@threadlabs/looma 0.2.5 → 0.2.7
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-3HMMDK27.js +2914 -0
- package/dist/chunk-3K45IWIJ.js +4733 -0
- package/dist/chunk-MLKGABMK.js +9 -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 +2942 -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 +7478 -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 +7652 -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/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,470 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dispatchDetail
|
|
3
|
-
} from "./chunk-UL7UIUJZ.js";
|
|
4
|
-
import {
|
|
5
|
-
Host,
|
|
6
|
-
getElement,
|
|
7
|
-
h,
|
|
8
|
-
registerInstance
|
|
9
|
-
} from "./chunk-24OTMNIU.js";
|
|
10
|
-
|
|
11
|
-
// dist/esm/ui-tree.entry.js
|
|
12
|
-
function classifyDropPosition(rect, clientY, acceptsChildren) {
|
|
13
|
-
const progress = rect.height > 0 ? Math.min(1, Math.max(0, (clientY - rect.top) / rect.height)) : 0.5;
|
|
14
|
-
if (!acceptsChildren)
|
|
15
|
-
return progress < 0.5 ? "before" : "after";
|
|
16
|
-
if (progress < 0.25)
|
|
17
|
-
return "before";
|
|
18
|
-
if (progress > 0.75)
|
|
19
|
-
return "after";
|
|
20
|
-
return "inside";
|
|
21
|
-
}
|
|
22
|
-
function setElementDragImage(dataTransfer, element) {
|
|
23
|
-
if (!dataTransfer || typeof dataTransfer.setDragImage !== "function")
|
|
24
|
-
return;
|
|
25
|
-
const { height } = element.getBoundingClientRect();
|
|
26
|
-
dataTransfer.setDragImage(element, 16, Math.max(0, height / 2));
|
|
27
|
-
}
|
|
28
|
-
function createHoverIntent(delay, onIntent) {
|
|
29
|
-
let timer;
|
|
30
|
-
let pendingKey;
|
|
31
|
-
function cancel() {
|
|
32
|
-
if (timer)
|
|
33
|
-
clearTimeout(timer);
|
|
34
|
-
timer = void 0;
|
|
35
|
-
pendingKey = void 0;
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
schedule(key) {
|
|
39
|
-
if (pendingKey === key && timer)
|
|
40
|
-
return;
|
|
41
|
-
cancel();
|
|
42
|
-
pendingKey = key;
|
|
43
|
-
timer = setTimeout(() => {
|
|
44
|
-
timer = void 0;
|
|
45
|
-
const resolvedKey = pendingKey;
|
|
46
|
-
pendingKey = void 0;
|
|
47
|
-
if (resolvedKey)
|
|
48
|
-
onIntent(resolvedKey);
|
|
49
|
-
}, Math.max(0, delay));
|
|
50
|
-
},
|
|
51
|
-
cancel,
|
|
52
|
-
destroy: cancel
|
|
53
|
-
};
|
|
54
|
-
}
|
|
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
|
-
var UITree = class {
|
|
57
|
-
constructor(hostRef) {
|
|
58
|
-
registerInstance(this, hostRef);
|
|
59
|
-
}
|
|
60
|
-
get host() {
|
|
61
|
-
return getElement(this);
|
|
62
|
-
}
|
|
63
|
-
label = "Tree";
|
|
64
|
-
hoverExpandDelay = 700;
|
|
65
|
-
/** Maximum resulting item depth accepted by pointer reordering. Zero is unlimited. */
|
|
66
|
-
maxDepth = 0;
|
|
67
|
-
source = null;
|
|
68
|
-
target = null;
|
|
69
|
-
position = null;
|
|
70
|
-
rejectedTarget = null;
|
|
71
|
-
rejectedPosition = null;
|
|
72
|
-
rejection = null;
|
|
73
|
-
hoverIntent = null;
|
|
74
|
-
structureObserver = null;
|
|
75
|
-
tabStop = null;
|
|
76
|
-
componentDidLoad() {
|
|
77
|
-
this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
|
|
78
|
-
this.host.addEventListener("dragstart", this.onDragStart);
|
|
79
|
-
this.host.addEventListener("drag", this.onDrag);
|
|
80
|
-
this.host.addEventListener("dragenter", this.onDragOver);
|
|
81
|
-
this.host.addEventListener("dragover", this.onDragOver);
|
|
82
|
-
this.host.addEventListener("dragleave", this.onDragLeave);
|
|
83
|
-
this.host.addEventListener("drop", this.onDrop);
|
|
84
|
-
this.host.addEventListener("dragend", this.onDragEnd);
|
|
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 });
|
|
91
|
-
}
|
|
92
|
-
disconnectedCallback() {
|
|
93
|
-
this.hoverIntent?.destroy();
|
|
94
|
-
this.host.removeEventListener("dragstart", this.onDragStart);
|
|
95
|
-
this.host.removeEventListener("drag", this.onDrag);
|
|
96
|
-
this.host.removeEventListener("dragenter", this.onDragOver);
|
|
97
|
-
this.host.removeEventListener("dragover", this.onDragOver);
|
|
98
|
-
this.host.removeEventListener("dragleave", this.onDragLeave);
|
|
99
|
-
this.host.removeEventListener("drop", this.onDrop);
|
|
100
|
-
this.host.removeEventListener("dragend", this.onDragEnd);
|
|
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
|
-
}
|
|
122
|
-
}
|
|
123
|
-
itemFromEvent(event) {
|
|
124
|
-
return event.composedPath().find((node) => node instanceof HTMLElement && node.localName === "ui-tree-item") ?? null;
|
|
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
|
-
}
|
|
136
|
-
itemId(item) {
|
|
137
|
-
return item.itemId || item.getAttribute("item-id") || "";
|
|
138
|
-
}
|
|
139
|
-
rowFor(item) {
|
|
140
|
-
return item.shadowRoot?.querySelector('[part="row"]') ?? null;
|
|
141
|
-
}
|
|
142
|
-
itemAtPoint(clientX, clientY) {
|
|
143
|
-
let element = this.host.ownerDocument.elementFromPoint(clientX, clientY);
|
|
144
|
-
while (element) {
|
|
145
|
-
if (element.localName === "ui-tree-item" && this.host.contains(element)) {
|
|
146
|
-
return element;
|
|
147
|
-
}
|
|
148
|
-
const root = element.getRootNode();
|
|
149
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
isWithinTree(node) {
|
|
154
|
-
let element = node instanceof HTMLElement ? node : null;
|
|
155
|
-
while (element) {
|
|
156
|
-
if (element === this.host || this.host.contains(element))
|
|
157
|
-
return true;
|
|
158
|
-
const root = element.getRootNode();
|
|
159
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
160
|
-
}
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
acceptsChildren(item) {
|
|
164
|
-
return Boolean(item.container ?? item.hasAttribute("container")) && !Boolean(item.disabled ?? item.hasAttribute("disabled"));
|
|
165
|
-
}
|
|
166
|
-
itemMetadata(item) {
|
|
167
|
-
return {
|
|
168
|
-
type: item.getAttribute("data-drag-type") || item.getAttribute("drag-type") || "item",
|
|
169
|
-
scope: item.getAttribute("data-drop-scope") || item.getAttribute("drop-scope") || "",
|
|
170
|
-
accepts: (item.getAttribute("data-accepts") || item.getAttribute("accepts") || "").split(",").map((value) => value.trim()).filter(Boolean)
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
constraintDepth(item) {
|
|
174
|
-
if (item.dropDepth !== void 0)
|
|
175
|
-
return item.dropDepth;
|
|
176
|
-
const dropDepth = item.getAttribute("drop-depth");
|
|
177
|
-
if (dropDepth !== null)
|
|
178
|
-
return Number(dropDepth);
|
|
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);
|
|
196
|
-
}
|
|
197
|
-
dropRejection(source, target, position) {
|
|
198
|
-
if (source.contains(target))
|
|
199
|
-
return { reason: "descendant" };
|
|
200
|
-
const sourceMeta = this.itemMetadata(source);
|
|
201
|
-
const targetMeta = this.itemMetadata(target);
|
|
202
|
-
if (position === "inside") {
|
|
203
|
-
if (!this.acceptsChildren(target) || targetMeta.accepts.length > 0 && !targetMeta.accepts.includes(sourceMeta.type)) {
|
|
204
|
-
return { reason: "incompatible" };
|
|
205
|
-
}
|
|
206
|
-
} else if (sourceMeta.type !== targetMeta.type) {
|
|
207
|
-
return { reason: "incompatible" };
|
|
208
|
-
}
|
|
209
|
-
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
210
|
-
if (maxDepth > 0) {
|
|
211
|
-
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
212
|
-
const subtreeDepth = this.subtreeDepth(source);
|
|
213
|
-
const resultingDepth = targetDepth + (position === "inside" ? 1 : 0) + subtreeDepth;
|
|
214
|
-
if (resultingDepth > maxDepth)
|
|
215
|
-
return { reason: "max-depth", maxDepth, resultingDepth };
|
|
216
|
-
}
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
clearTarget() {
|
|
220
|
-
this.target?.removeAttribute("data-drop-position");
|
|
221
|
-
this.target = null;
|
|
222
|
-
this.position = null;
|
|
223
|
-
this.hoverIntent?.cancel();
|
|
224
|
-
}
|
|
225
|
-
clearRejection() {
|
|
226
|
-
this.rejectedTarget = null;
|
|
227
|
-
this.rejectedPosition = null;
|
|
228
|
-
this.rejection = null;
|
|
229
|
-
}
|
|
230
|
-
finishDrag() {
|
|
231
|
-
this.source?.removeAttribute("data-dragging");
|
|
232
|
-
this.source = null;
|
|
233
|
-
this.clearTarget();
|
|
234
|
-
this.clearRejection();
|
|
235
|
-
}
|
|
236
|
-
expandTarget = (itemId) => {
|
|
237
|
-
const item = Array.from(this.host.querySelectorAll("ui-tree-item")).find((candidate) => this.itemId(candidate) === itemId);
|
|
238
|
-
if (!item || item.getAttribute("aria-expanded") !== "false")
|
|
239
|
-
return;
|
|
240
|
-
item.dispatchEvent(new CustomEvent("ui-tree-auto-expand"));
|
|
241
|
-
};
|
|
242
|
-
onDragStart = (event) => {
|
|
243
|
-
const item = this.itemFromEvent(event);
|
|
244
|
-
if (!item || !Boolean(item.sortable ?? item.hasAttribute("sortable")) || Boolean(item.disabled ?? item.hasAttribute("disabled")))
|
|
245
|
-
return;
|
|
246
|
-
const fromHandle = event.composedPath().some((node) => node instanceof HTMLElement && node.getAttribute("part") === "drag-handle");
|
|
247
|
-
if (!fromHandle) {
|
|
248
|
-
event.preventDefault();
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const sourceId = this.itemId(item);
|
|
252
|
-
const row = this.rowFor(item);
|
|
253
|
-
if (!sourceId || !row) {
|
|
254
|
-
event.preventDefault();
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
this.source = item;
|
|
258
|
-
item.setAttribute("data-dragging", "true");
|
|
259
|
-
if (event.dataTransfer) {
|
|
260
|
-
event.dataTransfer.effectAllowed = "move";
|
|
261
|
-
event.dataTransfer.setData("text/plain", sourceId);
|
|
262
|
-
}
|
|
263
|
-
setElementDragImage(event.dataTransfer, row);
|
|
264
|
-
};
|
|
265
|
-
updateTarget(target, clientY, dataTransfer) {
|
|
266
|
-
if (!this.source)
|
|
267
|
-
return false;
|
|
268
|
-
if (!target || target === this.source) {
|
|
269
|
-
this.clearTarget();
|
|
270
|
-
this.clearRejection();
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
const row = this.rowFor(target);
|
|
274
|
-
if (!row)
|
|
275
|
-
return false;
|
|
276
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), clientY, this.acceptsChildren(target));
|
|
277
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
278
|
-
if (rejection) {
|
|
279
|
-
if (dataTransfer)
|
|
280
|
-
dataTransfer.dropEffect = "none";
|
|
281
|
-
this.clearTarget();
|
|
282
|
-
if (rejection.reason === "max-depth") {
|
|
283
|
-
this.rejectedTarget = target;
|
|
284
|
-
this.rejectedPosition = position;
|
|
285
|
-
this.rejection = rejection;
|
|
286
|
-
} else {
|
|
287
|
-
this.clearRejection();
|
|
288
|
-
}
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
this.clearRejection();
|
|
292
|
-
if (dataTransfer)
|
|
293
|
-
dataTransfer.dropEffect = "move";
|
|
294
|
-
if (this.target !== target || this.position !== position) {
|
|
295
|
-
this.clearTarget();
|
|
296
|
-
this.target = target;
|
|
297
|
-
this.position = position;
|
|
298
|
-
target.setAttribute("data-drop-position", position);
|
|
299
|
-
}
|
|
300
|
-
if (position === "inside" && target.getAttribute("aria-expanded") === "false") {
|
|
301
|
-
this.hoverIntent?.schedule(this.itemId(target));
|
|
302
|
-
} else {
|
|
303
|
-
this.hoverIntent?.cancel();
|
|
304
|
-
}
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
onDrag = (event) => {
|
|
308
|
-
if (!this.source || event.clientX === 0 && event.clientY === 0)
|
|
309
|
-
return;
|
|
310
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
311
|
-
if (target)
|
|
312
|
-
this.updateTarget(target, event.clientY, event.dataTransfer);
|
|
313
|
-
};
|
|
314
|
-
onDragOver = (event) => {
|
|
315
|
-
if (!this.source)
|
|
316
|
-
return;
|
|
317
|
-
const target = this.itemFromEvent(event);
|
|
318
|
-
if (this.updateTarget(target, event.clientY, event.dataTransfer)) {
|
|
319
|
-
event.preventDefault();
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
onDragLeave = (event) => {
|
|
323
|
-
if (this.isWithinTree(event.relatedTarget))
|
|
324
|
-
return;
|
|
325
|
-
if (this.itemAtPoint(event.clientX, event.clientY))
|
|
326
|
-
return;
|
|
327
|
-
this.clearTarget();
|
|
328
|
-
this.clearRejection();
|
|
329
|
-
};
|
|
330
|
-
dispatchReorder(source, target, position) {
|
|
331
|
-
const sourceId = this.itemId(source);
|
|
332
|
-
const targetId = this.itemId(target);
|
|
333
|
-
if (!sourceId || !targetId)
|
|
334
|
-
return;
|
|
335
|
-
if (position === "inside")
|
|
336
|
-
this.expandTarget(targetId);
|
|
337
|
-
const sourceMeta = this.itemMetadata(source);
|
|
338
|
-
const targetMeta = this.itemMetadata(target);
|
|
339
|
-
dispatchDetail(this.host, "reorder", {
|
|
340
|
-
sourceId,
|
|
341
|
-
targetId,
|
|
342
|
-
position,
|
|
343
|
-
sourceType: sourceMeta.type,
|
|
344
|
-
targetType: targetMeta.type,
|
|
345
|
-
sourceScope: sourceMeta.scope,
|
|
346
|
-
targetScope: targetMeta.scope,
|
|
347
|
-
trigger: "pointer"
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
dispatchReorderRejected(source, target, position, rejection) {
|
|
351
|
-
const sourceId = this.itemId(source);
|
|
352
|
-
const targetId = this.itemId(target);
|
|
353
|
-
if (!sourceId || !targetId)
|
|
354
|
-
return;
|
|
355
|
-
dispatchDetail(this.host, "reorder-rejected", {
|
|
356
|
-
sourceId,
|
|
357
|
-
targetId,
|
|
358
|
-
position,
|
|
359
|
-
reason: "max-depth",
|
|
360
|
-
maxDepth: rejection.maxDepth,
|
|
361
|
-
resultingDepth: rejection.resultingDepth,
|
|
362
|
-
trigger: "pointer"
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
onDrop = (event) => {
|
|
366
|
-
if (!this.source || !this.target || !this.position)
|
|
367
|
-
return;
|
|
368
|
-
event.preventDefault();
|
|
369
|
-
this.dispatchReorder(this.source, this.target, this.position);
|
|
370
|
-
this.finishDrag();
|
|
371
|
-
};
|
|
372
|
-
onDragEnd = (event) => {
|
|
373
|
-
if (this.source) {
|
|
374
|
-
if (this.rejectedTarget && this.rejectedPosition && this.rejection) {
|
|
375
|
-
this.dispatchReorderRejected(this.source, this.rejectedTarget, this.rejectedPosition, this.rejection);
|
|
376
|
-
this.finishDrag();
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
380
|
-
if (target && target !== this.source) {
|
|
381
|
-
const row = this.rowFor(target);
|
|
382
|
-
if (row) {
|
|
383
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), event.clientY, this.acceptsChildren(target));
|
|
384
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
385
|
-
if (!rejection) {
|
|
386
|
-
this.dispatchReorder(this.source, target, position);
|
|
387
|
-
} else if (rejection.reason === "max-depth") {
|
|
388
|
-
this.dispatchReorderRejected(this.source, target, position, rejection);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
this.finishDrag();
|
|
394
|
-
};
|
|
395
|
-
visibleItems() {
|
|
396
|
-
return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((item) => item.getClientRects().length > 0 && !item.hasAttribute("disabled"));
|
|
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
|
-
};
|
|
424
|
-
onKeyDown = (event) => {
|
|
425
|
-
if (this.eventTargetsInteractiveContent(event))
|
|
426
|
-
return;
|
|
427
|
-
const current = this.itemFromEvent(event);
|
|
428
|
-
if (!current)
|
|
429
|
-
return;
|
|
430
|
-
const items = this.visibleItems();
|
|
431
|
-
const index = items.indexOf(current);
|
|
432
|
-
if (index < 0)
|
|
433
|
-
return;
|
|
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);
|
|
438
|
-
return;
|
|
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
|
-
}
|
|
462
|
-
};
|
|
463
|
-
render() {
|
|
464
|
-
return h(Host, { key: "bae06665078a67c59db2d9e72c7dea6ddeeb9e56", role: "tree", "aria-label": this.label || "Tree" }, h("slot", { key: "232cb02f1a50bc5e18a92c0d8677e917870ec75e" }));
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
UITree.style = uiTreeCss();
|
|
468
|
-
export {
|
|
469
|
-
UITree as ui_tree
|
|
470
|
-
};
|