@threadlabs/looma 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3K45IWIJ.js +4733 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-UHHA4WT5.js +2916 -0
- package/dist/declarative-generated.cjs +135 -0
- package/dist/declarative-generated.d.cts +10 -0
- package/dist/declarative-generated.d.ts +10 -0
- package/dist/declarative-generated.js +111 -0
- package/dist/declarative.cjs +2944 -0
- package/dist/declarative.d.cts +27 -0
- package/dist/declarative.d.ts +27 -0
- package/dist/declarative.js +13 -0
- package/dist/index.cjs +7480 -6457
- package/dist/index.d.cts +4 -58
- package/dist/index.d.ts +4 -58
- package/dist/index.js +15 -27
- package/dist/loader.cjs +7654 -0
- package/dist/loader.d.cts +4 -0
- package/dist/loader.d.ts +4 -0
- package/dist/loader.js +16 -0
- package/dist/valibot.cjs +31 -0
- package/dist/valibot.d.cts +10 -0
- package/dist/valibot.d.ts +1 -43
- package/dist/valibot.js +2 -0
- package/dist/{types/field/validation.d.ts → validation-bxcou-l-.d.cts} +13 -11
- package/dist/validation-bxcou-l-.d.ts +58 -0
- package/editor/{chunk-B5WVJOPV.js → chunk-BXICJBWS.js} +118 -8
- package/editor/{chunk-ZOUKEZ77.js → chunk-JK53ENSG.js} +8 -21
- package/editor/chunk-WI7ZA44X.js +2558 -0
- package/editor/extensions/index.d.ts +11 -2
- package/editor/extensions/index.js +9 -7
- package/editor/index.d.ts +1 -1
- package/editor/index.js +10 -8
- package/editor/ui.js +2 -2
- package/editor.css +32 -0
- package/layout/index.cjs +466 -400
- package/layout/index.d.cts +1 -2
- package/layout/index.d.ts +1 -2
- package/layout/index.js +471 -395
- package/package.json +14 -5
- package/styles.css +8 -8
- package/vue/chunk-4DPYH3IT.js +3538 -0
- package/vue/editor/index.d.ts +17 -7
- package/vue/editor/index.js +53 -35
- package/vue/index.d.ts +48 -31
- package/vue/index.js +1 -1
- package/dist/chunk-24OTMNIU.js +0 -1617
- package/dist/chunk-D5WRORG6.js +0 -366
- package/dist/chunk-HNFCGIBP.js +0 -8
- package/dist/chunk-NB6DBRXQ.js +0 -323
- package/dist/chunk-OF57X5AR.js +0 -10
- package/dist/chunk-TL4FIE7X.js +0 -93
- package/dist/chunk-UL7UIUJZ.js +0 -20
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/controlled-state-BFya8rAX.js +0 -9
- package/dist/cjs/events-TcQIzpNv.js +0 -19
- package/dist/cjs/icons-BAdjrnhS.js +0 -680
- package/dist/cjs/id-CYbKpaYr.js +0 -9
- package/dist/cjs/index-BHG9Rpil.js +0 -1602
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -13
- package/dist/cjs/looma.cjs.js +0 -25
- package/dist/cjs/manager-Ce25WRtl.js +0 -95
- package/dist/cjs/positioning-CCR6ifPj.js +0 -426
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +0 -43
- package/dist/cjs/ui-avatar-group.cjs.entry.js +0 -43
- package/dist/cjs/ui-avatar.cjs.entry.js +0 -50
- package/dist/cjs/ui-badge.cjs.entry.js +0 -19
- package/dist/cjs/ui-button.cjs.entry.js +0 -75
- package/dist/cjs/ui-callout.cjs.entry.js +0 -27
- package/dist/cjs/ui-checkbox.cjs.entry.js +0 -97
- package/dist/cjs/ui-chip_2.cjs.entry.js +0 -258
- package/dist/cjs/ui-combobox.cjs.entry.js +0 -708
- package/dist/cjs/ui-context-menu.cjs.entry.js +0 -239
- package/dist/cjs/ui-dialog.cjs.entry.js +0 -131
- package/dist/cjs/ui-disclosure.cjs.entry.js +0 -112
- package/dist/cjs/ui-editable.cjs.entry.js +0 -100
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +0 -20
- package/dist/cjs/ui-form-field.cjs.entry.js +0 -114
- package/dist/cjs/ui-icon-button.cjs.entry.js +0 -23
- package/dist/cjs/ui-input.cjs.entry.js +0 -106
- package/dist/cjs/ui-menu-item.cjs.entry.js +0 -19
- package/dist/cjs/ui-menu.cjs.entry.js +0 -182
- package/dist/cjs/ui-popover.cjs.entry.js +0 -135
- package/dist/cjs/ui-radio-group.cjs.entry.js +0 -134
- package/dist/cjs/ui-radio.cjs.entry.js +0 -94
- package/dist/cjs/ui-search-result-row.cjs.entry.js +0 -47
- package/dist/cjs/ui-search-shell.cjs.entry.js +0 -39
- package/dist/cjs/ui-select.cjs.entry.js +0 -108
- package/dist/cjs/ui-switch.cjs.entry.js +0 -74
- package/dist/cjs/ui-tabs.cjs.entry.js +0 -118
- package/dist/cjs/ui-textarea.cjs.entry.js +0 -110
- package/dist/cjs/ui-toast-region.cjs.entry.js +0 -93
- package/dist/cjs/ui-top-bar.cjs.entry.js +0 -43
- package/dist/cjs/ui-tree-item.cjs.entry.js +0 -135
- package/dist/cjs/ui-tree.cjs.entry.js +0 -500
- package/dist/collection/collection-manifest.json +0 -45
- package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.css +0 -8
- package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +0 -70
- package/dist/collection/components/ui-avatar/ui-avatar.css +0 -35
- package/dist/collection/components/ui-avatar/ui-avatar.js +0 -130
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +0 -32
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +0 -95
- package/dist/collection/components/ui-badge/ui-badge.css +0 -90
- package/dist/collection/components/ui-badge/ui-badge.js +0 -62
- package/dist/collection/components/ui-button/ui-button.css +0 -121
- package/dist/collection/components/ui-button/ui-button.js +0 -141
- package/dist/collection/components/ui-callout/ui-callout.css +0 -74
- package/dist/collection/components/ui-callout/ui-callout.js +0 -59
- package/dist/collection/components/ui-checkbox/ui-checkbox.css +0 -24
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +0 -228
- package/dist/collection/components/ui-chip/ui-chip.css +0 -57
- package/dist/collection/components/ui-chip/ui-chip.js +0 -67
- package/dist/collection/components/ui-combobox/ui-combobox.css +0 -47
- package/dist/collection/components/ui-combobox/ui-combobox.js +0 -1295
- package/dist/collection/components/ui-context-menu/ui-context-menu.css +0 -34
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +0 -311
- package/dist/collection/components/ui-dialog/ui-dialog.css +0 -72
- package/dist/collection/components/ui-dialog/ui-dialog.js +0 -242
- package/dist/collection/components/ui-disclosure/ui-disclosure.css +0 -7
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +0 -184
- package/dist/collection/components/ui-editable/ui-editable.css +0 -2
- package/dist/collection/components/ui-editable/ui-editable.js +0 -196
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +0 -73
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +0 -85
- package/dist/collection/components/ui-form-field/ui-form-field.css +0 -25
- package/dist/collection/components/ui-form-field/ui-form-field.js +0 -180
- package/dist/collection/components/ui-icon-button/ui-icon-button.css +0 -145
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +0 -128
- package/dist/collection/components/ui-input/ui-input.css +0 -48
- package/dist/collection/components/ui-input/ui-input.js +0 -217
- package/dist/collection/components/ui-menu/ui-menu.css +0 -73
- package/dist/collection/components/ui-menu/ui-menu.js +0 -280
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +0 -32
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +0 -64
- package/dist/collection/components/ui-popover/ui-popover.css +0 -58
- package/dist/collection/components/ui-popover/ui-popover.js +0 -232
- package/dist/collection/components/ui-radio/ui-radio.css +0 -22
- package/dist/collection/components/ui-radio/ui-radio.js +0 -226
- package/dist/collection/components/ui-radio-group/ui-radio-group.css +0 -10
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +0 -247
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +0 -80
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +0 -100
- package/dist/collection/components/ui-search-shell/ui-search-shell.css +0 -63
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +0 -46
- package/dist/collection/components/ui-select/ui-select.css +0 -64
- package/dist/collection/components/ui-select/ui-select.js +0 -218
- package/dist/collection/components/ui-switch/ui-switch.css +0 -63
- package/dist/collection/components/ui-switch/ui-switch.js +0 -185
- package/dist/collection/components/ui-tabs/ui-tabs.css +0 -68
- package/dist/collection/components/ui-tabs/ui-tabs.js +0 -190
- package/dist/collection/components/ui-textarea/ui-textarea.css +0 -49
- package/dist/collection/components/ui-textarea/ui-textarea.js +0 -241
- package/dist/collection/components/ui-toast-region/ui-toast-region.css +0 -59
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +0 -126
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +0 -43
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +0 -430
- package/dist/collection/components/ui-top-bar/ui-top-bar.css +0 -51
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +0 -52
- package/dist/collection/components/ui-tree/ui-tree.css +0 -12
- package/dist/collection/components/ui-tree/ui-tree.js +0 -515
- package/dist/collection/components/ui-tree-item/ui-tree-item.css +0 -217
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +0 -406
- package/dist/collection/field/combobox.js +0 -4
- package/dist/collection/field/editable.js +0 -1
- package/dist/collection/field/multi-combobox.js +0 -1
- package/dist/collection/field/valibot.js +0 -5
- package/dist/collection/field/validation.js +0 -62
- package/dist/collection/icons.js +0 -71
- package/dist/collection/input-modality.js +0 -24
- package/dist/collection/overlay/manager.js +0 -92
- package/dist/collection/overlay/positioning.js +0 -424
- package/dist/collection/utils/controlled-state.js +0 -4
- package/dist/collection/utils/drag-drop.js +0 -51
- package/dist/collection/utils/events.js +0 -13
- package/dist/collection/utils/id.js +0 -5
- package/dist/collection/utils/initials.js +0 -11
- package/dist/components/index.d.ts +0 -102
- package/dist/components/index.js +0 -1
- package/dist/components/p-6SWSrfmW.js +0 -1
- package/dist/components/p-B_DaIVEY.js +0 -1
- package/dist/components/p-Bh_1GxOD.js +0 -1
- package/dist/components/p-BnGhGgTH.js +0 -1
- package/dist/components/p-BzaB_bXo.js +0 -1
- package/dist/components/p-C-0syqXZ.js +0 -1
- package/dist/components/p-CoFximGM.js +0 -13
- package/dist/components/p-JwSoedEO.js +0 -1
- package/dist/components/p-Vc4ExHFc.js +0 -1
- package/dist/components/p-hgBUJRDa.js +0 -1
- package/dist/components/ui-affordance-scope.d.ts +0 -11
- package/dist/components/ui-affordance-scope.js +0 -1
- package/dist/components/ui-avatar-group.d.ts +0 -11
- package/dist/components/ui-avatar-group.js +0 -1
- package/dist/components/ui-avatar.d.ts +0 -11
- package/dist/components/ui-avatar.js +0 -1
- package/dist/components/ui-badge.d.ts +0 -11
- package/dist/components/ui-badge.js +0 -1
- package/dist/components/ui-button.d.ts +0 -11
- package/dist/components/ui-button.js +0 -1
- package/dist/components/ui-callout.d.ts +0 -11
- package/dist/components/ui-callout.js +0 -1
- package/dist/components/ui-checkbox.d.ts +0 -11
- package/dist/components/ui-checkbox.js +0 -1
- package/dist/components/ui-chip.d.ts +0 -11
- package/dist/components/ui-chip.js +0 -1
- package/dist/components/ui-combobox.d.ts +0 -11
- package/dist/components/ui-combobox.js +0 -1
- package/dist/components/ui-context-menu.d.ts +0 -11
- package/dist/components/ui-context-menu.js +0 -1
- package/dist/components/ui-dialog.d.ts +0 -11
- package/dist/components/ui-dialog.js +0 -1
- package/dist/components/ui-disclosure.d.ts +0 -11
- package/dist/components/ui-disclosure.js +0 -1
- package/dist/components/ui-editable.d.ts +0 -11
- package/dist/components/ui-editable.js +0 -1
- package/dist/components/ui-floating-action-button.d.ts +0 -11
- package/dist/components/ui-floating-action-button.js +0 -1
- package/dist/components/ui-form-field.d.ts +0 -11
- package/dist/components/ui-form-field.js +0 -1
- package/dist/components/ui-icon-button.d.ts +0 -11
- package/dist/components/ui-icon-button.js +0 -1
- package/dist/components/ui-input.d.ts +0 -11
- package/dist/components/ui-input.js +0 -1
- package/dist/components/ui-menu-item.d.ts +0 -11
- package/dist/components/ui-menu-item.js +0 -1
- package/dist/components/ui-menu.d.ts +0 -11
- package/dist/components/ui-menu.js +0 -1
- package/dist/components/ui-popover.d.ts +0 -11
- package/dist/components/ui-popover.js +0 -1
- package/dist/components/ui-radio-group.d.ts +0 -11
- package/dist/components/ui-radio-group.js +0 -1
- package/dist/components/ui-radio.d.ts +0 -11
- package/dist/components/ui-radio.js +0 -1
- package/dist/components/ui-search-result-row.d.ts +0 -11
- package/dist/components/ui-search-result-row.js +0 -1
- package/dist/components/ui-search-shell.d.ts +0 -11
- package/dist/components/ui-search-shell.js +0 -1
- package/dist/components/ui-select.d.ts +0 -11
- package/dist/components/ui-select.js +0 -1
- package/dist/components/ui-switch.d.ts +0 -11
- package/dist/components/ui-switch.js +0 -1
- package/dist/components/ui-tabs.d.ts +0 -11
- package/dist/components/ui-tabs.js +0 -1
- package/dist/components/ui-textarea.d.ts +0 -11
- package/dist/components/ui-textarea.js +0 -1
- package/dist/components/ui-toast-region.d.ts +0 -11
- package/dist/components/ui-toast-region.js +0 -1
- package/dist/components/ui-tooltip.d.ts +0 -11
- package/dist/components/ui-tooltip.js +0 -1
- package/dist/components/ui-top-bar.d.ts +0 -11
- package/dist/components/ui-top-bar.js +0 -1
- package/dist/components/ui-tree-item.d.ts +0 -11
- package/dist/components/ui-tree-item.js +0 -1
- package/dist/components/ui-tree.d.ts +0 -11
- package/dist/components/ui-tree.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/controlled-state-BnGhGgTH.js +0 -6
- package/dist/esm/events-JwSoedEO.js +0 -15
- package/dist/esm/icons-CoFximGM.js +0 -678
- package/dist/esm/id-hgBUJRDa.js +0 -7
- package/dist/esm/index-8BGiMGQ0.js +0 -1593
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -11
- package/dist/esm/looma.js +0 -21
- package/dist/esm/manager-C-0syqXZ.js +0 -91
- package/dist/esm/positioning-ZOr-2PSe.js +0 -421
- package/dist/esm/ui-affordance-scope.entry.js +0 -41
- package/dist/esm/ui-avatar-group.entry.js +0 -41
- package/dist/esm/ui-avatar.entry.js +0 -48
- package/dist/esm/ui-badge.entry.js +0 -17
- package/dist/esm/ui-button.entry.js +0 -73
- package/dist/esm/ui-callout.entry.js +0 -25
- package/dist/esm/ui-checkbox.entry.js +0 -95
- package/dist/esm/ui-chip_2.entry.js +0 -255
- package/dist/esm/ui-combobox.entry.js +0 -706
- package/dist/esm/ui-context-menu.entry.js +0 -237
- package/dist/esm/ui-dialog.entry.js +0 -129
- package/dist/esm/ui-disclosure.entry.js +0 -110
- package/dist/esm/ui-editable.entry.js +0 -98
- package/dist/esm/ui-floating-action-button.entry.js +0 -18
- package/dist/esm/ui-form-field.entry.js +0 -112
- package/dist/esm/ui-icon-button.entry.js +0 -21
- package/dist/esm/ui-input.entry.js +0 -104
- package/dist/esm/ui-menu-item.entry.js +0 -17
- package/dist/esm/ui-menu.entry.js +0 -180
- package/dist/esm/ui-popover.entry.js +0 -133
- package/dist/esm/ui-radio-group.entry.js +0 -132
- package/dist/esm/ui-radio.entry.js +0 -92
- package/dist/esm/ui-search-result-row.entry.js +0 -45
- package/dist/esm/ui-search-shell.entry.js +0 -37
- package/dist/esm/ui-select.entry.js +0 -106
- package/dist/esm/ui-switch.entry.js +0 -72
- package/dist/esm/ui-tabs.entry.js +0 -116
- package/dist/esm/ui-textarea.entry.js +0 -108
- package/dist/esm/ui-toast-region.entry.js +0 -91
- package/dist/esm/ui-top-bar.entry.js +0 -41
- package/dist/esm/ui-tree-item.entry.js +0 -133
- package/dist/esm/ui-tree.entry.js +0 -498
- package/dist/index.cjs.js +0 -1
- package/dist/looma/index.esm.js +0 -0
- package/dist/looma/looma.esm.js +0 -1
- package/dist/looma/p-08f80207.entry.js +0 -1
- package/dist/looma/p-0b5b8d9e.entry.js +0 -1
- package/dist/looma/p-1249a806.entry.js +0 -1
- package/dist/looma/p-16e0669d.entry.js +0 -1
- package/dist/looma/p-1c00670f.entry.js +0 -1
- package/dist/looma/p-1c5a7522.entry.js +0 -1
- package/dist/looma/p-22842f8c.entry.js +0 -1
- package/dist/looma/p-2915d5c0.entry.js +0 -1
- package/dist/looma/p-3b2961a6.entry.js +0 -1
- package/dist/looma/p-3f60f4c8.entry.js +0 -1
- package/dist/looma/p-424d6719.entry.js +0 -1
- package/dist/looma/p-4caccfce.entry.js +0 -1
- package/dist/looma/p-5fdcee1d.entry.js +0 -1
- package/dist/looma/p-6d8b99ee.entry.js +0 -1
- package/dist/looma/p-6f20d470.entry.js +0 -1
- package/dist/looma/p-7c0b5364.entry.js +0 -1
- package/dist/looma/p-8BGiMGQ0.js +0 -2
- package/dist/looma/p-8bdd9495.entry.js +0 -1
- package/dist/looma/p-99116a72.entry.js +0 -1
- package/dist/looma/p-9cfbf722.entry.js +0 -1
- package/dist/looma/p-9d2662ca.entry.js +0 -1
- package/dist/looma/p-9ff2fa19.entry.js +0 -1
- package/dist/looma/p-BnGhGgTH.js +0 -1
- package/dist/looma/p-C-0syqXZ.js +0 -1
- package/dist/looma/p-CoFximGM.js +0 -13
- package/dist/looma/p-DQuL1Twl.js +0 -1
- package/dist/looma/p-JwSoedEO.js +0 -1
- package/dist/looma/p-ZOr-2PSe.js +0 -1
- package/dist/looma/p-a2dd4c6c.entry.js +0 -1
- package/dist/looma/p-add67e4c.entry.js +0 -1
- package/dist/looma/p-b6ede6bb.entry.js +0 -1
- package/dist/looma/p-b76e2111.entry.js +0 -1
- package/dist/looma/p-ca2a54fd.entry.js +0 -1
- package/dist/looma/p-d372b0db.entry.js +0 -1
- package/dist/looma/p-d4825822.entry.js +0 -1
- package/dist/looma/p-d56571a2.entry.js +0 -1
- package/dist/looma/p-d5c3954f.entry.js +0 -1
- package/dist/looma/p-e604e906.entry.js +0 -1
- package/dist/looma/p-f1f7c5cb.entry.js +0 -1
- package/dist/looma/p-hgBUJRDa.js +0 -1
- package/dist/types/components/ui-affordance-scope/ui-affordance-scope.d.ts +0 -11
- package/dist/types/components/ui-avatar/ui-avatar.d.ts +0 -11
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +0 -11
- package/dist/types/components/ui-badge/ui-badge.d.ts +0 -5
- package/dist/types/components/ui-button/ui-button.d.ts +0 -13
- package/dist/types/components/ui-callout/ui-callout.d.ts +0 -6
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +0 -20
- package/dist/types/components/ui-chip/ui-chip.d.ts +0 -8
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +0 -128
- package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +0 -43
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +0 -27
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +0 -21
- package/dist/types/components/ui-editable/ui-editable.d.ts +0 -24
- package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +0 -6
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +0 -18
- package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +0 -9
- package/dist/types/components/ui-input/ui-input.d.ts +0 -19
- package/dist/types/components/ui-menu/ui-menu.d.ts +0 -28
- package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +0 -5
- package/dist/types/components/ui-popover/ui-popover.d.ts +0 -26
- package/dist/types/components/ui-radio/ui-radio.d.ts +0 -20
- package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +0 -21
- package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +0 -15
- package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +0 -9
- package/dist/types/components/ui-select/ui-select.d.ts +0 -20
- package/dist/types/components/ui-switch/ui-switch.d.ts +0 -16
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +0 -18
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +0 -20
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +0 -16
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +0 -57
- package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +0 -12
- package/dist/types/components/ui-tree/ui-tree.d.ts +0 -53
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +0 -44
- package/dist/types/components.d.ts +0 -1889
- package/dist/types/field/combobox.d.ts +0 -46
- package/dist/types/field/editable.d.ts +0 -5
- package/dist/types/field/multi-combobox.d.ts +0 -11
- package/dist/types/field/valibot.d.ts +0 -7
- package/dist/types/icons.d.ts +0 -53
- package/dist/types/input-modality.d.ts +0 -6
- package/dist/types/overlay/manager.d.ts +0 -17
- package/dist/types/overlay/positioning.d.ts +0 -74
- package/dist/types/stencil-public-runtime.d.ts +0 -1860
- package/dist/types/utils/controlled-state.d.ts +0 -4
- package/dist/types/utils/drag-drop.d.ts +0 -15
- package/dist/types/utils/events.d.ts +0 -4
- package/dist/types/utils/id.d.ts +0 -1
- package/dist/types/utils/initials.d.ts +0 -1
- package/dist/ui-affordance-scope.entry-L6TIXYOP.js +0 -54
- package/dist/ui-avatar-group.entry-TCAA6P72.js +0 -51
- package/dist/ui-avatar.entry-52DQ7VXA.js +0 -51
- package/dist/ui-badge.entry-2XCAA6LL.js +0 -22
- package/dist/ui-button.entry-MNFBMNSX.js +0 -83
- package/dist/ui-callout.entry-SSHT5TH2.js +0 -32
- package/dist/ui-checkbox.entry-LOWIWIWI.js +0 -111
- package/dist/ui-chip_2.entry-BIMTSF6C.js +0 -272
- package/dist/ui-combobox.entry-25Z4MN7N.js +0 -717
- package/dist/ui-context-menu.entry-YZDL5Y4M.js +0 -248
- package/dist/ui-dialog.entry-HIXZX5AB.js +0 -146
- package/dist/ui-disclosure.entry-2JZHZNDQ.js +0 -126
- package/dist/ui-editable.entry-U3VR3XPT.js +0 -110
- package/dist/ui-floating-action-button.entry-6S3QN3KJ.js +0 -23
- package/dist/ui-form-field.entry-GQOSMLHT.js +0 -120
- package/dist/ui-icon-button.entry-QJXKVDM6.js +0 -26
- package/dist/ui-input.entry-UWMQ6JMP.js +0 -114
- package/dist/ui-menu-item.entry-NHNZKKJS.js +0 -22
- package/dist/ui-menu.entry-D53RUJND.js +0 -192
- package/dist/ui-popover.entry-7ZSIWCFQ.js +0 -152
- package/dist/ui-radio-group.entry-37MSYIH4.js +0 -142
- package/dist/ui-radio.entry-7YGCDHXT.js +0 -108
- package/dist/ui-search-result-row.entry-6FCCLGAS.js +0 -50
- package/dist/ui-search-shell.entry-HSBEXPER.js +0 -41
- package/dist/ui-select.entry-GIDIAYRD.js +0 -117
- package/dist/ui-switch.entry-MYAL6XPC.js +0 -87
- package/dist/ui-tabs.entry-R4TEXQSD.js +0 -128
- package/dist/ui-textarea.entry-FW32JNDV.js +0 -119
- package/dist/ui-toast-region.entry-BTMFPKZF.js +0 -104
- package/dist/ui-top-bar.entry-5DQGJF3B.js +0 -49
- package/dist/ui-tree-item.entry-ADT7DSOS.js +0 -145
- package/dist/ui-tree.entry-7PYQ5RIN.js +0 -470
- package/editor/chunk-64GLF274.js +0 -1271
- package/layout/index.css +0 -387
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.d.ts +0 -24
- package/loader/index.es2017.js +0 -1
- package/loader/index.js +0 -2
- package/vue/chunk-ROMBQS2L.js +0 -352
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { dispatchDetail } from "../../utils/events";
|
|
3
|
-
import { classifyDropPosition, createHoverIntent, setElementDragImage, } from "../../utils/drag-drop";
|
|
4
|
-
export class UITree {
|
|
5
|
-
host;
|
|
6
|
-
label = 'Tree';
|
|
7
|
-
hoverExpandDelay = 700;
|
|
8
|
-
/** Maximum resulting item depth accepted by pointer reordering. Zero is unlimited. */
|
|
9
|
-
maxDepth = 0;
|
|
10
|
-
source = null;
|
|
11
|
-
target = null;
|
|
12
|
-
position = null;
|
|
13
|
-
rejectedTarget = null;
|
|
14
|
-
rejectedPosition = null;
|
|
15
|
-
rejection = null;
|
|
16
|
-
hoverIntent = null;
|
|
17
|
-
structureObserver = null;
|
|
18
|
-
tabStop = null;
|
|
19
|
-
componentDidLoad() {
|
|
20
|
-
this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
|
|
21
|
-
this.host.addEventListener('dragstart', this.onDragStart);
|
|
22
|
-
this.host.addEventListener('drag', this.onDrag);
|
|
23
|
-
this.host.addEventListener('dragenter', this.onDragOver);
|
|
24
|
-
this.host.addEventListener('dragover', this.onDragOver);
|
|
25
|
-
this.host.addEventListener('dragleave', this.onDragLeave);
|
|
26
|
-
this.host.addEventListener('drop', this.onDrop);
|
|
27
|
-
this.host.addEventListener('dragend', this.onDragEnd);
|
|
28
|
-
this.host.addEventListener('keydown', this.onKeyDown);
|
|
29
|
-
this.host.addEventListener('focusin', this.onFocusIn);
|
|
30
|
-
this.host.addEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
31
|
-
this.syncStructuralLevels();
|
|
32
|
-
this.structureObserver = new MutationObserver(this.syncStructuralLevels);
|
|
33
|
-
this.structureObserver.observe(this.host, { childList: true, subtree: true });
|
|
34
|
-
}
|
|
35
|
-
disconnectedCallback() {
|
|
36
|
-
this.hoverIntent?.destroy();
|
|
37
|
-
this.host.removeEventListener('dragstart', this.onDragStart);
|
|
38
|
-
this.host.removeEventListener('drag', this.onDrag);
|
|
39
|
-
this.host.removeEventListener('dragenter', this.onDragOver);
|
|
40
|
-
this.host.removeEventListener('dragover', this.onDragOver);
|
|
41
|
-
this.host.removeEventListener('dragleave', this.onDragLeave);
|
|
42
|
-
this.host.removeEventListener('drop', this.onDrop);
|
|
43
|
-
this.host.removeEventListener('dragend', this.onDragEnd);
|
|
44
|
-
this.host.removeEventListener('keydown', this.onKeyDown);
|
|
45
|
-
this.host.removeEventListener('focusin', this.onFocusIn);
|
|
46
|
-
this.host.removeEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
47
|
-
this.structureObserver?.disconnect();
|
|
48
|
-
this.structureObserver = null;
|
|
49
|
-
}
|
|
50
|
-
syncStructuralLevels = () => {
|
|
51
|
-
for (const item of Array.from(this.host.querySelectorAll('ui-tree-item'))) {
|
|
52
|
-
item.dispatchEvent(new CustomEvent('ui-tree-structure-sync'));
|
|
53
|
-
}
|
|
54
|
-
this.syncTabStop();
|
|
55
|
-
};
|
|
56
|
-
syncTabStop(preferred) {
|
|
57
|
-
const items = this.visibleItems();
|
|
58
|
-
const next = preferred && items.includes(preferred)
|
|
59
|
-
? preferred
|
|
60
|
-
: this.tabStop && items.includes(this.tabStop)
|
|
61
|
-
? this.tabStop
|
|
62
|
-
: items[0] ?? null;
|
|
63
|
-
this.tabStop = next;
|
|
64
|
-
for (const item of items) {
|
|
65
|
-
item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
|
|
66
|
-
detail: { active: item === next },
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
itemFromEvent(event) {
|
|
71
|
-
return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
|
|
72
|
-
}
|
|
73
|
-
eventTargetsInteractiveContent(event) {
|
|
74
|
-
for (const node of event.composedPath()) {
|
|
75
|
-
if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
|
|
76
|
-
break;
|
|
77
|
-
if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
itemId(item) {
|
|
84
|
-
return item.itemId || item.getAttribute('item-id') || '';
|
|
85
|
-
}
|
|
86
|
-
rowFor(item) {
|
|
87
|
-
return item.shadowRoot?.querySelector('[part="row"]') ?? null;
|
|
88
|
-
}
|
|
89
|
-
itemAtPoint(clientX, clientY) {
|
|
90
|
-
let element = this.host.ownerDocument.elementFromPoint(clientX, clientY);
|
|
91
|
-
while (element) {
|
|
92
|
-
if (element.localName === 'ui-tree-item' && this.host.contains(element)) {
|
|
93
|
-
return element;
|
|
94
|
-
}
|
|
95
|
-
const root = element.getRootNode();
|
|
96
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
isWithinTree(node) {
|
|
101
|
-
let element = node instanceof HTMLElement ? node : null;
|
|
102
|
-
while (element) {
|
|
103
|
-
if (element === this.host || this.host.contains(element))
|
|
104
|
-
return true;
|
|
105
|
-
const root = element.getRootNode();
|
|
106
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
acceptsChildren(item) {
|
|
111
|
-
return Boolean(item.container ?? item.hasAttribute('container'))
|
|
112
|
-
&& !Boolean(item.disabled ?? item.hasAttribute('disabled'));
|
|
113
|
-
}
|
|
114
|
-
itemMetadata(item) {
|
|
115
|
-
return {
|
|
116
|
-
type: item.getAttribute('data-drag-type') || item.getAttribute('drag-type') || 'item',
|
|
117
|
-
scope: item.getAttribute('data-drop-scope') || item.getAttribute('drop-scope') || '',
|
|
118
|
-
accepts: (item.getAttribute('data-accepts') || item.getAttribute('accepts') || '')
|
|
119
|
-
.split(',')
|
|
120
|
-
.map(value => value.trim())
|
|
121
|
-
.filter(Boolean),
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
constraintDepth(item) {
|
|
125
|
-
if (item.dropDepth !== undefined)
|
|
126
|
-
return item.dropDepth;
|
|
127
|
-
const dropDepth = item.getAttribute('drop-depth');
|
|
128
|
-
if (dropDepth !== null)
|
|
129
|
-
return Number(dropDepth);
|
|
130
|
-
return Number(item.getAttribute('aria-level')) || 1;
|
|
131
|
-
}
|
|
132
|
-
subtreeDepth(item) {
|
|
133
|
-
if (item.subtreeDepth !== undefined)
|
|
134
|
-
return Math.max(0, Math.floor(item.subtreeDepth));
|
|
135
|
-
const override = item.getAttribute('subtree-depth');
|
|
136
|
-
if (override !== null)
|
|
137
|
-
return Math.max(0, Math.floor(Number(override)));
|
|
138
|
-
return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
|
|
139
|
-
let nesting = 0;
|
|
140
|
-
let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
|
|
141
|
-
while (ancestor && ancestor !== item) {
|
|
142
|
-
nesting += 1;
|
|
143
|
-
ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
|
|
144
|
-
}
|
|
145
|
-
return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
|
|
146
|
-
}, 0);
|
|
147
|
-
}
|
|
148
|
-
dropRejection(source, target, position) {
|
|
149
|
-
// A tree item can never move into (or beside) one of its own descendants.
|
|
150
|
-
// Reject the target before showing any insertion affordance so the preview
|
|
151
|
-
// stays truthful instead of promising a move the consumer must undo.
|
|
152
|
-
if (source.contains(target))
|
|
153
|
-
return { reason: 'descendant' };
|
|
154
|
-
const sourceMeta = this.itemMetadata(source);
|
|
155
|
-
const targetMeta = this.itemMetadata(target);
|
|
156
|
-
if (position === 'inside') {
|
|
157
|
-
if (!this.acceptsChildren(target)
|
|
158
|
-
|| (targetMeta.accepts.length > 0 && !targetMeta.accepts.includes(sourceMeta.type))) {
|
|
159
|
-
return { reason: 'incompatible' };
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
else if (sourceMeta.type !== targetMeta.type) {
|
|
163
|
-
return { reason: 'incompatible' };
|
|
164
|
-
}
|
|
165
|
-
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
166
|
-
if (maxDepth > 0) {
|
|
167
|
-
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
168
|
-
const subtreeDepth = this.subtreeDepth(source);
|
|
169
|
-
const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
|
|
170
|
-
if (resultingDepth > maxDepth)
|
|
171
|
-
return { reason: 'max-depth', maxDepth, resultingDepth };
|
|
172
|
-
}
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
clearTarget() {
|
|
176
|
-
this.target?.removeAttribute('data-drop-position');
|
|
177
|
-
this.target = null;
|
|
178
|
-
this.position = null;
|
|
179
|
-
this.hoverIntent?.cancel();
|
|
180
|
-
}
|
|
181
|
-
clearRejection() {
|
|
182
|
-
this.rejectedTarget = null;
|
|
183
|
-
this.rejectedPosition = null;
|
|
184
|
-
this.rejection = null;
|
|
185
|
-
}
|
|
186
|
-
finishDrag() {
|
|
187
|
-
this.source?.removeAttribute('data-dragging');
|
|
188
|
-
this.source = null;
|
|
189
|
-
this.clearTarget();
|
|
190
|
-
this.clearRejection();
|
|
191
|
-
}
|
|
192
|
-
expandTarget = (itemId) => {
|
|
193
|
-
const item = Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
194
|
-
.find(candidate => this.itemId(candidate) === itemId);
|
|
195
|
-
if (!item || item.getAttribute('aria-expanded') !== 'false')
|
|
196
|
-
return;
|
|
197
|
-
item.dispatchEvent(new CustomEvent('ui-tree-auto-expand'));
|
|
198
|
-
};
|
|
199
|
-
onDragStart = (event) => {
|
|
200
|
-
const item = this.itemFromEvent(event);
|
|
201
|
-
if (!item || !Boolean(item.sortable ?? item.hasAttribute('sortable'))
|
|
202
|
-
|| Boolean(item.disabled ?? item.hasAttribute('disabled')))
|
|
203
|
-
return;
|
|
204
|
-
const fromHandle = event.composedPath().some(node => (node instanceof HTMLElement && node.getAttribute('part') === 'drag-handle'));
|
|
205
|
-
if (!fromHandle) {
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const sourceId = this.itemId(item);
|
|
210
|
-
const row = this.rowFor(item);
|
|
211
|
-
if (!sourceId || !row) {
|
|
212
|
-
event.preventDefault();
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
this.source = item;
|
|
216
|
-
item.setAttribute('data-dragging', 'true');
|
|
217
|
-
if (event.dataTransfer) {
|
|
218
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
219
|
-
event.dataTransfer.setData('text/plain', sourceId);
|
|
220
|
-
}
|
|
221
|
-
setElementDragImage(event.dataTransfer, row);
|
|
222
|
-
};
|
|
223
|
-
updateTarget(target, clientY, dataTransfer) {
|
|
224
|
-
if (!this.source)
|
|
225
|
-
return false;
|
|
226
|
-
if (!target || target === this.source) {
|
|
227
|
-
this.clearTarget();
|
|
228
|
-
this.clearRejection();
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
const row = this.rowFor(target);
|
|
232
|
-
if (!row)
|
|
233
|
-
return false;
|
|
234
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), clientY, this.acceptsChildren(target));
|
|
235
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
236
|
-
if (rejection) {
|
|
237
|
-
if (dataTransfer)
|
|
238
|
-
dataTransfer.dropEffect = 'none';
|
|
239
|
-
this.clearTarget();
|
|
240
|
-
if (rejection.reason === 'max-depth') {
|
|
241
|
-
this.rejectedTarget = target;
|
|
242
|
-
this.rejectedPosition = position;
|
|
243
|
-
this.rejection = rejection;
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
this.clearRejection();
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
this.clearRejection();
|
|
251
|
-
if (dataTransfer)
|
|
252
|
-
dataTransfer.dropEffect = 'move';
|
|
253
|
-
if (this.target !== target || this.position !== position) {
|
|
254
|
-
this.clearTarget();
|
|
255
|
-
this.target = target;
|
|
256
|
-
this.position = position;
|
|
257
|
-
target.setAttribute('data-drop-position', position);
|
|
258
|
-
}
|
|
259
|
-
if (position === 'inside' && target.getAttribute('aria-expanded') === 'false') {
|
|
260
|
-
this.hoverIntent?.schedule(this.itemId(target));
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
this.hoverIntent?.cancel();
|
|
264
|
-
}
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
onDrag = (event) => {
|
|
268
|
-
if (!this.source || (event.clientX === 0 && event.clientY === 0))
|
|
269
|
-
return;
|
|
270
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
271
|
-
// Native dragenter does not fire when a nested source moves onto an
|
|
272
|
-
// ancestor row: the pointer was already inside that ancestor's host. The
|
|
273
|
-
// source drag event still carries the live pointer coordinates, so use it
|
|
274
|
-
// to keep ancestor/outdent feedback current.
|
|
275
|
-
if (target)
|
|
276
|
-
this.updateTarget(target, event.clientY, event.dataTransfer);
|
|
277
|
-
};
|
|
278
|
-
onDragOver = (event) => {
|
|
279
|
-
if (!this.source)
|
|
280
|
-
return;
|
|
281
|
-
const target = this.itemFromEvent(event);
|
|
282
|
-
if (this.updateTarget(target, event.clientY, event.dataTransfer)) {
|
|
283
|
-
event.preventDefault();
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
onDragLeave = (event) => {
|
|
287
|
-
if (this.isWithinTree(event.relatedTarget))
|
|
288
|
-
return;
|
|
289
|
-
if (this.itemAtPoint(event.clientX, event.clientY))
|
|
290
|
-
return;
|
|
291
|
-
this.clearTarget();
|
|
292
|
-
this.clearRejection();
|
|
293
|
-
};
|
|
294
|
-
dispatchReorder(source, target, position) {
|
|
295
|
-
const sourceId = this.itemId(source);
|
|
296
|
-
const targetId = this.itemId(target);
|
|
297
|
-
if (!sourceId || !targetId)
|
|
298
|
-
return;
|
|
299
|
-
if (position === 'inside')
|
|
300
|
-
this.expandTarget(targetId);
|
|
301
|
-
const sourceMeta = this.itemMetadata(source);
|
|
302
|
-
const targetMeta = this.itemMetadata(target);
|
|
303
|
-
dispatchDetail(this.host, 'reorder', {
|
|
304
|
-
sourceId,
|
|
305
|
-
targetId,
|
|
306
|
-
position,
|
|
307
|
-
sourceType: sourceMeta.type,
|
|
308
|
-
targetType: targetMeta.type,
|
|
309
|
-
sourceScope: sourceMeta.scope,
|
|
310
|
-
targetScope: targetMeta.scope,
|
|
311
|
-
trigger: 'pointer',
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
dispatchReorderRejected(source, target, position, rejection) {
|
|
315
|
-
const sourceId = this.itemId(source);
|
|
316
|
-
const targetId = this.itemId(target);
|
|
317
|
-
if (!sourceId || !targetId)
|
|
318
|
-
return;
|
|
319
|
-
dispatchDetail(this.host, 'reorder-rejected', {
|
|
320
|
-
sourceId,
|
|
321
|
-
targetId,
|
|
322
|
-
position,
|
|
323
|
-
reason: 'max-depth',
|
|
324
|
-
maxDepth: rejection.maxDepth,
|
|
325
|
-
resultingDepth: rejection.resultingDepth,
|
|
326
|
-
trigger: 'pointer',
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
onDrop = (event) => {
|
|
330
|
-
if (!this.source || !this.target || !this.position)
|
|
331
|
-
return;
|
|
332
|
-
event.preventDefault();
|
|
333
|
-
this.dispatchReorder(this.source, this.target, this.position);
|
|
334
|
-
this.finishDrag();
|
|
335
|
-
};
|
|
336
|
-
onDragEnd = (event) => {
|
|
337
|
-
if (this.source) {
|
|
338
|
-
if (this.rejectedTarget && this.rejectedPosition && this.rejection) {
|
|
339
|
-
this.dispatchReorderRejected(this.source, this.rejectedTarget, this.rejectedPosition, this.rejection);
|
|
340
|
-
this.finishDrag();
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
344
|
-
if (target && target !== this.source) {
|
|
345
|
-
const row = this.rowFor(target);
|
|
346
|
-
if (row) {
|
|
347
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), event.clientY, this.acceptsChildren(target));
|
|
348
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
349
|
-
if (!rejection) {
|
|
350
|
-
this.dispatchReorder(this.source, target, position);
|
|
351
|
-
}
|
|
352
|
-
else if (rejection.reason === 'max-depth') {
|
|
353
|
-
this.dispatchReorderRejected(this.source, target, position, rejection);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
this.finishDrag();
|
|
359
|
-
};
|
|
360
|
-
visibleItems() {
|
|
361
|
-
return Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
362
|
-
.filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
|
|
363
|
-
}
|
|
364
|
-
parentItem(item) {
|
|
365
|
-
const parent = item.parentElement?.closest('ui-tree-item') ?? null;
|
|
366
|
-
return parent && this.host.contains(parent) ? parent : null;
|
|
367
|
-
}
|
|
368
|
-
firstVisibleChild(item, items) {
|
|
369
|
-
return items.find(candidate => this.parentItem(candidate) === item) ?? null;
|
|
370
|
-
}
|
|
371
|
-
focusItem(item) {
|
|
372
|
-
this.syncTabStop(item);
|
|
373
|
-
item.focus();
|
|
374
|
-
}
|
|
375
|
-
requestExpansion(item, expanded) {
|
|
376
|
-
item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
|
|
377
|
-
detail: { expanded, trigger: 'keyboard' },
|
|
378
|
-
}));
|
|
379
|
-
}
|
|
380
|
-
onFocusIn = (event) => {
|
|
381
|
-
if (this.eventTargetsInteractiveContent(event))
|
|
382
|
-
return;
|
|
383
|
-
const item = this.itemFromEvent(event);
|
|
384
|
-
if (item)
|
|
385
|
-
this.syncTabStop(item);
|
|
386
|
-
};
|
|
387
|
-
onExpansionChange = () => {
|
|
388
|
-
requestAnimationFrame(() => this.syncTabStop());
|
|
389
|
-
};
|
|
390
|
-
onKeyDown = (event) => {
|
|
391
|
-
if (this.eventTargetsInteractiveContent(event))
|
|
392
|
-
return;
|
|
393
|
-
const current = this.itemFromEvent(event);
|
|
394
|
-
if (!current)
|
|
395
|
-
return;
|
|
396
|
-
const items = this.visibleItems();
|
|
397
|
-
const index = items.indexOf(current);
|
|
398
|
-
if (index < 0)
|
|
399
|
-
return;
|
|
400
|
-
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
401
|
-
: event.key === 'ArrowUp' ? items[index - 1]
|
|
402
|
-
: event.key === 'Home' ? items[0]
|
|
403
|
-
: event.key === 'End' ? items.at(-1)
|
|
404
|
-
: null;
|
|
405
|
-
if (next) {
|
|
406
|
-
event.preventDefault();
|
|
407
|
-
this.focusItem(next);
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
if (event.key === 'ArrowLeft') {
|
|
411
|
-
if (current.getAttribute('aria-expanded') === 'true') {
|
|
412
|
-
event.preventDefault();
|
|
413
|
-
this.requestExpansion(current, false);
|
|
414
|
-
}
|
|
415
|
-
else if (this.parentItem(current)) {
|
|
416
|
-
event.preventDefault();
|
|
417
|
-
this.focusItem(this.parentItem(current));
|
|
418
|
-
}
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
if (event.key === 'ArrowRight') {
|
|
422
|
-
if (current.getAttribute('aria-expanded') === 'false') {
|
|
423
|
-
event.preventDefault();
|
|
424
|
-
this.requestExpansion(current, true);
|
|
425
|
-
}
|
|
426
|
-
else if (current.getAttribute('aria-expanded') === 'true') {
|
|
427
|
-
const child = this.firstVisibleChild(current, items);
|
|
428
|
-
if (child) {
|
|
429
|
-
event.preventDefault();
|
|
430
|
-
this.focusItem(child);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
render() {
|
|
436
|
-
return (h(Host, { key: 'bae06665078a67c59db2d9e72c7dea6ddeeb9e56', role: "tree", "aria-label": this.label || 'Tree' }, h("slot", { key: '232cb02f1a50bc5e18a92c0d8677e917870ec75e' })));
|
|
437
|
-
}
|
|
438
|
-
static get is() { return "ui-tree"; }
|
|
439
|
-
static get encapsulation() { return "shadow"; }
|
|
440
|
-
static get originalStyleUrls() {
|
|
441
|
-
return {
|
|
442
|
-
"$": ["ui-tree.css"]
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
static get styleUrls() {
|
|
446
|
-
return {
|
|
447
|
-
"$": ["ui-tree.css"]
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
static get properties() {
|
|
451
|
-
return {
|
|
452
|
-
"label": {
|
|
453
|
-
"type": "string",
|
|
454
|
-
"mutable": false,
|
|
455
|
-
"complexType": {
|
|
456
|
-
"original": "string",
|
|
457
|
-
"resolved": "string",
|
|
458
|
-
"references": {}
|
|
459
|
-
},
|
|
460
|
-
"required": false,
|
|
461
|
-
"optional": false,
|
|
462
|
-
"docs": {
|
|
463
|
-
"tags": [],
|
|
464
|
-
"text": ""
|
|
465
|
-
},
|
|
466
|
-
"getter": false,
|
|
467
|
-
"setter": false,
|
|
468
|
-
"reflect": false,
|
|
469
|
-
"attribute": "label",
|
|
470
|
-
"defaultValue": "'Tree'"
|
|
471
|
-
},
|
|
472
|
-
"hoverExpandDelay": {
|
|
473
|
-
"type": "number",
|
|
474
|
-
"mutable": false,
|
|
475
|
-
"complexType": {
|
|
476
|
-
"original": "number",
|
|
477
|
-
"resolved": "number",
|
|
478
|
-
"references": {}
|
|
479
|
-
},
|
|
480
|
-
"required": false,
|
|
481
|
-
"optional": false,
|
|
482
|
-
"docs": {
|
|
483
|
-
"tags": [],
|
|
484
|
-
"text": ""
|
|
485
|
-
},
|
|
486
|
-
"getter": false,
|
|
487
|
-
"setter": false,
|
|
488
|
-
"reflect": false,
|
|
489
|
-
"attribute": "hover-expand-delay",
|
|
490
|
-
"defaultValue": "700"
|
|
491
|
-
},
|
|
492
|
-
"maxDepth": {
|
|
493
|
-
"type": "number",
|
|
494
|
-
"mutable": false,
|
|
495
|
-
"complexType": {
|
|
496
|
-
"original": "number",
|
|
497
|
-
"resolved": "number",
|
|
498
|
-
"references": {}
|
|
499
|
-
},
|
|
500
|
-
"required": false,
|
|
501
|
-
"optional": false,
|
|
502
|
-
"docs": {
|
|
503
|
-
"tags": [],
|
|
504
|
-
"text": "Maximum resulting item depth accepted by pointer reordering. Zero is unlimited."
|
|
505
|
-
},
|
|
506
|
-
"getter": false,
|
|
507
|
-
"setter": false,
|
|
508
|
-
"reflect": false,
|
|
509
|
-
"attribute": "max-depth",
|
|
510
|
-
"defaultValue": "0"
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
static get elementRef() { return "host"; }
|
|
515
|
-
}
|