@acorex/components 20.2.0-next.18 → 20.2.0-next.19

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 (50) hide show
  1. package/autocomplete/index.d.ts +2 -6
  2. package/calendar/index.d.ts +1 -1
  3. package/fesm2022/acorex-components-autocomplete.mjs +3 -19
  4. package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
  5. package/fesm2022/acorex-components-calendar.mjs +5 -3
  6. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  7. package/fesm2022/acorex-components-color-palette.mjs +1 -1
  8. package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
  9. package/fesm2022/acorex-components-cron-job.mjs +6 -6
  10. package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
  11. package/fesm2022/acorex-components-list.mjs +14 -6
  12. package/fesm2022/acorex-components-list.mjs.map +1 -1
  13. package/fesm2022/acorex-components-media-viewer.mjs +4 -4
  14. package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
  15. package/fesm2022/acorex-components-menu.mjs +11 -2
  16. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  17. package/fesm2022/acorex-components-phone-box.mjs +1 -1
  18. package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
  19. package/fesm2022/acorex-components-query-builder.mjs +1 -1
  20. package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
  21. package/fesm2022/acorex-components-rail-navigation.mjs +11 -0
  22. package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
  23. package/fesm2022/acorex-components-rest-api-generator.mjs +1 -1
  24. package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
  25. package/fesm2022/acorex-components-rrule.mjs +1 -1
  26. package/fesm2022/acorex-components-rrule.mjs.map +1 -1
  27. package/fesm2022/acorex-components-scheduler.mjs +1 -1
  28. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  29. package/fesm2022/acorex-components-select-box.mjs +19 -62
  30. package/fesm2022/acorex-components-select-box.mjs.map +1 -1
  31. package/fesm2022/acorex-components-selection-list-2.mjs +2 -5
  32. package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
  33. package/fesm2022/acorex-components-selection-list.mjs +4 -7
  34. package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
  35. package/fesm2022/acorex-components-side-menu.mjs +3 -3
  36. package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
  37. package/fesm2022/acorex-components-tag-box.mjs +12 -24
  38. package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
  39. package/fesm2022/acorex-components-wysiwyg.mjs +1 -1
  40. package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
  41. package/list/index.d.ts +9 -3
  42. package/menu/index.d.ts +2 -0
  43. package/package.json +9 -13
  44. package/rail-navigation/index.d.ts +11 -0
  45. package/select-box/index.d.ts +2 -11
  46. package/tag-box/index.d.ts +2 -2
  47. package/data-list/README.md +0 -356
  48. package/data-list/index.d.ts +0 -102
  49. package/fesm2022/acorex-components-data-list.mjs +0 -386
  50. package/fesm2022/acorex-components-data-list.mjs.map +0 -1
package/list/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, WritableSignal, TemplateRef, EventEmitter } from '@angular/core';
3
- import { AXEvent, MXSelectionValueComponent, AXDataSource, AXListDataSource } from '@acorex/cdk/common';
2
+ import { OnInit, EventEmitter, WritableSignal, TemplateRef } from '@angular/core';
3
+ import { AXEvent, MXSelectionValueComponent, AXItemClickEvent, AXDataSource, AXListDataSource } from '@acorex/cdk/common';
4
4
  import * as i1 from '@angular/common';
5
5
  import * as i2 from '@angular/cdk/scrolling';
6
6
  import * as i3 from '@acorex/core/translation';
@@ -27,6 +27,12 @@ declare class AXListComponent extends MXSelectionValueComponent implements OnIni
27
27
  * @defaultValue false
28
28
  */
29
29
  showItemTooltip: i0.InputSignal<boolean>;
30
+ /**
31
+ * Emitted when an item in the list is clicked.
32
+ *
33
+ * @event
34
+ */
35
+ onItemClick: EventEmitter<AXItemClickEvent<any>>;
30
36
  /**
31
37
  * Defines the data source for the list.
32
38
  *
@@ -142,7 +148,7 @@ declare class AXListComponent extends MXSelectionValueComponent implements OnIni
142
148
  */
143
149
  showEmptyTemplate: i0.Signal<boolean>;
144
150
  static ɵfac: i0.ɵɵFactoryDeclaration<AXListComponent, never>;
145
- static ɵcmp: i0.ɵɵComponentDeclaration<AXListComponent, "ax-list", never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "itemHeight": { "alias": "itemHeight"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "checkbox": { "alias": "checkbox"; "required": false; }; }, { "onValueChanged": "onValueChanged"; "disabledChange": "disabledChange"; "readonlyChange": "readonlyChange"; "onBlur": "onBlur"; "onFocus": "onFocus"; "onItemClick": "onItemClick"; "onItemSelected": "onItemSelected"; "onScrolledIndexChanged": "onScrolledIndexChanged"; }, never, ["ax-header", "ax-footer"], true, never>;
151
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXListComponent, "ax-list", never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "itemHeight": { "alias": "itemHeight"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "checkbox": { "alias": "checkbox"; "required": false; }; }, { "onValueChanged": "onValueChanged"; "disabledChange": "disabledChange"; "readonlyChange": "readonlyChange"; "onBlur": "onBlur"; "onFocus": "onFocus"; "onItemClick": "onItemClick"; "onScrolledIndexChanged": "onScrolledIndexChanged"; }, never, ["ax-header", "ax-footer"], true, never>;
146
152
  }
