@threadlabs/looma 0.2.5 → 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/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,498 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
-
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Classify the pointer against stable edge bands. Containers reserve their
|
|
6
|
-
* middle half for containment; leaf rows split cleanly at their midpoint.
|
|
7
|
-
*/
|
|
8
|
-
function classifyDropPosition(rect, clientY, acceptsChildren) {
|
|
9
|
-
const progress = rect.height > 0
|
|
10
|
-
? Math.min(1, Math.max(0, (clientY - rect.top) / rect.height))
|
|
11
|
-
: 0.5;
|
|
12
|
-
if (!acceptsChildren)
|
|
13
|
-
return progress < 0.5 ? 'before' : 'after';
|
|
14
|
-
if (progress < 0.25)
|
|
15
|
-
return 'before';
|
|
16
|
-
if (progress > 0.75)
|
|
17
|
-
return 'after';
|
|
18
|
-
return 'inside';
|
|
19
|
-
}
|
|
20
|
-
/** Use the rendered row—not the tiny handle—as the browser drag preview. */
|
|
21
|
-
function setElementDragImage(dataTransfer, element) {
|
|
22
|
-
if (!dataTransfer || typeof dataTransfer.setDragImage !== 'function')
|
|
23
|
-
return;
|
|
24
|
-
const { height } = element.getBoundingClientRect();
|
|
25
|
-
dataTransfer.setDragImage(element, 16, Math.max(0, height / 2));
|
|
26
|
-
}
|
|
27
|
-
/** A keyed, replaceable hover timer suitable for expansion and disclosure intent. */
|
|
28
|
-
function createHoverIntent(delay, onIntent) {
|
|
29
|
-
let timer;
|
|
30
|
-
let pendingKey;
|
|
31
|
-
function cancel() {
|
|
32
|
-
if (timer)
|
|
33
|
-
clearTimeout(timer);
|
|
34
|
-
timer = undefined;
|
|
35
|
-
pendingKey = undefined;
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
schedule(key) {
|
|
39
|
-
if (pendingKey === key && timer)
|
|
40
|
-
return;
|
|
41
|
-
cancel();
|
|
42
|
-
pendingKey = key;
|
|
43
|
-
timer = setTimeout(() => {
|
|
44
|
-
timer = undefined;
|
|
45
|
-
const resolvedKey = pendingKey;
|
|
46
|
-
pendingKey = undefined;
|
|
47
|
-
if (resolvedKey)
|
|
48
|
-
onIntent(resolvedKey);
|
|
49
|
-
}, Math.max(0, delay));
|
|
50
|
-
},
|
|
51
|
-
cancel,
|
|
52
|
-
destroy: cancel,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const 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}`;
|
|
57
|
-
|
|
58
|
-
const UITree = class {
|
|
59
|
-
constructor(hostRef) {
|
|
60
|
-
registerInstance(this, hostRef);
|
|
61
|
-
}
|
|
62
|
-
get host() { return getElement(this); }
|
|
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)
|
|
116
|
-
? preferred
|
|
117
|
-
: this.tabStop && items.includes(this.tabStop)
|
|
118
|
-
? this.tabStop
|
|
119
|
-
: items[0] ?? null;
|
|
120
|
-
this.tabStop = next;
|
|
121
|
-
for (const item of items) {
|
|
122
|
-
item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
|
|
123
|
-
detail: { active: item === next },
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
itemFromEvent(event) {
|
|
128
|
-
return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
|
|
129
|
-
}
|
|
130
|
-
eventTargetsInteractiveContent(event) {
|
|
131
|
-
for (const node of event.composedPath()) {
|
|
132
|
-
if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
|
|
133
|
-
break;
|
|
134
|
-
if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
itemId(item) {
|
|
141
|
-
return item.itemId || item.getAttribute('item-id') || '';
|
|
142
|
-
}
|
|
143
|
-
rowFor(item) {
|
|
144
|
-
return item.shadowRoot?.querySelector('[part="row"]') ?? null;
|
|
145
|
-
}
|
|
146
|
-
itemAtPoint(clientX, clientY) {
|
|
147
|
-
let element = this.host.ownerDocument.elementFromPoint(clientX, clientY);
|
|
148
|
-
while (element) {
|
|
149
|
-
if (element.localName === 'ui-tree-item' && this.host.contains(element)) {
|
|
150
|
-
return element;
|
|
151
|
-
}
|
|
152
|
-
const root = element.getRootNode();
|
|
153
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
isWithinTree(node) {
|
|
158
|
-
let element = node instanceof HTMLElement ? node : null;
|
|
159
|
-
while (element) {
|
|
160
|
-
if (element === this.host || this.host.contains(element))
|
|
161
|
-
return true;
|
|
162
|
-
const root = element.getRootNode();
|
|
163
|
-
element = root instanceof ShadowRoot ? root.host : element.parentElement;
|
|
164
|
-
}
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
acceptsChildren(item) {
|
|
168
|
-
return Boolean(item.container ?? item.hasAttribute('container'))
|
|
169
|
-
&& !Boolean(item.disabled ?? item.hasAttribute('disabled'));
|
|
170
|
-
}
|
|
171
|
-
itemMetadata(item) {
|
|
172
|
-
return {
|
|
173
|
-
type: item.getAttribute('data-drag-type') || item.getAttribute('drag-type') || 'item',
|
|
174
|
-
scope: item.getAttribute('data-drop-scope') || item.getAttribute('drop-scope') || '',
|
|
175
|
-
accepts: (item.getAttribute('data-accepts') || item.getAttribute('accepts') || '')
|
|
176
|
-
.split(',')
|
|
177
|
-
.map(value => value.trim())
|
|
178
|
-
.filter(Boolean),
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
constraintDepth(item) {
|
|
182
|
-
if (item.dropDepth !== undefined)
|
|
183
|
-
return item.dropDepth;
|
|
184
|
-
const dropDepth = item.getAttribute('drop-depth');
|
|
185
|
-
if (dropDepth !== null)
|
|
186
|
-
return Number(dropDepth);
|
|
187
|
-
return Number(item.getAttribute('aria-level')) || 1;
|
|
188
|
-
}
|
|
189
|
-
subtreeDepth(item) {
|
|
190
|
-
if (item.subtreeDepth !== undefined)
|
|
191
|
-
return Math.max(0, Math.floor(item.subtreeDepth));
|
|
192
|
-
const override = item.getAttribute('subtree-depth');
|
|
193
|
-
if (override !== null)
|
|
194
|
-
return Math.max(0, Math.floor(Number(override)));
|
|
195
|
-
return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
|
|
196
|
-
let nesting = 0;
|
|
197
|
-
let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
|
|
198
|
-
while (ancestor && ancestor !== item) {
|
|
199
|
-
nesting += 1;
|
|
200
|
-
ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
|
|
201
|
-
}
|
|
202
|
-
return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
|
|
203
|
-
}, 0);
|
|
204
|
-
}
|
|
205
|
-
dropRejection(source, target, position) {
|
|
206
|
-
// A tree item can never move into (or beside) one of its own descendants.
|
|
207
|
-
// Reject the target before showing any insertion affordance so the preview
|
|
208
|
-
// stays truthful instead of promising a move the consumer must undo.
|
|
209
|
-
if (source.contains(target))
|
|
210
|
-
return { reason: 'descendant' };
|
|
211
|
-
const sourceMeta = this.itemMetadata(source);
|
|
212
|
-
const targetMeta = this.itemMetadata(target);
|
|
213
|
-
if (position === 'inside') {
|
|
214
|
-
if (!this.acceptsChildren(target)
|
|
215
|
-
|| (targetMeta.accepts.length > 0 && !targetMeta.accepts.includes(sourceMeta.type))) {
|
|
216
|
-
return { reason: 'incompatible' };
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
else if (sourceMeta.type !== targetMeta.type) {
|
|
220
|
-
return { reason: 'incompatible' };
|
|
221
|
-
}
|
|
222
|
-
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
223
|
-
if (maxDepth > 0) {
|
|
224
|
-
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
225
|
-
const subtreeDepth = this.subtreeDepth(source);
|
|
226
|
-
const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
|
|
227
|
-
if (resultingDepth > maxDepth)
|
|
228
|
-
return { reason: 'max-depth', maxDepth, resultingDepth };
|
|
229
|
-
}
|
|
230
|
-
return null;
|
|
231
|
-
}
|
|
232
|
-
clearTarget() {
|
|
233
|
-
this.target?.removeAttribute('data-drop-position');
|
|
234
|
-
this.target = null;
|
|
235
|
-
this.position = null;
|
|
236
|
-
this.hoverIntent?.cancel();
|
|
237
|
-
}
|
|
238
|
-
clearRejection() {
|
|
239
|
-
this.rejectedTarget = null;
|
|
240
|
-
this.rejectedPosition = null;
|
|
241
|
-
this.rejection = null;
|
|
242
|
-
}
|
|
243
|
-
finishDrag() {
|
|
244
|
-
this.source?.removeAttribute('data-dragging');
|
|
245
|
-
this.source = null;
|
|
246
|
-
this.clearTarget();
|
|
247
|
-
this.clearRejection();
|
|
248
|
-
}
|
|
249
|
-
expandTarget = (itemId) => {
|
|
250
|
-
const item = Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
251
|
-
.find(candidate => this.itemId(candidate) === itemId);
|
|
252
|
-
if (!item || item.getAttribute('aria-expanded') !== 'false')
|
|
253
|
-
return;
|
|
254
|
-
item.dispatchEvent(new CustomEvent('ui-tree-auto-expand'));
|
|
255
|
-
};
|
|
256
|
-
onDragStart = (event) => {
|
|
257
|
-
const item = this.itemFromEvent(event);
|
|
258
|
-
if (!item || !Boolean(item.sortable ?? item.hasAttribute('sortable'))
|
|
259
|
-
|| Boolean(item.disabled ?? item.hasAttribute('disabled')))
|
|
260
|
-
return;
|
|
261
|
-
const fromHandle = event.composedPath().some(node => (node instanceof HTMLElement && node.getAttribute('part') === 'drag-handle'));
|
|
262
|
-
if (!fromHandle) {
|
|
263
|
-
event.preventDefault();
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const sourceId = this.itemId(item);
|
|
267
|
-
const row = this.rowFor(item);
|
|
268
|
-
if (!sourceId || !row) {
|
|
269
|
-
event.preventDefault();
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
this.source = item;
|
|
273
|
-
item.setAttribute('data-dragging', 'true');
|
|
274
|
-
if (event.dataTransfer) {
|
|
275
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
276
|
-
event.dataTransfer.setData('text/plain', sourceId);
|
|
277
|
-
}
|
|
278
|
-
setElementDragImage(event.dataTransfer, row);
|
|
279
|
-
};
|
|
280
|
-
updateTarget(target, clientY, dataTransfer) {
|
|
281
|
-
if (!this.source)
|
|
282
|
-
return false;
|
|
283
|
-
if (!target || target === this.source) {
|
|
284
|
-
this.clearTarget();
|
|
285
|
-
this.clearRejection();
|
|
286
|
-
return false;
|
|
287
|
-
}
|
|
288
|
-
const row = this.rowFor(target);
|
|
289
|
-
if (!row)
|
|
290
|
-
return false;
|
|
291
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), clientY, this.acceptsChildren(target));
|
|
292
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
293
|
-
if (rejection) {
|
|
294
|
-
if (dataTransfer)
|
|
295
|
-
dataTransfer.dropEffect = 'none';
|
|
296
|
-
this.clearTarget();
|
|
297
|
-
if (rejection.reason === 'max-depth') {
|
|
298
|
-
this.rejectedTarget = target;
|
|
299
|
-
this.rejectedPosition = position;
|
|
300
|
-
this.rejection = rejection;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
this.clearRejection();
|
|
304
|
-
}
|
|
305
|
-
return false;
|
|
306
|
-
}
|
|
307
|
-
this.clearRejection();
|
|
308
|
-
if (dataTransfer)
|
|
309
|
-
dataTransfer.dropEffect = 'move';
|
|
310
|
-
if (this.target !== target || this.position !== position) {
|
|
311
|
-
this.clearTarget();
|
|
312
|
-
this.target = target;
|
|
313
|
-
this.position = position;
|
|
314
|
-
target.setAttribute('data-drop-position', position);
|
|
315
|
-
}
|
|
316
|
-
if (position === 'inside' && target.getAttribute('aria-expanded') === 'false') {
|
|
317
|
-
this.hoverIntent?.schedule(this.itemId(target));
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this.hoverIntent?.cancel();
|
|
321
|
-
}
|
|
322
|
-
return true;
|
|
323
|
-
}
|
|
324
|
-
onDrag = (event) => {
|
|
325
|
-
if (!this.source || (event.clientX === 0 && event.clientY === 0))
|
|
326
|
-
return;
|
|
327
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
328
|
-
// Native dragenter does not fire when a nested source moves onto an
|
|
329
|
-
// ancestor row: the pointer was already inside that ancestor's host. The
|
|
330
|
-
// source drag event still carries the live pointer coordinates, so use it
|
|
331
|
-
// to keep ancestor/outdent feedback current.
|
|
332
|
-
if (target)
|
|
333
|
-
this.updateTarget(target, event.clientY, event.dataTransfer);
|
|
334
|
-
};
|
|
335
|
-
onDragOver = (event) => {
|
|
336
|
-
if (!this.source)
|
|
337
|
-
return;
|
|
338
|
-
const target = this.itemFromEvent(event);
|
|
339
|
-
if (this.updateTarget(target, event.clientY, event.dataTransfer)) {
|
|
340
|
-
event.preventDefault();
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
onDragLeave = (event) => {
|
|
344
|
-
if (this.isWithinTree(event.relatedTarget))
|
|
345
|
-
return;
|
|
346
|
-
if (this.itemAtPoint(event.clientX, event.clientY))
|
|
347
|
-
return;
|
|
348
|
-
this.clearTarget();
|
|
349
|
-
this.clearRejection();
|
|
350
|
-
};
|
|
351
|
-
dispatchReorder(source, target, position) {
|
|
352
|
-
const sourceId = this.itemId(source);
|
|
353
|
-
const targetId = this.itemId(target);
|
|
354
|
-
if (!sourceId || !targetId)
|
|
355
|
-
return;
|
|
356
|
-
if (position === 'inside')
|
|
357
|
-
this.expandTarget(targetId);
|
|
358
|
-
const sourceMeta = this.itemMetadata(source);
|
|
359
|
-
const targetMeta = this.itemMetadata(target);
|
|
360
|
-
dispatchDetail(this.host, 'reorder', {
|
|
361
|
-
sourceId,
|
|
362
|
-
targetId,
|
|
363
|
-
position,
|
|
364
|
-
sourceType: sourceMeta.type,
|
|
365
|
-
targetType: targetMeta.type,
|
|
366
|
-
sourceScope: sourceMeta.scope,
|
|
367
|
-
targetScope: targetMeta.scope,
|
|
368
|
-
trigger: 'pointer',
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
dispatchReorderRejected(source, target, position, rejection) {
|
|
372
|
-
const sourceId = this.itemId(source);
|
|
373
|
-
const targetId = this.itemId(target);
|
|
374
|
-
if (!sourceId || !targetId)
|
|
375
|
-
return;
|
|
376
|
-
dispatchDetail(this.host, 'reorder-rejected', {
|
|
377
|
-
sourceId,
|
|
378
|
-
targetId,
|
|
379
|
-
position,
|
|
380
|
-
reason: 'max-depth',
|
|
381
|
-
maxDepth: rejection.maxDepth,
|
|
382
|
-
resultingDepth: rejection.resultingDepth,
|
|
383
|
-
trigger: 'pointer',
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
onDrop = (event) => {
|
|
387
|
-
if (!this.source || !this.target || !this.position)
|
|
388
|
-
return;
|
|
389
|
-
event.preventDefault();
|
|
390
|
-
this.dispatchReorder(this.source, this.target, this.position);
|
|
391
|
-
this.finishDrag();
|
|
392
|
-
};
|
|
393
|
-
onDragEnd = (event) => {
|
|
394
|
-
if (this.source) {
|
|
395
|
-
if (this.rejectedTarget && this.rejectedPosition && this.rejection) {
|
|
396
|
-
this.dispatchReorderRejected(this.source, this.rejectedTarget, this.rejectedPosition, this.rejection);
|
|
397
|
-
this.finishDrag();
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
const target = this.itemAtPoint(event.clientX, event.clientY);
|
|
401
|
-
if (target && target !== this.source) {
|
|
402
|
-
const row = this.rowFor(target);
|
|
403
|
-
if (row) {
|
|
404
|
-
const position = classifyDropPosition(row.getBoundingClientRect(), event.clientY, this.acceptsChildren(target));
|
|
405
|
-
const rejection = this.dropRejection(this.source, target, position);
|
|
406
|
-
if (!rejection) {
|
|
407
|
-
this.dispatchReorder(this.source, target, position);
|
|
408
|
-
}
|
|
409
|
-
else if (rejection.reason === 'max-depth') {
|
|
410
|
-
this.dispatchReorderRejected(this.source, target, position, rejection);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
this.finishDrag();
|
|
416
|
-
};
|
|
417
|
-
visibleItems() {
|
|
418
|
-
return Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
419
|
-
.filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
|
|
420
|
-
}
|
|
421
|
-
parentItem(item) {
|
|
422
|
-
const parent = item.parentElement?.closest('ui-tree-item') ?? null;
|
|
423
|
-
return parent && this.host.contains(parent) ? parent : null;
|
|
424
|
-
}
|
|
425
|
-
firstVisibleChild(item, items) {
|
|
426
|
-
return items.find(candidate => this.parentItem(candidate) === item) ?? null;
|
|
427
|
-
}
|
|
428
|
-
focusItem(item) {
|
|
429
|
-
this.syncTabStop(item);
|
|
430
|
-
item.focus();
|
|
431
|
-
}
|
|
432
|
-
requestExpansion(item, expanded) {
|
|
433
|
-
item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
|
|
434
|
-
detail: { expanded, trigger: 'keyboard' },
|
|
435
|
-
}));
|
|
436
|
-
}
|
|
437
|
-
onFocusIn = (event) => {
|
|
438
|
-
if (this.eventTargetsInteractiveContent(event))
|
|
439
|
-
return;
|
|
440
|
-
const item = this.itemFromEvent(event);
|
|
441
|
-
if (item)
|
|
442
|
-
this.syncTabStop(item);
|
|
443
|
-
};
|
|
444
|
-
onExpansionChange = () => {
|
|
445
|
-
requestAnimationFrame(() => this.syncTabStop());
|
|
446
|
-
};
|
|
447
|
-
onKeyDown = (event) => {
|
|
448
|
-
if (this.eventTargetsInteractiveContent(event))
|
|
449
|
-
return;
|
|
450
|
-
const current = this.itemFromEvent(event);
|
|
451
|
-
if (!current)
|
|
452
|
-
return;
|
|
453
|
-
const items = this.visibleItems();
|
|
454
|
-
const index = items.indexOf(current);
|
|
455
|
-
if (index < 0)
|
|
456
|
-
return;
|
|
457
|
-
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
458
|
-
: event.key === 'ArrowUp' ? items[index - 1]
|
|
459
|
-
: event.key === 'Home' ? items[0]
|
|
460
|
-
: event.key === 'End' ? items.at(-1)
|
|
461
|
-
: null;
|
|
462
|
-
if (next) {
|
|
463
|
-
event.preventDefault();
|
|
464
|
-
this.focusItem(next);
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
if (event.key === 'ArrowLeft') {
|
|
468
|
-
if (current.getAttribute('aria-expanded') === 'true') {
|
|
469
|
-
event.preventDefault();
|
|
470
|
-
this.requestExpansion(current, false);
|
|
471
|
-
}
|
|
472
|
-
else if (this.parentItem(current)) {
|
|
473
|
-
event.preventDefault();
|
|
474
|
-
this.focusItem(this.parentItem(current));
|
|
475
|
-
}
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
if (event.key === 'ArrowRight') {
|
|
479
|
-
if (current.getAttribute('aria-expanded') === 'false') {
|
|
480
|
-
event.preventDefault();
|
|
481
|
-
this.requestExpansion(current, true);
|
|
482
|
-
}
|
|
483
|
-
else if (current.getAttribute('aria-expanded') === 'true') {
|
|
484
|
-
const child = this.firstVisibleChild(current, items);
|
|
485
|
-
if (child) {
|
|
486
|
-
event.preventDefault();
|
|
487
|
-
this.focusItem(child);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
render() {
|
|
493
|
-
return (h(Host, { key: 'bae06665078a67c59db2d9e72c7dea6ddeeb9e56', role: "tree", "aria-label": this.label || 'Tree' }, h("slot", { key: '232cb02f1a50bc5e18a92c0d8677e917870ec75e' })));
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
UITree.style = uiTreeCss();
|
|
497
|
-
|
|
498
|
-
export { UITree as ui_tree };
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./cjs/index.cjs.js');
|
package/dist/looma/index.esm.js
DELETED
|
File without changes
|
package/dist/looma/looma.esm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-8BGiMGQ0.js";export{s as setNonce}from"./p-8BGiMGQ0.js";import{g as n}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,n={};return""!==a&&(n.resourcesUrl=new URL(".",a).href),e(n)})().then((async e=>(await n(),a([["p-0b5b8d9e",[[769,"ui-combobox",{label:[1],placeholder:[1],name:[1],value:[1],defaultValue:[1,"default-value"],multiple:[516],tokenSeparators:[16],query:[1],defaultQuery:[1,"default-query"],config:[16],disabled:[4],readOnly:[4,"readonly"],required:[4],size:[1],labelVisibility:[1,"label-visibility"],disclosure:[4],clearable:[4],help:[1],raw:[32],display:[32],selected:[32],expanded:[32],rows:[32],active:[32],loading:[32],helpOpen:[32],lookupError:[32],validation:[32],validate:[64],focusInput:[64]},null,{value:[{syncValue:0}],query:[{syncQuery:0}],disabled:[{syncDisabled:0}],readOnly:[{syncDisabled:0}],config:[{syncConfig:0}]}]]],["p-6d8b99ee",[[769,"ui-context-menu",{open:[4],defaultOpen:[4,"default-open"],for:[1],internalOpen:[32],focusTrigger:[32]},null,{open:[{syncFromProp:0}],for:[{syncTarget:0}],internalOpen:[{syncOverlay:0}]}]]],["p-16e0669d",[[769,"ui-affordance-scope",{nearRadius:[514,"near-radius"]},null,{nearRadius:[{connectCoordinator:0}]}]]],["p-08f80207",[[513,"ui-avatar",{src:[1],alt:[1],name:[1],fallback:[1],hasImage:[32]},null,{src:[{watchSrc:0}]}]]],["p-d56571a2",[[769,"ui-avatar-group",{max:[2],label:[1],overflowCount:[32]},null,{max:[{syncOverflow:0}]}]]],["p-5fdcee1d",[[769,"ui-badge",{variant:[1],tone:[1]}]]],["p-1c5a7522",[[769,"ui-button",{variant:[1],size:[1],disabled:[516]},null,{variant:[{syncToButton:0}],size:[{syncToButton:0}],disabled:[{syncToButton:0}]}]]],["p-add67e4c",[[769,"ui-callout",{tone:[1]}]]],["p-9d2662ca",[[769,"ui-checkbox",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],indeterminate:[4],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}],internalChecked:[{syncToInput:0}],indeterminate:[{syncToInput:0}],disabled:[{syncToInput:0}],required:[{syncToInput:0}]}]]],["p-e604e906",[[769,"ui-dialog",{open:[4],defaultOpen:[4,"default-open"],modal:[4],dismissible:[4],label:[1],internalOpen:[32],accessibleLabel:[32]},null,{open:[{syncFromProp:0}],label:[{syncLabelFromProp:0}],internalOpen:[{syncOpen:0}]}]]],["p-2915d5c0",[[769,"ui-disclosure",{open:[4],defaultOpen:[4,"default-open"],disabled:[4],internalOpen:[32],contentId:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{syncState:0}]}]]],["p-22842f8c",[[769,"ui-editable",{edit:[4],defaultEdit:[4,"default-edit"],disabled:[4],internalEdit:[32]},null,{edit:[{syncFromProp:0}]}]]],["p-3f60f4c8",[[769,"ui-floating-action-button",{disabled:[516],mobileOnly:[516,"mobile-only"],label:[1]}]]],["p-3b2961a6",[[769,"ui-form-field",{invalid:[4],disabled:[4],required:[4]}]]],["p-b6ede6bb",[[769,"ui-icon-button",{disabled:[516],label:[1],size:[513],variant:[513],anticipatory:[516]}]]],["p-1c00670f",[[769,"ui-input",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],readOnly:[4,"readonly"],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToInput:0}],defaultValue:[{syncToInput:0}],disabled:[{syncToInput:0}],invalid:[{syncToInput:0}],readOnly:[{syncToInput:0}]}]]],["p-7c0b5364",[[769,"ui-menu-item",{disabled:[516],value:[1]}]]],["p-99116a72",[[769,"ui-popover",{open:[4],defaultOpen:[4,"default-open"],for:[1],placement:[1],internalOpen:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}]]],["p-424d6719",[[769,"ui-radio",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],name:[1],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}],disabled:[{syncToInput:0}],name:[{syncToInput:0}],required:[{syncToInput:0}],value:[{syncToInput:0}]}]]],["p-d5c3954f",[[769,"ui-radio-group",{value:[1],name:[1],orientation:[1],disabled:[4],required:[4],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToRadios:0}],name:[{syncToRadios:0}],orientation:[{syncToRadios:0}],disabled:[{syncToRadios:0}]}]]],["p-9cfbf722",[[769,"ui-search-result-row",{disabled:[516],selected:[516],hasLeading:[32],hasMeta:[32],hasExcerpt:[32],hasTrailing:[32]}]]],["p-8bdd9495",[[769,"ui-search-shell",{hasStatus:[32],hasFooter:[32]}]]],["p-6f20d470",[[769,"ui-select",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],required:[4],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToSelect:0}],defaultValue:[{syncToSelect:0}],disabled:[{syncToSelect:0}],invalid:[{syncToSelect:0}],required:[{syncToSelect:0}]}]]],["p-d4825822",[[769,"ui-switch",{checked:[4],defaultChecked:[4,"default-checked"],disabled:[4],required:[4],value:[1],internalChecked:[32]},null,{checked:[{syncFromProp:0}]}]]],["p-d372b0db",[[769,"ui-tabs",{value:[1],defaultValue:[1,"default-value"],orientation:[1],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncState:0}],orientation:[{syncState:0}]}]]],["p-b76e2111",[[769,"ui-textarea",{value:[1],defaultValue:[1,"default-value"],disabled:[4],invalid:[4],readOnly:[4,"readonly"],rows:[2],internalValue:[32]},null,{value:[{syncFromProp:0}],internalValue:[{syncToTextarea:0}],defaultValue:[{syncToTextarea:0}],disabled:[{syncToTextarea:0}],invalid:[{syncToTextarea:0}],readOnly:[{syncToTextarea:0}],rows:[{syncToTextarea:0}]}]]],["p-ca2a54fd",[[769,"ui-toast-region",{open:[4],internalOpen:[32]},null,{open:[{syncFromProp:0}],internalOpen:[{syncSurface:0}]}]]],["p-1249a806",[[769,"ui-top-bar",{hasLeading:[32],hasSearch:[32],hasActions:[32]}]]],["p-f1f7c5cb",[[769,"ui-tree",{label:[1],hoverExpandDelay:[2,"hover-expand-delay"],maxDepth:[2,"max-depth"]}]]],["p-4caccfce",[[769,"ui-tree-item",{itemId:[1,"item-id"],label:[1],dropDepth:[2,"drop-depth"],subtreeDepth:[2,"subtree-depth"],container:[4],sortable:[4],dragType:[1,"drag-type"],dropScope:[1,"drop-scope"],accepts:[1],expanded:[4],defaultExpanded:[4,"default-expanded"],selected:[4],disabled:[4],internalExpanded:[32],structuralLevel:[32],tabStop:[32]},null,{expanded:[{syncExpandedFromProp:0}]}]]],["p-a2dd4c6c",[[769,"ui-menu",{open:[4],defaultOpen:[4,"default-open"],for:[1],placement:[1],internalOpen:[32]},null,{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncSurface:0}]}]]],["p-9ff2fa19",[[769,"ui-chip",{appearance:[1],size:[1]}],[769,"ui-tooltip",{for:[1],open:[4],defaultOpen:[4,"default-open"],placement:[1],showDelay:[2,"show-delay"],hideDelay:[2,"hide-delay"],toggleOnClick:[4,"toggle-on-click"],internalOpen:[32]},null,{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncOverlay:0}]}]]]],e))));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,h as e,H as i}from"./p-8BGiMGQ0.js";const r=class{constructor(e){a(this,e)}src="";alt="";name="";fallback="";hasImage=!1;watchSrc(){this.hasImage=!1}onImageLoad=()=>{this.hasImage=!0};onImageError=()=>{this.hasImage=!1};render(){const a=this.fallback||function(a){const e=a.trim().split(/\s+/).filter((a=>a.length>0));return 0===e.length?"?":1===e.length?e[0].slice(0,2).toUpperCase():`${e[0][0]??""}${e[1][0]??""}`.toUpperCase()}(this.name||this.alt),r=this.alt||this.name||"Avatar";return e(i,{key:"bbe6c3a775702022a19d819a6cc9d81d798cb3e1",role:"img","aria-label":r,"data-has-image":this.hasImage?"":void 0},e("div",{key:"63402327ba5bde122bf5deaea09baf965ee9b047",class:"avatar"},e("img",{key:"e52b86773684b80d76efa459cb03ae40881f959b",src:this.src,alt:r,onLoad:this.onImageLoad,onError:this.onImageError,hidden:!this.hasImage,"aria-hidden":this.hasImage?"false":"true"}),e("span",{key:"82a6d8f0d0c69ca52f81d092a2292fc80238265b",class:"fallback",hidden:this.hasImage,"aria-hidden":this.hasImage?"true":"false"},a)))}static get watchers(){return{src:[{watchSrc:0}]}}};r.style=":host{display:inline-flex}.avatar{display:inline-grid;place-items:center;overflow:hidden;inline-size:2.5rem;block-size:2.5rem;border-radius:999px;border:1px solid var(--ui-border-default);background:var(--ui-surface-muted);color:var(--ui-text-secondary);font:inherit;font-size:0.875rem;font-weight:600;text-transform:uppercase}.avatar img{grid-area:1 / 1;inline-size:100%;block-size:100%;object-fit:cover}.avatar .fallback{grid-area:1 / 1;display:inline-flex;align-items:center;justify-content:center;inline-size:100%;block-size:100%}";export{r as ui_avatar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,g as s,h as e,H as a}from"./p-8BGiMGQ0.js";import{a as o}from"./p-ZOr-2PSe.js";import{c as r,o as h}from"./p-C-0syqXZ.js";const n=class{constructor(s){i(this,s),this.queryChange=t(this,"query-change"),this.valueChange=t(this,"value-change"),this.freeEntry=t(this,"free-entry"),this.createEntry=t(this,"create-entry"),this.dependencyInvalidate=t(this,"dependency-invalidate"),this.validationChange=t(this,"validation-change"),this.optionsChange=t(this,"options-change"),this.addItem=t(this,"add-item"),this.removeItem=t(this,"remove-item"),this.createItem=t(this,"create-item")}get host(){return s(this)}label="";placeholder="";name="";value;defaultValue;multiple=!1;tokenSeparators=[];query;defaultQuery="";config={};disabled=!1;readOnly=!1;required=!1;size="md";labelVisibility="visible";disclosure=!1;clearable=!1;help="";queryChange;valueChange;freeEntry;createEntry;dependencyInvalidate;validationChange;optionsChange;addItem;removeItem;createItem;raw="";display="";selected=null;expanded=!1;rows=[];active=-1;loading=!1;helpOpen=!1;lookupError="";validation={status:"pristine",touched:!1,dirty:!1,issues:[]};input;popup;field;surface;lookup;validationRun;lookupTimer;composing=!1;initialRaw="";overlayId=`ui-combobox-${Math.random().toString(36).slice(2)}`;alive=!1;fullSet=!1;knownOptions=new Map;awaitingLabel=null;proposedChange;formattedRaw;formattedWith;get items(){return this.multiple&&Array.isArray(this.value)?this.value:[]}get selectedValues(){return new Set(this.items.map((i=>i.value)))}componentWillLoad(){if(this.multiple)return this.selected=null,this.raw=this.query??this.defaultQuery,this.display=this.raw,this.initialRaw=this.raw,void this.applyServerIssues();this.selected=void 0!==this.value?this.value:this.defaultValue??null,this.raw=this.query??this.defaultQuery,void 0!==this.query||this.raw||null===this.selected||(this.raw=this.config.options?.find((i=>i.value===this.selected))?.label??this.selected),void 0===this.query&&null!==this.selected&&this.raw===this.selected&&(this.awaitingLabel=this.selected),this.display=this.raw,this.initialRaw=this.raw,this.applyServerIssues()}connectedCallback(){this.alive=!0,this.setupSurface()}componentDidLoad(){this.setupSurface()}componentDidUpdate(){this.input&&!this.composing&&this.input.value!==this.display&&(this.input.value=this.display),this.expanded&&this.surface?.refresh()}disconnectedCallback(){this.alive=!1,this.close(),this.validationRun?.abort(),this.surface?.destroy(),this.surface=void 0}setupSurface(){!this.surface&&this.popup&&this.field&&(this.surface=o(this.popup,{anchor:this.field,placement:"bottom-start"}))}syncValue(){if(!this.multiple&&void 0!==this.value){if(this.selected=this.value,void 0===this.query){const i=this.proposedChange,t=this.config.options?.find((i=>i.value===this.selected))??(null===this.selected?void 0:this.knownOptions.get(this.selected)),s=i?.value===this.selected?i.query:t?.label??this.selected??"";i?.value===this.selected&&s===this.raw||(this.raw=s,this.display=this.raw,this.formattedRaw=void 0),this.awaitingLabel=t||null===this.selected?null:this.selected}this.resetValidation()}}syncQuery(){void 0!==this.query&&this.query!==this.raw&&(void 0===this.value&&this.proposedChange?.query!==this.query&&(this.selected=null),this.awaitingLabel=null,this.formattedRaw=void 0,this.raw=this.query,this.display=this.raw,this.resetValidation(),this.expanded&&this.search("input"))}syncDisabled(){(this.disabled||this.readOnly)&&(this.close(),this.resetValidation())}syncConfig(i,t){if(this.validationRun?.abort(),i.provider===t?.provider&&i.context===t?.context||this.knownOptions.clear(),i.context!==t?.context){this.close();const t=i.invalidation??"retain-query";this.multiple?"clear"===t&&this.setMultiQuery("","programmatic"):this.commit("retain"===t?this.selected:null,"clear"===t?"":this.raw,null,"invalidation","programmatic"),this.validation={status:"pristine",touched:!1,dirty:this.raw!==this.initialRaw,issues:[]}}this.applyServerIssues(),this.expanded&&this.search("context")}applyServerIssues(){const i=this.config.issues??[];i.length?this.setValidation({issues:i},this.validation.touched):this.resetValidation()}resetValidation(){this.validationRun?.abort(),this.validation={status:"pristine",touched:this.validation.touched,dirty:this.raw!==this.initialRaw,issues:[]},this.validationChange?.emit(this.validation)}cancelLookup(){clearTimeout(this.lookupTimer),this.lookup?.abort(),this.lookup=void 0,this.loading=!1}close(){this.expanded=!1,this.active=-1,this.cancelLookup(),this.surface?.hide(),r(this.overlayId)}open(i="input"){this.disabled||this.readOnly||(this.expanded=!0,this.popup&&this.field&&(this.popup.style.minWidth=`${this.field.getBoundingClientRect().width}px`),this.surface?.show(),h({id:this.overlayId,element:this.popup,relatedElements:[this.host],modal:!1,requestClose:()=>this.close()}),this.search(i))}search(i){this.cancelLookup(),this.fullSet="disclosure"===i,this.active=-1,this.lookupError="";const t=this.config,s=this.fullSet?"":this.raw,e=new AbortController;this.lookup=e;const a=i=>{if(e.signal.aborted||!this.alive)return;for(const t of i)this.knownOptions.set(t.value,t);const a=null===this.selected?void 0:this.knownOptions.get(this.selected);void 0===this.query&&this.awaitingLabel===this.selected&&a&&(this.raw=a.label,this.display=this.raw,this.awaitingLabel=null,this.formattedRaw=void 0,this.resetValidation());const o=new Set,r=this.multiple?this.selectedValues:void 0;this.rows=i.filter((i=>!o.has(i.id)&&(o.add(i.id),!!this.fullSet||(r?!r.has(i.value)&&(t.filter?t.filter(i,s,t.context):i.label.toLocaleLowerCase().includes(s.toLocaleLowerCase())):t.filter?t.filter(i,s,t.context):!!t.provider||i.label.toLocaleLowerCase().includes(s.toLocaleLowerCase())))));const h=new Map;for(const i of this.rows){const t=i.group??"";h.has(t)||h.set(t,[]),h.get(t).push(i)}this.rows=[...h.values()].flat(),this.loading=!1,this.optionsChange.emit(this.rows)};t.provider?(this.rows=[],this.loading=!0,this.lookupTimer=setTimeout((async()=>{try{a(await t.provider({query:s,context:t.context,signal:e.signal,reason:i}))}catch(i){if(e.signal.aborted||!this.alive)return;this.loading=!1,this.lookupError=i instanceof Error?i.message:"Unable to load suggestions."}}),"disclosure"===i?0:Math.max(0,t.debounce??200))):a(t.options??[])}get canCreate(){const i=this.config.options?[...this.config.options,...this.rows]:this.rows;return Boolean(this.config.allowCreate&&this.raw.trim()&&!this.loading&&!this.lookupError&&!i.some((i=>i.label.toLocaleLowerCase()===this.raw.toLocaleLowerCase())))}format(i){if((this.config.formatOn??"blur")!==i||!this.input)return;if(this.formattedRaw===this.raw&&this.formattedWith===this.config.format)return;const t=function(i,t,s){const e={display:i,selection:t};if(!s)return e;let a;try{a=s(i,t)}catch{return e}if(!a)return e;const o=Array.from(i);let r=0;for(const i of a.display)i===o[r]&&(r+=1);return!Number.isInteger(a.selection.start)||!Number.isInteger(a.selection.end)||r!==o.length||a.selection.start<0||a.selection.end<a.selection.start||a.selection.end>a.display.length?e:a}(this.raw,{start:this.input.selectionStart??this.raw.length,end:this.input.selectionEnd??this.raw.length,direction:this.input.selectionDirection??"none"},this.config.format);this.formattedRaw=this.raw,this.formattedWith=this.config.format,this.display=t.display,this.input.value!==t.display&&(this.input.value=t.display,this.input.setSelectionRange(t.selection.start,t.selection.end,t.selection.direction))}onInput=i=>{this.composing||i.isComposing||(this.awaitingLabel=null,this.formattedRaw=void 0,this.raw=this.input.value,this.display=this.raw,this.resetValidation(),this.format("input"),this.queryChange.emit({query:this.raw,display:this.display,trigger:"keyboard"}),null!==this.selected&&this.commit(null,this.raw,null,"clear","keyboard"),this.open(),"input"===this.config.validateOn&&this.validate(),queueMicrotask((()=>{void 0!==this.query&&this.query!==this.raw&&this.syncQuery()})))};commit(i,t,s,e,a){this.awaitingLabel=null;const o=t!==this.raw;void 0===this.value&&(this.selected=i),void 0===this.query&&o&&(this.raw=t,this.display=t,this.formattedRaw=void 0),this.resetValidation();const r={value:i,query:t,option:s,kind:e,trigger:a},h={value:i,query:t};this.proposedChange=h,this.valueChange.emit(r),o&&this.queryChange.emit({query:t,display:t,trigger:a}),"create"===e&&this.createEntry.emit(r),"free-entry"===e&&this.freeEntry.emit(r),"invalidation"===e&&this.dependencyInvalidate.emit(r),queueMicrotask((()=>{this.proposedChange===h&&(void 0!==this.value&&this.value!==h.value&&this.syncValue(),void 0!==this.query&&this.query!==h.query&&(void 0===this.value&&(this.selected=null,this.resetValidation()),this.syncQuery()),this.proposedChange=void 0)}))}choose(i,t){const s=this.rows[i];if(!s?.disabled){if(this.multiple){if(s)this.addSelectedItem(s,t);else{if(!this.canCreate||i!==this.rows.length)return;this.createSelectedItem(this.raw.trim(),t)}return this.setMultiQuery("",t),this.close(),void this.input?.focus()}if(s)this.commit(s.value,s.label,s,"selection",t);else{if(!this.canCreate||i!==this.rows.length)return;this.commit(null,this.raw,null,"create",t)}this.close(),this.input?.focus(),"submit"!==this.config.validateOn&&queueMicrotask((()=>{this.validate()}))}}emitItems(i){this.valueChange.emit(i)}setMultiQuery(i,t){void 0===this.query&&(this.raw=i,this.display=i,this.formattedRaw=void 0),this.input&&(this.input.value=i),this.queryChange.emit({query:i,display:i,trigger:t})}addSelectedItem(i,t){this.addItem.emit({item:i,index:this.items.length,trigger:t}),this.emitItems([...this.items,i])}createSelectedItem(i,t){i&&this.createItem.emit({query:i,trigger:t})}commitQuery(i){const t=this.raw.trim();if(!t)return;const s=t.toLocaleLowerCase(),e=this.rows.find((i=>i.label.trim().toLocaleLowerCase()===s));e?(this.setMultiQuery("",i),this.addSelectedItem(e,i)):this.config.allowCreate&&(this.setMultiQuery("",i),this.createSelectedItem(t,i))}removeItemAt(i,t){const s=this.items[i];!s||s.disabled||this.disabled||this.readOnly||(this.removeItem.emit({item:s,index:i,trigger:t}),this.emitItems(this.items.filter(((t,s)=>s!==i))),requestAnimationFrame((()=>{const t=this.host.shadowRoot?.querySelectorAll('[part="item"]')??[],e=t[Math.min(i,t.length-1)]??t[i-1];e&&e.dataset.value!==s.value?e.focus():this.focusInput()})))}focusItem(i){this.host.shadowRoot?.querySelectorAll('[part="item"]')[i]?.focus()}onItemKeyDown=(i,t)=>{i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||("ArrowLeft"===i.key?(i.preventDefault(),i.stopPropagation(),this.focusItem(Math.max(0,t-1))):"ArrowRight"===i.key?(i.preventDefault(),i.stopPropagation(),t===this.items.length-1?this.focusInput():this.focusItem(t+1)):"Backspace"!==i.key&&"Delete"!==i.key||(i.preventDefault(),i.stopPropagation(),this.removeItemAt(t,"keyboard")))};handleMultipleKeydown(i){return!(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||(this.tokenSeparators.includes(i.key)?(i.preventDefault(),i.stopPropagation(),this.commitQuery("keyboard"),0):this.raw||(this.input?.selectionStart??0)>0||("ArrowLeft"===i.key&&this.items.length?(i.preventDefault(),this.focusItem(this.items.length-1),0):"Backspace"!==i.key||!this.items.length||(i.preventDefault(),this.removeItemAt(this.items.length-1,"keyboard"),0))))}move(i){const t=this.rows.flatMap(((i,t)=>i.disabled?[]:[t]));if(this.canCreate&&t.push(this.rows.length),!t.length)return;const s=t.indexOf(this.active),e="Home"===i?0:"End"===i?t.length-1:"ArrowDown"===i?Math.min(s+1,t.length-1):s<0?t.length-1:Math.max(0,s-1);this.active=t[e],requestAnimationFrame((()=>this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({block:"nearest"})))}onKeydown=i=>{if(!(this.composing||i.isComposing||this.disabled||this.readOnly||this.multiple&&this.handleMultipleKeydown(i)))return"Escape"===i.key&&this.expanded?(i.preventDefault(),i.stopPropagation(),void this.close()):void("Tab"!==i.key?i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||("ArrowDown"===i.key||"ArrowUp"===i.key?(i.preventDefault(),this.expanded||this.open("disclosure"),this.move(i.key)):("Home"===i.key||"End"===i.key)&&this.expanded&&this.active>=0?(i.preventDefault(),this.move(i.key)):"Enter"===i.key&&this.expanded&&(this.active>=0?(i.preventDefault(),this.choose(this.active,"keyboard")):this.config.allowFreeText&&(i.preventDefault(),this.commit(null,this.raw,null,"free-entry","keyboard"),this.close()))):this.close())};onFocusOut=i=>{i.relatedTarget instanceof Node&&this.host.shadowRoot?.contains(i.relatedTarget)||(this.close(),this.format("blur"),this.validation={...this.validation,touched:!0},!this.multiple&&this.config.allowFreeText&&null===this.selected&&this.commit(null,this.raw,null,"free-entry","keyboard"),"blur"===(this.config.validateOn??"blur")&&this.validate())};setValidation(i,t=this.validation.touched){const s=i.issues.some((i=>"warning"!==i.severity));this.validation={status:s?"error":i.issues.length?"warning":"valid",touched:t,dirty:this.raw!==this.initialRaw,...i},this.validationChange?.emit(this.validation)}async validate(){this.validationRun?.abort();const i=new AbortController;this.validationRun=i,this.validation={...this.validation,status:"pending",output:void 0},this.validationChange.emit(this.validation);try{const t=await async function(i,t){let s=i.raw,e=[];const a=()=>i.signal.throwIfAborted();try{if(a(),t.parse&&(s=await t.parse(i.raw,i)),a(),t.schema){const i=await t.schema["~standard"].validate(s);a(),i.issues?e=i.issues:"value"in i&&(s=i.value)}if(!e.some((i=>"warning"!==i.severity))&&(t.normalize&&(s=await t.normalize(s,i)),a(),t.validator)){const o=await t.validator(s,i);a(),e=[...e,...o.issues??[]],"output"in o&&(s=o.output)}}catch(i){a(),e=[{message:i instanceof Error?i.message:"Unable to validate this value."}]}return e=[...e,...t.issues??[]],{output:e.some((i=>"warning"!==i.severity))?void 0:s,issues:e}}({raw:this.raw,value:this.selected,context:this.config.context,signal:i.signal},this.config);this.required&&!this.raw.trim()?t.issues=[...t.issues,{message:"A value is required."}]:!this.raw||null!==this.selected||this.config.allowFreeText||this.config.allowCreate||(t.issues=[...t.issues,{message:"Choose a suggestion."}]),t.issues.some((i=>"warning"!==i.severity))&&(t.output=void 0),!i.signal.aborted&&this.alive&&this.setValidation(t)}catch{}return this.validation}async focusInput(){this.input?.focus()}render(){const i=[this.helpOpen?"help-text":"",this.validation.issues.length?"validation":""].filter(Boolean).join(" ")||void 0,t=this.loading?"Loading suggestions…":this.lookupError||(this.expanded?`${this.rows.length} suggestions available.`:""),s=[...new Set(this.rows.map((i=>i.group??"")))];return e(a,{key:"fc4c0192d3be88d8c0199ae1bcca44232bd22351","data-size":this.size,"data-validation":this.validation.status,onFocusout:this.onFocusOut},e("label",{key:"bdd0d244c6ef448978fa77aac3a2d3b71d713553",htmlFor:"input",part:"label",class:"sr-only"===this.labelVisibility?"sr-only":void 0},this.label,this.required?" *":""),e("div",{key:"afb3972aab52171a3b25ede863c31059e56f5d91",class:"field",part:"field",ref:i=>this.field=i,onClick:i=>{i.composedPath().some((i=>i instanceof HTMLButtonElement))||this.input?.focus()}},e("slot",{key:"65e4e201d6c11cd2638e392e1298662de7ba4d57",name:"start"}),this.multiple&&e("div",{key:"b80b5b85fa0540139b9756fcc494aef9df245c15",class:"items",role:"group","aria-label":`Selected ${this.label}`},this.items.map(((i,t)=>e("button",{type:"button",part:"item",class:"item","data-value":i.value,tabIndex:-1,disabled:this.disabled||this.readOnly||i.disabled,"aria-label":`${i.label}, press Delete or Backspace to remove`,onKeyDown:i=>this.onItemKeyDown(i,t)},e("slot",{name:`item-${i.id}`},e("ui-chip",{appearance:"pill"},i.label)))))),e("input",{key:"64f76055ae412cc87119270eec10c69000a72563",id:"input",ref:i=>this.input=i,role:"combobox","aria-autocomplete":"list","aria-expanded":String(this.expanded),"aria-controls":"listbox","aria-activedescendant":this.expanded&&this.active>=0?`option-${this.active}`:void 0,"aria-describedby":i,"aria-invalid":String("error"===this.validation.status),"aria-busy":String("pending"===this.validation.status),value:this.display,placeholder:this.placeholder,name:this.name||void 0,disabled:this.disabled,readOnly:this.readOnly,required:this.required,autoComplete:"off",part:"input",onInput:this.onInput,onKeyDown:this.onKeydown,onCompositionstart:()=>this.composing=!0,onCompositionend:()=>{this.composing=!1,this.onInput(new InputEvent("input"))}}),this.clearable&&e("button",{key:"eac4c18dadcea92065af4ecd871d925ef1248d47",type:"button",part:"affordance","aria-label":`Clear ${this.label}`,disabled:this.disabled||this.readOnly,onClick:()=>{this.commit(null,"",null,"clear","pointer"),this.close(),this.input?.focus()}},"×"),this.help&&e("button",{key:"9a559d49a495ead3dbf159f170c594e0aaa0d0d0",id:"help",type:"button",part:"affordance","aria-label":`Help for ${this.label}`,disabled:this.disabled},e("span",{key:"73940e568b976f85399d5baa5e247a4a606d0039","aria-hidden":"true"},"?")),this.disclosure&&e("button",{key:"30dd6746ffb121888a4c4fb6df54720906badf78",type:"button",part:"affordance","aria-label":`Suggestions for ${this.label}`,"aria-controls":"listbox","aria-expanded":String(this.expanded),disabled:this.disabled||this.readOnly,onClick:()=>{this.expanded?this.close():this.open("disclosure"),this.input?.focus()}},e("span",{key:"7d3b10a765ee0a6c40d7b0b49e98c676a5837944","aria-hidden":"true"},"⌄"))),this.help&&e("ui-tooltip",{key:"efff00f45dc281b727789eb2aa84ff772bb5c925",id:"help-text",for:"help",toggleOnClick:!0,onOpen:()=>this.helpOpen=!0,onClose:()=>this.helpOpen=!1},this.help),e("div",{key:"770bc12b873026b571bd3ae2a80416e8af52b8d4",class:"popup",part:"popup",hidden:!this.expanded,ref:i=>this.popup=i},e("div",{key:"ed48c8dd8b672a577d567ca5e795b8a53fde2761",id:"listbox",role:"listbox","aria-label":`${this.label} suggestions`,"aria-busy":String(this.loading)},s.map((i=>e("div",{role:i?"group":"presentation","aria-label":i||void 0},i&&e("div",{class:"group",part:"group"},i),this.rows.map(((t,s)=>(t.group??"")!==i?null:e("div",{id:`option-${s}`,role:"option","aria-selected":String(this.selected===t.value),"aria-disabled":String(Boolean(t.disabled)),"data-active":this.active===s?"":void 0,part:"option",class:"option",onPointerDown:i=>i.preventDefault(),onClick:()=>this.choose(s,"pointer")},e("slot",{name:`option-${t.id}`},e("span",{class:"primary",part:"option-primary"},t.label),t.description&&e("span",{class:"secondary",part:"option-secondary"},t.description)))))))),this.canCreate&&e("div",{key:"43215f449bbccde407ef818cee473f69870f6f8c",id:`option-${this.rows.length}`,role:"option","aria-selected":"false",class:"option",part:"option","data-active":this.active===this.rows.length?"":void 0,onPointerDown:i=>i.preventDefault(),onClick:()=>this.choose(this.rows.length,"pointer")},e("slot",{key:"3ff70ff3ab8e24afc369a26e8474e7d1220ed6eb",name:"create"},"Create “",this.raw,"”"))),this.loading?e("div",{class:"message"},e("slot",{name:"loading"},"Loading suggestions…")):this.lookupError?e("div",{class:"message"},e("slot",{name:"error"},this.lookupError)):this.rows.length||this.canCreate?null:e("div",{class:"message"},e("slot",{name:"empty"},"No suggestions.")),e("slot",{key:"8b1fbd4f5c372393d294d8c218ae1785e6b0334f",name:"footer"})),e("div",{key:"18e68687f04e35535edee363683523ce6bbb0291",id:"validation",class:"message",part:"validation",hidden:!this.validation.issues.length},this.validation.issues.map((i=>e("div",null,i.message)))),e("div",{key:"e4a7db06abcfaf08b8ac592107531a13ef3a5897",class:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true"},t," ","pending"===this.validation.status?"Checking value…":this.validation.issues.map((i=>i.message)).join(" ")))}static get watchers(){return{value:[{syncValue:0}],query:[{syncQuery:0}],disabled:[{syncDisabled:0}],readOnly:[{syncDisabled:0}],config:[{syncConfig:0}]}}};n.style=":host{display:grid;gap:var(--ui-space-1);min-inline-size:0;color:var(--ui-text-primary);font:inherit}label{color:var(--ui-field-label-color, var(--ui-text-primary));font-size:var(--ui-field-label-size, 0.875rem);font-weight:var(--ui-field-label-weight, 500)}.field{display:flex;min-inline-size:0;border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default))}.field:focus-within{border-color:var(--ui-control-focus, var(--ui-focus-ring));outline:2px solid var(--ui-control-focus, var(--ui-focus-ring));outline-offset:1px}input{appearance:none;width:100%;min-inline-size:0;min-block-size:var(--ui-control-min-block-size, 2.75rem);box-sizing:border-box;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;outline:none}:host([data-size='sm']) input{min-block-size:var(--ui-field-compact-size, 2rem);padding:var(--ui-space-1) var(--ui-space-2)}button{appearance:none;border:0;border-radius:var(--ui-radius-2);background:transparent;color:var(--ui-field-affordance-color, var(--ui-text-secondary));font:inherit;font-weight:var(--ui-field-affordance-weight, 400);min-inline-size:2rem;padding:var(--ui-space-1);cursor:pointer}button:hover:enabled{background:var(--ui-surface-muted);color:var(--ui-text-primary)}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-3px}input:disabled,button:disabled{color:var(--ui-text-muted);cursor:not-allowed}.field:has(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted))}:host([data-validation='error']) .field{border-color:var(--ui-danger-solid, var(--ui-accent-active))}.popup{box-sizing:border-box;min-inline-size:12rem;max-inline-size:calc(100vw - 1rem);max-block-size:var(--ui-combobox-max-block-size, 18rem);overflow:auto;margin:0;padding:var(--ui-space-1);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-md)}[hidden]{display:none !important}.option{padding:var(--ui-space-2) var(--ui-space-3);border-radius:var(--ui-radius-1);cursor:pointer;overflow-wrap:anywhere}.option:hover,.option[data-active]{background:var(--ui-surface-muted);outline:1px solid var(--ui-focus-ring);outline-offset:-1px}.option[aria-disabled='true']{color:var(--ui-text-muted);cursor:not-allowed}.primary{display:block;color:var(--ui-option-primary-color, var(--ui-text-primary));font-weight:var(--ui-option-primary-weight, 500)}.secondary{display:block;color:var(--ui-option-secondary-color, var(--ui-text-secondary));font-weight:var(--ui-option-secondary-weight, 400);font-size:var(--ui-font-size-sm)}.message,.group{color:var(--ui-field-message-color, var(--ui-text-secondary));font-weight:var(--ui-field-message-weight, 400);font-size:var(--ui-font-size-sm);line-height:var(--ui-line-height-md);overflow-wrap:anywhere}.group,.popup .message{padding:var(--ui-space-2) var(--ui-space-3)}.sr-only{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (pointer: coarse){button{min-inline-size:2.75rem;min-block-size:2.75rem}}@media (forced-colors: active){.field,.popup{border-color:CanvasText}.option[data-active]{outline-color:Highlight}}:host([multiple]) .field{flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}:host([multiple]) input{flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;min-inline-size:0;max-inline-size:min(100%, var(--ui-multi-combobox-item-max-inline-size, 12rem));overflow:hidden;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item>slot{display:block;min-inline-size:0;max-inline-size:100%;overflow:hidden}.item>slot::slotted(*){min-inline-size:0;max-inline-size:100%}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}";export{n as ui_combobox}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,g as e,h as i,H as t}from"./p-8BGiMGQ0.js";function s(a){return!!a&&a.assignedNodes({flatten:!0}).some((a=>a.nodeType!==Node.TEXT_NODE||Boolean(a.textContent?.trim())))}const r=class{constructor(e){a(this,e)}get host(){return e(this)}hasLeading=!1;hasSearch=!1;hasActions=!1;leadingSlot;searchSlot;actionsSlot;componentDidLoad(){this.syncSlots()}syncSlots=()=>{this.hasLeading=s(this.leadingSlot),this.hasSearch=s(this.searchSlot),this.hasActions=s(this.actionsSlot)};render(){return i(t,{key:"1ef941e211c9536c034a40c0f7a255068595de10"},i("header",{key:"f1ea465d17753224d72971d26f70b546b93de8ba",class:"top-bar",part:"base"},i("div",{key:"4eab975109467ad41e16527102b31e6e6d7421c8",class:"top-bar__leading",hidden:!this.hasLeading},i("slot",{key:"3388d0e2346de4c08d85dd4c3a998e5f668a05f6",name:"leading",ref:a=>this.leadingSlot=a,onSlotchange:this.syncSlots})),i("div",{key:"7b176d6e82da08eb495f3ca2c83505327c21f525",class:"top-bar__title"},i("slot",{key:"8196e5489d2f43a72f794aad8ceaa44c358810e9"})),i("div",{key:"2b29c72174559865fb01b99cfab830f74640a8a5",class:"top-bar__search",hidden:!this.hasSearch},i("slot",{key:"9597fde0cf05821e641471343a38dd3190f1e18f",name:"search",ref:a=>this.searchSlot=a,onSlotchange:this.syncSlots})),i("div",{key:"1f19003e43fb28ac4ff4debd27e1a0fa9f342275",class:"top-bar__actions",hidden:!this.hasActions},i("slot",{key:"f6a84824d2806dc16b5fa82cc25dc1247a6a8ad1",name:"actions",ref:a=>this.actionsSlot=a,onSlotchange:this.syncSlots}))))}};r.style=":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}}";export{r as ui_top_bar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as e,h as a,H as o}from"./p-8BGiMGQ0.js";import{D as s,c as n}from"./p-ZOr-2PSe.js";const r=class{constructor(e){t(this,e)}get host(){return e(this)}nearRadius=s;coordinator=null;componentDidLoad(){this.connectCoordinator()}disconnectedCallback(){this.coordinator?.destroy(),this.coordinator=null}connectCoordinator(){this.coordinator?.destroy(),this.coordinator=n(this.host,{nearRadius:this.nearRadius})}onSlotChange=()=>{this.coordinator?.refresh()};render(){return a(o,{key:"f500fa48554ed6224efd2dbe9632880bf0a15a19"},a("slot",{key:"37c5c5b7925b260ff8f9edd411ee6c90a12a4909",onSlotchange:this.onSlotChange}))}static get watchers(){return{nearRadius:[{connectCoordinator:0}]}}};r.style=":host{display:contents;--ui-affordance-scope-engaged:0}:host([data-ui-interaction='engaged']){--ui-affordance-scope-engaged:1}";export{r as ui_affordance_scope}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as i,h as o,H as r}from"./p-8BGiMGQ0.js";import{d as s,e}from"./p-JwSoedEO.js";const a=class{constructor(i){t(this,i)}get host(){return i(this)}value;defaultValue="";disabled=!1;invalid=!1;readOnly=!1;internalValue="";slotRef;syncFromProp(){void 0!==this.value&&(this.internalValue=this.value)}syncToInput(){const t=this.getInput();t&&(this.host.dataset.invalid=this.invalid?"true":"",void 0!==this.value&&(t.value=this.internalValue),t.defaultValue=this.defaultValue,t.disabled=this.disabled,t.readOnly=this.readOnly,t.setAttribute("aria-invalid",this.invalid?"true":"false"))}componentDidLoad(){this.syncFromProp(),this.slotRef?.addEventListener("slotchange",(()=>this.syncToInput())),this.syncToInput();const t=this.getInput();t?.addEventListener("input",this.onInput),t?.addEventListener("change",this.onChange)}disconnectedCallback(){const t=this.getInput();t?.removeEventListener("input",this.onInput),t?.removeEventListener("change",this.onChange)}componentDidUpdate(){this.syncToInput()}getInput(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"INPUT"===t.tagName))??null}onInput=t=>{const i=t.target;i&&(this.internalValue=i.value,s(this.host,"input",{value:this.internalValue,trigger:e(t)}))};onChange=t=>{const i=this.getInput();i&&(this.internalValue=i.value,s(this.host,"change",{value:this.internalValue,trigger:e(t)}))};render(){return o(r,{key:"92505de6b1245569a6d4746418a70f8d7bc4eed9","data-invalid":this.invalid?"":void 0},o("slot",{key:"d5743dc62037b5d7722cfbb64a582592327c75e5",ref:t=>this.slotRef=t}))}static get watchers(){return{value:[{syncFromProp:0}],internalValue:[{syncToInput:0}],defaultValue:[{syncToInput:0}],disabled:[{syncToInput:0}],invalid:[{syncToInput:0}],readOnly:[{syncToInput:0}]}}};a.style=":host{display:inline-flex;min-inline-size:0;color:var(--ui-text-primary)}::slotted(input){width:100%;appearance:none;min-block-size:var(--ui-control-min-block-size, 2.75rem);border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default));color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;transition:border-color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), background-color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(input:hover:not(:focus):not(:disabled)){border-color:var(--ui-control-border-hover, var(--ui-border-strong))}::slotted(input:focus){border-color:var(--ui-control-focus, var(--ui-focus-ring));box-shadow:0 0 0 3px var(--ui-control-focus-halo, var(--ui-accent-soft))}:host([data-invalid='true'])::slotted(input),::slotted(input[aria-invalid='true']){border-color:var(--ui-accent-active)}::slotted(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted));color:var(--ui-text-muted);cursor:not-allowed}::slotted(input:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}";export{a as ui_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as a,h as o,H as r}from"./p-8BGiMGQ0.js";import{i as e}from"./p-JwSoedEO.js";const i=class{constructor(a){t(this,a)}get host(){return a(this)}variant="outline";size;disabled=!1;slotRef;syncToButton(){const t=this.getButton();t&&(this.size?this.host.dataset.size=this.size:delete this.host.dataset.size,this.disabled?this.host.dataset.disabled="true":delete this.host.dataset.disabled,this.host.dataset.variant=this.variant,t.disabled=this.disabled)}componentDidLoad(){this.slotRef?.addEventListener("slotchange",(()=>this.syncToButton())),this.syncToButton()}componentDidUpdate(){this.syncToButton()}getButton(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"BUTTON"===t.tagName))??null}onKeydown=t=>{this.getButton()||this.disabled||!e(t)||(t.preventDefault(),this.host.click())};render(){return o(r,{key:"27af76cb5db1d0385b6450d2bb12c3bbea5822d2","data-size":this.size||void 0,"data-variant":this.variant,"data-disabled":this.disabled?"true":void 0,onKeyDown:this.onKeydown},o("slot",{key:"daeaa9a8c4e4e87e264bb1e09f1ab6bd1d53830c",ref:t=>this.slotRef=t}))}static get watchers(){return{variant:[{syncToButton:0}],size:[{syncToButton:0}],disabled:[{syncToButton:0}]}}};i.style=":host{display:inline-flex;vertical-align:middle;color:var(--ui-action-secondary-text, var(--ui-text-primary))}:host([data-variant='solid']){color:var(--ui-action-primary-text, var(--ui-text-on-accent))}:host([data-variant='outline']) ::slotted(button),::slotted(button){appearance:none;min-block-size:var(--ui-button-min-block-size, 2.5rem);border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-button-radius, var(--ui-radius-2));background:var(--ui-action-secondary-surface, var(--ui-surface-default));color:inherit;font:inherit;font-weight:var(--ui-font-medium, 500);line-height:var(--ui-line-height-tight);padding:var(--ui-space-2) var(--ui-space-3);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host([data-size='sm']) ::slotted(button){padding:var(--ui-space-1) var(--ui-space-2);font-size:0.875rem}:host([data-size='lg']) ::slotted(button){min-block-size:var(--ui-control-min-block-size, 2.75rem);padding:var(--ui-space-3) var(--ui-space-4);font-size:1rem}::slotted(button:hover:enabled){background:var(--ui-action-secondary-surface-hover, var(--ui-surface-muted));border-color:var(--ui-control-border-hover, var(--ui-border-strong))}::slotted(button:active:enabled){background:var(--ui-surface-subtle)}:host([data-variant='solid']) ::slotted(button){border-color:var(--ui-action-primary-surface, var(--ui-accent-solid));background:var(--ui-action-primary-surface, var(--ui-accent-solid));color:var(--ui-action-primary-text, var(--ui-text-on-accent));box-shadow:var(--ui-button-solid-shadow, inset 0 1px rgb(255 255 255 / 0.16), var(--ui-shadow-xs))}:host([data-variant='solid']) ::slotted(button:hover:enabled){background:var(--ui-action-primary-surface-hover, var(--ui-accent-hover));border-color:var(--ui-action-primary-surface-hover, var(--ui-accent-hover));box-shadow:var(--ui-shadow-sm);transform:translateY(-1px)}:host([data-variant='solid']) ::slotted(button:active:enabled){background:var(--ui-action-primary-surface-active, var(--ui-accent-active));border-color:var(--ui-action-primary-surface-active, var(--ui-accent-active));box-shadow:none;transform:translateY(0)}:host([data-variant='destructive']) ::slotted(button){border-color:var(--ui-danger-solid);background:var(--ui-danger-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-button-destructive-shadow, inset 0 1px rgb(255 255 255 / 0.14), var(--ui-shadow-xs))}:host([data-variant='destructive']) ::slotted(button:hover:enabled){background:var(--ui-danger-hover);border-color:var(--ui-danger-hover);box-shadow:var(--ui-shadow-sm);transform:translateY(-1px)}:host([data-variant='destructive']) ::slotted(button:active:enabled){box-shadow:none;transform:translateY(0)}:host([data-variant='ghost']) ::slotted(button){border-color:transparent;background:transparent}:host([data-variant='ghost']) ::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:transparent}:host([data-variant='ghost']) ::slotted(button:active:enabled){background:var(--ui-surface-subtle);border-color:transparent}::slotted(button:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}:host([data-disabled='true']),:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(button:disabled){cursor:not-allowed}";export{i as ui_button}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,g as e,h as s,H as n}from"./p-8BGiMGQ0.js";import{i as a,c as o}from"./p-BnGhGgTH.js";const r=class{constructor(e){t(this,e),this.editChange=i(this,"edit-change")}get host(){return e(this)}edit;defaultEdit=!1;disabled=!1;editChange;internalEdit=!1;trigger=null;syncFromProp(){a(this.edit)&&(this.internalEdit=this.edit)}componentWillLoad(){this.internalEdit=o(this.edit,this.defaultEdit)}componentDidLoad(){this.host.ownerDocument.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}disconnectedCallback(){this.host.ownerDocument.removeEventListener("pointerdown",this.onDocumentPointerDown,!0)}requestEdit(t,i,e){this.disabled||this.internalEdit===t||(a(this.edit)||(this.internalEdit=t),this.editChange.emit({edit:t,reason:i,trigger:e}),t?requestAnimationFrame((()=>this.focusEditor())):requestAnimationFrame((()=>this.trigger?.focus())))}focusEditor(){const t=this.host.querySelector('[slot="edit"]'),i=t?.matches("input, textarea, select, button, [tabindex], ui-combobox")?t:t?.querySelector("input, textarea, select, button, [tabindex], ui-combobox"),e=i?.focusInput;"function"==typeof e?e.call(i):i?.focus()}eventTrigger(t){return t.composedPath().find((t=>t instanceof HTMLElement&&t.hasAttribute("data-ui-editable-trigger")))}onClick=t=>{if(this.internalEdit||this.disabled)return;const i=this.eventTrigger(t);i&&(this.trigger=i,this.requestEdit(!0,"activate","pointer"))};onKeyDown=t=>{if(this.internalEdit&&"Escape"===t.key)return t.preventDefault(),t.stopPropagation(),void this.requestEdit(!1,"escape","keyboard");if(this.internalEdit||!["Enter"," "].includes(t.key))return;const i=this.eventTrigger(t);i&&(t.preventDefault(),this.trigger=i,this.requestEdit(!0,"activate","keyboard"))};onDocumentPointerDown=t=>{this.internalEdit&&!t.composedPath().includes(this.host)&&this.requestEdit(!1,"light-dismiss","pointer")};render(){return s(n,{key:"c11babe81053ecc0fb6390507f74d5094c551f48","data-edit":this.internalEdit?"":void 0,"data-disabled":this.disabled?"":void 0,onClick:this.onClick,onKeyDown:this.onKeyDown},s("div",{key:"fbb13fda25a177ff62f4bbb16b8fa7a8d1bfefb6",part:"preview",hidden:this.internalEdit},s("slot",{key:"29537eed3c19da07a61b0236a563912eec332572",name:"preview"})),s("div",{key:"a8cdb53c61041361ff97762bdf1e8e6992706751",part:"edit",hidden:!this.internalEdit},s("slot",{key:"466c6bf07d44ab07ccab1fd138412e43a291dcca",name:"edit"})))}static get watchers(){return{edit:[{syncFromProp:0}]}}};r.style=":host{display:block;min-inline-size:0}[hidden]{display:none !important}";export{r as ui_editable}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as s,h as i,H as e}from"./p-8BGiMGQ0.js";import{c as n}from"./p-hgBUJRDa.js";import{d as o,e as r,i as h}from"./p-JwSoedEO.js";import{i as a,c}from"./p-BnGhGgTH.js";const d=class{constructor(s){t(this,s)}get host(){return s(this)}open;defaultOpen=!1;disabled=!1;internalOpen=!1;contentId="";trigger=null;content=null;syncFromProp(){a(this.open)&&(this.internalOpen=this.open)}syncState(){this.trigger&&this.trigger.setAttribute("aria-expanded",String(this.internalOpen)),this.content&&(this.content.hidden=!this.internalOpen)}componentDidLoad(){this.resolveParts(),this.internalOpen=c(this.open,this.defaultOpen),this.syncState(),this.trigger?.addEventListener("click",this.onTriggerClick),this.trigger?.addEventListener("keydown",this.onTriggerKeydown)}disconnectedCallback(){this.trigger?.removeEventListener("click",this.onTriggerClick),this.trigger?.removeEventListener("keydown",this.onTriggerKeydown)}componentDidUpdate(){this.syncState()}resolveParts(){this.trigger=this.host.querySelector("[data-ui-disclosure-trigger], button, [aria-controls]");const t=this.trigger?.getAttribute("aria-controls")??"";if(t)this.content=document.getElementById(t);else{const t=Array.from(this.host.children);this.content=t.find((t=>t!==this.trigger))??null}this.trigger&&this.content&&(this.content.id||(this.content.id=n("disclosure-content")),this.trigger.setAttribute("aria-controls",this.content.id),this.contentId=this.content.id),this.trigger instanceof HTMLButtonElement?this.trigger.disabled=this.disabled:this.trigger&&this.trigger.setAttribute("aria-disabled",String(this.disabled))}setOpen(t,s){this.internalOpen!==t&&(a(this.open)||(this.internalOpen=t),o(this.host,t?"open":"close",{open:t,reason:s.reason,trigger:s.trigger}))}onTriggerClick=t=>{this.disabled?t.preventDefault():this.setOpen(!this.internalOpen,{reason:"action",trigger:r(t)})};onTriggerKeydown=t=>{!this.disabled&&h(t)&&(t.preventDefault(),this.setOpen(!this.internalOpen,{reason:"action",trigger:"keyboard"}))};render(){return i(e,{key:"91d1df53268f18c8c15192fb66b67baa7053fe93"},i("slot",{key:"578c99f8fd09415c5e63e9f6a860fe204471da2f"}))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{syncState:0}]}}};d.style=":host{display:block}::slotted([hidden]){display:none !important}";export{d as ui_disclosure}
|