@limetech/lime-web-components 6.4.1 → 6.5.0

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/action/action.d.ts +305 -13
  3. package/dist/action/action.d.ts.map +1 -1
  4. package/dist/application/decorators/application.d.ts +57 -3
  5. package/dist/application/decorators/application.d.ts.map +1 -1
  6. package/dist/application/decorators/session.d.ts +44 -3
  7. package/dist/application/decorators/session.d.ts.map +1 -1
  8. package/dist/application/decorators/user.d.ts +47 -3
  9. package/dist/application/decorators/user.d.ts.map +1 -1
  10. package/dist/application/repository.d.ts +102 -5
  11. package/dist/application/repository.d.ts.map +1 -1
  12. package/dist/application/session.d.ts +105 -15
  13. package/dist/application/session.d.ts.map +1 -1
  14. package/dist/application/user.d.ts +122 -13
  15. package/dist/application/user.d.ts.map +1 -1
  16. package/dist/commandbus/commandbus.d.ts +364 -23
  17. package/dist/commandbus/commandbus.d.ts.map +1 -1
  18. package/dist/conditionregistry/conditionregistry.d.ts +310 -27
  19. package/dist/conditionregistry/conditionregistry.d.ts.map +1 -1
  20. package/dist/config/decorator.d.ts +50 -3
  21. package/dist/config/decorator.d.ts.map +1 -1
  22. package/dist/config/repository.d.ts +131 -10
  23. package/dist/config/repository.d.ts.map +1 -1
  24. package/dist/core/context.d.ts +94 -4
  25. package/dist/core/context.d.ts.map +1 -1
  26. package/dist/core/lime-web-component.d.ts +59 -3
  27. package/dist/core/lime-web-component.d.ts.map +1 -1
  28. package/dist/core/metadata.d.ts +113 -13
  29. package/dist/core/metadata.d.ts.map +1 -1
  30. package/dist/core/platform.d.ts +175 -14
  31. package/dist/core/platform.d.ts.map +1 -1
  32. package/dist/core/state.d.ts +138 -14
  33. package/dist/core/state.d.ts.map +1 -1
  34. package/dist/datetimeformatter/datetimeformatter.d.ts +97 -34
  35. package/dist/datetimeformatter/datetimeformatter.d.ts.map +1 -1
  36. package/dist/device/decorator.d.ts +56 -4
  37. package/dist/device/decorator.d.ts.map +1 -1
  38. package/dist/device/device.d.ts +51 -6
  39. package/dist/device/device.d.ts.map +1 -1
  40. package/dist/dialog/dialog.d.ts +155 -19
  41. package/dist/dialog/dialog.d.ts.map +1 -1
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.esm.js.map +1 -1
  44. package/dist/limeobject/file.d.ts +6 -0
  45. package/dist/limeobject/file.d.ts.map +1 -1
  46. package/package.json +7 -7
@@ -1,52 +1,188 @@
1
1
  /**
2
- * Service for creating and displaying dialogs containing a web component
2
+ * Service for creating and managing dialogs
3
3
  *
4
- * @emits dialog.destroyed - When the dialog is beeing externally destroyed,
5
- * e.g. by closing a popup window (depending on platform), a
6
- * {@link DialogDestroyedEvent} will be emitted using
4
+ * The {@link DialogRenderer} enables displaying web components in dialogs,
5
+ * which can be modal or non-modal. It is accessed through the
6
+ * {@link LimeWebComponentPlatform} instance provided to components.
7
+ *
8
+ * Dialogs are useful for:
9
+ * - User input forms
10
+ * - Confirmation prompts
11
+ * - Detail views
12
+ * - Multi-step wizards
13
+ *
14
+ * The rendering implementation depends on the platform. Most commonly, dialogs
15
+ * are rendered directly on the current page. On some platforms, dialogs may be
16
+ * opened as separate native windows.
17
+ *
18
+ * @emits dialog.destroyed - When a dialog is externally destroyed (e.g., popup
19
+ * window closed by user), a {@link DialogDestroyedEvent} is emitted via
7
20
  * {@link EventDispatcher}
21
+ *
22
+ * @example
23
+ * Basic usage
24
+ * ```typescript
25
+ * const dialogRenderer = platform.get(PlatformServiceNames.Dialog);
26
+ *
27
+ * // Create a dialog
28
+ * const dialogId = dialogRenderer.create('my-dialog-component', {
29
+ * title: 'Confirmation',
30
+ * message: 'Are you sure?'
31
+ * });
32
+ *
33
+ * // Update dialog properties
34
+ * dialogRenderer.update(dialogId, { message: 'Processing...' });
35
+ *
36
+ * // Close the dialog
37
+ * dialogRenderer.destroy(dialogId);
38
+ * ```
39
+ *
8
40
  * @public
9
41
  * @group Dialog
10
42
  */
