@acorex/cdk 20.2.0-next.9 → 20.2.1

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 (55) hide show
  1. package/accordion/index.d.ts +21 -16
  2. package/carousel/index.d.ts +1 -0
  3. package/common/README.md +1 -1
  4. package/common/index.d.ts +113 -2
  5. package/drag-drop/index.d.ts +1 -0
  6. package/drawer/index.d.ts +15 -0
  7. package/fesm2022/acorex-cdk-accordion.mjs +103 -54
  8. package/fesm2022/acorex-cdk-accordion.mjs.map +1 -1
  9. package/fesm2022/acorex-cdk-carousel.mjs +11 -5
  10. package/fesm2022/acorex-cdk-carousel.mjs.map +1 -1
  11. package/fesm2022/acorex-cdk-clipboard.mjs +6 -6
  12. package/fesm2022/acorex-cdk-clipboard.mjs.map +1 -1
  13. package/fesm2022/acorex-cdk-common.mjs +452 -157
  14. package/fesm2022/acorex-cdk-common.mjs.map +1 -1
  15. package/fesm2022/acorex-cdk-dom.mjs +3 -3
  16. package/fesm2022/acorex-cdk-dom.mjs.map +1 -1
  17. package/fesm2022/acorex-cdk-drag-drop.mjs +23 -20
  18. package/fesm2022/acorex-cdk-drag-drop.mjs.map +1 -1
  19. package/fesm2022/acorex-cdk-drawer.mjs +27 -14
  20. package/fesm2022/acorex-cdk-drawer.mjs.map +1 -1
  21. package/fesm2022/acorex-cdk-focus-trap.mjs +3 -3
  22. package/fesm2022/acorex-cdk-focus-trap.mjs.map +1 -1
  23. package/fesm2022/acorex-cdk-input-mask.mjs +65 -7
  24. package/fesm2022/acorex-cdk-input-mask.mjs.map +1 -1
  25. package/fesm2022/acorex-cdk-list-navigation.mjs +75 -100
  26. package/fesm2022/acorex-cdk-list-navigation.mjs.map +1 -1
  27. package/fesm2022/acorex-cdk-outline.mjs +24 -29
  28. package/fesm2022/acorex-cdk-outline.mjs.map +1 -1
  29. package/fesm2022/acorex-cdk-overlay.mjs +3 -3
  30. package/fesm2022/acorex-cdk-overlay.mjs.map +1 -1
  31. package/fesm2022/acorex-cdk-pan-view.mjs +5 -5
  32. package/fesm2022/acorex-cdk-pan-view.mjs.map +1 -1
  33. package/fesm2022/acorex-cdk-qrcode.mjs.map +1 -1
  34. package/fesm2022/acorex-cdk-resizable.mjs +3 -3
  35. package/fesm2022/acorex-cdk-resizable.mjs.map +1 -1
  36. package/fesm2022/acorex-cdk-selection.mjs +76 -16
  37. package/fesm2022/acorex-cdk-selection.mjs.map +1 -1
  38. package/fesm2022/acorex-cdk-sliding-item.mjs +5 -22
  39. package/fesm2022/acorex-cdk-sliding-item.mjs.map +1 -1
  40. package/fesm2022/acorex-cdk-sticky.mjs +3 -3
  41. package/fesm2022/acorex-cdk-sticky.mjs.map +1 -1
  42. package/fesm2022/acorex-cdk-virtual-scroll.mjs +10 -10
  43. package/fesm2022/acorex-cdk-virtual-scroll.mjs.map +1 -1
  44. package/fesm2022/acorex-cdk-wysiwyg.mjs +5 -0
  45. package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
  46. package/focus-trap/index.d.ts +1 -1
  47. package/input-mask/index.d.ts +38 -0
  48. package/list-navigation/index.d.ts +20 -20
  49. package/outline/index.d.ts +3 -8
  50. package/overlay/index.d.ts +1 -1
  51. package/package.json +2 -5
  52. package/selection/index.d.ts +5 -3
  53. package/sliding-item/index.d.ts +8 -15
  54. package/virtual-scroll/index.d.ts +1 -1
  55. package/wysiwyg/index.d.ts +3 -2
@@ -9,14 +9,31 @@ declare class AXAccordionCloseButtonDirective {
9
9
  static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionCloseButtonDirective, "[axAccordionCloseButton]", never, {}, {}, never, never, true, never>;
10
10
  }
