@threadlabs/looma 0.1.23 → 0.1.25
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/chunk-HNFCGIBP.js +8 -0
- package/dist/chunk-NB6DBRXQ.js +323 -0
- package/dist/{chunk-GDMQKT5F.js → chunk-UY423IKN.js} +33 -30
- package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
- package/dist/cjs/icons-BAdjrnhS.js +680 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
- package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ui-badge.cjs.entry.js +2 -2
- package/dist/cjs/ui-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-callout.cjs.entry.js +27 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
- package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
- package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
- package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
- package/dist/cjs/ui-editable.cjs.entry.js +100 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
- package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-input.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-menu.cjs.entry.js +14 -9
- package/dist/cjs/ui-multi-combobox.cjs.entry.js +158 -0
- package/dist/cjs/ui-popover.cjs.entry.js +10 -7
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio.cjs.entry.js +16 -7
- package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-select.cjs.entry.js +1 -1
- package/dist/cjs/ui-switch.cjs.entry.js +19 -10
- package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
- package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
- package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
- package/dist/cjs/ui-tree.cjs.entry.js +123 -11
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
- package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
- package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
- package/dist/collection/components/ui-badge/ui-badge.css +64 -48
- package/dist/collection/components/ui-badge/ui-badge.js +1 -1
- package/dist/collection/components/ui-button/ui-button.js +1 -1
- package/dist/collection/components/ui-callout/ui-callout.css +74 -0
- package/dist/collection/components/ui-callout/ui-callout.js +59 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
- package/dist/collection/components/ui-chip/ui-chip.css +47 -0
- package/dist/collection/components/ui-chip/ui-chip.js +67 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
- package/dist/collection/components/ui-editable/ui-editable.css +2 -0
- package/dist/collection/components/ui-editable/ui-editable.js +196 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.js +1 -1
- package/dist/collection/components/ui-menu/ui-menu.css +12 -23
- package/dist/collection/components/ui-menu/ui-menu.js +16 -12
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +29 -0
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +503 -0
- package/dist/collection/components/ui-popover/ui-popover.css +14 -5
- package/dist/collection/components/ui-popover/ui-popover.js +12 -10
- package/dist/collection/components/ui-radio/ui-radio.js +24 -11
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
- package/dist/collection/components/ui-select/ui-select.js +1 -1
- package/dist/collection/components/ui-switch/ui-switch.js +22 -14
- package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
- package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +14 -11
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.css +2 -1
- package/dist/collection/components/ui-tree/ui-tree.js +122 -10
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
- package/dist/collection/field/editable.js +1 -0
- package/dist/collection/field/multi-combobox.js +1 -0
- package/dist/collection/icons.js +6 -1
- package/dist/collection/utils/controlled-state.js +4 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-B9CzOHvE.js +1 -0
- package/dist/components/p-BMgIcOh-.js +1 -0
- package/dist/components/p-BVteuP_d.js +1 -0
- package/dist/components/p-BnGhGgTH.js +1 -0
- package/dist/components/p-C6p-ygxq.js +1 -0
- package/dist/components/p-CoFximGM.js +13 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-avatar-group.js +1 -1
- package/dist/components/ui-avatar.js +1 -1
- package/dist/components/ui-badge.js +1 -1
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-callout.d.ts +11 -0
- package/dist/components/ui-callout.js +1 -0
- package/dist/components/ui-checkbox.js +1 -1
- package/dist/components/ui-chip.d.ts +11 -0
- package/dist/components/ui-chip.js +1 -0
- package/dist/components/ui-combobox.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-disclosure.js +1 -1
- package/dist/components/ui-editable.d.ts +11 -0
- package/dist/components/ui-editable.js +1 -0
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-form-field.js +1 -1
- package/dist/components/ui-icon-button.js +1 -1
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-menu-item.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-multi-combobox.d.ts +11 -0
- package/dist/components/ui-multi-combobox.js +1 -0
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-radio.js +1 -1
- package/dist/components/ui-search-result-row.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/components/ui-tree-item.js +1 -13
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
- package/dist/esm/icons-CoFximGM.js +678 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-avatar-group.entry.js +9 -17
- package/dist/esm/ui-avatar.entry.js +2 -2
- package/dist/esm/ui-badge.entry.js +2 -2
- package/dist/esm/ui-button.entry.js +1 -1
- package/dist/esm/ui-callout.entry.js +25 -0
- package/dist/esm/ui-checkbox.entry.js +13 -7
- package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
- package/dist/esm/ui-context-menu.entry.js +1 -1
- package/dist/esm/ui-dialog.entry.js +44 -8
- package/dist/esm/ui-disclosure.entry.js +9 -6
- package/dist/esm/ui-editable.entry.js +98 -0
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-form-field.entry.js +59 -4
- package/dist/esm/ui-icon-button.entry.js +1 -1
- package/dist/esm/ui-input.entry.js +1 -1
- package/dist/esm/ui-menu-item.entry.js +2 -2
- package/dist/esm/ui-menu.entry.js +14 -9
- package/dist/esm/ui-multi-combobox.entry.js +156 -0
- package/dist/esm/ui-popover.entry.js +10 -7
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-radio.entry.js +16 -7
- package/dist/esm/ui-search-result-row.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-select.entry.js +1 -1
- package/dist/esm/ui-switch.entry.js +19 -10
- package/dist/esm/ui-tabs.entry.js +10 -9
- package/dist/esm/ui-textarea.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +30 -19
- package/dist/esm/ui-tooltip.entry.js +12 -8
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/esm/ui-tree-item.entry.js +54 -617
- package/dist/esm/ui-tree.entry.js +123 -11
- package/dist/index.cjs +1552 -894
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +12 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-08f80207.entry.js +1 -0
- package/dist/looma/{p-ed368426.entry.js → p-0e1741cb.entry.js} +1 -1
- package/dist/looma/p-0ef4bf13.entry.js +1 -0
- package/dist/looma/{p-7e0bb7f6.entry.js → p-166f8593.entry.js} +1 -1
- package/dist/looma/p-262a542c.entry.js +1 -0
- package/dist/looma/{p-13347631.entry.js → p-26d357ae.entry.js} +1 -1
- package/dist/looma/p-30f01909.entry.js +1 -0
- package/dist/looma/p-393e3e02.entry.js +1 -0
- package/dist/looma/p-3a44b9f9.entry.js +1 -0
- package/dist/looma/p-558d4f5b.entry.js +1 -0
- package/dist/looma/{p-5a87b59d.entry.js → p-5780cefa.entry.js} +1 -1
- package/dist/looma/p-5a7261e1.entry.js +1 -0
- package/dist/looma/p-5fdcee1d.entry.js +1 -0
- package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
- package/dist/looma/p-7319c147.entry.js +1 -0
- package/dist/looma/p-78b7e466.entry.js +1 -0
- package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
- package/dist/looma/p-7eb04f09.entry.js +1 -0
- package/dist/looma/{p-69a5557b.entry.js → p-81c533f5.entry.js} +1 -1
- package/dist/looma/p-87f501cf.entry.js +1 -0
- package/dist/looma/p-89e71bbb.entry.js +1 -0
- package/dist/looma/{p-8b8840b8.entry.js → p-92cd1841.entry.js} +1 -1
- package/dist/looma/{p-f0487ff3.entry.js → p-95eb3b58.entry.js} +1 -1
- package/dist/looma/p-96ec4d7a.entry.js +1 -0
- package/dist/looma/p-9d2662ca.entry.js +1 -0
- package/dist/looma/p-BnGhGgTH.js +1 -0
- package/dist/looma/p-CoFximGM.js +13 -0
- package/dist/looma/p-add67e4c.entry.js +1 -0
- package/dist/looma/p-b6c776fb.entry.js +1 -0
- package/dist/looma/p-bcb1b47b.entry.js +1 -0
- package/dist/looma/p-d56571a2.entry.js +1 -0
- package/dist/looma/{p-582973b5.entry.js → p-d62da01d.entry.js} +1 -1
- package/dist/looma/{p-f74e5546.entry.js → p-dbcb479c.entry.js} +1 -1
- package/dist/looma/p-e14024bf.entry.js +1 -0
- package/dist/looma/{p-5da09f47.entry.js → p-fc180770.entry.js} +1 -1
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
- package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
- package/dist/types/components/ui-chip/ui-chip.d.ts +8 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
- package/dist/types/components/ui-editable/ui-editable.d.ts +24 -0
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
- package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +47 -0
- package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
- package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
- package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +2 -1
- package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
- package/dist/types/components.d.ts +343 -46
- package/dist/types/field/editable.d.ts +5 -0
- package/dist/types/field/multi-combobox.d.ts +11 -0
- package/dist/types/icons.d.ts +5 -0
- package/dist/types/utils/controlled-state.d.ts +4 -0
- package/dist/{ui-affordance-scope.entry-VO4C2MZX.js → ui-affordance-scope.entry-VSSP52ZP.js} +2 -2
- package/dist/ui-avatar-group.entry-JMCLL6FW.js +51 -0
- package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-X2YQ3QPG.js} +3 -3
- package/dist/ui-badge.entry-OJ6FJJKL.js +22 -0
- package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-ZN6JLND7.js} +2 -2
- package/dist/ui-callout.entry-7K6NXQ7U.js +32 -0
- package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-GUYRVU6O.js} +17 -8
- package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-chip_2.entry-M2DOTIGY.js} +32 -7
- package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-BM7FHOUJ.js} +5 -5
- package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-AZAD37CG.js} +50 -12
- package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-XDPGKMBK.js} +13 -7
- package/dist/ui-editable.entry-S3TE6KFT.js +110 -0
- package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-U7HGA3CS.js} +2 -2
- package/dist/ui-form-field.entry-C2ZSP3TM.js +120 -0
- package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-P6H2LY7D.js} +2 -2
- package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-GTNQJCQ2.js} +2 -2
- package/dist/ui-menu-item.entry-2HWOGUO5.js +22 -0
- package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-NZ7ER54K.js} +22 -14
- package/dist/ui-multi-combobox.entry-DZ5LLSVQ.js +167 -0
- package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-ZOEQMUWG.js} +17 -11
- package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-QCQ46EK5.js} +2 -2
- package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-QAATWUYT.js} +20 -8
- package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-2I3DH2OT.js} +2 -2
- package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-7RS55ORF.js} +2 -2
- package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-6O4KD4G7.js} +2 -2
- package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-DY5PSHCQ.js} +23 -11
- package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-6X56UOUE.js} +14 -10
- package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-RDYP6O77.js} +2 -2
- package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-EBY42KS5.js} +32 -23
- package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-PLXMPOKV.js} +19 -12
- package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-QKE2DLVD.js} +2 -2
- package/dist/ui-tree-item.entry-TC6YWIC6.js +145 -0
- package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-UL6UHCUT.js} +114 -12
- package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
- package/editor/extensions/index.d.ts +14 -6
- package/editor/extensions/index.js +1 -1
- package/editor/index.js +1 -1
- package/editor.css +37 -20
- package/package.json +1 -1
- package/styles.css +10 -0
- package/tokens.css +3 -0
- package/vue/{chunk-JLW23USW.js → chunk-GXQY27K2.js} +112 -17
- package/vue/editor/index.d.ts +5 -15
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +442 -116
- package/vue/index.js +9 -1
- package/dist/components/p-CaietZcq.js +0 -1
- package/dist/components/p-DHd18bK7.js +0 -1
- package/dist/looma/p-14c081cf.entry.js +0 -1
- package/dist/looma/p-25366205.entry.js +0 -1
- package/dist/looma/p-2e3aa869.entry.js +0 -1
- package/dist/looma/p-40fe7fee.entry.js +0 -1
- package/dist/looma/p-446cda76.entry.js +0 -1
- package/dist/looma/p-4fc1b005.entry.js +0 -13
- package/dist/looma/p-6a8a4736.entry.js +0 -1
- package/dist/looma/p-6bf4038b.entry.js +0 -1
- package/dist/looma/p-8204fee6.entry.js +0 -1
- package/dist/looma/p-8238e0dc.entry.js +0 -1
- package/dist/looma/p-99d88efb.entry.js +0 -1
- package/dist/looma/p-a27669b1.entry.js +0 -1
- package/dist/looma/p-a6ee76b7.entry.js +0 -1
- package/dist/looma/p-b6398a6b.entry.js +0 -1
- package/dist/looma/p-d50faaff.entry.js +0 -1
- package/dist/looma/p-d77278ce.entry.js +0 -1
- package/dist/looma/p-d9ec13b7.entry.js +0 -1
- package/dist/looma/p-ecf8005f.entry.js +0 -1
- package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
- package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
- package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
- package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
- package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getElement,
|
|
4
4
|
h,
|
|
5
5
|
registerInstance
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UY423IKN.js";
|
|
7
7
|
|
|
8
8
|
// dist/esm/ui-top-bar.entry.js
|
|
9
9
|
var uiTopBarCss = () => `:host{position:sticky;inset-block-start:0;z-index:var(--ui-top-bar-z-index, 100);display:block}.top-bar{min-block-size:calc(var(--ui-top-bar-height, 56px) + env(safe-area-inset-top));display:flex;align-items:center;gap:var(--ui-top-bar-gap, var(--ui-space-3, 0.75rem));padding-block-start:env(safe-area-inset-top);padding-inline-start:max( var(--ui-top-bar-padding-inline, var(--ui-space-4, 1rem)), env(safe-area-inset-left) );padding-inline-end:max( var(--ui-top-bar-padding-inline, var(--ui-space-4, 1rem)), env(safe-area-inset-right) );background:var(--ui-top-bar-bg, var(--ui-surface, #ffffff));border-block-end:1px solid var(--ui-top-bar-border, var(--ui-border, #e5e7eb))}.top-bar__leading,.top-bar__search,.top-bar__actions{display:flex;align-items:center;flex-shrink:0}.top-bar__actions{gap:var(--ui-top-bar-actions-gap, var(--ui-space-1, 0.25rem))}.top-bar__title{min-inline-size:0;flex:1}[hidden]{display:none}@media (min-width: 768px){:host{display:none}}`;
|
|
@@ -40,7 +40,7 @@ var UITopBar = class {
|
|
|
40
40
|
this.hasActions = slotHasContent(this.actionsSlot);
|
|
41
41
|
};
|
|
42
42
|
render() {
|
|
43
|
-
return h(Host, { key: "
|
|
43
|
+
return h(Host, { key: "ef7cf644a8e8381d7d1f8d093bcfefcdc4620682" }, h("header", { key: "5055594a179d86efefd43529e070a582c51cb1d8", class: "top-bar", part: "base" }, h("div", { key: "bd6ec069ae9d7820a6992250ba1aa997b4cc6754", class: "top-bar__leading", hidden: !this.hasLeading }, h("slot", { key: "3b9b1b73fb455ad720e1db46757555eb3713c0b8", name: "leading", ref: (el) => this.leadingSlot = el, onSlotchange: this.syncSlots })), h("div", { key: "e402cc0cb7ec4418460182f8f32cb161c6139221", class: "top-bar__title" }, h("slot", { key: "fce0cfc11da269167853f591742b1369023864ae" })), h("div", { key: "6861bb04f399076378aa1fa9be24b35db277106a", class: "top-bar__search", hidden: !this.hasSearch }, h("slot", { key: "3857f37d53ec99b36a52cb7830e634afdee29d2e", name: "search", ref: (el) => this.searchSlot = el, onSlotchange: this.syncSlots })), h("div", { key: "538f6297078b6d5aa85906e902066e8809f52540", class: "top-bar__actions", hidden: !this.hasActions }, h("slot", { key: "3c45ff59c4b48673e796c6e93842cb11fceb652f", name: "actions", ref: (el) => this.actionsSlot = el, onSlotchange: this.syncSlots }))));
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
UITopBar.style = uiTopBarCss();
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loomaIconMarkup
|
|
3
|
+
} from "./chunk-NB6DBRXQ.js";
|
|
4
|
+
import {
|
|
5
|
+
dispatchDetail,
|
|
6
|
+
eventToTrigger
|
|
7
|
+
} from "./chunk-UL7UIUJZ.js";
|
|
8
|
+
import {
|
|
9
|
+
Host,
|
|
10
|
+
getElement,
|
|
11
|
+
h,
|
|
12
|
+
registerInstance
|
|
13
|
+
} from "./chunk-UY423IKN.js";
|
|
14
|
+
|
|
15
|
+
// dist/esm/ui-tree-item.entry.js
|
|
16
|
+
var uiTreeItemCss = () => `:host{--ui-tree-indent:16px;--ui-tree-row-min-height:32px;--ui-tree-drop-color:var(--ui-accent-solid);position:relative;display:block;min-inline-size:0;margin-inline-start:calc(var(--ui-tree-item-depth, 0) * var(--ui-tree-indent))}.row{position:relative;display:grid;grid-template-columns:20px auto minmax(0, 1fr) auto;align-items:center;min-block-size:var(--ui-tree-row-min-height);min-inline-size:0;font-size:var(--ui-tree-font-size, var(--ui-font-size-ui, 0.9375rem));border-radius:var(--ui-radius-md);color:var(--ui-text-secondary);transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), opacity var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), min-block-size var(--ui-motion-base) var(--ui-motion-ease)}.row:hover,:host([data-selected]) .row,.row:focus-within{color:var(--ui-text-primary);background:var(--ui-surface-muted)}:host([data-disabled]) .row{opacity:0.55}:host([data-dragging]) .row{opacity:0.42}:host(:focus){outline:none}:host(:focus-visible) .row{box-shadow:0 0 0 2px var(--ui-focus-ring)}:host([data-drop-position='inside']) .row{background:var(--ui-accent-subtle);box-shadow:inset 0 0 0 1px var(--ui-tree-drop-color)}.disclosure,.disclosure-spacer{grid-column:1;grid-row:1;inline-size:20px;block-size:28px}.disclosure{display:grid;place-items:center;padding:0;color:var(--ui-text-muted);background:transparent;border:0;border-radius:var(--ui-radius-sm);cursor:pointer}.disclosure:hover{color:var(--ui-text-primary);background:var(--ui-surface-elevated)}.disclosure-icon{display:block;inline-size:14px;block-size:14px;transform:rotate(-90deg);transition:transform var(--ui-motion-fast) var(--ui-motion-ease)}.disclosure-icon--expanded{transform:rotate(0deg)}.disclosure-icon :is(svg),.drag-handle :is(svg){display:block;inline-size:100%;block-size:100%}.leading{display:none}.leading:has(*){display:inline-grid;place-items:center;grid-column:2;grid-row:1;inline-size:16px;block-size:16px;margin-inline-start:var(--ui-space-1)}.label{grid-column:3;grid-row:1;min-inline-size:0;padding:var(--ui-space-1) var(--ui-space-2)}.actions{grid-column:4;grid-row:1;display:inline-flex;align-items:center;min-inline-size:0}.drag-handle{position:absolute;z-index:2;inset-block-start:50%;inset-inline-start:-22px;inline-size:20px;block-size:32px;display:grid;place-items:center;padding:7px 3px;color:var(--ui-text-muted);background:var(--ui-surface-elevated);border:1px solid transparent;border-radius:var(--ui-radius-sm);cursor:grab;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease)}.row:hover .drag-handle,.drag-handle:focus-visible,:host([data-dragging]) .drag-handle{opacity:1;pointer-events:auto}.drag-handle:active{cursor:grabbing}.drop-indicator{position:absolute;z-index:3;inset-inline:1px;display:none;block-size:2px;border-radius:999px;background:var(--ui-tree-drop-color);pointer-events:none}.drop-indicator::before,.drop-indicator::after{content:'';position:absolute;inset-block-start:50%;inline-size:7px;block-size:7px;border:2px solid var(--ui-tree-drop-color);border-radius:999px;background:var(--ui-surface-elevated);transform:translateY(-50%)}.drop-indicator::before{inset-inline-start:-1px}.drop-indicator::after{inset-inline-end:-1px}:host([data-drop-position='before']) .row-drop-indicator{display:block;inset-block-start:-1px}:host([data-drop-position='after']) .subtree-drop-indicator{display:block;inset-block-end:-1px}.children[hidden]{display:none}:host-context(html[data-ui-input-modality='touch']){--ui-tree-row-min-height:44px}:host-context(html[data-ui-input-modality='touch']) .drag-handle{display:none}@media (prefers-reduced-motion: reduce){.row,.disclosure-icon,.drag-handle{transition:none}}`;
|
|
17
|
+
var UITreeItem = class {
|
|
18
|
+
constructor(hostRef) {
|
|
19
|
+
registerInstance(this, hostRef);
|
|
20
|
+
}
|
|
21
|
+
get host() {
|
|
22
|
+
return getElement(this);
|
|
23
|
+
}
|
|
24
|
+
/** Stable application identifier emitted by tree interaction events. */
|
|
25
|
+
itemId = "";
|
|
26
|
+
/** Accessible name used by the disclosure and drag handle. */
|
|
27
|
+
label = "";
|
|
28
|
+
/** Application hierarchy depth override used for drop constraints. Defaults to structural nesting. */
|
|
29
|
+
dropDepth;
|
|
30
|
+
/** Virtualized-tree descendant-depth override for the tree's max-depth drop constraint. */
|
|
31
|
+
subtreeDepth;
|
|
32
|
+
/** Whether this item accepts children and exposes disclosure behavior. */
|
|
33
|
+
container = false;
|
|
34
|
+
/** Whether this item participates in pointer drag and drop. */
|
|
35
|
+
sortable = false;
|
|
36
|
+
/** Application-defined kind used to reject incompatible sibling drops. */
|
|
37
|
+
dragType = "item";
|
|
38
|
+
/** Application-defined parent/list identity included with reorder events. */
|
|
39
|
+
dropScope = "";
|
|
40
|
+
/** Comma-separated drag kinds accepted as children. Empty accepts every kind. */
|
|
41
|
+
accepts = "";
|
|
42
|
+
/** Controlled expansion value. When omitted, `default-expanded` initializes uncontrolled state. */
|
|
43
|
+
expanded;
|
|
44
|
+
/** Initial uncontrolled expansion value. */
|
|
45
|
+
defaultExpanded = false;
|
|
46
|
+
selected = false;
|
|
47
|
+
disabled = false;
|
|
48
|
+
internalExpanded = false;
|
|
49
|
+
structuralLevel = 1;
|
|
50
|
+
tabStop = false;
|
|
51
|
+
syncExpandedFromProp() {
|
|
52
|
+
if (this.expanded !== void 0)
|
|
53
|
+
this.internalExpanded = this.expanded;
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.internalExpanded = this.expanded ?? this.defaultExpanded;
|
|
57
|
+
this.updateStructuralLevel();
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
this.host.addEventListener("ui-tree-auto-expand", this.onAutoExpand);
|
|
61
|
+
this.host.addEventListener("ui-tree-structure-sync", this.updateStructuralLevel);
|
|
62
|
+
this.host.addEventListener("ui-tree-roving-tab-stop", this.onRovingTabStop);
|
|
63
|
+
this.host.addEventListener("ui-tree-request-expanded", this.onExpansionRequest);
|
|
64
|
+
}
|
|
65
|
+
disconnectedCallback() {
|
|
66
|
+
this.host.removeEventListener("ui-tree-auto-expand", this.onAutoExpand);
|
|
67
|
+
this.host.removeEventListener("ui-tree-structure-sync", this.updateStructuralLevel);
|
|
68
|
+
this.host.removeEventListener("ui-tree-roving-tab-stop", this.onRovingTabStop);
|
|
69
|
+
this.host.removeEventListener("ui-tree-request-expanded", this.onExpansionRequest);
|
|
70
|
+
}
|
|
71
|
+
updateStructuralLevel = () => {
|
|
72
|
+
const tree = this.host.closest("ui-tree");
|
|
73
|
+
let ancestor = this.host.parentElement?.closest("ui-tree-item") ?? null;
|
|
74
|
+
let level = 1;
|
|
75
|
+
while (ancestor && tree?.contains(ancestor)) {
|
|
76
|
+
level += 1;
|
|
77
|
+
ancestor = ancestor.parentElement?.closest("ui-tree-item") ?? null;
|
|
78
|
+
}
|
|
79
|
+
if (this.structuralLevel !== level)
|
|
80
|
+
this.structuralLevel = level;
|
|
81
|
+
};
|
|
82
|
+
setExpanded(expanded, trigger) {
|
|
83
|
+
const current = this.isExpanded();
|
|
84
|
+
if (!this.container || this.disabled || current === expanded)
|
|
85
|
+
return;
|
|
86
|
+
if (this.expanded === void 0)
|
|
87
|
+
this.internalExpanded = expanded;
|
|
88
|
+
dispatchDetail(this.host, "expand", { id: this.itemId, expanded, trigger });
|
|
89
|
+
this.host.dispatchEvent(new CustomEvent("ui-tree-expansion-change"));
|
|
90
|
+
}
|
|
91
|
+
isExpanded() {
|
|
92
|
+
return this.expanded ?? this.internalExpanded;
|
|
93
|
+
}
|
|
94
|
+
onAutoExpand = () => {
|
|
95
|
+
this.setExpanded(true, "pointer");
|
|
96
|
+
};
|
|
97
|
+
onRovingTabStop = (event) => {
|
|
98
|
+
this.tabStop = Boolean(event.detail?.active) && !this.disabled;
|
|
99
|
+
};
|
|
100
|
+
onExpansionRequest = (event) => {
|
|
101
|
+
const detail = event.detail;
|
|
102
|
+
if (typeof detail?.expanded === "boolean")
|
|
103
|
+
this.setExpanded(detail.expanded, detail.trigger ?? "keyboard");
|
|
104
|
+
};
|
|
105
|
+
onDisclosureClick = (event) => {
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
this.setExpanded(!this.isExpanded(), eventToTrigger(event));
|
|
108
|
+
};
|
|
109
|
+
onDisclosureKeydown = (event) => {
|
|
110
|
+
if (event.key !== "ArrowRight" && event.key !== "ArrowLeft")
|
|
111
|
+
return;
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
this.setExpanded(event.key === "ArrowRight", "keyboard");
|
|
115
|
+
};
|
|
116
|
+
onRowClick = (event) => {
|
|
117
|
+
if (!this.container || this.disabled)
|
|
118
|
+
return;
|
|
119
|
+
const path = event.composedPath();
|
|
120
|
+
const interactive = path.some((node) => node instanceof HTMLElement && (node.matches('a, button, input, select, textarea, [role="button"], [role="link"]') || node.getAttribute("slot") === "actions"));
|
|
121
|
+
if (!interactive)
|
|
122
|
+
this.setExpanded(!this.isExpanded(), eventToTrigger(event));
|
|
123
|
+
};
|
|
124
|
+
render() {
|
|
125
|
+
const level = this.structuralLevel;
|
|
126
|
+
const expanded = this.isExpanded();
|
|
127
|
+
const disclosureLabel = `${expanded ? "Collapse" : "Expand"} ${this.label || "item"}`;
|
|
128
|
+
const dragLabel = `Drag ${this.label || "item"} to reorder`;
|
|
129
|
+
return h(Host, { key: "f092fa9586a39aba1a9629ba42e52f8fbc10de05", role: "treeitem", "aria-label": this.label || void 0, "aria-level": String(level), "aria-expanded": this.container ? String(expanded) : void 0, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? "true" : void 0, "data-container": this.container ? "" : void 0, "data-selected": this.selected ? "" : void 0, "data-disabled": this.disabled ? "" : void 0, "data-drag-type": this.dragType || "item", "data-drop-scope": this.dropScope || void 0, "data-accepts": this.accepts || void 0, tabIndex: this.disabled || !this.tabStop ? -1 : 0, style: {
|
|
130
|
+
"--ui-tree-item-depth": String(level - 1),
|
|
131
|
+
"margin-inline-start": level > 1 ? "var(--ui-tree-indent, 16px)" : "0px"
|
|
132
|
+
} }, h("div", { key: "2f16d97219ba9ec9e37688d97ad9144508aa1ed5", class: "row", part: "row", onClick: this.onRowClick }, this.sortable && !this.disabled ? h("button", { class: "drag-handle", part: "drag-handle", type: "button", draggable: true, "aria-label": dragLabel, title: dragLabel }, h("span", { innerHTML: loomaIconMarkup("grip-vertical") })) : null, this.container ? h("button", { class: "disclosure", part: "disclosure", type: "button", "aria-label": disclosureLabel, "aria-expanded": String(expanded), disabled: this.disabled, onClick: this.onDisclosureClick, onKeyDown: this.onDisclosureKeydown }, h("span", { class: { "disclosure-icon": true, "disclosure-icon--expanded": expanded }, innerHTML: loomaIconMarkup("chevron-down") })) : h("span", { class: "disclosure-spacer", "aria-hidden": "true" }), h("span", { key: "d984631c891df304edb3e1dc5bcd19af3ad8e20d", class: "leading", part: "leading" }, h("slot", { key: "81a0e055859df5d4daaa6dac39013b23dcc2831b", name: "leading" })), h("span", { key: "3ae295523d5a3b9feaa9bfaa16d807349e37d78b", class: "label", part: "label" }, h("slot", { key: "db8503a41d087d283074a41e76fa872ff4b2a707" })), h("span", { key: "ac5b5db7128b31a9263b912bd64cd90ac640eaeb", class: "actions", part: "actions" }, h("slot", { key: "c8842a5d80215ec297688c86f6bfe9b4d9bed333", name: "actions" })), h("span", { key: "b7f239bc16867678291850ad61a5cd752d6a7425", class: "drop-indicator row-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })), this.container ? h("div", { class: "children", part: "children", role: "group", hidden: !expanded }, h("slot", { name: "children" })) : null, h("span", { key: "2a5f448db2f4f363a34a1a950785e0ee12cc9938", class: "drop-indicator subtree-drop-indicator", part: "drop-indicator", "aria-hidden": "true" }));
|
|
133
|
+
}
|
|
134
|
+
static get watchers() {
|
|
135
|
+
return {
|
|
136
|
+
"expanded": [{
|
|
137
|
+
"syncExpandedFromProp": 0
|
|
138
|
+
}]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
UITreeItem.style = uiTreeItemCss();
|
|
143
|
+
export {
|
|
144
|
+
UITreeItem as ui_tree_item
|
|
145
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getElement,
|
|
7
7
|
h,
|
|
8
8
|
registerInstance
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UY423IKN.js";
|
|
10
10
|
|
|
11
11
|
// dist/esm/ui-tree.entry.js
|
|
12
12
|
function classifyDropPosition(rect, clientY, acceptsChildren) {
|
|
@@ -52,7 +52,7 @@ function createHoverIntent(delay, onIntent) {
|
|
|
52
52
|
destroy: cancel
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
var uiTreeCss = () => `:host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter
|
|
55
|
+
var uiTreeCss = () => `:host{--ui-tree-indent:16px;--ui-tree-gutter:0px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
|
|
56
56
|
var UITree = class {
|
|
57
57
|
constructor(hostRef) {
|
|
58
58
|
registerInstance(this, hostRef);
|
|
@@ -71,6 +71,8 @@ var UITree = class {
|
|
|
71
71
|
rejectedPosition = null;
|
|
72
72
|
rejection = null;
|
|
73
73
|
hoverIntent = null;
|
|
74
|
+
structureObserver = null;
|
|
75
|
+
tabStop = null;
|
|
74
76
|
componentDidLoad() {
|
|
75
77
|
this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
|
|
76
78
|
this.host.addEventListener("dragstart", this.onDragStart);
|
|
@@ -81,6 +83,11 @@ var UITree = class {
|
|
|
81
83
|
this.host.addEventListener("drop", this.onDrop);
|
|
82
84
|
this.host.addEventListener("dragend", this.onDragEnd);
|
|
83
85
|
this.host.addEventListener("keydown", this.onKeyDown);
|
|
86
|
+
this.host.addEventListener("focusin", this.onFocusIn);
|
|
87
|
+
this.host.addEventListener("ui-tree-expansion-change", this.onExpansionChange);
|
|
88
|
+
this.syncStructuralLevels();
|
|
89
|
+
this.structureObserver = new MutationObserver(this.syncStructuralLevels);
|
|
90
|
+
this.structureObserver.observe(this.host, { childList: true, subtree: true });
|
|
84
91
|
}
|
|
85
92
|
disconnectedCallback() {
|
|
86
93
|
this.hoverIntent?.destroy();
|
|
@@ -92,10 +99,40 @@ var UITree = class {
|
|
|
92
99
|
this.host.removeEventListener("drop", this.onDrop);
|
|
93
100
|
this.host.removeEventListener("dragend", this.onDragEnd);
|
|
94
101
|
this.host.removeEventListener("keydown", this.onKeyDown);
|
|
102
|
+
this.host.removeEventListener("focusin", this.onFocusIn);
|
|
103
|
+
this.host.removeEventListener("ui-tree-expansion-change", this.onExpansionChange);
|
|
104
|
+
this.structureObserver?.disconnect();
|
|
105
|
+
this.structureObserver = null;
|
|
106
|
+
}
|
|
107
|
+
syncStructuralLevels = () => {
|
|
108
|
+
for (const item of Array.from(this.host.querySelectorAll("ui-tree-item"))) {
|
|
109
|
+
item.dispatchEvent(new CustomEvent("ui-tree-structure-sync"));
|
|
110
|
+
}
|
|
111
|
+
this.syncTabStop();
|
|
112
|
+
};
|
|
113
|
+
syncTabStop(preferred) {
|
|
114
|
+
const items = this.visibleItems();
|
|
115
|
+
const next = preferred && items.includes(preferred) ? preferred : this.tabStop && items.includes(this.tabStop) ? this.tabStop : items[0] ?? null;
|
|
116
|
+
this.tabStop = next;
|
|
117
|
+
for (const item of items) {
|
|
118
|
+
item.dispatchEvent(new CustomEvent("ui-tree-roving-tab-stop", {
|
|
119
|
+
detail: { active: item === next }
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
95
122
|
}
|
|
96
123
|
itemFromEvent(event) {
|
|
97
124
|
return event.composedPath().find((node) => node instanceof HTMLElement && node.localName === "ui-tree-item") ?? null;
|
|
98
125
|
}
|
|
126
|
+
eventTargetsInteractiveContent(event) {
|
|
127
|
+
for (const node of event.composedPath()) {
|
|
128
|
+
if (node instanceof HTMLElement && node.localName === "ui-tree-item")
|
|
129
|
+
break;
|
|
130
|
+
if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
99
136
|
itemId(item) {
|
|
100
137
|
return item.itemId || item.getAttribute("item-id") || "";
|
|
101
138
|
}
|
|
@@ -139,9 +176,23 @@ var UITree = class {
|
|
|
139
176
|
const dropDepth = item.getAttribute("drop-depth");
|
|
140
177
|
if (dropDepth !== null)
|
|
141
178
|
return Number(dropDepth);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
179
|
+
return Number(item.getAttribute("aria-level")) || 1;
|
|
180
|
+
}
|
|
181
|
+
subtreeDepth(item) {
|
|
182
|
+
if (item.subtreeDepth !== void 0)
|
|
183
|
+
return Math.max(0, Math.floor(item.subtreeDepth));
|
|
184
|
+
const override = item.getAttribute("subtree-depth");
|
|
185
|
+
if (override !== null)
|
|
186
|
+
return Math.max(0, Math.floor(Number(override)));
|
|
187
|
+
return Array.from(item.querySelectorAll("ui-tree-item")).reduce((deepest, descendant) => {
|
|
188
|
+
let nesting = 0;
|
|
189
|
+
let ancestor = descendant.parentElement?.closest("ui-tree-item") ?? null;
|
|
190
|
+
while (ancestor && ancestor !== item) {
|
|
191
|
+
nesting += 1;
|
|
192
|
+
ancestor = ancestor.parentElement?.closest("ui-tree-item") ?? null;
|
|
193
|
+
}
|
|
194
|
+
return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
|
|
195
|
+
}, 0);
|
|
145
196
|
}
|
|
146
197
|
dropRejection(source, target, position) {
|
|
147
198
|
if (source.contains(target))
|
|
@@ -156,9 +207,9 @@ var UITree = class {
|
|
|
156
207
|
return { reason: "incompatible" };
|
|
157
208
|
}
|
|
158
209
|
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
159
|
-
if (maxDepth > 0
|
|
210
|
+
if (maxDepth > 0) {
|
|
160
211
|
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
161
|
-
const subtreeDepth =
|
|
212
|
+
const subtreeDepth = this.subtreeDepth(source);
|
|
162
213
|
const resultingDepth = targetDepth + (position === "inside" ? 1 : 0) + subtreeDepth;
|
|
163
214
|
if (resultingDepth > maxDepth)
|
|
164
215
|
return { reason: "max-depth", maxDepth, resultingDepth };
|
|
@@ -344,7 +395,35 @@ var UITree = class {
|
|
|
344
395
|
visibleItems() {
|
|
345
396
|
return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((item) => item.getClientRects().length > 0 && !item.hasAttribute("disabled"));
|
|
346
397
|
}
|
|
398
|
+
parentItem(item) {
|
|
399
|
+
const parent = item.parentElement?.closest("ui-tree-item") ?? null;
|
|
400
|
+
return parent && this.host.contains(parent) ? parent : null;
|
|
401
|
+
}
|
|
402
|
+
firstVisibleChild(item, items) {
|
|
403
|
+
return items.find((candidate) => this.parentItem(candidate) === item) ?? null;
|
|
404
|
+
}
|
|
405
|
+
focusItem(item) {
|
|
406
|
+
this.syncTabStop(item);
|
|
407
|
+
item.focus();
|
|
408
|
+
}
|
|
409
|
+
requestExpansion(item, expanded) {
|
|
410
|
+
item.dispatchEvent(new CustomEvent("ui-tree-request-expanded", {
|
|
411
|
+
detail: { expanded, trigger: "keyboard" }
|
|
412
|
+
}));
|
|
413
|
+
}
|
|
414
|
+
onFocusIn = (event) => {
|
|
415
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
416
|
+
return;
|
|
417
|
+
const item = this.itemFromEvent(event);
|
|
418
|
+
if (item)
|
|
419
|
+
this.syncTabStop(item);
|
|
420
|
+
};
|
|
421
|
+
onExpansionChange = () => {
|
|
422
|
+
requestAnimationFrame(() => this.syncTabStop());
|
|
423
|
+
};
|
|
347
424
|
onKeyDown = (event) => {
|
|
425
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
426
|
+
return;
|
|
348
427
|
const current = this.itemFromEvent(event);
|
|
349
428
|
if (!current)
|
|
350
429
|
return;
|
|
@@ -352,14 +431,37 @@ var UITree = class {
|
|
|
352
431
|
const index = items.indexOf(current);
|
|
353
432
|
if (index < 0)
|
|
354
433
|
return;
|
|
355
|
-
const next = event.key === "ArrowDown" ? items[index + 1] : event.key === "ArrowUp" ? items[index - 1] : null;
|
|
356
|
-
if (
|
|
434
|
+
const next = event.key === "ArrowDown" ? items[index + 1] : event.key === "ArrowUp" ? items[index - 1] : event.key === "Home" ? items[0] : event.key === "End" ? items.at(-1) : null;
|
|
435
|
+
if (next) {
|
|
436
|
+
event.preventDefault();
|
|
437
|
+
this.focusItem(next);
|
|
357
438
|
return;
|
|
358
|
-
|
|
359
|
-
|
|
439
|
+
}
|
|
440
|
+
if (event.key === "ArrowLeft") {
|
|
441
|
+
if (current.getAttribute("aria-expanded") === "true") {
|
|
442
|
+
event.preventDefault();
|
|
443
|
+
this.requestExpansion(current, false);
|
|
444
|
+
} else if (this.parentItem(current)) {
|
|
445
|
+
event.preventDefault();
|
|
446
|
+
this.focusItem(this.parentItem(current));
|
|
447
|
+
}
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
if (event.key === "ArrowRight") {
|
|
451
|
+
if (current.getAttribute("aria-expanded") === "false") {
|
|
452
|
+
event.preventDefault();
|
|
453
|
+
this.requestExpansion(current, true);
|
|
454
|
+
} else if (current.getAttribute("aria-expanded") === "true") {
|
|
455
|
+
const child = this.firstVisibleChild(current, items);
|
|
456
|
+
if (child) {
|
|
457
|
+
event.preventDefault();
|
|
458
|
+
this.focusItem(child);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
360
462
|
};
|
|
361
463
|
render() {
|
|
362
|
-
return h(Host, { key: "
|
|
464
|
+
return h(Host, { key: "7efbf793fe63471006df57f0045a5fe995c81440", role: "tree", "aria-label": this.label || "Tree" }, h("slot", { key: "1804e391796e7451c93cb58258e0e23ec3ad98c7" }));
|
|
363
465
|
}
|
|
364
466
|
};
|
|
365
467
|
UITree.style = uiTreeCss();
|