@acorex/components 21.0.0-next.5 → 21.0.0-next.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.d.ts +0 -1
- package/autocomplete/index.d.ts +23 -9
- package/button/index.d.ts +38 -17
- package/button-group/index.d.ts +6 -4
- package/calendar/index.d.ts +4 -0
- package/chips/index.d.ts +3 -8
- package/code-editor/README.md +291 -1
- package/code-editor/index.d.ts +260 -12
- package/command/index.d.ts +1 -0
- package/conversation2/README.md +426 -0
- package/conversation2/index.d.ts +6139 -0
- package/data-table/index.d.ts +97 -261
- package/dialog/index.d.ts +1 -1
- package/drawer/README.md +2 -2
- package/drawer/index.d.ts +33 -57
- package/drawer-legacy/README.md +3 -0
- package/drawer-legacy/index.d.ts +86 -0
- package/editor/README.md +3 -0
- package/editor/index.d.ts +79 -0
- package/fesm2022/acorex-components-accordion.mjs +19 -24
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +12 -12
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +14 -14
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs +4 -4
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +12 -11
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs +30 -13
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +13 -13
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +10 -10
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +12 -12
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +12 -12
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +25 -21
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +68 -28
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +39 -18
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +11 -11
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +12 -14
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +13 -11
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs +494 -162
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +13 -28
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +11 -11
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +32 -32
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +18 -11
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +34 -34
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +56 -65
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation2.mjs +17641 -0
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -0
- package/fesm2022/acorex-components-cron-job.mjs +53 -53
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs +5 -5
- package/fesm2022/acorex-components-data-list.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +63 -47
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +509 -551
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +10 -10
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +10 -10
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +11 -11
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +96 -54
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +26 -16
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-legacy.mjs +218 -0
- package/fesm2022/acorex-components-drawer-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-drawer.mjs +66 -150
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +9 -9
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +20 -18
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-editor.mjs +195 -0
- package/fesm2022/acorex-components-editor.mjs.map +1 -0
- package/fesm2022/acorex-components-file-explorer.mjs +34 -34
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs +18 -18
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +62 -37
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +14 -15
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +206 -156
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +10 -10
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +9 -9
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +9 -7
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +29 -11
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +9 -9
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +10 -10
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +23 -14
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +23 -23
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +290 -31
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +95 -99
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +24 -24
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs → acorex-components-modal-acorex-components-modal-WaTo81yi.mjs} +24 -24
- package/fesm2022/acorex-components-modal-acorex-components-modal-WaTo81yi.mjs.map +1 -0
- package/fesm2022/acorex-components-modal-modal-content.component-D61_wSet.mjs +214 -0
- package/fesm2022/acorex-components-modal-modal-content.component-D61_wSet.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +9 -9
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +16 -23
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box-legacy.mjs +412 -0
- package/fesm2022/acorex-components-number-box-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-number-box.mjs +113 -331
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +10 -10
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +10 -10
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +35 -40
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +14 -14
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +9 -9
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +47 -10
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +17 -17
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +12 -12
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +13 -13
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +11 -9
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +8 -8
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +9 -9
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +7 -7
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +40 -38
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +11 -11
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +20 -35
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +23 -23
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +8 -8
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +8 -8
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +111 -16
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +2339 -0
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -0
- package/fesm2022/acorex-components-scheduler.mjs +52 -52
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs +4 -4
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +23 -12
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +36 -17
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +12 -12
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +10 -10
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +31 -38
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +8 -8
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +11 -11
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-sliding-item.mjs +17 -17
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +16 -16
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +14 -14
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +28 -20
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +51 -21
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +47 -11
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +9 -9
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +13 -13
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs +54 -14
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +14 -29
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +14 -14
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +9 -9
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +12 -12
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view-legacy.mjs +511 -0
- package/fesm2022/acorex-components-tree-view-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-tree-view.mjs +2221 -435
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +28 -641
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +8 -8
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +229 -473
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/fesm2022/acorex-components.mjs.map +1 -1
- package/file-explorer/index.d.ts +6 -6
- package/form/index.d.ts +3 -3
- package/grid-layout-builder/index.d.ts +1 -2
- package/image-editor/index.d.ts +11 -13
- package/kbd/index.d.ts +13 -7
- package/loading/index.d.ts +1 -1
- package/map/index.d.ts +28 -1
- package/media-viewer/index.d.ts +7 -3
- package/notification/index.d.ts +0 -2
- package/number-box/README.md +2 -2
- package/number-box/index.d.ts +32 -171
- package/number-box-legacy/README.md +3 -0
- package/number-box-legacy/index.d.ts +191 -0
- package/package.json +37 -10
- package/paint/index.d.ts +1 -6
- package/phone-box/index.d.ts +5 -4
- package/rate-picker/index.d.ts +5 -15
- package/rrule/index.d.ts +96 -1
- package/scheduler-picker/README.md +15 -0
- package/scheduler-picker/index.d.ts +1360 -0
- package/search-box/index.d.ts +6 -1
- package/select-box/index.d.ts +15 -10
- package/side-menu/index.d.ts +3 -2
- package/tag/index.d.ts +8 -2
- package/tag-box/index.d.ts +12 -3
- package/time-duration/index.d.ts +19 -3
- package/tree-view/index.d.ts +941 -168
- package/tree-view-legacy/README.md +3 -0
- package/tree-view-legacy/index.d.ts +184 -0
- package/uploader/index.d.ts +4 -331
- package/wysiwyg/index.d.ts +57 -159
- package/drawer-2/README.md +0 -3
- package/drawer-2/index.d.ts +0 -62
- package/fesm2022/acorex-components-drawer-2.mjs +0 -134
- package/fesm2022/acorex-components-drawer-2.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs +0 -235
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs.map +0 -1
- package/fesm2022/acorex-components-number-box-2.mjs +0 -183
- package/fesm2022/acorex-components-number-box-2.mjs.map +0 -1
- package/number-box-2/README.md +0 -3
- package/number-box-2/index.d.ts +0 -41
package/tree-view/index.d.ts
CHANGED
|
@@ -1,184 +1,957 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { AXPlatform } from '@acorex/core/platform';
|
|
6
|
-
import * as i3 from '@angular/common';
|
|
7
|
-
import * as i5 from '@acorex/components/decorators';
|
|
8
|
-
import * as i6 from '@acorex/components/check-box';
|
|
9
|
-
import * as i7 from '@acorex/components/form';
|
|
10
|
-
import * as i8 from '@angular/forms';
|
|
11
|
-
import * as i9 from '@acorex/components/tooltip';
|
|
12
|
-
import * as i10 from '@acorex/components/loading';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { AXEvent, AXHtmlEvent, AXValueChangedEvent } from '@acorex/cdk/common';
|
|
4
|
+
import { AXDropListDroppedEvent } from '@acorex/cdk/drag-drop';
|
|
13
5
|
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
/**
|
|
7
|
+
* TreeView Component - Design Tokens
|
|
8
|
+
*
|
|
9
|
+
* The component supports the following CSS custom properties (design tokens):
|
|
10
|
+
*
|
|
11
|
+
* **Layout & Spacing:**
|
|
12
|
+
* - `--ax-comp-tree-view-indent-size`: Indentation size for each tree level.
|
|
13
|
+
* Default: `12px`
|
|
14
|
+
* - `--ax-comp-tree-view-node-margin`: Vertical margin between nodes.
|
|
15
|
+
* Default: `0.125rem`
|
|
16
|
+
*
|
|
17
|
+
* **Node Styling:**
|
|
18
|
+
* - `--ax-comp-tree-view-node-border-radius`: Border radius for tree nodes.
|
|
19
|
+
* Default: `6px`
|
|
20
|
+
* - `--ax-comp-tree-view-node-hover-bg`: Background color on node hover.
|
|
21
|
+
* Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.04)`
|
|
22
|
+
* - `--ax-comp-tree-view-node-selected-bg`: Background color for selected nodes.
|
|
23
|
+
* Default: `rgba(var(--ax-sys-color-primary-500), 0.12)`
|
|
24
|
+
*
|
|
25
|
+
* **Tree Lines (with-line look):**
|
|
26
|
+
* - `--ax-comp-tree-view-line-color`: Color for tree structure lines.
|
|
27
|
+
* Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.15)`
|
|
28
|
+
*
|
|
29
|
+
* **Drag & Drop:**
|
|
30
|
+
* - `--ax-comp-tree-view-drag-preview-opacity`: Opacity of dragged element preview.
|
|
31
|
+
* Default: `0.9`
|
|
32
|
+
* - `--ax-comp-tree-view-drag-placeholder-bg`: Background for drag placeholder.
|
|
33
|
+
* Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.02)`
|
|
34
|
+
* - `--ax-comp-tree-view-drop-active-bg`: Background when hovering over valid drop zone.
|
|
35
|
+
* Default: `rgba(var(--ax-sys-color-primary-500), 0.08)`
|
|
36
|
+
* - `--ax-comp-tree-view-drop-active-outline`: Outline color for active drop zones.
|
|
37
|
+
* Default: `rgba(var(--ax-sys-color-primary-500), 0.3)`
|
|
38
|
+
*
|
|
39
|
+
* **Dynamic Tokens (set via TypeScript):**
|
|
40
|
+
* - `--ax-tree-view-indent-size`: Dynamically set from `indentSize` input
|
|
41
|
+
* - `--ax-tree-view-line-offset`: Dynamically calculated as `indentSize / 2`
|
|
42
|
+
* - `--ax-tree-view-line-color`: Optional override for line color
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```css
|
|
46
|
+
* // Customize tree appearance
|
|
47
|
+
* ax-tree-view {
|
|
48
|
+
* --ax-comp-tree-view-indent-size: 16px;
|
|
49
|
+
* --ax-comp-tree-view-node-selected-bg: rgba(var(--ax-sys-color-primary-600), 0.15);
|
|
50
|
+
* --ax-comp-tree-view-line-color: rgba(var(--ax-sys-color-on-lightest-surface), 0.1);
|
|
51
|
+
* --ax-comp-tree-view-node-hover-bg: rgba(var(--ax-sys-color-primary-500), 0.06);
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* All color tokens use Acorex design system variables (`--ax-sys-color-*`) for automatic
|
|
57
|
+
* light/dark mode support. Colors adapt based on the active theme without additional configuration.
|
|
58
|
+
*/
|
|
59
|
+
interface AXTreeViewBeforeDropEvent extends AXEvent {
|
|
60
|
+
movedNode: AXTreeViewNode;
|
|
61
|
+
previousParent?: AXTreeViewNode;
|
|
62
|
+
currentParent?: AXTreeViewNode;
|
|
63
|
+
previousIndex: number;
|
|
64
|
+
currentIndex: number;
|
|
65
|
+
canceled: boolean;
|
|
16
66
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
abstract onCollapsedChanged: EventEmitter<{
|
|
45
|
-
component: any;
|
|
46
|
-
data: unknown;
|
|
47
|
-
nativeElement: any;
|
|
48
|
-
}>;
|
|
49
|
-
abstract onNodeClick: EventEmitter<{
|
|
50
|
-
component: any;
|
|
51
|
-
data: unknown;
|
|
52
|
-
nativeElement: any;
|
|
53
|
-
}>;
|
|
54
|
-
abstract onNodedbClick: EventEmitter<{
|
|
55
|
-
component: any;
|
|
56
|
-
data: unknown;
|
|
57
|
-
nativeElement: any;
|
|
58
|
-
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Tree view node interface.
|
|
69
|
+
*
|
|
70
|
+
* By default, nodes should have the following structure:
|
|
71
|
+
* ```typescript
|
|
72
|
+
* {
|
|
73
|
+
* id: string; // Unique identifier for the node
|
|
74
|
+
* title: string; // Display text for the node
|
|
75
|
+
* tooltip?: string; // Optional tooltip text
|
|
76
|
+
* icon?: string; // Optional icon class name
|
|
77
|
+
* expanded?: boolean; // Whether the node is expanded
|
|
78
|
+
* selected?: boolean; // Whether the node is selected
|
|
79
|
+
* indeterminate?: boolean; // Whether the checkbox is in indeterminate state
|
|
80
|
+
* disabled?: boolean; // Whether the node is disabled
|
|
81
|
+
* hidden?: boolean; // Whether the node is hidden
|
|
82
|
+
* children?: AXTreeViewNode[]; // Child nodes
|
|
83
|
+
* childrenCount?: number; // Count of children (for lazy loading)
|
|
84
|
+
* data?: unknown; // Optional custom data
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* However, you can use custom field names by providing field name inputs
|
|
89
|
+
* (idField, titleField, etc.) to the component. The component will then
|
|
90
|
+
* use those field names to access node properties.
|
|
91
|
+
*/
|
|
92
|
+
interface AXTreeViewNode {
|
|
93
|
+
[key: string]: unknown;
|
|
59
94
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
95
|
+
interface AXTreeViewNodeToggleEvent extends AXHtmlEvent {
|
|
96
|
+
node: AXTreeViewNode;
|
|
97
|
+
}
|
|
98
|
+
interface AXTreeViewNodeSelectEvent extends AXHtmlEvent {
|
|
99
|
+
node: AXTreeViewNode;
|
|
100
|
+
}
|
|
101
|
+
interface AXTreeViewNodeDoubleClickEvent extends AXHtmlEvent {
|
|
102
|
+
node: AXTreeViewNode;
|
|
103
|
+
}
|
|
104
|
+
interface AXTreeViewNodeClickEvent extends AXHtmlEvent {
|
|
105
|
+
node: AXTreeViewNode;
|
|
106
|
+
}
|
|
107
|
+
interface AXTreeViewSelectionChangeEvent extends AXEvent {
|
|
108
|
+
selectedNodes: AXTreeViewNode[];
|
|
109
|
+
}
|
|
110
|
+
interface AXTreeViewDropEvent extends AXEvent {
|
|
111
|
+
node: AXTreeViewNode;
|
|
112
|
+
previousParent?: AXTreeViewNode;
|
|
113
|
+
currentParent?: AXTreeViewNode;
|
|
114
|
+
previousIndex: number;
|
|
115
|
+
currentIndex: number;
|
|
116
|
+
}
|
|
117
|
+
interface AXTreeViewItemTemplateContext {
|
|
118
|
+
$implicit: AXTreeViewNode;
|
|
119
|
+
node: AXTreeViewNode;
|
|
120
|
+
level: number;
|
|
121
|
+
expanded: boolean;
|
|
122
|
+
childrenCount: number;
|
|
123
|
+
loading: boolean;
|
|
124
|
+
/** Whether the node is effectively disabled (considering inheritance from parents) */
|
|
125
|
+
disabled: boolean;
|
|
126
|
+
}
|
|
127
|
+
type AXTreeViewViewLook = 'default' | 'card' | 'with-line';
|
|
128
|
+
type AXTreeViewDragArea = 'handler' | 'item';
|
|
129
|
+
type AXTreeViewDragBehavior = 'none' | 'order-only' | 'move' | 'both';
|
|
130
|
+
type AXTreeViewSelectMode = 'none' | 'single' | 'multiple';
|
|
131
|
+
/**
|
|
132
|
+
* Selection behavior mode for tree nodes.
|
|
133
|
+
*
|
|
134
|
+
* Controls how node selection behaves in the tree:
|
|
135
|
+
* - **'all'**: No restrictions or special behavior. Any node can be selected independently.
|
|
136
|
+
* - **'intermediate'**: When children are selected, parent nodes show indeterminate state.
|
|
137
|
+
* If all children are selected, parent becomes selected; if some are selected, parent shows indeterminate.
|
|
138
|
+
* - **'leaf'**: Only leaf nodes (nodes with no children) can be selected. Parent nodes cannot be selected.
|
|
139
|
+
* - **'nested'**: Selecting a parent node automatically selects all its children (cascading selection).
|
|
140
|
+
* - **'intermediate-nested'**: Combines both behaviors - selecting parent selects children AND children selection affects parent state.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* // Allow any node to be selected
|
|
145
|
+
* <ax-tree-view [selectionBehavior]="'all'" />
|
|
146
|
+
*
|
|
147
|
+
* // Only leaf nodes can be selected
|
|
148
|
+
* <ax-tree-view [selectionBehavior]="'leaf'" />
|
|
149
|
+
*
|
|
150
|
+
* // Parent shows indeterminate when children are selected
|
|
151
|
+
* <ax-tree-view [selectionBehavior]="'intermediate'" />
|
|
152
|
+
*
|
|
153
|
+
* // Selecting parent selects all children
|
|
154
|
+
* <ax-tree-view [selectionBehavior]="'nested'" />
|
|
155
|
+
*
|
|
156
|
+
* // Both: selecting parent selects children AND children affect parent state
|
|
157
|
+
* <ax-tree-view [selectionBehavior]="'intermediate-nested'" />
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
type AXTreeViewSelectionBehavior = 'all' | 'intermediate' | 'leaf' | 'nested' | 'intermediate-nested';
|
|
161
|
+
/**
|
|
162
|
+
* Function type for lazy loading tree nodes
|
|
163
|
+
*/
|
|
164
|
+
type AXTreeViewCallback = (id?: string) => AXTreeViewNode[] | Promise<AXTreeViewNode[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Data source type - can be static array or lazy loading function
|
|
167
|
+
*/
|
|
168
|
+
type AXTreeViewDataSource = AXTreeViewNode[] | AXTreeViewCallback;
|
|
169
|
+
/**
|
|
170
|
+
* Flat node representation for keyboard navigation
|
|
171
|
+
*/
|
|
172
|
+
interface AXTreeViewFlatNode {
|
|
173
|
+
node: AXTreeViewNode;
|
|
174
|
+
level: number;
|
|
175
|
+
parent?: AXTreeViewNode;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Children selection state for parent node calculation
|
|
179
|
+
*/
|
|
180
|
+
interface AXTreeViewChildrenSelectionState {
|
|
181
|
+
allSelected: boolean;
|
|
182
|
+
someSelected: boolean;
|
|
76
183
|
}
|
|
77
184
|
|
|
78
|
-
declare class AXTreeViewComponent
|
|
185
|
+
declare class AXTreeViewComponent {
|
|
79
186
|
#private;
|
|
80
|
-
|
|
81
|
-
private
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
protected
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
private readonly treeService;
|
|
188
|
+
private readonly platformService;
|
|
189
|
+
private readonly destroyRef;
|
|
190
|
+
/** Tree data source - can be static array or lazy loading function */
|
|
191
|
+
readonly datasource: _angular_core.ModelSignal<AXTreeViewDataSource>;
|
|
192
|
+
/** Selection mode: 'single' (click to select) or 'multiple' (checkbox selection). Default: `'single'`. In multiple mode, checkboxes are automatically shown. */
|
|
193
|
+
readonly selectMode: _angular_core.InputSignal<AXTreeViewSelectMode>;
|
|
194
|
+
/** Selection behavior: 'all' (select anything, no special behavior), 'intermediate' (parent indeterminate state when children selected), 'leaf' (only leaf nodes selectable), 'nested' (selecting parent selects all children). Default: `'intermediate'` */
|
|
195
|
+
readonly selectionBehavior: _angular_core.InputSignal<AXTreeViewSelectionBehavior>;
|
|
196
|
+
/** Drag area: 'handler' (drag handle), 'item' (entire item). Default: `'handler'` */
|
|
197
|
+
readonly dragArea: _angular_core.InputSignal<AXTreeViewDragArea>;
|
|
198
|
+
/** Drag behavior: 'none' (disabled), 'order-only' (reorder only), 'move' (move between parents), 'both' (allow both). Default: `'none'` */
|
|
199
|
+
readonly dragBehavior: _angular_core.InputSignal<AXTreeViewDragBehavior>;
|
|
200
|
+
/** Whether to show icons. Default: `true` */
|
|
201
|
+
readonly showIcons: _angular_core.InputSignal<boolean>;
|
|
202
|
+
/** Whether to show children count badge. Default: `true` */
|
|
203
|
+
readonly showChildrenBadge: _angular_core.InputSignal<boolean>;
|
|
204
|
+
/** Custom icon for expanded nodes. Default: `'fa-solid fa-chevron-down'` */
|
|
205
|
+
readonly expandedIcon: _angular_core.InputSignal<string>;
|
|
206
|
+
/** Custom icon for collapsed nodes. Default: `'fa-solid fa-chevron-right'` */
|
|
207
|
+
readonly collapsedIcon: _angular_core.InputSignal<string>;
|
|
208
|
+
/** Indent size in pixels for each level. Default: `16` */
|
|
209
|
+
readonly indentSize: _angular_core.InputSignal<number>;
|
|
210
|
+
/** Visual style variant. Default: `'default'` */
|
|
211
|
+
readonly look: _angular_core.InputSignal<AXTreeViewViewLook>;
|
|
212
|
+
/** Custom template for tree items. Default: `undefined` */
|
|
213
|
+
readonly nodeTemplate: _angular_core.InputSignal<TemplateRef<AXTreeViewItemTemplateContext>>;
|
|
214
|
+
/** Field name for node ID. Default: `'id'` */
|
|
215
|
+
readonly idField: _angular_core.InputSignal<string>;
|
|
216
|
+
/** Field name for node title. Default: `'title'` */
|
|
217
|
+
readonly titleField: _angular_core.InputSignal<string>;
|
|
218
|
+
/** Field name for node tooltip. Default: `'tooltip'` */
|
|
219
|
+
readonly tooltipField: _angular_core.InputSignal<string>;
|
|
220
|
+
/** Field name for node icon. Default: `'icon'` */
|
|
221
|
+
readonly iconField: _angular_core.InputSignal<string>;
|
|
222
|
+
/** Field name for expanded state. Default: `'expanded'` */
|
|
223
|
+
readonly expandedField: _angular_core.InputSignal<string>;
|
|
224
|
+
/** Field name for selected state. Default: `'selected'` */
|
|
225
|
+
readonly selectedField: _angular_core.InputSignal<string>;
|
|
226
|
+
/** Field name for indeterminate state. Default: `'indeterminate'` */
|
|
227
|
+
readonly indeterminateField: _angular_core.InputSignal<string>;
|
|
228
|
+
/** Field name for disabled state. Default: `'disabled'` */
|
|
229
|
+
readonly disabledField: _angular_core.InputSignal<string>;
|
|
230
|
+
/** Field name for hidden state. Default: `'hidden'` */
|
|
231
|
+
readonly hiddenField: _angular_core.InputSignal<string>;
|
|
232
|
+
/** Field name for children array. Default: `'children'` */
|
|
233
|
+
readonly childrenField: _angular_core.InputSignal<string>;
|
|
234
|
+
/** Field name for children count. Default: `'childrenCount'` */
|
|
235
|
+
readonly childrenCountField: _angular_core.InputSignal<string>;
|
|
236
|
+
/** Field name for custom data. Default: `'data'` */
|
|
237
|
+
readonly dataField: _angular_core.InputSignal<string>;
|
|
238
|
+
/** Whether disabled state is inherited from parent nodes. Default: `true`. */
|
|
239
|
+
readonly inheritDisabled: _angular_core.InputSignal<boolean>;
|
|
240
|
+
/** Emitted before a drop operation - set canceled to true to prevent drop */
|
|
241
|
+
readonly onBeforeDrop: _angular_core.OutputEmitterRef<AXTreeViewBeforeDropEvent>;
|
|
242
|
+
/** Emitted when a node is toggled (expanded/collapsed) */
|
|
243
|
+
readonly onNodeToggle: _angular_core.OutputEmitterRef<AXTreeViewNodeToggleEvent>;
|
|
244
|
+
/** Emitted when a node is selected/deselected */
|
|
245
|
+
readonly onNodeSelect: _angular_core.OutputEmitterRef<AXTreeViewNodeSelectEvent>;
|
|
246
|
+
/** Emitted when a node is double-clicked */
|
|
247
|
+
readonly onNodeDoubleClick: _angular_core.OutputEmitterRef<AXTreeViewNodeDoubleClickEvent>;
|
|
248
|
+
/** Emitted when a node is double-clicked */
|
|
249
|
+
readonly onNodeClick: _angular_core.OutputEmitterRef<AXTreeViewNodeClickEvent>;
|
|
250
|
+
/** Emitted when selection changes - returns all currently selected nodes */
|
|
251
|
+
readonly onSelectionChange: _angular_core.OutputEmitterRef<AXTreeViewSelectionChangeEvent>;
|
|
252
|
+
/** Emitted when nodes are reordered within the same parent */
|
|
253
|
+
readonly onOrderChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
|
|
254
|
+
/** Emitted when a node is moved to a different parent */
|
|
255
|
+
readonly onMoveChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
|
|
256
|
+
/** Emitted for any item change (order or move) */
|
|
257
|
+
readonly onItemsChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
|
|
258
|
+
/** Internal signal for tree nodes */
|
|
259
|
+
protected readonly nodes: _angular_core.WritableSignal<AXTreeViewNode[]>;
|
|
260
|
+
/** Internal signal for tracking loading state of individual nodes */
|
|
261
|
+
protected readonly loadingNodes: _angular_core.WritableSignal<Set<string>>;
|
|
262
|
+
/** Signal for tracking root/tree-level loading state (used by reloadData) */
|
|
263
|
+
private readonly _isLoading;
|
|
264
|
+
/** Public readonly signal for tree loading state - can be used in templates */
|
|
265
|
+
readonly isLoading: _angular_core.Signal<boolean>;
|
|
266
|
+
/** Currently focused node ID for keyboard navigation */
|
|
267
|
+
protected readonly focusedNodeId: _angular_core.WritableSignal<string>;
|
|
268
|
+
/** RTL detection signal */
|
|
269
|
+
protected readonly isRtl: _angular_core.WritableSignal<boolean>;
|
|
270
|
+
/** active node id */
|
|
271
|
+
protected readonly activeNodeId: _angular_core.WritableSignal<string>;
|
|
272
|
+
/** Computed chevron icons that flip for RTL */
|
|
273
|
+
protected readonly directionExpandedIcon: _angular_core.Signal<string>;
|
|
274
|
+
protected readonly directionCollapsedIcon: _angular_core.Signal<string>;
|
|
275
|
+
/** Flag to prevent infinite loops when syncing datasource */
|
|
276
|
+
private isUpdatingFromDatasource;
|
|
277
|
+
/** Computed to check if datasource is a function */
|
|
278
|
+
private readonly isLazyDataSource;
|
|
279
|
+
/** Computed: Returns true when selection is restricted to leaf nodes only */
|
|
280
|
+
protected readonly isLeafOnlyMode: _angular_core.Signal<boolean>;
|
|
281
|
+
/** Computed: Returns true when selecting a parent automatically selects all its children */
|
|
282
|
+
protected readonly cascadesToChildren: _angular_core.Signal<boolean>;
|
|
283
|
+
/** Computed: Returns true when parent nodes show indeterminate state based on children selection */
|
|
284
|
+
protected readonly hasIntermediateState: _angular_core.Signal<boolean>;
|
|
285
|
+
/** Computed: Returns true when drag handle should be shown */
|
|
286
|
+
protected readonly shouldShowDragHandle: _angular_core.Signal<boolean>;
|
|
287
|
+
/**
|
|
288
|
+
* Get a property value from a node using the configured field name
|
|
289
|
+
*/
|
|
290
|
+
protected getNodeProp<T = unknown>(node: AXTreeViewNode, fieldName: string, defaultValue?: T): T;
|
|
291
|
+
/**
|
|
292
|
+
* Set a property value on a node using the configured field name
|
|
293
|
+
*/
|
|
294
|
+
protected setNodeProp(node: AXTreeViewNode, fieldName: string, value: unknown): void;
|
|
295
|
+
/**
|
|
296
|
+
* Get node ID
|
|
297
|
+
*/
|
|
298
|
+
protected getNodeId(node: AXTreeViewNode): string;
|
|
299
|
+
/**
|
|
300
|
+
* Get node title
|
|
301
|
+
*/
|
|
302
|
+
protected getNodeTitle(node: AXTreeViewNode): string;
|
|
303
|
+
/**
|
|
304
|
+
* Get node tooltip
|
|
305
|
+
*/
|
|
306
|
+
protected getNodeTooltip(node: AXTreeViewNode): string | undefined;
|
|
307
|
+
/**
|
|
308
|
+
* Get node icon
|
|
309
|
+
*/
|
|
310
|
+
protected getNodeIcon(node: AXTreeViewNode): string | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* Get node expanded state
|
|
313
|
+
*/
|
|
314
|
+
protected getNodeExpanded(node: AXTreeViewNode): boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Set node expanded state
|
|
317
|
+
*/
|
|
318
|
+
protected setNodeExpanded(node: AXTreeViewNode, value: boolean): void;
|
|
319
|
+
/**
|
|
320
|
+
* Get node selected state
|
|
321
|
+
*/
|
|
322
|
+
protected getNodeSelected(node: AXTreeViewNode): boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Set node selected state
|
|
325
|
+
*/
|
|
326
|
+
protected setNodeSelected(node: AXTreeViewNode, value: boolean): void;
|
|
327
|
+
/**
|
|
328
|
+
* Get node indeterminate state
|
|
329
|
+
*/
|
|
330
|
+
protected getNodeIndeterminate(node: AXTreeViewNode): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Set node indeterminate state
|
|
333
|
+
*/
|
|
334
|
+
protected setNodeIndeterminate(node: AXTreeViewNode, value: boolean): void;
|
|
335
|
+
/**
|
|
336
|
+
* Get node's own disabled state (without inheritance)
|
|
337
|
+
*/
|
|
338
|
+
protected getNodeDisabled(node: AXTreeViewNode): boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Check if node is effectively disabled (considering inheritance from parents)
|
|
341
|
+
* When inheritDisabled is true:
|
|
342
|
+
* - Returns true if node itself is disabled
|
|
343
|
+
* - Returns true if any ancestor is disabled AND node doesn't have explicit `disabled: false`
|
|
344
|
+
* When inheritDisabled is false:
|
|
345
|
+
* - Only returns node's own disabled state
|
|
346
|
+
*/
|
|
347
|
+
protected isNodeEffectivelyDisabled(node: AXTreeViewNode): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Check if any ancestor of the node is disabled
|
|
350
|
+
*/
|
|
351
|
+
private isAnyAncestorDisabled;
|
|
352
|
+
/**
|
|
353
|
+
* Get node hidden state
|
|
354
|
+
*/
|
|
355
|
+
protected getNodeHidden(node: AXTreeViewNode): boolean;
|
|
356
|
+
/**
|
|
357
|
+
* Get node children array
|
|
358
|
+
*/
|
|
359
|
+
protected getNodeChildren(node: AXTreeViewNode): AXTreeViewNode[] | undefined;
|
|
360
|
+
/**
|
|
361
|
+
* Set node children array
|
|
362
|
+
*/
|
|
363
|
+
protected setNodeChildren(node: AXTreeViewNode, value: AXTreeViewNode[] | undefined): void;
|
|
364
|
+
/**
|
|
365
|
+
* Get node children count
|
|
366
|
+
*/
|
|
367
|
+
protected getNodeChildrenCount(node: AXTreeViewNode): number | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* Set node children count
|
|
370
|
+
*/
|
|
371
|
+
protected setNodeChildrenCount(node: AXTreeViewNode, value: number | undefined): void;
|
|
372
|
+
/**
|
|
373
|
+
* Expand all nodes in the tree (with lazy loading support)
|
|
374
|
+
*/
|
|
375
|
+
expandAll(): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* Collapse all nodes in the tree
|
|
378
|
+
*/
|
|
379
|
+
collapseAll(): void;
|
|
380
|
+
/**
|
|
381
|
+
* Get count of selected nodes
|
|
382
|
+
*/
|
|
383
|
+
getSelectedCount(): number;
|
|
384
|
+
/**
|
|
385
|
+
* Check if any nodes are selected
|
|
386
|
+
*/
|
|
387
|
+
hasSelection(): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Get all selected nodes
|
|
390
|
+
*/
|
|
391
|
+
getSelectedNodes(): AXTreeViewNode[];
|
|
392
|
+
/**
|
|
393
|
+
* Delete selected nodes from the tree
|
|
394
|
+
*/
|
|
395
|
+
deleteSelected(): void;
|
|
396
|
+
/**
|
|
397
|
+
* Select all nodes in the tree (respects disabled state)
|
|
398
|
+
*/
|
|
399
|
+
selectAll(): void;
|
|
400
|
+
/**
|
|
401
|
+
* Deselect all nodes in the tree
|
|
402
|
+
*/
|
|
403
|
+
deselectAll(): void;
|
|
404
|
+
/**
|
|
405
|
+
* Find a node by ID in the tree
|
|
406
|
+
*/
|
|
407
|
+
findNode(id: string): AXTreeViewNode | null;
|
|
408
|
+
/**
|
|
409
|
+
* Refresh the tree to trigger change detection
|
|
410
|
+
*/
|
|
169
411
|
refresh(): void;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Reload the entire tree data from the datasource
|
|
414
|
+
* For callback datasource: clears all nodes and reloads from root
|
|
415
|
+
* For array datasource: refreshes the current data
|
|
416
|
+
* @returns Promise that resolves when reload is complete
|
|
417
|
+
*/
|
|
418
|
+
reloadData(): Promise<void>;
|
|
419
|
+
/**
|
|
420
|
+
* Check if the tree is currently loading data (root level)
|
|
421
|
+
* @returns true if the tree is loading root data
|
|
422
|
+
*/
|
|
423
|
+
getIsLoading(): boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Check if a node is currently loading
|
|
426
|
+
*/
|
|
427
|
+
isNodeLoading(nodeId: string): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Get loading state for a node (internal state)
|
|
430
|
+
*/
|
|
431
|
+
getNodeLoading(node: AXTreeViewNode): boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Edit/update a node's properties
|
|
434
|
+
* @param nodeId - The ID of the node to edit
|
|
435
|
+
* @param updates - Partial node object with properties to update
|
|
436
|
+
* @returns true if node was found and updated, false otherwise
|
|
437
|
+
*/
|
|
438
|
+
editNode(nodeId: string, updates: Partial<AXTreeViewNode>): boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Add a child node to a parent node
|
|
441
|
+
* @param parentId - The ID of the parent node
|
|
442
|
+
* @param childNode - The child node to add
|
|
443
|
+
* @param index - Optional index to insert at (default: append to end)
|
|
444
|
+
* @returns true if parent was found and child was added, false otherwise
|
|
445
|
+
*/
|
|
446
|
+
addChild(parentId: string, childNode: AXTreeViewNode, index?: number): boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Remove a node from the tree
|
|
449
|
+
* @param nodeId - The ID of the node to remove
|
|
450
|
+
* @returns The removed node if found, null otherwise
|
|
451
|
+
*/
|
|
452
|
+
removeNode(nodeId: string): AXTreeViewNode | null;
|
|
453
|
+
/**
|
|
454
|
+
* Expand a specific node
|
|
455
|
+
* @param nodeId - The ID of the node to expand
|
|
456
|
+
* @returns Promise that resolves when expansion is complete (if lazy loading)
|
|
457
|
+
*/
|
|
458
|
+
expandNode(nodeId: string): Promise<void>;
|
|
459
|
+
/**
|
|
460
|
+
* Collapse a specific node
|
|
461
|
+
* @param nodeId - The ID of the node to collapse
|
|
462
|
+
*/
|
|
463
|
+
collapseNode(nodeId: string): void;
|
|
464
|
+
/**
|
|
465
|
+
* Toggle expansion state of a specific node
|
|
466
|
+
* @param nodeId - The ID of the node to toggle
|
|
467
|
+
* @returns Promise that resolves when toggle is complete (if lazy loading)
|
|
468
|
+
*/
|
|
469
|
+
toggleNodeExpansion(nodeId: string): Promise<void>;
|
|
470
|
+
/**
|
|
471
|
+
* Programmatically select a node
|
|
472
|
+
* @param nodeId - The ID of the node to select
|
|
473
|
+
* @returns true if node was found and selected, false otherwise
|
|
474
|
+
*/
|
|
475
|
+
selectNode(nodeId: string): boolean;
|
|
476
|
+
/**
|
|
477
|
+
* Programmatically deselect a node
|
|
478
|
+
* @param nodeId - The ID of the node to deselect
|
|
479
|
+
* @returns true if node was found and deselected, false otherwise
|
|
480
|
+
*/
|
|
481
|
+
deselectNode(nodeId: string): boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Get parent node of a given node
|
|
484
|
+
* @param nodeId - The ID of the node
|
|
485
|
+
* @returns The parent node if found, null otherwise
|
|
486
|
+
*/
|
|
487
|
+
getParent(nodeId: string): AXTreeViewNode | null;
|
|
488
|
+
/**
|
|
489
|
+
* Get children of a node
|
|
490
|
+
* @param nodeId - The ID of the parent node
|
|
491
|
+
* @returns Array of child nodes, or null if node not found
|
|
492
|
+
*/
|
|
493
|
+
getChildren(nodeId: string): AXTreeViewNode[] | null;
|
|
494
|
+
/**
|
|
495
|
+
* Get all root nodes
|
|
496
|
+
* @returns Array of root nodes
|
|
497
|
+
*/
|
|
498
|
+
getRootNodes(): AXTreeViewNode[];
|
|
499
|
+
/**
|
|
500
|
+
* Get all nodes in a flat array
|
|
501
|
+
* @returns Array of all nodes in the tree
|
|
502
|
+
*/
|
|
503
|
+
getAllNodes(): AXTreeViewNode[];
|
|
504
|
+
/**
|
|
505
|
+
* Get the path to a node (array of parent IDs from root to node)
|
|
506
|
+
* @param nodeId - The ID of the node
|
|
507
|
+
* @returns Array of node IDs representing the path, or empty array if node not found
|
|
508
|
+
*/
|
|
509
|
+
getNodePath(nodeId: string): string[];
|
|
510
|
+
/**
|
|
511
|
+
* Get the level/depth of a node (0 = root level)
|
|
512
|
+
* @param nodeId - The ID of the node
|
|
513
|
+
* @returns The level of the node, or -1 if node not found
|
|
514
|
+
*/
|
|
515
|
+
getNodeLevel(nodeId: string): number;
|
|
516
|
+
/**
|
|
517
|
+
* Programmatically move a node to a new parent
|
|
518
|
+
* @param nodeId - The ID of the node to move
|
|
519
|
+
* @param newParentId - The ID of the new parent (undefined for root level)
|
|
520
|
+
* @param index - Optional index to insert at (default: append to end)
|
|
521
|
+
* @returns true if move was successful, false otherwise
|
|
522
|
+
*/
|
|
523
|
+
moveNode(nodeId: string, newParentId?: string, index?: number): boolean;
|
|
524
|
+
/**
|
|
525
|
+
* Clone a node (creates a deep copy)
|
|
526
|
+
* @param nodeId - The ID of the node to clone
|
|
527
|
+
* @returns The cloned node, or null if node not found
|
|
528
|
+
*/
|
|
529
|
+
cloneNode(nodeId: string): AXTreeViewNode | null;
|
|
530
|
+
/**
|
|
531
|
+
* Focus a specific node by ID
|
|
532
|
+
* @param nodeId - The ID of the node to focus
|
|
533
|
+
* @returns true if node was found and focused, false otherwise
|
|
534
|
+
*/
|
|
535
|
+
focusNode(nodeId: string): boolean;
|
|
536
|
+
/**
|
|
537
|
+
* Get all expanded nodes
|
|
538
|
+
* @returns Array of expanded nodes
|
|
539
|
+
*/
|
|
540
|
+
getExpandedNodes(): AXTreeViewNode[];
|
|
541
|
+
/**
|
|
542
|
+
* Get all collapsed nodes that have children
|
|
543
|
+
* @returns Array of collapsed nodes with children
|
|
544
|
+
*/
|
|
545
|
+
getCollapsedNodes(): AXTreeViewNode[];
|
|
546
|
+
/**
|
|
547
|
+
* Check if a node is expanded
|
|
548
|
+
* @param nodeId - The ID of the node
|
|
549
|
+
* @returns true if node is expanded, false otherwise
|
|
550
|
+
*/
|
|
551
|
+
isNodeExpanded(nodeId: string): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Check if a node is selected
|
|
554
|
+
* @param nodeId - The ID of the node
|
|
555
|
+
* @returns true if node is selected, false otherwise
|
|
556
|
+
*/
|
|
557
|
+
isNodeSelected(nodeId: string): boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Check if a node has children
|
|
560
|
+
* @param nodeId - The ID of the node
|
|
561
|
+
* @returns true if node has children, false otherwise
|
|
562
|
+
*/
|
|
563
|
+
hasChildren(nodeId: string): boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Check if a node is disabled (considering inheritance from parent nodes)
|
|
566
|
+
* @param nodeId - The ID of the node
|
|
567
|
+
* @returns true if node is disabled (directly or inherited), false otherwise
|
|
568
|
+
*/
|
|
569
|
+
isDisabled(nodeId: string): boolean;
|
|
570
|
+
/**
|
|
571
|
+
* Get template context for a node
|
|
572
|
+
*/
|
|
573
|
+
getTemplateContext(node: AXTreeViewNode, level?: number): AXTreeViewItemTemplateContext;
|
|
574
|
+
/**
|
|
575
|
+
* Calculate padding-inline for a node based on its level
|
|
576
|
+
*/
|
|
577
|
+
getNodePaddingInline(level: number): number;
|
|
578
|
+
/**
|
|
579
|
+
* Check if node should show expand toggle
|
|
580
|
+
*/
|
|
581
|
+
shouldShowExpandToggle(node: AXTreeViewNode): boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Check if checkboxes should be shown (only for multiple mode)
|
|
584
|
+
*/
|
|
585
|
+
shouldShowCheckbox(): boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Check if a node is a leaf (has no children)
|
|
588
|
+
* A node is a leaf if it has no loaded children AND no childrenCount (or childrenCount is 0)
|
|
589
|
+
*/
|
|
590
|
+
isLeafNode(node: AXTreeViewNode): boolean;
|
|
591
|
+
/**
|
|
592
|
+
* Check if a node can be selected (considering selectMode and isLeafOnlyMode)
|
|
593
|
+
*/
|
|
594
|
+
canSelectNode(node: AXTreeViewNode): boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Check if checkbox should be shown for a specific node
|
|
597
|
+
*/
|
|
598
|
+
shouldShowCheckboxForNode(node: AXTreeViewNode): boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Generate unique list ID for each node
|
|
601
|
+
*/
|
|
602
|
+
getListId(node?: AXTreeViewNode): string;
|
|
603
|
+
/**
|
|
604
|
+
* Check if a node is currently focused
|
|
605
|
+
*/
|
|
606
|
+
isNodeFocused(nodeId: string): boolean;
|
|
607
|
+
/**
|
|
608
|
+
* Get ARIA level for a node
|
|
609
|
+
*/
|
|
610
|
+
getNodeAriaLevel(level: number): number;
|
|
611
|
+
/**
|
|
612
|
+
* Get ARIA expanded state for a node
|
|
613
|
+
*/
|
|
614
|
+
getNodeAriaExpanded(node: AXTreeViewNode): string | null;
|
|
615
|
+
/**
|
|
616
|
+
* Get ARIA selected state for a node
|
|
617
|
+
*/
|
|
618
|
+
getNodeAriaSelected(node: AXTreeViewNode): string | null;
|
|
619
|
+
/**
|
|
620
|
+
* Emit selection change event with all selected nodes
|
|
621
|
+
*/
|
|
622
|
+
private emitSelectionChange;
|
|
623
|
+
/**
|
|
624
|
+
* Handle node double click
|
|
625
|
+
*/
|
|
626
|
+
onNodeDoubleClickHandle(node: AXTreeViewNode, event: Event): void;
|
|
627
|
+
/**
|
|
628
|
+
* Handle node click handle
|
|
629
|
+
*/
|
|
630
|
+
onNodeClickHandle(node: AXTreeViewNode, event: Event): void;
|
|
631
|
+
/**
|
|
632
|
+
* Toggle node expansion state with lazy loading support
|
|
633
|
+
* Note: Disabled nodes can still be toggled (expanded/collapsed) for better UX
|
|
634
|
+
*/
|
|
635
|
+
toggleNode(node: AXTreeViewNode, event: Event): Promise<void>;
|
|
636
|
+
/**
|
|
637
|
+
* Toggle node selection state with indeterminate support (for multiple mode)
|
|
638
|
+
*/
|
|
639
|
+
toggleSelection(node: AXTreeViewNode, event: AXValueChangedEvent): void;
|
|
640
|
+
/**
|
|
641
|
+
* Handle drop events for tree nodes
|
|
642
|
+
*/
|
|
643
|
+
onDrop(event: AXDropListDroppedEvent, parentNode?: AXTreeViewNode): void;
|
|
644
|
+
/**
|
|
645
|
+
* Handle drop events when dropping directly onto a node (to make it a child)
|
|
646
|
+
*/
|
|
647
|
+
onDropOntoNode(event: AXDropListDroppedEvent, targetNode: AXTreeViewNode): void;
|
|
648
|
+
/**
|
|
649
|
+
* Handle node focus event
|
|
650
|
+
*/
|
|
651
|
+
onNodeFocus(nodeId: string): void;
|
|
652
|
+
/**
|
|
653
|
+
* Handle tree container focus - focus first node if none is focused
|
|
654
|
+
*/
|
|
655
|
+
onTreeFocus(event: FocusEvent): void;
|
|
656
|
+
/**
|
|
657
|
+
* Handle tree container blur
|
|
658
|
+
*/
|
|
659
|
+
onTreeBlur(event: FocusEvent): void;
|
|
660
|
+
/**
|
|
661
|
+
* Handle keyboard navigation
|
|
662
|
+
*/
|
|
663
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
664
|
+
/**
|
|
665
|
+
* Load root items when datasource is a function
|
|
666
|
+
*/
|
|
667
|
+
private loadRootItems;
|
|
668
|
+
/**
|
|
669
|
+
* Load children for a node using lazy loading
|
|
670
|
+
* Only calls callback if:
|
|
671
|
+
* - children field is undefined or empty
|
|
672
|
+
* - AND childrenCount > 0
|
|
673
|
+
*/
|
|
674
|
+
private loadNodeChildren;
|
|
675
|
+
/**
|
|
676
|
+
* Internal method to refresh nodes signal and sync back to datasource if it's an array
|
|
677
|
+
* Creates new array references for all nested children to ensure reactivity
|
|
678
|
+
*/
|
|
679
|
+
private refreshNodes;
|
|
680
|
+
/**
|
|
681
|
+
* Recursively ensure all children arrays have new references to trigger change detection
|
|
682
|
+
* Mutates the tree structure by replacing children arrays with new array references
|
|
683
|
+
*/
|
|
684
|
+
private ensureNewArrayReferences;
|
|
685
|
+
/**
|
|
686
|
+
* Handle single selection mode
|
|
687
|
+
*/
|
|
688
|
+
private handleSingleSelection;
|
|
689
|
+
/**
|
|
690
|
+
* Handle multiple selection mode (used internally, but in multiple mode selection is primarily handled by checkboxes)
|
|
691
|
+
*/
|
|
692
|
+
private handleMultipleSelection;
|
|
693
|
+
/**
|
|
694
|
+
* Get array reference by drop list ID
|
|
695
|
+
*/
|
|
696
|
+
private getArrayByListId;
|
|
697
|
+
/**
|
|
698
|
+
* Find parent node by list ID
|
|
699
|
+
*/
|
|
700
|
+
private findParentByListId;
|
|
701
|
+
/**
|
|
702
|
+
* Check if move operation is allowed based on dragBehavior
|
|
703
|
+
*/
|
|
704
|
+
private canMoveToParent;
|
|
705
|
+
/**
|
|
706
|
+
* Check if reorder operation is allowed based on dragBehavior
|
|
707
|
+
*/
|
|
708
|
+
private canReorder;
|
|
709
|
+
/**
|
|
710
|
+
* Handle reordering within the same list */
|
|
711
|
+
private handleReorder;
|
|
712
|
+
/**
|
|
713
|
+
* Handle moving between different lists
|
|
714
|
+
*/
|
|
715
|
+
private handleMove;
|
|
716
|
+
/**
|
|
717
|
+
* Emit beforeDrop event and return whether to continue
|
|
718
|
+
*/
|
|
719
|
+
private emitBeforeDropEvent;
|
|
720
|
+
/**
|
|
721
|
+
* Emit drop events based on operation type
|
|
722
|
+
*/
|
|
723
|
+
private emitDropEvents;
|
|
724
|
+
/**
|
|
725
|
+
* Get the currently focused node
|
|
726
|
+
*/
|
|
727
|
+
private getFocusedNode;
|
|
728
|
+
/**
|
|
729
|
+
* Set focus to a node by ID
|
|
730
|
+
*/
|
|
731
|
+
private focusNodeById;
|
|
732
|
+
/**
|
|
733
|
+
* Handle keyboard navigation keys
|
|
734
|
+
*/
|
|
735
|
+
private handleNavigationKey;
|
|
736
|
+
/**
|
|
737
|
+
* Handle Space key selection
|
|
738
|
+
* In single mode: replaces selection (deselects all, selects this node)
|
|
739
|
+
* In multiple mode: toggles selection
|
|
740
|
+
*/
|
|
741
|
+
private handleSpaceKeySelection;
|
|
742
|
+
/**
|
|
743
|
+
* Handle Enter key selection
|
|
744
|
+
* In single mode: replaces selection (deselects all, selects this node)
|
|
745
|
+
* In multiple mode: replaces selection (deselects all, selects this node and respects selectionBehavior)
|
|
746
|
+
*/
|
|
747
|
+
private handleEnterKeySelection;
|
|
748
|
+
/**
|
|
749
|
+
* Handle Ctrl/Cmd + Enter key selection
|
|
750
|
+
*/
|
|
751
|
+
private handleCtrlEnterSelection;
|
|
752
|
+
/**
|
|
753
|
+
* Type guard to check if value is an Event
|
|
754
|
+
*/
|
|
755
|
+
private isEvent;
|
|
756
|
+
/**
|
|
757
|
+
* Handle errors consistently
|
|
758
|
+
*/
|
|
759
|
+
private handleError;
|
|
173
760
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewComponent, never>;
|
|
174
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXTreeViewComponent, "ax-tree-view", never, { "
|
|
761
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXTreeViewComponent, "ax-tree-view", never, { "datasource": { "alias": "datasource"; "required": true; "isSignal": true; }; "selectMode": { "alias": "selectMode"; "required": false; "isSignal": true; }; "selectionBehavior": { "alias": "selectionBehavior"; "required": false; "isSignal": true; }; "dragArea": { "alias": "dragArea"; "required": false; "isSignal": true; }; "dragBehavior": { "alias": "dragBehavior"; "required": false; "isSignal": true; }; "showIcons": { "alias": "showIcons"; "required": false; "isSignal": true; }; "showChildrenBadge": { "alias": "showChildrenBadge"; "required": false; "isSignal": true; }; "expandedIcon": { "alias": "expandedIcon"; "required": false; "isSignal": true; }; "collapsedIcon": { "alias": "collapsedIcon"; "required": false; "isSignal": true; }; "indentSize": { "alias": "indentSize"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "nodeTemplate": { "alias": "nodeTemplate"; "required": false; "isSignal": true; }; "idField": { "alias": "idField"; "required": false; "isSignal": true; }; "titleField": { "alias": "titleField"; "required": false; "isSignal": true; }; "tooltipField": { "alias": "tooltipField"; "required": false; "isSignal": true; }; "iconField": { "alias": "iconField"; "required": false; "isSignal": true; }; "expandedField": { "alias": "expandedField"; "required": false; "isSignal": true; }; "selectedField": { "alias": "selectedField"; "required": false; "isSignal": true; }; "indeterminateField": { "alias": "indeterminateField"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "hiddenField": { "alias": "hiddenField"; "required": false; "isSignal": true; }; "childrenField": { "alias": "childrenField"; "required": false; "isSignal": true; }; "childrenCountField": { "alias": "childrenCountField"; "required": false; "isSignal": true; }; "dataField": { "alias": "dataField"; "required": false; "isSignal": true; }; "inheritDisabled": { "alias": "inheritDisabled"; "required": false; "isSignal": true; }; }, { "datasource": "datasourceChange"; "onBeforeDrop": "onBeforeDrop"; "onNodeToggle": "onNodeToggle"; "onNodeSelect": "onNodeSelect"; "onNodeDoubleClick": "onNodeDoubleClick"; "onNodeClick": "onNodeClick"; "onSelectionChange": "onSelectionChange"; "onOrderChange": "onOrderChange"; "onMoveChange": "onMoveChange"; "onItemsChange": "onItemsChange"; }, never, never, true, never>;
|
|
175
762
|
}
|
|
176
763
|
|
|
177
764
|
declare class AXTreeViewModule {
|
|
178
765
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewModule, never>;
|
|
179
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXTreeViewModule, never, [typeof AXTreeViewComponent
|
|
766
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXTreeViewModule, never, [typeof AXTreeViewComponent], never>;
|
|
180
767
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXTreeViewModule>;
|
|
181
768
|
}
|
|
182
769
|
|
|
183
|
-
|
|
184
|
-
|
|
770
|
+
/**
|
|
771
|
+
* Service for tree node operations
|
|
772
|
+
* Handles all business logic for tree node manipulation
|
|
773
|
+
*/
|
|
774
|
+
declare class AXTreeViewService {
|
|
775
|
+
private static readonly ROOT_LIST_ID;
|
|
776
|
+
private static readonly NODE_DROP_PREFIX;
|
|
777
|
+
private static readonly LIST_PREFIX;
|
|
778
|
+
/**
|
|
779
|
+
* Find a node by ID in the tree
|
|
780
|
+
*/
|
|
781
|
+
findNodeById(nodes: AXTreeViewNode[], id: string, idField?: string, childrenField?: string): AXTreeViewNode | null;
|
|
782
|
+
/**
|
|
783
|
+
* Find parent node of a given node
|
|
784
|
+
*/
|
|
785
|
+
findParentNode(nodes: AXTreeViewNode[], targetNode: AXTreeViewNode, idField?: string, childrenField?: string): AXTreeViewNode | undefined;
|
|
786
|
+
/**
|
|
787
|
+
* Check if targetNode is a descendant of ancestorNode (or the same node)
|
|
788
|
+
* Prevents circular references by checking if target exists in ancestor's children tree
|
|
789
|
+
*/
|
|
790
|
+
isValidDropTarget(movedNode: AXTreeViewNode, targetNode: AXTreeViewNode, idField?: string, childrenField?: string): boolean;
|
|
791
|
+
/**
|
|
792
|
+
* Check if targetNode is a descendant of ancestorNode
|
|
793
|
+
*/
|
|
794
|
+
private isNodeDescendantOf;
|
|
795
|
+
/**
|
|
796
|
+
* Build a flat list of all visible focusable nodes
|
|
797
|
+
*/
|
|
798
|
+
buildFlatNodeList(nodes: AXTreeViewNode[], hiddenField?: string, disabledField?: string, expandedField?: string, childrenField?: string): AXTreeViewFlatNode[];
|
|
799
|
+
/**
|
|
800
|
+
* Check if node has children
|
|
801
|
+
*/
|
|
802
|
+
hasChildren(node: AXTreeViewNode, childrenField?: string): boolean;
|
|
803
|
+
/**
|
|
804
|
+
* Check if node can be lazy loaded
|
|
805
|
+
*/
|
|
806
|
+
canLazyLoad(node: AXTreeViewNode, isLazyDataSource: boolean, childrenCountField?: string, childrenField?: string): boolean;
|
|
807
|
+
/**
|
|
808
|
+
* Recursively select/deselect all children
|
|
809
|
+
*/
|
|
810
|
+
selectAllChildren(children: AXTreeViewNode[], selected: boolean, selectedField?: string, indeterminateField?: string, childrenField?: string): void;
|
|
811
|
+
/**
|
|
812
|
+
* Get selection state of children
|
|
813
|
+
*/
|
|
814
|
+
getChildrenSelectionState(children: AXTreeViewNode[], selectedField?: string, indeterminateField?: string): AXTreeViewChildrenSelectionState;
|
|
815
|
+
/**
|
|
816
|
+
* Update parent node states based on children selection (with intermediate state support)
|
|
817
|
+
*/
|
|
818
|
+
updateParentStates(nodes: AXTreeViewNode[], changedNode: AXTreeViewNode, intermediateState: boolean, idField?: string, childrenField?: string, selectedField?: string, indeterminateField?: string): void;
|
|
819
|
+
/**
|
|
820
|
+
* Recursively deselect all nodes
|
|
821
|
+
*/
|
|
822
|
+
deselectAllNodes(nodes: AXTreeViewNode[], selectedField?: string, indeterminateField?: string, childrenField?: string): void;
|
|
823
|
+
/**
|
|
824
|
+
* Recursively set selection state for all nodes
|
|
825
|
+
*/
|
|
826
|
+
setAllSelection(nodes: AXTreeViewNode[], selected: boolean, selectedField?: string, indeterminateField?: string, childrenField?: string): void;
|
|
827
|
+
/**
|
|
828
|
+
* Recursively count selected nodes
|
|
829
|
+
*/
|
|
830
|
+
countSelected(nodes: AXTreeViewNode[], selectedField?: string, childrenField?: string): number;
|
|
831
|
+
/**
|
|
832
|
+
* Recursively collect selected nodes
|
|
833
|
+
*/
|
|
834
|
+
collectSelected(nodes: AXTreeViewNode[], result: AXTreeViewNode[], selectedField?: string, childrenField?: string): void;
|
|
835
|
+
/**
|
|
836
|
+
* Recursively remove selected nodes
|
|
837
|
+
*/
|
|
838
|
+
removeSelected(nodes: AXTreeViewNode[], selectedField?: string, indeterminateField?: string, childrenField?: string): void;
|
|
839
|
+
/**
|
|
840
|
+
* Recursively update all parent states in the tree (used after deletion)
|
|
841
|
+
*/
|
|
842
|
+
updateAllParentStates(nodes: AXTreeViewNode[], intermediateState: boolean, childrenField?: string, selectedField?: string, indeterminateField?: string): void;
|
|
843
|
+
/**
|
|
844
|
+
* Recursively set expanded state (with lazy loading)
|
|
845
|
+
*/
|
|
846
|
+
setExpandedState(nodes: AXTreeViewNode[], expanded: boolean, isLazyDataSource: boolean, loadNodeChildren: (node: AXTreeViewNode) => Promise<void>, expandedField?: string, childrenField?: string, childrenCountField?: string): Promise<void>;
|
|
847
|
+
/**
|
|
848
|
+
* Get array reference by drop list ID
|
|
849
|
+
*/
|
|
850
|
+
getArrayByListId(nodes: AXTreeViewNode[], listId: string, idField?: string, childrenField?: string): AXTreeViewNode[] | null;
|
|
851
|
+
/**
|
|
852
|
+
* Find parent node by list ID
|
|
853
|
+
*/
|
|
854
|
+
findParentByListId(nodes: AXTreeViewNode[], listId: string, idField?: string, childrenField?: string): AXTreeViewNode | undefined;
|
|
855
|
+
/**
|
|
856
|
+
* Generate unique list ID for each node
|
|
857
|
+
*/
|
|
858
|
+
getListId(node: AXTreeViewNode | undefined, idField?: string): string;
|
|
859
|
+
/**
|
|
860
|
+
* Get root list ID constant
|
|
861
|
+
*/
|
|
862
|
+
getRootListId(): string;
|
|
863
|
+
/**
|
|
864
|
+
* Get node drop prefix constant
|
|
865
|
+
*/
|
|
866
|
+
getNodeDropPrefix(): string;
|
|
867
|
+
/**
|
|
868
|
+
* Get list prefix constant
|
|
869
|
+
*/
|
|
870
|
+
getListPrefix(): string;
|
|
871
|
+
/**
|
|
872
|
+
* Get all nodes in a flat array
|
|
873
|
+
*/
|
|
874
|
+
getAllNodes(nodes: AXTreeViewNode[], childrenField?: string): AXTreeViewNode[];
|
|
875
|
+
/**
|
|
876
|
+
* Get the path to a node (array of parent nodes from root to node)
|
|
877
|
+
*/
|
|
878
|
+
getNodePath(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): AXTreeViewNode[];
|
|
879
|
+
/**
|
|
880
|
+
* Get the level/depth of a node (0 = root level)
|
|
881
|
+
*/
|
|
882
|
+
getNodeLevel(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): number;
|
|
883
|
+
/**
|
|
884
|
+
* Get sibling nodes of a given node
|
|
885
|
+
*/
|
|
886
|
+
getSiblings(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): AXTreeViewNode[];
|
|
887
|
+
/**
|
|
888
|
+
* Clone a node (creates a deep copy)
|
|
889
|
+
*/
|
|
890
|
+
cloneNode(node: AXTreeViewNode, idField?: string, titleField?: string, tooltipField?: string, iconField?: string, expandedField?: string, selectedField?: string, indeterminateField?: string, disabledField?: string, hiddenField?: string, childrenCountField?: string, dataField?: string, childrenField?: string): AXTreeViewNode;
|
|
891
|
+
/**
|
|
892
|
+
* Move a node to a new parent in the tree
|
|
893
|
+
* @param nodes - Root nodes array
|
|
894
|
+
* @param nodeId - The ID of the node to move
|
|
895
|
+
* @param newParentId - The ID of the new parent (undefined for root level)
|
|
896
|
+
* @param index - Optional index to insert at (default: append to end)
|
|
897
|
+
* @param idField - Field name for node ID
|
|
898
|
+
* @param childrenField - Field name for children array
|
|
899
|
+
* @param childrenCountField - Field name for children count
|
|
900
|
+
* @param expandedField - Field name for expanded state
|
|
901
|
+
* @returns Object with success status, moved node, previous parent, new parent, and indices
|
|
902
|
+
*/
|
|
903
|
+
moveNode(nodes: AXTreeViewNode[], nodeId: string, newParentId: string | undefined, index: number | undefined, idField?: string, childrenField?: string, childrenCountField?: string, expandedField?: string): {
|
|
904
|
+
success: boolean;
|
|
905
|
+
movedNode?: AXTreeViewNode;
|
|
906
|
+
previousParent?: AXTreeViewNode;
|
|
907
|
+
newParent?: AXTreeViewNode;
|
|
908
|
+
previousIndex: number;
|
|
909
|
+
currentIndex: number;
|
|
910
|
+
};
|
|
911
|
+
/**
|
|
912
|
+
* Edit/update a node's properties
|
|
913
|
+
* @param nodes - Root nodes array
|
|
914
|
+
* @param nodeId - The ID of the node to edit
|
|
915
|
+
* @param updates - Partial node object with properties to update
|
|
916
|
+
* @param idField - Field name for node ID
|
|
917
|
+
* @param childrenField - Field name for children array
|
|
918
|
+
* @param childrenCountField - Field name for children count
|
|
919
|
+
* @returns The updated node if found, null otherwise
|
|
920
|
+
*/
|
|
921
|
+
editNode(nodes: AXTreeViewNode[], nodeId: string, updates: Partial<AXTreeViewNode>, idField?: string, childrenField?: string, childrenCountField?: string): AXTreeViewNode | null;
|
|
922
|
+
/**
|
|
923
|
+
* Add a child node to a parent node
|
|
924
|
+
* @param nodes - Root nodes array
|
|
925
|
+
* @param parentId - The ID of the parent node
|
|
926
|
+
* @param childNode - The child node to add
|
|
927
|
+
* @param index - Optional index to insert at (default: append to end)
|
|
928
|
+
* @param idField - Field name for node ID
|
|
929
|
+
* @param childrenField - Field name for children array
|
|
930
|
+
* @param childrenCountField - Field name for children count
|
|
931
|
+
* @param expandedField - Field name for expanded state
|
|
932
|
+
* @returns The parent node if found and child was added, null otherwise
|
|
933
|
+
*/
|
|
934
|
+
addChild(nodes: AXTreeViewNode[], parentId: string, childNode: AXTreeViewNode, index: number | undefined, idField?: string, childrenField?: string, childrenCountField?: string, expandedField?: string): AXTreeViewNode | null;
|
|
935
|
+
/**
|
|
936
|
+
* Remove a node from the tree
|
|
937
|
+
* @param nodes - Root nodes array
|
|
938
|
+
* @param nodeId - The ID of the node to remove
|
|
939
|
+
* @param idField - Field name for node ID
|
|
940
|
+
* @param childrenField - Field name for children array
|
|
941
|
+
* @param childrenCountField - Field name for children count
|
|
942
|
+
* @returns The removed node if found, null otherwise
|
|
943
|
+
*/
|
|
944
|
+
removeNode(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string, childrenCountField?: string): AXTreeViewNode | null;
|
|
945
|
+
/**
|
|
946
|
+
* Validate node structure (check for required fields and circular references)
|
|
947
|
+
*/
|
|
948
|
+
validateNode(node: AXTreeViewNode, visitedIds?: Set<string>, idField?: string, titleField?: string, childrenField?: string, childrenCountField?: string): {
|
|
949
|
+
valid: boolean;
|
|
950
|
+
errors: string[];
|
|
951
|
+
};
|
|
952
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewService, never>;
|
|
953
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXTreeViewService>;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export { AXTreeViewComponent, AXTreeViewModule, AXTreeViewService };
|
|
957
|
+
export type { AXTreeViewBeforeDropEvent, AXTreeViewCallback, AXTreeViewChildrenSelectionState, AXTreeViewDataSource, AXTreeViewDragArea, AXTreeViewDragBehavior, AXTreeViewDropEvent, AXTreeViewFlatNode, AXTreeViewItemTemplateContext, AXTreeViewNode, AXTreeViewNodeClickEvent, AXTreeViewNodeDoubleClickEvent, AXTreeViewNodeSelectEvent, AXTreeViewNodeToggleEvent, AXTreeViewSelectMode, AXTreeViewSelectionBehavior, AXTreeViewSelectionChangeEvent, AXTreeViewViewLook };
|