@memberjunction/ng-trees 6.1.0-edge.5 → 6.1.0-edge.6
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/dist/lib/tree/tree.component.js +1 -1
- package/dist/lib/tree-dropdown/tree-dropdown.component.d.ts +9 -0
- package/dist/lib/tree-dropdown/tree-dropdown.component.d.ts.map +1 -1
- package/dist/lib/tree-dropdown/tree-dropdown.component.js +46 -25
- package/dist/lib/tree-dropdown/tree-dropdown.component.js.map +1 -1
- package/package.json +12 -12
|
@@ -1658,7 +1658,7 @@ export class TreeComponent extends BaseAngularComponent {
|
|
|
1658
1658
|
i0.ɵɵconditional(ctx.IsLoaded && ctx.Nodes.length === 0 && !ctx.ErrorMessage && !ctx.IsLoading ? 4 : -1);
|
|
1659
1659
|
i0.ɵɵadvance();
|
|
1660
1660
|
i0.ɵɵconditional(ctx.Nodes.length > 0 && !ctx.IsLoading ? 5 : -1);
|
|
1661
|
-
} }, dependencies: [i1.NgClass, i1.NgTemplateOutlet, i2.MJEmptyStateComponent], styles: ["\n\n\n\n\n\n\n\n\n\n\n
|
|
1661
|
+
} }, dependencies: [i1.NgClass, i1.NgTemplateOutlet, i2.MJEmptyStateComponent], styles: ["\n\n\n\n\n\n\n\n\n\n\n[_nghost-%COMP%] {\n \n --tree-bg: var(--mj-bg-surface);\n --tree-border-color: var(--mj-border-default);\n --tree-text-color: var(--mj-text-primary);\n --tree-text-secondary: var(--mj-text-muted);\n --tree-text-muted: var(--mj-text-disabled);\n\n \n --tree-node-hover-bg: var(--mj-bg-surface-sunken);\n --tree-node-selected-bg: var(--mj-brand-primary-subtle);\n --tree-node-selected-border: var(--mj-brand-primary);\n --tree-node-focused-outline: color-mix(in srgb, var(--mj-brand-primary) 50%, transparent);\n --tree-node-match-bg: var(--mj-status-warning-subtle);\n\n \n --tree-icon-color: var(--mj-brand-primary);\n --tree-icon-leaf-color: var(--mj-text-muted);\n --tree-toggle-color: var(--mj-text-disabled);\n\n \n --tree-node-padding-y: 8px;\n --tree-node-padding-x: 12px;\n --tree-node-gap: 8px;\n --tree-icon-size: 16px;\n --tree-toggle-size: 12px;\n\n \n --tree-transition-duration: 150ms;\n --tree-animation-easing: ease-out;\n\n \n --tree-badge-bg: var(--mj-border-default);\n --tree-badge-color: var(--mj-text-muted);\n --tree-badge-size: 12px;\n\n display: block;\n width: 100%;\n height: 100%;\n}\n\n\n\n\n\n.tree-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: var(--tree-bg);\n border-radius: var(--mj-radius-md);\n overflow: hidden;\n outline: none;\n}\n\n.tree-container[_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--tree-node-focused-outline);\n outline-offset: -2px;\n}\n\n\n\n\n\n.tree-loading[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 32px 16px;\n gap: 12px;\n color: var(--tree-text-muted);\n}\n\n.tree-loading__spinner[_ngcontent-%COMP%] {\n font-size: var(--mj-text-2xl);\n color: var(--tree-icon-color);\n}\n\n.tree-loading__text[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n}\n\n\n\n\n\n.tree-error[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 32px 16px;\n gap: 12px;\n text-align: center;\n}\n\n.tree-error__icon[_ngcontent-%COMP%] {\n font-size: 32px;\n color: var(--mj-status-error);\n}\n\n.tree-error__message[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n color: var(--tree-text-secondary);\n max-width: 280px;\n}\n\n.tree-error__retry[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: 1px solid var(--tree-border-color);\n border-radius: var(--mj-radius-md);\n background: var(--tree-bg);\n color: var(--tree-text-color);\n font-size: var(--mj-text-sm);\n cursor: pointer;\n transition: all var(--tree-transition-duration) var(--tree-animation-easing);\n}\n\n.tree-error__retry[_ngcontent-%COMP%]:hover {\n background: var(--tree-node-hover-bg);\n border-color: var(--tree-icon-color);\n color: var(--tree-icon-color);\n}\n\n\n\n\n\n.tree-empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 16px;\n gap: 12px;\n color: var(--tree-text-muted);\n}\n\n.tree-empty__icon[_ngcontent-%COMP%] {\n font-size: 40px;\n opacity: 0.5;\n}\n\n.tree-empty__message[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n}\n\n\n\n\n\n.tree-toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--tree-border-color);\n background: var(--tree-node-hover-bg);\n}\n\n.tree-toolbar__btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: var(--mj-radius-sm);\n background: transparent;\n color: var(--tree-text-secondary);\n cursor: pointer;\n transition: all var(--tree-transition-duration) var(--tree-animation-easing);\n}\n\n.tree-toolbar__btn[_ngcontent-%COMP%]:hover {\n background: var(--tree-bg);\n color: var(--tree-icon-color);\n}\n\n\n\n\n\n.tree-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n}\n\n\n\n\n\n.tree-node[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--tree-node-gap);\n padding: var(--tree-node-padding-y) var(--tree-node-padding-x);\n cursor: pointer;\n user-select: none;\n border-left: 3px solid transparent;\n transition: all var(--tree-transition-duration) var(--tree-animation-easing);\n min-height: 36px;\n}\n\n.tree-node[_ngcontent-%COMP%]:hover {\n background: var(--tree-node-hover-bg);\n}\n\n.tree-node--selected[_ngcontent-%COMP%] {\n background: var(--tree-node-selected-bg);\n border-left-color: var(--tree-node-selected-border);\n}\n\n.tree-node--selected[_ngcontent-%COMP%]:hover {\n background: var(--tree-node-selected-bg);\n}\n\n.tree-node--focused[_ngcontent-%COMP%] {\n outline: 2px solid var(--tree-node-focused-outline);\n outline-offset: -2px;\n}\n\n\n.tree-search-highlight[_ngcontent-%COMP%] {\n background: var(--tree-node-match-bg);\n padding: 1px 2px;\n border-radius: 2px;\n font-weight: 500;\n}\n\n\n\n\n\n.tree-node-toggle[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n border-radius: var(--mj-radius-sm);\n transition: all var(--tree-transition-duration) var(--tree-animation-easing);\n}\n\n.tree-node-toggle[_ngcontent-%COMP%]:hover {\n background: rgba(0, 0, 0, 0.08);\n}\n\n.tree-node-toggle__icon[_ngcontent-%COMP%] {\n font-size: var(--tree-toggle-size);\n color: var(--tree-toggle-color);\n transition: transform var(--tree-transition-duration) var(--tree-animation-easing);\n}\n\n.tree-node--expanded[_ngcontent-%COMP%] .tree-node-toggle__icon[_ngcontent-%COMP%] {\n color: var(--tree-icon-color);\n}\n\n.tree-node-toggle__spacer[_ngcontent-%COMP%] {\n width: var(--tree-toggle-size);\n}\n\n.tree-node-leaf-spacer[_ngcontent-%COMP%] {\n width: 20px;\n flex-shrink: 0;\n}\n\n\n\n\n\n.tree-node-icon[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--tree-icon-size);\n flex-shrink: 0;\n font-size: var(--tree-icon-size);\n color: var(--tree-icon-color);\n}\n\n.tree-node--leaf[_ngcontent-%COMP%] .tree-node-icon[_ngcontent-%COMP%] {\n color: var(--tree-icon-leaf-color);\n}\n\n\n\n\n\n.tree-node-content[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.tree-node-label[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n font-weight: 500;\n color: var(--tree-text-color);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.tree-node--leaf[_ngcontent-%COMP%] .tree-node-label[_ngcontent-%COMP%] {\n font-weight: 400;\n}\n\n.tree-node-description[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n color: var(--tree-text-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n\n\n\n\n.tree-node-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: 10px;\n background: var(--tree-badge-bg);\n color: var(--tree-badge-color);\n font-size: var(--tree-badge-size);\n font-weight: 500;\n flex-shrink: 0;\n}\n\n\n\n\n\n.tree-node-selected-indicator[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border-radius: var(--mj-radius-full);\n background: var(--tree-node-selected-border);\n color: var(--mj-text-inverse);\n font-size: 10px;\n flex-shrink: 0;\n}\n\n\n\n\n\n.tree-node-children[_ngcontent-%COMP%] {\n overflow: hidden;\n}\n\n.tree-node-children--animated[_ngcontent-%COMP%] {\n animation: _ngcontent-%COMP%_tree-expand var(--tree-transition-duration) var(--tree-animation-easing);\n}\n\n@keyframes _ngcontent-%COMP%_tree-expand {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n\n\n\n\n.tree-content[_ngcontent-%COMP%]::-webkit-scrollbar {\n width: 8px;\n}\n\n.tree-content[_ngcontent-%COMP%]::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.tree-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb {\n background: var(--tree-border-color);\n border-radius: var(--mj-radius-sm);\n}\n\n.tree-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover {\n background: var(--tree-toggle-color);\n}\n\n\n\n\n\n@media (max-width: 480px) {\n [_nghost-%COMP%] {\n --tree-node-padding-y: 10px;\n --tree-node-padding-x: 10px;\n --tree-icon-size: 18px;\n }\n\n .tree-node-label[_ngcontent-%COMP%] {\n font-size: var(--mj-text-base);\n }\n}"] });
|
|
1662
1662
|
}
|
|
1663
1663
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TreeComponent, [{
|
|
1664
1664
|
type: Component,
|
|
@@ -212,6 +212,15 @@ export declare class TreeDropdownComponent extends BaseAngularComponent implemen
|
|
|
212
212
|
* Handle tree selection change
|
|
213
213
|
*/
|
|
214
214
|
onTreeSelectionChange(nodes: TreeNode[]): void;
|
|
215
|
+
/**
|
|
216
|
+
* Build the CompositeKey for a selected node. A node's `ID` is the value of its config's `IDField`
|
|
217
|
+
* (leaf or branch), so the key is named after that field rather than a hardcoded `ID`. When no
|
|
218
|
+
* `IDField` is configured, the field is the entity's primary key — the tree identifies a node by
|
|
219
|
+
* exactly one string, so a single-column key is the only shape this control can represent.
|
|
220
|
+
*/
|
|
221
|
+
private nodeToKey;
|
|
222
|
+
/** The single primary-key column of the configured entity, used when a config has no explicit `IDField`. */
|
|
223
|
+
private resolvePrimaryKeyFieldName;
|
|
215
224
|
/**
|
|
216
225
|
* Handle tree data load events
|
|
217
226
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/tree-dropdown/tree-dropdown.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAIH,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,SAAS,EAET,UAAU,EAAG,6CAA6C;AAC1D,SAAS,EACT,aAAa,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACp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alD;;OAEG;IACI,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAUnD;;;OAGG;IACI,mBAAmB,IAAI,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"tree-dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/tree-dropdown/tree-dropdown.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAIH,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,SAAS,EAET,UAAU,EAAG,6CAA6C;AAC1D,SAAS,EACT,aAAa,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAGrE;;GAEG;AACH,UAAU,gBAAgB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,qBAMa,qBAAsB,SAAQ,oBAAqB,YAAW,MAAM,EAAE,SAAS,EAAE,aAAa;IAiMnG,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAjM7B;;;;;OAKG;IACH,OAAO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AC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA0EzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiE5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;OAEG;IACH,OAAO,CAAC,eAAe,CAKrB;IAEF;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAUpC;;OAEG;IACH,OAAO,CAAC,aAAa;IAwCrB;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,4BAA4B;IAYpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;OAEG;YACW,wBAAwB;IAsCtC;;OAEG;IACI,cAAc,IAAI,MAAM;IAuB/B;;OAEG;IACI,cAAc,IAAI,MAAM,GAAG,IAAI;IAOtC;;OAEG;IACI,eAAe,IAAI,MAAM,GAAG,IAAI;IAOvC;;OAEG;IACI,YAAY,IAAI,OAAO;IAI9B;;OAEG;IACI,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAalD;;OAEG;IACI,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAUnD;;;OAGG;IACI,mBAAmB,IAAI,MAAM,EAAE;yCArqC7B,qBAAqB;2CAArB,qBAAqB;CAirCjC"}
|
|
@@ -28,10 +28,10 @@ function TreeDropdownComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
28
28
|
i0.ɵɵelement(1, "i");
|
|
29
29
|
i0.ɵɵelementEnd();
|
|
30
30
|
} if (rf & 2) {
|
|
31
|
-
const
|
|
32
|
-
i0.ɵɵstyleProp("color",
|
|
31
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
32
|
+
i0.ɵɵstyleProp("color", ctx_r0.getDisplayColor());
|
|
33
33
|
i0.ɵɵadvance();
|
|
34
|
-
i0.ɵɵclassMap(
|
|
34
|
+
i0.ɵɵclassMap(ctx_r0.getDisplayIcon());
|
|
35
35
|
} }
|
|
36
36
|
function TreeDropdownComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
37
37
|
i0.ɵɵelementStart(0, "span", 9);
|
|
@@ -39,51 +39,51 @@ function TreeDropdownComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
39
39
|
i0.ɵɵelementEnd();
|
|
40
40
|
} }
|
|
41
41
|
function TreeDropdownComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
-
const
|
|
42
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
43
43
|
i0.ɵɵelementStart(0, "button", 17);
|
|
44
|
-
i0.ɵɵlistener("click", function TreeDropdownComponent_Conditional_9_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(
|
|
44
|
+
i0.ɵɵlistener("click", function TreeDropdownComponent_Conditional_9_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Clear($event)); });
|
|
45
45
|
i0.ɵɵelement(1, "i", 18);
|
|
46
46
|
i0.ɵɵelementEnd();
|
|
47
47
|
} }
|
|
48
48
|
function TreeDropdownComponent_Conditional_12_Conditional_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
49
|
-
const
|
|
49
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
50
50
|
i0.ɵɵelementStart(0, "button", 27);
|
|
51
|
-
i0.ɵɵlistener("click", function TreeDropdownComponent_Conditional_12_Conditional_2_Conditional_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(
|
|
51
|
+
i0.ɵɵlistener("click", function TreeDropdownComponent_Conditional_12_Conditional_2_Conditional_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onClearSearch()); });
|
|
52
52
|
i0.ɵɵelement(1, "i", 18);
|
|
53
53
|
i0.ɵɵelementEnd();
|
|
54
54
|
} }
|
|
55
55
|
function TreeDropdownComponent_Conditional_12_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
56
|
-
const
|
|
56
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
57
57
|
i0.ɵɵelementStart(0, "div", 20)(1, "div", 23);
|
|
58
58
|
i0.ɵɵelement(2, "i", 24);
|
|
59
59
|
i0.ɵɵelementStart(3, "input", 25, 3);
|
|
60
|
-
i0.ɵɵlistener("input", function TreeDropdownComponent_Conditional_12_Conditional_2_Template_input_input_3_listener($event) { i0.ɵɵrestoreView(
|
|
60
|
+
i0.ɵɵlistener("input", function TreeDropdownComponent_Conditional_12_Conditional_2_Template_input_input_3_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onSearchInput($event)); })("keydown", function TreeDropdownComponent_Conditional_12_Conditional_2_Template_input_keydown_3_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onSearchKeyDown($event)); });
|
|
61
61
|
i0.ɵɵelementEnd();
|
|
62
62
|
i0.ɵɵconditionalCreate(5, TreeDropdownComponent_Conditional_12_Conditional_2_Conditional_5_Template, 2, 0, "button", 26);
|
|
63
63
|
i0.ɵɵelementEnd()();
|
|
64
64
|
} if (rf & 2) {
|
|
65
|
-
const
|
|
65
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
66
66
|
i0.ɵɵadvance(3);
|
|
67
|
-
i0.ɵɵproperty("placeholder",
|
|
67
|
+
i0.ɵɵproperty("placeholder", ctx_r0.SearchConfig.Placeholder || "Type to search...")("value", ctx_r0.SearchText);
|
|
68
68
|
i0.ɵɵadvance(2);
|
|
69
|
-
i0.ɵɵconditional(
|
|
69
|
+
i0.ɵɵconditional(ctx_r0.SearchText ? 5 : -1);
|
|
70
70
|
} }
|
|
71
71
|
function TreeDropdownComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
-
const
|
|
72
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
73
73
|
i0.ɵɵelementStart(0, "div", 19, 1);
|
|
74
74
|
i0.ɵɵconditionalCreate(2, TreeDropdownComponent_Conditional_12_Conditional_2_Template, 6, 3, "div", 20);
|
|
75
75
|
i0.ɵɵelementStart(3, "div", 21)(4, "mj-tree", 22, 2);
|
|
76
|
-
i0.ɵɵlistener("SelectionChange", function TreeDropdownComponent_Conditional_12_Template_mj_tree_SelectionChange_4_listener($event) { i0.ɵɵrestoreView(
|
|
76
|
+
i0.ɵɵlistener("SelectionChange", function TreeDropdownComponent_Conditional_12_Template_mj_tree_SelectionChange_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTreeSelectionChange($event)); })("BeforeNodeSelect", function TreeDropdownComponent_Conditional_12_Template_mj_tree_BeforeNodeSelect_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTreeBeforeNodeSelect($event)); })("AfterNodeSelect", function TreeDropdownComponent_Conditional_12_Template_mj_tree_AfterNodeSelect_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTreeAfterNodeSelect($event)); })("BeforeDataLoad", function TreeDropdownComponent_Conditional_12_Template_mj_tree_BeforeDataLoad_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTreeBeforeDataLoad($event)); })("AfterDataLoad", function TreeDropdownComponent_Conditional_12_Template_mj_tree_AfterDataLoad_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onTreeAfterDataLoad($event)); });
|
|
77
77
|
i0.ɵɵelementEnd()()();
|
|
78
78
|
} if (rf & 2) {
|
|
79
|
-
const
|
|
80
|
-
i0.ɵɵclassMap(
|
|
81
|
-
i0.ɵɵclassProp("tree-dropdown-panel--open",
|
|
82
|
-
i0.ɵɵproperty("ngStyle",
|
|
79
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
80
|
+
i0.ɵɵclassMap(ctx_r0.StyleConfig.DropdownClass || "");
|
|
81
|
+
i0.ɵɵclassProp("tree-dropdown-panel--open", ctx_r0.IsOpen)("tree-dropdown-panel--above", ctx_r0.Position == null ? null : ctx_r0.Position.renderAbove)("tree-dropdown-panel--below", !(ctx_r0.Position == null ? null : ctx_r0.Position.renderAbove));
|
|
82
|
+
i0.ɵɵproperty("ngStyle", ctx_r0.IsOpen ? ctx_r0.getDropdownStyles() : i0.ɵɵpureFunction0(22, _c4));
|
|
83
83
|
i0.ɵɵadvance(2);
|
|
84
|
-
i0.ɵɵconditional(
|
|
84
|
+
i0.ɵɵconditional(ctx_r0.EnableSearch ? 2 : -1);
|
|
85
85
|
i0.ɵɵadvance(2);
|
|
86
|
-
i0.ɵɵproperty("BranchConfig",
|
|
86
|
+
i0.ɵɵproperty("BranchConfig", ctx_r0.BranchConfig)("LeafConfig", ctx_r0.LeafConfig)("SelectionMode", ctx_r0.SelectionMode)("SelectableTypes", ctx_r0.SelectableTypes)("DefaultExpansion", ctx_r0.DefaultExpansion)("SelectedIDs", ctx_r0.getSelectedIDsArray())("AutoLoad", ctx_r0.AutoLoad)("ShowIcons", true)("ShowExpandCollapseAll", false)("AnimateExpandCollapse", true)("EmptyMessage", ctx_r0.SearchText ? "No matches found" : "No items available")("EmptyIcon", ctx_r0.SearchText ? "fa-solid fa-search" : "fa-solid fa-folder-open");
|
|
87
87
|
} }
|
|
88
88
|
export class TreeDropdownComponent extends BaseAngularComponent {
|
|
89
89
|
cdr;
|
|
@@ -478,7 +478,7 @@ export class TreeDropdownComponent extends BaseAngularComponent {
|
|
|
478
478
|
this._pendingDisplayText = null;
|
|
479
479
|
// Update value - convert node IDs to CompositeKeys
|
|
480
480
|
if (this.SelectionMode === 'single') {
|
|
481
|
-
this._value = nodes.length > 0 ?
|
|
481
|
+
this._value = nodes.length > 0 ? this.nodeToKey(nodes[0]) : null;
|
|
482
482
|
this.ValueChange.emit(this._value);
|
|
483
483
|
this.SelectionChange.emit(nodes.length > 0 ? nodes[0] : null);
|
|
484
484
|
// Close on selection in single mode (unless disabled)
|
|
@@ -488,12 +488,34 @@ export class TreeDropdownComponent extends BaseAngularComponent {
|
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
else {
|
|
491
|
-
this._value = nodes.map(n =>
|
|
491
|
+
this._value = nodes.map(n => this.nodeToKey(n));
|
|
492
492
|
this.ValueChange.emit(this._value);
|
|
493
493
|
this.SelectionChange.emit(nodes.length > 0 ? nodes : null);
|
|
494
494
|
}
|
|
495
495
|
this.cdr.detectChanges();
|
|
496
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* Build the CompositeKey for a selected node. A node's `ID` is the value of its config's `IDField`
|
|
499
|
+
* (leaf or branch), so the key is named after that field rather than a hardcoded `ID`. When no
|
|
500
|
+
* `IDField` is configured, the field is the entity's primary key — the tree identifies a node by
|
|
501
|
+
* exactly one string, so a single-column key is the only shape this control can represent.
|
|
502
|
+
*/
|
|
503
|
+
nodeToKey(node) {
|
|
504
|
+
const config = node.Type === 'leaf' && this.LeafConfig ? this.LeafConfig : this.BranchConfig;
|
|
505
|
+
const idField = config?.IDField ?? this.resolvePrimaryKeyFieldName(config?.EntityName);
|
|
506
|
+
return CompositeKey.FromKeyValuePair(idField, node.ID);
|
|
507
|
+
}
|
|
508
|
+
/** The single primary-key column of the configured entity, used when a config has no explicit `IDField`. */
|
|
509
|
+
resolvePrimaryKeyFieldName(entityName) {
|
|
510
|
+
const entityInfo = entityName ? this.ProviderToUse.EntityByName(entityName) : null;
|
|
511
|
+
if (!entityInfo) {
|
|
512
|
+
throw new Error(`TreeDropdown: cannot resolve the ID field — entity '${entityName ?? ''}' was not found in metadata and no IDField is configured.`);
|
|
513
|
+
}
|
|
514
|
+
if (entityInfo.PrimaryKeys.length !== 1) {
|
|
515
|
+
throw new Error(`TreeDropdown: entity '${entityName}' has a composite primary key; set IDField on the tree config to name the node identity column.`);
|
|
516
|
+
}
|
|
517
|
+
return entityInfo.FirstPrimaryKey.Name; // first-pk-ok: guarded by PrimaryKeys.length === 1 above — a tree node carries exactly one ID string
|
|
518
|
+
}
|
|
497
519
|
/**
|
|
498
520
|
* Handle tree data load events
|
|
499
521
|
*/
|
|
@@ -1101,9 +1123,8 @@ export class TreeDropdownComponent extends BaseAngularComponent {
|
|
|
1101
1123
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dropdownPanel = _t.first);
|
|
1102
1124
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.treeComponent = _t.first);
|
|
1103
1125
|
} }, inputs: { BranchConfig: "BranchConfig", LeafConfig: "LeafConfig", SelectionMode: "SelectionMode", SelectableTypes: "SelectableTypes", DefaultExpansion: "DefaultExpansion", Value: "Value", Placeholder: "Placeholder", EnableSearch: "EnableSearch", SearchConfig: "SearchConfig", DropdownConfig: "DropdownConfig", StyleConfig: "StyleConfig", Clearable: "Clearable", Disabled: "Disabled", ShowIconInDisplay: "ShowIconInDisplay", AutoLoad: "AutoLoad", ShowLoadingInTrigger: "ShowLoadingInTrigger" }, outputs: { ValueChange: "ValueChange", SelectionChange: "SelectionChange", BeforeNodeSelect: "BeforeNodeSelect", AfterNodeSelect: "AfterNodeSelect", BeforeSearch: "BeforeSearch", AfterSearch: "AfterSearch", BeforeDropdownOpen: "BeforeDropdownOpen", AfterDropdownOpen: "AfterDropdownOpen", BeforeDropdownClose: "BeforeDropdownClose", AfterDropdownClose: "AfterDropdownClose", BeforeDataLoad: "BeforeDataLoad", AfterDataLoad: "AfterDataLoad" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 13, vars: 16, consts: [["triggerElement", ""], ["dropdownPanel", ""], ["treeComponent", ""], ["searchInput", ""], [1, "tree-dropdown"], ["tabindex", "0", "role", "combobox", 3, "click", "keydown", "ngClass"], [1, "tree-dropdown-trigger__content"], [1, "tree-dropdown-trigger__icon", 3, "color"], [1, "tree-dropdown-trigger__text"], [1, "tree-dropdown-trigger__loading"], [1, "tree-dropdown-trigger__actions"], ["type", "button", "title", "Clear selection", "tabindex", "-1", 1, "tree-dropdown-trigger__clear"], [1, "tree-dropdown-trigger__chevron"], [1, "fa-solid", 3, "ngClass"], ["role", "tree", 1, "tree-dropdown-panel", 3, "tree-dropdown-panel--open", "tree-dropdown-panel--above", "tree-dropdown-panel--below", "class", "ngStyle"], [1, "tree-dropdown-trigger__icon"], [1, "fa-solid", "fa-spinner", "fa-spin"], ["type", "button", "title", "Clear selection", "tabindex", "-1", 1, "tree-dropdown-trigger__clear", 3, "click"], [1, "fa-solid", "fa-times"], ["role", "tree", 1, "tree-dropdown-panel", 3, "ngStyle"], [1, "tree-dropdown-search"], [1, "tree-dropdown-tree"], [3, "SelectionChange", "BeforeNodeSelect", "AfterNodeSelect", "BeforeDataLoad", "AfterDataLoad", "BranchConfig", "LeafConfig", "SelectionMode", "SelectableTypes", "DefaultExpansion", "SelectedIDs", "AutoLoad", "ShowIcons", "ShowExpandCollapseAll", "AnimateExpandCollapse", "EmptyMessage", "EmptyIcon"], [1, "tree-dropdown-search__input-wrapper"], [1, "fa-solid", "fa-search", "tree-dropdown-search__icon"], ["type", "text", "autocomplete", "off", "spellcheck", "false", 1, "tree-dropdown-search__input", 3, "input", "keydown", "placeholder", "value"], ["type", "button", "tabindex", "-1", 1, "tree-dropdown-search__clear"], ["type", "button", "tabindex", "-1", 1, "tree-dropdown-search__clear", 3, "click"]], template: function TreeDropdownComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1104
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
1105
1126
|
i0.ɵɵelementStart(0, "div", 4)(1, "div", 5, 0);
|
|
1106
|
-
i0.ɵɵlistener("click", function TreeDropdownComponent_Template_div_click_1_listener() {
|
|
1127
|
+
i0.ɵɵlistener("click", function TreeDropdownComponent_Template_div_click_1_listener() { return ctx.onTriggerClick(); })("keydown", function TreeDropdownComponent_Template_div_keydown_1_listener($event) { return ctx.onTriggerKeyDown($event); });
|
|
1107
1128
|
i0.ɵɵelementStart(3, "div", 6);
|
|
1108
1129
|
i0.ɵɵconditionalCreate(4, TreeDropdownComponent_Conditional_4_Template, 2, 4, "span", 7);
|
|
1109
1130
|
i0.ɵɵelementStart(5, "span", 8);
|
|
@@ -1138,7 +1159,7 @@ export class TreeDropdownComponent extends BaseAngularComponent {
|
|
|
1138
1159
|
i0.ɵɵproperty("ngClass", ctx.IsOpen ? "fa-chevron-up" : "fa-chevron-down");
|
|
1139
1160
|
i0.ɵɵadvance();
|
|
1140
1161
|
i0.ɵɵconditional(ctx.IsOpen ? 12 : -1);
|
|
1141
|
-
} }, dependencies: [i1.NgClass, i1.NgStyle, i2.TreeComponent], styles: ["\n\n\n\n\n\n\n\n\n\n\n
|
|
1162
|
+
} }, dependencies: [i1.NgClass, i1.NgStyle, i2.TreeComponent], styles: ["\n\n\n\n\n\n\n\n\n\n\n[_nghost-%COMP%] {\n \n --dropdown-bg: var(--mj-bg-surface);\n --dropdown-border-color: var(--mj-border-strong);\n --dropdown-border-hover: var(--mj-text-disabled);\n --dropdown-border-focus: var(--mj-brand-primary);\n --dropdown-text-color: var(--mj-text-primary);\n --dropdown-text-placeholder: var(--mj-text-disabled);\n --dropdown-shadow: var(--mj-shadow-lg);\n\n \n --dropdown-trigger-bg: var(--mj-bg-surface);\n --dropdown-trigger-height: 40px;\n --dropdown-trigger-padding: 8px 12px;\n --dropdown-trigger-radius: var(--mj-radius-md);\n\n \n --dropdown-search-bg: var(--mj-bg-surface-card);\n --dropdown-search-height: 36px;\n\n \n --dropdown-animation-duration: 150ms;\n --dropdown-animation-easing: ease-out;\n\n display: block;\n position: relative;\n width: 100%;\n}\n\n\n\n\n\n.tree-dropdown[_ngcontent-%COMP%] {\n position: relative;\n width: 100%;\n}\n\n.tree-dropdown--disabled[_ngcontent-%COMP%] {\n opacity: 0.6;\n pointer-events: none;\n}\n\n\n\n\n\n.tree-dropdown-trigger[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n min-height: var(--dropdown-trigger-height);\n padding: var(--dropdown-trigger-padding);\n background: var(--dropdown-trigger-bg);\n border: 1px solid var(--dropdown-border-color);\n border-radius: var(--dropdown-trigger-radius);\n cursor: pointer;\n outline: none;\n transition: all var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-trigger[_ngcontent-%COMP%]:hover {\n border-color: var(--dropdown-border-hover);\n}\n\n.tree-dropdown-trigger[_ngcontent-%COMP%]:focus, \n.tree-dropdown-trigger--open[_ngcontent-%COMP%] {\n border-color: var(--dropdown-border-focus);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.tree-dropdown-trigger--disabled[_ngcontent-%COMP%] {\n cursor: not-allowed;\n background: var(--mj-bg-surface-card);\n}\n\n.tree-dropdown-trigger__content[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n overflow: hidden;\n}\n\n.tree-dropdown-trigger__icon[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mj-text-sm);\n flex-shrink: 0;\n}\n\n.tree-dropdown-trigger__text[_ngcontent-%COMP%] {\n flex: 1;\n font-size: var(--mj-text-sm);\n color: var(--dropdown-text-color);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.tree-dropdown-trigger__text--placeholder[_ngcontent-%COMP%] {\n color: var(--dropdown-text-placeholder);\n}\n\n.tree-dropdown-trigger__loading[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n color: var(--dropdown-border-focus);\n font-size: var(--mj-text-xs);\n}\n\n.tree-dropdown-trigger__actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.tree-dropdown-trigger__clear[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full);\n background: var(--mj-border-default);\n color: var(--mj-text-muted);\n cursor: pointer;\n font-size: 10px;\n transition: all var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-trigger__clear[_ngcontent-%COMP%]:hover {\n background: var(--mj-border-strong);\n color: var(--mj-text-primary);\n}\n\n.tree-dropdown-trigger__chevron[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n color: var(--dropdown-text-placeholder);\n font-size: var(--mj-text-xs);\n transition: transform var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-trigger--open[_ngcontent-%COMP%] .tree-dropdown-trigger__chevron[_ngcontent-%COMP%] {\n transform: rotate(180deg);\n}\n\n\n\n\n\n.tree-dropdown-panel[_ngcontent-%COMP%] {\n position: fixed;\n z-index: 10000;\n display: flex;\n flex-direction: column;\n background: var(--dropdown-bg);\n border: 1px solid var(--dropdown-border-color);\n border-radius: var(--mj-radius-md);\n box-shadow: var(--dropdown-shadow);\n overflow: hidden;\n animation: _ngcontent-%COMP%_dropdown-open var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n \n box-sizing: border-box;\n}\n\n.tree-dropdown-panel--above[_ngcontent-%COMP%] {\n transform-origin: bottom center;\n}\n\n.tree-dropdown-panel--below[_ngcontent-%COMP%] {\n transform-origin: top center;\n}\n\n@keyframes _ngcontent-%COMP%_dropdown-open {\n from {\n opacity: 0;\n transform: scaleY(0.95);\n }\n to {\n opacity: 1;\n transform: scaleY(1);\n }\n}\n\n\n\n\n\n.tree-dropdown-search[_ngcontent-%COMP%] {\n padding: 8px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--dropdown-search-bg);\n}\n\n.tree-dropdown-search__input-wrapper[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n height: var(--dropdown-search-height);\n padding: 0 10px;\n background: var(--dropdown-bg);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n transition: all var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-search__input-wrapper[_ngcontent-%COMP%]:focus-within {\n border-color: var(--dropdown-border-focus);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.tree-dropdown-search__icon[_ngcontent-%COMP%] {\n color: var(--mj-text-disabled);\n font-size: var(--mj-text-xs);\n flex-shrink: 0;\n}\n\n.tree-dropdown-search__input[_ngcontent-%COMP%] {\n flex: 1;\n border: none;\n background: transparent;\n font-size: var(--mj-text-sm);\n color: var(--dropdown-text-color);\n outline: none;\n min-width: 0;\n}\n\n.tree-dropdown-search__input[_ngcontent-%COMP%]::placeholder {\n color: var(--dropdown-text-placeholder);\n}\n\n.tree-dropdown-search__clear[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full);\n background: var(--mj-border-default);\n color: var(--mj-text-muted);\n cursor: pointer;\n font-size: 9px;\n flex-shrink: 0;\n transition: all var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-search__clear[_ngcontent-%COMP%]:hover {\n background: var(--mj-border-strong);\n color: var(--mj-text-primary);\n}\n\n\n\n\n\n.tree-dropdown-tree[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n min-height: 0;\n max-height: 100%;\n}\n\n.tree-dropdown-tree[_ngcontent-%COMP%] mj-tree[_ngcontent-%COMP%] {\n display: block;\n height: auto;\n max-height: 100%;\n}\n\n\n.tree-dropdown-tree[_ngcontent-%COMP%] .tree-container {\n border-radius: 0;\n height: auto;\n max-height: none;\n}\n\n.tree-dropdown-tree[_ngcontent-%COMP%] .tree-content {\n padding: 4px 0;\n}\n\n.tree-dropdown-tree[_ngcontent-%COMP%] .tree-node {\n padding: 6px 12px;\n min-height: 32px;\n}\n\n.tree-dropdown-tree[_ngcontent-%COMP%] .tree-empty {\n padding: 24px 16px;\n}\n\n.tree-dropdown-tree[_ngcontent-%COMP%] .tree-loading {\n padding: 24px 16px;\n}\n\n\n\n\n\n[_nghost-%COMP%] .mj-tree-dropdown-portal {\n pointer-events: none;\n}\n\n[_nghost-%COMP%] .mj-tree-dropdown-portal > * {\n pointer-events: auto;\n}\n\n\n\n\n\n.tree-dropdown-pills[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n padding: 4px;\n}\n\n.tree-dropdown-pill[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n background: var(--mj-brand-primary-subtle);\n border-radius: var(--mj-radius-lg);\n font-size: var(--mj-text-xs);\n color: var(--mj-brand-primary);\n}\n\n.tree-dropdown-pill__remove[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full);\n background: transparent;\n color: var(--mj-brand-primary);\n cursor: pointer;\n font-size: 8px;\n transition: background var(--dropdown-animation-duration) var(--dropdown-animation-easing);\n}\n\n.tree-dropdown-pill__remove[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n\n\n\n\n@media (max-width: 480px) {\n [_nghost-%COMP%] {\n --dropdown-trigger-height: 44px;\n }\n\n .tree-dropdown-trigger__text[_ngcontent-%COMP%] {\n font-size: var(--mj-text-base);\n }\n\n .tree-dropdown-search__input[_ngcontent-%COMP%] {\n font-size: var(--mj-text-base); \n }\n}"] });
|
|
1142
1163
|
}
|
|
1143
1164
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TreeDropdownComponent, [{
|
|
1144
1165
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-dropdown.component.js","sourceRoot":"","sources":["../../../src/lib/tree-dropdown/tree-dropdown.component.ts","../../../src/lib/tree-dropdown/tree-dropdown.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAIZ,SAAS,EAIZ,MAAM,eAAe,CAAC;AAWvB,OAAO,EAGH,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAG9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;;IC/B5C,gCAEoC;IAClC,oBAAkC;IACpC,iBAAO;;;IAFL,iDAAiC;IAC9B,cAA0B;IAA1B,sCAA0B;;;IAa/B,+BAA6C;IAC3C,wBAA2C;IAC7C,iBAAO;;;;IAQP,kCAKgB;IAFd,+LAAS,oBAAa,KAAC;IAGvB,wBAAiC;IACnC,iBAAS;;;;IAwCH,kCAIgB;IADd,uNAAS,sBAAe,KAAC;IAEzB,wBAAiC;IACnC,iBAAS;;;;IAnBb,AADF,+BAAkC,cACiB;IAC/C,wBAA6D;IAC7D,oCASqB;IAFnB,AADA,8MAAS,4BAAqB,KAAC,qMACpB,8BAAuB,KAAC;IAPrC,iBASqB;IACrB,wHAAkB;IAUtB,AADE,iBAAM,EACF;;;IAhBA,eAA+D;IAC/D,AADA,o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;;kBACN,MAAM;;kBACN,MAAM;;kBAMN,SAAS;mBAAC,gBAAgB;;kBAC1B,SAAS;mBAAC,aAAa;;kBACvB,SAAS;mBAAC,eAAe;;kBACzB,SAAS;mBAAC,eAAe;;kFA/IjB,qBAAqB","sourcesContent":["/**\n * Tree Dropdown Component for @memberjunction/ng-trees\n *\n * A searchable dropdown with tree selection. Features:\n * - Smart positioning (auto-flips above/below based on available space)\n * - Portal rendering to avoid clipping\n * - Type-ahead search with highlighting\n * - Keyboard navigation\n * - Single and multi-select modes\n */\n\nimport {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n OnInit,\n OnDestroy,\n ViewChild,\n ElementRef, // Still needed for ViewChild type references\n Renderer2,\n AfterViewInit\n} from '@angular/core';\nimport {\n TreeNode,\n TreeBranchConfig,\n TreeLeafConfig,\n TreeSelectionMode,\n TreeSelectableTypes,\n TreeStyleConfig,\n TreeSearchConfig,\n TreeDropdownConfig\n} from '../models/tree-types';\nimport {\n BeforeNodeSelectEventArgs,\n AfterNodeSelectEventArgs,\n BeforeSearchEventArgs,\n AfterSearchEventArgs,\n BeforeDropdownOpenEventArgs,\n AfterDropdownOpenEventArgs,\n BeforeDropdownCloseEventArgs,\n AfterDropdownCloseEventArgs,\n BeforeDataLoadEventArgs,\n AfterDataLoadEventArgs\n} from '../events/tree-events';\nimport { TreeComponent } from '../tree/tree.component';\nimport { Subject } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\nimport { CompositeKey } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Dropdown position calculation result\n */\ninterface DropdownPosition {\n top: number;\n left: number;\n width: number;\n maxHeight: number;\n renderAbove: boolean;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-tree-dropdown',\n templateUrl: './tree-dropdown.component.html',\n styleUrls: ['./tree-dropdown.component.css']\n})\nexport class TreeDropdownComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewInit {\n /**\n * Default minimum width (px) for the open dropdown panel when the consumer\n * hasn't set `DropdownConfig.MinWidth`. Keeps node labels readable even when\n * the trigger is narrow (e.g. a compact form field). The panel still grows to\n * the trigger width when that is larger.\n */\n private static readonly DEFAULT_PANEL_MIN_WIDTH = 280;\n\n // ========================================\n // Tree Configuration (passed to inner tree)\n // ========================================\n\n /** Branch (category) entity configuration - REQUIRED */\n @Input() BranchConfig!: TreeBranchConfig;\n\n /** Optional leaf entity configuration */\n @Input() LeafConfig?: TreeLeafConfig;\n\n /** Selection mode: 'single' or 'multiple' */\n @Input() SelectionMode: TreeSelectionMode = 'single';\n\n /** What types can be selected: 'branch', 'leaf', or 'both' */\n @Input() SelectableTypes: TreeSelectableTypes = 'both';\n\n /** Initial expansion for the inner tree when it first loads (see TreeComponent.DefaultExpansion). */\n @Input() DefaultExpansion: 'first-level' | 'all' | 'none' = 'first-level';\n\n // ========================================\n // Value Inputs\n // ========================================\n\n /** Current selected value (CompositeKey for single, CompositeKeys for multiple) */\n private _value: CompositeKey | CompositeKey[] | null = null;\n\n /**\n * The selected value as a CompositeKey (single select) or array of CompositeKeys (multi-select).\n * CompositeKey supports both simple single-field primary keys and composite primary keys.\n *\n * @example Single select with simple ID:\n * ```typescript\n * dropdown.Value = CompositeKey.FromID('some-guid');\n * ```\n *\n * @example Single select with composite key:\n * ```typescript\n * dropdown.Value = new CompositeKey([\n * { FieldName: 'Field1', Value: 'value1' },\n * { FieldName: 'Field2', Value: 'value2' }\n * ]);\n * ```\n *\n * @example Multi-select:\n * ```typescript\n * dropdown.Value = [\n * CompositeKey.FromID('guid1'),\n * CompositeKey.FromID('guid2')\n * ];\n * ```\n */\n @Input()\n set Value(val: CompositeKey | CompositeKey[] | null) {\n if (!CompositeKey.EqualsEx(val, this._value)) {\n this._value = val;\n // If tree is loaded, sync selection immediately\n if (this.IsLoaded && this.treeComponent) {\n this.syncValueToSelection();\n } else {\n // Tree not loaded yet - fetch display text directly via Metadata\n this.fetchDisplayTextForValue(val);\n }\n }\n }\n get Value(): CompositeKey | CompositeKey[] | null {\n return this._value;\n }\n \n /** Cached display text for showing in trigger before tree loads */\n private _pendingDisplayText: string | null = null;\n\n // ========================================\n // Dropdown-specific Inputs\n // ========================================\n\n /** Placeholder text when nothing selected */\n @Input() Placeholder: string = 'Select...';\n\n /** Enable search filtering */\n @Input() EnableSearch: boolean = true;\n\n /** Search configuration */\n @Input() SearchConfig: TreeSearchConfig = {};\n\n /** Dropdown configuration */\n @Input() DropdownConfig: TreeDropdownConfig = {};\n\n /** Style configuration */\n @Input() StyleConfig: TreeStyleConfig = {};\n\n /** Show clear button */\n @Input() Clearable: boolean = true;\n\n /** Disabled state */\n @Input() Disabled: boolean = false;\n\n /** Show node icons in display */\n @Input() ShowIconInDisplay: boolean = true;\n\n /** Auto-load data on init */\n @Input() AutoLoad: boolean = true;\n\n /** Show loading in trigger */\n @Input() ShowLoadingInTrigger: boolean = true;\n\n // ========================================\n // Event Outputs\n // ========================================\n\n /** Emitted when value changes */\n @Output() ValueChange = new EventEmitter<CompositeKey | CompositeKey[] | null>();\n\n /** Emitted with full node(s) when selection changes */\n @Output() SelectionChange = new EventEmitter<TreeNode | TreeNode[] | null>();\n\n // Bubble up tree events\n @Output() BeforeNodeSelect = new EventEmitter<BeforeNodeSelectEventArgs>();\n @Output() AfterNodeSelect = new EventEmitter<AfterNodeSelectEventArgs>();\n @Output() BeforeSearch = new EventEmitter<BeforeSearchEventArgs>();\n @Output() AfterSearch = new EventEmitter<AfterSearchEventArgs>();\n @Output() BeforeDropdownOpen = new EventEmitter<BeforeDropdownOpenEventArgs>();\n @Output() AfterDropdownOpen = new EventEmitter<AfterDropdownOpenEventArgs>();\n @Output() BeforeDropdownClose = new EventEmitter<BeforeDropdownCloseEventArgs>();\n @Output() AfterDropdownClose = new EventEmitter<AfterDropdownCloseEventArgs>();\n @Output() BeforeDataLoad = new EventEmitter<BeforeDataLoadEventArgs>();\n @Output() AfterDataLoad = new EventEmitter<AfterDataLoadEventArgs>();\n\n // ========================================\n // ViewChild References\n // ========================================\n\n @ViewChild('triggerElement') triggerElement!: ElementRef<HTMLElement>;\n @ViewChild('searchInput') searchInput!: ElementRef<HTMLInputElement>;\n @ViewChild('dropdownPanel') dropdownPanel!: ElementRef<HTMLElement>;\n @ViewChild('treeComponent') treeComponent!: TreeComponent;\n\n // ========================================\n // State\n // ========================================\n\n /** Is dropdown open */\n public IsOpen: boolean = false;\n\n /** Dropdown position */\n public Position: DropdownPosition | null = null;\n\n /** Search text */\n public SearchText: string = '';\n\n /** Selected nodes (for display) */\n public SelectedNodes: TreeNode[] = [];\n\n /** Is tree loading */\n public IsLoading: boolean = false;\n\n /** Has data loaded */\n public IsLoaded: boolean = false;\n\n /** Dropdown portal element */\n private dropdownPortal: HTMLElement | null = null;\n\n /** Search debounce subject */\n private searchSubject = new Subject<string>();\n\n /** Destroy subject */\n private destroy$ = new Subject<void>();\n\n /** Click outside listener */\n private clickOutsideListener: (() => void) | null = null;\n\n /** Scroll listener */\n private scrollListener: (() => void) | null = null;\n\n /** Resize listener */\n private resizeListener: (() => void) | null = null;\n\n /** Pending load promise resolvers */\n private _loadResolvers: Array<() => void> = [];\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(\n private readonly cdr: ChangeDetectorRef,\n private readonly renderer: Renderer2\n ) { super(); }\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngOnInit(): void {\n // Setup search debounce\n const debounceMs = this.SearchConfig.DebounceMs ?? 200;\n this.searchSubject.pipe(\n debounceTime(debounceMs),\n takeUntil(this.destroy$)\n ).subscribe(text => {\n this.performSearch(text);\n });\n }\n\n ngAfterViewInit(): void {\n // Create portal element\n this.createDropdownPortal();\n }\n\n // Note: Value changes are handled by the getter/setter pattern\n // No ngOnChanges needed for that property\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.removeDropdownPortal();\n this.removeEventListeners();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Returns a promise that resolves when the tree data has finished loading.\n * If data is already loaded, the promise resolves immediately.\n *\n * Use this method when you need to perform operations that depend on the tree\n * being fully loaded, such as programmatically selecting nodes or accessing\n * the tree structure.\n *\n * Note: For setting initial values, you typically don't need this method -\n * just set the `Value` input and the component will automatically display\n * the correct text by looking up the record name via Metadata.\n *\n * @returns A promise that resolves when the tree data is loaded\n * @example\n * ```typescript\n * // Wait for tree to load before accessing tree structure\n * await treeDropdown.WaitForDataLoad();\n * const nodes = treeDropdown.treeComponent.Nodes;\n * ```\n */\n public WaitForDataLoad(): Promise<void> {\n if (this.IsLoaded) {\n return Promise.resolve();\n }\n return new Promise<void>((resolve) => {\n this._loadResolvers.push(resolve);\n });\n }\n\n /**\n * Open the dropdown\n */\n public Open(): void {\n if (this.Disabled || this.IsOpen) {\n return;\n }\n\n // Fire before event\n const beforeEvent = new BeforeDropdownOpenEventArgs(this);\n this.BeforeDropdownOpen.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n this.IsOpen = true;\n this.calculatePosition();\n this.attachEventListeners();\n\n // Trigger change detection so the @if (IsOpen) block renders the dropdown panel\n this.cdr.detectChanges();\n\n // Focus search input after rendering\n this.focusSearchInput();\n\n // Fire after event\n const afterEvent = new AfterDropdownOpenEventArgs(\n this,\n this.Position?.renderAbove ? 'above' : 'below'\n );\n this.AfterDropdownOpen.emit(afterEvent);\n }\n\n /**\n * Close the dropdown\n */\n public Close(reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic' = 'programmatic'): void {\n if (!this.IsOpen) {\n return;\n }\n\n // Fire before event\n const beforeEvent = new BeforeDropdownCloseEventArgs(this, reason);\n this.BeforeDropdownClose.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n this.IsOpen = false;\n this.SearchText = '';\n this.clearSearch();\n this.removeEventListeners();\n\n // Fire after event\n const afterEvent = new AfterDropdownCloseEventArgs(this, reason);\n this.AfterDropdownClose.emit(afterEvent);\n\n this.cdr.detectChanges();\n }\n\n /**\n * Toggle dropdown\n */\n public Toggle(): void {\n if (this.IsOpen) {\n this.Close('programmatic');\n } else {\n this.Open();\n }\n }\n\n /**\n * Clear selection\n */\n public Clear(event?: MouseEvent): void {\n if (event) {\n event.stopPropagation();\n }\n\n this.SelectedNodes = [];\n this._value = null;\n this._pendingDisplayText = null;\n\n if (this.treeComponent) {\n this.treeComponent.ClearSelection();\n }\n\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(null);\n this.cdr.detectChanges();\n }\n\n /**\n * Refresh tree data\n */\n public async Refresh(): Promise<void> {\n if (this.treeComponent) {\n await this.treeComponent.Refresh();\n }\n }\n\n // ========================================\n // Template Event Handlers\n // ========================================\n\n /**\n * Handle trigger click\n */\n public onTriggerClick(): void {\n \n if (!this.Disabled) {\n this.Toggle();\n }\n }\n\n /**\n * Handle trigger keydown\n */\n public onTriggerKeyDown(event: KeyboardEvent): void {\n if (this.Disabled) {\n return;\n }\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault();\n this.Open();\n break;\n case 'Escape':\n if (this.IsOpen) {\n event.preventDefault();\n this.Close('escape');\n }\n break;\n }\n }\n\n /**\n * Handle search input\n */\n public onSearchInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n this.SearchText = value;\n this.searchSubject.next(value);\n }\n\n /**\n * Handle search keydown — provides full keyboard navigation while search input retains focus.\n * The tree's own keyboard handler doesn't fire because the search input has DOM focus,\n * so all navigation is handled here by manipulating the tree's FocusedNode visual state.\n */\n public onSearchKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n event.stopPropagation();\n this.Close('escape');\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.navigateTree('down');\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.navigateTree('up');\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.expandOrDescendFocusedNode();\n break;\n case 'ArrowLeft':\n event.preventDefault();\n this.collapseOrAscendFocusedNode();\n break;\n case 'Enter':\n event.preventDefault();\n this.selectFocusedNode();\n break;\n case 'Home':\n event.preventDefault();\n this.navigateTree('first');\n break;\n case 'End':\n event.preventDefault();\n this.navigateTree('last');\n break;\n }\n }\n\n /**\n * Handle clear search\n */\n public onClearSearch(): void {\n this.SearchText = '';\n this.clearSearch();\n if (this.searchInput) {\n this.searchInput.nativeElement.focus();\n }\n }\n\n /**\n * Handle tree selection change\n */\n public onTreeSelectionChange(nodes: TreeNode[]): void {\n \n this.SelectedNodes = nodes;\n\n // Clear pending display text since we now have real nodes\n this._pendingDisplayText = null;\n\n // Update value - convert node IDs to CompositeKeys\n if (this.SelectionMode === 'single') {\n this._value = nodes.length > 0 ? CompositeKey.FromID(nodes[0].ID) : null;\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(nodes.length > 0 ? nodes[0] : null);\n\n // Close on selection in single mode (unless disabled)\n // Only close if user actually selected something (not on empty selection from sync)\n \n if (this.DropdownConfig.CloseOnSelect !== false && nodes.length > 0) {\n \n this.Close('selection');\n }\n } else {\n this._value = nodes.map(n => CompositeKey.FromID(n.ID));\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(nodes.length > 0 ? nodes : null);\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Handle tree data load events\n */\n public onTreeBeforeDataLoad(event: BeforeDataLoadEventArgs): void {\n \n this.IsLoading = true;\n this.BeforeDataLoad.emit(event);\n this.cdr.detectChanges();\n }\n\n public onTreeAfterDataLoad(event: AfterDataLoadEventArgs): void {\n \n \n this.IsLoading = false;\n this.IsLoaded = true;\n\n // Resolve all pending WaitForDataLoad() promises\n const resolvers = this._loadResolvers;\n this._loadResolvers = [];\n for (const resolve of resolvers) {\n resolve();\n }\n\n // Sync selection after load - defer to next microtask to ensure ViewChild is resolved\n Promise.resolve().then(() => {\n \n if (this.treeComponent) {\n \n \n }\n this.syncValueToSelection();\n this.cdr.detectChanges();\n });\n\n this.AfterDataLoad.emit(event);\n this.cdr.detectChanges();\n }\n\n /**\n * Bubble tree events\n */\n public onTreeBeforeNodeSelect(event: BeforeNodeSelectEventArgs): void {\n this.BeforeNodeSelect.emit(event);\n }\n\n public onTreeAfterNodeSelect(event: AfterNodeSelectEventArgs): void {\n this.AfterNodeSelect.emit(event);\n }\n\n // ========================================\n // Keyboard Navigation Helpers\n // ========================================\n\n /**\n * Focus the search input after the dropdown opens.\n * Deferred to the next macrotask so that:\n * 1. Angular has fully resolved @ViewChild queries for the @if block\n * 2. The browser's click event (on the trigger) has completed and won't steal focus back\n * Falls back to direct DOM querySelector if the ViewChild isn't resolved.\n */\n private focusSearchInput(): void {\n if (!this.EnableSearch) return;\n\n const tryFocus = (retriesLeft: number): void => {\n // Try ViewChild first\n if (this.searchInput?.nativeElement) {\n this.searchInput.nativeElement.focus();\n return;\n }\n // Fallback: query DOM directly (ViewChild may not resolve for @if blocks)\n const panel = this.dropdownPanel?.nativeElement;\n if (panel) {\n const input = panel.querySelector('.tree-dropdown-search__input') as HTMLInputElement;\n if (input) {\n input.focus();\n return;\n }\n }\n // Retry on next frame\n if (retriesLeft > 0) {\n requestAnimationFrame(() => tryFocus(retriesLeft - 1));\n }\n };\n\n // Defer to next macrotask so the click event on the trigger completes first\n // and Angular finishes resolving ViewChild queries for the new @if block\n setTimeout(() => tryFocus(5), 0);\n }\n\n /**\n * Navigate tree focus up/down/first/last while search input retains DOM focus\n */\n private navigateTree(direction: 'up' | 'down' | 'first' | 'last'): void {\n if (!this.treeComponent?.Nodes?.length) return;\n\n const visibleNodes = this.getVisibleNodesInOrder(this.treeComponent.Nodes);\n if (visibleNodes.length === 0) return;\n\n const currentIndex = this.treeComponent.FocusedNode\n ? visibleNodes.indexOf(this.treeComponent.FocusedNode)\n : -1;\n\n let targetNode: TreeNode | null = null;\n\n switch (direction) {\n case 'down':\n targetNode = currentIndex === -1\n ? visibleNodes[0]\n : currentIndex < visibleNodes.length - 1\n ? visibleNodes[currentIndex + 1]\n : null;\n break;\n case 'up':\n targetNode = currentIndex === -1\n ? visibleNodes[visibleNodes.length - 1]\n : currentIndex > 0\n ? visibleNodes[currentIndex - 1]\n : null;\n break;\n case 'first':\n targetNode = visibleNodes[0];\n break;\n case 'last':\n targetNode = visibleNodes[visibleNodes.length - 1];\n break;\n }\n\n if (targetNode) {\n this.treeComponent.FocusedNode = targetNode;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n\n /**\n * Select the currently focused tree node (Enter key)\n */\n private selectFocusedNode(): void {\n const focusedNode = this.treeComponent?.FocusedNode;\n if (!focusedNode) return;\n\n // Check if the node type is selectable per config\n const isSelectable = this.SelectableTypes === 'both'\n || (this.SelectableTypes === 'leaf' && focusedNode.Type === 'leaf')\n || (this.SelectableTypes === 'branch' && focusedNode.Type === 'branch');\n\n if (isSelectable) {\n this.treeComponent.SelectNodes([focusedNode.ID], true);\n } else if (focusedNode.Type === 'branch') {\n // Non-selectable branch: toggle expand/collapse\n this.toggleBranchExpansion(focusedNode);\n }\n }\n\n /**\n * ArrowRight: expand focused branch or descend to first child\n */\n private expandOrDescendFocusedNode(): void {\n const node = this.treeComponent?.FocusedNode;\n if (!node || node.Type !== 'branch') return;\n\n if (!node.Expanded && node.Children?.length) {\n this.treeComponent.ExpandToNode(node.Children[0].ID);\n this.cdr.detectChanges();\n } else if (node.Expanded && node.Children?.length) {\n // Already expanded: move focus to first visible child\n const firstVisible = node.Children.find(c => c.Visible);\n if (firstVisible) {\n this.treeComponent.FocusedNode = firstVisible;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n }\n\n /**\n * ArrowLeft: collapse focused branch or ascend to parent\n */\n private collapseOrAscendFocusedNode(): void {\n const node = this.treeComponent?.FocusedNode;\n if (!node) return;\n\n if (node.Type === 'branch' && node.Expanded) {\n // Collapse the branch\n this.toggleBranchExpansion(node);\n } else if (node.ParentID) {\n // Move to parent\n const allNodes = this.getVisibleNodesInOrder(this.treeComponent.Nodes);\n const parent = allNodes.find(n => UUIDsEqual(n.ID, node.ParentID));\n if (parent) {\n this.treeComponent.FocusedNode = parent;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n }\n\n /**\n * Toggle expand/collapse of a branch node\n */\n private toggleBranchExpansion(node: TreeNode): void {\n if (node.Expanded) {\n node.Expanded = false;\n } else {\n this.treeComponent.ExpandToNode(node.ID);\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Scroll the currently focused tree node into view within the dropdown panel\n */\n private scrollFocusedNodeIntoView(): void {\n requestAnimationFrame(() => {\n const panel = this.dropdownPanel?.nativeElement;\n if (!panel) return;\n const focused = panel.querySelector('.tree-node-focused, .tree-node--focused, [data-focused=\"true\"]');\n if (focused) {\n focused.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n });\n }\n\n // ========================================\n // Private Methods\n // ========================================\n\n /**\n * Create dropdown portal element (attached to body)\n */\n private createDropdownPortal(): void {\n this.dropdownPortal = this.renderer.createElement('div');\n this.renderer.addClass(this.dropdownPortal, 'mj-tree-dropdown-portal');\n this.renderer.setStyle(this.dropdownPortal, 'position', 'fixed');\n this.renderer.setStyle(this.dropdownPortal, 'z-index', '10000');\n this.renderer.setStyle(this.dropdownPortal, 'display', 'none');\n this.renderer.appendChild(document.body, this.dropdownPortal);\n }\n\n /**\n * Remove dropdown portal\n */\n private removeDropdownPortal(): void {\n if (this.dropdownPortal && this.dropdownPortal.parentNode) {\n this.dropdownPortal.parentNode.removeChild(this.dropdownPortal);\n this.dropdownPortal = null;\n }\n }\n\n /**\n * Calculate dropdown position\n */\n private calculatePosition(): void {\n if (!this.triggerElement) {\n return;\n }\n\n const triggerRect = this.triggerElement.nativeElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n // Parse max height from config\n const maxHeightConfig = this.DropdownConfig.MaxHeight || '300px';\n const maxHeightPx = parseInt(maxHeightConfig, 10) || 300;\n\n // Calculate available space\n const spaceBelow = viewportHeight - triggerRect.bottom - 8; // 8px margin\n const spaceAbove = triggerRect.top - 8;\n\n // Determine if we should render above or below\n let renderAbove = false;\n let maxHeight = maxHeightPx;\n\n if (this.DropdownConfig.Position === 'above') {\n renderAbove = true;\n maxHeight = Math.min(maxHeightPx, spaceAbove);\n } else if (this.DropdownConfig.Position === 'below') {\n renderAbove = false;\n maxHeight = Math.min(maxHeightPx, spaceBelow);\n } else {\n // Auto position\n if (spaceBelow < maxHeightPx && spaceAbove > spaceBelow) {\n renderAbove = true;\n maxHeight = Math.min(maxHeightPx, spaceAbove);\n } else {\n renderAbove = false;\n maxHeight = Math.min(maxHeightPx, spaceBelow);\n }\n }\n\n // Calculate width. When no explicit MinWidth is configured, fall back to a\n // readable default (not the trigger width) so the panel doesn't collapse to\n // a narrow column when the trigger is small — node labels need room. The\n // panel never gets narrower than the trigger, and `left` below is computed\n // from this width so a wider panel still avoids overflowing the viewport.\n const minWidth = this.DropdownConfig.MinWidth\n ? parseInt(this.DropdownConfig.MinWidth, 10)\n : TreeDropdownComponent.DEFAULT_PANEL_MIN_WIDTH;\n const width = Math.max(minWidth, triggerRect.width);\n\n // Ensure dropdown doesn't go off screen horizontally\n let left = triggerRect.left;\n if (left + width > viewportWidth - 8) {\n left = viewportWidth - width - 8;\n }\n if (left < 8) {\n left = 8;\n }\n\n // Calculate top position\n let top: number;\n if (renderAbove) {\n top = triggerRect.top - maxHeight - 4;\n } else {\n top = triggerRect.bottom + 4;\n }\n\n this.Position = {\n top,\n left,\n width,\n maxHeight,\n renderAbove\n };\n }\n\n /**\n * Attach event listeners for click outside, scroll, resize\n */\n private attachEventListeners(): void {\n \n // Click outside - defer with a small timeout to:\n // 1. Allow the opening click event to complete\n // 2. Ensure the dropdown panel DOM element is fully rendered\n // 3. Allow Angular change detection to complete\n if (this.DropdownConfig.CloseOnOutsideClick !== false) {\n \n setTimeout(() => {\n \n // Only attach if still open (could have been closed in the meantime)\n if (!this.IsOpen) {\n \n return;\n }\n \n this.clickOutsideListener = this.renderer.listen('document', 'click', (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n \n \n // Double check we're still open\n if (!this.IsOpen) {\n \n return;\n }\n const isInsideTrigger = this.triggerElement?.nativeElement?.contains(target);\n // Check if click is inside the dropdown panel (rendered inline, not in portal)\n const isInsideDropdown = this.dropdownPanel?.nativeElement?.contains(target);\n \n \n\n if (!isInsideTrigger && !isInsideDropdown) {\n \n this.Close('outsideClick');\n } else {\n \n }\n });\n }, 100); // 100ms delay to ensure DOM is stable\n } else {\n \n }\n\n // Escape key\n if (this.DropdownConfig.CloseOnEscape !== false) {\n document.addEventListener('keydown', this.handleEscapeKey);\n }\n\n // Scroll - reposition dropdown\n this.scrollListener = this.renderer.listen('window', 'scroll', () => {\n if (this.IsOpen) {\n this.calculatePosition();\n this.updateDropdownPortalPosition();\n }\n });\n\n // Resize - reposition dropdown\n this.resizeListener = this.renderer.listen('window', 'resize', () => {\n if (this.IsOpen) {\n this.calculatePosition();\n this.updateDropdownPortalPosition();\n }\n });\n }\n\n /**\n * Remove event listeners\n */\n private removeEventListeners(): void {\n if (this.clickOutsideListener) {\n this.clickOutsideListener();\n this.clickOutsideListener = null;\n }\n\n document.removeEventListener('keydown', this.handleEscapeKey);\n\n if (this.scrollListener) {\n this.scrollListener();\n this.scrollListener = null;\n }\n\n if (this.resizeListener) {\n this.resizeListener();\n this.resizeListener = null;\n }\n }\n\n /**\n * Handle escape key\n */\n private handleEscapeKey = (event: KeyboardEvent): void => {\n \n if (event.key === 'Escape' && this.IsOpen) {\n this.Close('escape');\n }\n };\n\n /**\n * Update dropdown portal position\n */\n private updateDropdownPortalPosition(): void {\n if (!this.dropdownPortal || !this.Position) {\n return;\n }\n\n this.renderer.setStyle(this.dropdownPortal, 'top', `${this.Position.top}px`);\n this.renderer.setStyle(this.dropdownPortal, 'left', `${this.Position.left}px`);\n this.renderer.setStyle(this.dropdownPortal, 'width', `${this.Position.width}px`);\n }\n\n /**\n * Perform search on tree\n */\n private performSearch(text: string): void {\n // Fire before event\n const beforeEvent = new BeforeSearchEventArgs(this, text);\n this.BeforeSearch.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n const searchText = beforeEvent.ModifiedSearchText ?? text;\n\n // Guard: tree component may not be ready or may have no nodes loaded\n if (!this.treeComponent || !this.IsLoaded) {\n return;\n }\n\n const matchedNodes = this.treeComponent.FilterNodes(\n searchText,\n {\n caseSensitive: this.SearchConfig.CaseSensitive,\n searchBranches: this.SearchConfig.SearchBranches ?? true,\n searchLeaves: this.SearchConfig.SearchLeaves ?? true,\n searchDescription: this.SearchConfig.SearchDescription\n }\n );\n\n // Auto-expand to show matches — guard against empty results\n if (matchedNodes.length > 0 && this.SearchConfig.AutoExpandMatches !== false && searchText.trim()) {\n for (const node of matchedNodes) {\n this.treeComponent.ExpandToNode(node.ID);\n }\n }\n\n // Fire after event\n const afterEvent = new AfterSearchEventArgs(this, searchText, matchedNodes ?? []);\n this.AfterSearch.emit(afterEvent);\n\n this.cdr.detectChanges();\n }\n\n /**\n * Clear search filter\n */\n private clearSearch(): void {\n if (this.treeComponent?.Nodes?.length) {\n this.treeComponent.FilterNodes('', {});\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get all visible nodes in tree order (for keyboard navigation)\n */\n private getVisibleNodesInOrder(nodes: TreeNode[]): TreeNode[] {\n if (!nodes || nodes.length === 0) return [];\n const result: TreeNode[] = [];\n this.collectVisibleNodesRecursive(nodes, result);\n return result;\n }\n\n private collectVisibleNodesRecursive(nodes: TreeNode[], result: TreeNode[]): void {\n if (!nodes) return;\n for (const node of nodes) {\n if (node.Visible) {\n result.push(node);\n if (node.Expanded && node.Type === 'branch' && node.Children?.length) {\n this.collectVisibleNodesRecursive(node.Children, result);\n }\n }\n }\n }\n\n /**\n * Sync value to tree selection\n */\n private syncValueToSelection(): void {\n if (!this.treeComponent || !this.IsLoaded) {\n return;\n }\n\n // Convert CompositeKey(s) to string IDs for tree selection\n const ids = this.getSelectedIDsArray();\n\n // Pass emitChange=false to avoid emitting SelectionChange during sync\n // This prevents unnecessary events and parent component confusion\n this.treeComponent.SelectNodes(ids, false);\n\n // Use try-catch as defensive measure since tree component may not be fully ready\n try {\n this.SelectedNodes = this.treeComponent.GetSelectedNodes() || [];\n } catch {\n this.SelectedNodes = [];\n }\n\n // Clear pending display text since we now have real nodes\n this._pendingDisplayText = null;\n\n this.cdr.detectChanges();\n }\n\n /**\n * Fetch display text for value before tree loads using Metadata.GetEntityRecordName\n */\n private async fetchDisplayTextForValue(val: CompositeKey | CompositeKey[] | null): Promise<void> {\n // Determine which entity to look up: prefer LeafConfig, fall back to BranchConfig\n // (branch-only dropdowns have no LeafConfig)\n const entityName = this.LeafConfig?.EntityName ?? this.BranchConfig?.EntityName;\n if (!val || !entityName) {\n this._pendingDisplayText = null;\n this.cdr.detectChanges();\n return;\n }\n\n try {\n const md = this.ProviderToUse;\n\n if (Array.isArray(val)) {\n // Multiple selection\n if (val.length === 0) {\n this._pendingDisplayText = null;\n } else if (val.length === 1) {\n this._pendingDisplayText = await md.GetEntityRecordName(entityName, val[0]);\n } else {\n this._pendingDisplayText = `${val.length} items selected`;\n }\n } else {\n // Single selection\n this._pendingDisplayText = await md.GetEntityRecordName(entityName, val);\n }\n } catch (error) {\n console.warn('[TreeDropdown] Failed to fetch display text:', error);\n this._pendingDisplayText = null;\n }\n\n this.cdr.detectChanges();\n }\n\n // ========================================\n // Template Helpers\n // ========================================\n\n /**\n * Get display text for selected value(s)\n */\n public getDisplayText(): string {\n // If we have selected nodes from the tree, use those\n if (this.SelectedNodes.length > 0) {\n if (this.SelectionMode === 'single') {\n return this.SelectedNodes[0].Label;\n }\n\n // Multiple selection\n if (this.SelectedNodes.length === 1) {\n return this.SelectedNodes[0].Label;\n }\n\n return `${this.SelectedNodes.length} items selected`;\n }\n\n // If tree not loaded but we have pending display text from Metadata lookup\n if (this._pendingDisplayText) {\n return this._pendingDisplayText;\n }\n\n return '';\n }\n\n /**\n * Get display icon for single selection\n */\n public getDisplayIcon(): string | null {\n if (!this.ShowIconInDisplay || this.SelectedNodes.length !== 1) {\n return null;\n }\n return this.SelectedNodes[0].Icon;\n }\n\n /**\n * Get display color for single selection\n */\n public getDisplayColor(): string | null {\n if (this.SelectedNodes.length !== 1) {\n return null;\n }\n return this.SelectedNodes[0].Color || null;\n }\n\n /**\n * Check if has selection\n */\n public hasSelection(): boolean {\n return this.SelectedNodes.length > 0 || this._pendingDisplayText != null;\n }\n\n /**\n * Get dropdown panel styles\n */\n public getDropdownStyles(): Record<string, string> {\n if (!this.Position) {\n return {};\n }\n\n return {\n top: `${this.Position.top}px`,\n left: `${this.Position.left}px`,\n width: `${this.Position.width}px`,\n maxHeight: `${this.Position.maxHeight}px`\n };\n }\n\n /**\n * Get trigger classes\n */\n public getTriggerClasses(): Record<string, boolean> {\n return {\n 'tree-dropdown-trigger': true,\n 'tree-dropdown-trigger--open': this.IsOpen,\n 'tree-dropdown-trigger--disabled': this.Disabled,\n 'tree-dropdown-trigger--has-value': this.hasSelection(),\n 'tree-dropdown-trigger--loading': this.IsLoading && this.ShowLoadingInTrigger\n };\n }\n\n /**\n * Get selected IDs as a string array for passing to tree component.\n * Extracts the first key value from each CompositeKey (typically the ID field).\n */\n public getSelectedIDsArray(): string[] {\n if (!this._value) {\n return [];\n }\n\n const keys = Array.isArray(this._value) ? this._value : [this._value];\n return keys.map(key => {\n // Get the first value from the composite key (usually the ID)\n const firstValue = key.GetValueByIndex(0);\n return firstValue != null ? String(firstValue) : '';\n }).filter(id => id !== '');\n }\n}\n","<!-- Tree Dropdown Component Template -->\n<div class=\"tree-dropdown\" [class.tree-dropdown--disabled]=\"Disabled\">\n\n <!-- Trigger Button -->\n <div\n #triggerElement\n [ngClass]=\"getTriggerClasses()\"\n [class]=\"StyleConfig.SearchInputClass || ''\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"IsOpen\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-disabled]=\"Disabled\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeyDown($event)\">\n\n <!-- Selected Value Display -->\n <div class=\"tree-dropdown-trigger__content\">\n <!-- Icon -->\n @if (getDisplayIcon()) {\n <span\n class=\"tree-dropdown-trigger__icon\"\n [style.color]=\"getDisplayColor()\">\n <i [class]=\"getDisplayIcon()\"></i>\n </span>\n }\n\n <!-- Text -->\n <span\n class=\"tree-dropdown-trigger__text\"\n [class.tree-dropdown-trigger__text--placeholder]=\"!hasSelection()\">\n {{ hasSelection() ? getDisplayText() : Placeholder }}\n </span>\n\n <!-- Loading Spinner -->\n @if (IsLoading && ShowLoadingInTrigger) {\n <span class=\"tree-dropdown-trigger__loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n </span>\n }\n </div>\n\n <!-- Actions -->\n <div class=\"tree-dropdown-trigger__actions\">\n <!-- Clear Button -->\n @if (Clearable && hasSelection() && !Disabled) {\n <button\n type=\"button\"\n class=\"tree-dropdown-trigger__clear\"\n (click)=\"Clear($event)\"\n title=\"Clear selection\"\n tabindex=\"-1\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"tree-dropdown-trigger__chevron\">\n <i\n class=\"fa-solid\"\n [ngClass]=\"IsOpen ? 'fa-chevron-up' : 'fa-chevron-down'\">\n </i>\n </span>\n </div>\n </div>\n\n <!-- Dropdown Panel (rendered in place, will be moved to portal when open) -->\n @if (IsOpen) {\n <div\n #dropdownPanel\n class=\"tree-dropdown-panel\"\n [class.tree-dropdown-panel--open]=\"IsOpen\"\n [class.tree-dropdown-panel--above]=\"Position?.renderAbove\"\n [class.tree-dropdown-panel--below]=\"!Position?.renderAbove\"\n [class]=\"StyleConfig.DropdownClass || ''\"\n [ngStyle]=\"IsOpen ? getDropdownStyles() : {}\"\n role=\"tree\">\n <!-- Search Input -->\n @if (EnableSearch) {\n <div class=\"tree-dropdown-search\">\n <div class=\"tree-dropdown-search__input-wrapper\">\n <i class=\"fa-solid fa-search tree-dropdown-search__icon\"></i>\n <input\n #searchInput\n type=\"text\"\n class=\"tree-dropdown-search__input\"\n [placeholder]=\"SearchConfig.Placeholder || 'Type to search...'\"\n [value]=\"SearchText\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeyDown($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\">\n @if (SearchText) {\n <button\n type=\"button\"\n class=\"tree-dropdown-search__clear\"\n (click)=\"onClearSearch()\"\n tabindex=\"-1\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n </div>\n }\n <!-- Tree -->\n <div class=\"tree-dropdown-tree\">\n <mj-tree\n #treeComponent\n [BranchConfig]=\"BranchConfig\"\n [LeafConfig]=\"LeafConfig\"\n [SelectionMode]=\"SelectionMode\"\n [SelectableTypes]=\"SelectableTypes\"\n [DefaultExpansion]=\"DefaultExpansion\"\n [SelectedIDs]=\"getSelectedIDsArray()\"\n [AutoLoad]=\"AutoLoad\"\n [ShowIcons]=\"true\"\n [ShowExpandCollapseAll]=\"false\"\n [AnimateExpandCollapse]=\"true\"\n [EmptyMessage]=\"SearchText ? 'No matches found' : 'No items available'\"\n [EmptyIcon]=\"SearchText ? 'fa-solid fa-search' : 'fa-solid fa-folder-open'\"\n (SelectionChange)=\"onTreeSelectionChange($event)\"\n (BeforeNodeSelect)=\"onTreeBeforeNodeSelect($event)\"\n (AfterNodeSelect)=\"onTreeAfterNodeSelect($event)\"\n (BeforeDataLoad)=\"onTreeBeforeDataLoad($event)\"\n (AfterDataLoad)=\"onTreeAfterDataLoad($event)\">\n </mj-tree>\n </div>\n </div>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"tree-dropdown.component.js","sourceRoot":"","sources":["../../../src/lib/tree-dropdown/tree-dropdown.component.ts","../../../src/lib/tree-dropdown/tree-dropdown.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAIZ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cAAkE;YAAlE,+EAAkE;YAClE,cACF;YADE,4FACF;YAGA,cAIC;YAJD,oEAIC;YAMD,eASC;YATD,+EASC;YAMG,eAAwD;YAAxD,0EAAwD;YAOhE,cA6DC;YA7DD,sCA6DC;;;iFD1DU,qBAAqB;cANjC,SAAS;6BACI,KAAK,YACL,kBAAkB;;kBAkB3B,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAkCL,KAAK;;kBAyBL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAOL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAMN,SAAS;mBAAC,gBAAgB;;kBAC1B,SAAS;mBAAC,aAAa;;kBACvB,SAAS;mBAAC,eAAe;;kBACzB,SAAS;mBAAC,eAAe;;kFA/IjB,qBAAqB","sourcesContent":["/**\n * Tree Dropdown Component for @memberjunction/ng-trees\n *\n * A searchable dropdown with tree selection. Features:\n * - Smart positioning (auto-flips above/below based on available space)\n * - Portal rendering to avoid clipping\n * - Type-ahead search with highlighting\n * - Keyboard navigation\n * - Single and multi-select modes\n */\n\nimport {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n OnInit,\n OnDestroy,\n ViewChild,\n ElementRef, // Still needed for ViewChild type references\n Renderer2,\n AfterViewInit\n} from '@angular/core';\nimport {\n TreeNode,\n TreeBranchConfig,\n TreeLeafConfig,\n TreeSelectionMode,\n TreeSelectableTypes,\n TreeStyleConfig,\n TreeSearchConfig,\n TreeDropdownConfig\n} from '../models/tree-types';\nimport {\n BeforeNodeSelectEventArgs,\n AfterNodeSelectEventArgs,\n BeforeSearchEventArgs,\n AfterSearchEventArgs,\n BeforeDropdownOpenEventArgs,\n AfterDropdownOpenEventArgs,\n BeforeDropdownCloseEventArgs,\n AfterDropdownCloseEventArgs,\n BeforeDataLoadEventArgs,\n AfterDataLoadEventArgs\n} from '../events/tree-events';\nimport { TreeComponent } from '../tree/tree.component';\nimport { Subject } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\nimport { CompositeKey } from '@memberjunction/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Dropdown position calculation result\n */\ninterface DropdownPosition {\n top: number;\n left: number;\n width: number;\n maxHeight: number;\n renderAbove: boolean;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-tree-dropdown',\n templateUrl: './tree-dropdown.component.html',\n styleUrls: ['./tree-dropdown.component.css']\n})\nexport class TreeDropdownComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewInit {\n /**\n * Default minimum width (px) for the open dropdown panel when the consumer\n * hasn't set `DropdownConfig.MinWidth`. Keeps node labels readable even when\n * the trigger is narrow (e.g. a compact form field). The panel still grows to\n * the trigger width when that is larger.\n */\n private static readonly DEFAULT_PANEL_MIN_WIDTH = 280;\n\n // ========================================\n // Tree Configuration (passed to inner tree)\n // ========================================\n\n /** Branch (category) entity configuration - REQUIRED */\n @Input() BranchConfig!: TreeBranchConfig;\n\n /** Optional leaf entity configuration */\n @Input() LeafConfig?: TreeLeafConfig;\n\n /** Selection mode: 'single' or 'multiple' */\n @Input() SelectionMode: TreeSelectionMode = 'single';\n\n /** What types can be selected: 'branch', 'leaf', or 'both' */\n @Input() SelectableTypes: TreeSelectableTypes = 'both';\n\n /** Initial expansion for the inner tree when it first loads (see TreeComponent.DefaultExpansion). */\n @Input() DefaultExpansion: 'first-level' | 'all' | 'none' = 'first-level';\n\n // ========================================\n // Value Inputs\n // ========================================\n\n /** Current selected value (CompositeKey for single, CompositeKeys for multiple) */\n private _value: CompositeKey | CompositeKey[] | null = null;\n\n /**\n * The selected value as a CompositeKey (single select) or array of CompositeKeys (multi-select).\n * CompositeKey supports both simple single-field primary keys and composite primary keys.\n *\n * @example Single select with simple ID:\n * ```typescript\n * dropdown.Value = CompositeKey.FromID('some-guid');\n * ```\n *\n * @example Single select with composite key:\n * ```typescript\n * dropdown.Value = new CompositeKey([\n * { FieldName: 'Field1', Value: 'value1' },\n * { FieldName: 'Field2', Value: 'value2' }\n * ]);\n * ```\n *\n * @example Multi-select:\n * ```typescript\n * dropdown.Value = [\n * CompositeKey.FromID('guid1'),\n * CompositeKey.FromID('guid2')\n * ];\n * ```\n */\n @Input()\n set Value(val: CompositeKey | CompositeKey[] | null) {\n if (!CompositeKey.EqualsEx(val, this._value)) {\n this._value = val;\n // If tree is loaded, sync selection immediately\n if (this.IsLoaded && this.treeComponent) {\n this.syncValueToSelection();\n } else {\n // Tree not loaded yet - fetch display text directly via Metadata\n this.fetchDisplayTextForValue(val);\n }\n }\n }\n get Value(): CompositeKey | CompositeKey[] | null {\n return this._value;\n }\n \n /** Cached display text for showing in trigger before tree loads */\n private _pendingDisplayText: string | null = null;\n\n // ========================================\n // Dropdown-specific Inputs\n // ========================================\n\n /** Placeholder text when nothing selected */\n @Input() Placeholder: string = 'Select...';\n\n /** Enable search filtering */\n @Input() EnableSearch: boolean = true;\n\n /** Search configuration */\n @Input() SearchConfig: TreeSearchConfig = {};\n\n /** Dropdown configuration */\n @Input() DropdownConfig: TreeDropdownConfig = {};\n\n /** Style configuration */\n @Input() StyleConfig: TreeStyleConfig = {};\n\n /** Show clear button */\n @Input() Clearable: boolean = true;\n\n /** Disabled state */\n @Input() Disabled: boolean = false;\n\n /** Show node icons in display */\n @Input() ShowIconInDisplay: boolean = true;\n\n /** Auto-load data on init */\n @Input() AutoLoad: boolean = true;\n\n /** Show loading in trigger */\n @Input() ShowLoadingInTrigger: boolean = true;\n\n // ========================================\n // Event Outputs\n // ========================================\n\n /** Emitted when value changes */\n @Output() ValueChange = new EventEmitter<CompositeKey | CompositeKey[] | null>();\n\n /** Emitted with full node(s) when selection changes */\n @Output() SelectionChange = new EventEmitter<TreeNode | TreeNode[] | null>();\n\n // Bubble up tree events\n @Output() BeforeNodeSelect = new EventEmitter<BeforeNodeSelectEventArgs>();\n @Output() AfterNodeSelect = new EventEmitter<AfterNodeSelectEventArgs>();\n @Output() BeforeSearch = new EventEmitter<BeforeSearchEventArgs>();\n @Output() AfterSearch = new EventEmitter<AfterSearchEventArgs>();\n @Output() BeforeDropdownOpen = new EventEmitter<BeforeDropdownOpenEventArgs>();\n @Output() AfterDropdownOpen = new EventEmitter<AfterDropdownOpenEventArgs>();\n @Output() BeforeDropdownClose = new EventEmitter<BeforeDropdownCloseEventArgs>();\n @Output() AfterDropdownClose = new EventEmitter<AfterDropdownCloseEventArgs>();\n @Output() BeforeDataLoad = new EventEmitter<BeforeDataLoadEventArgs>();\n @Output() AfterDataLoad = new EventEmitter<AfterDataLoadEventArgs>();\n\n // ========================================\n // ViewChild References\n // ========================================\n\n @ViewChild('triggerElement') triggerElement!: ElementRef<HTMLElement>;\n @ViewChild('searchInput') searchInput!: ElementRef<HTMLInputElement>;\n @ViewChild('dropdownPanel') dropdownPanel!: ElementRef<HTMLElement>;\n @ViewChild('treeComponent') treeComponent!: TreeComponent;\n\n // ========================================\n // State\n // ========================================\n\n /** Is dropdown open */\n public IsOpen: boolean = false;\n\n /** Dropdown position */\n public Position: DropdownPosition | null = null;\n\n /** Search text */\n public SearchText: string = '';\n\n /** Selected nodes (for display) */\n public SelectedNodes: TreeNode[] = [];\n\n /** Is tree loading */\n public IsLoading: boolean = false;\n\n /** Has data loaded */\n public IsLoaded: boolean = false;\n\n /** Dropdown portal element */\n private dropdownPortal: HTMLElement | null = null;\n\n /** Search debounce subject */\n private searchSubject = new Subject<string>();\n\n /** Destroy subject */\n private destroy$ = new Subject<void>();\n\n /** Click outside listener */\n private clickOutsideListener: (() => void) | null = null;\n\n /** Scroll listener */\n private scrollListener: (() => void) | null = null;\n\n /** Resize listener */\n private resizeListener: (() => void) | null = null;\n\n /** Pending load promise resolvers */\n private _loadResolvers: Array<() => void> = [];\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(\n private readonly cdr: ChangeDetectorRef,\n private readonly renderer: Renderer2\n ) { super(); }\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngOnInit(): void {\n // Setup search debounce\n const debounceMs = this.SearchConfig.DebounceMs ?? 200;\n this.searchSubject.pipe(\n debounceTime(debounceMs),\n takeUntil(this.destroy$)\n ).subscribe(text => {\n this.performSearch(text);\n });\n }\n\n ngAfterViewInit(): void {\n // Create portal element\n this.createDropdownPortal();\n }\n\n // Note: Value changes are handled by the getter/setter pattern\n // No ngOnChanges needed for that property\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.removeDropdownPortal();\n this.removeEventListeners();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Returns a promise that resolves when the tree data has finished loading.\n * If data is already loaded, the promise resolves immediately.\n *\n * Use this method when you need to perform operations that depend on the tree\n * being fully loaded, such as programmatically selecting nodes or accessing\n * the tree structure.\n *\n * Note: For setting initial values, you typically don't need this method -\n * just set the `Value` input and the component will automatically display\n * the correct text by looking up the record name via Metadata.\n *\n * @returns A promise that resolves when the tree data is loaded\n * @example\n * ```typescript\n * // Wait for tree to load before accessing tree structure\n * await treeDropdown.WaitForDataLoad();\n * const nodes = treeDropdown.treeComponent.Nodes;\n * ```\n */\n public WaitForDataLoad(): Promise<void> {\n if (this.IsLoaded) {\n return Promise.resolve();\n }\n return new Promise<void>((resolve) => {\n this._loadResolvers.push(resolve);\n });\n }\n\n /**\n * Open the dropdown\n */\n public Open(): void {\n if (this.Disabled || this.IsOpen) {\n return;\n }\n\n // Fire before event\n const beforeEvent = new BeforeDropdownOpenEventArgs(this);\n this.BeforeDropdownOpen.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n this.IsOpen = true;\n this.calculatePosition();\n this.attachEventListeners();\n\n // Trigger change detection so the @if (IsOpen) block renders the dropdown panel\n this.cdr.detectChanges();\n\n // Focus search input after rendering\n this.focusSearchInput();\n\n // Fire after event\n const afterEvent = new AfterDropdownOpenEventArgs(\n this,\n this.Position?.renderAbove ? 'above' : 'below'\n );\n this.AfterDropdownOpen.emit(afterEvent);\n }\n\n /**\n * Close the dropdown\n */\n public Close(reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic' = 'programmatic'): void {\n if (!this.IsOpen) {\n return;\n }\n\n // Fire before event\n const beforeEvent = new BeforeDropdownCloseEventArgs(this, reason);\n this.BeforeDropdownClose.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n this.IsOpen = false;\n this.SearchText = '';\n this.clearSearch();\n this.removeEventListeners();\n\n // Fire after event\n const afterEvent = new AfterDropdownCloseEventArgs(this, reason);\n this.AfterDropdownClose.emit(afterEvent);\n\n this.cdr.detectChanges();\n }\n\n /**\n * Toggle dropdown\n */\n public Toggle(): void {\n if (this.IsOpen) {\n this.Close('programmatic');\n } else {\n this.Open();\n }\n }\n\n /**\n * Clear selection\n */\n public Clear(event?: MouseEvent): void {\n if (event) {\n event.stopPropagation();\n }\n\n this.SelectedNodes = [];\n this._value = null;\n this._pendingDisplayText = null;\n\n if (this.treeComponent) {\n this.treeComponent.ClearSelection();\n }\n\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(null);\n this.cdr.detectChanges();\n }\n\n /**\n * Refresh tree data\n */\n public async Refresh(): Promise<void> {\n if (this.treeComponent) {\n await this.treeComponent.Refresh();\n }\n }\n\n // ========================================\n // Template Event Handlers\n // ========================================\n\n /**\n * Handle trigger click\n */\n public onTriggerClick(): void {\n \n if (!this.Disabled) {\n this.Toggle();\n }\n }\n\n /**\n * Handle trigger keydown\n */\n public onTriggerKeyDown(event: KeyboardEvent): void {\n if (this.Disabled) {\n return;\n }\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault();\n this.Open();\n break;\n case 'Escape':\n if (this.IsOpen) {\n event.preventDefault();\n this.Close('escape');\n }\n break;\n }\n }\n\n /**\n * Handle search input\n */\n public onSearchInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n this.SearchText = value;\n this.searchSubject.next(value);\n }\n\n /**\n * Handle search keydown — provides full keyboard navigation while search input retains focus.\n * The tree's own keyboard handler doesn't fire because the search input has DOM focus,\n * so all navigation is handled here by manipulating the tree's FocusedNode visual state.\n */\n public onSearchKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n event.stopPropagation();\n this.Close('escape');\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.navigateTree('down');\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.navigateTree('up');\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.expandOrDescendFocusedNode();\n break;\n case 'ArrowLeft':\n event.preventDefault();\n this.collapseOrAscendFocusedNode();\n break;\n case 'Enter':\n event.preventDefault();\n this.selectFocusedNode();\n break;\n case 'Home':\n event.preventDefault();\n this.navigateTree('first');\n break;\n case 'End':\n event.preventDefault();\n this.navigateTree('last');\n break;\n }\n }\n\n /**\n * Handle clear search\n */\n public onClearSearch(): void {\n this.SearchText = '';\n this.clearSearch();\n if (this.searchInput) {\n this.searchInput.nativeElement.focus();\n }\n }\n\n /**\n * Handle tree selection change\n */\n public onTreeSelectionChange(nodes: TreeNode[]): void {\n \n this.SelectedNodes = nodes;\n\n // Clear pending display text since we now have real nodes\n this._pendingDisplayText = null;\n\n // Update value - convert node IDs to CompositeKeys\n if (this.SelectionMode === 'single') {\n this._value = nodes.length > 0 ? this.nodeToKey(nodes[0]) : null;\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(nodes.length > 0 ? nodes[0] : null);\n\n // Close on selection in single mode (unless disabled)\n // Only close if user actually selected something (not on empty selection from sync)\n \n if (this.DropdownConfig.CloseOnSelect !== false && nodes.length > 0) {\n \n this.Close('selection');\n }\n } else {\n this._value = nodes.map(n => this.nodeToKey(n));\n this.ValueChange.emit(this._value);\n this.SelectionChange.emit(nodes.length > 0 ? nodes : null);\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Build the CompositeKey for a selected node. A node's `ID` is the value of its config's `IDField`\n * (leaf or branch), so the key is named after that field rather than a hardcoded `ID`. When no\n * `IDField` is configured, the field is the entity's primary key — the tree identifies a node by\n * exactly one string, so a single-column key is the only shape this control can represent.\n */\n private nodeToKey(node: TreeNode): CompositeKey {\n const config = node.Type === 'leaf' && this.LeafConfig ? this.LeafConfig : this.BranchConfig;\n const idField = config?.IDField ?? this.resolvePrimaryKeyFieldName(config?.EntityName);\n return CompositeKey.FromKeyValuePair(idField, node.ID);\n }\n\n /** The single primary-key column of the configured entity, used when a config has no explicit `IDField`. */\n private resolvePrimaryKeyFieldName(entityName: string | undefined): string {\n const entityInfo = entityName ? this.ProviderToUse.EntityByName(entityName) : null;\n if (!entityInfo) {\n throw new Error(`TreeDropdown: cannot resolve the ID field — entity '${entityName ?? ''}' was not found in metadata and no IDField is configured.`);\n }\n if (entityInfo.PrimaryKeys.length !== 1) {\n throw new Error(`TreeDropdown: entity '${entityName}' has a composite primary key; set IDField on the tree config to name the node identity column.`);\n }\n return entityInfo.FirstPrimaryKey.Name; // first-pk-ok: guarded by PrimaryKeys.length === 1 above — a tree node carries exactly one ID string\n }\n\n /**\n * Handle tree data load events\n */\n public onTreeBeforeDataLoad(event: BeforeDataLoadEventArgs): void {\n \n this.IsLoading = true;\n this.BeforeDataLoad.emit(event);\n this.cdr.detectChanges();\n }\n\n public onTreeAfterDataLoad(event: AfterDataLoadEventArgs): void {\n \n \n this.IsLoading = false;\n this.IsLoaded = true;\n\n // Resolve all pending WaitForDataLoad() promises\n const resolvers = this._loadResolvers;\n this._loadResolvers = [];\n for (const resolve of resolvers) {\n resolve();\n }\n\n // Sync selection after load - defer to next microtask to ensure ViewChild is resolved\n Promise.resolve().then(() => {\n \n if (this.treeComponent) {\n \n \n }\n this.syncValueToSelection();\n this.cdr.detectChanges();\n });\n\n this.AfterDataLoad.emit(event);\n this.cdr.detectChanges();\n }\n\n /**\n * Bubble tree events\n */\n public onTreeBeforeNodeSelect(event: BeforeNodeSelectEventArgs): void {\n this.BeforeNodeSelect.emit(event);\n }\n\n public onTreeAfterNodeSelect(event: AfterNodeSelectEventArgs): void {\n this.AfterNodeSelect.emit(event);\n }\n\n // ========================================\n // Keyboard Navigation Helpers\n // ========================================\n\n /**\n * Focus the search input after the dropdown opens.\n * Deferred to the next macrotask so that:\n * 1. Angular has fully resolved @ViewChild queries for the @if block\n * 2. The browser's click event (on the trigger) has completed and won't steal focus back\n * Falls back to direct DOM querySelector if the ViewChild isn't resolved.\n */\n private focusSearchInput(): void {\n if (!this.EnableSearch) return;\n\n const tryFocus = (retriesLeft: number): void => {\n // Try ViewChild first\n if (this.searchInput?.nativeElement) {\n this.searchInput.nativeElement.focus();\n return;\n }\n // Fallback: query DOM directly (ViewChild may not resolve for @if blocks)\n const panel = this.dropdownPanel?.nativeElement;\n if (panel) {\n const input = panel.querySelector('.tree-dropdown-search__input') as HTMLInputElement;\n if (input) {\n input.focus();\n return;\n }\n }\n // Retry on next frame\n if (retriesLeft > 0) {\n requestAnimationFrame(() => tryFocus(retriesLeft - 1));\n }\n };\n\n // Defer to next macrotask so the click event on the trigger completes first\n // and Angular finishes resolving ViewChild queries for the new @if block\n setTimeout(() => tryFocus(5), 0);\n }\n\n /**\n * Navigate tree focus up/down/first/last while search input retains DOM focus\n */\n private navigateTree(direction: 'up' | 'down' | 'first' | 'last'): void {\n if (!this.treeComponent?.Nodes?.length) return;\n\n const visibleNodes = this.getVisibleNodesInOrder(this.treeComponent.Nodes);\n if (visibleNodes.length === 0) return;\n\n const currentIndex = this.treeComponent.FocusedNode\n ? visibleNodes.indexOf(this.treeComponent.FocusedNode)\n : -1;\n\n let targetNode: TreeNode | null = null;\n\n switch (direction) {\n case 'down':\n targetNode = currentIndex === -1\n ? visibleNodes[0]\n : currentIndex < visibleNodes.length - 1\n ? visibleNodes[currentIndex + 1]\n : null;\n break;\n case 'up':\n targetNode = currentIndex === -1\n ? visibleNodes[visibleNodes.length - 1]\n : currentIndex > 0\n ? visibleNodes[currentIndex - 1]\n : null;\n break;\n case 'first':\n targetNode = visibleNodes[0];\n break;\n case 'last':\n targetNode = visibleNodes[visibleNodes.length - 1];\n break;\n }\n\n if (targetNode) {\n this.treeComponent.FocusedNode = targetNode;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n\n /**\n * Select the currently focused tree node (Enter key)\n */\n private selectFocusedNode(): void {\n const focusedNode = this.treeComponent?.FocusedNode;\n if (!focusedNode) return;\n\n // Check if the node type is selectable per config\n const isSelectable = this.SelectableTypes === 'both'\n || (this.SelectableTypes === 'leaf' && focusedNode.Type === 'leaf')\n || (this.SelectableTypes === 'branch' && focusedNode.Type === 'branch');\n\n if (isSelectable) {\n this.treeComponent.SelectNodes([focusedNode.ID], true);\n } else if (focusedNode.Type === 'branch') {\n // Non-selectable branch: toggle expand/collapse\n this.toggleBranchExpansion(focusedNode);\n }\n }\n\n /**\n * ArrowRight: expand focused branch or descend to first child\n */\n private expandOrDescendFocusedNode(): void {\n const node = this.treeComponent?.FocusedNode;\n if (!node || node.Type !== 'branch') return;\n\n if (!node.Expanded && node.Children?.length) {\n this.treeComponent.ExpandToNode(node.Children[0].ID);\n this.cdr.detectChanges();\n } else if (node.Expanded && node.Children?.length) {\n // Already expanded: move focus to first visible child\n const firstVisible = node.Children.find(c => c.Visible);\n if (firstVisible) {\n this.treeComponent.FocusedNode = firstVisible;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n }\n\n /**\n * ArrowLeft: collapse focused branch or ascend to parent\n */\n private collapseOrAscendFocusedNode(): void {\n const node = this.treeComponent?.FocusedNode;\n if (!node) return;\n\n if (node.Type === 'branch' && node.Expanded) {\n // Collapse the branch\n this.toggleBranchExpansion(node);\n } else if (node.ParentID) {\n // Move to parent\n const allNodes = this.getVisibleNodesInOrder(this.treeComponent.Nodes);\n const parent = allNodes.find(n => UUIDsEqual(n.ID, node.ParentID));\n if (parent) {\n this.treeComponent.FocusedNode = parent;\n this.cdr.detectChanges();\n this.scrollFocusedNodeIntoView();\n }\n }\n }\n\n /**\n * Toggle expand/collapse of a branch node\n */\n private toggleBranchExpansion(node: TreeNode): void {\n if (node.Expanded) {\n node.Expanded = false;\n } else {\n this.treeComponent.ExpandToNode(node.ID);\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Scroll the currently focused tree node into view within the dropdown panel\n */\n private scrollFocusedNodeIntoView(): void {\n requestAnimationFrame(() => {\n const panel = this.dropdownPanel?.nativeElement;\n if (!panel) return;\n const focused = panel.querySelector('.tree-node-focused, .tree-node--focused, [data-focused=\"true\"]');\n if (focused) {\n focused.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n });\n }\n\n // ========================================\n // Private Methods\n // ========================================\n\n /**\n * Create dropdown portal element (attached to body)\n */\n private createDropdownPortal(): void {\n this.dropdownPortal = this.renderer.createElement('div');\n this.renderer.addClass(this.dropdownPortal, 'mj-tree-dropdown-portal');\n this.renderer.setStyle(this.dropdownPortal, 'position', 'fixed');\n this.renderer.setStyle(this.dropdownPortal, 'z-index', '10000');\n this.renderer.setStyle(this.dropdownPortal, 'display', 'none');\n this.renderer.appendChild(document.body, this.dropdownPortal);\n }\n\n /**\n * Remove dropdown portal\n */\n private removeDropdownPortal(): void {\n if (this.dropdownPortal && this.dropdownPortal.parentNode) {\n this.dropdownPortal.parentNode.removeChild(this.dropdownPortal);\n this.dropdownPortal = null;\n }\n }\n\n /**\n * Calculate dropdown position\n */\n private calculatePosition(): void {\n if (!this.triggerElement) {\n return;\n }\n\n const triggerRect = this.triggerElement.nativeElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n // Parse max height from config\n const maxHeightConfig = this.DropdownConfig.MaxHeight || '300px';\n const maxHeightPx = parseInt(maxHeightConfig, 10) || 300;\n\n // Calculate available space\n const spaceBelow = viewportHeight - triggerRect.bottom - 8; // 8px margin\n const spaceAbove = triggerRect.top - 8;\n\n // Determine if we should render above or below\n let renderAbove = false;\n let maxHeight = maxHeightPx;\n\n if (this.DropdownConfig.Position === 'above') {\n renderAbove = true;\n maxHeight = Math.min(maxHeightPx, spaceAbove);\n } else if (this.DropdownConfig.Position === 'below') {\n renderAbove = false;\n maxHeight = Math.min(maxHeightPx, spaceBelow);\n } else {\n // Auto position\n if (spaceBelow < maxHeightPx && spaceAbove > spaceBelow) {\n renderAbove = true;\n maxHeight = Math.min(maxHeightPx, spaceAbove);\n } else {\n renderAbove = false;\n maxHeight = Math.min(maxHeightPx, spaceBelow);\n }\n }\n\n // Calculate width. When no explicit MinWidth is configured, fall back to a\n // readable default (not the trigger width) so the panel doesn't collapse to\n // a narrow column when the trigger is small — node labels need room. The\n // panel never gets narrower than the trigger, and `left` below is computed\n // from this width so a wider panel still avoids overflowing the viewport.\n const minWidth = this.DropdownConfig.MinWidth\n ? parseInt(this.DropdownConfig.MinWidth, 10)\n : TreeDropdownComponent.DEFAULT_PANEL_MIN_WIDTH;\n const width = Math.max(minWidth, triggerRect.width);\n\n // Ensure dropdown doesn't go off screen horizontally\n let left = triggerRect.left;\n if (left + width > viewportWidth - 8) {\n left = viewportWidth - width - 8;\n }\n if (left < 8) {\n left = 8;\n }\n\n // Calculate top position\n let top: number;\n if (renderAbove) {\n top = triggerRect.top - maxHeight - 4;\n } else {\n top = triggerRect.bottom + 4;\n }\n\n this.Position = {\n top,\n left,\n width,\n maxHeight,\n renderAbove\n };\n }\n\n /**\n * Attach event listeners for click outside, scroll, resize\n */\n private attachEventListeners(): void {\n \n // Click outside - defer with a small timeout to:\n // 1. Allow the opening click event to complete\n // 2. Ensure the dropdown panel DOM element is fully rendered\n // 3. Allow Angular change detection to complete\n if (this.DropdownConfig.CloseOnOutsideClick !== false) {\n \n setTimeout(() => {\n \n // Only attach if still open (could have been closed in the meantime)\n if (!this.IsOpen) {\n \n return;\n }\n \n this.clickOutsideListener = this.renderer.listen('document', 'click', (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n \n \n // Double check we're still open\n if (!this.IsOpen) {\n \n return;\n }\n const isInsideTrigger = this.triggerElement?.nativeElement?.contains(target);\n // Check if click is inside the dropdown panel (rendered inline, not in portal)\n const isInsideDropdown = this.dropdownPanel?.nativeElement?.contains(target);\n \n \n\n if (!isInsideTrigger && !isInsideDropdown) {\n \n this.Close('outsideClick');\n } else {\n \n }\n });\n }, 100); // 100ms delay to ensure DOM is stable\n } else {\n \n }\n\n // Escape key\n if (this.DropdownConfig.CloseOnEscape !== false) {\n document.addEventListener('keydown', this.handleEscapeKey);\n }\n\n // Scroll - reposition dropdown\n this.scrollListener = this.renderer.listen('window', 'scroll', () => {\n if (this.IsOpen) {\n this.calculatePosition();\n this.updateDropdownPortalPosition();\n }\n });\n\n // Resize - reposition dropdown\n this.resizeListener = this.renderer.listen('window', 'resize', () => {\n if (this.IsOpen) {\n this.calculatePosition();\n this.updateDropdownPortalPosition();\n }\n });\n }\n\n /**\n * Remove event listeners\n */\n private removeEventListeners(): void {\n if (this.clickOutsideListener) {\n this.clickOutsideListener();\n this.clickOutsideListener = null;\n }\n\n document.removeEventListener('keydown', this.handleEscapeKey);\n\n if (this.scrollListener) {\n this.scrollListener();\n this.scrollListener = null;\n }\n\n if (this.resizeListener) {\n this.resizeListener();\n this.resizeListener = null;\n }\n }\n\n /**\n * Handle escape key\n */\n private handleEscapeKey = (event: KeyboardEvent): void => {\n \n if (event.key === 'Escape' && this.IsOpen) {\n this.Close('escape');\n }\n };\n\n /**\n * Update dropdown portal position\n */\n private updateDropdownPortalPosition(): void {\n if (!this.dropdownPortal || !this.Position) {\n return;\n }\n\n this.renderer.setStyle(this.dropdownPortal, 'top', `${this.Position.top}px`);\n this.renderer.setStyle(this.dropdownPortal, 'left', `${this.Position.left}px`);\n this.renderer.setStyle(this.dropdownPortal, 'width', `${this.Position.width}px`);\n }\n\n /**\n * Perform search on tree\n */\n private performSearch(text: string): void {\n // Fire before event\n const beforeEvent = new BeforeSearchEventArgs(this, text);\n this.BeforeSearch.emit(beforeEvent);\n\n if (beforeEvent.Cancel) {\n return;\n }\n\n const searchText = beforeEvent.ModifiedSearchText ?? text;\n\n // Guard: tree component may not be ready or may have no nodes loaded\n if (!this.treeComponent || !this.IsLoaded) {\n return;\n }\n\n const matchedNodes = this.treeComponent.FilterNodes(\n searchText,\n {\n caseSensitive: this.SearchConfig.CaseSensitive,\n searchBranches: this.SearchConfig.SearchBranches ?? true,\n searchLeaves: this.SearchConfig.SearchLeaves ?? true,\n searchDescription: this.SearchConfig.SearchDescription\n }\n );\n\n // Auto-expand to show matches — guard against empty results\n if (matchedNodes.length > 0 && this.SearchConfig.AutoExpandMatches !== false && searchText.trim()) {\n for (const node of matchedNodes) {\n this.treeComponent.ExpandToNode(node.ID);\n }\n }\n\n // Fire after event\n const afterEvent = new AfterSearchEventArgs(this, searchText, matchedNodes ?? []);\n this.AfterSearch.emit(afterEvent);\n\n this.cdr.detectChanges();\n }\n\n /**\n * Clear search filter\n */\n private clearSearch(): void {\n if (this.treeComponent?.Nodes?.length) {\n this.treeComponent.FilterNodes('', {});\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get all visible nodes in tree order (for keyboard navigation)\n */\n private getVisibleNodesInOrder(nodes: TreeNode[]): TreeNode[] {\n if (!nodes || nodes.length === 0) return [];\n const result: TreeNode[] = [];\n this.collectVisibleNodesRecursive(nodes, result);\n return result;\n }\n\n private collectVisibleNodesRecursive(nodes: TreeNode[], result: TreeNode[]): void {\n if (!nodes) return;\n for (const node of nodes) {\n if (node.Visible) {\n result.push(node);\n if (node.Expanded && node.Type === 'branch' && node.Children?.length) {\n this.collectVisibleNodesRecursive(node.Children, result);\n }\n }\n }\n }\n\n /**\n * Sync value to tree selection\n */\n private syncValueToSelection(): void {\n if (!this.treeComponent || !this.IsLoaded) {\n return;\n }\n\n // Convert CompositeKey(s) to string IDs for tree selection\n const ids = this.getSelectedIDsArray();\n\n // Pass emitChange=false to avoid emitting SelectionChange during sync\n // This prevents unnecessary events and parent component confusion\n this.treeComponent.SelectNodes(ids, false);\n\n // Use try-catch as defensive measure since tree component may not be fully ready\n try {\n this.SelectedNodes = this.treeComponent.GetSelectedNodes() || [];\n } catch {\n this.SelectedNodes = [];\n }\n\n // Clear pending display text since we now have real nodes\n this._pendingDisplayText = null;\n\n this.cdr.detectChanges();\n }\n\n /**\n * Fetch display text for value before tree loads using Metadata.GetEntityRecordName\n */\n private async fetchDisplayTextForValue(val: CompositeKey | CompositeKey[] | null): Promise<void> {\n // Determine which entity to look up: prefer LeafConfig, fall back to BranchConfig\n // (branch-only dropdowns have no LeafConfig)\n const entityName = this.LeafConfig?.EntityName ?? this.BranchConfig?.EntityName;\n if (!val || !entityName) {\n this._pendingDisplayText = null;\n this.cdr.detectChanges();\n return;\n }\n\n try {\n const md = this.ProviderToUse;\n\n if (Array.isArray(val)) {\n // Multiple selection\n if (val.length === 0) {\n this._pendingDisplayText = null;\n } else if (val.length === 1) {\n this._pendingDisplayText = await md.GetEntityRecordName(entityName, val[0]);\n } else {\n this._pendingDisplayText = `${val.length} items selected`;\n }\n } else {\n // Single selection\n this._pendingDisplayText = await md.GetEntityRecordName(entityName, val);\n }\n } catch (error) {\n console.warn('[TreeDropdown] Failed to fetch display text:', error);\n this._pendingDisplayText = null;\n }\n\n this.cdr.detectChanges();\n }\n\n // ========================================\n // Template Helpers\n // ========================================\n\n /**\n * Get display text for selected value(s)\n */\n public getDisplayText(): string {\n // If we have selected nodes from the tree, use those\n if (this.SelectedNodes.length > 0) {\n if (this.SelectionMode === 'single') {\n return this.SelectedNodes[0].Label;\n }\n\n // Multiple selection\n if (this.SelectedNodes.length === 1) {\n return this.SelectedNodes[0].Label;\n }\n\n return `${this.SelectedNodes.length} items selected`;\n }\n\n // If tree not loaded but we have pending display text from Metadata lookup\n if (this._pendingDisplayText) {\n return this._pendingDisplayText;\n }\n\n return '';\n }\n\n /**\n * Get display icon for single selection\n */\n public getDisplayIcon(): string | null {\n if (!this.ShowIconInDisplay || this.SelectedNodes.length !== 1) {\n return null;\n }\n return this.SelectedNodes[0].Icon;\n }\n\n /**\n * Get display color for single selection\n */\n public getDisplayColor(): string | null {\n if (this.SelectedNodes.length !== 1) {\n return null;\n }\n return this.SelectedNodes[0].Color || null;\n }\n\n /**\n * Check if has selection\n */\n public hasSelection(): boolean {\n return this.SelectedNodes.length > 0 || this._pendingDisplayText != null;\n }\n\n /**\n * Get dropdown panel styles\n */\n public getDropdownStyles(): Record<string, string> {\n if (!this.Position) {\n return {};\n }\n\n return {\n top: `${this.Position.top}px`,\n left: `${this.Position.left}px`,\n width: `${this.Position.width}px`,\n maxHeight: `${this.Position.maxHeight}px`\n };\n }\n\n /**\n * Get trigger classes\n */\n public getTriggerClasses(): Record<string, boolean> {\n return {\n 'tree-dropdown-trigger': true,\n 'tree-dropdown-trigger--open': this.IsOpen,\n 'tree-dropdown-trigger--disabled': this.Disabled,\n 'tree-dropdown-trigger--has-value': this.hasSelection(),\n 'tree-dropdown-trigger--loading': this.IsLoading && this.ShowLoadingInTrigger\n };\n }\n\n /**\n * Get selected IDs as a string array for passing to tree component.\n * Extracts the first key value from each CompositeKey (typically the ID field).\n */\n public getSelectedIDsArray(): string[] {\n if (!this._value) {\n return [];\n }\n\n const keys = Array.isArray(this._value) ? this._value : [this._value];\n return keys.map(key => {\n // Get the first value from the composite key (usually the ID)\n const firstValue = key.GetValueByIndex(0);\n return firstValue != null ? String(firstValue) : '';\n }).filter(id => id !== '');\n }\n}\n","<!-- Tree Dropdown Component Template -->\n<div class=\"tree-dropdown\" [class.tree-dropdown--disabled]=\"Disabled\">\n\n <!-- Trigger Button -->\n <div\n #triggerElement\n [ngClass]=\"getTriggerClasses()\"\n [class]=\"StyleConfig.SearchInputClass || ''\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"IsOpen\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-disabled]=\"Disabled\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeyDown($event)\">\n\n <!-- Selected Value Display -->\n <div class=\"tree-dropdown-trigger__content\">\n <!-- Icon -->\n @if (getDisplayIcon()) {\n <span\n class=\"tree-dropdown-trigger__icon\"\n [style.color]=\"getDisplayColor()\">\n <i [class]=\"getDisplayIcon()\"></i>\n </span>\n }\n\n <!-- Text -->\n <span\n class=\"tree-dropdown-trigger__text\"\n [class.tree-dropdown-trigger__text--placeholder]=\"!hasSelection()\">\n {{ hasSelection() ? getDisplayText() : Placeholder }}\n </span>\n\n <!-- Loading Spinner -->\n @if (IsLoading && ShowLoadingInTrigger) {\n <span class=\"tree-dropdown-trigger__loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n </span>\n }\n </div>\n\n <!-- Actions -->\n <div class=\"tree-dropdown-trigger__actions\">\n <!-- Clear Button -->\n @if (Clearable && hasSelection() && !Disabled) {\n <button\n type=\"button\"\n class=\"tree-dropdown-trigger__clear\"\n (click)=\"Clear($event)\"\n title=\"Clear selection\"\n tabindex=\"-1\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"tree-dropdown-trigger__chevron\">\n <i\n class=\"fa-solid\"\n [ngClass]=\"IsOpen ? 'fa-chevron-up' : 'fa-chevron-down'\">\n </i>\n </span>\n </div>\n </div>\n\n <!-- Dropdown Panel (rendered in place, will be moved to portal when open) -->\n @if (IsOpen) {\n <div\n #dropdownPanel\n class=\"tree-dropdown-panel\"\n [class.tree-dropdown-panel--open]=\"IsOpen\"\n [class.tree-dropdown-panel--above]=\"Position?.renderAbove\"\n [class.tree-dropdown-panel--below]=\"!Position?.renderAbove\"\n [class]=\"StyleConfig.DropdownClass || ''\"\n [ngStyle]=\"IsOpen ? getDropdownStyles() : {}\"\n role=\"tree\">\n <!-- Search Input -->\n @if (EnableSearch) {\n <div class=\"tree-dropdown-search\">\n <div class=\"tree-dropdown-search__input-wrapper\">\n <i class=\"fa-solid fa-search tree-dropdown-search__icon\"></i>\n <input\n #searchInput\n type=\"text\"\n class=\"tree-dropdown-search__input\"\n [placeholder]=\"SearchConfig.Placeholder || 'Type to search...'\"\n [value]=\"SearchText\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeyDown($event)\"\n autocomplete=\"off\"\n spellcheck=\"false\">\n @if (SearchText) {\n <button\n type=\"button\"\n class=\"tree-dropdown-search__clear\"\n (click)=\"onClearSearch()\"\n tabindex=\"-1\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n </div>\n }\n <!-- Tree -->\n <div class=\"tree-dropdown-tree\">\n <mj-tree\n #treeComponent\n [BranchConfig]=\"BranchConfig\"\n [LeafConfig]=\"LeafConfig\"\n [SelectionMode]=\"SelectionMode\"\n [SelectableTypes]=\"SelectableTypes\"\n [DefaultExpansion]=\"DefaultExpansion\"\n [SelectedIDs]=\"getSelectedIDsArray()\"\n [AutoLoad]=\"AutoLoad\"\n [ShowIcons]=\"true\"\n [ShowExpandCollapseAll]=\"false\"\n [AnimateExpandCollapse]=\"true\"\n [EmptyMessage]=\"SearchText ? 'No matches found' : 'No items available'\"\n [EmptyIcon]=\"SearchText ? 'fa-solid fa-search' : 'fa-solid fa-folder-open'\"\n (SelectionChange)=\"onTreeSelectionChange($event)\"\n (BeforeNodeSelect)=\"onTreeBeforeNodeSelect($event)\"\n (AfterNodeSelect)=\"onTreeAfterNodeSelect($event)\"\n (BeforeDataLoad)=\"onTreeBeforeDataLoad($event)\"\n (AfterDataLoad)=\"onTreeAfterDataLoad($event)\">\n </mj-tree>\n </div>\n </div>\n }\n</div>\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-trees",
|
|
3
|
-
"version": "6.1.0-edge.
|
|
3
|
+
"version": "6.1.0-edge.6",
|
|
4
4
|
"description": "MemberJunction: Angular tree and tree dropdown components for hierarchical entity selection",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -17,22 +17,22 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "BUSL-1.1",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@angular/compiler": "21.
|
|
21
|
-
"@angular/compiler-cli": "21.
|
|
22
|
-
"@memberjunction/ng-test-utils": "6.1.0-edge.
|
|
20
|
+
"@angular/compiler": "21.2.22",
|
|
21
|
+
"@angular/compiler-cli": "21.2.22",
|
|
22
|
+
"@memberjunction/ng-test-utils": "6.1.0-edge.6",
|
|
23
23
|
"vitest": "^4.0.18"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@angular/common": "^21.
|
|
27
|
-
"@angular/core": "^21.
|
|
28
|
-
"@angular/forms": "^21.
|
|
26
|
+
"@angular/common": "^21.2.22",
|
|
27
|
+
"@angular/core": "^21.2.22",
|
|
28
|
+
"@angular/forms": "^21.2.22"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@memberjunction/ng-ui-components": "6.1.0-edge.
|
|
32
|
-
"@memberjunction/core": "6.1.0-edge.
|
|
33
|
-
"@memberjunction/ng-base-types": "6.1.0-edge.
|
|
34
|
-
"@memberjunction/core-entities": "6.1.0-edge.
|
|
35
|
-
"@memberjunction/global": "6.1.0-edge.
|
|
31
|
+
"@memberjunction/ng-ui-components": "6.1.0-edge.6",
|
|
32
|
+
"@memberjunction/core": "6.1.0-edge.6",
|
|
33
|
+
"@memberjunction/ng-base-types": "6.1.0-edge.6",
|
|
34
|
+
"@memberjunction/core-entities": "6.1.0-edge.6",
|
|
35
|
+
"@memberjunction/global": "6.1.0-edge.6",
|
|
36
36
|
"tslib": "^2.8.1",
|
|
37
37
|
"rxjs": "^7.8.2"
|
|
38
38
|
},
|