You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This extension type allows apps to register a global action that is either displayed within the left sidebar (for desktop resolutions) or as a floating action button (for mobile resolutions). The extension point for this extension type is `global.floating-action-button`.
10
+
11
+
:::warning
12
+
You need to take care of the visibility of your floating action button extension via the `isActive` property, otherwise you might end up overwriting other extensions' action buttons. In most cases, it makes sense to only display the button when your app is currently active.
13
+
:::
14
+
15
+
### Configuration
16
+
17
+
To define a floating action button extension, you implement the `FloatingActionButtonExtension` interface. Here's what it looks like:
18
+
19
+
```typescript
20
+
interfaceFloatingActionButtonExtension {
21
+
id:string;
22
+
type:'floatingActionButton';
23
+
extensionPointIds?:string[];
24
+
label: () =>string;
25
+
isActive: () =>boolean;
26
+
isDisabled?: () =>boolean;
27
+
color?:string;
28
+
icon?:string;
29
+
mode: () =>'drop'|'handler';
30
+
handler?: () =>Promise<void> |void;
31
+
dropComponent?:Component;
32
+
}
33
+
```
34
+
35
+
For `id`, `type`, and `extensionPointIds`, please see [extension base section](../#extension-base-configuration) in the top level docs.
36
+
37
+
The `mode` property determines whether the floating action button triggers a handler function or renders a `dropComponent` when clicked. If mode returns `handler`, the click handler function is executed, if it returns `drop`, the specified `dropComponent` is shown instead.
38
+
39
+
`isDisabled` controls the disabled state of the button whereas `isActive` determines if the button is showing at all.
40
+
41
+
`icon` is an icon name string that can be picked from [Remix Icon](https://remixicon.com/).
42
+
43
+
### Example
44
+
45
+
The following example shows how the files app is registering a floating action button extension for creating new files or folders. Note that the example assumes you're in a Vue injection context (e.g. within the `setup` method of your app's `defineWebApplication` call).
Copy file name to clipboardExpand all lines: docs/dev/web/extension-system/index.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,8 @@ For building an extension you can choose from the types predefined by the OpenCl
114
114
For details, please refer to the [folder view docs](./extension-types/folder-view-extensions).
115
115
6.`CustomComponentExtension` (type `customComponent`) - An extension that can register a custom component for a render target. For details, please refer to the
7.`FloatingActionButtonExtension` (type `floatingActionButton`) - An extension that can register a global action that is either displayed within the left sidebar (for desktop resolutions) or as a floating action button (for mobile resolutions). For details, please refer to the
You're free to introduce your own extension types within your application code and use the extension registry to query the available ones. However, if you have the impression
119
121
that an important extension type is missing and would be beneficial for the platform, please reach out to us by opening a [GitHub issue](https://github.com/opencloud-eu/web/issues/new/choose).
@@ -140,9 +142,16 @@ your extension will be used automatically.
140
142
1. Left Sidebar for Navigation. ExtensionPointId `app.${appName}.navItems` (dynamically created for each app). Mounts extensions of type `sidebarNav`.
141
143
2. Global top bar
142
144
1. Center area. ExtensionPointId `app.runtime.header.center`. Mounts extensions of type `customComponent`.
143
-
2. Progress bar for the global loading state. ExtensionPointId `app.runtime.global-progress-bar`. Mounts a single extensions of type `customComponent`. If multiple exist, the user can choose via the account page.
145
+
2. Left area. ExtensionPointId `app.runtime.header.left`. Mounts extensions of type `customComponent`.
146
+
3. Right area. ExtensionPointId `app.runtime.header.right`. Mounts extensions of type `customComponent`.
147
+
4. Progress bar for the global loading state. ExtensionPointId `app.runtime.global-progress-bar`. Mounts a single extension of type `customComponent`. If multiple exist, the user can choose via the account page.
144
148
3. Files app
145
-
1. Right sidebar. ExtensionPointId `app.files.sidebar`. Mounts extensions of type `sidebarPanel`. Used in any file(s) context (files app, file viewer apps, file editor apps).
149
+
1. Right sidebar.
150
+
1. Panels. ExtensionPointId `app.files.sidebar`. Mounts extensions of type `sidebarPanel`. Used in any file(s) context (files app, file viewer apps, file editor apps).
151
+
2. File details table. ExtensionPointId `app.files.sidebar.file-details.table`. Mounts extensions of type `customComponent`. Properties `space` and `resource` can be retrieved via injection context.
152
+
3. Space details table. ExtensionPointId `app.files.sidebar.space-details.table`. Mounts extensions of type `customComponent`. Properties `space` and `resource` can be retrieved via injection context.
153
+
4. Shares panel people list top section. ExtensionPointId `app.files.sidebar.shares-panel.shared-with.top`. Mounts extensions of type `customComponent`. Properties `space` and `resource` can be retrieved via injection context.
154
+
5. Shares panel people list bottom section. ExtensionPointId `app.files.sidebar.shares-panel.shared-with.bottom`. Mounts extensions of type `customComponent`. Properties `space` and `resource` can be retrieved via injection context.
146
155
2. Folder views for regular folders. ExtensionPointId `app.files.folder-views.folder`. Mounts extensions of type `folderView`.
147
156
3. Folder views for the project spaces overview. ExtensionPointId `app.files.folder-views.project-spaces`. Mounts extensions of type `folderView`.
148
157
4. Folder views for the favorites page. ExtensionPointId `app.files.folder-views.favorites`. Mounts extensions of type `folderView`.
@@ -154,6 +163,7 @@ your extension will be used automatically.
154
163
10. Quick actions for the trash overview. ExtensionPointId `app.files.trash-quick-actions`. Mounts extensions of type `action`.
155
164
4. Global search providers. ExtensionPointId `app.search.providers`. Utilizes extensions of type `search` as search engines for the search input in the global top bar.
156
165
5. User preference panels. ExtensionPointId `app.runtime.preferences.panels`. Mounts extensions of type `customComponent`.
166
+
6. Global Floating Action button. ExtensionPointId `global.floating-action-button`. Mounts extensions of type `floatingActionButton`.
0 commit comments