@threadlabs/looma 0.1.28 → 0.2.1
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-G5AWV77V.js → chunk-WW7Y67EW.js} +32 -33
- package/dist/{chunk-M7FPK6GN.js → chunk-Z4W5W53T.js} +19 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/{positioning-D5q9DM-0.js → positioning-BiPpyC-_.js} +26 -0
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-chip_2.cjs.entry.js +190 -498
- package/dist/cjs/ui-combobox.cjs.entry.js +708 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +2 -2
- package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ui-disclosure.cjs.entry.js +1 -1
- package/dist/cjs/ui-editable.cjs.entry.js +3 -3
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-form-field.cjs.entry.js +1 -1
- package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-input.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu.cjs.entry.js +2 -2
- package/dist/cjs/ui-popover.cjs.entry.js +2 -2
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-select.cjs.entry.js +1 -1
- package/dist/cjs/ui-switch.cjs.entry.js +2 -2
- package/dist/cjs/ui-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +2 -2
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/cjs/ui-tree-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-tree.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/ui-combobox/ui-combobox.css +23 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +298 -21
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
- package/dist/collection/components/ui-editable/ui-editable.js +3 -3
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.js +1 -1
- package/dist/collection/components/ui-menu/ui-menu.js +1 -1
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
- package/dist/collection/components/ui-popover/ui-popover.js +1 -1
- package/dist/collection/components/ui-radio/ui-radio.js +1 -1
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
- package/dist/collection/components/ui-select/ui-select.js +1 -1
- package/dist/collection/components/ui-switch/ui-switch.js +2 -2
- package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
- package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.js +1 -1
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +2 -2
- package/dist/collection/overlay/positioning.js +26 -0
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +1 -1
- package/dist/components/p-BOC_l2hE.js +1 -0
- package/dist/components/{p-B1macZOS.js → p-Btk_75st.js} +1 -1
- package/dist/components/p-biKnomFl.js +1 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-combobox.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-disclosure.js +1 -1
- package/dist/components/ui-editable.js +1 -1
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-form-field.js +1 -1
- package/dist/components/ui-icon-button.js +1 -1
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-menu-item.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-radio.js +1 -1
- package/dist/components/ui-search-result-row.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/components/ui-tree-item.js +1 -1
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/{positioning-Drmwg-C1.js → positioning-Ig1jYhE1.js} +26 -0
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-chip_2.entry.js +193 -501
- package/dist/esm/ui-combobox.entry.js +706 -0
- package/dist/esm/ui-context-menu.entry.js +2 -2
- package/dist/esm/ui-dialog.entry.js +1 -1
- package/dist/esm/ui-disclosure.entry.js +1 -1
- package/dist/esm/ui-editable.entry.js +3 -3
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-form-field.entry.js +1 -1
- package/dist/esm/ui-icon-button.entry.js +1 -1
- package/dist/esm/ui-input.entry.js +1 -1
- package/dist/esm/ui-menu-item.entry.js +1 -1
- package/dist/esm/ui-menu.entry.js +2 -2
- package/dist/esm/ui-popover.entry.js +2 -2
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-radio.entry.js +1 -1
- package/dist/esm/ui-search-result-row.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-select.entry.js +1 -1
- package/dist/esm/ui-switch.entry.js +2 -2
- package/dist/esm/ui-tabs.entry.js +1 -1
- package/dist/esm/ui-textarea.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +2 -2
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/esm/ui-tree-item.entry.js +2 -2
- package/dist/esm/ui-tree.entry.js +1 -1
- package/dist/index.cjs +516 -524
- package/dist/index.js +19 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/{p-32c85198.entry.js → p-08c9e253.entry.js} +1 -1
- package/dist/looma/{p-88e61cab.entry.js → p-0fa7062f.entry.js} +1 -1
- package/dist/looma/{p-9a82c523.entry.js → p-1249a806.entry.js} +1 -1
- package/dist/looma/p-172d67ff.entry.js +1 -0
- package/dist/looma/p-1c00670f.entry.js +1 -0
- package/dist/looma/p-22842f8c.entry.js +1 -0
- package/dist/looma/{p-1e1de77f.entry.js → p-2915d5c0.entry.js} +1 -1
- package/dist/looma/{p-2f3c1b57.entry.js → p-3b2961a6.entry.js} +1 -1
- package/dist/looma/{p-e07e6ac2.entry.js → p-3f60f4c8.entry.js} +1 -1
- package/dist/looma/p-3fba3edd.entry.js +1 -0
- package/dist/looma/{p-9551ebf6.entry.js → p-424d6719.entry.js} +1 -1
- package/dist/looma/p-4354f48f.entry.js +1 -0
- package/dist/looma/{p-6cc3180b.entry.js → p-4caccfce.entry.js} +1 -1
- package/dist/looma/{p-f431dc13.entry.js → p-6f20d470.entry.js} +1 -1
- package/dist/looma/{p-b68762f2.entry.js → p-7c0b5364.entry.js} +1 -1
- package/dist/looma/p-7ebbe74e.entry.js +1 -0
- package/dist/looma/{p-e82f104c.entry.js → p-8bdd9495.entry.js} +1 -1
- package/dist/looma/{p-df696cca.entry.js → p-9cfbf722.entry.js} +1 -1
- package/dist/looma/p-Ig1jYhE1.js +1 -0
- package/dist/looma/{p-607c3056.entry.js → p-b6ede6bb.entry.js} +1 -1
- package/dist/looma/{p-da6e2d01.entry.js → p-b76e2111.entry.js} +1 -1
- package/dist/looma/{p-1a12eb5c.entry.js → p-d372b0db.entry.js} +1 -1
- package/dist/looma/{p-20387ffa.entry.js → p-d4825822.entry.js} +1 -1
- package/dist/looma/{p-8a5e3fe1.entry.js → p-d5c3954f.entry.js} +1 -1
- package/dist/looma/{p-4f68f939.entry.js → p-e604e906.entry.js} +1 -1
- package/dist/looma/p-ec1c02e5.entry.js +1 -0
- package/dist/looma/{p-e406656e.entry.js → p-f1f7c5cb.entry.js} +1 -1
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +35 -4
- package/dist/types/components.d.ts +56 -153
- package/dist/{ui-affordance-scope.entry-X5526PRP.js → ui-affordance-scope.entry-FENYADN3.js} +2 -2
- package/dist/{ui-avatar-group.entry-U72MPB5K.js → ui-avatar-group.entry-K7D6QKDP.js} +1 -1
- package/dist/{ui-avatar.entry-OC4J3LTV.js → ui-avatar.entry-WCYFUQZT.js} +1 -1
- package/dist/{ui-badge.entry-4MSUQRQV.js → ui-badge.entry-VZC4LONR.js} +1 -1
- package/dist/{ui-button.entry-22DESWN4.js → ui-button.entry-7E2KMPRF.js} +1 -1
- package/dist/{ui-callout.entry-LOGODDM5.js → ui-callout.entry-7WXQ47S6.js} +1 -1
- package/dist/{ui-checkbox.entry-XAGW3BW4.js → ui-checkbox.entry-GTSEB7ZS.js} +1 -1
- package/dist/{ui-tooltip.entry-AQ6UPBUP.js → ui-chip_2.entry-PG24H67I.js} +19 -4
- package/dist/{ui-chip_2.entry-JCPHPXAG.js → ui-combobox.entry-NTCOCZOH.js} +170 -31
- package/dist/{ui-context-menu.entry-24YOHF7L.js → ui-context-menu.entry-7GSDWHTP.js} +3 -3
- package/dist/{ui-dialog.entry-XKNYDWOQ.js → ui-dialog.entry-F53O6FBQ.js} +2 -2
- package/dist/{ui-disclosure.entry-2AWCGZ4C.js → ui-disclosure.entry-YWJA42GQ.js} +2 -2
- package/dist/{ui-editable.entry-HLEWO7BN.js → ui-editable.entry-3QPCWDPM.js} +3 -3
- package/dist/{ui-floating-action-button.entry-2NJDB4YN.js → ui-floating-action-button.entry-L4UC6RFM.js} +2 -2
- package/dist/{ui-form-field.entry-FJ5HYCTN.js → ui-form-field.entry-2VCITLQA.js} +2 -2
- package/dist/{ui-icon-button.entry-YZHJQ5YR.js → ui-icon-button.entry-MRRA6NVP.js} +2 -2
- package/dist/{ui-input.entry-JMBLMNP6.js → ui-input.entry-7LYLUJNT.js} +2 -2
- package/dist/{ui-menu-item.entry-VBGXM66D.js → ui-menu-item.entry-YHSIKO5W.js} +2 -2
- package/dist/{ui-menu.entry-I2N5H3YC.js → ui-menu.entry-ZQBF7B4T.js} +3 -3
- package/dist/{ui-popover.entry-7JRSJM5S.js → ui-popover.entry-2HG5ZWQX.js} +3 -3
- package/dist/{ui-radio-group.entry-Q2XB7P3B.js → ui-radio-group.entry-A6LI3KHW.js} +2 -2
- package/dist/{ui-radio.entry-NJO4NA4M.js → ui-radio.entry-WBCZZG5D.js} +2 -2
- package/dist/{ui-search-result-row.entry-RPMNDSRN.js → ui-search-result-row.entry-P25POOYP.js} +2 -2
- package/dist/{ui-search-shell.entry-FMIMYD3B.js → ui-search-shell.entry-R6IVRPSW.js} +2 -2
- package/dist/{ui-select.entry-7NDBWNAU.js → ui-select.entry-CAAGCELJ.js} +2 -2
- package/dist/{ui-switch.entry-YUCPIZE4.js → ui-switch.entry-SKU445KH.js} +3 -3
- package/dist/{ui-tabs.entry-FXZWV665.js → ui-tabs.entry-7BQPZEH3.js} +2 -2
- package/dist/{ui-textarea.entry-HHLQR5GG.js → ui-textarea.entry-OFC4YUU7.js} +2 -2
- package/dist/{ui-toast-region.entry-PIIBHNYA.js → ui-toast-region.entry-7VNTFVDO.js} +3 -3
- package/dist/{ui-top-bar.entry-S2L7ZM4U.js → ui-top-bar.entry-2N3EKMVF.js} +2 -2
- package/dist/{ui-tree-item.entry-UID7IJPA.js → ui-tree-item.entry-SLHAE42A.js} +3 -3
- package/dist/{ui-tree.entry-UMD3DNG5.js → ui-tree.entry-LF45JUC4.js} +2 -2
- package/package.json +1 -1
- package/vue/{chunk-2DDIBSFD.js → chunk-ROMBQS2L.js} +32 -89
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +30 -107
- package/vue/index.js +1 -3
- package/dist/cjs/ui-multi-combobox.cjs.entry.js +0 -190
- package/dist/cjs/ui-tooltip.cjs.entry.js +0 -241
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +0 -33
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +0 -553
- package/dist/components/p-DiyiodGX.js +0 -1
- package/dist/components/p-Drw41pSY.js +0 -1
- package/dist/components/p-d5fk1vBI.js +0 -1
- package/dist/components/ui-multi-combobox.d.ts +0 -11
- package/dist/components/ui-multi-combobox.js +0 -1
- package/dist/esm/ui-multi-combobox.entry.js +0 -188
- package/dist/esm/ui-tooltip.entry.js +0 -239
- package/dist/looma/p-071c139c.entry.js +0 -1
- package/dist/looma/p-311e54d4.entry.js +0 -1
- package/dist/looma/p-3957f7ef.entry.js +0 -1
- package/dist/looma/p-4a10a875.entry.js +0 -1
- package/dist/looma/p-4fc9917f.entry.js +0 -1
- package/dist/looma/p-63a9159f.entry.js +0 -1
- package/dist/looma/p-82de1112.entry.js +0 -1
- package/dist/looma/p-Drmwg-C1.js +0 -1
- package/dist/looma/p-caa37be2.entry.js +0 -1
- package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +0 -51
- package/dist/ui-multi-combobox.entry-MEX7MU7P.js +0 -196
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as i,H as t}from"./p-8BGiMGQ0.js";const n=class{constructor(i){o(this,i)}disabled=!1;label="";size="md";variant="ghost";anticipatory=!1;render(){return i(t,{key:"
|
|
1
|
+
import{r as o,h as i,H as t}from"./p-8BGiMGQ0.js";const n=class{constructor(i){o(this,i)}disabled=!1;label="";size="md";variant="ghost";anticipatory=!1;render(){return i(t,{key:"8d0f84c9d3aaa69f47430369b511bb4160de5cc8","data-disabled":this.disabled?"":void 0,"data-ui-affordance":this.anticipatory?"button":void 0},i("button",{key:"b896cdb091e9733b2b8625463f1324819c23965c",type:"button","aria-label":this.label||void 0,disabled:this.disabled},i("slot",{key:"76ab5e5f4d34e3f0850287b4552dde060b3798e7"})))}};n.style=":host{display:inline-flex;color:var(--ui-text-secondary)}:host([anticipatory]){position:relative}:host([anticipatory])::before{content:'';position:absolute;inset:50% auto auto 50%;z-index:1;inline-size:var(--ui-affordance-guide-size, 0.25rem);block-size:var(--ui-affordance-guide-size, 0.25rem);border-radius:var(--ui-radius-round, 999px);background:var(--ui-affordance-guide-color, var(--ui-border-strong));opacity:var(--ui-affordance-guide-opacity, 0.42);transform:translate(-50%, -50%);transition:opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);pointer-events:none}:host([anticipatory]) button{opacity:0;transform:scale(0.72);pointer-events:none}:host([anticipatory][data-ui-proximity='near'])::before,:host([anticipatory]:focus-within)::before,:host([anticipatory]:hover)::before,:host([anticipatory][variant='solid'])::before{opacity:0}:host([anticipatory][data-ui-proximity='near']) button,:host([anticipatory]:focus-within) button,:host([anticipatory]:hover) button,:host([anticipatory][variant='solid']) button{opacity:1;transform:scale(1);pointer-events:auto}button{appearance:none;inline-size:var(--ui-icon-button-size, 2.5rem);block-size:var(--ui-icon-button-size, 2.5rem);min-inline-size:var(--ui-icon-button-size, 2.5rem);min-block-size:var(--ui-icon-button-size, 2.5rem);padding:0;margin:0;border:1px solid transparent;border-radius:var(--ui-icon-button-radius, var(--ui-radius-2));background:var(--ui-icon-button-bg, transparent);color:inherit;display:inline-flex;align-items:center;justify-content:center;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)}@media (hover: none), (pointer: coarse){:host([anticipatory])::before{opacity:0}:host([anticipatory]) button{opacity:1;transform:none;pointer-events:auto}}:host([size='sm']) button{inline-size:var(--ui-icon-button-size-sm, 2rem);block-size:var(--ui-icon-button-size-sm, 2rem);min-inline-size:var(--ui-icon-button-size-sm, 2rem);min-block-size:var(--ui-icon-button-size-sm, 2rem)}:host([size='lg']) button{inline-size:var(--ui-icon-button-size-lg, 2.75rem);block-size:var(--ui-icon-button-size-lg, 2.75rem);min-inline-size:var(--ui-icon-button-size-lg, 2.75rem);min-block-size:var(--ui-icon-button-size-lg, 2.75rem)}:host([variant='outline']) button{border-color:var(--ui-icon-button-border, var(--ui-border-default));background:var(--ui-icon-button-outline-bg, var(--ui-surface-default));color:var(--ui-icon-button-outline-color, var(--ui-text-primary))}:host([variant='solid']) button{background:var(--ui-icon-button-solid-bg, var(--ui-accent-solid));color:var(--ui-icon-button-solid-color, var(--ui-text-on-accent));box-shadow:var( --ui-icon-button-solid-shadow, 0 1px 2px color-mix(in srgb, var(--ui-accent-solid) 18%, transparent) )}button:hover:enabled{background:var(--ui-icon-button-hover-bg, var(--ui-surface-muted));color:var(--ui-icon-button-hover-color, var(--ui-text-primary))}:host([variant='outline']) button:hover:enabled{border-color:var(--ui-icon-button-hover-border, var(--ui-border-strong))}:host([variant='solid']) button:hover:enabled{background:var(--ui-icon-button-solid-hover-bg, var(--ui-accent-hover))}button:active:enabled{transform:scale(var(--ui-icon-button-active-scale, 0.96))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-icon-button-icon-size, 1.125rem);block-size:var(--ui-icon-button-icon-size, 1.125rem);flex-shrink:0;stroke-width:var(--ui-icon-button-icon-stroke-width, 1.75)}";export{n as ui_icon_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as e,h as a,H as r}from"./p-8BGiMGQ0.js";import{d as i,e as o}from"./p-JwSoedEO.js";const s=class{constructor(e){t(this,e)}get host(){return e(this)}value;defaultValue="";disabled=!1;invalid=!1;readOnly=!1;rows=4;internalValue="";slotRef;syncFromProp(){void 0!==this.value&&(this.internalValue=this.value)}syncToTextarea(){const t=this.getTextarea();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.rows=this.rows,t.setAttribute("aria-invalid",this.invalid?"true":"false"))}componentDidLoad(){this.syncFromProp(),this.slotRef?.addEventListener("slotchange",(()=>this.syncToTextarea())),this.syncToTextarea();const t=this.getTextarea();t?.addEventListener("input",this.onInput),t?.addEventListener("change",this.onChange)}disconnectedCallback(){const t=this.getTextarea();t?.removeEventListener("input",this.onInput),t?.removeEventListener("change",this.onChange)}componentDidUpdate(){this.syncToTextarea()}getTextarea(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"TEXTAREA"===t.tagName))??null}onInput=t=>{const e=t.target;e&&(this.internalValue=e.value,i(this.host,"input",{value:this.internalValue,trigger:o(t)}))};onChange=t=>{const e=this.getTextarea();e&&(this.internalValue=e.value,i(this.host,"change",{value:this.internalValue,trigger:o(t)}))};render(){return a(r,{key:"
|
|
1
|
+
import{r as t,g as e,h as a,H as r}from"./p-8BGiMGQ0.js";import{d as i,e as o}from"./p-JwSoedEO.js";const s=class{constructor(e){t(this,e)}get host(){return e(this)}value;defaultValue="";disabled=!1;invalid=!1;readOnly=!1;rows=4;internalValue="";slotRef;syncFromProp(){void 0!==this.value&&(this.internalValue=this.value)}syncToTextarea(){const t=this.getTextarea();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.rows=this.rows,t.setAttribute("aria-invalid",this.invalid?"true":"false"))}componentDidLoad(){this.syncFromProp(),this.slotRef?.addEventListener("slotchange",(()=>this.syncToTextarea())),this.syncToTextarea();const t=this.getTextarea();t?.addEventListener("input",this.onInput),t?.addEventListener("change",this.onChange)}disconnectedCallback(){const t=this.getTextarea();t?.removeEventListener("input",this.onInput),t?.removeEventListener("change",this.onChange)}componentDidUpdate(){this.syncToTextarea()}getTextarea(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"TEXTAREA"===t.tagName))??null}onInput=t=>{const e=t.target;e&&(this.internalValue=e.value,i(this.host,"input",{value:this.internalValue,trigger:o(t)}))};onChange=t=>{const e=this.getTextarea();e&&(this.internalValue=e.value,i(this.host,"change",{value:this.internalValue,trigger:o(t)}))};render(){return a(r,{key:"a554edb1a0ef40a2c116e3064e52af7474e065e4","data-invalid":this.invalid?"":void 0},a("slot",{key:"a4eb8034ec11f8b3b06ace7287410fd839004593",ref:t=>this.slotRef=t}))}static get watchers(){return{value:[{syncFromProp:0}],internalValue:[{syncToTextarea:0}],defaultValue:[{syncToTextarea:0}],disabled:[{syncToTextarea:0}],invalid:[{syncToTextarea:0}],readOnly:[{syncToTextarea:0}],rows:[{syncToTextarea:0}]}}};s.style=":host{display:inline-flex;min-inline-size:0;color:var(--ui-text-primary)}::slotted(textarea){width:100%;appearance:none;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);min-block-size:calc(var(--ui-space-12, 3rem) * 2);padding:var(--ui-space-2) var(--ui-space-3);margin:0;resize:vertical;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(textarea:hover:not(:focus):not(:disabled)){border-color:var(--ui-control-border-hover, var(--ui-border-strong))}::slotted(textarea: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(textarea),::slotted(textarea[aria-invalid='true']){border-color:var(--ui-accent-active)}::slotted(textarea:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted));color:var(--ui-text-muted);cursor:not-allowed}::slotted(textarea:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}";export{s as ui_textarea}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as o,h as e,H as r}from"./p-8BGiMGQ0.js";import{d as i,e as a}from"./p-JwSoedEO.js";import{i as s,c as n}from"./p-BnGhGgTH.js";const l=class{constructor(o){t(this,o)}get host(){return o(this)}value;defaultValue="";orientation="horizontal";internalValue="";syncFromProp(){s(this.value)&&(this.internalValue=this.value)}syncState(){const t=this.getTabs();0!==t.length&&t.forEach((t=>{const o=(t.id??t.getAttribute("aria-controls")??"")===this.internalValue;t.setAttribute("aria-selected",String(o)),t.tabIndex=o?0:-1;const e=t.getAttribute("aria-controls");if(e){const t=this.host.querySelector(`#${CSS.escape(e)}`)??document.getElementById(e);t&&(t.hidden=!o)}}))}componentDidLoad(){if(this.internalValue=n(this.value,this.defaultValue),!s(this.value)&&!this.internalValue){const t=this.getTabs();t.length>0&&(this.internalValue=t[0]?.id??t[0]?.getAttribute("aria-controls")??"")}this.syncState(),this.host.addEventListener("keydown",this.onKeydown),this.host.addEventListener("click",this.onClick)}disconnectedCallback(){this.host.removeEventListener("keydown",this.onKeydown),this.host.removeEventListener("click",this.onClick)}componentDidUpdate(){this.syncState()}getTabs(){return Array.from(this.host.querySelectorAll('[role="tab"]'))}setValueFromTab(t,o){const e=t.id??t.getAttribute("aria-controls")??"";if(!e)return;const r=this.internalValue;s(this.value)||(this.internalValue=e),this.syncState(),i(this.host,"select",{value:e,previousValue:r||void 0,trigger:o})}onClick=t=>{const o=t.target.closest?.('[role="tab"]');o&&this.host.contains(o)&&this.setValueFromTab(o,a(t))};onKeydown=t=>{const o=t.target.closest?.('[role="tab"]');if(!o||!this.host.contains(o))return;const e=this.getTabs();if(0===e.length)return;const r=e.indexOf(o),i="vertical"===this.orientation,a=i?"ArrowDown":"ArrowRight";if(t.key===a||t.key===(i?"ArrowUp":"ArrowLeft")){t.preventDefault();const o=t.key===a?Math.min(r+1,e.length-1):r<=0?e.length-1:r-1;this.setValueFromTab(e[o],"keyboard"),e[o].focus()}};render(){return e(r,{key:"
|
|
1
|
+
import{r as t,g as o,h as e,H as r}from"./p-8BGiMGQ0.js";import{d as i,e as a}from"./p-JwSoedEO.js";import{i as s,c as n}from"./p-BnGhGgTH.js";const l=class{constructor(o){t(this,o)}get host(){return o(this)}value;defaultValue="";orientation="horizontal";internalValue="";syncFromProp(){s(this.value)&&(this.internalValue=this.value)}syncState(){const t=this.getTabs();0!==t.length&&t.forEach((t=>{const o=(t.id??t.getAttribute("aria-controls")??"")===this.internalValue;t.setAttribute("aria-selected",String(o)),t.tabIndex=o?0:-1;const e=t.getAttribute("aria-controls");if(e){const t=this.host.querySelector(`#${CSS.escape(e)}`)??document.getElementById(e);t&&(t.hidden=!o)}}))}componentDidLoad(){if(this.internalValue=n(this.value,this.defaultValue),!s(this.value)&&!this.internalValue){const t=this.getTabs();t.length>0&&(this.internalValue=t[0]?.id??t[0]?.getAttribute("aria-controls")??"")}this.syncState(),this.host.addEventListener("keydown",this.onKeydown),this.host.addEventListener("click",this.onClick)}disconnectedCallback(){this.host.removeEventListener("keydown",this.onKeydown),this.host.removeEventListener("click",this.onClick)}componentDidUpdate(){this.syncState()}getTabs(){return Array.from(this.host.querySelectorAll('[role="tab"]'))}setValueFromTab(t,o){const e=t.id??t.getAttribute("aria-controls")??"";if(!e)return;const r=this.internalValue;s(this.value)||(this.internalValue=e),this.syncState(),i(this.host,"select",{value:e,previousValue:r||void 0,trigger:o})}onClick=t=>{const o=t.target.closest?.('[role="tab"]');o&&this.host.contains(o)&&this.setValueFromTab(o,a(t))};onKeydown=t=>{const o=t.target.closest?.('[role="tab"]');if(!o||!this.host.contains(o))return;const e=this.getTabs();if(0===e.length)return;const r=e.indexOf(o),i="vertical"===this.orientation,a=i?"ArrowDown":"ArrowRight";if(t.key===a||t.key===(i?"ArrowUp":"ArrowLeft")){t.preventDefault();const o=t.key===a?Math.min(r+1,e.length-1):r<=0?e.length-1:r-1;this.setValueFromTab(e[o],"keyboard"),e[o].focus()}};render(){return e(r,{key:"61044ac3f2fcb0f766d931416f42ff17ec94c00d",orientation:this.orientation,"data-orientation":this.orientation},e("slot",{key:"3260c95bdd24581045b1c4e4d1b8f4d08daf02b4"}))}static get watchers(){return{value:[{syncFromProp:0}],internalValue:[{syncState:0}],orientation:[{syncState:0}]}}};l.style=":host{display:flex;flex-direction:column;gap:0}:host([data-orientation='vertical']){flex-direction:row}::slotted([role='tablist']){display:flex;gap:0;max-inline-size:100%;overflow-x:auto;overscroll-behavior-inline:contain;border-bottom:1px solid var(--ui-border-default)}:host([data-orientation='vertical']) ::slotted([role='tablist']){flex-direction:column;border-bottom:none;border-inline-end:1px solid var(--ui-border-default)}::slotted(button[role='tab']),::slotted([role='tab']),::slotted(ui-button) button[role='tab']{padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);font-weight:var(--ui-font-medium, 500);color:var(--ui-text-secondary);background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer;transition:color var(--ui-motion-fast) var(--ui-motion-ease);box-shadow:none}::slotted(button[role='tab']:hover),::slotted([role='tab']:hover){color:var(--ui-text-primary)}::slotted(button[role='tab'][aria-selected='true']),::slotted([role='tab'][aria-selected='true']){color:var(--ui-accent-solid);border-bottom-color:var(--ui-accent-solid)}:host([data-orientation='vertical']) ::slotted(button[role='tab']),:host([data-orientation='vertical']) ::slotted([role='tab']){border-bottom:none;border-inline-end:2px solid transparent;margin-bottom:0;margin-inline-end:-1px}:host([data-orientation='vertical']) ::slotted(button[role='tab'][aria-selected='true']),:host([data-orientation='vertical']) ::slotted([role='tab'][aria-selected='true']){border-inline-end-color:var(--ui-accent-solid)}::slotted([role='tabpanel']){padding:var(--ui-space-4)}";export{l as ui_tabs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,g as t,h as i,H as r}from"./p-8BGiMGQ0.js";import{d as o}from"./p-JwSoedEO.js";import{i as a,c as s}from"./p-BnGhGgTH.js";const c=class{constructor(t){e(this,t)}get host(){return t(this)}checked;defaultChecked=!1;disabled=!1;required=!1;value="on";internalChecked=!1;syncFromProp(){a(this.checked)&&(this.internalChecked=this.checked)}componentDidLoad(){this.internalChecked=s(this.checked,this.defaultChecked)}toggle=e=>{if(this.disabled)return;const t=!this.internalChecked;a(this.checked)||(this.internalChecked=t),o(this.host,"change",{checked:t,value:this.value,trigger:e})};onKeydown=e=>{" "!==e.key||this.disabled||(e.preventDefault(),this.toggle("keyboard"))};onClick=e=>{e.target!==this.host?.shadowRoot?.querySelector("input")&&this.toggle("pointer")};render(){return i(r,{key:"
|
|
1
|
+
import{r as e,g as t,h as i,H as r}from"./p-8BGiMGQ0.js";import{d as o}from"./p-JwSoedEO.js";import{i as a,c as s}from"./p-BnGhGgTH.js";const c=class{constructor(t){e(this,t)}get host(){return t(this)}checked;defaultChecked=!1;disabled=!1;required=!1;value="on";internalChecked=!1;syncFromProp(){a(this.checked)&&(this.internalChecked=this.checked)}componentDidLoad(){this.internalChecked=s(this.checked,this.defaultChecked)}toggle=e=>{if(this.disabled)return;const t=!this.internalChecked;a(this.checked)||(this.internalChecked=t),o(this.host,"change",{checked:t,value:this.value,trigger:e})};onKeydown=e=>{" "!==e.key||this.disabled||(e.preventDefault(),this.toggle("keyboard"))};onClick=e=>{e.target!==this.host?.shadowRoot?.querySelector("input")&&this.toggle("pointer")};render(){return i(r,{key:"eaee279bbc787c844f2ad265da03fca608d9c429",role:"switch","aria-checked":String(this.internalChecked),"aria-disabled":String(this.disabled),"data-disabled":this.disabled?"":void 0,tabIndex:this.disabled?-1:0,onKeyDown:this.onKeydown,onClick:this.onClick},i("input",{key:"2ebfa684bf08735a4e89a06001f6758885c40ffb",type:"checkbox",checked:this.internalChecked,disabled:this.disabled,required:this.required,value:this.value,"aria-hidden":"true",tabIndex:-1,onChange:e=>{const t=e.target,i=t.checked;a(this.checked)||(this.internalChecked=i),o(this.host,"change",{checked:i,value:this.value,trigger:"pointer"}),a(this.checked)&&(t.checked=this.internalChecked)}}),i("slot",{key:"ff9975d4ccbffbed2b97060eabf347653d5f5110"}))}static get watchers(){return{checked:[{syncFromProp:0}]}}};c.style=":host{display:inline-flex;align-items:center;gap:var(--ui-space-2);color:var(--ui-text-primary)}:host([aria-disabled='true']),:host([data-disabled='true']){opacity:0.6;cursor:not-allowed}:host([role='switch']){cursor:pointer}:host input[type='checkbox']{appearance:none;-webkit-appearance:none;display:block;position:relative;width:2.25rem;height:1.25rem;padding:0;border:1px solid var(--ui-border-default);border-radius:999px;background:var(--ui-surface-muted);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host input[type='checkbox']::after{content:'';position:absolute;top:2px;left:2px;width:0.875rem;height:0.875rem;border-radius:999px;background:var(--ui-surface-default);border:1px solid var(--ui-border-default);transition:transform var(--ui-motion-fast) var(--ui-motion-ease)}:host input[type='checkbox']:checked{background:var(--ui-accent-solid);border-color:var(--ui-accent-solid)}:host input[type='checkbox']:checked::after{transform:translateX(calc(2.25rem - 0.875rem - 4px));background:var(--ui-text-on-accent);border-color:var(--ui-text-on-accent)}:host input[type='checkbox']:focus-visible{outline:2px solid var(--ui-accent-solid);outline-offset:2px}";export{c as ui_switch}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as i,h as a,H as
|
|
1
|
+
import{r as t,g as i,h as a,H as s}from"./p-8BGiMGQ0.js";import{d as e,e as o}from"./p-JwSoedEO.js";const r=class{constructor(i){t(this,i)}get host(){return i(this)}value="";name="";orientation="horizontal";disabled=!1;required=!1;internalValue="";syncFromProp(){this.internalValue=this.value}syncToRadios(){this.getRadios().forEach((t=>{t.checked=(t.getAttribute("value")??"")===this.internalValue,t.name=this.name||this.groupId,this.disabled?(t.setAttribute("aria-disabled","true"),t.setAttribute("data-disabled","true")):(t.removeAttribute("aria-disabled"),t.removeAttribute("data-disabled"))})),this.updateRovingTabindex()}groupId=`ui-radio-group-${Math.random().toString(36).slice(2,9)}`;componentDidLoad(){this.syncFromProp(),this.syncToRadios(),this.host.addEventListener("change",this.onRadioChange),this.host.addEventListener("keydown",this.onKeydown)}disconnectedCallback(){this.host.removeEventListener("change",this.onRadioChange),this.host.removeEventListener("keydown",this.onKeydown)}componentDidUpdate(){this.syncToRadios()}getRadios(){return Array.from(this.host.querySelectorAll("ui-radio"))}updateRovingTabindex(){const t=this.getRadios(),i=t.findIndex((t=>(t.getAttribute("value")??"")===this.internalValue));t.forEach(((t,a)=>{const s=t.querySelector('input[type="radio"]');s&&(s.tabIndex=a===(i>=0?i:0)?0:-1)}))}setValue(t,i){const a=this.internalValue;this.internalValue=t,this.syncToRadios(),e(this.host,"select",{value:t,previousValue:a,trigger:i}),e(this.host,"change",{checked:!0,value:t,trigger:i})}onRadioChange=t=>{const i=t.target.closest?.("ui-radio");if(!i||i.getRootNode()!==this.host.getRootNode())return;const a=i.getAttribute("value")??"";a&&a!==this.internalValue&&this.setValue(a,o(t))};onKeydown=t=>{const i=this.getRadios();if(0===i.length)return;const a=i.findIndex((t=>(t.getAttribute("value")??"")===this.internalValue)),s="vertical"===this.orientation?"vertical":"horizontal",e="horizontal"===s?"ArrowRight"===t.key:"ArrowDown"===t.key;if(!("horizontal"===s?"ArrowLeft"===t.key:"ArrowUp"===t.key)&&!e)return;let o;t.preventDefault(),o=e?a<0?0:Math.min(a+1,i.length-1):a<=0?i.length-1:a-1;const r=i[o],n=r?.getAttribute("value")??"";n&&(this.setValue(n,"keyboard"),r?.querySelector('input[type="radio"]')?.focus())};render(){return a(s,{key:"9bdfe6b5209b5444cb27dde3226ec33866999c25",role:"radiogroup","aria-orientation":this.orientation,"data-orientation":this.orientation,"data-disabled":this.disabled?"":void 0},a("slot",{key:"b81a2f1e4c49000cfb5357570b460564ced48d91"}))}static get watchers(){return{value:[{syncFromProp:0}],internalValue:[{syncToRadios:0}],name:[{syncToRadios:0}],orientation:[{syncToRadios:0}],disabled:[{syncToRadios:0}]}}};r.style=":host{display:inline-flex;align-items:center;gap:var(--ui-space-2)}:host([data-orientation='vertical']){display:inline-grid;justify-items:start}";export{r as ui_radio_group}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,g as a,h as o,H as e}from"./p-8BGiMGQ0.js";import{o as t,c as s,r}from"./p-C-0syqXZ.js";import{d as n}from"./p-JwSoedEO.js";import{i as
|
|
1
|
+
import{r as i,g as a,h as o,H as e}from"./p-8BGiMGQ0.js";import{o as t,c as s,r}from"./p-C-0syqXZ.js";import{d as n}from"./p-JwSoedEO.js";import{i as l,c as d}from"./p-BnGhGgTH.js";const c=class{constructor(a){i(this,a)}get host(){return a(this)}open;defaultOpen=!1;modal=!0;dismissible=!0;label;internalOpen=!1;accessibleLabel="Dialog";overlayId=`ui-dialog-${Math.random().toString(36).slice(2,11)}`;dialogRef;contentObserver=null;syncFromProp(){l(this.open)&&(this.internalOpen=this.open)}syncLabelFromProp(){this.syncAccessibleLabel()}componentWillLoad(){this.syncAccessibleLabel()}syncOpen(){this.dialogRef&&(this.internalOpen?(this.dialogRef.showModal(),t({id:this.overlayId,modal:this.modal,element:this.host,dismissible:this.dismissible,requestClose:(i,a)=>this.handleRequestClose(i,a)})):(this.dialogRef.close(),s(this.overlayId)))}componentDidLoad(){this.contentObserver=new MutationObserver(this.syncAccessibleLabel),this.contentObserver.observe(this.host,{childList:!0,subtree:!0,characterData:!0}),this.internalOpen=d(this.open,this.defaultOpen),this.dialogRef?.addEventListener("close",this.onDialogClose),this.syncAccessibleLabel(),this.syncOpen()}disconnectedCallback(){this.dialogRef?.removeEventListener("close",this.onDialogClose),this.contentObserver?.disconnect(),this.contentObserver=null,s(this.overlayId)}componentDidUpdate(){this.syncOpen()}handleRequestClose(i,a){l(this.open)||(this.internalOpen=!1),n(this.host,"close",{open:!1,reason:i,trigger:a})}onDialogClose=()=>{this.internalOpen&&(l(this.open)?requestAnimationFrame((()=>this.syncOpen())):(this.internalOpen=!1,s(this.overlayId)),n(this.host,"close",{open:!1,reason:"programmatic",trigger:"programmatic"}))};onKeydown=i=>{"Escape"===i.key&&r("escape","keyboard")};syncAccessibleLabel=()=>{const i=this.label?.trim(),a=this.host.querySelector('[slot="heading"], [data-ui-dialog-title], h1, h2, h3, h4, h5, h6'),o=a?.textContent?.trim(),e=i||o||"Dialog";this.accessibleLabel!==e&&(this.accessibleLabel=e)};render(){return o(e,{key:"b606ef8c95728b5538047a7134030455fedf69e4","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},o("dialog",{key:"85531d82c36e79230cbb22c105ff3821f1f35f58",ref:i=>this.dialogRef=i,open:this.internalOpen,"aria-label":this.accessibleLabel},o("slot",{key:"8216096bc94e8261680664398691b8ea877daa0f"})))}static get watchers(){return{open:[{syncFromProp:0}],label:[{syncLabelFromProp:0}],internalOpen:[{syncOpen:0}]}}};c.style=":host{display:block}:host:not([data-open]){display:none}:host dialog{--ui-dialog-duration:var(--ui-motion-base);--ui-dialog-viewport-gap:var(--ui-space-4, 1rem);position:fixed;inset:0;box-sizing:border-box;inline-size:min( calc(100% - (var(--ui-dialog-viewport-gap) * 2)), var(--ui-dialog-max-width, 440px) );max-inline-size:none;max-block-size:calc(100dvh - (var(--ui-dialog-viewport-gap) * 2));margin:auto;padding:var(--ui-space-4);overflow:auto;background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-dialog);box-shadow:var(--ui-shadow-dialog);visibility:hidden;pointer-events:none;opacity:0;transform:scale(0.96);transition:opacity var(--ui-dialog-duration) var(--ui-motion-ease), transform var(--ui-dialog-duration) var(--ui-motion-ease), visibility var(--ui-dialog-duration), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]{visibility:visible;pointer-events:auto;opacity:1;transform:scale(1);animation:ui-dialog-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-enter{from{opacity:0;transform:scale(0.96)}}:host dialog::backdrop{background-color:transparent;transition:background-color var(--ui-dialog-duration) var(--ui-motion-ease), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]::backdrop{background-color:var(--ui-overlay-backdrop);animation:ui-dialog-backdrop-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-backdrop-enter{from{background-color:transparent}}";export{c as ui_dialog}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,g as o,h as t,H as s}from"./p-8BGiMGQ0.js";import{o as i,c as a,r}from"./p-C-0syqXZ.js";import{d as n}from"./p-JwSoedEO.js";import{i as p,c as h}from"./p-BnGhGgTH.js";import{a as c}from"./p-Ig1jYhE1.js";const d=class{constructor(o){e(this,o)}get host(){return o(this)}open;defaultOpen=!1;for;placement="bottom-start";internalOpen=!1;overlayId=`ui-popover-${Math.random().toString(36).slice(2,11)}`;anchor=null;surface=null;syncFromProp(){p(this.open)&&(this.internalOpen=this.open)}onOpenChange(){this.syncOverlay(),this.internalOpen?n(this.host,"open",{open:!0,reason:"programmatic",trigger:"programmatic"}):n(this.host,"close",{open:!1,reason:"programmatic",trigger:"programmatic"})}resetSurface(){this.setupSurface(),this.syncSurface()}setupSurface(){this.surface?.destroy(),this.surface=null,this.anchor=this.for?this.host.ownerDocument.getElementById(this.for):null,this.anchor&&(this.surface=c(this.host,{anchor:this.anchor,placement:this.placement}))}syncSurface(){this.surface&&(this.internalOpen?this.surface.show():this.surface.hide())}syncOverlay(){this.syncSurface(),this.internalOpen?i({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.anchor?[this.anchor]:void 0,dismissible:!0,requestClose:(e,o)=>this.handleRequestClose(e,o)}):a(this.overlayId)}componentDidLoad(){this.internalOpen=h(this.open,this.defaultOpen),this.host.addEventListener("keydown",this.onKeydown),this.setupSurface(),this.syncOverlay()}disconnectedCallback(){this.host.removeEventListener("keydown",this.onKeydown),this.surface?.destroy(),this.surface=null,a(this.overlayId)}componentDidUpdate(){this.syncOverlay()}handleRequestClose(e,o){p(this.open)||(this.internalOpen=!1),n(this.host,"close",{open:!1,reason:e,trigger:o})}onKeydown=e=>{"Escape"===e.key&&r("escape","keyboard")};render(){return t(s,{key:"65a0927abc40450205989704bfde2cf7fd80d1f9","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},t("div",{key:"255acaf99e0fe70a92048351b24bdfde1a4ea45f",class:"popover__surface"},t("slot",{key:"9d2f6c9d5a0f7a2766225aef0ec5b98b33ec9f07"})))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}}};d.style=":host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);box-sizing:border-box;max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.popover__surface{box-sizing:border-box;max-inline-size:inherit;max-block-size:inherit;overflow:auto;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}";export{d as ui_popover}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,g as e,h as i,H as s}from"./p-8BGiMGQ0.js";import{d as r}from"./p-JwSoedEO.js";function n(t,e,i){const s=t.height>0?Math.min(1,Math.max(0,(e-t.top)/t.height)):.5;return i?s<.25?"before":s>.75?"after":"inside":s<.5?"before":"after"}const h=class{constructor(e){t(this,e)}get host(){return e(this)}label="Tree";hoverExpandDelay=700;maxDepth=0;source=null;target=null;position=null;rejectedTarget=null;rejectedPosition=null;rejection=null;hoverIntent=null;structureObserver=null;tabStop=null;componentDidLoad(){this.hoverIntent=function(t,e){let i,s;function r(){i&&clearTimeout(i),i=void 0,s=void 0}return{schedule(n){s===n&&i||(r(),s=n,i=setTimeout((()=>{i=void 0;const t=s;s=void 0,t&&e(t)}),Math.max(0,t)))},cancel:r,destroy:r}}(this.hoverExpandDelay,this.expandTarget),this.host.addEventListener("dragstart",this.onDragStart),this.host.addEventListener("drag",this.onDrag),this.host.addEventListener("dragenter",this.onDragOver),this.host.addEventListener("dragover",this.onDragOver),this.host.addEventListener("dragleave",this.onDragLeave),this.host.addEventListener("drop",this.onDrop),this.host.addEventListener("dragend",this.onDragEnd),this.host.addEventListener("keydown",this.onKeyDown),this.host.addEventListener("focusin",this.onFocusIn),this.host.addEventListener("ui-tree-expansion-change",this.onExpansionChange),this.syncStructuralLevels(),this.structureObserver=new MutationObserver(this.syncStructuralLevels),this.structureObserver.observe(this.host,{childList:!0,subtree:!0})}disconnectedCallback(){this.hoverIntent?.destroy(),this.host.removeEventListener("dragstart",this.onDragStart),this.host.removeEventListener("drag",this.onDrag),this.host.removeEventListener("dragenter",this.onDragOver),this.host.removeEventListener("dragover",this.onDragOver),this.host.removeEventListener("dragleave",this.onDragLeave),this.host.removeEventListener("drop",this.onDrop),this.host.removeEventListener("dragend",this.onDragEnd),this.host.removeEventListener("keydown",this.onKeyDown),this.host.removeEventListener("focusin",this.onFocusIn),this.host.removeEventListener("ui-tree-expansion-change",this.onExpansionChange),this.structureObserver?.disconnect(),this.structureObserver=null}syncStructuralLevels=()=>{for(const t of Array.from(this.host.querySelectorAll("ui-tree-item")))t.dispatchEvent(new CustomEvent("ui-tree-structure-sync"));this.syncTabStop()};syncTabStop(t){const e=this.visibleItems(),i=t&&e.includes(t)?t:this.tabStop&&e.includes(this.tabStop)?this.tabStop:e[0]??null;this.tabStop=i;for(const t of e)t.dispatchEvent(new CustomEvent("ui-tree-roving-tab-stop",{detail:{active:t===i}}))}itemFromEvent(t){return t.composedPath().find((t=>t instanceof HTMLElement&&"ui-tree-item"===t.localName))??null}eventTargetsInteractiveContent(t){for(const e of t.composedPath()){if(e instanceof HTMLElement&&"ui-tree-item"===e.localName)break;if(e instanceof HTMLElement&&e.matches('a, button, input, select, textarea, [role="button"], [role="link"]'))return!0}return!1}itemId(t){return t.itemId||t.getAttribute("item-id")||""}rowFor(t){return t.shadowRoot?.querySelector('[part="row"]')??null}itemAtPoint(t,e){let i=this.host.ownerDocument.elementFromPoint(t,e);for(;i;){if("ui-tree-item"===i.localName&&this.host.contains(i))return i;const t=i.getRootNode();i=t instanceof ShadowRoot?t.host:i.parentElement}return null}isWithinTree(t){let e=t instanceof HTMLElement?t:null;for(;e;){if(e===this.host||this.host.contains(e))return!0;const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}return!1}acceptsChildren(t){return Boolean(t.container??t.hasAttribute("container"))&&!Boolean(t.disabled??t.hasAttribute("disabled"))}itemMetadata(t){return{type:t.getAttribute("data-drag-type")||t.getAttribute("drag-type")||"item",scope:t.getAttribute("data-drop-scope")||t.getAttribute("drop-scope")||"",accepts:(t.getAttribute("data-accepts")||t.getAttribute("accepts")||"").split(",").map((t=>t.trim())).filter(Boolean)}}constraintDepth(t){if(void 0!==t.dropDepth)return t.dropDepth;const e=t.getAttribute("drop-depth");return null!==e?Number(e):Number(t.getAttribute("aria-level"))||1}subtreeDepth(t){if(void 0!==t.subtreeDepth)return Math.max(0,Math.floor(t.subtreeDepth));const e=t.getAttribute("subtree-depth");return null!==e?Math.max(0,Math.floor(Number(e))):Array.from(t.querySelectorAll("ui-tree-item")).reduce(((e,i)=>{let s=0,r=i.parentElement?.closest("ui-tree-item")??null;for(;r&&r!==t;)s+=1,r=r.parentElement?.closest("ui-tree-item")??null;return r===t?Math.max(e,s+1):e}),0)}dropRejection(t,e,i){if(t.contains(e))return{reason:"descendant"};const s=this.itemMetadata(t),r=this.itemMetadata(e);if("inside"===i){if(!this.acceptsChildren(e)||r.accepts.length>0&&!r.accepts.includes(s.type))return{reason:"incompatible"}}else if(s.type!==r.type)return{reason:"incompatible"};const n=Math.max(0,Math.floor(this.maxDepth));if(n>0){const s=Math.max(0,Math.floor(this.constraintDepth(e)))+("inside"===i?1:0)+this.subtreeDepth(t);if(s>n)return{reason:"max-depth",maxDepth:n,resultingDepth:s}}return null}clearTarget(){this.target?.removeAttribute("data-drop-position"),this.target=null,this.position=null,this.hoverIntent?.cancel()}clearRejection(){this.rejectedTarget=null,this.rejectedPosition=null,this.rejection=null}finishDrag(){this.source?.removeAttribute("data-dragging"),this.source=null,this.clearTarget(),this.clearRejection()}expandTarget=t=>{const e=Array.from(this.host.querySelectorAll("ui-tree-item")).find((e=>this.itemId(e)===t));e&&"false"===e.getAttribute("aria-expanded")&&e.dispatchEvent(new CustomEvent("ui-tree-auto-expand"))};onDragStart=t=>{const e=this.itemFromEvent(t);if(!e||!Boolean(e.sortable??e.hasAttribute("sortable"))||Boolean(e.disabled??e.hasAttribute("disabled")))return;if(!t.composedPath().some((t=>t instanceof HTMLElement&&"drag-handle"===t.getAttribute("part"))))return void t.preventDefault();const i=this.itemId(e),s=this.rowFor(e);i&&s?(this.source=e,e.setAttribute("data-dragging","true"),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",i)),function(t,e){if(!t||"function"!=typeof t.setDragImage)return;const{height:i}=e.getBoundingClientRect();t.setDragImage(e,16,Math.max(0,i/2))}(t.dataTransfer,s)):t.preventDefault()};updateTarget(t,e,i){if(!this.source)return!1;if(!t||t===this.source)return this.clearTarget(),this.clearRejection(),!1;const s=this.rowFor(t);if(!s)return!1;const r=n(s.getBoundingClientRect(),e,this.acceptsChildren(t)),h=this.dropRejection(this.source,t,r);return h?(i&&(i.dropEffect="none"),this.clearTarget(),"max-depth"===h.reason?(this.rejectedTarget=t,this.rejectedPosition=r,this.rejection=h):this.clearRejection(),!1):(this.clearRejection(),i&&(i.dropEffect="move"),this.target===t&&this.position===r||(this.clearTarget(),this.target=t,this.position=r,t.setAttribute("data-drop-position",r)),"inside"===r&&"false"===t.getAttribute("aria-expanded")?this.hoverIntent?.schedule(this.itemId(t)):this.hoverIntent?.cancel(),!0)}onDrag=t=>{if(!this.source||0===t.clientX&&0===t.clientY)return;const e=this.itemAtPoint(t.clientX,t.clientY);e&&this.updateTarget(e,t.clientY,t.dataTransfer)};onDragOver=t=>{if(!this.source)return;const e=this.itemFromEvent(t);this.updateTarget(e,t.clientY,t.dataTransfer)&&t.preventDefault()};onDragLeave=t=>{this.isWithinTree(t.relatedTarget)||this.itemAtPoint(t.clientX,t.clientY)||(this.clearTarget(),this.clearRejection())};dispatchReorder(t,e,i){const s=this.itemId(t),n=this.itemId(e);if(!s||!n)return;"inside"===i&&this.expandTarget(n);const h=this.itemMetadata(t),o=this.itemMetadata(e);r(this.host,"reorder",{sourceId:s,targetId:n,position:i,sourceType:h.type,targetType:o.type,sourceScope:h.scope,targetScope:o.scope,trigger:"pointer"})}dispatchReorderRejected(t,e,i,s){const n=this.itemId(t),h=this.itemId(e);n&&h&&r(this.host,"reorder-rejected",{sourceId:n,targetId:h,position:i,reason:"max-depth",maxDepth:s.maxDepth,resultingDepth:s.resultingDepth,trigger:"pointer"})}onDrop=t=>{this.source&&this.target&&this.position&&(t.preventDefault(),this.dispatchReorder(this.source,this.target,this.position),this.finishDrag())};onDragEnd=t=>{if(this.source){if(this.rejectedTarget&&this.rejectedPosition&&this.rejection)return this.dispatchReorderRejected(this.source,this.rejectedTarget,this.rejectedPosition,this.rejection),void this.finishDrag();const e=this.itemAtPoint(t.clientX,t.clientY);if(e&&e!==this.source){const i=this.rowFor(e);if(i){const s=n(i.getBoundingClientRect(),t.clientY,this.acceptsChildren(e)),r=this.dropRejection(this.source,e,s);r?"max-depth"===r.reason&&this.dispatchReorderRejected(this.source,e,s,r):this.dispatchReorder(this.source,e,s)}}}this.finishDrag()};visibleItems(){return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((t=>t.getClientRects().length>0&&!t.hasAttribute("disabled")))}parentItem(t){const e=t.parentElement?.closest("ui-tree-item")??null;return e&&this.host.contains(e)?e:null}firstVisibleChild(t,e){return e.find((e=>this.parentItem(e)===t))??null}focusItem(t){this.syncTabStop(t),t.focus()}requestExpansion(t,e){t.dispatchEvent(new CustomEvent("ui-tree-request-expanded",{detail:{expanded:e,trigger:"keyboard"}}))}onFocusIn=t=>{if(this.eventTargetsInteractiveContent(t))return;const e=this.itemFromEvent(t);e&&this.syncTabStop(e)};onExpansionChange=()=>{requestAnimationFrame((()=>this.syncTabStop()))};onKeyDown=t=>{if(this.eventTargetsInteractiveContent(t))return;const e=this.itemFromEvent(t);if(!e)return;const i=this.visibleItems(),s=i.indexOf(e);if(s<0)return;const r="ArrowDown"===t.key?i[s+1]:"ArrowUp"===t.key?i[s-1]:"Home"===t.key?i[0]:"End"===t.key?i.at(-1):null;if(r)return t.preventDefault(),void this.focusItem(r);if("ArrowLeft"!==t.key){if("ArrowRight"===t.key)if("false"===e.getAttribute("aria-expanded"))t.preventDefault(),this.requestExpansion(e,!0);else if("true"===e.getAttribute("aria-expanded")){const s=this.firstVisibleChild(e,i);s&&(t.preventDefault(),this.focusItem(s))}}else"true"===e.getAttribute("aria-expanded")?(t.preventDefault(),this.requestExpansion(e,!1)):this.parentItem(e)&&(t.preventDefault(),this.focusItem(this.parentItem(e)))};render(){return i(s,{key:"81fe656b4a7cdf8683f53aeee94fb53838950383",role:"tree","aria-label":this.label||"Tree"},i("slot",{key:"941204b299eec2181228f536c017a17f026b2f3d"}))}};h.style=":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}";export{h as ui_tree}
|
|
1
|
+
import{r as t,g as e,h as i,H as s}from"./p-8BGiMGQ0.js";import{d as r}from"./p-JwSoedEO.js";function n(t,e,i){const s=t.height>0?Math.min(1,Math.max(0,(e-t.top)/t.height)):.5;return i?s<.25?"before":s>.75?"after":"inside":s<.5?"before":"after"}const h=class{constructor(e){t(this,e)}get host(){return e(this)}label="Tree";hoverExpandDelay=700;maxDepth=0;source=null;target=null;position=null;rejectedTarget=null;rejectedPosition=null;rejection=null;hoverIntent=null;structureObserver=null;tabStop=null;componentDidLoad(){this.hoverIntent=function(t,e){let i,s;function r(){i&&clearTimeout(i),i=void 0,s=void 0}return{schedule(n){s===n&&i||(r(),s=n,i=setTimeout((()=>{i=void 0;const t=s;s=void 0,t&&e(t)}),Math.max(0,t)))},cancel:r,destroy:r}}(this.hoverExpandDelay,this.expandTarget),this.host.addEventListener("dragstart",this.onDragStart),this.host.addEventListener("drag",this.onDrag),this.host.addEventListener("dragenter",this.onDragOver),this.host.addEventListener("dragover",this.onDragOver),this.host.addEventListener("dragleave",this.onDragLeave),this.host.addEventListener("drop",this.onDrop),this.host.addEventListener("dragend",this.onDragEnd),this.host.addEventListener("keydown",this.onKeyDown),this.host.addEventListener("focusin",this.onFocusIn),this.host.addEventListener("ui-tree-expansion-change",this.onExpansionChange),this.syncStructuralLevels(),this.structureObserver=new MutationObserver(this.syncStructuralLevels),this.structureObserver.observe(this.host,{childList:!0,subtree:!0})}disconnectedCallback(){this.hoverIntent?.destroy(),this.host.removeEventListener("dragstart",this.onDragStart),this.host.removeEventListener("drag",this.onDrag),this.host.removeEventListener("dragenter",this.onDragOver),this.host.removeEventListener("dragover",this.onDragOver),this.host.removeEventListener("dragleave",this.onDragLeave),this.host.removeEventListener("drop",this.onDrop),this.host.removeEventListener("dragend",this.onDragEnd),this.host.removeEventListener("keydown",this.onKeyDown),this.host.removeEventListener("focusin",this.onFocusIn),this.host.removeEventListener("ui-tree-expansion-change",this.onExpansionChange),this.structureObserver?.disconnect(),this.structureObserver=null}syncStructuralLevels=()=>{for(const t of Array.from(this.host.querySelectorAll("ui-tree-item")))t.dispatchEvent(new CustomEvent("ui-tree-structure-sync"));this.syncTabStop()};syncTabStop(t){const e=this.visibleItems(),i=t&&e.includes(t)?t:this.tabStop&&e.includes(this.tabStop)?this.tabStop:e[0]??null;this.tabStop=i;for(const t of e)t.dispatchEvent(new CustomEvent("ui-tree-roving-tab-stop",{detail:{active:t===i}}))}itemFromEvent(t){return t.composedPath().find((t=>t instanceof HTMLElement&&"ui-tree-item"===t.localName))??null}eventTargetsInteractiveContent(t){for(const e of t.composedPath()){if(e instanceof HTMLElement&&"ui-tree-item"===e.localName)break;if(e instanceof HTMLElement&&e.matches('a, button, input, select, textarea, [role="button"], [role="link"]'))return!0}return!1}itemId(t){return t.itemId||t.getAttribute("item-id")||""}rowFor(t){return t.shadowRoot?.querySelector('[part="row"]')??null}itemAtPoint(t,e){let i=this.host.ownerDocument.elementFromPoint(t,e);for(;i;){if("ui-tree-item"===i.localName&&this.host.contains(i))return i;const t=i.getRootNode();i=t instanceof ShadowRoot?t.host:i.parentElement}return null}isWithinTree(t){let e=t instanceof HTMLElement?t:null;for(;e;){if(e===this.host||this.host.contains(e))return!0;const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}return!1}acceptsChildren(t){return Boolean(t.container??t.hasAttribute("container"))&&!Boolean(t.disabled??t.hasAttribute("disabled"))}itemMetadata(t){return{type:t.getAttribute("data-drag-type")||t.getAttribute("drag-type")||"item",scope:t.getAttribute("data-drop-scope")||t.getAttribute("drop-scope")||"",accepts:(t.getAttribute("data-accepts")||t.getAttribute("accepts")||"").split(",").map((t=>t.trim())).filter(Boolean)}}constraintDepth(t){if(void 0!==t.dropDepth)return t.dropDepth;const e=t.getAttribute("drop-depth");return null!==e?Number(e):Number(t.getAttribute("aria-level"))||1}subtreeDepth(t){if(void 0!==t.subtreeDepth)return Math.max(0,Math.floor(t.subtreeDepth));const e=t.getAttribute("subtree-depth");return null!==e?Math.max(0,Math.floor(Number(e))):Array.from(t.querySelectorAll("ui-tree-item")).reduce(((e,i)=>{let s=0,r=i.parentElement?.closest("ui-tree-item")??null;for(;r&&r!==t;)s+=1,r=r.parentElement?.closest("ui-tree-item")??null;return r===t?Math.max(e,s+1):e}),0)}dropRejection(t,e,i){if(t.contains(e))return{reason:"descendant"};const s=this.itemMetadata(t),r=this.itemMetadata(e);if("inside"===i){if(!this.acceptsChildren(e)||r.accepts.length>0&&!r.accepts.includes(s.type))return{reason:"incompatible"}}else if(s.type!==r.type)return{reason:"incompatible"};const n=Math.max(0,Math.floor(this.maxDepth));if(n>0){const s=Math.max(0,Math.floor(this.constraintDepth(e)))+("inside"===i?1:0)+this.subtreeDepth(t);if(s>n)return{reason:"max-depth",maxDepth:n,resultingDepth:s}}return null}clearTarget(){this.target?.removeAttribute("data-drop-position"),this.target=null,this.position=null,this.hoverIntent?.cancel()}clearRejection(){this.rejectedTarget=null,this.rejectedPosition=null,this.rejection=null}finishDrag(){this.source?.removeAttribute("data-dragging"),this.source=null,this.clearTarget(),this.clearRejection()}expandTarget=t=>{const e=Array.from(this.host.querySelectorAll("ui-tree-item")).find((e=>this.itemId(e)===t));e&&"false"===e.getAttribute("aria-expanded")&&e.dispatchEvent(new CustomEvent("ui-tree-auto-expand"))};onDragStart=t=>{const e=this.itemFromEvent(t);if(!e||!Boolean(e.sortable??e.hasAttribute("sortable"))||Boolean(e.disabled??e.hasAttribute("disabled")))return;if(!t.composedPath().some((t=>t instanceof HTMLElement&&"drag-handle"===t.getAttribute("part"))))return void t.preventDefault();const i=this.itemId(e),s=this.rowFor(e);i&&s?(this.source=e,e.setAttribute("data-dragging","true"),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",i)),function(t,e){if(!t||"function"!=typeof t.setDragImage)return;const{height:i}=e.getBoundingClientRect();t.setDragImage(e,16,Math.max(0,i/2))}(t.dataTransfer,s)):t.preventDefault()};updateTarget(t,e,i){if(!this.source)return!1;if(!t||t===this.source)return this.clearTarget(),this.clearRejection(),!1;const s=this.rowFor(t);if(!s)return!1;const r=n(s.getBoundingClientRect(),e,this.acceptsChildren(t)),h=this.dropRejection(this.source,t,r);return h?(i&&(i.dropEffect="none"),this.clearTarget(),"max-depth"===h.reason?(this.rejectedTarget=t,this.rejectedPosition=r,this.rejection=h):this.clearRejection(),!1):(this.clearRejection(),i&&(i.dropEffect="move"),this.target===t&&this.position===r||(this.clearTarget(),this.target=t,this.position=r,t.setAttribute("data-drop-position",r)),"inside"===r&&"false"===t.getAttribute("aria-expanded")?this.hoverIntent?.schedule(this.itemId(t)):this.hoverIntent?.cancel(),!0)}onDrag=t=>{if(!this.source||0===t.clientX&&0===t.clientY)return;const e=this.itemAtPoint(t.clientX,t.clientY);e&&this.updateTarget(e,t.clientY,t.dataTransfer)};onDragOver=t=>{if(!this.source)return;const e=this.itemFromEvent(t);this.updateTarget(e,t.clientY,t.dataTransfer)&&t.preventDefault()};onDragLeave=t=>{this.isWithinTree(t.relatedTarget)||this.itemAtPoint(t.clientX,t.clientY)||(this.clearTarget(),this.clearRejection())};dispatchReorder(t,e,i){const s=this.itemId(t),n=this.itemId(e);if(!s||!n)return;"inside"===i&&this.expandTarget(n);const h=this.itemMetadata(t),o=this.itemMetadata(e);r(this.host,"reorder",{sourceId:s,targetId:n,position:i,sourceType:h.type,targetType:o.type,sourceScope:h.scope,targetScope:o.scope,trigger:"pointer"})}dispatchReorderRejected(t,e,i,s){const n=this.itemId(t),h=this.itemId(e);n&&h&&r(this.host,"reorder-rejected",{sourceId:n,targetId:h,position:i,reason:"max-depth",maxDepth:s.maxDepth,resultingDepth:s.resultingDepth,trigger:"pointer"})}onDrop=t=>{this.source&&this.target&&this.position&&(t.preventDefault(),this.dispatchReorder(this.source,this.target,this.position),this.finishDrag())};onDragEnd=t=>{if(this.source){if(this.rejectedTarget&&this.rejectedPosition&&this.rejection)return this.dispatchReorderRejected(this.source,this.rejectedTarget,this.rejectedPosition,this.rejection),void this.finishDrag();const e=this.itemAtPoint(t.clientX,t.clientY);if(e&&e!==this.source){const i=this.rowFor(e);if(i){const s=n(i.getBoundingClientRect(),t.clientY,this.acceptsChildren(e)),r=this.dropRejection(this.source,e,s);r?"max-depth"===r.reason&&this.dispatchReorderRejected(this.source,e,s,r):this.dispatchReorder(this.source,e,s)}}}this.finishDrag()};visibleItems(){return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((t=>t.getClientRects().length>0&&!t.hasAttribute("disabled")))}parentItem(t){const e=t.parentElement?.closest("ui-tree-item")??null;return e&&this.host.contains(e)?e:null}firstVisibleChild(t,e){return e.find((e=>this.parentItem(e)===t))??null}focusItem(t){this.syncTabStop(t),t.focus()}requestExpansion(t,e){t.dispatchEvent(new CustomEvent("ui-tree-request-expanded",{detail:{expanded:e,trigger:"keyboard"}}))}onFocusIn=t=>{if(this.eventTargetsInteractiveContent(t))return;const e=this.itemFromEvent(t);e&&this.syncTabStop(e)};onExpansionChange=()=>{requestAnimationFrame((()=>this.syncTabStop()))};onKeyDown=t=>{if(this.eventTargetsInteractiveContent(t))return;const e=this.itemFromEvent(t);if(!e)return;const i=this.visibleItems(),s=i.indexOf(e);if(s<0)return;const r="ArrowDown"===t.key?i[s+1]:"ArrowUp"===t.key?i[s-1]:"Home"===t.key?i[0]:"End"===t.key?i.at(-1):null;if(r)return t.preventDefault(),void this.focusItem(r);if("ArrowLeft"!==t.key){if("ArrowRight"===t.key)if("false"===e.getAttribute("aria-expanded"))t.preventDefault(),this.requestExpansion(e,!0);else if("true"===e.getAttribute("aria-expanded")){const s=this.firstVisibleChild(e,i);s&&(t.preventDefault(),this.focusItem(s))}}else"true"===e.getAttribute("aria-expanded")?(t.preventDefault(),this.requestExpansion(e,!1)):this.parentItem(e)&&(t.preventDefault(),this.focusItem(this.parentItem(e)))};render(){return i(s,{key:"bae06665078a67c59db2d9e72c7dea6ddeeb9e56",role:"tree","aria-label":this.label||"Tree"},i("slot",{key:"232cb02f1a50bc5e18a92c0d8677e917870ec75e"}))}};h.style=":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}";export{h as ui_tree}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { type EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import type { ComboboxConfig, ComboboxOption, ComboboxChange, ComboboxValidationState } from '../../field/combobox';
|
|
3
|
-
|
|
3
|
+
import type { MultiComboboxItem, MultiComboboxItemChange, MultiComboboxCreate } from '../../field/multi-combobox';
|
|
4
|
+
/**
|
|
5
|
+
* A single editable field with contextual suggestions, optional help and field validation.
|
|
6
|
+
* With `multiple`, it becomes a multi-value tag field: `value` holds the selected
|
|
7
|
+
* items, chips render before the cursor, and add/remove/create item events fire.
|
|
8
|
+
*/
|
|
4
9
|
export declare class UICombobox {
|
|
5
10
|
host: HTMLElement;
|
|
6
11
|
/** Accessible visible label, associated with the native text input. */
|
|
7
12
|
label: string;
|
|
8
13
|
placeholder: string;
|
|
9
14
|
name: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Controlled canonical value. Undefined selects uncontrolled mode; null means no selection.
|
|
17
|
+
* With `multiple`, this is the controlled list of selected items instead.
|
|
18
|
+
*/
|
|
19
|
+
value?: string | null | readonly MultiComboboxItem[];
|
|
12
20
|
defaultValue?: string;
|
|
21
|
+
/** Render selected values as removable chips before the cursor. `value` becomes the item list. */
|
|
22
|
+
multiple: boolean;
|
|
23
|
+
/** Characters that commit the current query and leave the input ready for the next item (multiple only). */
|
|
24
|
+
tokenSeparators: readonly string[];
|
|
13
25
|
/** Controlled raw editing text; independent of canonical selection. */
|
|
14
26
|
query?: string;
|
|
15
27
|
defaultQuery: string;
|
|
@@ -30,13 +42,20 @@ export declare class UICombobox {
|
|
|
30
42
|
display: string;
|
|
31
43
|
trigger: 'keyboard' | 'pointer' | 'programmatic';
|
|
32
44
|
}>;
|
|
33
|
-
|
|
45
|
+
/** Single mode: the ComboboxChange. Multiple mode: the full current item list on any change. */
|
|
46
|
+
valueChange: EventEmitter<ComboboxChange | readonly MultiComboboxItem[]>;
|
|
34
47
|
freeEntry: EventEmitter<ComboboxChange>;
|
|
35
48
|
createEntry: EventEmitter<ComboboxChange>;
|
|
36
49
|
dependencyInvalidate: EventEmitter<ComboboxChange>;
|
|
37
50
|
validationChange: EventEmitter<ComboboxValidationState>;
|
|
38
51
|
/** Supplies the current result rows for framework-owned rich slots. */
|
|
39
52
|
optionsChange: EventEmitter<readonly ComboboxOption[]>;
|
|
53
|
+
/** Multiple mode: a suggestion or exact-match token was committed as a new item. */
|
|
54
|
+
addItem: EventEmitter<MultiComboboxItemChange>;
|
|
55
|
+
/** Multiple mode: a selected item was removed via chip keyboard controls. */
|
|
56
|
+
removeItem: EventEmitter<MultiComboboxItemChange>;
|
|
57
|
+
/** Multiple mode: an unmatched query was submitted for creation. */
|
|
58
|
+
createItem: EventEmitter<MultiComboboxCreate>;
|
|
40
59
|
raw: string;
|
|
41
60
|
display: string;
|
|
42
61
|
selected: string | null;
|
|
@@ -64,6 +83,9 @@ export declare class UICombobox {
|
|
|
64
83
|
private proposedChange?;
|
|
65
84
|
private formattedRaw?;
|
|
66
85
|
private formattedWith?;
|
|
86
|
+
/** Multiple mode: the controlled selected items (from `value`). Empty otherwise. */
|
|
87
|
+
private get items();
|
|
88
|
+
private get selectedValues();
|
|
67
89
|
componentWillLoad(): void;
|
|
68
90
|
connectedCallback(): void;
|
|
69
91
|
componentDidLoad(): void;
|
|
@@ -85,6 +107,15 @@ export declare class UICombobox {
|
|
|
85
107
|
private onInput;
|
|
86
108
|
private commit;
|
|
87
109
|
private choose;
|
|
110
|
+
private emitItems;
|
|
111
|
+
private setMultiQuery;
|
|
112
|
+
private addSelectedItem;
|
|
113
|
+
private createSelectedItem;
|
|
114
|
+
private commitQuery;
|
|
115
|
+
private removeItemAt;
|
|
116
|
+
private focusItem;
|
|
117
|
+
private onItemKeyDown;
|
|
118
|
+
private handleMultipleKeydown;
|
|
88
119
|
private move;
|
|
89
120
|
private onKeydown;
|
|
90
121
|
private onFocusOut;
|