@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,708 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-BHG9Rpil.js');
|
|
4
|
-
var positioning = require('./positioning-CCR6ifPj.js');
|
|
5
|
-
var manager = require('./manager-Ce25WRtl.js');
|
|
6
|
-
|
|
7
|
-
/** Formatting is additive: every original character must survive in order.
|
|
8
|
-
* Normalization belongs to submitted output, never the visible editing buffer. */
|
|
9
|
-
function formatEditingValue(raw, selection, format) {
|
|
10
|
-
const unchanged = { display: raw, selection };
|
|
11
|
-
if (!format)
|
|
12
|
-
return unchanged;
|
|
13
|
-
let result;
|
|
14
|
-
try {
|
|
15
|
-
result = format(raw, selection);
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return unchanged;
|
|
19
|
-
}
|
|
20
|
-
if (!result)
|
|
21
|
-
return unchanged;
|
|
22
|
-
const characters = Array.from(raw);
|
|
23
|
-
let cursor = 0;
|
|
24
|
-
for (const character of result.display)
|
|
25
|
-
if (character === characters[cursor])
|
|
26
|
-
cursor += 1;
|
|
27
|
-
if (!Number.isInteger(result.selection.start) || !Number.isInteger(result.selection.end) || cursor !== characters.length || result.selection.start < 0 || result.selection.end < result.selection.start
|
|
28
|
-
|| result.selection.end > result.display.length)
|
|
29
|
-
return unchanged;
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
async function validateField(request, config) {
|
|
33
|
-
let output = request.raw;
|
|
34
|
-
let issues = [];
|
|
35
|
-
const check = () => request.signal.throwIfAborted();
|
|
36
|
-
try {
|
|
37
|
-
check();
|
|
38
|
-
if (config.parse)
|
|
39
|
-
output = await config.parse(request.raw, request);
|
|
40
|
-
check();
|
|
41
|
-
if (config.schema) {
|
|
42
|
-
const result = await config.schema['~standard'].validate(output);
|
|
43
|
-
check();
|
|
44
|
-
if (result.issues)
|
|
45
|
-
issues = result.issues;
|
|
46
|
-
else if ('value' in result)
|
|
47
|
-
output = result.value;
|
|
48
|
-
}
|
|
49
|
-
if (!issues.some(issue => issue.severity !== 'warning')) {
|
|
50
|
-
if (config.normalize)
|
|
51
|
-
output = await config.normalize(output, request);
|
|
52
|
-
check();
|
|
53
|
-
if (config.validator) {
|
|
54
|
-
const result = await config.validator(output, request);
|
|
55
|
-
check();
|
|
56
|
-
issues = [...issues, ...(result.issues ?? [])];
|
|
57
|
-
if ('output' in result)
|
|
58
|
-
output = result.output;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
check();
|
|
64
|
-
issues = [{ message: error instanceof Error ? error.message : 'Unable to validate this value.' }];
|
|
65
|
-
}
|
|
66
|
-
issues = [...issues, ...(config.issues ?? [])];
|
|
67
|
-
return { output: issues.some(issue => issue.severity !== 'warning') ? undefined : output, issues };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const uiComboboxCss = () => `: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}`;
|
|
71
|
-
|
|
72
|
-
const UICombobox = class {
|
|
73
|
-
constructor(hostRef) {
|
|
74
|
-
index.registerInstance(this, hostRef);
|
|
75
|
-
this.queryChange = index.createEvent(this, "query-change");
|
|
76
|
-
this.valueChange = index.createEvent(this, "value-change");
|
|
77
|
-
this.freeEntry = index.createEvent(this, "free-entry");
|
|
78
|
-
this.createEntry = index.createEvent(this, "create-entry");
|
|
79
|
-
this.dependencyInvalidate = index.createEvent(this, "dependency-invalidate");
|
|
80
|
-
this.validationChange = index.createEvent(this, "validation-change");
|
|
81
|
-
this.optionsChange = index.createEvent(this, "options-change");
|
|
82
|
-
this.addItem = index.createEvent(this, "add-item");
|
|
83
|
-
this.removeItem = index.createEvent(this, "remove-item");
|
|
84
|
-
this.createItem = index.createEvent(this, "create-item");
|
|
85
|
-
}
|
|
86
|
-
get host() { return index.getElement(this); }
|
|
87
|
-
/** Accessible visible label, associated with the native text input. */
|
|
88
|
-
label = '';
|
|
89
|
-
placeholder = '';
|
|
90
|
-
name = '';
|
|
91
|
-
/**
|
|
92
|
-
* Controlled canonical value. Undefined selects uncontrolled mode; null means no selection.
|
|
93
|
-
* With `multiple`, this is the controlled list of selected items instead.
|
|
94
|
-
*/
|
|
95
|
-
value;
|
|
96
|
-
defaultValue;
|
|
97
|
-
/** Render selected values as removable chips before the cursor. `value` becomes the item list. */
|
|
98
|
-
multiple = false;
|
|
99
|
-
/** Characters that commit the current query and leave the input ready for the next item (multiple only). */
|
|
100
|
-
tokenSeparators = [];
|
|
101
|
-
/** Controlled raw editing text; independent of canonical selection. */
|
|
102
|
-
query;
|
|
103
|
-
defaultQuery = '';
|
|
104
|
-
/** Immutable configuration; replace the object/context when dependencies change. */
|
|
105
|
-
config = {};
|
|
106
|
-
disabled = false;
|
|
107
|
-
readOnly = false;
|
|
108
|
-
required = false;
|
|
109
|
-
size = 'md';
|
|
110
|
-
/** Keep the native label accessible while allowing compact composed controls. */
|
|
111
|
-
labelVisibility = 'visible';
|
|
112
|
-
disclosure = false;
|
|
113
|
-
clearable = false;
|
|
114
|
-
/** Optional description shown by the connected question-mark button. */
|
|
115
|
-
help = '';
|
|
116
|
-
queryChange;
|
|
117
|
-
/** Single mode: the ComboboxChange. Multiple mode: the full current item list on any change. */
|
|
118
|
-
valueChange;
|
|
119
|
-
freeEntry;
|
|
120
|
-
createEntry;
|
|
121
|
-
dependencyInvalidate;
|
|
122
|
-
validationChange;
|
|
123
|
-
/** Supplies the current result rows for framework-owned rich slots. */
|
|
124
|
-
optionsChange;
|
|
125
|
-
/** Multiple mode: a suggestion or exact-match token was committed as a new item. */
|
|
126
|
-
addItem;
|
|
127
|
-
/** Multiple mode: a selected item was removed via chip keyboard controls. */
|
|
128
|
-
removeItem;
|
|
129
|
-
/** Multiple mode: an unmatched query was submitted for creation. */
|
|
130
|
-
createItem;
|
|
131
|
-
raw = '';
|
|
132
|
-
display = '';
|
|
133
|
-
selected = null;
|
|
134
|
-
expanded = false;
|
|
135
|
-
rows = [];
|
|
136
|
-
active = -1;
|
|
137
|
-
loading = false;
|
|
138
|
-
helpOpen = false;
|
|
139
|
-
lookupError = '';
|
|
140
|
-
validation = { status: 'pristine', touched: false, dirty: false, issues: [] };
|
|
141
|
-
input;
|
|
142
|
-
popup;
|
|
143
|
-
field;
|
|
144
|
-
surface;
|
|
145
|
-
lookup;
|
|
146
|
-
validationRun;
|
|
147
|
-
lookupTimer;
|
|
148
|
-
composing = false;
|
|
149
|
-
initialRaw = '';
|
|
150
|
-
overlayId = `ui-combobox-${Math.random().toString(36).slice(2)}`;
|
|
151
|
-
alive = false;
|
|
152
|
-
fullSet = false;
|
|
153
|
-
knownOptions = new Map();
|
|
154
|
-
awaitingLabel = null;
|
|
155
|
-
proposedChange;
|
|
156
|
-
formattedRaw;
|
|
157
|
-
formattedWith;
|
|
158
|
-
/** Multiple mode: the controlled selected items (from `value`). Empty otherwise. */
|
|
159
|
-
get items() {
|
|
160
|
-
return this.multiple && Array.isArray(this.value) ? this.value : [];
|
|
161
|
-
}
|
|
162
|
-
get selectedValues() { return new Set(this.items.map(item => item.value)); }
|
|
163
|
-
componentWillLoad() {
|
|
164
|
-
if (this.multiple) {
|
|
165
|
-
this.selected = null;
|
|
166
|
-
this.raw = this.query ?? this.defaultQuery;
|
|
167
|
-
this.display = this.raw;
|
|
168
|
-
this.initialRaw = this.raw;
|
|
169
|
-
this.applyServerIssues();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
this.selected = (this.value !== undefined ? this.value : this.defaultValue ?? null);
|
|
173
|
-
this.raw = this.query ?? this.defaultQuery;
|
|
174
|
-
if (this.query === undefined && !this.raw && this.selected !== null) {
|
|
175
|
-
this.raw = this.config.options?.find(row => row.value === this.selected)?.label ?? this.selected;
|
|
176
|
-
}
|
|
177
|
-
if (this.query === undefined && this.selected !== null && this.raw === this.selected)
|
|
178
|
-
this.awaitingLabel = this.selected;
|
|
179
|
-
this.display = this.raw;
|
|
180
|
-
this.initialRaw = this.raw;
|
|
181
|
-
this.applyServerIssues();
|
|
182
|
-
}
|
|
183
|
-
connectedCallback() { this.alive = true; this.setupSurface(); }
|
|
184
|
-
componentDidLoad() { this.setupSurface(); }
|
|
185
|
-
componentDidUpdate() {
|
|
186
|
-
if (this.input && !this.composing && this.input.value !== this.display)
|
|
187
|
-
this.input.value = this.display;
|
|
188
|
-
if (this.expanded)
|
|
189
|
-
this.surface?.refresh();
|
|
190
|
-
}
|
|
191
|
-
disconnectedCallback() {
|
|
192
|
-
this.alive = false;
|
|
193
|
-
this.close();
|
|
194
|
-
this.validationRun?.abort();
|
|
195
|
-
this.surface?.destroy();
|
|
196
|
-
this.surface = undefined;
|
|
197
|
-
}
|
|
198
|
-
setupSurface() {
|
|
199
|
-
if (!this.surface && this.popup && this.field)
|
|
200
|
-
this.surface = positioning.createAnchoredSurface(this.popup, { anchor: this.field, placement: 'bottom-start' });
|
|
201
|
-
}
|
|
202
|
-
syncValue() {
|
|
203
|
-
// Multiple mode: `value` is the item list; Stencil re-renders chips on reference change.
|
|
204
|
-
if (this.multiple || this.value === undefined)
|
|
205
|
-
return;
|
|
206
|
-
this.selected = this.value;
|
|
207
|
-
if (this.query === undefined) {
|
|
208
|
-
const proposal = this.proposedChange;
|
|
209
|
-
const option = this.config.options?.find(row => row.value === this.selected)
|
|
210
|
-
?? (this.selected === null ? undefined : this.knownOptions.get(this.selected));
|
|
211
|
-
const nextRaw = proposal?.value === this.selected ? proposal.query : option?.label ?? this.selected ?? '';
|
|
212
|
-
if (proposal?.value !== this.selected || nextRaw !== this.raw) {
|
|
213
|
-
this.raw = nextRaw;
|
|
214
|
-
this.display = this.raw;
|
|
215
|
-
this.formattedRaw = undefined;
|
|
216
|
-
}
|
|
217
|
-
this.awaitingLabel = !option && this.selected !== null ? this.selected : null;
|
|
218
|
-
}
|
|
219
|
-
this.resetValidation();
|
|
220
|
-
}
|
|
221
|
-
syncQuery() {
|
|
222
|
-
if (this.query === undefined || this.query === this.raw)
|
|
223
|
-
return;
|
|
224
|
-
// Only a selection proposal's query echo retains an uncontrolled identity.
|
|
225
|
-
// Other owner text replacements are edits, just like native input.
|
|
226
|
-
if (this.value === undefined && this.proposedChange?.query !== this.query)
|
|
227
|
-
this.selected = null;
|
|
228
|
-
this.awaitingLabel = null;
|
|
229
|
-
this.formattedRaw = undefined;
|
|
230
|
-
this.raw = this.query;
|
|
231
|
-
this.display = this.raw;
|
|
232
|
-
this.resetValidation();
|
|
233
|
-
if (this.expanded)
|
|
234
|
-
this.search('input');
|
|
235
|
-
}
|
|
236
|
-
syncDisabled() {
|
|
237
|
-
if (this.disabled || this.readOnly) {
|
|
238
|
-
this.close();
|
|
239
|
-
this.resetValidation();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
syncConfig(next, previous) {
|
|
243
|
-
this.validationRun?.abort();
|
|
244
|
-
if (next.provider !== previous?.provider || next.context !== previous?.context)
|
|
245
|
-
this.knownOptions.clear();
|
|
246
|
-
if (next.context !== previous?.context) {
|
|
247
|
-
this.close();
|
|
248
|
-
const policy = next.invalidation ?? 'retain-query';
|
|
249
|
-
if (this.multiple) {
|
|
250
|
-
if (policy === 'clear')
|
|
251
|
-
this.setMultiQuery('', 'programmatic');
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
const value = policy === 'retain' ? this.selected : null;
|
|
255
|
-
const query = policy === 'clear' ? '' : this.raw;
|
|
256
|
-
this.commit(value, query, null, 'invalidation', 'programmatic');
|
|
257
|
-
}
|
|
258
|
-
this.validation = { status: 'pristine', touched: false, dirty: this.raw !== this.initialRaw, issues: [] };
|
|
259
|
-
}
|
|
260
|
-
this.applyServerIssues();
|
|
261
|
-
if (this.expanded)
|
|
262
|
-
this.search('context');
|
|
263
|
-
}
|
|
264
|
-
applyServerIssues() {
|
|
265
|
-
const issues = this.config.issues ?? [];
|
|
266
|
-
if (issues.length)
|
|
267
|
-
this.setValidation({ issues }, this.validation.touched);
|
|
268
|
-
else
|
|
269
|
-
this.resetValidation();
|
|
270
|
-
}
|
|
271
|
-
resetValidation() {
|
|
272
|
-
this.validationRun?.abort();
|
|
273
|
-
this.validation = { status: 'pristine', touched: this.validation.touched, dirty: this.raw !== this.initialRaw, issues: [] };
|
|
274
|
-
this.validationChange?.emit(this.validation);
|
|
275
|
-
}
|
|
276
|
-
cancelLookup() {
|
|
277
|
-
clearTimeout(this.lookupTimer);
|
|
278
|
-
this.lookup?.abort();
|
|
279
|
-
this.lookup = undefined;
|
|
280
|
-
this.loading = false;
|
|
281
|
-
}
|
|
282
|
-
close() {
|
|
283
|
-
this.expanded = false;
|
|
284
|
-
this.active = -1;
|
|
285
|
-
this.cancelLookup();
|
|
286
|
-
this.surface?.hide();
|
|
287
|
-
manager.closeOverlay(this.overlayId);
|
|
288
|
-
}
|
|
289
|
-
open(reason = 'input') {
|
|
290
|
-
if (this.disabled || this.readOnly)
|
|
291
|
-
return;
|
|
292
|
-
this.expanded = true;
|
|
293
|
-
if (this.popup && this.field)
|
|
294
|
-
this.popup.style.minWidth = `${this.field.getBoundingClientRect().width}px`;
|
|
295
|
-
this.surface?.show();
|
|
296
|
-
manager.openOverlay({ id: this.overlayId, element: this.popup, relatedElements: [this.host], modal: false,
|
|
297
|
-
requestClose: () => this.close() });
|
|
298
|
-
this.search(reason);
|
|
299
|
-
}
|
|
300
|
-
search(reason) {
|
|
301
|
-
this.cancelLookup();
|
|
302
|
-
this.fullSet = reason === 'disclosure';
|
|
303
|
-
this.active = -1;
|
|
304
|
-
this.lookupError = '';
|
|
305
|
-
const config = this.config;
|
|
306
|
-
const query = this.fullSet ? '' : this.raw;
|
|
307
|
-
const controller = new AbortController();
|
|
308
|
-
this.lookup = controller;
|
|
309
|
-
const apply = (options) => {
|
|
310
|
-
if (controller.signal.aborted || !this.alive)
|
|
311
|
-
return;
|
|
312
|
-
for (const option of options)
|
|
313
|
-
this.knownOptions.set(option.value, option);
|
|
314
|
-
const selectedOption = this.selected === null ? undefined : this.knownOptions.get(this.selected);
|
|
315
|
-
if (this.query === undefined && this.awaitingLabel === this.selected && selectedOption) {
|
|
316
|
-
this.raw = selectedOption.label;
|
|
317
|
-
this.display = this.raw;
|
|
318
|
-
this.awaitingLabel = null;
|
|
319
|
-
this.formattedRaw = undefined;
|
|
320
|
-
this.resetValidation();
|
|
321
|
-
}
|
|
322
|
-
const ids = new Set();
|
|
323
|
-
const selected = this.multiple ? this.selectedValues : undefined;
|
|
324
|
-
this.rows = options.filter(option => {
|
|
325
|
-
if (ids.has(option.id))
|
|
326
|
-
return false;
|
|
327
|
-
ids.add(option.id);
|
|
328
|
-
if (this.fullSet)
|
|
329
|
-
return true;
|
|
330
|
-
// Multiple mode always hides already-selected items and, absent an owner
|
|
331
|
-
// filter, falls back to a client label match (there is no unfiltered pass-through).
|
|
332
|
-
if (selected)
|
|
333
|
-
return !selected.has(option.value)
|
|
334
|
-
&& (config.filter ? config.filter(option, query, config.context)
|
|
335
|
-
: option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
|
|
336
|
-
return config.filter ? config.filter(option, query, config.context)
|
|
337
|
-
: config.provider ? true : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase());
|
|
338
|
-
});
|
|
339
|
-
const groups = new Map();
|
|
340
|
-
for (const row of this.rows) {
|
|
341
|
-
const group = row.group ?? '';
|
|
342
|
-
if (!groups.has(group))
|
|
343
|
-
groups.set(group, []);
|
|
344
|
-
groups.get(group).push(row);
|
|
345
|
-
}
|
|
346
|
-
this.rows = [...groups.values()].flat();
|
|
347
|
-
this.loading = false;
|
|
348
|
-
this.optionsChange.emit(this.rows);
|
|
349
|
-
};
|
|
350
|
-
if (!config.provider) {
|
|
351
|
-
apply(config.options ?? []);
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
this.rows = [];
|
|
355
|
-
this.loading = true;
|
|
356
|
-
this.lookupTimer = setTimeout(async () => {
|
|
357
|
-
try {
|
|
358
|
-
apply(await config.provider({ query, context: config.context, signal: controller.signal, reason }));
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
if (controller.signal.aborted || !this.alive)
|
|
362
|
-
return;
|
|
363
|
-
this.loading = false;
|
|
364
|
-
this.lookupError = error instanceof Error ? error.message : 'Unable to load suggestions.';
|
|
365
|
-
}
|
|
366
|
-
}, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
|
|
367
|
-
}
|
|
368
|
-
get canCreate() {
|
|
369
|
-
const candidates = this.config.options ? [...this.config.options, ...this.rows] : this.rows;
|
|
370
|
-
return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
|
|
371
|
-
&& !candidates.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
|
|
372
|
-
}
|
|
373
|
-
format(timing) {
|
|
374
|
-
if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
|
|
375
|
-
return;
|
|
376
|
-
// Selection is now in display coordinates; do not map it as raw a second time.
|
|
377
|
-
if (this.formattedRaw === this.raw && this.formattedWith === this.config.format)
|
|
378
|
-
return;
|
|
379
|
-
const result = formatEditingValue(this.raw, {
|
|
380
|
-
start: this.input.selectionStart ?? this.raw.length, end: this.input.selectionEnd ?? this.raw.length,
|
|
381
|
-
direction: this.input.selectionDirection ?? 'none',
|
|
382
|
-
}, this.config.format);
|
|
383
|
-
this.formattedRaw = this.raw;
|
|
384
|
-
this.formattedWith = this.config.format;
|
|
385
|
-
this.display = result.display;
|
|
386
|
-
if (this.input.value !== result.display) {
|
|
387
|
-
this.input.value = result.display;
|
|
388
|
-
this.input.setSelectionRange(result.selection.start, result.selection.end, result.selection.direction);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
onInput = (event) => {
|
|
392
|
-
// Composition updates remain entirely native until compositionend.
|
|
393
|
-
if (this.composing || event.isComposing)
|
|
394
|
-
return;
|
|
395
|
-
this.awaitingLabel = null;
|
|
396
|
-
this.formattedRaw = undefined;
|
|
397
|
-
this.raw = this.input.value;
|
|
398
|
-
this.display = this.raw;
|
|
399
|
-
this.resetValidation();
|
|
400
|
-
this.format('input');
|
|
401
|
-
this.queryChange.emit({ query: this.raw, display: this.display, trigger: 'keyboard' });
|
|
402
|
-
if (this.selected !== null)
|
|
403
|
-
this.commit(null, this.raw, null, 'clear', 'keyboard');
|
|
404
|
-
this.open();
|
|
405
|
-
if (this.config.validateOn === 'input')
|
|
406
|
-
void this.validate();
|
|
407
|
-
queueMicrotask(() => {
|
|
408
|
-
if (this.query !== undefined && this.query !== this.raw)
|
|
409
|
-
this.syncQuery();
|
|
410
|
-
});
|
|
411
|
-
};
|
|
412
|
-
commit(value, query, option, kind, trigger) {
|
|
413
|
-
this.awaitingLabel = null;
|
|
414
|
-
const queryChanged = query !== this.raw;
|
|
415
|
-
if (this.value === undefined)
|
|
416
|
-
this.selected = value;
|
|
417
|
-
if (this.query === undefined && queryChanged) {
|
|
418
|
-
this.raw = query;
|
|
419
|
-
this.display = query;
|
|
420
|
-
this.formattedRaw = undefined;
|
|
421
|
-
}
|
|
422
|
-
this.resetValidation();
|
|
423
|
-
const detail = { value, query, option, kind, trigger };
|
|
424
|
-
const proposal = { value, query };
|
|
425
|
-
this.proposedChange = proposal;
|
|
426
|
-
this.valueChange.emit(detail);
|
|
427
|
-
if (queryChanged)
|
|
428
|
-
this.queryChange.emit({ query, display: query, trigger });
|
|
429
|
-
if (kind === 'create')
|
|
430
|
-
this.createEntry.emit(detail);
|
|
431
|
-
if (kind === 'free-entry')
|
|
432
|
-
this.freeEntry.emit(detail);
|
|
433
|
-
if (kind === 'invalidation')
|
|
434
|
-
this.dependencyInvalidate.emit(detail);
|
|
435
|
-
// Settle after all owner notifications (including Vue's queued update).
|
|
436
|
-
// A retained prop does not fire a Stencil watcher, so rejection must be
|
|
437
|
-
// reconciled explicitly while the proposal still identifies an edit echo.
|
|
438
|
-
queueMicrotask(() => {
|
|
439
|
-
if (this.proposedChange !== proposal)
|
|
440
|
-
return;
|
|
441
|
-
if (this.value !== undefined && this.value !== proposal.value)
|
|
442
|
-
this.syncValue();
|
|
443
|
-
if (this.query !== undefined && this.query !== proposal.query) {
|
|
444
|
-
if (this.value === undefined) {
|
|
445
|
-
this.selected = null;
|
|
446
|
-
this.resetValidation();
|
|
447
|
-
}
|
|
448
|
-
this.syncQuery();
|
|
449
|
-
}
|
|
450
|
-
this.proposedChange = undefined;
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
choose(index, trigger) {
|
|
454
|
-
const option = this.rows[index];
|
|
455
|
-
if (option?.disabled)
|
|
456
|
-
return;
|
|
457
|
-
if (this.multiple) {
|
|
458
|
-
if (option)
|
|
459
|
-
this.addSelectedItem(option, trigger);
|
|
460
|
-
else if (this.canCreate && index === this.rows.length)
|
|
461
|
-
this.createSelectedItem(this.raw.trim(), trigger);
|
|
462
|
-
else
|
|
463
|
-
return;
|
|
464
|
-
this.setMultiQuery('', trigger);
|
|
465
|
-
this.close();
|
|
466
|
-
this.input?.focus();
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
if (option)
|
|
470
|
-
this.commit(option.value, option.label, option, 'selection', trigger);
|
|
471
|
-
else if (this.canCreate && index === this.rows.length)
|
|
472
|
-
this.commit(null, this.raw, null, 'create', trigger);
|
|
473
|
-
else
|
|
474
|
-
return;
|
|
475
|
-
this.close();
|
|
476
|
-
this.input?.focus();
|
|
477
|
-
if (this.config.validateOn !== 'submit')
|
|
478
|
-
queueMicrotask(() => void this.validate());
|
|
479
|
-
}
|
|
480
|
-
// --- Multiple-mode helpers ---------------------------------------------
|
|
481
|
-
emitItems(items) { this.valueChange.emit(items); }
|
|
482
|
-
setMultiQuery(query, trigger) {
|
|
483
|
-
if (this.query === undefined) {
|
|
484
|
-
this.raw = query;
|
|
485
|
-
this.display = query;
|
|
486
|
-
this.formattedRaw = undefined;
|
|
487
|
-
}
|
|
488
|
-
if (this.input)
|
|
489
|
-
this.input.value = query;
|
|
490
|
-
this.queryChange.emit({ query, display: query, trigger });
|
|
491
|
-
}
|
|
492
|
-
addSelectedItem(option, trigger) {
|
|
493
|
-
this.addItem.emit({ item: option, index: this.items.length, trigger });
|
|
494
|
-
this.emitItems([...this.items, option]);
|
|
495
|
-
}
|
|
496
|
-
createSelectedItem(query, trigger) {
|
|
497
|
-
if (!query)
|
|
498
|
-
return;
|
|
499
|
-
this.createItem.emit({ query, trigger });
|
|
500
|
-
}
|
|
501
|
-
commitQuery(trigger) {
|
|
502
|
-
const query = this.raw.trim();
|
|
503
|
-
if (!query)
|
|
504
|
-
return;
|
|
505
|
-
const normalized = query.toLocaleLowerCase();
|
|
506
|
-
const option = this.rows.find(row => row.label.trim().toLocaleLowerCase() === normalized);
|
|
507
|
-
if (option) {
|
|
508
|
-
this.setMultiQuery('', trigger);
|
|
509
|
-
this.addSelectedItem(option, trigger);
|
|
510
|
-
}
|
|
511
|
-
else if (this.config.allowCreate) {
|
|
512
|
-
this.setMultiQuery('', trigger);
|
|
513
|
-
this.createSelectedItem(query, trigger);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
removeItemAt(index, trigger) {
|
|
517
|
-
const item = this.items[index];
|
|
518
|
-
if (!item || item.disabled || this.disabled || this.readOnly)
|
|
519
|
-
return;
|
|
520
|
-
this.removeItem.emit({ item, index, trigger });
|
|
521
|
-
this.emitItems(this.items.filter((_, position) => position !== index));
|
|
522
|
-
requestAnimationFrame(() => {
|
|
523
|
-
const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
|
|
524
|
-
const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
|
|
525
|
-
if (next && next.dataset.value !== item.value)
|
|
526
|
-
next.focus();
|
|
527
|
-
else
|
|
528
|
-
void this.focusInput();
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
focusItem(index) {
|
|
532
|
-
this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
|
|
533
|
-
}
|
|
534
|
-
onItemKeyDown = (event, index) => {
|
|
535
|
-
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
536
|
-
return;
|
|
537
|
-
if (event.key === 'ArrowLeft') {
|
|
538
|
-
event.preventDefault();
|
|
539
|
-
event.stopPropagation();
|
|
540
|
-
this.focusItem(Math.max(0, index - 1));
|
|
541
|
-
}
|
|
542
|
-
else if (event.key === 'ArrowRight') {
|
|
543
|
-
event.preventDefault();
|
|
544
|
-
event.stopPropagation();
|
|
545
|
-
if (index === this.items.length - 1)
|
|
546
|
-
void this.focusInput();
|
|
547
|
-
else
|
|
548
|
-
this.focusItem(index + 1);
|
|
549
|
-
}
|
|
550
|
-
else if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
551
|
-
event.preventDefault();
|
|
552
|
-
event.stopPropagation();
|
|
553
|
-
this.removeItemAt(index, 'keyboard');
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
handleMultipleKeydown(event) {
|
|
557
|
-
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
558
|
-
return false;
|
|
559
|
-
if (this.tokenSeparators.includes(event.key)) {
|
|
560
|
-
event.preventDefault();
|
|
561
|
-
event.stopPropagation();
|
|
562
|
-
this.commitQuery('keyboard');
|
|
563
|
-
return true;
|
|
564
|
-
}
|
|
565
|
-
if (this.raw || (this.input?.selectionStart ?? 0) > 0)
|
|
566
|
-
return false;
|
|
567
|
-
if (event.key === 'ArrowLeft' && this.items.length) {
|
|
568
|
-
event.preventDefault();
|
|
569
|
-
this.focusItem(this.items.length - 1);
|
|
570
|
-
return true;
|
|
571
|
-
}
|
|
572
|
-
if (event.key === 'Backspace' && this.items.length) {
|
|
573
|
-
event.preventDefault();
|
|
574
|
-
this.removeItemAt(this.items.length - 1, 'keyboard');
|
|
575
|
-
return true;
|
|
576
|
-
}
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
-
move(key) {
|
|
580
|
-
const indices = this.rows.flatMap((row, index) => row.disabled ? [] : [index]);
|
|
581
|
-
if (this.canCreate)
|
|
582
|
-
indices.push(this.rows.length);
|
|
583
|
-
if (!indices.length)
|
|
584
|
-
return;
|
|
585
|
-
const current = indices.indexOf(this.active);
|
|
586
|
-
const next = key === 'Home' ? 0 : key === 'End' ? indices.length - 1
|
|
587
|
-
: key === 'ArrowDown' ? Math.min(current + 1, indices.length - 1)
|
|
588
|
-
: current < 0 ? indices.length - 1 : Math.max(0, current - 1);
|
|
589
|
-
this.active = indices[next];
|
|
590
|
-
requestAnimationFrame(() => this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({ block: 'nearest' }));
|
|
591
|
-
}
|
|
592
|
-
onKeydown = (event) => {
|
|
593
|
-
if (this.composing || event.isComposing || this.disabled || this.readOnly)
|
|
594
|
-
return;
|
|
595
|
-
if (this.multiple && this.handleMultipleKeydown(event))
|
|
596
|
-
return;
|
|
597
|
-
if (event.key === 'Escape' && this.expanded) {
|
|
598
|
-
event.preventDefault();
|
|
599
|
-
event.stopPropagation();
|
|
600
|
-
this.close();
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
if (event.key === 'Tab') {
|
|
604
|
-
this.close();
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
608
|
-
return;
|
|
609
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
610
|
-
event.preventDefault();
|
|
611
|
-
if (!this.expanded)
|
|
612
|
-
this.open('disclosure');
|
|
613
|
-
this.move(event.key);
|
|
614
|
-
}
|
|
615
|
-
else if ((event.key === 'Home' || event.key === 'End') && this.expanded && this.active >= 0) {
|
|
616
|
-
event.preventDefault();
|
|
617
|
-
this.move(event.key);
|
|
618
|
-
}
|
|
619
|
-
else if (event.key === 'Enter' && this.expanded) {
|
|
620
|
-
if (this.active >= 0) {
|
|
621
|
-
event.preventDefault();
|
|
622
|
-
this.choose(this.active, 'keyboard');
|
|
623
|
-
}
|
|
624
|
-
else if (this.config.allowFreeText) {
|
|
625
|
-
event.preventDefault();
|
|
626
|
-
this.commit(null, this.raw, null, 'free-entry', 'keyboard');
|
|
627
|
-
this.close();
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
onFocusOut = (event) => {
|
|
632
|
-
if (event.relatedTarget instanceof Node && this.host.shadowRoot?.contains(event.relatedTarget))
|
|
633
|
-
return;
|
|
634
|
-
this.close();
|
|
635
|
-
this.format('blur');
|
|
636
|
-
this.validation = { ...this.validation, touched: true };
|
|
637
|
-
if (!this.multiple && this.config.allowFreeText && this.selected === null)
|
|
638
|
-
this.commit(null, this.raw, null, 'free-entry', 'keyboard');
|
|
639
|
-
if ((this.config.validateOn ?? 'blur') === 'blur')
|
|
640
|
-
void this.validate();
|
|
641
|
-
};
|
|
642
|
-
setValidation(result, touched = this.validation.touched) {
|
|
643
|
-
const blocking = result.issues.some(issue => issue.severity !== 'warning');
|
|
644
|
-
this.validation = { status: blocking ? 'error' : result.issues.length ? 'warning' : 'valid',
|
|
645
|
-
touched, dirty: this.raw !== this.initialRaw, ...result };
|
|
646
|
-
this.validationChange?.emit(this.validation);
|
|
647
|
-
}
|
|
648
|
-
/** Validate for submission. Caller submits only non-pending, non-error output. */
|
|
649
|
-
async validate() {
|
|
650
|
-
this.validationRun?.abort();
|
|
651
|
-
const run = new AbortController();
|
|
652
|
-
this.validationRun = run;
|
|
653
|
-
this.validation = { ...this.validation, status: 'pending', output: undefined };
|
|
654
|
-
this.validationChange.emit(this.validation);
|
|
655
|
-
try {
|
|
656
|
-
const result = await validateField({ raw: this.raw, value: this.selected, context: this.config.context, signal: run.signal }, this.config);
|
|
657
|
-
if (this.required && !this.raw.trim())
|
|
658
|
-
result.issues = [...result.issues, { message: 'A value is required.' }];
|
|
659
|
-
else if (this.raw && this.selected === null && !this.config.allowFreeText && !this.config.allowCreate)
|
|
660
|
-
result.issues = [...result.issues, { message: 'Choose a suggestion.' }];
|
|
661
|
-
if (result.issues.some(issue => issue.severity !== 'warning'))
|
|
662
|
-
result.output = undefined;
|
|
663
|
-
if (!run.signal.aborted && this.alive)
|
|
664
|
-
this.setValidation(result);
|
|
665
|
-
}
|
|
666
|
-
catch { /* Aborted work never becomes current field state. */ }
|
|
667
|
-
return this.validation;
|
|
668
|
-
}
|
|
669
|
-
/** Focus the native editing input from a composed control. */
|
|
670
|
-
async focusInput() { this.input?.focus(); }
|
|
671
|
-
render() {
|
|
672
|
-
const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
|
|
673
|
-
const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
|
|
674
|
-
const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
|
|
675
|
-
return index.h(index.Host, { key: 'fc4c0192d3be88d8c0199ae1bcca44232bd22351', "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, index.h("label", { key: 'bdd0d244c6ef448978fa77aac3a2d3b71d713553', htmlFor: "input", part: "label", class: this.labelVisibility === 'sr-only' ? 'sr-only' : undefined }, this.label, this.required ? ' *' : ''), index.h("div", { key: 'afb3972aab52171a3b25ede863c31059e56f5d91', class: "field", part: "field", ref: element => this.field = element, onClick: event => {
|
|
676
|
-
if (!event.composedPath().some(node => node instanceof HTMLButtonElement))
|
|
677
|
-
this.input?.focus();
|
|
678
|
-
} }, index.h("slot", { key: '65e4e201d6c11cd2638e392e1298662de7ba4d57', name: "start" }), this.multiple && index.h("div", { key: 'b80b5b85fa0540139b9756fcc494aef9df245c15', class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index$1) => index.h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: event => this.onItemKeyDown(event, index$1) }, index.h("slot", { name: `item-${item.id}` }, index.h("ui-chip", { appearance: "pill" }, item.label))))), index.h("input", { key: '64f76055ae412cc87119270eec10c69000a72563', id: "input", ref: element => this.input = element, role: "combobox", "aria-autocomplete": "list", "aria-expanded": String(this.expanded), "aria-controls": "listbox", "aria-activedescendant": this.expanded && this.active >= 0 ? `option-${this.active}` : undefined, "aria-describedby": description, "aria-invalid": String(this.validation.status === 'error'), "aria-busy": String(this.validation.status === 'pending'), value: this.display, placeholder: this.placeholder, name: this.name || undefined, disabled: this.disabled, readOnly: this.readOnly, required: this.required, autoComplete: "off", part: "input", onInput: this.onInput, onKeyDown: this.onKeydown, onCompositionstart: () => this.composing = true, onCompositionend: () => { this.composing = false; this.onInput(new InputEvent('input')); } }), this.clearable && index.h("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(); } }, "\u00D7"), this.help && index.h("button", { key: '9a559d49a495ead3dbf159f170c594e0aaa0d0d0', id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, index.h("span", { key: '73940e568b976f85399d5baa5e247a4a606d0039', "aria-hidden": "true" }, "?")), this.disclosure && index.h("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: () => {
|
|
679
|
-
if (this.expanded)
|
|
680
|
-
this.close();
|
|
681
|
-
else
|
|
682
|
-
this.open('disclosure');
|
|
683
|
-
this.input?.focus();
|
|
684
|
-
} }, index.h("span", { key: '7d3b10a765ee0a6c40d7b0b49e98c676a5837944', "aria-hidden": "true" }, "\u2304"))), this.help && index.h("ui-tooltip", { key: 'efff00f45dc281b727789eb2aa84ff772bb5c925', id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), index.h("div", { key: '770bc12b873026b571bd3ae2a80416e8af52b8d4', class: "popup", part: "popup", hidden: !this.expanded, ref: element => this.popup = element }, index.h("div", { key: 'ed48c8dd8b672a577d567ca5e795b8a53fde2761', id: "listbox", role: "listbox", "aria-label": `${this.label} suggestions`, "aria-busy": String(this.loading) }, groups.map(group => index.h("div", { role: group ? 'group' : 'presentation', "aria-label": group || undefined }, group && index.h("div", { class: "group", part: "group" }, group), this.rows.map((row, index$1) => (row.group ?? '') !== group ? null : index.h("div", { id: `option-${index$1}`, role: "option", "aria-selected": String(this.selected === row.value), "aria-disabled": String(Boolean(row.disabled)), "data-active": this.active === index$1 ? '' : undefined, part: "option", class: "option", onPointerDown: event => event.preventDefault(), onClick: () => this.choose(index$1, 'pointer') }, index.h("slot", { name: `option-${row.id}` }, index.h("span", { class: "primary", part: "option-primary" }, row.label), row.description && index.h("span", { class: "secondary", part: "option-secondary" }, row.description)))))), this.canCreate && index.h("div", { key: '43215f449bbccde407ef818cee473f69870f6f8c', id: `option-${this.rows.length}`, role: "option", "aria-selected": "false", class: "option", part: "option", "data-active": this.active === this.rows.length ? '' : undefined, onPointerDown: event => event.preventDefault(), onClick: () => this.choose(this.rows.length, 'pointer') }, index.h("slot", { key: '3ff70ff3ab8e24afc369a26e8474e7d1220ed6eb', name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? index.h("div", { class: "message" }, index.h("slot", { name: "loading" }, "Loading suggestions\u2026"))
|
|
685
|
-
: this.lookupError ? index.h("div", { class: "message" }, index.h("slot", { name: "error" }, this.lookupError))
|
|
686
|
-
: !this.rows.length && !this.canCreate ? index.h("div", { class: "message" }, index.h("slot", { name: "empty" }, "No suggestions.")) : null, index.h("slot", { key: '8b1fbd4f5c372393d294d8c218ae1785e6b0334f', name: "footer" })), index.h("div", { key: '18e68687f04e35535edee363683523ce6bbb0291', id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map(issue => index.h("div", null, issue.message))), index.h("div", { key: 'e4a7db06abcfaf08b8ac592107531a13ef3a5897', class: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" }, status, " ", this.validation.status === 'pending' ? 'Checking value…' : this.validation.issues.map(issue => issue.message).join(' ')));
|
|
687
|
-
}
|
|
688
|
-
static get watchers() { return {
|
|
689
|
-
"value": [{
|
|
690
|
-
"syncValue": 0
|
|
691
|
-
}],
|
|
692
|
-
"query": [{
|
|
693
|
-
"syncQuery": 0
|
|
694
|
-
}],
|
|
695
|
-
"disabled": [{
|
|
696
|
-
"syncDisabled": 0
|
|
697
|
-
}],
|
|
698
|
-
"readOnly": [{
|
|
699
|
-
"syncDisabled": 0
|
|
700
|
-
}],
|
|
701
|
-
"config": [{
|
|
702
|
-
"syncConfig": 0
|
|
703
|
-
}]
|
|
704
|
-
}; }
|
|
705
|
-
};
|
|
706
|
-
UICombobox.style = uiComboboxCss();
|
|
707
|
-
|
|
708
|
-
exports.ui_combobox = UICombobox;
|