11
11
 
12
+ declare class AXAccordionItemDirective {
13
+ #private;
14
+ private closeBtn;
15
+ private header;
16
+ id: i0.WritableSignal<number>;
17
+ collapsedOnItemClick: i0.WritableSignal<boolean>;
18
+ isCollapsed: i0.ModelSignal<boolean>;
19
+ onClick: i0.OutputEmitterRef<AXClickEvent>;
20
+ open(): void;
21
+ close(): void;
22
+ toggle(): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXAccordionItemDirective, never>;
24
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionItemDirective, "[axAccordionItem]", ["axAccordionItem"], { "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; "onClick": "onClick"; }, ["closeBtn", "header"], never, true, never>;
25
+ }
26
+
12
27
  declare class AXAccordionGroupDirective {
13
28
  #private;
14
- accordion: i0.ModelSignal<boolean>;
15
- activeIndex: i0.ModelSignal<number | number[]>;
29
+ accordion: i0.InputSignal<boolean>;
30
+ activeIndex: i0.InputSignal<number | number[]>;
31
+ collapsedOnItemClick: i0.InputSignal<boolean>;
32
+ private contentChildren;
16
33
  private activeId;
17
- private content;
34
+ customAccordionItem: i0.WritableSignal<AXAccordionItemDirective[]>;
18
35
  static ɵfac: i0.ɵɵFactoryDeclaration<AXAccordionGroupDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionGroupDirective, "[axAccordionGroup]", ["axAccordionGroup"], { "accordion": { "alias": "accordion"; "required": false; "isSignal": true; }; "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; }, { "accordion": "accordionChange"; "activeIndex": "activeIndexChange"; }, ["content"], never, true, never>;
36
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionGroupDirective, "[axAccordionGroup]", ["axAccordionGroup"], { "accordion": { "alias": "accordion"; "required": false; "isSignal": true; }; "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; "collapsedOnItemClick": { "alias": "collapsedOnItemClick"; "required": false; "isSignal": true; }; }, {}, ["contentChildren"], never, true, never>;
20
37
  }
21
38
 
22
39
  declare class AXAccordionItemContentDirective {
@@ -35,18 +52,6 @@ declare class AXAccordionItemHeaderDirective {
35
52
  static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionItemHeaderDirective, "[axAccordionItemHeader]", ["axAccordionItemHeader"], {}, {}, never, never, true, never>;
36
53
  }
37
54
 
38
- declare class AXAccordionItemDirective {
39
- #private;
40
- private close;
41
- private header;
42
- id: i0.WritableSignal<number>;
43
- isCollapsed: i0.ModelSignal<boolean>;
44
- onClick: i0.OutputEmitterRef<AXClickEvent>;
45
- collapsedOnItemClick: i0.ModelSignal<boolean>;
46
- static ɵfac: i0.ɵɵFactoryDeclaration<AXAccordionItemDirective, never>;
47
- static ɵdir: i0.ɵɵDirectiveDeclaration<AXAccordionItemDirective, "[axAccordionItem]", ["axAccordionItem"], { "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; "collapsedOnItemClick": { "alias": "collapsedOnItemClick"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; "onClick": "onClick"; "collapsedOnItemClick": "collapsedOnItemClickChange"; }, ["close", "header"], never, true, never>;
48
- }
49
-
50
55
  declare class AXAccordionCdkModule {
51
56
  static ɵfac: i0.ɵɵFactoryDeclaration<AXAccordionCdkModule, never>;
52
57
  static ɵmod: i0.ɵɵNgModuleDeclaration<AXAccordionCdkModule, never, [typeof i1.CommonModule, typeof AXAccordionGroupDirective, typeof AXAccordionItemContentDirective, typeof AXAccordionItemHeaderDirective, typeof AXAccordionItemDirective, typeof AXAccordionCloseButtonDirective], [typeof AXAccordionGroupDirective, typeof AXAccordionItemContentDirective, typeof AXAccordionItemHeaderDirective, typeof AXAccordionItemDirective, typeof AXAccordionCloseButtonDirective]>;
@@ -8,6 +8,7 @@ declare class AXCarouselDirective {
8
8
  carousel: _angular_core.WritableSignal<Swiper>;
9
9
  carouselOptions: _angular_core.InputSignal<SwiperOptions>;
10
10
  private el;
11
+ private platformId;
11
12
  private init;
12
13
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXCarouselDirective, never>;
13
14
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXCarouselDirective, "[axCarousel]", ["axCarousel"], { "carouselOptions": { "alias": "carouselOptions"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
package/common/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # @acorex/cdk/common
2
2
 
3
- Secondary entry point of `@acorex/components`. It can be used by importing from `@acorex/cdk/common`.
3
+ Secondary entry point of `@acorex/cdk`. It can be used by importing from `@acorex/cdk/common`.
package/common/index.d.ts CHANGED
@@ -210,6 +210,13 @@ declare class AXItemClickEvent<T = any> extends AXClickEvent {
210
210
  name?: string;
211
211
  item: T;
212
212
  }
213
+ /**
214
+ * Fires each time the user select the element.
215
+ * @category Events
216
+ */
217
+ declare class AXItemSelectedEvent<T = any> extends AXEvent {
218
+ item: T;
219
+ }
213
220
  /**
214
221
  * Fires each time the component gets focused.
215
222
  * @category Events
@@ -262,6 +269,11 @@ declare abstract class MXBaseComponent {
262
269
  get id(): string;
263
270
  set id(v: string);
264
271
  protected get cdr(): ChangeDetectorRef;
272
+ /**
273
+ * Gets the host HTML element of the component.
274
+ *
275
+ * @returns T - The native DOM element associated with this component.
276
+ */
265
277
  getHostElement<T = HTMLElement>(): T;
266
278
  protected getViewContainer(): ViewContainerRef;
267
279
  protected internalOptionChanging(option: MXComponentOptionChanging): any;
@@ -276,6 +288,11 @@ declare abstract class MXBaseComponent {
276
288
  * @event
277
289
  */
278
290
  onOptionChanged: EventEmitter<AXOptionChangedEvent>;
291
+ /**
292
+ * Sets a component option with optional lifecycle callbacks.
293
+ *
294
+ * @param option - The option configuration containing the name, value and optional before/after callbacks.
295
+ */
279
296
  setOption<T = any>(option: MXComponentSetOption<T>): void;
280
297
  static ɵfac: i0.ɵɵFactoryDeclaration<MXBaseComponent, never>;
281
298
  static ɵprov: i0.ɵɵInjectableDeclaration<MXBaseComponent>;
@@ -286,6 +303,11 @@ declare class MXInteractiveComponent extends MXBaseComponent {
286
303
  * @ignore
287
304
  */
288
305
  protected onTouchedCallback: () => void;
306
+ /**
307
+ * Registers a touched callback function (ControlValueAccessor method).
308
+ *
309
+ * @param fn - The callback function to register.
310
+ */
289
311
  registerOnTouched(fn: () => void): void;
290
312
  private _touched;
291
313
  /**
@@ -309,6 +331,11 @@ declare class MXInteractiveComponent extends MXBaseComponent {
309
331
  */
310
332
  get disabled(): boolean;
311
333
  set disabled(value: boolean);
334
+ /**
335
+ * Sets the disabled state of the component.
336
+ *
337
+ * @param isDisabled - Whether the component should be disabled.
338
+ */
312
339
  setDisabledState(isDisabled: boolean): void;
313
340
  _tabIndex: number;
314
341
  /**
@@ -328,10 +355,18 @@ declare class MXInteractiveComponent extends MXBaseComponent {
328
355
  */
329
356
  onBlur: EventEmitter<AXFocusEvent>;
330
357
  protected emitOnBlurEvent(e?: FocusEvent): void;
358
+ /**
359
+ * Focuses the component.
360
+ */
331
361
  focus(): void;
362
+ /**
363
+ * Removes focus from the component.
364
+ */
332
365
  blur(): void;
333
366
  /**
334
- * Check component is focused or has any focused element.
367
+ * Checks if the component is focused or has any focused element.
368
+ *
369
+ * @returns boolean - True if the component has focus.
335
370
  */
336
371
  hasFocus(): boolean;
337
372
  }
@@ -385,15 +420,54 @@ declare class MXValueComponent<T = any> extends MXInteractiveComponent implement
385
420
  validationRulesChange: EventEmitter<AXFormValidationRule[]>;
386
421
  private validationRules;
387
422
  get isRequired(): boolean;
423
+ /**
424
+ * Adds a validation rule.
425
+ *
426
+ * @param rule - The validation rule to add.
427
+ */
388
428
  addValidationRule(rule: AXFormValidationRule): void;
429
+ /**
430
+ * Removes a validation rule.
431
+ *
432
+ * @param ruleToRemove - The validation rule to remove.
433
+ */
389
434
  removeValidationRule(ruleToRemove: AXFormValidationRule): void;
435
+ /**
436
+ * Validates the component.
437
+ *
438
+ * @returns Promise<AXValidationSummary> - Validation result.
439
+ */
390
440
  validate(): Promise<AXValidationSummary>;
391
441
  protected setState(state: AXComponentState, ...args: any[]): void;
392
442
  protected onChangeCallback: (value: T) => void;
443
+ /**
444
+ * Registers a change callback function (ControlValueAccessor method).
445
+ *
446
+ * @param fn - The callback function to register.
447
+ */
393
448
  registerOnChange(fn: (value: T) => void): void;
449
+ /**
450
+ * Writes a value to the component (ControlValueAccessor method).
451
+ *
452
+ * @param value - The value to write.
453
+ */
394
454
  writeValue(value: T): void;
455
+ /**
456
+ * Commits a value with optional user interaction flag.
457
+ *
458
+ * @param value - The value to commit.
459
+ * @param u - Optional flag indicating if this is a user interaction.
460
+ */
395
461
  commitValue(value: T, u?: boolean): void;
462
+ /**
463
+ * Resets the component value.
464
+ *
465
+ * @param e - Optional flag indicating if this is a user interaction.
466
+ */
396
467
  reset(e?: boolean): void;
468
+ /**
469
+ * Resets validation errors.
470
+ */
397
471
  resetErrors(): void;
398
472
  static ɵfac: i0.ɵɵFactoryDeclaration<MXValueComponent<any>, never>;
399
473
  static ɵprov: i0.ɵɵInjectableDeclaration<MXValueComponent<any>>;
@@ -579,6 +653,7 @@ declare function convertArrayToDataSource<T = unknown>(items: T[], options?: {
579
653
  key: string;
580
654
  pageSize: number;
581
655
  }): AXDataSource<T>;
656
+ declare function applyDataSourceQuery<T extends Record<string, unknown>>(items: T[], filter: AXDataSourceFilterOption): T[];
582
657
 
583
658
  interface AXDataListQuery {
584
659
  take?: number;
@@ -853,6 +928,10 @@ declare abstract class MXSelectionValueComponent<T = unknown> extends MXValueCom
853
928
  /** Template string for formatting item display text */
854
929
  get textTemplate(): string;
855
930
  set textTemplate(value: string);
931
+ private _defaultText;
932
+ /** Text to display when neither textField nor valueField exist on the item */
933
+ get defaultText(): string;
934
+ set defaultText(value: string);
856
935
  private _disabledField;
857
936
  /** Field name used to determine if an item is disabled */
858
937
  get disabledField(): string;
@@ -863,6 +942,13 @@ declare abstract class MXSelectionValueComponent<T = unknown> extends MXValueCom
863
942
  set multiple(value: boolean);
864
943
  /** Gets the currently selected items */
865
944
  get selectedItems(): unknown[];
945
+ onItemSelected: EventEmitter<AXItemSelectedEvent>;
946
+ /**
947
+ * Emitted when an item in the list is clicked.
948
+ *
949
+ * @event
950
+ */
951
+ onItemClick: EventEmitter<AXItemClickEvent>;
866
952
  /**
867
953
  * Abstract method to retrieve an item by its key
868
954
  * @param key The unique identifier of the item
@@ -940,6 +1026,12 @@ declare abstract class MXSelectionValueComponent<T = unknown> extends MXValueCom
940
1026
  * @returns True if the item is disabled
941
1027
  */
942
1028
  isItemDisabled(item: T): boolean;
1029
+ /**
1030
+ * Checks if an item is currently loading
1031
+ * @param item Item to check
1032
+ * @returns True if the item is loading
1033
+ */
1034
+ isItemLoading(item: T): boolean;
943
1035
  /**
944
1036
  * Gets the display text for an item using template or text field
945
1037
  * @param item Item to get display text for
@@ -960,6 +1052,25 @@ declare abstract class MXSelectionValueComponent<T = unknown> extends MXValueCom
960
1052
  * Clears only the cache while preserving selected items
961
1053
  */
962
1054
  protected softClearSelectionCache(): void;
1055
+ /**
1056
+ * Clears the debouncing cache for specific items to ensure fresh data is displayed
1057
+ */
1058
+ protected clearItemDebouncingCache(item: T): void;
1059
+ /**
1060
+ * Forces a refresh of the display when items are loaded asynchronously
1061
+ * This should be called when the data source is updated
1062
+ */
1063
+ protected refreshDisplay(): void;
1064
+ /**
1065
+ * Refreshes the display for all selected items to ensure consistency
1066
+ * This is useful when the data source has been updated
1067
+ */
1068
+ protected refreshSelectedItemsDisplay(): void;
1069
+ /**
1070
+ * Forces a refresh of all selected items by clearing their debouncing cache
1071
+ * This ensures fresh data is displayed when the data source is updated
1072
+ */
1073
+ protected forceRefreshSelectedItems(): void;
963
1074
  /**
964
1075
  * Asynchronously loads an item by its key and caches the result
965
1076
  * @param key Key to load item by
@@ -1043,5 +1154,5 @@ declare class AXHotkeysService {
1043
1154
  static ɵprov: i0.ɵɵInjectableDeclaration<AXHotkeysService>;
1044
1155
  }
1045
1156
 
1046
- export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, convertArrayToDataSource, convertToPlacement };
1157
+ export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXItemSelectedEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, applyDataSourceQuery, convertArrayToDataSource, convertToPlacement };
1047
1158
  export type { AXAnimationEasing, AXComponentState, AXConnectedPosition, AXDataListFetchCallbackResult, AXDataListFetchDataCallback, AXDataListItems, AXDataListQuery, AXDataSourceByKeyCallback, AXDataSourceCallbackResult, AXDataSourceChangedEvent, AXDataSourceConfig, AXDataSourceFilterOption, AXDataSourceItemExpandedEvent, AXDataSourceLoadCallback, AXDataSourceOperator, AXDataSourceQuery, AXDataSourceSortOption, AXDirection, AXExpandToggleIcons, AXFilterLogic, AXFormValidationRule, AXHotKeyAction, AXLocation, AXOrientation, AXPagedComponentInterface, AXPlacement, AXPlacementType, AXRange, AXScrollPosition, AXSelectionMode, AXSizeType, AXSortOrder, AXStyleColorType, AXStyleLookType, AXStyleSizeType, AXSurfaceType, DisabledCallback, MXComponentOptionChanged, MXComponentOptionChanging, MXComponentSetOption, NormalizedItem };
@@ -154,6 +154,7 @@ declare class AXDropListDirective extends NXComponent implements OnInit, AfterCo
154
154
  private readonly _zone;
155
155
  private readonly _renderer;
156
156
  private readonly _cdr;
157
+ private readonly _platformId;
157
158
  private readonly _hostEl;
158
159
  /** Whether sorting within this list is disabled. */
159
160
  sortingDisabled: _angular_core.InputSignal<boolean>;
package/drawer/index.d.ts CHANGED
@@ -28,8 +28,23 @@ declare class AXDrawerItemDirective implements OnDestroy {
28
28
  closeOnBackdropClick: _angular_core.ModelSignal<boolean>;
29
29
  backdropClass: _angular_core.ModelSignal<string>;
30
30
  onBackdropClick: _angular_core.OutputEmitterRef<AXClickEvent>;
31
+ /**
32
+ * Shows the drawer by animating it into view.
33
+ *
34
+ * @returns void - No return value. The drawer becomes visible.
35
+ */
31
36
  show(): void;
37
+ /**
38
+ * Hides the drawer by animating it out of view.
39
+ *
40
+ * @returns void - No return value. The drawer becomes hidden.
41
+ */
32
42
  hide(): void;
43
+ /**
44
+ * Toggles the drawer state between visible and hidden.
45
+ *
46
+ * @returns void - No return value. The drawer state is toggled.
47
+ */
33
48
  toggle(): void;
34
49
  private addBackdrop;
35
50
  private removeBackdrop;
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Directive, contentChild, signal, model, output, afterNextRender, contentChildren, effect, computed, input, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, Directive, contentChild, signal, model, output, afterNextRender, input, contentChildren, effect, computed, NgModule } from '@angular/core';
3
3
  import { castArray } from 'lodash-es';
4
4
  import { CommonModule } from '@angular/common';
5
5
 
@@ -7,10 +7,10 @@ class AXAccordionCloseButtonDirective {
7
7
  constructor() {
8
8
  this.elm = inject(ElementRef);
9
9
  }
10
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCloseButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
11
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.3", type: AXAccordionCloseButtonDirective, isStandalone: true, selector: "[axAccordionCloseButton]", ngImport: i0 }); }
10
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCloseButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
11
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXAccordionCloseButtonDirective, isStandalone: true, selector: "[axAccordionCloseButton]", ngImport: i0 }); }
12
12
  }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCloseButtonDirective, decorators: [{
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCloseButtonDirective, decorators: [{
14
14
  type: Directive,
15
15
  args: [{ selector: '[axAccordionCloseButton]' }]
16
16
  }] });
@@ -19,10 +19,10 @@ class AXAccordionItemHeaderDirective {
19
19
  constructor() {
20
20
  this.elm = inject(ElementRef);
21
21
  }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.3", type: AXAccordionItemHeaderDirective, isStandalone: true, selector: "[axAccordionItemHeader]", exportAs: ["axAccordionItemHeader"], ngImport: i0 }); }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXAccordionItemHeaderDirective, isStandalone: true, selector: "[axAccordionItemHeader]", exportAs: ["axAccordionItemHeader"], ngImport: i0 }); }
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemHeaderDirective, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemHeaderDirective, decorators: [{
26
26
  type: Directive,
27
27
  args: [{
28
28
  selector: '[axAccordionItemHeader]',
@@ -32,15 +32,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
32
32
 
33
33
  class AXAccordionItemDirective {
34
34
  constructor() {
35
- this.close = contentChild(AXAccordionCloseButtonDirective, ...(ngDevMode ? [{ debugName: "close", descendants: true }] : [{ descendants: true }]));
35
+ this.closeBtn = contentChild(AXAccordionCloseButtonDirective, ...(ngDevMode ? [{ debugName: "closeBtn", descendants: true }] : [{ descendants: true }]));
36
36
  this.header = contentChild(AXAccordionItemHeaderDirective, ...(ngDevMode ? [{ debugName: "header", descendants: true }] : [{ descendants: true }]));
37
37
  this.id = signal(Math.random(), ...(ngDevMode ? [{ debugName: "id" }] : []));
38
+ this.collapsedOnItemClick = signal(true, ...(ngDevMode ? [{ debugName: "collapsedOnItemClick" }] : []));
38
39
  this.isCollapsed = model(true, ...(ngDevMode ? [{ debugName: "isCollapsed" }] : []));
39
40
  this.onClick = output();
40
- this.collapsedOnItemClick = model(true, ...(ngDevMode ? [{ debugName: "collapsedOnItemClick" }] : []));
41
41
  this.#init = afterNextRender(() => {
42
- if (this.close()) {
43
- (this.close()?.elm.nativeElement).onclick = () => {
42
+ if (this.closeBtn()) {
43
+ (this.closeBtn()?.elm.nativeElement).onclick = () => {
44
44
  if (this.collapsedOnItemClick()) {
45
45
  this.isCollapsed.update((prev) => !prev);
46
46
  }
@@ -58,10 +58,19 @@ class AXAccordionItemDirective {
58
58
  });
59
59
  }
60
60
  #init;
61
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
62
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.1.3", type: AXAccordionItemDirective, isStandalone: true, selector: "[axAccordionItem]", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, collapsedOnItemClick: { classPropertyName: "collapsedOnItemClick", publicName: "collapsedOnItemClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isCollapsed: "isCollapsedChange", onClick: "onClick", collapsedOnItemClick: "collapsedOnItemClickChange" }, queries: [{ propertyName: "close", first: true, predicate: AXAccordionCloseButtonDirective, descendants: true, isSignal: true }, { propertyName: "header", first: true, predicate: AXAccordionItemHeaderDirective, descendants: true, isSignal: true }], exportAs: ["axAccordionItem"], ngImport: i0 }); }
61
+ open() {
62
+ this.isCollapsed.set(false);
63
+ }
64
+ close() {
65
+ this.isCollapsed.set(true);
66
+ }
67
+ toggle() {
68
+ this.isCollapsed.update((prev) => !prev);
69
+ }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
71
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.3", type: AXAccordionItemDirective, isStandalone: true, selector: "[axAccordionItem]", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isCollapsed: "isCollapsedChange", onClick: "onClick" }, queries: [{ propertyName: "closeBtn", first: true, predicate: AXAccordionCloseButtonDirective, descendants: true, isSignal: true }, { propertyName: "header", first: true, predicate: AXAccordionItemHeaderDirective, descendants: true, isSignal: true }], exportAs: ["axAccordionItem"], ngImport: i0 }); }
63
72
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemDirective, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemDirective, decorators: [{
65
74
  type: Directive,
66
75
  args: [{
67
76
  selector: '[axAccordionItem]',
@@ -71,16 +80,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
71
80
 
72
81
  class AXAccordionGroupDirective {
73
82
  constructor() {
74
- this.accordion = model(true, ...(ngDevMode ? [{ debugName: "accordion" }] : []));
75
- this.activeIndex = model(null, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
83
+ this.accordion = input(true, ...(ngDevMode ? [{ debugName: "accordion" }] : []));
84
+ this.activeIndex = input(null, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
85
+ this.collapsedOnItemClick = input(true, ...(ngDevMode ? [{ debugName: "collapsedOnItemClick" }] : []));
86
+ this.contentChildren = contentChildren(AXAccordionItemDirective, ...(ngDevMode ? [{ debugName: "contentChildren" }] : []));
76
87
  this.activeId = signal(null, ...(ngDevMode ? [{ debugName: "activeId" }] : []));
77
- this.content = contentChildren(AXAccordionItemDirective, ...(ngDevMode ? [{ debugName: "content" }] : []));
88
+ this.customAccordionItem = signal([], ...(ngDevMode ? [{ debugName: "customAccordionItem" }] : []));
78
89
  this.#init = afterNextRender(() => {
79
- this.content().forEach((element) => {
80
- element.onClick.subscribe((e) => {
81
- this.activeId.set(e.component.id());
90
+ if (this.contentChildren().length) {
91
+ this.contentChildren().forEach((element) => {
92
+ element.collapsedOnItemClick.set(this.collapsedOnItemClick());
93
+ if (this.accordion() && !element.isCollapsed())
94
+ this.activeId.set(element.id());
95
+ element.onClick.subscribe((e) => {
96
+ this.activeId.set(e.component.id());
97
+ });
98
+ });
99
+ }
100
+ else {
101
+ this.customAccordionItem().forEach((element) => {
102
+ element.collapsedOnItemClick.set(this.collapsedOnItemClick());
103
+ if (this.accordion() && !element.isCollapsed())
104
+ this.activeId.set(element.id());
105
+ element.onClick.subscribe((e) => {
106
+ this.activeId.set(e.component.id());
107
+ });
82
108
  });
83
- });
109
+ }
84
110
  });
85
111
  this.#eff2 = effect(() => {
86
112
  if (!this.activeIndex())
@@ -88,38 +114,59 @@ class AXAccordionGroupDirective {
88
114
  const activeIndexes = castArray(this.activeIndex());
89
115
  if (activeIndexes.length)
90
116
  return;
91
- this.content().forEach((item, index) => {
92
- if (activeIndexes.includes(index)) {
93
- setTimeout(() => {
94
- item.isCollapsed.set(false);
95
- });
96
- }
97
- });
117
+ if (this.contentChildren().length) {
118
+ this.contentChildren().forEach((item, index) => {
119
+ if (activeIndexes.includes(index)) {
120
+ setTimeout(() => {
121
+ this.activeId.set(item.id());
122
+ item.isCollapsed.set(false);
123
+ });
124
+ }
125
+ });
126
+ }
127
+ else {
128
+ this.customAccordionItem().forEach((item, index) => {
129
+ if (activeIndexes.includes(index)) {
130
+ setTimeout(() => {
131
+ this.activeId.set(item.id());
132
+ item.isCollapsed.set(false);
133
+ });
134
+ }
135
+ });
136
+ }
98
137
  }, ...(ngDevMode ? [{ debugName: "#eff2" }] : []));
99
138
  this.#eff3 = effect(() => {
100
- if (!this.accordion())
139
+ if (!this.accordion() || !this.collapsedOnItemClick())
101
140
  return;
102
- this.content().forEach((element) => {
103
- if (this.activeId() === element.id()) {
104
- if (!element.collapsedOnItemClick())
105
- return;
106
- element.isCollapsed.set(false);
107
- }
108
- else {
109
- if (!element.collapsedOnItemClick())
110
- return;
111
- element.isCollapsed.set(true);
112
- }
113
- });
141
+ if (this.contentChildren().length) {
142
+ this.contentChildren().forEach((element) => {
143
+ if (this.activeId() === element.id()) {
144
+ element.isCollapsed.set(false);
145
+ }
146
+ else {
147
+ element.isCollapsed.set(true);
148
+ }
149
+ });
150
+ }
151
+ else {
152
+ this.customAccordionItem().forEach((element) => {
153
+ if (this.activeId() === element.id()) {
154
+ element.isCollapsed.set(false);
155
+ }
156
+ else {
157
+ element.isCollapsed.set(true);
158
+ }
159
+ });
160
+ }
114
161
  }, ...(ngDevMode ? [{ debugName: "#eff3" }] : []));
115
162
  }
116
163
  #init;
117
164
  #eff2;
118
165
  #eff3;
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.1.3", type: AXAccordionGroupDirective, isStandalone: true, selector: "[axAccordionGroup]", inputs: { accordion: { classPropertyName: "accordion", publicName: "accordion", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { accordion: "accordionChange", activeIndex: "activeIndexChange" }, queries: [{ propertyName: "content", predicate: AXAccordionItemDirective, isSignal: true }], exportAs: ["axAccordionGroup"], ngImport: i0 }); }
166
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
167
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.3", type: AXAccordionGroupDirective, isStandalone: true, selector: "[axAccordionGroup]", inputs: { accordion: { classPropertyName: "accordion", publicName: "accordion", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, collapsedOnItemClick: { classPropertyName: "collapsedOnItemClick", publicName: "collapsedOnItemClick", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "contentChildren", predicate: AXAccordionItemDirective, isSignal: true }], exportAs: ["axAccordionGroup"], ngImport: i0 }); }
121
168
  }
122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionGroupDirective, decorators: [{
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionGroupDirective, decorators: [{
123
170
  type: Directive,
124
171
  args: [{
125
172
  selector: '[axAccordionGroup]',
@@ -149,9 +196,11 @@ class AXAccordionItemContentDirective {
149
196
  });
150
197
  }
151
198
  else {
152
- el.style.display = 'block';
153
- el.style.opacity = '1';
154
- el.style.height = el.scrollHeight + 'px';
199
+ setTimeout(() => {
200
+ el.style.display = 'block';
201
+ el.style.opacity = '1';
202
+ el.style.height = el.scrollHeight + 'px';
203
+ });
155
204
  const onTransitionEnd = (event) => {
156
205
  if (event.propertyName === 'height') {
157
206
  el.style.height = 'auto';
@@ -163,10 +212,10 @@ class AXAccordionItemContentDirective {
163
212
  }
164
213
  #init;
165
214
  #eff;
166
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
167
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.3", type: AXAccordionItemContentDirective, isStandalone: true, selector: "[axAccordionItemContent]", inputs: { transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["axAccordionItemContent"], ngImport: i0 }); }
215
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
216
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: AXAccordionItemContentDirective, isStandalone: true, selector: "[axAccordionItemContent]", inputs: { transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["axAccordionItemContent"], ngImport: i0 }); }
168
217
  }
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionItemContentDirective, decorators: [{
218
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionItemContentDirective, decorators: [{
170
219
  type: Directive,
171
220
  args: [{
172
221
  selector: '[axAccordionItemContent]',
@@ -183,8 +232,8 @@ const COMPONENT = [
183
232
  ];
184
233
  const MODULES = [CommonModule];
185
234
  class AXAccordionCdkModule {
186
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCdkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
187
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCdkModule, imports: [CommonModule, AXAccordionGroupDirective,
235
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCdkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
236
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCdkModule, imports: [CommonModule, AXAccordionGroupDirective,
188
237
  AXAccordionItemContentDirective,
189
238
  AXAccordionItemHeaderDirective,
190
239
  AXAccordionItemDirective,
@@ -193,9 +242,9 @@ class AXAccordionCdkModule {
193
242
  AXAccordionItemHeaderDirective,
194
243
  AXAccordionItemDirective,
195
244
  AXAccordionCloseButtonDirective] }); }
196
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCdkModule, imports: [MODULES] }); }
245
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCdkModule, imports: [MODULES] }); }
197
246
  }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXAccordionCdkModule, decorators: [{
247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAccordionCdkModule, decorators: [{
199
248
  type: NgModule,
200
249
  args: [{
201
250
  imports: [...MODULES, ...COMPONENT],