@ship-ui/core 0.22.16 → 0.22.17
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/assets/mcp/components.json +181 -39
- package/bin/src/subset.ts +6 -6
- package/bin/src/utilities.ts +14 -14
- package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs +4 -87
- package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-accordion.mjs +4 -3
- package/fesm2022/ship-ui-core-ship-accordion.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-alert.mjs +1 -4
- package/fesm2022/ship-ui-core-ship-alert.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-blueprint.mjs +8 -10
- package/fesm2022/ship-ui-core-ship-blueprint.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-checkbox.mjs +3 -2
- package/fesm2022/ship-ui-core-ship-checkbox.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-color-picker.mjs +66 -62
- package/fesm2022/ship-ui-core-ship-color-picker.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-datepicker.mjs +8 -12
- package/fesm2022/ship-ui-core-ship-datepicker.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-editor.mjs +0 -42
- package/fesm2022/ship-ui-core-ship-editor.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-form-field.mjs +0 -1
- package/fesm2022/ship-ui-core-ship-form-field.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-kbd.mjs +0 -6
- package/fesm2022/ship-ui-core-ship-kbd.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-list-item-swipe.mjs +241 -0
- package/fesm2022/ship-ui-core-ship-list-item-swipe.mjs.map +1 -0
- package/fesm2022/ship-ui-core-ship-menu.mjs +7 -10
- package/fesm2022/ship-ui-core-ship-menu.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-popover.mjs +1 -20
- package/fesm2022/ship-ui-core-ship-popover.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-radio.mjs +3 -2
- package/fesm2022/ship-ui-core-ship-radio.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-range-slider.mjs +7 -9
- package/fesm2022/ship-ui-core-ship-range-slider.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-select.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-sidenav.mjs +2 -2
- package/fesm2022/ship-ui-core-ship-sidenav.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-sortable.mjs +262 -68
- package/fesm2022/ship-ui-core-ship-sortable.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-spotlight.mjs +0 -11
- package/fesm2022/ship-ui-core-ship-spotlight.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-stepper.mjs +1 -1
- package/fesm2022/ship-ui-core-ship-stepper.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-table.mjs +4 -5
- package/fesm2022/ship-ui-core-ship-table.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-toggle.mjs +3 -2
- package/fesm2022/ship-ui-core-ship-toggle.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-tree.mjs +1 -9
- package/fesm2022/ship-ui-core-ship-tree.mjs.map +1 -1
- package/fesm2022/ship-ui-core.mjs +37 -53
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/package.json +5 -1
- package/types/ship-ui-core-ship-a11y-keybindings.d.ts +0 -55
- package/types/ship-ui-core-ship-accordion.d.ts +7 -7
- package/types/ship-ui-core-ship-blueprint.d.ts +1 -1
- package/types/ship-ui-core-ship-checkbox.d.ts +2 -3
- package/types/ship-ui-core-ship-color-picker.d.ts +1 -25
- package/types/ship-ui-core-ship-datepicker.d.ts +0 -3
- package/types/ship-ui-core-ship-editor.d.ts +10 -10
- package/types/ship-ui-core-ship-list-item-swipe.d.ts +25 -0
- package/types/ship-ui-core-ship-menu.d.ts +1 -2
- package/types/ship-ui-core-ship-radio.d.ts +2 -3
- package/types/ship-ui-core-ship-range-slider.d.ts +6 -6
- package/types/ship-ui-core-ship-sortable.d.ts +31 -9
- package/types/ship-ui-core-ship-toggle.d.ts +2 -3
- package/types/ship-ui-core-ship-tree.d.ts +20 -25
- package/types/ship-ui-core.d.ts +17 -24
|
@@ -39,16 +39,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
39
39
|
}] });
|
|
40
40
|
class ShipTree {
|
|
41
41
|
constructor() {
|
|
42
|
-
/** The flat list of all tree nodes. */
|
|
43
42
|
this.items = model([], /* @ts-ignore */
|
|
44
43
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
45
|
-
/** Optional Writable/Readable WritableSignal manager created by createTreeSortableManager. */
|
|
46
44
|
this.sortableManager = input(null, /* @ts-ignore */
|
|
47
45
|
...(ngDevMode ? [{ debugName: "sortableManager" }] : /* istanbul ignore next */ []));
|
|
48
|
-
/** Currently selected node ID. */
|
|
49
46
|
this.selectedId = model(null, /* @ts-ignore */
|
|
50
47
|
...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
|
|
51
|
-
// Mappings
|
|
52
48
|
this.getId = input((item) => item.id, /* @ts-ignore */
|
|
53
49
|
...(ngDevMode ? [{ debugName: "getId" }] : /* istanbul ignore next */ []));
|
|
54
50
|
this.getName = input((item) => item.name, /* @ts-ignore */
|
|
@@ -63,10 +59,8 @@ class ShipTree {
|
|
|
63
59
|
item.isOpen = open;
|
|
64
60
|
}, /* @ts-ignore */
|
|
65
61
|
...(ngDevMode ? [{ debugName: "setIsOpen" }] : /* istanbul ignore next */ []));
|
|
66
|
-
/** Function returning a custom icon name for a node. */
|
|
67
62
|
this.getIcon = input(() => null, /* @ts-ignore */
|
|
68
63
|
...(ngDevMode ? [{ debugName: "getIcon" }] : /* istanbul ignore next */ []));
|
|
69
|
-
// Read projected icons via lightweight directives
|
|
70
64
|
this.openIconDir = contentChild(ShipTreeOpenIcon, /* @ts-ignore */
|
|
71
65
|
...(ngDevMode ? [{ debugName: "openIconDir" }] : /* istanbul ignore next */ []));
|
|
72
66
|
this.closedIconDir = contentChild(ShipTreeClosedIcon, /* @ts-ignore */
|
|
@@ -79,14 +73,12 @@ class ShipTree {
|
|
|
79
73
|
...(ngDevMode ? [{ debugName: "closedIconName" }] : /* istanbul ignore next */ []));
|
|
80
74
|
this.itemIconName = computed(() => this.itemIconDir()?.el.nativeElement.textContent?.trim() || null, /* @ts-ignore */
|
|
81
75
|
...(ngDevMode ? [{ debugName: "itemIconName" }] : /* istanbul ignore next */ []));
|
|
82
|
-
// Outputs
|
|
83
76
|
this.nodeClick = output();
|
|
84
77
|
this.nodeToggle = output();
|
|
85
78
|
this.nodeTemplate = contentChild('nodeTemplate', /* @ts-ignore */
|
|
86
79
|
...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
|
|
87
80
|
this.dirTemplate = contentChild('dirTemplate', /* @ts-ignore */
|
|
88
81
|
...(ngDevMode ? [{ debugName: "dirTemplate" }] : /* istanbul ignore next */ []));
|
|
89
|
-
/** Filter the full flat array down to only visible nodes (whose parents are all expanded). */
|
|
90
82
|
this.visibleNodes = computed(() => {
|
|
91
83
|
const manager = this.sortableManager();
|
|
92
84
|
if (manager && typeof manager.visibleNodes === 'function') {
|
|
@@ -169,7 +161,7 @@ class ShipTree {
|
|
|
169
161
|
return this.itemIconName() || 'file';
|
|
170
162
|
}
|
|
171
163
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipTree, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: ShipTree, isStandalone: true, selector: "sh-tree", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, sortableManager: { classPropertyName: "sortableManager", publicName: "sortableManager", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, getId: { classPropertyName: "getId", publicName: "getId", isSignal: true, isRequired: false, transformFunction: null }, getName: { classPropertyName: "getName", publicName: "getName", isSignal: true, isRequired: false, transformFunction: null }, getParentId: { classPropertyName: "getParentId", publicName: "getParentId", isSignal: true, isRequired: false, transformFunction: null }, isFolder: { classPropertyName: "isFolder", publicName: "isFolder", isSignal: true, isRequired: false, transformFunction: null }, getIsOpen: { classPropertyName: "getIsOpen", publicName: "getIsOpen", isSignal: true, isRequired: false, transformFunction: null }, setIsOpen: { classPropertyName: "setIsOpen", publicName: "setIsOpen", isSignal: true, isRequired: false, transformFunction: null }, getIcon: { classPropertyName: "getIcon", publicName: "getIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange", selectedId: "selectedIdChange", nodeClick: "nodeClick", nodeToggle: "nodeToggle" }, host: { properties: { "class.sh-tree": "true" } }, queries: [{ propertyName: "openIconDir", first: true, predicate: ShipTreeOpenIcon, descendants: true, isSignal: true }, { propertyName: "closedIconDir", first: true, predicate: ShipTreeClosedIcon, descendants: true, isSignal: true }, { propertyName: "itemIconDir", first: true, predicate: ShipTreeItemIcon, descendants: true, isSignal: true }, { propertyName: "nodeTemplate", first: true, predicate: ["nodeTemplate"], descendants: true, isSignal: true }, { propertyName: "dirTemplate", first: true, predicate: ["dirTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (sortableManager()) {\n <div\n class=\"sh-tree-container\"\n [shSortable]=\"sortableManager()\"\n [treeItems]=\"visibleNodes()\"\n sortingMode=\"tree\"\n role=\"tree\"\n >\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n draggable=\"true\"\n [attr.sortable-dir]=\"isFolder()(node) ? 'true' : null\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n} @else {\n <div class=\"sh-tree-container\" role=\"tree\">\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultTemplate let-node>\n <span class=\"node-name\">{{ getName()(node) }}</span>\n</ng-template>\n", styles: [".sh-sortable{position:relative}.sh-sortable.dragging [draggable],.sh-sortable.dragging .sortable-ghost{cursor:grabbing;transition:transform 40ms linear}.sh-sortable [draggable]{transform:translate(0);transition:none;z-index:2;-webkit-user-select:none;user-select:none}.sh-sortable:not(.sh-sortable-tree) [draggable]{background:var(--base-1)}.sh-sortable:not(.sh-sortable-tree) [draggable]:not(:has([sort-handle])){cursor:grab}.sh-sortable .sortable-ghost{opacity:.5;z-index:10}.sh-sortable.item-dragged-out .sortable-ghost{display:none}.sh-sortable [sort-handle]{cursor:grab}.sh-sortable.sh-sortable-tree [draggable]{transform:none!important;transition:none!important;z-index:auto}.sh-sortable.sh-sortable-tree .sortable-ghost{z-index:0!important}.sh-sortable.sh-sortable-tree .sortable-ghost.drop-before:before,.sh-sortable.sh-sortable-tree .sortable-ghost.drop-after:after{display:none!important}.sh-sortable.sh-sortable-tree .sortable-ghost.drop-inside{outline:none!important;background:inherit!important}.sh-sortable.sh-sortable-tree .drop-inside{background:var(--primary-3)!important;outline:2px solid var(--primary-8)!important;outline-offset:-.125rem;border-radius:var(--shape-1, 4px)}.sh-sortable.sh-sortable-tree .drop-inside .node-icon,.sh-sortable.sh-sortable-tree .drop-inside sh-tree-node .sh-tree-node-left sh-icon{color:var(--primary-8)!important}.sh-sortable.sh-sortable-tree .drop-before{position:relative;z-index:20}.sh-sortable.sh-sortable-tree .drop-before:before{content:\"\";position:absolute;top:-.1875rem;left:calc(var(--tree-padding-left, 12px) + var(--tree-depth, 0) * var(--tree-indent-step, 12px) + .375rem);right:var(--tree-padding-right, 6px);height:.375rem;background-image:radial-gradient(circle at 3px 3px,var(--primary-8) 3px,transparent 3px),linear-gradient(to right,var(--primary-8),var(--primary-8));background-repeat:no-repeat,no-repeat;background-position:left center,6px center;background-size:6px 6px,100% 2px;z-index:10;pointer-events:none}.sh-sortable.sh-sortable-tree .drop-after{position:relative;z-index:20}.sh-sortable.sh-sortable-tree .drop-after:after{content:\"\";position:absolute;bottom:-.1875rem;left:calc(var(--tree-padding-left, 12px) + var(--tree-depth, 0) * var(--tree-indent-step, 12px) + .375rem);right:var(--tree-padding-right, 6px);height:.375rem;background-image:radial-gradient(circle at 3px 3px,var(--primary-8) 3px,transparent 3px),linear-gradient(to right,var(--primary-8),var(--primary-8));background-repeat:no-repeat,no-repeat;background-position:left center,6px center;background-size:6px 6px,100% 2px;z-index:10;pointer-events:none}sh-tree{--tree-bg: var(--base-2);--tree-bc: var(--base-3);--tree-color: var(--base-12);--tree-hover-bg: var(--base-3);--tree-active-bg: var(--base-4);--tree-selected-bg: var(--base-4);--tree-guide-color: var(--base-4);--tree-caret-color: var(--base-9);--tree-caret-hover-color: var(--base-12);--tree-icon-color: var(--base-9);--tree-icon-folder-color: var(--primary-8);--tree-indent-step: .75rem;--tree-padding-left: .75rem;--tree-padding-right: .375rem;display:flex;flex-direction:column;width:100%;background:var(--tree-bg);border:1px solid var(--tree-bc);border-radius:var(--shape-2, .5rem);overflow:hidden;font-family:var(--font-family, sans-serif);box-shadow:var(--box-shadow-10)}sh-tree .sh-tree-container{flex:1;padding:.5rem 0;overflow-y:auto;position:relative}sh-tree .sh-tree-node{display:flex;align-items:center;height:2rem;position:relative;cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--tree-color);font:var(--paragraph-20, 14px sans-serif);gap:.375rem;transition:background .12s ease;padding-left:calc(var(--tree-padding-left) + var(--tree-depth, 0) * var(--tree-indent-step));padding-right:var(--tree-padding-right);background:var(--tree-bg)}sh-tree .sh-tree-node:hover{background:var(--tree-hover-bg)}sh-tree .sh-tree-node.is-selected{background:var(--tree-selected-bg)}sh-tree .sh-tree-node.sortable-ghost{opacity:.4;background:var(--tree-active-bg)}sh-tree .sh-tree-node .indent-guide{position:absolute;top:0;bottom:0;width:1px;border-left:1px solid var(--tree-guide-color);opacity:.5;left:calc(var(--tree-padding-left) + var(--tree-indent-step) / 2 + var(--guide-index, 0) * var(--tree-indent-step))}sh-tree .sh-tree-node .caret-container{display:flex;align-items:center;justify-content:center;width:var(--tree-indent-step);height:1rem;z-index:2}sh-tree .sh-tree-node .caret-container:has(+.node-icon){position:absolute;opacity:0;z-index:3;width:var(--tree-indent-step)}sh-tree .sh-tree-node .caret-container .caret-btn{background:none;border:none;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--tree-caret-color);border-radius:var(--shape-1, 4px);width:100%;height:100%;position:relative;transition:background .15s ease,color .15s ease}sh-tree .sh-tree-node .caret-container .caret-btn:after{content:\"\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1.5rem;height:1.5rem;z-index:1}sh-tree .sh-tree-node .caret-container .caret-btn:hover{color:var(--tree-caret-hover-color)}sh-tree .sh-tree-node .node-icon{color:var(--tree-icon-color);display:inline-flex;align-items:center;justify-content:center;width:var(--tree-indent-step)}sh-tree .sh-tree-node .node-icon.folder{color:var(--tree-icon-folder-color)}sh-tree .sh-tree-node .node-icon:has(~.node-content sh-tree-node sh-icon){display:none}sh-tree .sh-tree-node.is-folder sh-tree-node .sh-tree-node-left sh-icon{color:var(--tree-icon-folder-color)}sh-tree .sh-tree-node:not(.is-folder) sh-tree-node .sh-tree-node-left sh-icon{color:var(--tree-icon-color)}sh-tree .sh-tree-node .node-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;z-index:2;display:flex;align-items:center}sh-tree .sh-tree-node .node-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sh-tree sh-tree-node{display:flex;align-items:center;width:100%;gap:.5rem;justify-content:space-between;min-width:0}sh-tree sh-tree-node .sh-tree-node-left{display:flex;align-items:center;gap:.25rem;padding-left:.25rem;overflow:hidden;min-width:0;flex:1}sh-tree sh-tree-node .sh-tree-node-left sh-icon{display:inline-flex;align-items:center;justify-content:center;width:var(--tree-indent-step)}sh-tree sh-tree-node .sh-tree-node-label{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}sh-tree sh-tree-node .sh-tree-node-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sh-tree sh-tree-node .sh-tree-node-actions,sh-tree sh-tree-node sh-tree-node-actions{display:flex;align-items:center;gap:.5rem}sh-tree sh-tree-node .status-badge{font-size:.625rem;padding:.125rem .375rem;border-radius:var(--shape-1, 4px);text-transform:uppercase;font-weight:600}sh-tree sh-tree-node .status-badge.success{background:var(--success-3, #e6f4ea);color:var(--success-8, #137333)}sh-tree sh-tree-node .status-badge.warning{background:var(--warning-3, #fef7e0);color:var(--warning-8, #b06000)}sh-tree sh-tree-node .status-badge.error{background:var(--error-3, #fce8e6);color:var(--error-8, #c5221f)}sh-tree sh-tree-node .delete-btn{background:none;border:none;padding:.125rem;cursor:pointer;color:var(--base-9);border-radius:var(--shape-1, 4px);display:flex;opacity:0;transition:opacity .15s ease;align-items:center;justify-content:center}sh-tree sh-tree-node .delete-btn:hover{background:var(--base-4);color:var(--error-8, #c5221f)}sh-tree .sh-tree-node:hover .delete-btn{opacity:1}sh-tree .empty-state{padding:2rem;text-align:center;color:var(--tree-caret-color);font:var(--paragraph-20, 14px sans-serif)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }, { kind: "directive", type: ShipSortable, selector: "[shSortable]", inputs: ["shSortable", "sortableGroup", "sortingMode", "treeItems"], outputs: ["treeItemsChange", "sortDrop", "afterDrop", "crossDrop", "treeDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
164
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: ShipTree, isStandalone: true, selector: "sh-tree", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, sortableManager: { classPropertyName: "sortableManager", publicName: "sortableManager", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, getId: { classPropertyName: "getId", publicName: "getId", isSignal: true, isRequired: false, transformFunction: null }, getName: { classPropertyName: "getName", publicName: "getName", isSignal: true, isRequired: false, transformFunction: null }, getParentId: { classPropertyName: "getParentId", publicName: "getParentId", isSignal: true, isRequired: false, transformFunction: null }, isFolder: { classPropertyName: "isFolder", publicName: "isFolder", isSignal: true, isRequired: false, transformFunction: null }, getIsOpen: { classPropertyName: "getIsOpen", publicName: "getIsOpen", isSignal: true, isRequired: false, transformFunction: null }, setIsOpen: { classPropertyName: "setIsOpen", publicName: "setIsOpen", isSignal: true, isRequired: false, transformFunction: null }, getIcon: { classPropertyName: "getIcon", publicName: "getIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { items: "itemsChange", selectedId: "selectedIdChange", nodeClick: "nodeClick", nodeToggle: "nodeToggle" }, host: { properties: { "class.sh-tree": "true" } }, queries: [{ propertyName: "openIconDir", first: true, predicate: ShipTreeOpenIcon, descendants: true, isSignal: true }, { propertyName: "closedIconDir", first: true, predicate: ShipTreeClosedIcon, descendants: true, isSignal: true }, { propertyName: "itemIconDir", first: true, predicate: ShipTreeItemIcon, descendants: true, isSignal: true }, { propertyName: "nodeTemplate", first: true, predicate: ["nodeTemplate"], descendants: true, isSignal: true }, { propertyName: "dirTemplate", first: true, predicate: ["dirTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (sortableManager()) {\n <div\n class=\"sh-tree-container\"\n [shSortable]=\"sortableManager()\"\n [treeItems]=\"visibleNodes()\"\n sortingMode=\"tree\"\n role=\"tree\"\n >\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n draggable=\"true\"\n [attr.sortable-dir]=\"isFolder()(node) ? 'true' : null\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n} @else {\n <div class=\"sh-tree-container\" role=\"tree\">\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultTemplate let-node>\n <span class=\"node-name\">{{ getName()(node) }}</span>\n</ng-template>\n", styles: [".sh-sortable{position:relative}.sh-sortable.dragging [draggable],.sh-sortable.dragging .sortable-ghost{cursor:grabbing;transition:transform 40ms linear}.sh-sortable [draggable]{transform:translate(0);transition:none;z-index:2;-webkit-user-select:none;user-select:none}.sh-sortable:not(.sh-sortable-tree) [draggable]{background:var(--base-1)}.sh-sortable:not(.sh-sortable-tree) [draggable]:not(:has([sort-handle])){cursor:grab}.sh-sortable .sortable-ghost{opacity:.5;z-index:10}.sh-sortable.item-dragged-out .sortable-ghost{display:none}.sh-sortable [sort-handle]{cursor:grab}.sh-sortable.sh-sortable-tree [draggable]{transform:none!important;transition:none!important;z-index:auto}.sh-sortable.sh-sortable-tree .sortable-ghost{z-index:0!important}.sh-sortable.sh-sortable-tree .sortable-ghost.drop-before:before,.sh-sortable.sh-sortable-tree .sortable-ghost.drop-after:after{display:none!important}.sh-sortable.sh-sortable-tree .sortable-ghost.drop-inside{outline:none!important;background:inherit!important}.sh-sortable.sh-sortable-tree .drop-inside{background:var(--primary-3)!important;outline:2px solid var(--primary-8)!important;outline-offset:-.125rem;border-radius:var(--shape-1, 4px)}.sh-sortable.sh-sortable-tree .drop-inside .node-icon,.sh-sortable.sh-sortable-tree .drop-inside sh-tree-node .sh-tree-node-left sh-icon{color:var(--primary-8)!important}.sh-sortable.sh-sortable-tree .drop-before{position:relative;z-index:20}.sh-sortable.sh-sortable-tree .drop-before:before{content:\"\";position:absolute;top:-.1875rem;left:calc(var(--tree-padding-left, 12px) + var(--tree-depth, 0) * var(--tree-indent-step, 12px) + .375rem);right:var(--tree-padding-right, 6px);height:.375rem;background-image:radial-gradient(circle at 3px 3px,var(--primary-8) 3px,transparent 3px),linear-gradient(to right,var(--primary-8),var(--primary-8));background-repeat:no-repeat,no-repeat;background-position:left center,6px center;background-size:6px 6px,100% 2px;z-index:10;pointer-events:none}.sh-sortable.sh-sortable-tree .drop-after{position:relative;z-index:20}.sh-sortable.sh-sortable-tree .drop-after:after{content:\"\";position:absolute;bottom:-.1875rem;left:calc(var(--tree-padding-left, 12px) + var(--tree-depth, 0) * var(--tree-indent-step, 12px) + .375rem);right:var(--tree-padding-right, 6px);height:.375rem;background-image:radial-gradient(circle at 3px 3px,var(--primary-8) 3px,transparent 3px),linear-gradient(to right,var(--primary-8),var(--primary-8));background-repeat:no-repeat,no-repeat;background-position:left center,6px center;background-size:6px 6px,100% 2px;z-index:10;pointer-events:none}sh-tree{--tree-bg: var(--base-2);--tree-bc: var(--base-3);--tree-color: var(--base-12);--tree-hover-bg: var(--base-3);--tree-active-bg: var(--base-4);--tree-selected-bg: var(--base-4);--tree-guide-color: var(--base-4);--tree-caret-color: var(--base-9);--tree-caret-hover-color: var(--base-12);--tree-icon-color: var(--base-9);--tree-icon-folder-color: var(--primary-8);--tree-indent-step: .75rem;--tree-padding-left: .75rem;--tree-padding-right: .375rem;display:flex;flex-direction:column;width:100%;background:var(--tree-bg);border:1px solid var(--tree-bc);border-radius:var(--shape-2, .5rem);overflow:hidden;font-family:var(--font-family, sans-serif);box-shadow:var(--box-shadow-10)}sh-tree .sh-tree-container{flex:1;padding:.5rem 0;overflow-y:auto;position:relative}sh-tree .sh-tree-node{display:flex;align-items:center;height:2rem;position:relative;cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--tree-color);font:var(--paragraph-20, 14px sans-serif);gap:.375rem;transition:background .12s ease;padding-left:calc(var(--tree-padding-left) + var(--tree-depth, 0) * var(--tree-indent-step));padding-right:var(--tree-padding-right);background:var(--tree-bg)}sh-tree .sh-tree-node:hover{background:var(--tree-hover-bg)}sh-tree .sh-tree-node.is-selected{background:var(--tree-selected-bg)}sh-tree .sh-tree-node.sortable-ghost{opacity:.4;background:var(--tree-active-bg)}sh-tree .sh-tree-node .indent-guide{position:absolute;top:0;bottom:0;width:1px;border-left:1px solid var(--tree-guide-color);opacity:.5;left:calc(var(--tree-padding-left) + var(--tree-indent-step) / 2 + var(--guide-index, 0) * var(--tree-indent-step))}sh-tree .sh-tree-node .caret-container{display:flex;align-items:center;justify-content:center;width:var(--tree-indent-step);height:1rem;z-index:2}sh-tree .sh-tree-node .caret-container:has(+.node-icon){position:absolute;opacity:0;z-index:3;width:var(--tree-indent-step)}sh-tree .sh-tree-node .caret-container .caret-btn{background:none;border:none;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--tree-caret-color);border-radius:var(--shape-1, 4px);width:100%;height:100%;position:relative;transition:background .15s ease,color .15s ease}sh-tree .sh-tree-node .caret-container .caret-btn:after{content:\"\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1.5rem;height:1.5rem;z-index:1}sh-tree .sh-tree-node .caret-container .caret-btn:hover{color:var(--tree-caret-hover-color)}sh-tree .sh-tree-node .node-icon{color:var(--tree-icon-color);display:inline-flex;align-items:center;justify-content:center;width:var(--tree-indent-step)}sh-tree .sh-tree-node .node-icon.folder{color:var(--tree-icon-folder-color)}sh-tree .sh-tree-node .node-icon:has(~.node-content sh-tree-node sh-icon){display:none}sh-tree .sh-tree-node.is-folder sh-tree-node .sh-tree-node-left sh-icon{color:var(--tree-icon-folder-color)}sh-tree .sh-tree-node:not(.is-folder) sh-tree-node .sh-tree-node-left sh-icon{color:var(--tree-icon-color)}sh-tree .sh-tree-node .node-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;z-index:2;display:flex;align-items:center}sh-tree .sh-tree-node .node-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sh-tree sh-tree-node{display:flex;align-items:center;width:100%;gap:.5rem;justify-content:space-between;min-width:0}sh-tree sh-tree-node .sh-tree-node-left{display:flex;align-items:center;gap:.25rem;padding-left:.25rem;overflow:hidden;min-width:0;flex:1}sh-tree sh-tree-node .sh-tree-node-left sh-icon{display:inline-flex;align-items:center;justify-content:center;width:var(--tree-indent-step)}sh-tree sh-tree-node .sh-tree-node-label{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}sh-tree sh-tree-node .sh-tree-node-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sh-tree sh-tree-node .sh-tree-node-actions,sh-tree sh-tree-node sh-tree-node-actions{display:flex;align-items:center;gap:.5rem}sh-tree sh-tree-node .status-badge{font-size:.625rem;padding:.125rem .375rem;border-radius:var(--shape-1, 4px);text-transform:uppercase;font-weight:600}sh-tree sh-tree-node .status-badge.success{background:var(--success-3, #e6f4ea);color:var(--success-8, #137333)}sh-tree sh-tree-node .status-badge.warning{background:var(--warning-3, #fef7e0);color:var(--warning-8, #b06000)}sh-tree sh-tree-node .status-badge.error{background:var(--error-3, #fce8e6);color:var(--error-8, #c5221f)}sh-tree sh-tree-node .delete-btn{background:none;border:none;padding:.125rem;cursor:pointer;color:var(--base-9);border-radius:var(--shape-1, 4px);display:flex;opacity:0;transition:opacity .15s ease;align-items:center;justify-content:center}sh-tree sh-tree-node .delete-btn:hover{background:var(--base-4);color:var(--error-8, #c5221f)}sh-tree .sh-tree-node:hover .delete-btn{opacity:1}sh-tree .empty-state{padding:2rem;text-align:center;color:var(--tree-caret-color);font:var(--paragraph-20, 14px sans-serif)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }, { kind: "directive", type: ShipSortable, selector: "[shSortable]", inputs: ["shSortable", "sortableGroup", "sortingMode", "treeItems", "touchEnabled", "touchActivation"], outputs: ["treeItemsChange", "sortDrop", "afterDrop", "crossDrop", "treeDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
173
165
|
}
|
|
174
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipTree, decorators: [{
|
|
175
167
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship-ui-core-ship-tree.mjs","sources":["../../../projects/ship-ui/ship-tree/ship-tree.ts","../../../projects/ship-ui/ship-tree/ship-tree.html","../../../projects/ship-ui/ship-tree/ship-ui-core-ship-tree.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n output,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ShipIcon } from '@ship-ui/core/ship-icon';\nimport { ShipSortable } from '@ship-ui/core/ship-sortable';\n\n@Directive({ selector: 'sh-icon[openIcon]', standalone: true })\nexport class ShipTreeOpenIcon {\n readonly el = inject(ElementRef<HTMLElement>);\n}\n\n@Directive({ selector: 'sh-icon[closedIcon]', standalone: true })\nexport class ShipTreeClosedIcon {\n readonly el = inject(ElementRef<HTMLElement>);\n}\n\n@Directive({ selector: 'sh-icon[itemIcon]', standalone: true })\nexport class ShipTreeItemIcon {\n readonly el = inject(ElementRef<HTMLElement>);\n}\n\n@Component({\n selector: 'sh-tree',\n standalone: true,\n imports: [NgTemplateOutlet, ShipIcon, ShipSortable],\n templateUrl: './ship-tree.html',\n styleUrl: './ship-tree.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.sh-tree]': 'true',\n },\n})\nexport class ShipTree {\n /** The flat list of all tree nodes. */\n readonly items = model<any[]>([]);\n\n /** Optional Writable/Readable WritableSignal manager created by createTreeSortableManager. */\n readonly sortableManager = input<any>(null);\n\n /** Currently selected node ID. */\n readonly selectedId = model<string | null>(null);\n\n // Mappings\n readonly getId = input<(item: any) => string>((item) => item.id);\n readonly getName = input<(item: any) => string>((item) => item.name);\n readonly getParentId = input<(item: any) => string | null>((item) => item.parentId);\n readonly isFolder = input<(item: any) => boolean>((item) => item.type === 'dir');\n readonly getIsOpen = input<(item: any) => boolean>((item) => !!item.isOpen);\n readonly setIsOpen = input<(item: any, isOpen: boolean) => void>((item, open) => {\n item.isOpen = open;\n });\n\n /** Function returning a custom icon name for a node. */\n readonly getIcon = input<(item: any) => string | null>(() => null);\n\n // Read projected icons via lightweight directives\n readonly openIconDir = contentChild(ShipTreeOpenIcon);\n readonly closedIconDir = contentChild(ShipTreeClosedIcon);\n readonly itemIconDir = contentChild(ShipTreeItemIcon);\n\n openIconName = computed(() => this.openIconDir()?.el.nativeElement.textContent?.trim() || null);\n closedIconName = computed(() => this.closedIconDir()?.el.nativeElement.textContent?.trim() || null);\n itemIconName = computed(() => this.itemIconDir()?.el.nativeElement.textContent?.trim() || null);\n\n // Outputs\n readonly nodeClick = output<any>();\n readonly nodeToggle = output<{ node: any; isOpen: boolean }>();\n\n readonly nodeTemplate = contentChild<TemplateRef<any>>('nodeTemplate');\n readonly dirTemplate = contentChild<TemplateRef<any>>('dirTemplate');\n\n /** Filter the full flat array down to only visible nodes (whose parents are all expanded). */\n visibleNodes = computed(() => {\n const manager = this.sortableManager();\n if (manager && typeof manager.visibleNodes === 'function') {\n return manager.visibleNodes();\n }\n\n const list = this.items();\n const visible: any[] = [];\n\n const isNodeVisible = (node: any): boolean => {\n let currentParentId = this.getParentId()(node);\n while (currentParentId !== null && currentParentId !== undefined) {\n const parent = list.find((n) => this.getId()(n) === currentParentId);\n if (!parent || !this.getIsOpen()(parent)) {\n return false;\n }\n currentParentId = this.getParentId()(parent);\n }\n return true;\n };\n\n for (const node of list) {\n const parentId = this.getParentId()(node);\n if (parentId === null || parentId === undefined || isNodeVisible(node)) {\n visible.push(node);\n }\n }\n return visible;\n });\n\n toggleNode(node: any, event: MouseEvent) {\n event.stopPropagation();\n const open = !this.getIsOpen()(node);\n\n this.items.update((list) =>\n list.map((item) => {\n if (this.getId()(item) === this.getId()(node)) {\n const updated = { ...item };\n this.setIsOpen()(updated, open);\n return updated;\n }\n return item;\n })\n );\n\n this.nodeToggle.emit({ node, isOpen: open });\n }\n\n handleNodeClick(node: any, event: MouseEvent) {\n const target = event.target as HTMLElement;\n const isIconClick = !!target.closest('sh-icon') && !target.closest('.sh-tree-node-actions') && !target.closest('sh-tree-node-actions') && !target.closest('.caret-container');\n\n if (isIconClick && this.isFolder()(node)) {\n this.toggleNode(node, event);\n } else {\n this.selectNode(node);\n }\n }\n\n selectNode(node: any) {\n this.selectedId.set(this.getId()(node));\n this.nodeClick.emit(node);\n }\n\n getDepthArray(depth: number): number[] {\n return Array.from({ length: depth }, (_, i) => i);\n }\n\n getNodeDepth(node: any): number {\n const list = this.items();\n let depth = 0;\n let currentParentId = this.getParentId()(node);\n while (currentParentId !== null && currentParentId !== undefined) {\n const parent = list.find((n) => this.getId()(n) === currentParentId);\n if (!parent) break;\n depth++;\n currentParentId = this.getParentId()(parent);\n }\n return depth;\n }\n\n getNodeIcon(node: any): string | null {\n const customIcon = this.getIcon()(node);\n if (customIcon) return customIcon;\n\n if (this.isFolder()(node)) {\n const open = this.getIsOpen()(node);\n return open ? this.openIconName() : this.closedIconName();\n }\n return this.itemIconName() || 'file';\n }\n}\n\n@Component({\n selector: 'sh-tree-node',\n template: `\n <div class=\"sh-tree-node-left\">\n <ng-content select=\"sh-icon\" />\n <span class=\"sh-tree-node-label\">\n <ng-content />\n </span>\n </div>\n <div class=\"sh-tree-node-actions\">\n <ng-content select=\"[actions], sh-tree-node-actions\" />\n </div>\n `,\n host: {\n '[class.sh-tree-node-layout]': 'true',\n },\n})\nexport class ShipTreeNode {}\n\n@Component({\n selector: 'sh-tree-node-actions',\n template: `\n <ng-content />\n `,\n host: {\n '[class.sh-tree-node-actions]': 'true',\n },\n})\nexport class ShipTreeNodeActions {}\n","@if (sortableManager()) {\n <div\n class=\"sh-tree-container\"\n [shSortable]=\"sortableManager()\"\n [treeItems]=\"visibleNodes()\"\n sortingMode=\"tree\"\n role=\"tree\"\n >\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n draggable=\"true\"\n [attr.sortable-dir]=\"isFolder()(node) ? 'true' : null\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n} @else {\n <div class=\"sh-tree-container\" role=\"tree\">\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultTemplate let-node>\n <span class=\"node-name\">{{ getName()(node) }}</span>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\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C,oBAAA,QAAQ,EAAE;;AAET,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,8BAA8B,EAAE,MAAM;AACvC,qBAAA;AACF,iBAAA;;;AE7MD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ship-ui-core-ship-tree.mjs","sources":["../../../projects/ship-ui/ship-tree/ship-tree.ts","../../../projects/ship-ui/ship-tree/ship-tree.html","../../../projects/ship-ui/ship-tree/ship-ui-core-ship-tree.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n output,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ShipIcon } from '@ship-ui/core/ship-icon';\nimport { ShipSortable } from '@ship-ui/core/ship-sortable';\n\n@Directive({ selector: 'sh-icon[openIcon]', standalone: true })\nexport class ShipTreeOpenIcon {\n el = inject(ElementRef<HTMLElement>);\n}\n\n@Directive({ selector: 'sh-icon[closedIcon]', standalone: true })\nexport class ShipTreeClosedIcon {\n el = inject(ElementRef<HTMLElement>);\n}\n\n@Directive({ selector: 'sh-icon[itemIcon]', standalone: true })\nexport class ShipTreeItemIcon {\n el = inject(ElementRef<HTMLElement>);\n}\n\n@Component({\n selector: 'sh-tree',\n standalone: true,\n imports: [NgTemplateOutlet, ShipIcon, ShipSortable],\n templateUrl: './ship-tree.html',\n styleUrl: './ship-tree.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.sh-tree]': 'true',\n },\n})\nexport class ShipTree {\n \n items = model<any[]>([]);\n\n \n sortableManager = input<any>(null);\n\n \n selectedId = model<string | null>(null);\n\n \n getId = input<(item: any) => string>((item) => item.id);\n getName = input<(item: any) => string>((item) => item.name);\n getParentId = input<(item: any) => string | null>((item) => item.parentId);\n isFolder = input<(item: any) => boolean>((item) => item.type === 'dir');\n getIsOpen = input<(item: any) => boolean>((item) => !!item.isOpen);\n setIsOpen = input<(item: any, isOpen: boolean) => void>((item, open) => {\n item.isOpen = open;\n });\n\n \n getIcon = input<(item: any) => string | null>(() => null);\n\n \n openIconDir = contentChild(ShipTreeOpenIcon);\n closedIconDir = contentChild(ShipTreeClosedIcon);\n itemIconDir = contentChild(ShipTreeItemIcon);\n\n openIconName = computed(() => this.openIconDir()?.el.nativeElement.textContent?.trim() || null);\n closedIconName = computed(() => this.closedIconDir()?.el.nativeElement.textContent?.trim() || null);\n itemIconName = computed(() => this.itemIconDir()?.el.nativeElement.textContent?.trim() || null);\n\n \n nodeClick = output<any>();\n nodeToggle = output<{ node: any; isOpen: boolean }>();\n\n nodeTemplate = contentChild<TemplateRef<any>>('nodeTemplate');\n dirTemplate = contentChild<TemplateRef<any>>('dirTemplate');\n\n \n visibleNodes = computed(() => {\n const manager = this.sortableManager();\n if (manager && typeof manager.visibleNodes === 'function') {\n return manager.visibleNodes();\n }\n\n const list = this.items();\n const visible: any[] = [];\n\n const isNodeVisible = (node: any): boolean => {\n let currentParentId = this.getParentId()(node);\n while (currentParentId !== null && currentParentId !== undefined) {\n const parent = list.find((n) => this.getId()(n) === currentParentId);\n if (!parent || !this.getIsOpen()(parent)) {\n return false;\n }\n currentParentId = this.getParentId()(parent);\n }\n return true;\n };\n\n for (const node of list) {\n const parentId = this.getParentId()(node);\n if (parentId === null || parentId === undefined || isNodeVisible(node)) {\n visible.push(node);\n }\n }\n return visible;\n });\n\n toggleNode(node: any, event: MouseEvent) {\n event.stopPropagation();\n const open = !this.getIsOpen()(node);\n\n this.items.update((list) =>\n list.map((item) => {\n if (this.getId()(item) === this.getId()(node)) {\n const updated = { ...item };\n this.setIsOpen()(updated, open);\n return updated;\n }\n return item;\n })\n );\n\n this.nodeToggle.emit({ node, isOpen: open });\n }\n\n handleNodeClick(node: any, event: MouseEvent) {\n const target = event.target as HTMLElement;\n const isIconClick = !!target.closest('sh-icon') && !target.closest('.sh-tree-node-actions') && !target.closest('sh-tree-node-actions') && !target.closest('.caret-container');\n\n if (isIconClick && this.isFolder()(node)) {\n this.toggleNode(node, event);\n } else {\n this.selectNode(node);\n }\n }\n\n selectNode(node: any) {\n this.selectedId.set(this.getId()(node));\n this.nodeClick.emit(node);\n }\n\n getDepthArray(depth: number): number[] {\n return Array.from({ length: depth }, (_, i) => i);\n }\n\n getNodeDepth(node: any): number {\n const list = this.items();\n let depth = 0;\n let currentParentId = this.getParentId()(node);\n while (currentParentId !== null && currentParentId !== undefined) {\n const parent = list.find((n) => this.getId()(n) === currentParentId);\n if (!parent) break;\n depth++;\n currentParentId = this.getParentId()(parent);\n }\n return depth;\n }\n\n getNodeIcon(node: any): string | null {\n const customIcon = this.getIcon()(node);\n if (customIcon) return customIcon;\n\n if (this.isFolder()(node)) {\n const open = this.getIsOpen()(node);\n return open ? this.openIconName() : this.closedIconName();\n }\n return this.itemIconName() || 'file';\n }\n}\n\n@Component({\n selector: 'sh-tree-node',\n template: `\n <div class=\"sh-tree-node-left\">\n <ng-content select=\"sh-icon\" />\n <span class=\"sh-tree-node-label\">\n <ng-content />\n </span>\n </div>\n <div class=\"sh-tree-node-actions\">\n <ng-content select=\"[actions], sh-tree-node-actions\" />\n </div>\n `,\n host: {\n '[class.sh-tree-node-layout]': 'true',\n },\n})\nexport class ShipTreeNode {}\n\n@Component({\n selector: 'sh-tree-node-actions',\n template: `\n <ng-content />\n `,\n host: {\n '[class.sh-tree-node-actions]': 'true',\n },\n})\nexport class ShipTreeNodeActions {}\n","@if (sortableManager()) {\n <div\n class=\"sh-tree-container\"\n [shSortable]=\"sortableManager()\"\n [treeItems]=\"visibleNodes()\"\n sortingMode=\"tree\"\n role=\"tree\"\n >\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n draggable=\"true\"\n [attr.sortable-dir]=\"isFolder()(node) ? 'true' : null\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n} @else {\n <div class=\"sh-tree-container\" role=\"tree\">\n @for (node of visibleNodes(); track getId()(node)) {\n <div\n class=\"sh-tree-node\"\n [class.is-folder]=\"isFolder()(node)\"\n [class.is-expanded]=\"getIsOpen()(node)\"\n [class.is-selected]=\"selectedId() === getId()(node)\"\n [style.--tree-depth]=\"getNodeDepth(node)\"\n (click)=\"handleNodeClick(node, $event)\"\n role=\"treeitem\"\n [attr.aria-expanded]=\"isFolder()(node) ? getIsOpen()(node) : null\"\n >\n <!-- Indent guides -->\n @for (i of getDepthArray(getNodeDepth(node)); track i) {\n <div class=\"indent-guide\" [style.--guide-index]=\"i\"></div>\n }\n\n <!-- Folder Caret -->\n @if (isFolder()(node) && !dirTemplate()) {\n <span class=\"caret-container\">\n <button class=\"caret-btn\" (click)=\"toggleNode(node, $event)\" type=\"button\">\n @if (getIsOpen()(node)) {\n <sh-icon size=\"small\">caret-down</sh-icon>\n } @else {\n <sh-icon size=\"small\">caret-right</sh-icon>\n }\n </button>\n </span>\n }\n\n <!-- Node Icon -->\n @if (getNodeIcon(node)) {\n @if (getNodeIcon(node) === 'file') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">file</sh-icon>\n } @else if (getNodeIcon(node) === 'folder') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder</sh-icon>\n } @else if (getNodeIcon(node) === 'folder-open') {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">folder-open</sh-icon>\n } @else {\n <sh-icon class=\"node-icon\" [class.folder]=\"isFolder()(node)\" size=\"small\">\n {{ getNodeIcon(node) }}\n </sh-icon>\n }\n }\n\n <!-- Node Content -->\n <div class=\"node-content\">\n <ng-container *ngTemplateOutlet=\"isFolder()(node) && dirTemplate() ? dirTemplate() : (nodeTemplate() || defaultTemplate); context: { $implicit: node }\"></ng-container>\n </div>\n </div>\n } @empty {\n <div class=\"empty-state\">\n <ng-content select=\"[emptyState]\">\n No items in tree\n </ng-content>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultTemplate let-node>\n <span class=\"node-name\">{{ getName()(node) }}</span>\n</ng-template>\n","/**\n * Generated bundle index.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;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE;;AAET,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,8BAA8B,EAAE,MAAM;AACvC,qBAAA;AACF,iBAAA;;;AE7MD;;AAEG;;;;"}
|
|
@@ -188,15 +188,15 @@ class ShipTooltipWrapper {
|
|
|
188
188
|
if (!this.SUPPORTS_ANCHOR) {
|
|
189
189
|
setTimeout(() => {
|
|
190
190
|
const scrollableParent = this.#findScrollableParent(tooltipEl);
|
|
191
|
-
scrollableParent.addEventListener('scroll', () => this
|
|
191
|
+
scrollableParent.addEventListener('scroll', () => this.#calculateTooltipPosition(), {
|
|
192
192
|
signal: this.#positionAbort?.signal,
|
|
193
193
|
passive: true,
|
|
194
194
|
});
|
|
195
|
-
window?.addEventListener('resize', () => this
|
|
195
|
+
window?.addEventListener('resize', () => this.#calculateTooltipPosition(), {
|
|
196
196
|
signal: this.#positionAbort?.signal,
|
|
197
197
|
passive: true,
|
|
198
198
|
});
|
|
199
|
-
this
|
|
199
|
+
this.#calculateTooltipPosition();
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
});
|
|
@@ -210,7 +210,6 @@ class ShipTooltipWrapper {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
catch (e) {
|
|
213
|
-
// Ignore if already hidden or other errors
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
this.#positionAbort?.abort();
|
|
@@ -218,7 +217,7 @@ class ShipTooltipWrapper {
|
|
|
218
217
|
}
|
|
219
218
|
}, /* @ts-ignore */
|
|
220
219
|
...(ngDevMode ? [{ debugName: "openEffect" }] : /* istanbul ignore next */ []));
|
|
221
|
-
this
|
|
220
|
+
this.#calculateTooltipPosition = () => {
|
|
222
221
|
if (!this.anchorEl())
|
|
223
222
|
return;
|
|
224
223
|
const hostRect = this.anchorEl().nativeElement.getBoundingClientRect();
|
|
@@ -227,7 +226,6 @@ class ShipTooltipWrapper {
|
|
|
227
226
|
if (tooltipRect.width === 0 && tooltipRect.height === 0)
|
|
228
227
|
return;
|
|
229
228
|
const BASE_SPACE = 8;
|
|
230
|
-
// Position generators
|
|
231
229
|
const topCenter = (t, m) => ({
|
|
232
230
|
left: t.left + t.width / 2 - m.width / 2,
|
|
233
231
|
top: t.top - m.height - BASE_SPACE,
|
|
@@ -274,6 +272,7 @@ class ShipTooltipWrapper {
|
|
|
274
272
|
}
|
|
275
273
|
return this.#document.documentElement;
|
|
276
274
|
}
|
|
275
|
+
#calculateTooltipPosition;
|
|
277
276
|
#applyPosition(pos, element) {
|
|
278
277
|
this.#renderer.setStyle(element, 'left', `${pos.left}px`);
|
|
279
278
|
this.#renderer.setStyle(element, 'top', `${pos.top}px`);
|
|
@@ -338,8 +337,8 @@ class ShipTooltip {
|
|
|
338
337
|
this.#elementRef = inject((ElementRef));
|
|
339
338
|
this.#viewContainerRef = inject(ViewContainerRef);
|
|
340
339
|
this.#environmentInjector = inject(EnvironmentInjector);
|
|
341
|
-
this
|
|
342
|
-
this
|
|
340
|
+
this.#debounceTimer = null;
|
|
341
|
+
this.#DEBOUNCE_DELAY = 50;
|
|
343
342
|
this.anchorName = `--${generateUniqueId()}`;
|
|
344
343
|
this.isOpen = signal(false, /* @ts-ignore */
|
|
345
344
|
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -349,42 +348,44 @@ class ShipTooltip {
|
|
|
349
348
|
#elementRef;
|
|
350
349
|
#viewContainerRef;
|
|
351
350
|
#environmentInjector;
|
|
351
|
+
#debounceTimer;
|
|
352
|
+
#DEBOUNCE_DELAY;
|
|
352
353
|
onMouseEnter(event) {
|
|
353
354
|
event.stopPropagation();
|
|
354
355
|
if (openRef?.component.anchorName !== this.anchorName) {
|
|
355
|
-
this
|
|
356
|
+
this.#cleanupTooltip();
|
|
356
357
|
}
|
|
357
358
|
else {
|
|
358
|
-
this
|
|
359
|
+
this.#cancelCleanupTimer();
|
|
359
360
|
}
|
|
360
|
-
this
|
|
361
|
+
this.#showTooltip();
|
|
361
362
|
// queueMicrotask(() => );
|
|
362
363
|
}
|
|
363
364
|
onMouseLeave(event) {
|
|
364
365
|
event.stopPropagation();
|
|
365
|
-
this
|
|
366
|
+
this.#startCleanupTimer();
|
|
366
367
|
}
|
|
367
368
|
ngOnDestroy() {
|
|
368
|
-
this
|
|
369
|
-
this
|
|
369
|
+
this.#cancelCleanupTimer();
|
|
370
|
+
this.#cleanupTooltip();
|
|
370
371
|
}
|
|
371
|
-
startCleanupTimer() {
|
|
372
|
-
this
|
|
373
|
-
this
|
|
374
|
-
this
|
|
375
|
-
}, this
|
|
372
|
+
#startCleanupTimer() {
|
|
373
|
+
this.#cancelCleanupTimer();
|
|
374
|
+
this.#debounceTimer = setTimeout(() => {
|
|
375
|
+
this.#cleanupTooltip();
|
|
376
|
+
}, this.#DEBOUNCE_DELAY);
|
|
376
377
|
}
|
|
377
|
-
cancelCleanupTimer() {
|
|
378
|
-
if (this
|
|
379
|
-
clearTimeout(this
|
|
380
|
-
this
|
|
378
|
+
#cancelCleanupTimer() {
|
|
379
|
+
if (this.#debounceTimer) {
|
|
380
|
+
clearTimeout(this.#debounceTimer);
|
|
381
|
+
this.#debounceTimer = null;
|
|
381
382
|
}
|
|
382
383
|
if (this.destroyTimeout) {
|
|
383
384
|
clearTimeout(this.destroyTimeout);
|
|
384
385
|
this.destroyTimeout = null;
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
|
-
showTooltip() {
|
|
388
|
+
#showTooltip() {
|
|
388
389
|
if (openRef?.wrapperComponentRef || !this.shTooltip()) {
|
|
389
390
|
if (openRef?.component === this && openRef?.wrapperComponentRef) {
|
|
390
391
|
openRef.wrapperComponentRef.setInput('content', this.shTooltip());
|
|
@@ -401,23 +402,23 @@ class ShipTooltip {
|
|
|
401
402
|
openRef.wrapperComponentRef.setInput('anchorEl', this.#elementRef);
|
|
402
403
|
openRef.wrapperComponentRef.setInput('isOpen', this.isOpen);
|
|
403
404
|
openRef.wrapperComponentRef.setInput('content', this.shTooltip());
|
|
404
|
-
openRef.wrapperComponentRef.setInput('close', () => this
|
|
405
|
+
openRef.wrapperComponentRef.setInput('close', () => this.#cleanupTooltip());
|
|
405
406
|
openRef.wrapperComponentRef.changeDetectorRef.detectChanges();
|
|
406
407
|
openRef.wrapperComponentRef.location.nativeElement.addEventListener('mouseenter', (event) => {
|
|
407
408
|
event.stopPropagation();
|
|
408
|
-
this
|
|
409
|
+
this.#cancelCleanupTimer();
|
|
409
410
|
});
|
|
410
411
|
openRef.wrapperComponentRef.location.nativeElement.addEventListener('mouseleave', (event) => {
|
|
411
412
|
event.stopPropagation();
|
|
412
|
-
this
|
|
413
|
+
this.#startCleanupTimer();
|
|
413
414
|
});
|
|
414
415
|
setTimeout(() => {
|
|
415
416
|
this.isOpen.set(true);
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
|
-
cleanupTooltip() {
|
|
419
|
+
#cleanupTooltip() {
|
|
419
420
|
if (openRef?.wrapperComponentRef) {
|
|
420
|
-
openRef.component
|
|
421
|
+
openRef.component.#cancelCleanupTimer();
|
|
421
422
|
openRef.component.isOpen.set(false);
|
|
422
423
|
openRef.wrapperComponentRef.location.nativeElement.hidePopover();
|
|
423
424
|
this.destroyTimeout = setTimeout(() => {
|
|
@@ -425,7 +426,7 @@ class ShipTooltip {
|
|
|
425
426
|
openRef?.wrapperComponentRef.destroy();
|
|
426
427
|
openRef = null;
|
|
427
428
|
});
|
|
428
|
-
}, this
|
|
429
|
+
}, this.#DEBOUNCE_DELAY);
|
|
429
430
|
}
|
|
430
431
|
}
|
|
431
432
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -899,11 +900,11 @@ function createInputSignal(input, options) {
|
|
|
899
900
|
Object.defineProperty(input, 'value', {
|
|
900
901
|
configurable: true,
|
|
901
902
|
get() {
|
|
902
|
-
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), 'value');
|
|
903
|
+
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), 'value');
|
|
903
904
|
return descriptor.get.call(this);
|
|
904
905
|
},
|
|
905
906
|
set(newVal) {
|
|
906
|
-
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), 'value');
|
|
907
|
+
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), 'value');
|
|
907
908
|
descriptor.set.call(this, newVal);
|
|
908
909
|
const inputEvent = new CustomEvent('inputValueChanged', {
|
|
909
910
|
bubbles: true,
|
|
@@ -951,43 +952,32 @@ function shipComponentClasses(componentName, inputs) {
|
|
|
951
952
|
const config = inject(SHIP_CONFIG, { optional: true });
|
|
952
953
|
return computed(() => {
|
|
953
954
|
const componentConfig = config?.[componentName];
|
|
954
|
-
// Resolve variant (Input > Component Config > Global Legacy Mappings > empty)
|
|
955
955
|
let variant = inputs.variant?.();
|
|
956
956
|
if (!variant) {
|
|
957
957
|
variant = componentConfig?.variant;
|
|
958
958
|
}
|
|
959
|
-
// Legacy mapping for alert
|
|
960
959
|
if (!variant && componentName === 'alert' && config?.alertVariant) {
|
|
961
960
|
variant = config.alertVariant;
|
|
962
961
|
}
|
|
963
|
-
// Legacy mapping for card
|
|
964
962
|
if (!variant && componentName === 'card' && config?.cardType) {
|
|
965
963
|
variant = config.cardType;
|
|
966
964
|
}
|
|
967
|
-
// Legacy mapping for table
|
|
968
965
|
if (!variant && componentName === 'table' && config?.tableType) {
|
|
969
966
|
variant = config.tableType;
|
|
970
967
|
}
|
|
971
|
-
// Resolve color (Input > Component Config > empty)
|
|
972
968
|
const color = inputs.color?.() || componentConfig?.color;
|
|
973
969
|
if (!variant) {
|
|
974
970
|
variant = 'base';
|
|
975
971
|
}
|
|
976
|
-
// Resolve size (Input > Component Config > empty)
|
|
977
972
|
const size = inputs.size?.() || componentConfig?.size;
|
|
978
|
-
// Resolve sharp (Input > Component Config > false)
|
|
979
973
|
const sharp = (inputs.sharp?.() ?? componentConfig?.sharp) || false;
|
|
980
|
-
// Resolve dynamic (Input > Component Config > false)
|
|
981
974
|
const dynamic = (inputs.dynamic?.() ?? componentConfig?.dynamic) || false;
|
|
982
|
-
// Resolve readonly (Input > Component Config > false)
|
|
983
975
|
const readonly = (inputs.readonly?.() ?? componentConfig?.readonly) || false;
|
|
984
|
-
// Resolve alwaysShow (Input > Component Config > false)
|
|
985
976
|
const alwaysShow = (inputs.alwaysShow?.() ?? componentConfig?.alwaysShow) || false;
|
|
986
977
|
const classList = [];
|
|
987
978
|
if (color)
|
|
988
979
|
classList.push(color);
|
|
989
980
|
if (variant) {
|
|
990
|
-
// Handle type-a, type-b etc. If it doesn't already have the prefix but it's meant to be one of those
|
|
991
981
|
if (['a', 'b', 'c', 'd'].includes(variant)) {
|
|
992
982
|
classList.push(`type-${variant}`);
|
|
993
983
|
}
|
|
@@ -1012,15 +1002,15 @@ function shipComponentClasses(componentName, inputs) {
|
|
|
1012
1002
|
class ShipSelectionGroup {
|
|
1013
1003
|
#keybindings;
|
|
1014
1004
|
constructor(itemSelector, activeClass, options) {
|
|
1015
|
-
this.itemSelector = itemSelector;
|
|
1016
|
-
this.activeClass = activeClass;
|
|
1017
|
-
this.options = options;
|
|
1018
1005
|
this.hostElement = inject((ElementRef)).nativeElement;
|
|
1019
1006
|
this.#keybindings = inject(ShipA11yKeybindingsService);
|
|
1020
1007
|
this.value = model(null, /* @ts-ignore */
|
|
1021
1008
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1022
1009
|
this.closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1023
1010
|
this.manualActivation = input(false, { ...(ngDevMode ? { debugName: "manualActivation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1011
|
+
this.itemSelector = itemSelector;
|
|
1012
|
+
this.activeClass = activeClass;
|
|
1013
|
+
this.options = options;
|
|
1024
1014
|
if (this.options?.hostRole) {
|
|
1025
1015
|
this.hostElement.setAttribute('role', this.options.hostRole);
|
|
1026
1016
|
}
|
|
@@ -1103,7 +1093,6 @@ class ShipSelectionGroup {
|
|
|
1103
1093
|
if (this.#keybindings.matches(event, 'selection-group.select')) {
|
|
1104
1094
|
const item = targetEl?.closest?.(this.itemSelector);
|
|
1105
1095
|
if (item && this.hostElement.contains(item) && item.hasAttribute('value')) {
|
|
1106
|
-
// Only prevent default for space to avoid scrolling, let enter naturally click if it's a link/button
|
|
1107
1096
|
const isSpace = event.key === ' ' || event.key === 'Spacebar';
|
|
1108
1097
|
if (isSpace)
|
|
1109
1098
|
event.preventDefault();
|
|
@@ -1134,7 +1123,7 @@ class ShipSelectionGroup {
|
|
|
1134
1123
|
nextIndex = activeIndex <= 0 ? items.length - 1 : activeIndex - 1;
|
|
1135
1124
|
}
|
|
1136
1125
|
else {
|
|
1137
|
-
return;
|
|
1126
|
+
return;
|
|
1138
1127
|
}
|
|
1139
1128
|
event.preventDefault();
|
|
1140
1129
|
const nextItem = items[nextIndex];
|
|
@@ -1171,11 +1160,6 @@ const __SHIP_BUTTON_GROUP_VARIANTS = [''];
|
|
|
1171
1160
|
const __SHIP_FORM_FIELD_VARIANTS = ['base', 'horizontal', 'auto-width', 'autosize', ''];
|
|
1172
1161
|
const __SHIP_RANGE_SLIDER_VARIANTS = ['simple', 'base', 'thick', 'outlined', 'flat', 'raised', ''];
|
|
1173
1162
|
|
|
1174
|
-
/*
|
|
1175
|
-
* Public API Surface of ship-ui (Core utilities, directives, and configs)
|
|
1176
|
-
*/
|
|
1177
|
-
// Global directives
|
|
1178
|
-
|
|
1179
1163
|
/**
|
|
1180
1164
|
* Generated bundle index. Do not edit.
|
|
1181
1165
|
*/
|