147
153
 
148
154
  declare class AXListModule {
package/menu/index.d.ts CHANGED
@@ -78,6 +78,8 @@ declare class AXContextMenuComponent extends NXComponent {
78
78
  showAt(point: AXPoint, targetElement?: HTMLElement, event?: AXContextMenuOpeningEvent): void;
79
79
  close(): void;
80
80
  private backdropElement;
81
+ private originalNextSibling;
82
+ private originalParent;
81
83
  protected items: _angular_core.WritableSignal<AXMenuItem[]>;
82
84
  /** @ignore */
83
85
  private getTargetElements;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/components",
3
- "version": "20.2.0-next.18",
3
+ "version": "20.2.0-next.19",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.0.0",
6
6
  "@angular/core": "^20.0.0",
@@ -114,10 +114,6 @@
114
114
  "types": "./cron-job/index.d.ts",
115
115
  "default": "./fesm2022/acorex-components-cron-job.mjs"
116
116
  },
117
- "./data-list": {
118
- "types": "./data-list/index.d.ts",
119
- "default": "./fesm2022/acorex-components-data-list.mjs"
120
- },
121
117
  "./data-pager": {
122
118
  "types": "./data-pager/index.d.ts",
123
119
  "default": "./fesm2022/acorex-components-data-pager.mjs"
@@ -130,14 +126,14 @@
130
126
  "types": "./datetime-box/index.d.ts",
131
127
  "default": "./fesm2022/acorex-components-datetime-box.mjs"
132
128
  },
133
- "./datetime-input": {
134
- "types": "./datetime-input/index.d.ts",
135
- "default": "./fesm2022/acorex-components-datetime-input.mjs"
136
- },
137
129
  "./datetime-picker": {
138
130
  "types": "./datetime-picker/index.d.ts",
139
131
  "default": "./fesm2022/acorex-components-datetime-picker.mjs"
140
132
  },
133
+ "./datetime-input": {
134
+ "types": "./datetime-input/index.d.ts",
135
+ "default": "./fesm2022/acorex-components-datetime-input.mjs"
136
+ },
141
137
  "./decorators": {
142
138
  "types": "./decorators/index.d.ts",
143
139
  "default": "./fesm2022/acorex-components-decorators.mjs"
@@ -310,14 +306,14 @@
310
306
  "types": "./rate-picker/index.d.ts",
311
307
  "default": "./fesm2022/acorex-components-rate-picker.mjs"
312
308
  },
313
- "./rest-api-generator": {
314
- "types": "./rest-api-generator/index.d.ts",
315
- "default": "./fesm2022/acorex-components-rest-api-generator.mjs"
316
- },
317
309
  "./result": {
318
310
  "types": "./result/index.d.ts",
319
311
  "default": "./fesm2022/acorex-components-result.mjs"
320
312
  },
313
+ "./rest-api-generator": {
314
+ "types": "./rest-api-generator/index.d.ts",
315
+ "default": "./fesm2022/acorex-components-rest-api-generator.mjs"
316
+ },
321
317
  "./routing-progress": {
322
318
  "types": "./routing-progress/index.d.ts",
323
319
  "default": "./fesm2022/acorex-components-routing-progress.mjs"
@@ -32,6 +32,10 @@ declare class AXRailNavigationItemComponent extends MXBaseComponent implements A
32
32
  ngAfterViewInit(): void;
33
33
  ngOnDestroy(): void;
34
34
  handleClickEvent(e: MouseEvent): void;
35
+ /**
36
+ * Gets the height and top position of the item.
37
+ * @returns Object containing height and top position
38
+ */
35
39
  getStats(): {
36
40
  height: number;
37
41
  top: number;
@@ -64,7 +68,14 @@ declare class AXRailNavigationModule {
64
68
 
65
69
  declare class AXRailNavigationService {
66
70
  private activeItem;
71
+ /**
72
+ * Observable that emits the currently active rail navigation item.
73
+ */
67
74
  activeItem$: rxjs.Observable<AXRailNavigationItemComponent>;
75
+ /**
76
+ * Sets the specified item as the active rail navigation item.
77
+ * @param item - The rail navigation item to set as active
78
+ */
68
79
  setActive(item: AXRailNavigationItemComponent): void;
69
80
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXRailNavigationService, never>;
70
81
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXRailNavigationService>;
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { OnDestroy, WritableSignal, TemplateRef, ElementRef } from '@angular/core';
3
3
  import * as polytype from 'polytype';
4
4
  import * as i2 from '@acorex/cdk/common';
5
- import { MXSelectionValueComponent, MXLookComponent, AXDataSource, MXSelectionBridgeService, AXEvent, AXValueChangedEvent, AXItemClickEvent, AXItemSelectedEvent } from '@acorex/cdk/common';
5
+ import { MXSelectionValueComponent, MXLookComponent, AXDataSource, MXSelectionBridgeService, AXEvent, AXValueChangedEvent } from '@acorex/cdk/common';
6
6
  import * as i12 from '@acorex/components/dropdown';
7
7
  import { MXDropdownBoxBaseComponent, AXDropdownBoxComponent } from '@acorex/components/dropdown';
8
8
  import * as i13 from '@acorex/components/list';
@@ -126,11 +126,6 @@ declare class AXSelectBoxComponent extends AXSelectBoxComponent_base implements
126
126
  private _unsubscriber;
127
127
  /** @ignore */
128
128
  protected ngOnInit(): void;
129
- /**
130
- * Proactively fetches item data if the component has a value but no corresponding item data.
131
- * This prevents showing "loading..." when the component has a value.
132
- */
133
- private fetchItemDataIfNeeded;
134
129
  /** @ignore */
135
130
  ngOnDestroy(): void;
136
131
  /**
@@ -149,10 +144,6 @@ declare class AXSelectBoxComponent extends AXSelectBoxComponent_base implements
149
144
  /** @ignore */
150
145
  protected _handleValueChanged(e: AXValueChangedEvent): void;
151
146
  /** @ignore */
152
- protected _handleItemClick(e: AXItemClickEvent): void;
153
- /** @ignore */
154
- protected _handleItemSelected(e: AXItemSelectedEvent): void;
155
- /** @ignore */
156
147
  private setDropdownSize;
157
148
  private updateDropdownPosition;
158
149
  private updateDropdownSize;
@@ -172,7 +163,7 @@ declare class AXSelectBoxComponent extends AXSelectBoxComponent_base implements
172
163
  refresh(): void;
173
164
  private hostClickListener;
174
165
  static ɵfac: i0.ɵɵFactoryDeclaration<AXSelectBoxComponent, never>;
175
- static ɵcmp: i0.ɵɵComponentDeclaration<AXSelectBoxComponent, "ax-select-box", never, { "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "minValue": { "alias": "minValue"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "value": { "alias": "value"; "required": false; }; "state": { "alias": "state"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": false; }; "look": { "alias": "look"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "minRecordsForSearch": { "alias": "minRecordsForSearch"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "selectedTemplate": { "alias": "selectedTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "dropdownWidth": { "alias": "dropdownWidth"; "required": false; "isSignal": true; }; "searchBoxAutoFocus": { "alias": "searchBoxAutoFocus"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "stateChange": "stateChange"; "onValueChanged": "onValueChanged"; "onBlur": "onBlur"; "onFocus": "onFocus"; "readonlyChange": "readonlyChange"; "disabledChange": "disabledChange"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onItemSelected": "onItemSelected"; "onItemClick": "onItemClick"; }, ["searchBox"], ["ax-prefix", "ax-clear-button", "ax-suffix", "ax-search-box", "ax-footer", "ax-validation-rule"], true, never>;
166
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXSelectBoxComponent, "ax-select-box", never, { "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "minValue": { "alias": "minValue"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "value": { "alias": "value"; "required": false; }; "state": { "alias": "state"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": false; }; "look": { "alias": "look"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "textField": { "alias": "textField"; "required": false; }; "disabledField": { "alias": "disabledField"; "required": false; }; "textTemplate": { "alias": "textTemplate"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; }; "minRecordsForSearch": { "alias": "minRecordsForSearch"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "selectedTemplate": { "alias": "selectedTemplate"; "required": false; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; }; "dropdownWidth": { "alias": "dropdownWidth"; "required": false; "isSignal": true; }; "searchBoxAutoFocus": { "alias": "searchBoxAutoFocus"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "stateChange": "stateChange"; "onValueChanged": "onValueChanged"; "onBlur": "onBlur"; "onFocus": "onFocus"; "readonlyChange": "readonlyChange"; "disabledChange": "disabledChange"; "onOpened": "onOpened"; "onClosed": "onClosed"; }, ["searchBox"], ["ax-prefix", "ax-clear-button", "ax-suffix", "ax-search-box", "ax-footer", "ax-validation-rule"], true, never>;
176
167
  }
177
168
 
178
169
  declare class AXSelectBoxModule {
@@ -26,8 +26,8 @@ declare class AXTagBoxComponent extends AXTagBoxComponent_base implements OnInit
26
26
  addItems(items: object[]): void;
27
27
  removeItem(index: number): void;
28
28
  convertString(v: unknown): object[];
29
- getFieldValue(item: unknown, path: string): unknown;
30
- protected internalSetValue(value: unknown): unknown[];
29
+ protected internalSetValue(value: any): unknown[];
30
+ protected internalSetValue(value: any): any;
31
31
  private get __hostName();
32
32
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTagBoxComponent, never>;
33
33
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXTagBoxComponent, "ax-tag-box", never, { "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "value": { "alias": "value"; "required": false; }; "state": { "alias": "state"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "allowNull": { "alias": "allowNull"; "required": false; }; "type": { "alias": "type"; "required": false; }; "look": { "alias": "look"; "required": false; }; "addOnComma": { "alias": "addOnComma"; "required": false; "isSignal": true; }; "addOnEnter": { "alias": "addOnEnter"; "required": false; "isSignal": true; }; "valueField": { "alias": "valueField"; "required": false; "isSignal": true; }; "textField": { "alias": "textField"; "required": false; "isSignal": true; }; "readonlyField": { "alias": "readonlyField"; "required": false; "isSignal": true; }; "allowDuplicateValues": { "alias": "allowDuplicateValues"; "required": false; "isSignal": true; }; }, { "onBlur": "onBlur"; "onFocus": "onFocus"; "valueChange": "valueChange"; "stateChange": "stateChange"; "onValueChanged": "onValueChanged"; "readonlyChange": "readonlyChange"; "disabledChange": "disabledChange"; "onKeyDown": "onKeyDown"; "onKeyUp": "onKeyUp"; "onKeyPress": "onKeyPress"; }, never, ["ax-prefix", "ax-clear-button", "ax-suffix", "ax-autocomplete", "ax-validation-rule"], true, never>;
@@ -1,356 +0,0 @@
1
- # @acorex/components/data-list
2
-
3
- Secondary entry point of `@acorex/components`. It can be used by importing from `@acorex/components/data-list`.
4
-
5
- ## Overview
6
-
7
- `AXDataList` is a modern, signal-based Angular data list component that provides virtual scrolling, selection management, and tree grouping capabilities. It's designed to replace the existing `AXListComponent` with improved performance and modern Angular patterns.
8
-
9
- ## Key Features
10
-
11
- ### Core Functionality
12
-
13
- - ✅ **Virtual Scrolling** - CDK-based virtual scrolling for large datasets
14
- - ✅ **Selection Management** - Single and multiple selection modes
15
- - ✅ **Tree Grouping** - Hierarchical item organization with expand/collapse
16
- - ✅ **Template System** - Custom templates for items, loading, and empty states
17
- - ✅ **Keyboard Navigation** - Full keyboard accessibility
18
- - ✅ **Modern Angular** - Signal-based architecture for optimal performance
19
-
20
- ### Advanced Features
21
-
22
- - ✅ **Disabled Items** - Field-based item disabling with visual and behavioral support
23
- - ✅ **Tooltip Support** - Custom tooltip content via field mapping
24
- - ✅ **Checkbox Control** - Configurable checkbox display and behavior
25
- - ✅ **Search API** - External search integration (not built-in)
26
-
27
- ## Component Architecture
28
-
29
- ### Base Class
30
-
31
- - **Inherits from**: `MXValueComponent` (instead of `MXSelectionValueComponent`)
32
- - **Change Detection**: `OnPush` strategy
33
- - **Encapsulation**: `ViewEncapsulation.None`
34
-
35
- ### Dependencies
36
-
37
- - `@angular/cdk/scrolling` - Virtual scrolling
38
- - `@angular/forms` - Form integration
39
- - `@acorex/cdk/common` - Base components and utilities
40
-
41
- ## Input Properties
42
-
43
- ### Basic Properties
44
-
45
- | Property | Type | Default | Description |
46
- | ---------- | --------- | ------- | ---------------------------- |
47
- | `id` | `string` | - | Component identifier |
48
- | `name` | `string` | - | Component name for forms |
49
- | `disabled` | `boolean` | `false` | Disable the entire component |
50
- | `readonly` | `boolean` | `false` | Make component read-only |
51
- | `tabIndex` | `number` | `0` | Tab order |
52
-
53
- ### Data & Selection
54
-
55
- | Property | Type | Default | Description |
56
- | --------------- | ----------------------- | -------- | -------------------------------- |
57
- | `dataSource` | `AXDataSource<unknown>` | `[]` | Data source for the list |
58
- | `value` | `unknown \| unknown[]` | - | Current selected value(s) |
59
- | `valueField` | `string` | `'id'` | Field name for item value |
60
- | `textField` | `string` | `'text'` | Field name for item display text |
61
- | `multiple` | `boolean` | `false` | Enable multiple selection |
62
- | `selectionMode` | `string` | `'item'` | Selection behavior |
63
-
64
- ### Display & Behavior
65
-
66
- | Property | Type | Default | Description |
67
- | ----------------- | ------------------ | ------- | --------------------------------- |
68
- | `itemHeight` | `number \| 'auto'` | `40` | Height of each list item |
69
- | `isItemTruncated` | `boolean` | `true` | Enable text truncation |
70
- | `showItemTooltip` | `boolean` | `false` | Show tooltips for truncated items |
71
- | `showCheckbox` | `boolean` | `true` | Show checkboxes for selection |
72
-
73
- ### Field Mappings
74
-
75
- | Property | Type | Default | Description |
76
- | --------------- | -------- | ------- | ------------------------------------------- |
77
- | `disabledField` | `string` | - | Field name to determine if item is disabled |
78
- | `tooltipField` | `string` | - | Field name for custom tooltip content |
79
-
80
- ### Tree Grouping
81
-
82
- | Property | Type | Default | Description |
83
- | -------------------- | ------------- | ------------ | --------------------------------- |
84
- | `childrenField` | `string` | `'children'` | Field name containing child items |
85
- | `expandedField` | `string` | `'expanded'` | Field name for expanded state |
86
- | `levelField` | `string` | `'level'` | Field name for nesting level |
87
- | `groupTemplate` | `TemplateRef` | - | Template for group headers |
88
- | `expandIconTemplate` | `TemplateRef` | - | Custom expand/collapse icons |
89
-
90
- ### Templates
91
-
92
- | Property | Type | Default | Description |
93
- | ----------------- | ------------- | ------- | ------------------------------ |
94
- | `itemTemplate` | `TemplateRef` | - | Custom template for list items |
95
- | `emptyTemplate` | `TemplateRef` | - | Template for empty state |
96
- | `loadingTemplate` | `TemplateRef` | - | Template for loading state |
97
- | `textTemplate` | `TemplateRef` | - | Custom text display template |
98
-
99
- ## Output Events
100
-
101
- ### Value & Selection Events
102
-
103
- | Event | Type | Description |
104
- | -------------------- | ------------------------- | ----------------------- |
105
- | `onValueChanged` | `AXValueChangedEvent` | Value selection changed |
106
- | `onItemClick` | `AXItemClickEvent` | Item clicked |
107
- | `onItemSelected` | `AXItemSelectedEvent` | Item selection changed |
108
- | `onSelectionChanged` | `AXSelectionChangedEvent` | Selection state changed |
109
-
110
- ### Focus & Interaction Events
111
-
112
- | Event | Type | Description |
113
- | ----------- | ---------------- | ---------------------- |
114
- | `onBlur` | `AXBlurEvent` | Component lost focus |
115
- | `onFocus` | `AXFocusEvent` | Component gained focus |
116
- | `onKeyDown` | `AXKeyDownEvent` | Key pressed |
117
-
118
- ### Data & State Events
119
-
120
- | Event | Type | Description |
121
- | ------------------------ | -------------------------- | ----------------------- |
122
- | `onScrolledIndexChanged` | `AXListScrollIndexChanged` | Scroll position changed |
123
- | `onLoadingChanged` | `AXLoadingChangedEvent` | Loading state changed |
124
- | `onDataChanged` | `AXDataChangedEvent` | Data source changed |
125
-
126
- ### Tree Grouping Events
127
-
128
- | Event | Type | Description |
129
- | ----------------- | ---------------------- | ----------------------------- |
130
- | `onItemExpanded` | `AXItemExpandedEvent` | Item expanded |
131
- | `onItemCollapsed` | `AXItemCollapsedEvent` | Item collapsed |
132
- | `onGroupToggle` | `AXGroupToggleEvent` | Group expand/collapse toggled |
133
-
134
- ## Public API Methods
135
-
136
- ### Selection Management
137
-
138
- | Method | Parameters | Return | Description |
139
- | ---------------------- | --------------- | ----------- | ----------------------------- |
140
- | `selectItem(item)` | `item: unknown` | `void` | Select specific item |
141
- | `deselectItem(item)` | `item: unknown` | `void` | Deselect specific item |
142
- | `clearSelection()` | - | `void` | Clear all selections |
143
- | `getSelectedItems()` | - | `unknown[]` | Get currently selected items |
144
- | `isItemSelected(item)` | `item: unknown` | `boolean` | Check if item is selected |
145
- | `isItemDisabled(item)` | `item: unknown` | `boolean` | Check if item is disabled |
146
- | `canSelectItem(item)` | `item: unknown` | `boolean` | Check if item can be selected |
147
-
148
- ### Navigation & Focus
149
-
150
- | Method | Parameters | Return | Description |
151
- | ---------------------- | --------------- | ------ | ---------------------------- |
152
- | `focus()` | - | `void` | Focus the component |
153
- | `focusItem(index)` | `index: number` | `void` | Focus specific item by index |
154
- | `focusNextItem()` | - | `void` | Focus next item |
155
- | `focusPreviousItem()` | - | `void` | Focus previous item |
156
- | `scrollToIndex(index)` | `index: number` | `void` | Scroll to specific index |
157
-
158
- ### Data & State
159
-
160
- | Method | Parameters | Return | Description |
161
- | ----------------------- | --------------- | ----------- | --------------------------- |
162
- | `refresh()` | - | `void` | Refresh data source |
163
- | `getItemByKey(key)` | `key: unknown` | `unknown` | Get item by key |
164
- | `getItemByIndex(index)` | `index: number` | `unknown` | Get item by index |
165
- | `getVisibleItems()` | - | `unknown[]` | Get items currently visible |
166
-
167
- ### Tree Grouping
168
-
169
- | Method | Parameters | Return | Description |
170
- | ---------------------- | --------------- | ----------- | ------------------------- |
171
- | `expandItem(item)` | `item: unknown` | `void` | Expand group |
172
- | `collapseItem(item)` | `item: unknown` | `void` | Collapse group |
173
- | `toggleExpanded(item)` | `item: unknown` | `void` | Toggle expand/collapse |
174
- | `expandAll()` | - | `void` | Expand all groups |
175
- | `collapseAll()` | - | `void` | Collapse all groups |
176
- | `isExpanded(item)` | `item: unknown` | `boolean` | Check if item is expanded |
177
- | `getItemLevel(item)` | `item: unknown` | `number` | Get nesting level |
178
- | `getParentItem(item)` | `item: unknown` | `unknown` | Get parent item |
179
- | `getChildItems(item)` | `item: unknown` | `unknown[]` | Get child items |
180
-
181
- ### Viewport Management
182
-
183
- | Method | Parameters | Return | Description |
184
- | --------------------- | ---------- | ------ | -------------------------- |
185
- | `render()` | - | `void` | Re-render the component |
186
- | `checkViewportSize()` | - | `void` | Update viewport dimensions |
187
- | `scrollToTop()` | - | `void` | Scroll to top |
188
- | `scrollToBottom()` | - | `void` | Scroll to bottom |
189
-
190
- ## Template Context Variables
191
-
192
- ### Standard Item Context
193
-
194
- | Variable | Type | Description |
195
- | ----------- | --------- | --------------- |
196
- | `$implicit` | `unknown` | The item data |
197
- | `index` | `number` | Item index |
198
- | `selected` | `boolean` | Selection state |
199
- | `disabled` | `boolean` | Disabled state |
200
- | `first` | `boolean` | First item flag |
201
- | `last` | `boolean` | Last item flag |
202
- | `even` | `boolean` | Even index flag |
203
- | `odd` | `boolean` | Odd index flag |
204
-
205
- ### Tree Grouping Context
206
-
207
- | Variable | Type | Description |
208
- | ------------- | ----------- | ------------------------------ |
209
- | `level` | `number` | Nesting level (0, 1, 2, etc.) |
210
- | `isGroup` | `boolean` | Whether item is a group/parent |
211
- | `isExpanded` | `boolean` | Whether group is expanded |
212
- | `hasChildren` | `boolean` | Whether item has children |
213
- | `parent` | `unknown` | Reference to parent item |
214
- | `children` | `unknown[]` | Child items array |
215
-
216
- ## Behavior Specifications
217
-
218
- ### Disabled Items
219
-
220
- - **Visual**: Grayed out appearance with reduced opacity
221
- - **Focus**: Disabled items are focusable but not selectable
222
- - **Navigation**: Skipped in keyboard navigation (Arrow keys)
223
- - **Selection**: Cannot be selected or deselected
224
- - **Checkbox**: Disabled checkboxes for disabled items
225
-
226
- ### Tooltip Behavior
227
-
228
- - **Custom Tooltip**: `tooltipField` provides custom tooltip content
229
- - **Default Tooltip**: Shows on hover regardless of truncation
230
- - **Priority**: Custom tooltip overrides default text tooltip
231
-
232
- ### Checkbox Behavior
233
-
234
- - **Display**: Controlled by `showCheckbox` input
235
- - **State**: Disabled items show disabled checkboxes
236
- - **Group Headers**: Can show checkboxes for "select all children" behavior
237
- - **Behavior Options**: Configurable checkbox interaction patterns
238
-
239
- ### Tree Grouping Behavior
240
-
241
- - **Expand/Collapse**: Click on group header or expand icon
242
- - **Selection**: Group selection can affect child selection
243
- - **Navigation**: Keyboard navigation respects expanded/collapsed state
244
- - **Performance**: Virtual scrolling optimized for tree structures
245
-
246
- ## CSS Classes & Styling
247
-
248
- ### Container Classes
249
-
250
- - `.ax-list-container` - Main container
251
- - `.ax-list-container.ax-height-auto` - Auto height mode
252
- - `.ax-list-container.ax-tree-mode` - Tree grouping mode
253
-
254
- ### Item Classes
255
-
256
- - `.ax-list-item` - Individual items
257
- - `.ax-list-item.ax-state-selected` - Selected state
258
- - `.ax-list-item.ax-state-disabled` - Disabled state
259
- - `.ax-list-item.ax-state-focused` - Focused state
260
- - `.ax-list-item.ax-state-loading` - Loading state
261
- - `.ax-list-item.ax-state-empty` - Empty state
262
-
263
- ### Tree Grouping Classes
264
-
265
- - `.ax-list-item.ax-group-header` - Group header items
266
- - `.ax-list-item.ax-group-expanded` - Expanded group
267
- - `.ax-list-item.ax-group-collapsed` - Collapsed group
268
- - `.ax-list-item.ax-group-child` - Child items
269
- - `.ax-list-item.ax-level-{n}` - Nesting level styling
270
-
271
- ### State Classes
272
-
273
- - `.ax-list-item.ax-level-0` - Root level items
274
- - `.ax-list-item.ax-level-1` - First level nested items
275
- - `.ax-list-item.ax-level-2` - Second level nested items
276
- - `.ax-list-item.ax-has-children` - Items with children
277
- - `.ax-list-item.ax-no-children` - Items without children
278
-
279
- ## Performance Considerations
280
-
281
- ### Virtual Scrolling
282
-
283
- - **Item Size**: Fixed item height for optimal performance
284
- - **Viewport Management**: Efficient viewport size calculations
285
- - **Memory Usage**: Minimal DOM elements for large datasets
286
-
287
- ### Signal Optimization
288
-
289
- - **Change Detection**: Signal-based updates for minimal re-renders
290
- - **Computed Values**: Efficient computed signals for derived state
291
- - **Memory Management**: Proper signal cleanup and disposal
292
-
293
- ### Tree Grouping Performance
294
-
295
- - **Lazy Loading**: Children loaded on demand
296
- - **Virtual Scrolling**: Optimized for hierarchical structures
297
- - **Selection Caching**: Efficient selection state management
298
-
299
- ## Migration Guide
300
-
301
- ### From AXListComponent
302
-
303
- - **Component Name**: Change from `ax-list` to `ax-data-list`
304
- - **Base Class**: Change from `MXSelectionValueComponent` to `MXValueComponent`
305
- - **Inputs**: Update input property names (e.g., `checkbox` → `showCheckbox`)
306
- - **Events**: Update event handler names
307
- - **Templates**: Ensure template context compatibility
308
-
309
- ### Breaking Changes
310
-
311
- - **Selection API**: Simplified selection management
312
- - **Event Names**: Updated event naming conventions
313
- - **Template Context**: Enhanced context variables for tree grouping
314
-
315
- ## Future Enhancements
316
-
317
- ### Planned Features
318
-
319
- - **Drag & Drop**: Item reordering and tree restructuring
320
- - **Filtering**: Client-side filtering capabilities
321
- - **Sorting**: Multi-column sorting support
322
- - **Pagination**: Built-in pagination controls
323
- - **Export**: Data export functionality
324
-
325
- ### Performance Improvements
326
-
327
- - **Web Workers**: Background data processing
328
- - **Service Workers**: Offline data caching
329
- - **IndexedDB**: Local data persistence
330
- - **WebAssembly**: High-performance data operations
331
-
332
- ## Implementation Notes
333
-
334
- ### Development Phases
335
-
336
- 1. **Phase 1**: Core functionality with virtual scrolling
337
- 2. **Phase 2**: Selection management and templates
338
- 3. **Phase 3**: Tree grouping implementation
339
- 4. **Phase 4**: Advanced features and optimizations
340
-
341
- ### Testing Strategy
342
-
343
- - **Unit Tests**: Component logic and API methods
344
- - **Integration Tests**: Template system and data binding
345
- - **Performance Tests**: Virtual scrolling and large datasets
346
- - **Accessibility Tests**: Keyboard navigation and screen readers
347
-
348
- ### Browser Support
349
-
350
- - **Modern Browsers**: Chrome 90+, Firefox 88+, Safari 14+
351
- - **Mobile**: iOS Safari 14+, Chrome Mobile 90+
352
- - **Fallbacks**: Graceful degradation for older browsers
353
-
354
- ---
355
-
356
- _This README serves as the complete specification for AXListComponent2 development and implementation._
@@ -1,102 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { OnInit, TemplateRef, EventEmitter } from '@angular/core';
3
- import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
4
- import { MXValueComponent, AXDataSource, AXListDataSource } from '@acorex/cdk/common';
5
-
6
- interface AXDataListItem {
7
- id: string;
8
- text: string;
9
- description?: string;
10
- disabled?: boolean;
11
- tooltip?: string;
12
- level?: number;
13
- children?: AXDataListItem[];
14
- expanded?: boolean;
15
- [key: string]: any;
16
- }
17
- interface AXDataListConfig {
18
- disabledField?: string;
19
- tooltipField?: string;
20
- textField?: string;
21
- descriptionField?: string;
22
- levelField?: string;
23
- childrenField?: string;
24
- expandedField?: string;
25
- }
26
- interface AXDataListSelectionChange {
27
- selectedItems: AXDataListItem[];
28
- selectedKeys: string[];
29
- isMultiple: boolean;
30
- }
31
- declare class AXDataListComponent extends MXValueComponent implements OnInit {
32
- dataSource: _angular_core.InputSignal<AXDataSource<AXDataListItem>>;
33
- config: _angular_core.InputSignal<AXDataListConfig>;
34
- multiple: _angular_core.InputSignal<boolean>;
35
- showCheckbox: _angular_core.InputSignal<boolean>;
36
- itemHeight: _angular_core.InputSignal<number>;
37
- isItemTruncated: _angular_core.InputSignal<boolean>;
38
- showItemTooltip: _angular_core.InputSignal<boolean>;
39
- disabledField: _angular_core.InputSignal<string>;
40
- tooltipField: _angular_core.InputSignal<string>;
41
- textField: _angular_core.InputSignal<string>;
42
- descriptionField: _angular_core.InputSignal<string>;
43
- levelField: _angular_core.InputSignal<string>;
44
- childrenField: _angular_core.InputSignal<string>;
45
- expandedField: _angular_core.InputSignal<string>;
46
- itemTemplate: _angular_core.InputSignal<TemplateRef<any>>;
47
- emptyTemplate: _angular_core.InputSignal<TemplateRef<any>>;
48
- loadingTemplate: _angular_core.InputSignal<TemplateRef<any>>;
49
- selectionChange: EventEmitter<AXDataListSelectionChange>;
50
- itemClick: EventEmitter<AXDataListItem>;
51
- itemDoubleClick: EventEmitter<AXDataListItem>;
52
- expandChange: EventEmitter<{
53
- item: AXDataListItem;
54
- expanded: boolean;
55
- }>;
56
- viewport: CdkVirtualScrollViewport;
57
- protected loading: _angular_core.WritableSignal<boolean>;
58
- protected totalItems: _angular_core.WritableSignal<number>;
59
- protected selectedItems: _angular_core.WritableSignal<AXDataListItem[]>;
60
- protected selectedKeys: _angular_core.WritableSignal<string[]>;
61
- protected focusedIndex: _angular_core.WritableSignal<number>;
62
- protected expandedItems: _angular_core.WritableSignal<Set<string>>;
63
- protected listDataSource: AXListDataSource<AXDataListItem> | null;
64
- protected hasItems: _angular_core.Signal<boolean>;
65
- protected isEmpty: _angular_core.Signal<boolean>;
66
- protected isMultipleSelection: _angular_core.Signal<boolean>;
67
- protected showCheckboxes: _angular_core.Signal<boolean>;
68
- selectionModel: _angular_core.ModelSignal<string | string[]>;
69
- constructor();
70
- ngOnInit(): void;
71
- private setupDataSourceSubscription;
72
- protected selectItem(item: AXDataListItem, event?: Event): void;
73
- protected toggleMultipleSelection(item: AXDataListItem): void;
74
- protected setSingleSelection(item: AXDataListItem): void;
75
- protected deselectItem(item: AXDataListItem): void;
76
- protected updateSelectedItems(): void;
77
- protected isItemSelected(item: AXDataListItem): boolean;
78
- protected isItemDisabled(item: AXDataListItem): boolean;
79
- protected getItemKey(item: AXDataListItem): string;
80
- protected toggleExpanded(item: AXDataListItem, event: Event): void;
81
- protected hasChildren(item: AXDataListItem): boolean;
82
- protected isExpanded(item: AXDataListItem): boolean;
83
- protected getItemLevel(item: AXDataListItem): number;
84
- protected onKeyDown(event: KeyboardEvent, item: AXDataListItem, index: number): void;
85
- protected focusNextItem(currentIndex: number): void;
86
- protected focusPreviousItem(currentIndex: number): void;
87
- protected scrollToIndex(index: number): void;
88
- protected onItemClick(item: AXDataListItem, event: Event): void;
89
- protected onCheckboxChange(item: AXDataListItem, checked: boolean): void;
90
- protected onCheckboxClick(event: Event): void;
91
- protected onItemDoubleClick(item: AXDataListItem): void;
92
- protected getItemText(item: AXDataListItem): string;
93
- protected getItemDescription(item: AXDataListItem): string;
94
- protected getItemTooltip(item: AXDataListItem): string;
95
- protected shouldShowTooltip(item: AXDataListItem): boolean;
96
- protected trackByFn: (index: number, item: AXDataListItem) => string;
97
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXDataListComponent, never>;
98
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXDataListComponent, "ax-data-list", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "showCheckbox": { "alias": "showCheckbox"; "required": false; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "isItemTruncated": { "alias": "isItemTruncated"; "required": false; "isSignal": true; }; "showItemTooltip": { "alias": "showItemTooltip"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "tooltipField": { "alias": "tooltipField"; "required": false; "isSignal": true; }; "textField": { "alias": "textField"; "required": false; "isSignal": true; }; "descriptionField": { "alias": "descriptionField"; "required": false; "isSignal": true; }; "levelField": { "alias": "levelField"; "required": false; "isSignal": true; }; "childrenField": { "alias": "childrenField"; "required": false; "isSignal": true; }; "expandedField": { "alias": "expandedField"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; "isSignal": true; }; "loadingTemplate": { "alias": "loadingTemplate"; "required": false; "isSignal": true; }; "selectionModel": { "alias": "selectionModel"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "itemClick": "itemClick"; "itemDoubleClick": "itemDoubleClick"; "expandChange": "expandChange"; "selectionModel": "selectionModelChange"; }, never, never, true, never>;
99
- }
100
-
101
- export { AXDataListComponent };
102
- export type { AXDataListConfig, AXDataListItem, AXDataListSelectionChange };