@limetech/lime-web-components 4.48.2 → 4.49.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -1
- package/README.md +1 -1
- package/dist/application/decorators/application.d.ts +8 -0
- package/dist/application/decorators/application.js +18 -0
- package/dist/application/decorators/index.d.ts +3 -0
- package/dist/application/decorators/index.js +3 -0
- package/dist/application/decorators/session.d.ts +8 -0
- package/dist/application/decorators/session.js +18 -0
- package/dist/application/decorators/user.d.ts +8 -0
- package/dist/application/decorators/user.js +18 -0
- package/dist/application/index.d.ts +4 -0
- package/dist/application/index.js +4 -0
- package/dist/application/session.d.ts +67 -0
- package/dist/application/session.js +1 -0
- package/dist/application/types.d.ts +14 -0
- package/dist/application/types.js +3 -0
- package/dist/application/user.d.ts +59 -0
- package/dist/application/user.js +1 -0
- package/dist/commandbus/commandbus.d.ts +112 -0
- package/dist/commandbus/commandbus.js +63 -0
- package/dist/commandbus/index.d.ts +2 -0
- package/dist/commandbus/index.js +2 -0
- package/dist/commandbus/types.d.ts +14 -0
- package/dist/commandbus/types.js +3 -0
- package/dist/config/decorator.d.ts +14 -0
- package/dist/config/decorator.js +14 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +3 -0
- package/dist/config/repository.d.ts +17 -0
- package/dist/config/repository.js +1 -0
- package/dist/config/types.d.ts +14 -0
- package/dist/config/types.js +3 -0
- package/dist/core/context.d.ts +17 -0
- package/dist/core/context.js +1 -0
- package/dist/core/decorators/factory.d.ts +29 -0
- package/dist/core/decorators/factory.js +243 -0
- package/dist/core/decorators/factory.spec.d.ts +1 -0
- package/dist/core/decorators/factory.spec.js +337 -0
- package/dist/core/decorators/index.d.ts +1 -0
- package/dist/core/decorators/index.js +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/lime-web-component.d.ts +15 -0
- package/dist/core/lime-web-component.js +1 -0
- package/dist/core/platform.d.ts +38 -0
- package/dist/core/platform.js +6 -0
- package/dist/core/plugin-loader.d.ts +28 -0
- package/dist/core/plugin-loader.js +1 -0
- package/dist/core/state.d.ts +39 -0
- package/dist/core/state.js +1 -0
- package/dist/device/decorator.d.ts +16 -0
- package/dist/device/decorator.js +16 -0
- package/dist/device/device.d.ts +21 -0
- package/dist/device/device.js +1 -0
- package/dist/device/index.d.ts +3 -0
- package/dist/device/index.js +3 -0
- package/dist/device/types.d.ts +14 -0
- package/dist/device/types.js +3 -0
- package/dist/dialog/dialog.d.ts +41 -0
- package/dist/dialog/dialog.js +1 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/types.d.ts +14 -0
- package/dist/dialog/types.js +3 -0
- package/dist/es5/application/decorators/application.js +18 -0
- package/dist/es5/application/decorators/index.js +6 -0
- package/dist/es5/application/decorators/session.js +18 -0
- package/dist/es5/application/decorators/user.js +18 -0
- package/dist/es5/application/index.js +7 -0
- package/dist/es5/application/session.js +2 -0
- package/dist/es5/application/types.js +5 -0
- package/dist/es5/application/user.js +2 -0
- package/dist/es5/commandbus/commandbus.js +31 -0
- package/dist/es5/commandbus/index.js +5 -0
- package/dist/es5/commandbus/types.js +5 -0
- package/dist/es5/config/decorator.js +12 -0
- package/dist/es5/config/index.js +6 -0
- package/dist/es5/config/repository.js +2 -0
- package/dist/es5/config/types.js +5 -0
- package/dist/es5/core/context.js +2 -0
- package/dist/es5/core/decorators/factory.js +213 -0
- package/dist/es5/core/decorators/factory.spec.js +495 -0
- package/dist/es5/core/decorators/index.js +2 -0
- package/dist/es5/core/index.js +9 -0
- package/dist/es5/core/lime-web-component.js +2 -0
- package/dist/es5/core/platform.js +6 -0
- package/dist/es5/core/plugin-loader.js +2 -0
- package/dist/es5/core/state.js +2 -0
- package/dist/es5/device/decorator.js +13 -0
- package/dist/es5/device/device.js +2 -0
- package/dist/es5/device/index.js +6 -0
- package/dist/es5/device/types.js +5 -0
- package/dist/es5/dialog/dialog.js +2 -0
- package/dist/es5/dialog/index.js +5 -0
- package/dist/es5/dialog/types.js +5 -0
- package/dist/es5/eventdispatcher/eventdispatcher.js +2 -0
- package/dist/es5/eventdispatcher/index.js +5 -0
- package/dist/es5/eventdispatcher/types.js +5 -0
- package/dist/es5/filter/decorator.js +13 -0
- package/dist/es5/filter/index.js +6 -0
- package/dist/es5/filter/repository.js +2 -0
- package/dist/es5/filter/types.js +5 -0
- package/dist/es5/http/http.js +2 -0
- package/dist/es5/http/index.js +5 -0
- package/dist/es5/http/types.js +5 -0
- package/dist/es5/index.js +22 -0
- package/dist/es5/keybindings/index.js +5 -0
- package/dist/es5/keybindings/registry.js +2 -0
- package/dist/es5/keybindings/types.js +5 -0
- package/dist/es5/limeobject/commands/bulk-create-dialog.js +17 -0
- package/dist/es5/limeobject/commands/create-dialog.js +17 -0
- package/dist/es5/limeobject/commands/delete-object.js +16 -0
- package/dist/es5/limeobject/commands/index.js +8 -0
- package/dist/es5/limeobject/commands/object-access.js +16 -0
- package/dist/es5/limeobject/commands/save-object.js +17 -0
- package/dist/es5/limeobject/decorator.js +38 -0
- package/dist/es5/limeobject/error.js +2 -0
- package/dist/es5/limeobject/index.js +9 -0
- package/dist/es5/limeobject/limeobject.js +2 -0
- package/dist/es5/limeobject/repository.js +2 -0
- package/dist/es5/limeobject/types.js +5 -0
- package/dist/es5/limetype/acl.js +2 -0
- package/dist/es5/limetype/decorator.js +28 -0
- package/dist/es5/limetype/index.js +8 -0
- package/dist/es5/limetype/limetype.js +2 -0
- package/dist/es5/limetype/property.js +40 -0
- package/dist/es5/limetype/types.js +5 -0
- package/dist/es5/navigator/decorator.js +13 -0
- package/dist/es5/navigator/index.js +6 -0
- package/dist/es5/navigator/navigator.js +2 -0
- package/dist/es5/navigator/types.js +5 -0
- package/dist/es5/notifications/index.js +5 -0
- package/dist/es5/notifications/notifications.js +2 -0
- package/dist/es5/notifications/types.js +5 -0
- package/dist/es5/query/index.js +6 -0
- package/dist/es5/query/query.js +17 -0
- package/dist/es5/query/service.js +2 -0
- package/dist/es5/query/types.js +5 -0
- package/dist/es5/routeregistry/index.js +5 -0
- package/dist/es5/routeregistry/registry.js +2 -0
- package/dist/es5/routeregistry/types.js +5 -0
- package/dist/es5/task/index.js +5 -0
- package/dist/es5/task/repository.js +17 -0
- package/dist/es5/task/types.js +5 -0
- package/dist/es5/testing/component-testing.js +102 -0
- package/dist/es5/testing/index.js +10 -0
- package/dist/es5/testing/limeobjects/company.js +660 -0
- package/dist/es5/testing/limeobjects/coworker.js +110 -0
- package/dist/es5/testing/limeobjects/deal.js +447 -0
- package/dist/es5/testing/limeobjects/document.js +82 -0
- package/dist/es5/testing/limeobjects/index.js +55 -0
- package/dist/es5/testing/limeobjects/person.js +1162 -0
- package/dist/es5/testing/limetypes/campaign.js +486 -0
- package/dist/es5/testing/limetypes/company.js +621 -0
- package/dist/es5/testing/limetypes/consent.js +237 -0
- package/dist/es5/testing/limetypes/consenttype.js +194 -0
- package/dist/es5/testing/limetypes/coworker.js +579 -0
- package/dist/es5/testing/limetypes/deal.js +422 -0
- package/dist/es5/testing/limetypes/document.js +343 -0
- package/dist/es5/testing/limetypes/helpdesk.js +426 -0
- package/dist/es5/testing/limetypes/helpdesktype.js +142 -0
- package/dist/es5/testing/limetypes/history.js +349 -0
- package/dist/es5/testing/limetypes/index.js +69 -0
- package/dist/es5/testing/limetypes/infotiles.js +514 -0
- package/dist/es5/testing/limetypes/localize.js +287 -0
- package/dist/es5/testing/limetypes/mailing.js +218 -0
- package/dist/es5/testing/limetypes/office.js +388 -0
- package/dist/es5/testing/limetypes/participant.js +195 -0
- package/dist/es5/testing/limetypes/person.js +535 -0
- package/dist/es5/testing/limetypes/recipient.js +175 -0
- package/dist/es5/testing/limetypes/solutionimprovement.js +353 -0
- package/dist/es5/testing/limetypes/successplan.js +215 -0
- package/dist/es5/testing/limetypes/target.js +181 -0
- package/dist/es5/testing/limetypes/todo.js +429 -0
- package/dist/es5/testing/platform/index.js +53 -0
- package/dist/es5/testing/platform/platform.spec.js +44 -0
- package/dist/es5/translator/index.js +5 -0
- package/dist/es5/translator/translator.js +2 -0
- package/dist/es5/translator/types.js +5 -0
- package/dist/es5/userdata/decorator.js +13 -0
- package/dist/es5/userdata/index.js +6 -0
- package/dist/es5/userdata/repository.js +2 -0
- package/dist/es5/userdata/types.js +5 -0
- package/dist/eventdispatcher/eventdispatcher.d.ts +26 -0
- package/dist/eventdispatcher/eventdispatcher.js +1 -0
- package/dist/eventdispatcher/index.d.ts +2 -0
- package/dist/eventdispatcher/index.js +2 -0
- package/dist/eventdispatcher/types.d.ts +14 -0
- package/dist/eventdispatcher/types.js +3 -0
- package/dist/filter/decorator.d.ts +15 -0
- package/dist/filter/decorator.js +14 -0
- package/dist/filter/index.d.ts +3 -0
- package/dist/filter/index.js +3 -0
- package/dist/filter/repository.d.ts +18 -0
- package/dist/filter/repository.js +1 -0
- package/dist/filter/types.d.ts +14 -0
- package/dist/filter/types.js +3 -0
- package/dist/http/http.d.ts +72 -0
- package/dist/http/http.js +1 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.js +2 -0
- package/dist/http/types.d.ts +14 -0
- package/dist/http/types.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/keybindings/index.d.ts +2 -0
- package/dist/keybindings/index.js +2 -0
- package/dist/keybindings/registry.d.ts +79 -0
- package/dist/keybindings/registry.js +1 -0
- package/dist/keybindings/types.d.ts +17 -0
- package/dist/keybindings/types.js +3 -0
- package/dist/limeobject/commands/bulk-create-dialog.d.ts +49 -0
- package/dist/limeobject/commands/bulk-create-dialog.js +48 -0
- package/dist/limeobject/commands/create-dialog.d.ts +28 -0
- package/dist/limeobject/commands/create-dialog.js +26 -0
- package/dist/limeobject/commands/delete-object.d.ts +10 -0
- package/dist/limeobject/commands/delete-object.js +15 -0
- package/dist/limeobject/commands/index.d.ts +5 -0
- package/dist/limeobject/commands/index.js +5 -0
- package/dist/limeobject/commands/object-access.d.ts +10 -0
- package/dist/limeobject/commands/object-access.js +15 -0
- package/dist/limeobject/commands/save-object.d.ts +16 -0
- package/dist/limeobject/commands/save-object.js +21 -0
- package/dist/limeobject/decorator.d.ts +32 -0
- package/dist/limeobject/decorator.js +42 -0
- package/dist/limeobject/error.d.ts +4 -0
- package/dist/limeobject/error.js +1 -0
- package/dist/limeobject/index.d.ts +6 -0
- package/dist/limeobject/index.js +6 -0
- package/dist/limeobject/limeobject.d.ts +43 -0
- package/dist/limeobject/limeobject.js +1 -0
- package/dist/limeobject/repository.d.ts +113 -0
- package/dist/limeobject/repository.js +1 -0
- package/dist/limeobject/types.d.ts +14 -0
- package/dist/limeobject/types.js +3 -0
- package/dist/limetype/acl.d.ts +6 -0
- package/dist/limetype/acl.js +1 -0
- package/dist/limetype/decorator.d.ts +21 -0
- package/dist/limetype/decorator.js +32 -0
- package/dist/limetype/index.d.ts +5 -0
- package/dist/limetype/index.js +5 -0
- package/dist/limetype/limetype.d.ts +25 -0
- package/dist/limetype/limetype.js +1 -0
- package/dist/limetype/property.d.ts +32 -0
- package/dist/limetype/property.js +32 -0
- package/dist/limetype/types.d.ts +14 -0
- package/dist/limetype/types.js +3 -0
- package/dist/navigator/decorator.d.ts +18 -0
- package/dist/navigator/decorator.js +15 -0
- package/dist/navigator/index.d.ts +3 -0
- package/dist/navigator/index.js +3 -0
- package/dist/navigator/navigator.d.ts +158 -0
- package/dist/navigator/navigator.js +1 -0
- package/dist/navigator/types.d.ts +17 -0
- package/dist/navigator/types.js +3 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/notifications.d.ts +101 -0
- package/dist/notifications/notifications.js +1 -0
- package/dist/notifications/types.d.ts +14 -0
- package/dist/notifications/types.js +3 -0
- package/dist/query/index.d.ts +3 -0
- package/dist/query/index.js +3 -0
- package/dist/query/query.d.ts +46 -0
- package/dist/query/query.js +14 -0
- package/dist/query/service.d.ts +12 -0
- package/dist/query/service.js +1 -0
- package/dist/query/types.d.ts +14 -0
- package/dist/query/types.js +3 -0
- package/dist/routeregistry/index.d.ts +2 -0
- package/dist/routeregistry/index.js +2 -0
- package/dist/routeregistry/registry.d.ts +92 -0
- package/dist/routeregistry/registry.js +1 -0
- package/dist/routeregistry/types.d.ts +17 -0
- package/dist/routeregistry/types.js +3 -0
- package/dist/task/index.d.ts +2 -0
- package/dist/task/index.js +2 -0
- package/dist/task/repository.d.ts +82 -0
- package/dist/task/repository.js +49 -0
- package/dist/task/types.d.ts +14 -0
- package/dist/task/types.js +3 -0
- package/dist/testing/component-testing.d.ts +53 -0
- package/dist/testing/component-testing.js +162 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/limeobjects/company.d.ts +55 -0
- package/dist/testing/limeobjects/company.js +656 -0
- package/dist/testing/limeobjects/coworker.d.ts +22 -0
- package/dist/testing/limeobjects/coworker.js +106 -0
- package/dist/testing/limeobjects/deal.d.ts +41 -0
- package/dist/testing/limeobjects/deal.js +443 -0
- package/dist/testing/limeobjects/document.d.ts +20 -0
- package/dist/testing/limeobjects/document.js +78 -0
- package/dist/testing/limeobjects/index.d.ts +177 -0
- package/dist/testing/limeobjects/index.js +50 -0
- package/dist/testing/limeobjects/person.d.ts +20 -0
- package/dist/testing/limeobjects/person.js +1158 -0
- package/dist/testing/limetypes/campaign.d.ts +417 -0
- package/dist/testing/limetypes/campaign.js +477 -0
- package/dist/testing/limetypes/company.d.ts +591 -0
- package/dist/testing/limetypes/company.js +614 -0
- package/dist/testing/limetypes/consent.d.ts +199 -0
- package/dist/testing/limetypes/consent.js +232 -0
- package/dist/testing/limetypes/consenttype.d.ts +188 -0
- package/dist/testing/limetypes/consenttype.js +189 -0
- package/dist/testing/limetypes/coworker.d.ts +563 -0
- package/dist/testing/limetypes/coworker.js +564 -0
- package/dist/testing/limetypes/deal.d.ts +391 -0
- package/dist/testing/limetypes/deal.js +419 -0
- package/dist/testing/limetypes/document.d.ts +309 -0
- package/dist/testing/limetypes/document.js +332 -0
- package/dist/testing/limetypes/helpdesk.d.ts +394 -0
- package/dist/testing/limetypes/helpdesk.js +417 -0
- package/dist/testing/limetypes/helpdesktype.d.ts +136 -0
- package/dist/testing/limetypes/helpdesktype.js +137 -0
- package/dist/testing/limetypes/history.d.ts +308 -0
- package/dist/testing/limetypes/history.js +346 -0
- package/dist/testing/limetypes/index.d.ts +5 -0
- package/dist/testing/limetypes/index.js +63 -0
- package/dist/testing/limetypes/infotiles.d.ts +387 -0
- package/dist/testing/limetypes/infotiles.js +509 -0
- package/dist/testing/limetypes/localize.d.ts +283 -0
- package/dist/testing/limetypes/localize.js +284 -0
- package/dist/testing/limetypes/mailing.d.ts +212 -0
- package/dist/testing/limetypes/mailing.js +213 -0
- package/dist/testing/limetypes/office.d.ts +384 -0
- package/dist/testing/limetypes/office.js +385 -0
- package/dist/testing/limetypes/participant.d.ts +165 -0
- package/dist/testing/limetypes/participant.js +188 -0
- package/dist/testing/limetypes/person.d.ts +472 -0
- package/dist/testing/limetypes/person.js +530 -0
- package/dist/testing/limetypes/recipient.d.ts +147 -0
- package/dist/testing/limetypes/recipient.js +170 -0
- package/dist/testing/limetypes/solutionimprovement.d.ts +302 -0
- package/dist/testing/limetypes/solutionimprovement.js +344 -0
- package/dist/testing/limetypes/successplan.d.ts +209 -0
- package/dist/testing/limetypes/successplan.js +210 -0
- package/dist/testing/limetypes/target.d.ts +160 -0
- package/dist/testing/limetypes/target.js +178 -0
- package/dist/testing/limetypes/todo.d.ts +386 -0
- package/dist/testing/limetypes/todo.js +426 -0
- package/dist/testing/platform/index.d.ts +8 -0
- package/dist/testing/platform/index.js +61 -0
- package/dist/testing/platform/platform.spec.d.ts +1 -0
- package/dist/testing/platform/platform.spec.js +41 -0
- package/dist/translator/index.d.ts +2 -0
- package/dist/translator/index.js +2 -0
- package/dist/translator/translator.d.ts +13 -0
- package/dist/translator/translator.js +1 -0
- package/dist/translator/types.d.ts +14 -0
- package/dist/translator/types.js +3 -0
- package/dist/userdata/decorator.d.ts +17 -0
- package/dist/userdata/decorator.js +14 -0
- package/dist/userdata/index.d.ts +3 -0
- package/dist/userdata/index.js +3 -0
- package/dist/userdata/repository.d.ts +29 -0
- package/dist/userdata/repository.js +1 -0
- package/dist/userdata/types.d.ts +14 -0
- package/dist/userdata/types.js +3 -0
- package/package.json +11 -6
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The {@link Navigator} service lets you navigate to a new location within the
|
|
3
|
+
* application, or update the current location with new data. A location is
|
|
4
|
+
* defined by a path and optional data.
|
|
5
|
+
*
|
|
6
|
+
* When navigating to a new location, a new entry will be pushed to the history
|
|
7
|
+
* stack in the browser and the {@link EventDispatcher} will emit a
|
|
8
|
+
* {@link NavigationEvent}.
|
|
9
|
+
*
|
|
10
|
+
* New locations can be registered using the {@link RouteRegistry} service
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Listen on navigation events
|
|
14
|
+
* eventDispatcher.addListener('navigate', onNavigate);
|
|
15
|
+
* navigator.navigate('/object/deal/1001');
|
|
16
|
+
*
|
|
17
|
+
* function onNavigate(event: NavigationEvent) {
|
|
18
|
+
* console.log(event.detail);
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* @experimental
|
|
22
|
+
*/
|
|
23
|
+
export interface Navigator {
|
|
24
|
+
/**
|
|
25
|
+
* Navigate to a new location
|
|
26
|
+
*
|
|
27
|
+
* @emits navigate - When the location has been changed the
|
|
28
|
+
* {@link EventDispatcher} will emit a {@link NavigationEvent}
|
|
29
|
+
*
|
|
30
|
+
* @param {string} path path to the location
|
|
31
|
+
* @param query query string parameters to append to the URL
|
|
32
|
+
*/
|
|
33
|
+
navigate(path: string, query?: Location['query']): void;
|
|
34
|
+
/**
|
|
35
|
+
* Navigate to a new location or update the current location with new data
|
|
36
|
+
*
|
|
37
|
+
* By default, it is automatically decided whether to replace the current
|
|
38
|
+
* history entry or push a new one. If no new path is provided, or if it
|
|
39
|
+
* resolves to an unchanged path of the URL (not including the query string
|
|
40
|
+
* or fragment), the current history entry will be updated with the
|
|
41
|
+
* provided location data.
|
|
42
|
+
*
|
|
43
|
+
* You can also set `location.method` to push or replace instead.
|
|
44
|
+
* When pushing a new entry, `location.state` defaults to `null`.
|
|
45
|
+
* When replacing, state will only be changed if a new value is provided.
|
|
46
|
+
*
|
|
47
|
+
* @emits navigate - When the location has been changed the
|
|
48
|
+
* {@link EventDispatcherService} will emit a {@link NavigationEvent}
|
|
49
|
+
*
|
|
50
|
+
* @param location a new location or parts of the location to replace
|
|
51
|
+
*/
|
|
52
|
+
navigate(location: LocationChange): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get the current location
|
|
55
|
+
*
|
|
56
|
+
* @return {Location}
|
|
57
|
+
*/
|
|
58
|
+
getLocation(): Location;
|
|
59
|
+
/**
|
|
60
|
+
* Add a blocker that can prevent navigation away from the current page, for
|
|
61
|
+
* example when there is some unsaved data that would otherwise be discarded.
|
|
62
|
+
*
|
|
63
|
+
* If the blocker function returns true navigation is blocked. If it returns
|
|
64
|
+
* false navigation will proceed as normal, if not blocked by other blockers.
|
|
65
|
+
*
|
|
66
|
+
* To later on resume navigation that was blocked, you can call the supplied
|
|
67
|
+
* {@link Transition.retry} method.
|
|
68
|
+
*
|
|
69
|
+
* @note Blockers are not guaranteed to be executed upon a navigation event.
|
|
70
|
+
* Blockers will be executed until either all returns false or up until one
|
|
71
|
+
* of them returns true.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* navigator.addBlocker(myBlocker);
|
|
75
|
+
*
|
|
76
|
+
* function myBlocker(transition) {
|
|
77
|
+
* showConfirmDialog().then((shouldNavigate) => {
|
|
78
|
+
* if (shouldNavigate) {
|
|
79
|
+
* navigator.removeBlocker(myBlocker);
|
|
80
|
+
* transition.retry()
|
|
81
|
+
* }
|
|
82
|
+
* });
|
|
83
|
+
* return true;
|
|
84
|
+
* }
|
|
85
|
+
*
|
|
86
|
+
* @param {Blocker} blocker function to be called before navigation
|
|
87
|
+
*/
|
|
88
|
+
addBlocker(blocker: Blocker): void;
|
|
89
|
+
/**
|
|
90
|
+
* Removes a previously configured blocker.
|
|
91
|
+
*
|
|
92
|
+
* @param {Blocker} blocker previously added blocker function
|
|
93
|
+
*/
|
|
94
|
+
removeBlocker(blocker: Blocker): void;
|
|
95
|
+
/**
|
|
96
|
+
* Create a URL for the given location
|
|
97
|
+
*
|
|
98
|
+
* @param {Partial<Location>} location the location to create a URL for.
|
|
99
|
+
* Any `state` of the location will be ignored.
|
|
100
|
+
*
|
|
101
|
+
* @return {URL} the URL to the location
|
|
102
|
+
*/
|
|
103
|
+
createUrl(location: Partial<Location>): URL;
|
|
104
|
+
}
|
|
105
|
+
export declare type Location = {
|
|
106
|
+
/**
|
|
107
|
+
* The path to the location
|
|
108
|
+
*/
|
|
109
|
+
path: string;
|
|
110
|
+
/**
|
|
111
|
+
* The parsed query string parameters. The values are parsed using `JSON.parse()`.
|
|
112
|
+
*/
|
|
113
|
+
query: Record<string, unknown>;
|
|
114
|
+
/**
|
|
115
|
+
* The URL fragment identifier, beginning with a #.
|
|
116
|
+
*/
|
|
117
|
+
hash: string;
|
|
118
|
+
/**
|
|
119
|
+
* The history state.
|
|
120
|
+
*/
|
|
121
|
+
state: unknown;
|
|
122
|
+
};
|
|
123
|
+
export declare type LocationChange = Partial<Location> & {
|
|
124
|
+
/**
|
|
125
|
+
* Specifies whether to push a new entry or replace the current entry in
|
|
126
|
+
* the history stack
|
|
127
|
+
*/
|
|
128
|
+
method?: 'push' | 'replace';
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @event navigate - Emitted when a new location is navigated to or the current
|
|
132
|
+
* location is updated
|
|
133
|
+
*/
|
|
134
|
+
export declare type NavigationEvent = CustomEvent<Location>;
|
|
135
|
+
/**
|
|
136
|
+
* Function to retry navigation
|
|
137
|
+
*/
|
|
138
|
+
export declare type Retry = () => void;
|
|
139
|
+
/**
|
|
140
|
+
* {@link Transition} describes the transition when navigating from a
|
|
141
|
+
* {@link Location} to another {@link Location}.
|
|
142
|
+
*
|
|
143
|
+
* @param {Location} to location to navigate to
|
|
144
|
+
* @param {Location} from current location before navigation
|
|
145
|
+
* @param {Retry} retry function to retry navigation
|
|
146
|
+
*/
|
|
147
|
+
export declare type Transition = {
|
|
148
|
+
to: Location;
|
|
149
|
+
from: Location;
|
|
150
|
+
retry: Retry;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Function to determine if navigation should be blocked or not.
|
|
154
|
+
*
|
|
155
|
+
* @param {Transition} transition the transition to evaluate
|
|
156
|
+
* @returns true if navigation should be blocked
|
|
157
|
+
*/
|
|
158
|
+
export declare type Blocker = (transition: Transition) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Navigator as Service } from './navigator';
|
|
2
|
+
declare const SERVICE_NAME = "navigator";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceName {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link Service Navigator}
|
|
7
|
+
*
|
|
8
|
+
* @note Work in progress, do not use!
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
Navigator: typeof SERVICE_NAME;
|
|
12
|
+
}
|
|
13
|
+
interface LimeWebComponentPlatform {
|
|
14
|
+
get(name: PlatformServiceName['Navigator']): Service;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for displaying different notification messages
|
|
3
|
+
*/
|
|
4
|
+
export interface Notifications {
|
|
5
|
+
/**
|
|
6
|
+
* Display a blocking alert dialog
|
|
7
|
+
*
|
|
8
|
+
* @param {string} title title of the dialog
|
|
9
|
+
* @param {string} message message to display in the dialog
|
|
10
|
+
* @param {AlertOptions} options
|
|
11
|
+
* @returns {Promise<void>} a promise that will be resolved when the dialog is closed
|
|
12
|
+
*/
|
|
13
|
+
alert(title: string, message: string, options?: AlertOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Display a blocking confirm dialog
|
|
16
|
+
*
|
|
17
|
+
* @param {string} title title of the dialog
|
|
18
|
+
* @param {string} message message to display in the dialog
|
|
19
|
+
* @param {ConfirmOptions} options
|
|
20
|
+
* @returns {Promise<boolean>} a promise that will be resolved to true when the dialog is closed.
|
|
21
|
+
* If the accepting button was pressed, the promise will resolve to true.
|
|
22
|
+
* Otherwise, the promise will resolve to false.
|
|
23
|
+
*/
|
|
24
|
+
confirm(title: string, message: string, options?: ConfirmOptions): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Display a non-blocking notification
|
|
27
|
+
*
|
|
28
|
+
* @param {string} message message to display in the notification
|
|
29
|
+
* @param {NotificationOptions} options
|
|
30
|
+
* @returns {Promise<boolean>} a promise that will be resolved when the notification is closed.
|
|
31
|
+
* If the notification has an action button and it was pressed, the promise will resolve to true.
|
|
32
|
+
* Otherwise, the promise will resolve to false.
|
|
33
|
+
*/
|
|
34
|
+
notify(message: string, options?: NotificationOptions): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Display a non-blocking and non-transient message
|
|
37
|
+
*
|
|
38
|
+
* @param {string} message message to display in the banner
|
|
39
|
+
* @param {ReportOptions} options
|
|
40
|
+
* @returns {Promise<boolean>} a promise that will be resolved when the notification is closed.
|
|
41
|
+
* If the notification has an action button and it was pressed, the promise will resolve to true.
|
|
42
|
+
* Otherwise, the promise will resolve to false.
|
|
43
|
+
*/
|
|
44
|
+
report(message: string, options?: ReportOptions): Promise<boolean>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for the confirmation dialog
|
|
48
|
+
*/
|
|
49
|
+
export interface AlertOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Text to display on the button
|
|
52
|
+
*/
|
|
53
|
+
acceptText?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Options for the confirmation dialog
|
|
57
|
+
*/
|
|
58
|
+
export interface ConfirmOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Text to display on the button for the accept action
|
|
61
|
+
*/
|
|
62
|
+
acceptText?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Text to display on the button for the cancel action
|
|
65
|
+
*/
|
|
66
|
+
cancelText?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Options for notifications
|
|
70
|
+
*/
|
|
71
|
+
export interface NotificationOptions {
|
|
72
|
+
/**
|
|
73
|
+
* Number of milliseconds to wait before the notification auto fades.
|
|
74
|
+
*/
|
|
75
|
+
timeout?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Text to display on the action button
|
|
78
|
+
*/
|
|
79
|
+
actionText?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Set to true to display the message on multiple lines
|
|
82
|
+
*/
|
|
83
|
+
multiline?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Set to true to make the notification dismissible
|
|
86
|
+
*/
|
|
87
|
+
dismissible?: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Options for reports
|
|
91
|
+
*/
|
|
92
|
+
export interface ReportOptions {
|
|
93
|
+
/**
|
|
94
|
+
* Text to display on the action button
|
|
95
|
+
*/
|
|
96
|
+
actionText?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Icon to display on the banner
|
|
99
|
+
*/
|
|
100
|
+
icon?: string;
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Notifications } from './notifications';
|
|
2
|
+
declare const SERVICE_NAME = "notifications";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceName {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link Notifications}
|
|
7
|
+
*/
|
|
8
|
+
Notification: typeof SERVICE_NAME;
|
|
9
|
+
}
|
|
10
|
+
interface LimeWebComponentPlatform {
|
|
11
|
+
get(name: PlatformServiceName['Notification']): Notifications;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface Query {
|
|
2
|
+
limetype: string;
|
|
3
|
+
limit?: number;
|
|
4
|
+
offset?: number;
|
|
5
|
+
orderBy?: object[];
|
|
6
|
+
filter?: Expression;
|
|
7
|
+
responseFormat: {
|
|
8
|
+
object?: object;
|
|
9
|
+
aggregates?: object;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface QueryResponse {
|
|
13
|
+
objects: any[];
|
|
14
|
+
aggregates: any;
|
|
15
|
+
}
|
|
16
|
+
export interface Expression {
|
|
17
|
+
key?: string;
|
|
18
|
+
op: Operator;
|
|
19
|
+
exp: any;
|
|
20
|
+
type?: 'filter';
|
|
21
|
+
}
|
|
22
|
+
export declare enum Operator {
|
|
23
|
+
AND = "AND",
|
|
24
|
+
OR = "OR",
|
|
25
|
+
EQUALS = "=",
|
|
26
|
+
NOT = "!",
|
|
27
|
+
GREATER = ">",
|
|
28
|
+
LESS = "<",
|
|
29
|
+
IN = "IN",
|
|
30
|
+
BEGINS = "=?",
|
|
31
|
+
LIKE = "?",
|
|
32
|
+
LESS_OR_EQUAL = "<=",
|
|
33
|
+
GREATER_OR_EQUAL = ">="
|
|
34
|
+
}
|
|
35
|
+
export interface Filter {
|
|
36
|
+
id: string;
|
|
37
|
+
limetype: string;
|
|
38
|
+
name: {
|
|
39
|
+
[language: string]: string;
|
|
40
|
+
};
|
|
41
|
+
filter: Expression;
|
|
42
|
+
description?: {
|
|
43
|
+
[language: string]: string;
|
|
44
|
+
};
|
|
45
|
+
iduser?: number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var Operator;
|
|
2
|
+
(function (Operator) {
|
|
3
|
+
Operator["AND"] = "AND";
|
|
4
|
+
Operator["OR"] = "OR";
|
|
5
|
+
Operator["EQUALS"] = "=";
|
|
6
|
+
Operator["NOT"] = "!";
|
|
7
|
+
Operator["GREATER"] = ">";
|
|
8
|
+
Operator["LESS"] = "<";
|
|
9
|
+
Operator["IN"] = "IN";
|
|
10
|
+
Operator["BEGINS"] = "=?";
|
|
11
|
+
Operator["LIKE"] = "?";
|
|
12
|
+
Operator["LESS_OR_EQUAL"] = "<=";
|
|
13
|
+
Operator["GREATER_OR_EQUAL"] = ">=";
|
|
14
|
+
})(Operator || (Operator = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Query, QueryResponse } from '../query';
|
|
2
|
+
/**
|
|
3
|
+
* Service for executing queries using the query objects API
|
|
4
|
+
*/
|
|
5
|
+
export interface QueryService {
|
|
6
|
+
/**
|
|
7
|
+
* Execute a query
|
|
8
|
+
*
|
|
9
|
+
* @param query
|
|
10
|
+
*/
|
|
11
|
+
execute(query: Query): Promise<QueryResponse>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryService } from './service';
|
|
2
|
+
declare const SERVICE_NAME = "query";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceName {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link QueryService}
|
|
7
|
+
*/
|
|
8
|
+
Query: typeof SERVICE_NAME;
|
|
9
|
+
}
|
|
10
|
+
interface LimeWebComponentPlatform {
|
|
11
|
+
get(name: PlatformServiceName['Query']): QueryService;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { LimeWebComponent } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* The {@link RouteRegistry} service lets you register new locations in the
|
|
4
|
+
* application specified by either a path or a path pattern. Once a location
|
|
5
|
+
* has been registered, it can be navigated to using the {@link Navigator}
|
|
6
|
+
* service.
|
|
7
|
+
*
|
|
8
|
+
* When registering a route, any parameters in the path will be used as props
|
|
9
|
+
* on the component when it is being rendered. Parameters will be of type
|
|
10
|
+
* `string`, when the parameter can be parsed as a number the type will instead
|
|
11
|
+
* be `number`. Components that are registered in the {@link RouteRegistry}
|
|
12
|
+
* should implement {@link RouteComponent}.
|
|
13
|
+
*
|
|
14
|
+
* @note Since components are assumed to implement {@link RouteComponent} some
|
|
15
|
+
* parameters can not be used as path parameters and some will have special
|
|
16
|
+
* meaning. Special handling will be used for parameters named `limetype` and
|
|
17
|
+
* `id` to create a {@link LimeWebComponentContext} for the component. `id` can
|
|
18
|
+
* be used on it's own, but will be used to create `context` if `limetype` is
|
|
19
|
+
* also present. The following should not be used since they are part of
|
|
20
|
+
* {@link RouteComponent}:
|
|
21
|
+
* - `platform`
|
|
22
|
+
* - `context`
|
|
23
|
+
* - `query`
|
|
24
|
+
* - `hash`
|
|
25
|
+
* - `state`
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Registering a simple route
|
|
29
|
+
* routeRegistry.registerRoute('/foo', 'foo-component');
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Registering a route with parameters
|
|
33
|
+
* // `name` will be used as a prop on the component when it renders
|
|
34
|
+
* routeRegistry.registerRoute('/foo/:name', 'foo-component');
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Registering a route with a context
|
|
38
|
+
* // The `context` prop of the component will have the values of the
|
|
39
|
+
* // `limetype` and `id` parameters
|
|
40
|
+
* routeRegistry.registerRoute('/foo/:limetype/:id', 'foo-component');
|
|
41
|
+
*
|
|
42
|
+
* @experimental
|
|
43
|
+
*/
|
|
44
|
+
export interface RouteRegistry {
|
|
45
|
+
/**
|
|
46
|
+
* Register a route for a component.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} pathPattern - path pattern used to match a component.
|
|
49
|
+
* For more information about URL patterns read [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API).
|
|
50
|
+
* @param {string} component - Name of the component to register for the
|
|
51
|
+
* specified pattern
|
|
52
|
+
*/
|
|
53
|
+
registerRoute(pathPattern: string, component: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Find the component for a given path.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} path - The path to match against.
|
|
58
|
+
* @return {MatchedComponent | undefined} the matched component along with
|
|
59
|
+
* path parameters, or `undefined` if no component could be found.
|
|
60
|
+
*/
|
|
61
|
+
findComponent(path: string): MatchedComponent | undefined;
|
|
62
|
+
}
|
|
63
|
+
export declare type MatchedComponent = {
|
|
64
|
+
/**
|
|
65
|
+
* The name of the component.
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* Matched path parameters.
|
|
70
|
+
*/
|
|
71
|
+
props: Record<string, string | number>;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Interface for components that are routed to and are registered with the
|
|
75
|
+
* {@link RouteRegistry} service.
|
|
76
|
+
*
|
|
77
|
+
* @experimental
|
|
78
|
+
*/
|
|
79
|
+
export interface RouteComponent extends LimeWebComponent {
|
|
80
|
+
/**
|
|
81
|
+
* Query parameters from the route URL
|
|
82
|
+
*/
|
|
83
|
+
query?: Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* The URL fragment identifier
|
|
86
|
+
*/
|
|
87
|
+
hash?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The history state
|
|
90
|
+
*/
|
|
91
|
+
state?: unknown;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RouteRegistry as Service } from './registry';
|
|
2
|
+
declare const SERVICE_NAME = "routeRegistry";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceName {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link Service RouteRegistry}
|
|
7
|
+
*
|
|
8
|
+
* @note Work in progress, do not use!
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
RouteRegistry: typeof SERVICE_NAME;
|
|
12
|
+
}
|
|
13
|
+
interface LimeWebComponentPlatform {
|
|
14
|
+
get(name: PlatformServiceName['RouteRegistry']): Service;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { StateRepository } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* Service for creating background tasks
|
|
4
|
+
*/
|
|
5
|
+
export interface TaskRepository extends StateRepository {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new background task
|
|
8
|
+
*
|
|
9
|
+
* @param url url to the resource that will create the task
|
|
10
|
+
* @param data task specific data
|
|
11
|
+
* @param cancelAction true to allow task creation to be cancelled
|
|
12
|
+
* @param message notification message to display before the task is created instead of the default one
|
|
13
|
+
* @returns a promise that resolves to the id of the task if it was created successfully
|
|
14
|
+
*/
|
|
15
|
+
create(url: string, data: any, cancelAction?: boolean, message?: string): Promise<string | void>;
|
|
16
|
+
/**
|
|
17
|
+
* Get status about specific tasks
|
|
18
|
+
*
|
|
19
|
+
* @param ids the ids of the tasks to check
|
|
20
|
+
* @returns a promise that resolves to the status about the tasks
|
|
21
|
+
*/
|
|
22
|
+
getStatus(ids: string[]): Promise<TaskStatus[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare enum TaskState {
|
|
25
|
+
/**
|
|
26
|
+
* Task state is unknown
|
|
27
|
+
*/
|
|
28
|
+
Pending = "PENDING",
|
|
29
|
+
/**
|
|
30
|
+
* Task was started by a worker
|
|
31
|
+
*/
|
|
32
|
+
Started = "STARTED",
|
|
33
|
+
/**
|
|
34
|
+
* Task is waiting for retry
|
|
35
|
+
*/
|
|
36
|
+
Retry = "RETRY",
|
|
37
|
+
/**
|
|
38
|
+
* Task succeeded
|
|
39
|
+
*/
|
|
40
|
+
Success = "SUCCESS",
|
|
41
|
+
/**
|
|
42
|
+
* Task failed
|
|
43
|
+
*/
|
|
44
|
+
Failure = "FAILURE"
|
|
45
|
+
}
|
|
46
|
+
export interface TaskStatus {
|
|
47
|
+
/**
|
|
48
|
+
* ID of the task
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* The state of the task
|
|
53
|
+
*/
|
|
54
|
+
status: TaskState;
|
|
55
|
+
/**
|
|
56
|
+
* The result of the task once it has finished its execution
|
|
57
|
+
*/
|
|
58
|
+
result?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Events dispatched by the task service
|
|
62
|
+
*/
|
|
63
|
+
export declare enum TaskEventType {
|
|
64
|
+
/**
|
|
65
|
+
* Dispatched when a task has been created.
|
|
66
|
+
*
|
|
67
|
+
* @detail { task }
|
|
68
|
+
*/
|
|
69
|
+
Created = "task.created",
|
|
70
|
+
/**
|
|
71
|
+
* Dispatched when the task has successfully been completed
|
|
72
|
+
*
|
|
73
|
+
* @detail { task }
|
|
74
|
+
*/
|
|
75
|
+
Success = "task.success",
|
|
76
|
+
/**
|
|
77
|
+
* Dispatched if an error occured while running the task
|
|
78
|
+
*
|
|
79
|
+
* @detail { task | error? }
|
|
80
|
+
*/
|
|
81
|
+
Failed = "task.failed"
|
|
82
|
+
}
|