11
43
  export interface DialogRenderer {
12
44
  /**
13
- * Create a new dialog and render its contents. Depending on what kind of
14
- * platform the service is used on, the dialog might be rendered in the
15
- * current `Document` or opened in a new popup window.
16
- *
17
- * @param name - the name of the web component representing the dialog
18
- * @param properties - any properties to send to the dialog
19
- * @param listeners - any event listeners to register on the dialog
20
- * @returns id representing the dialog
45
+ * Create and display a new dialog
46
+ *
47
+ * Creates a dialog containing the specified web component. The dialog can be
48
+ * modal or non-modal depending on the component implementation. The rendering
49
+ * approach depends on the platform - most commonly as an overlay on the current
50
+ * page, but on some platforms as a separate native window.
51
+ *
52
+ * @param name - Tag name of the web component to render in the dialog (e.g., 'my-dialog-component')
53
+ * @param properties - Props to pass to the dialog component. These will be set as properties on the component instance.
54
+ * @param listeners - Event listeners to register on the dialog component. Keys are event names, values are handler functions.
55
+ * @returns Unique identifier for the created dialog. Use this ID with {@link DialogRenderer.update} and {@link DialogRenderer.destroy}.
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const dialogRenderer = this.platform.get(PlatformServiceNames.Dialog);
60
+ * const dialogId = dialogRenderer.create(
61
+ * 'confirmation-dialog',
62
+ * { title: 'Delete Item', message: 'This cannot be undone' },
63
+ * {
64
+ * 'confirm': () => this.deleteItem(),
65
+ * 'cancel': () => dialogRenderer.destroy(dialogId)
66
+ * }
67
+ * );
68
+ * ```
21
69
  */
22
70
  create(name: string, properties?: DialogProperties, listeners?: DialogListeners): number;
23
71
  /**
24
- * Update an existing dialog with new properties
72
+ * Update an existing dialog's properties
73
+ *
74
+ * Updates the properties of a dialog that was previously created. This is
75
+ * useful for updating dialog content based on user interactions or data changes.
76
+ *
77
+ * Event listeners cannot be updated and will remain as originally registered.
78
+ *
79
+ * @param id - The dialog identifier returned from {@link DialogRenderer.create}
80
+ * @param properties - New property values to set on the dialog component
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const dialogRenderer = this.platform.get(PlatformServiceNames.Dialog);
85
+ * const dialogId = dialogRenderer.create('progress-dialog', {
86
+ * progress: 0,
87
+ * status: 'Starting...'
88
+ * });
25
89
  *
26
- * @param id - the dialog identifier
27
- * @param properties - any properties to send to the dialog
90
+ * // Later, update progress
91
+ * dialogRenderer.update(dialogId, {
92
+ * progress: 50,
93
+ * status: 'Processing...'
94
+ * });
95
+ * ```
28
96
  */
29
97
  update(id: number, properties?: DialogProperties): void;
30
98
  /**
31
- * Destroy a dialog
99
+ * Close and destroy a dialog
32
100
  *
33
- * @param id - id representing the dialog
101
+ * Removes the dialog from the DOM and cleans up all associated resources
102
+ * and event listeners. If the dialog was rendered as a popup window, the
103
+ * window will be closed.
104
+ *
105
+ * @param id - The dialog identifier returned from {@link DialogRenderer.create}
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const dialogRenderer = this.platform.get(PlatformServiceNames.Dialog);
110
+ * const dialogId = dialogRenderer.create('my-dialog');
111
+ *
112
+ * // Later, close the dialog
113
+ * dialogRenderer.destroy(dialogId);
114
+ * ```
34
115
  */
35
116
  destroy(id: number): void;
36
117
  }
37
118
  /**
119
+ * Properties to pass to a dialog component
120
+ *
121
+ * An object mapping property names to values. These will be set as properties
122
+ * on the dialog's web component instance when the dialog is created or updated.
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * const properties: DialogProperties = {
127
+ * userId: 123,
128
+ * mode: 'edit',
129
+ * allowDelete: true,
130
+ * fields: ['name', 'email', 'phone']
131
+ * };
132
+ * dialogRenderer.create('user-form-dialog', properties);
133
+ * ```
134
+ *
38
135
  * @public
39
136
  * @group Dialog
40
137
  */
41
138
  export type DialogProperties = Record<string, any>;
42
139
  /**
140
+ * Event listeners for a dialog component
141
+ *
142
+ * An object mapping event names to handler functions. These listeners will be
143
+ * registered on the dialog's web component instance when the dialog is created.
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * const listeners: DialogListeners = {
148
+ * 'save': (event?: CustomEvent<User>) => {
149
+ * console.log('User saved:', event?.detail);
150
+ * },
151
+ * 'cancel': () => {
152
+ * console.log('Cancelled');
153
+ * },
154
+ * 'delete': (event?: CustomEvent<number>) => {
155
+ * console.log('Delete user:', event?.detail);
156
+ * }
157
+ * };
158
+ * dialogRenderer.create('user-form-dialog', properties, listeners);
159
+ * ```
160
+ *
43
161
  * @public
44
162
  * @group Dialog
45
163
  */
46
164
  export type DialogListeners = Record<string, (event?: CustomEvent<any>) => void>;
47
165
  /**
48
- * @event dialog.destroyed - Emitted when a dialog is externally destroyed, e.g.
49
- * by closing a popup window
166
+ * Event emitted when a dialog is externally destroyed
167
+ *
168
+ * This event is dispatched via {@link EventDispatcher} when a dialog is closed
169
+ * by external means, such as the user closing a popup window. The event detail
170
+ * contains the dialog ID that was destroyed.
171
+ *
172
+ * This allows the component that created the dialog to clean up any references
173
+ * or state associated with the dialog.
174
+ *
175
+ * @event dialog.destroyed
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * const eventDispatcher = this.platform.get(PlatformServiceName.EventDispatcher);
180
+ * eventDispatcher.addListener('dialog.destroyed', (event: DialogDestroyedEvent) => {
181
+ * const destroyedDialogId = event.detail;
182
+ * console.log(`Dialog ${destroyedDialogId} was closed`);
183
+ * });
184
+ * ```
185
+ *
50
186
  * @public
51
187
  * @group Dialog
52
188
  */
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/dialog/dialog.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;;;;;OASG;IACH,MAAM,CACF,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,gBAAgB,EAC7B,SAAS,CAAC,EAAE,eAAe,GAC5B,MAAM,CAAC;IAEV;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAExD;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;;GAGG;AAEH,MA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