@threadlabs/looma 0.1.27 → 0.2.0
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-RLELJVBL.js → chunk-JXSHRMYW.js} +32 -33
- package/dist/{chunk-YHXJC5M5.js → chunk-M7FPK6GN.js} +17 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/{positioning-i0WrCAdF.js → positioning-D5q9DM-0.js} +19 -12
- 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 +2 -2
- 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 +3 -3
- package/dist/cjs/ui-popover.cjs.entry.js +3 -3
- 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.css +1 -0
- 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.css +7 -2
- 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.css +6 -2
- 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 +21 -14
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DZRtXH6j.js → p-DWN2m6ta.js} +1 -1
- package/dist/components/p-DYiNETk6.js +1 -0
- package/dist/components/p-Drw41pSY.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-Bu0dmLBE.js → positioning-Drmwg-C1.js} +19 -12
- 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 +2 -2
- 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 +3 -3
- package/dist/esm/ui-popover.entry.js +3 -3
- 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 +525 -550
- package/dist/index.js +27 -14
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/{p-9a82c523.entry.js → p-1249a806.entry.js} +1 -1
- 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-72338f53.entry.js → p-32c85198.entry.js} +1 -1
- package/dist/looma/{p-b75aff63.entry.js → p-37ec2b4b.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-9551ebf6.entry.js → p-424d6719.entry.js} +1 -1
- package/dist/looma/{p-6cc3180b.entry.js → p-4caccfce.entry.js} +1 -1
- package/dist/looma/p-55e06e2e.entry.js +1 -0
- package/dist/looma/{p-a939c00f.entry.js → p-56dac38a.entry.js} +1 -1
- package/dist/looma/p-5cbbf7a0.entry.js +1 -0
- 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-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-Drmwg-C1.js +1 -0
- package/dist/looma/{p-607c3056.entry.js → p-b6ede6bb.entry.js} +1 -1
- package/dist/looma/p-b6fb6ba3.entry.js +1 -0
- 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-d46317e0.entry.js +1 -0
- 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-e604e906.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-7H6GIQEK.js → ui-affordance-scope.entry-VR7FLAWG.js} +2 -2
- package/dist/{ui-avatar-group.entry-QB25IUWA.js → ui-avatar-group.entry-L3UKOY3U.js} +1 -1
- package/dist/{ui-avatar.entry-L377CWPR.js → ui-avatar.entry-VM5OHEFQ.js} +1 -1
- package/dist/{ui-badge.entry-QHC3KI5S.js → ui-badge.entry-ZTM4OPUD.js} +1 -1
- package/dist/{ui-button.entry-MZGTPU22.js → ui-button.entry-CIPUSV5B.js} +1 -1
- package/dist/{ui-callout.entry-2D4LO74K.js → ui-callout.entry-OBFCI2O7.js} +1 -1
- package/dist/{ui-checkbox.entry-B2O5DREC.js → ui-checkbox.entry-XT6ET56H.js} +1 -1
- package/dist/{ui-tooltip.entry-VG4AWEBD.js → ui-chip_2.entry-32SHCLV6.js} +19 -4
- package/dist/{ui-chip_2.entry-OOSON72O.js → ui-combobox.entry-ONBBPQ2C.js} +170 -31
- package/dist/{ui-context-menu.entry-UY76G7HM.js → ui-context-menu.entry-RXNUOK24.js} +3 -3
- package/dist/{ui-dialog.entry-345V7IJ3.js → ui-dialog.entry-IJXNUARC.js} +3 -3
- package/dist/{ui-disclosure.entry-RUU7VNDN.js → ui-disclosure.entry-5QS7UDRH.js} +2 -2
- package/dist/{ui-editable.entry-WWFFHOMP.js → ui-editable.entry-D7LOQN2H.js} +3 -3
- package/dist/{ui-floating-action-button.entry-Y2TLDJO4.js → ui-floating-action-button.entry-XQZCTZQT.js} +2 -2
- package/dist/{ui-form-field.entry-C63GZMQR.js → ui-form-field.entry-A654LJZE.js} +2 -2
- package/dist/{ui-icon-button.entry-35MJYYEI.js → ui-icon-button.entry-MJ7F7ZIH.js} +2 -2
- package/dist/{ui-input.entry-3FAXEH5M.js → ui-input.entry-B2XM7JQU.js} +2 -2
- package/dist/{ui-menu-item.entry-3J42XLCJ.js → ui-menu-item.entry-JULYSFVW.js} +2 -2
- package/dist/{ui-menu.entry-YDABO3OO.js → ui-menu.entry-ORRWW7HD.js} +4 -4
- package/dist/{ui-popover.entry-YP7R6FQO.js → ui-popover.entry-W67V4UPA.js} +4 -4
- package/dist/{ui-radio-group.entry-TYXAN7G5.js → ui-radio-group.entry-KCFOR27M.js} +2 -2
- package/dist/{ui-radio.entry-JW7HX3LW.js → ui-radio.entry-I2P4V5E3.js} +2 -2
- package/dist/{ui-search-result-row.entry-MKQYGNFO.js → ui-search-result-row.entry-GHODLSLR.js} +2 -2
- package/dist/{ui-search-shell.entry-KHIQTT4J.js → ui-search-shell.entry-PDB5UN4B.js} +2 -2
- package/dist/{ui-select.entry-R235Y3IL.js → ui-select.entry-D3CZHCKB.js} +2 -2
- package/dist/{ui-switch.entry-BJ6FIEPB.js → ui-switch.entry-WUDRL4H5.js} +3 -3
- package/dist/{ui-tabs.entry-ZBP3FLR2.js → ui-tabs.entry-MW64GKIJ.js} +2 -2
- package/dist/{ui-textarea.entry-2YW7TCEU.js → ui-textarea.entry-VHRBYY6G.js} +2 -2
- package/dist/{ui-toast-region.entry-ZSCMMIKQ.js → ui-toast-region.entry-ET75RWYP.js} +3 -3
- package/dist/{ui-top-bar.entry-CZW3MLC6.js → ui-top-bar.entry-QIYA3LD3.js} +2 -2
- package/dist/{ui-tree-item.entry-CU2SWAOK.js → ui-tree-item.entry-BDB7VEUS.js} +3 -3
- package/dist/{ui-tree.entry-M6KXK7GJ.js → ui-tree.entry-GSC7BPRN.js} +2 -2
- package/package.json +1 -1
- package/styles.css +6 -4
- 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-BKzrrab4.js +0 -1
- package/dist/components/p-D0wBI-9r.js +0 -1
- package/dist/components/p-DOulVJT7.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-0fd60103.entry.js +0 -1
- package/dist/looma/p-4fc9917f.entry.js +0 -1
- package/dist/looma/p-66c6b6dd.entry.js +0 -1
- package/dist/looma/p-77dcfa6f.entry.js +0 -1
- package/dist/looma/p-85a6716e.entry.js +0 -1
- package/dist/looma/p-8f102407.entry.js +0 -1
- package/dist/looma/p-Bu0dmLBE.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-XXLS4V3I.js +0 -196
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=16;let n=0;const o=new WeakMap;function a(t){try{return t.matches(":popover-open")}catch{return!t.hidden}}function i(t){if(t.setAttribute("popover","manual"),t.hidden=!1,"function"==typeof t.showPopover&&!a(t))try{t.showPopover()}catch{}}function e(t){if("function"==typeof t.hidePopover&&a(t))try{t.hidePopover()}catch{}t.hidden=!0}function r(t){return t.setAttribute("popover","manual"),t.dataset.uiPositioning="viewport",{show(){i(t)},hide(){e(t)},destroy(){e(t)}}}function l(t,n,o,a,i){const e=u(t.ownerDocument.defaultView??window),r=t.getBoundingClientRect(),l=o.startsWith("top"),c=o.endsWith("end"),s=e.bottom-n.bottom-i,h=n.top-e.top-i,p=(l?!(h<r.height+a&&s>h):s<r.height+a&&h>s)?n.top-r.height-a:n.bottom+a,f=c?n.right-r.width:n.left,d=function(t,n=u(),o=0){const a=Math.max(0,n.width-2*o),i=Math.max(0,n.height-2*o),e=t.width>a?n.left+o:Math.min(Math.max(t.left,n.left+o),n.right-o-t.width),r=t.height>i?n.top+o:Math.min(Math.max(t.top,n.top+o),n.bottom-o-t.height);return{x:e-t.left,y:r-t.top}}({left:f,top:p,width:r.width,height:r.height},e,i);t.style.left=`${Math.round(f+d.x)}px`,t.style.top=`${Math.round(p+d.y)}px`,t.style.right="auto",t.style.bottom="auto"}function c(t,a={}){const r=t.ownerDocument.defaultView??window,c=a.placement??"bottom-start",u=Math.max(0,a.gap??4),s=Math.max(0,a.viewportGap??8),h=function(t){const n=t.CSS;return"function"==typeof n?.supports&&n.supports("anchor-name: --ui-anchor-test")&&n.supports("position-anchor: --ui-anchor-test")&&n.supports("top: anchor(bottom)")}(r),p="--ui-anchor-"+ ++n;let f=a.anchor??null,d=null,m=!1,g=null,y=null;t.setAttribute("popover","manual"),t.dataset.uiPositioning=h?"anchor":"fallback",t.style.position="fixed",t.style.margin="0";const w=n=>{f&&function(t,n){const a=o.get(t);if(a)if(a.names.delete(n),a.names.size){const n=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",n.join(", "))}else a.original?t.style.setProperty("anchor-name",a.original):t.style.removeProperty("anchor-name"),o.delete(t)}(f,p),f=n,f?(function(t,n){const a=o.get(t)??{original:t.style.getPropertyValue("anchor-name"),names:new Set};a.names.add(n),o.set(t,a);const i=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",i.join(", "))}(f,p),t.style.setProperty("position-anchor",p)):t.style.removeProperty("position-anchor")},v=()=>{g=null,m&&(d?l(t,{left:d.x,right:d.x,top:d.y,bottom:d.y},"bottom-start",u,s):f&&(h?(()=>{const n=c.startsWith("bottom"),o=c.endsWith("end");t.style.top=n?`calc(anchor(bottom) + ${u}px)`:"auto",t.style.bottom=n?"auto":`calc(anchor(top) + ${u}px)`,t.style.left=o?"auto":"anchor(left)",t.style.right=o?"anchor(right)":"auto",t.style.setProperty("position-try-fallbacks","flip-block, flip-inline")})():l(t,f.getBoundingClientRect(),c,u,s)))},b=()=>{m&&null===g&&(g=r.requestAnimationFrame(v))},M=()=>{if(!m||null===d&&h)return y?.abort(),void(y=null);if(y)return;y=new AbortController;const t=y.signal;r.addEventListener("resize",b,{passive:!0,signal:t}),r.addEventListener("scroll",b,{passive:!0,capture:!0,signal:t}),r.visualViewport?.addEventListener("resize",b,{passive:!0,signal:t}),r.visualViewport?.addEventListener("scroll",b,{passive:!0,signal:t})};return w(f),{setAnchor(t){d=null,w(t),M(),b()},show(){d=null,m=!0,M(),i(t),v()},showAtPoint(n){d=n,m=!0,M(),i(t),v()},hide(){m=!1,d=null,M(),null!==g&&r.cancelAnimationFrame(g),g=null,e(t)},refresh:b,destroy(){m=!1,y?.abort(),y=null,null!==g&&r.cancelAnimationFrame(g),g=null,e(t),w(null)}}}function u(t=window){const n=t.visualViewport,o=n?.offsetLeft??0,a=n?.offsetTop??0,i=n?.width??t.innerWidth,e=n?.height??t.innerHeight;return{left:o,top:a,right:o+i,bottom:a+e,width:i,height:e}}function s(t,n){const o=Math.max(n.left-t.x,0,t.x-n.right),a=Math.max(n.top-t.y,0,t.y-n.bottom);return Math.hypot(o,a)}function h(t,n={}){const o=t.ownerDocument.defaultView??window,a=n.pointerTarget??t,i=n.anchorSelector??"[data-ui-affordance]",e=n.nearRadius??16,r=Number.isFinite(e)?Math.max(0,e):16,l=new AbortController;let c=[],u=null,h=null,p=!1;const f=()=>{for(const{element:t}of c)t.hasAttribute("data-ui-proximity")&&t.removeAttribute("data-ui-proximity");t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},d=()=>{c=Array.from(t.querySelectorAll(i)).filter((t=>!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-disabled"))).map((t=>({element:t,rect:t.getBoundingClientRect()}))),p=!1},m=()=>{if(u=null,p&&d(),!h)return void f();let n=!1;for(const t of c){const o=s(h,t.rect)<=r;o&&"near"!==t.element.getAttribute("data-ui-proximity")?t.element.setAttribute("data-ui-proximity","near"):!o&&t.element.hasAttribute("data-ui-proximity")&&t.element.removeAttribute("data-ui-proximity"),n||=o}n&&"engaged"!==t.getAttribute("data-ui-interaction")?t.setAttribute("data-ui-interaction","engaged"):!n&&t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},g=()=>{null===u&&(u=o.requestAnimationFrame(m))},y=()=>{p=!0,g()};return a.addEventListener("pointermove",(t=>{h="touch"===t.pointerType?null:{x:t.clientX,y:t.clientY},g()}),{passive:!0,signal:l.signal}),o.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.addEventListener("scroll",y,{passive:!0,capture:!0,signal:l.signal}),o.visualViewport?.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.visualViewport?.addEventListener("scroll",y,{passive:!0,signal:l.signal}),d(),{refresh:y,destroy(){l.abort(),null!==u&&o.cancelAnimationFrame(u),u=null,h=null,f(),c=[]}}}export{t as D,h as a,r as b,c}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface UiMultiCombobox extends Components.UiMultiCombobox, HTMLElement {}
|
|
4
|
-
export const UiMultiCombobox: {
|
|
5
|
-
prototype: UiMultiCombobox;
|
|
6
|
-
new (): UiMultiCombobox;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as t,d as i,h as s,c as o,t as a}from"./p-Bh_1GxOD.js";import{d as r}from"./p-Vc4ExHFc.js";import{d as n}from"./p-BKzrrab4.js";import{d as c}from"./p-DZRtXH6j.js";const h=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.queryChange=i(this,"query-change"),this.addItem=i(this,"add-item"),this.removeItem=i(this,"remove-item"),this.createItem=i(this,"create-item"),this.optionsChange=i(this,"options-change")}get host(){return this}label="";placeholder="";items=[];config={};query;defaultQuery="";tokenSeparators=[];disabled=!1;readOnly=!1;required=!1;name="";queryChange;addItem;removeItem;createItem;optionsChange;raw="";rows=[];combobox;filteredConfig;filteredConfigSource;filteredSelection="";componentWillLoad(){this.raw=this.query??this.defaultQuery}syncQuery(){void 0!==this.query&&(this.raw=this.query)}get selectedValues(){return new Set(this.items.map((e=>e.value)))}get comboboxConfig(){const e=this.items.map((e=>e.value)).join("\0");if(this.filteredConfig&&this.filteredConfigSource===this.config&&this.filteredSelection===e)return this.filteredConfig;const t=this.config.filter,i=this.selectedValues;return this.filteredConfigSource=this.config,this.filteredSelection=e,this.filteredConfig={...this.config,filter:(e,s,o)=>!i.has(e.value)&&(t?t(e,s,o):e.label.toLocaleLowerCase().includes(s.toLocaleLowerCase()))},this.filteredConfig}setQuery(e,t){void 0===this.query&&(this.raw=e),this.queryChange.emit({query:e,display:e,trigger:t})}clearCommittedQuery(e,t){e.value="",this.raw="",this.setQuery("",t)}onQueryChange=e=>{e.stopPropagation(),this.setQuery(e.detail.query,e.detail.trigger)};onOptionsChange=e=>{e.stopPropagation(),this.rows=e.detail,this.optionsChange.emit(e.detail)};onValueChange=e=>{e.stopPropagation(),"selection"===e.detail.kind&&e.detail.option&&(this.addItem.emit({item:e.detail.option,index:this.items.length,trigger:e.detail.trigger}),queueMicrotask((()=>this.setQuery("",e.detail.trigger))))};onCreateEntry=e=>{e.stopPropagation();const t=e.detail.query.trim();t&&(this.setQuery("",e.detail.trigger),this.createItem.emit({query:t,trigger:e.detail.trigger}))};commitQuery(e,t){const i=this.raw.trim();if(!i)return;const s=i.toLocaleLowerCase(),o=this.rows.find((e=>e.label.trim().toLocaleLowerCase()===s));o?(this.clearCommittedQuery(e,t),this.addItem.emit({item:o,index:this.items.length,trigger:t})):this.config.allowCreate&&(this.clearCommittedQuery(e,t),this.createItem.emit({query:i,trigger:t}))}remove(e,t){const i=this.items[e];!i||i.disabled||this.disabled||this.readOnly||(this.removeItem.emit({item:i,index:e,trigger:t}),requestAnimationFrame((()=>{const t=this.host.shadowRoot?.querySelectorAll('[part="item"]')??[],s=t[Math.min(e,t.length-1)]??t[e-1];s&&s.dataset.value!==i.value?s.focus():this.focusInput()})))}focusItem(e){this.host.shadowRoot?.querySelectorAll('[part="item"]')[e]?.focus()}onItemKeyDown=(e,t)=>{e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||("ArrowLeft"===e.key?(e.preventDefault(),e.stopPropagation(),this.focusItem(Math.max(0,t-1))):"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),t===this.items.length-1?this.focusInput():this.focusItem(t+1)):"Backspace"!==e.key&&"Delete"!==e.key||(e.preventDefault(),e.stopPropagation(),this.remove(t,"keyboard")))};onKeyDown=e=>{if(e.defaultPrevented||e.isComposing||this.disabled||this.readOnly||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const t=e.composedPath().find((e=>e instanceof HTMLInputElement));return t?this.tokenSeparators.includes(e.key)?(e.preventDefault(),e.stopPropagation(),void this.commitQuery(t,"keyboard")):void(this.raw||(t.selectionStart??0)>0||("ArrowLeft"===e.key&&this.items.length?(e.preventDefault(),this.focusItem(this.items.length-1)):"Backspace"===e.key&&this.items.length&&(e.preventDefault(),this.remove(this.items.length-1,"keyboard")))):void 0};async focusInput(){await(this.combobox?.focusInput())}render(){return s(o,{key:"ba4db0fdca6cae344fe6b0bf06c933a9a90d2d3f",onKeyDown:this.onKeyDown},s("ui-combobox",{key:"f5901b0b078b479425114d998618828cc458e7dd",ref:e=>this.combobox=e,label:this.label,"label-visibility":"sr-only",placeholder:this.placeholder,name:this.name,value:null,query:this.raw,config:this.comboboxConfig,size:"sm",disabled:this.disabled,readOnly:this.readOnly,required:this.required,"onQuery-change":this.onQueryChange,"onValue-change":this.onValueChange,"onCreate-entry":this.onCreateEntry,"onOptions-change":this.onOptionsChange},s("div",{key:"374c80862302d5c36f4849f42e5ed13222addd1c",slot:"start",class:"items",role:"group","aria-label":"Selected "+this.label},this.items.map(((e,t)=>s("button",{type:"button",part:"item",class:"item","data-value":e.value,tabIndex:-1,disabled:this.disabled||this.readOnly||e.disabled,"aria-label":e.label+", press Delete or Backspace to remove",onKeyDown:e=>this.onItemKeyDown(e,t)},s("slot",{name:"item-"+e.id},s("ui-chip",{appearance:"pill"},e.label)))))),this.rows.map((e=>s("span",{slot:"option-"+e.id},s("slot",{name:"option-"+e.id},e.label)))),s("span",{key:"a23781c153e154cdff7066868c2da956e26b7d52",slot:"create"},s("slot",{key:"e3bde0d1e549e785fff877a1a7aac10df308f7a3",name:"create"},"Create “",this.raw,"”")),s("span",{key:"5837c4cde35d5984aaf1d364f1b850b9d63ff8ca",slot:"loading"},s("slot",{key:"1bdfa30849bea752bc5c93268b3427c964d1b5d3",name:"loading"},"Loading suggestions…")),s("span",{key:"519d7b1a7f28f9d19cd441598a690c8b4fdacf5b",slot:"empty"},s("slot",{key:"3163150e0f1edebb50509a5dacd576e4568eaaae",name:"empty"},"No suggestions.")),s("span",{key:"655e4f85d70eb97f0f0ecb2bac7b4228f5cf580f",slot:"error"},s("slot",{key:"a22667db30ee30003855ee69774eff3a4aab8566",name:"error"},"Unable to load suggestions.")),s("div",{key:"b01b74f3fc7136a3bf1875c81b9f3a662f3e993c",slot:"footer"},s("slot",{key:"7565ee0798072eebc6d1c458f89ce6c7941577dd",name:"footer"}))))}static get watchers(){return{query:[{syncQuery:0}]}}static get style(){return":host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(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)}ui-combobox::part(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}"}},[769,"ui-multi-combobox",{label:[1],placeholder:[1],items:[16],config:[16],query:[1],defaultQuery:[1,"default-query"],tokenSeparators:[16],disabled:[4],readOnly:[4,"readonly"],required:[4],name:[1],raw:[32],rows:[32],focusInput:[64]},void 0,{query:[{syncQuery:0}]}]),l=h,d=function(){"undefined"!=typeof customElements&&["ui-multi-combobox","ui-chip","ui-combobox","ui-tooltip"].forEach((e=>{switch(e){case"ui-multi-combobox":customElements.get(a(e))||customElements.define(a(e),h);break;case"ui-chip":customElements.get(a(e))||r();break;case"ui-combobox":customElements.get(a(e))||n();break;case"ui-tooltip":customElements.get(a(e))||c()}}))};export{l as UiMultiCombobox,d as defineCustomElement}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
-
|
|
3
|
-
const uiMultiComboboxCss = () => `:host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(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)}ui-combobox::part(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}`;
|
|
4
|
-
|
|
5
|
-
const UIMultiCombobox = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.queryChange = createEvent(this, "query-change");
|
|
9
|
-
this.addItem = createEvent(this, "add-item");
|
|
10
|
-
this.removeItem = createEvent(this, "remove-item");
|
|
11
|
-
this.createItem = createEvent(this, "create-item");
|
|
12
|
-
this.optionsChange = createEvent(this, "options-change");
|
|
13
|
-
}
|
|
14
|
-
get host() { return getElement(this); }
|
|
15
|
-
label = '';
|
|
16
|
-
placeholder = '';
|
|
17
|
-
items = [];
|
|
18
|
-
config = {};
|
|
19
|
-
query;
|
|
20
|
-
defaultQuery = '';
|
|
21
|
-
/** Characters that commit the current query and leave the input ready for the next item. */
|
|
22
|
-
tokenSeparators = [];
|
|
23
|
-
disabled = false;
|
|
24
|
-
readOnly = false;
|
|
25
|
-
required = false;
|
|
26
|
-
name = '';
|
|
27
|
-
queryChange;
|
|
28
|
-
addItem;
|
|
29
|
-
removeItem;
|
|
30
|
-
createItem;
|
|
31
|
-
optionsChange;
|
|
32
|
-
raw = '';
|
|
33
|
-
rows = [];
|
|
34
|
-
combobox;
|
|
35
|
-
filteredConfig;
|
|
36
|
-
filteredConfigSource;
|
|
37
|
-
filteredSelection = '';
|
|
38
|
-
componentWillLoad() { this.raw = this.query ?? this.defaultQuery; }
|
|
39
|
-
syncQuery() {
|
|
40
|
-
if (this.query !== undefined)
|
|
41
|
-
this.raw = this.query;
|
|
42
|
-
}
|
|
43
|
-
get selectedValues() { return new Set(this.items.map(item => item.value)); }
|
|
44
|
-
get comboboxConfig() {
|
|
45
|
-
const selectionKey = this.items.map(item => item.value).join('\u0000');
|
|
46
|
-
if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
|
|
47
|
-
return this.filteredConfig;
|
|
48
|
-
}
|
|
49
|
-
const ownerFilter = this.config.filter;
|
|
50
|
-
const selected = this.selectedValues;
|
|
51
|
-
this.filteredConfigSource = this.config;
|
|
52
|
-
this.filteredSelection = selectionKey;
|
|
53
|
-
this.filteredConfig = {
|
|
54
|
-
...this.config,
|
|
55
|
-
filter: (option, query, context) => !selected.has(option.value)
|
|
56
|
-
&& (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())),
|
|
57
|
-
};
|
|
58
|
-
return this.filteredConfig;
|
|
59
|
-
}
|
|
60
|
-
setQuery(query, trigger) {
|
|
61
|
-
if (this.query === undefined)
|
|
62
|
-
this.raw = query;
|
|
63
|
-
this.queryChange.emit({ query, display: query, trigger });
|
|
64
|
-
}
|
|
65
|
-
clearCommittedQuery(input, trigger) {
|
|
66
|
-
// Clear the native control before another key can arrive. Controlled adapters
|
|
67
|
-
// still receive query-change, but do not need to round-trip before typing resumes.
|
|
68
|
-
input.value = '';
|
|
69
|
-
this.raw = '';
|
|
70
|
-
this.setQuery('', trigger);
|
|
71
|
-
}
|
|
72
|
-
onQueryChange = (event) => {
|
|
73
|
-
event.stopPropagation();
|
|
74
|
-
this.setQuery(event.detail.query, event.detail.trigger);
|
|
75
|
-
};
|
|
76
|
-
onOptionsChange = (event) => {
|
|
77
|
-
event.stopPropagation();
|
|
78
|
-
this.rows = event.detail;
|
|
79
|
-
this.optionsChange.emit(event.detail);
|
|
80
|
-
};
|
|
81
|
-
onValueChange = (event) => {
|
|
82
|
-
event.stopPropagation();
|
|
83
|
-
if (event.detail.kind !== 'selection' || !event.detail.option)
|
|
84
|
-
return;
|
|
85
|
-
const item = event.detail.option;
|
|
86
|
-
this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
|
|
87
|
-
// ui-combobox emits its selection value before the matching label query.
|
|
88
|
-
// Clear after both owner notifications so the stale label cannot win.
|
|
89
|
-
queueMicrotask(() => this.setQuery('', event.detail.trigger));
|
|
90
|
-
};
|
|
91
|
-
onCreateEntry = (event) => {
|
|
92
|
-
event.stopPropagation();
|
|
93
|
-
const query = event.detail.query.trim();
|
|
94
|
-
if (!query)
|
|
95
|
-
return;
|
|
96
|
-
this.setQuery('', event.detail.trigger);
|
|
97
|
-
this.createItem.emit({ query, trigger: event.detail.trigger });
|
|
98
|
-
};
|
|
99
|
-
commitQuery(input, trigger) {
|
|
100
|
-
const query = this.raw.trim();
|
|
101
|
-
if (!query)
|
|
102
|
-
return;
|
|
103
|
-
const normalizedQuery = query.toLocaleLowerCase();
|
|
104
|
-
const option = this.rows.find(row => row.label.trim().toLocaleLowerCase() === normalizedQuery);
|
|
105
|
-
if (option) {
|
|
106
|
-
this.clearCommittedQuery(input, trigger);
|
|
107
|
-
this.addItem.emit({ item: option, index: this.items.length, trigger });
|
|
108
|
-
}
|
|
109
|
-
else if (this.config.allowCreate) {
|
|
110
|
-
this.clearCommittedQuery(input, trigger);
|
|
111
|
-
this.createItem.emit({ query, trigger });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
remove(index, trigger) {
|
|
115
|
-
const item = this.items[index];
|
|
116
|
-
if (!item || item.disabled || this.disabled || this.readOnly)
|
|
117
|
-
return;
|
|
118
|
-
this.removeItem.emit({ item, index, trigger });
|
|
119
|
-
requestAnimationFrame(() => {
|
|
120
|
-
const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
|
|
121
|
-
const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
|
|
122
|
-
if (next && next.dataset.value !== item.value)
|
|
123
|
-
next.focus();
|
|
124
|
-
else
|
|
125
|
-
void this.focusInput();
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
focusItem(index) {
|
|
129
|
-
this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
|
|
130
|
-
}
|
|
131
|
-
onItemKeyDown = (event, index) => {
|
|
132
|
-
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
133
|
-
return;
|
|
134
|
-
if (event.key === 'ArrowLeft') {
|
|
135
|
-
event.preventDefault();
|
|
136
|
-
event.stopPropagation();
|
|
137
|
-
this.focusItem(Math.max(0, index - 1));
|
|
138
|
-
}
|
|
139
|
-
else if (event.key === 'ArrowRight') {
|
|
140
|
-
event.preventDefault();
|
|
141
|
-
event.stopPropagation();
|
|
142
|
-
if (index === this.items.length - 1)
|
|
143
|
-
void this.focusInput();
|
|
144
|
-
else
|
|
145
|
-
this.focusItem(index + 1);
|
|
146
|
-
}
|
|
147
|
-
else if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
event.stopPropagation();
|
|
150
|
-
this.remove(index, 'keyboard');
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
onKeyDown = (event) => {
|
|
154
|
-
if (event.defaultPrevented || event.isComposing || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
155
|
-
return;
|
|
156
|
-
const input = event.composedPath().find(node => node instanceof HTMLInputElement);
|
|
157
|
-
if (!input)
|
|
158
|
-
return;
|
|
159
|
-
if (this.tokenSeparators.includes(event.key)) {
|
|
160
|
-
event.preventDefault();
|
|
161
|
-
event.stopPropagation();
|
|
162
|
-
this.commitQuery(input, 'keyboard');
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (this.raw || (input.selectionStart ?? 0) > 0)
|
|
166
|
-
return;
|
|
167
|
-
if (event.key === 'ArrowLeft' && this.items.length) {
|
|
168
|
-
event.preventDefault();
|
|
169
|
-
this.focusItem(this.items.length - 1);
|
|
170
|
-
}
|
|
171
|
-
else if (event.key === 'Backspace' && this.items.length) {
|
|
172
|
-
event.preventDefault();
|
|
173
|
-
this.remove(this.items.length - 1, 'keyboard');
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
async focusInput() { await this.combobox?.focusInput(); }
|
|
177
|
-
render() {
|
|
178
|
-
return h(Host, { key: 'ba4db0fdca6cae344fe6b0bf06c933a9a90d2d3f', onKeyDown: this.onKeyDown }, h("ui-combobox", { key: 'f5901b0b078b479425114d998618828cc458e7dd', ref: element => this.combobox = element, label: this.label, "label-visibility": "sr-only", placeholder: this.placeholder, name: this.name, value: null, query: this.raw, config: this.comboboxConfig, size: "sm", disabled: this.disabled, readOnly: this.readOnly, required: this.required, "onQuery-change": this.onQueryChange, "onValue-change": this.onValueChange, "onCreate-entry": this.onCreateEntry, "onOptions-change": this.onOptionsChange }, h("div", { key: '374c80862302d5c36f4849f42e5ed13222addd1c', slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, 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) }, h("slot", { name: `item-${item.id}` }, h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map(option => h("span", { slot: `option-${option.id}` }, h("slot", { name: `option-${option.id}` }, option.label))), h("span", { key: 'a23781c153e154cdff7066868c2da956e26b7d52', slot: "create" }, h("slot", { key: 'e3bde0d1e549e785fff877a1a7aac10df308f7a3', name: "create" }, "Create \u201C", this.raw, "\u201D")), h("span", { key: '5837c4cde35d5984aaf1d364f1b850b9d63ff8ca', slot: "loading" }, h("slot", { key: '1bdfa30849bea752bc5c93268b3427c964d1b5d3', name: "loading" }, "Loading suggestions\u2026")), h("span", { key: '519d7b1a7f28f9d19cd441598a690c8b4fdacf5b', slot: "empty" }, h("slot", { key: '3163150e0f1edebb50509a5dacd576e4568eaaae', name: "empty" }, "No suggestions.")), h("span", { key: '655e4f85d70eb97f0f0ecb2bac7b4228f5cf580f', slot: "error" }, h("slot", { key: 'a22667db30ee30003855ee69774eff3a4aab8566', name: "error" }, "Unable to load suggestions.")), h("div", { key: 'b01b74f3fc7136a3bf1875c81b9f3a662f3e993c', slot: "footer" }, h("slot", { key: '7565ee0798072eebc6d1c458f89ce6c7941577dd', name: "footer" }))));
|
|
179
|
-
}
|
|
180
|
-
static get watchers() { return {
|
|
181
|
-
"query": [{
|
|
182
|
-
"syncQuery": 0
|
|
183
|
-
}]
|
|
184
|
-
}; }
|
|
185
|
-
};
|
|
186
|
-
UIMultiCombobox.style = uiMultiComboboxCss();
|
|
187
|
-
|
|
188
|
-
export { UIMultiCombobox as ui_multi_combobox };
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
-
import { o as openOverlay, c as closeOverlay } from './manager-C-0syqXZ.js';
|
|
3
|
-
import { d as dispatchDetail } from './events-JwSoedEO.js';
|
|
4
|
-
import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
|
|
5
|
-
import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
|
|
6
|
-
|
|
7
|
-
const uiTooltipCss = () => `:host{position:fixed;inset:auto;margin:0;display:inline-block;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent;opacity:0;transform:translateY(4px);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}.tooltip__surface{box-sizing:border-box;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md)}:host(:popover-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}`;
|
|
8
|
-
|
|
9
|
-
const UITooltip = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
registerInstance(this, hostRef);
|
|
12
|
-
this.opened = createEvent(this, "open");
|
|
13
|
-
this.closed = createEvent(this, "close");
|
|
14
|
-
}
|
|
15
|
-
get host() { return getElement(this); }
|
|
16
|
-
for = '';
|
|
17
|
-
/** Controlled open state. Omit it to use defaultOpen and local interaction state. */
|
|
18
|
-
open;
|
|
19
|
-
defaultOpen = false;
|
|
20
|
-
placement = 'top-start';
|
|
21
|
-
/** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
|
|
22
|
-
showDelay = 500;
|
|
23
|
-
/** Pointer leave grace period in milliseconds. */
|
|
24
|
-
hideDelay = 100;
|
|
25
|
-
/** Click or tap pins the description; activate again to dismiss. */
|
|
26
|
-
toggleOnClick = false;
|
|
27
|
-
pinned = false;
|
|
28
|
-
focused = false;
|
|
29
|
-
opened;
|
|
30
|
-
closed;
|
|
31
|
-
internalOpen = false;
|
|
32
|
-
overlayId = `ui-tooltip-${Math.random().toString(36).slice(2, 11)}`;
|
|
33
|
-
trigger = null;
|
|
34
|
-
surface = null;
|
|
35
|
-
showTimer = null;
|
|
36
|
-
hideTimer = null;
|
|
37
|
-
syncFromProp() {
|
|
38
|
-
this.clearTimers();
|
|
39
|
-
if (isControlled(this.open))
|
|
40
|
-
this.internalOpen = this.open;
|
|
41
|
-
}
|
|
42
|
-
resetSurface() {
|
|
43
|
-
this.syncTrigger();
|
|
44
|
-
this.setupSurface();
|
|
45
|
-
this.syncOverlay();
|
|
46
|
-
}
|
|
47
|
-
syncOverlay() {
|
|
48
|
-
if (this.internalOpen) {
|
|
49
|
-
this.surface?.show();
|
|
50
|
-
openOverlay({
|
|
51
|
-
id: this.overlayId,
|
|
52
|
-
modal: false,
|
|
53
|
-
element: this.host,
|
|
54
|
-
relatedElements: this.trigger ? [this.trigger] : undefined,
|
|
55
|
-
dismissible: true,
|
|
56
|
-
requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
this.surface?.hide();
|
|
61
|
-
closeOverlay(this.overlayId);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
componentDidLoad() {
|
|
65
|
-
if (!this.host.id)
|
|
66
|
-
this.host.id = this.overlayId;
|
|
67
|
-
this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
|
|
68
|
-
this.syncTrigger();
|
|
69
|
-
this.setupSurface();
|
|
70
|
-
this.host.addEventListener('pointerenter', this.onSurfaceEnter);
|
|
71
|
-
this.host.addEventListener('pointerleave', this.onTriggerLeave);
|
|
72
|
-
this.syncOverlay();
|
|
73
|
-
}
|
|
74
|
-
componentDidUpdate() {
|
|
75
|
-
this.syncTrigger();
|
|
76
|
-
}
|
|
77
|
-
disconnectedCallback() {
|
|
78
|
-
this.clearTimers();
|
|
79
|
-
this.detachTriggerListeners();
|
|
80
|
-
this.surface?.destroy();
|
|
81
|
-
this.surface = null;
|
|
82
|
-
this.host.removeEventListener('pointerenter', this.onSurfaceEnter);
|
|
83
|
-
this.host.removeEventListener('pointerleave', this.onTriggerLeave);
|
|
84
|
-
closeOverlay(this.overlayId);
|
|
85
|
-
}
|
|
86
|
-
syncTrigger() {
|
|
87
|
-
const next = this.for
|
|
88
|
-
? this.host.getRootNode().getElementById(this.for)
|
|
89
|
-
: this.host.previousElementSibling;
|
|
90
|
-
if (next === this.trigger)
|
|
91
|
-
return;
|
|
92
|
-
this.detachTriggerListeners();
|
|
93
|
-
this.trigger = next;
|
|
94
|
-
this.attachTriggerListeners();
|
|
95
|
-
this.surface?.setAnchor(next);
|
|
96
|
-
}
|
|
97
|
-
setupSurface() {
|
|
98
|
-
this.surface?.destroy();
|
|
99
|
-
this.surface = createAnchoredSurface(this.host, {
|
|
100
|
-
anchor: this.trigger,
|
|
101
|
-
placement: this.placement,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
attachTriggerListeners() {
|
|
105
|
-
this.detachTriggerListeners();
|
|
106
|
-
if (!this.trigger)
|
|
107
|
-
return;
|
|
108
|
-
const ids = new Set((this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(Boolean));
|
|
109
|
-
ids.add(this.host.id);
|
|
110
|
-
this.trigger.setAttribute('aria-describedby', [...ids].join(' '));
|
|
111
|
-
this.trigger.addEventListener('click', this.onTriggerClick);
|
|
112
|
-
this.trigger.addEventListener('keydown', this.onTriggerKeydown);
|
|
113
|
-
this.trigger.addEventListener('pointerenter', this.onTriggerEnter);
|
|
114
|
-
this.trigger.addEventListener('pointerleave', this.onTriggerLeave);
|
|
115
|
-
this.trigger.addEventListener('focusin', this.onTriggerFocusIn);
|
|
116
|
-
this.trigger.addEventListener('focusout', this.onTriggerFocusOut);
|
|
117
|
-
}
|
|
118
|
-
detachTriggerListeners() {
|
|
119
|
-
if (!this.trigger)
|
|
120
|
-
return;
|
|
121
|
-
const ids = (this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(id => id && id !== this.host.id);
|
|
122
|
-
if (ids.length)
|
|
123
|
-
this.trigger.setAttribute('aria-describedby', ids.join(' '));
|
|
124
|
-
else
|
|
125
|
-
this.trigger.removeAttribute('aria-describedby');
|
|
126
|
-
this.trigger.removeEventListener('click', this.onTriggerClick);
|
|
127
|
-
this.trigger.removeEventListener('keydown', this.onTriggerKeydown);
|
|
128
|
-
this.trigger.removeEventListener('pointerenter', this.onTriggerEnter);
|
|
129
|
-
this.trigger.removeEventListener('pointerleave', this.onTriggerLeave);
|
|
130
|
-
this.trigger.removeEventListener('focusin', this.onTriggerFocusIn);
|
|
131
|
-
this.trigger.removeEventListener('focusout', this.onTriggerFocusOut);
|
|
132
|
-
}
|
|
133
|
-
clearShowTimer() {
|
|
134
|
-
if (this.showTimer === null)
|
|
135
|
-
return;
|
|
136
|
-
clearTimeout(this.showTimer);
|
|
137
|
-
this.showTimer = null;
|
|
138
|
-
}
|
|
139
|
-
clearHideTimer() {
|
|
140
|
-
if (this.hideTimer === null)
|
|
141
|
-
return;
|
|
142
|
-
clearTimeout(this.hideTimer);
|
|
143
|
-
this.hideTimer = null;
|
|
144
|
-
}
|
|
145
|
-
clearTimers() {
|
|
146
|
-
this.clearShowTimer();
|
|
147
|
-
this.clearHideTimer();
|
|
148
|
-
}
|
|
149
|
-
setInteractionOpen(nextOpen, trigger) {
|
|
150
|
-
if (this.internalOpen === nextOpen)
|
|
151
|
-
return;
|
|
152
|
-
if (!isControlled(this.open))
|
|
153
|
-
this.internalOpen = nextOpen;
|
|
154
|
-
dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
|
|
155
|
-
open: nextOpen,
|
|
156
|
-
reason: 'action',
|
|
157
|
-
trigger,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
onSurfaceEnter = () => this.clearHideTimer();
|
|
161
|
-
onTriggerClick = (event) => {
|
|
162
|
-
if (!this.toggleOnClick)
|
|
163
|
-
return;
|
|
164
|
-
this.clearTimers();
|
|
165
|
-
this.pinned = !this.pinned;
|
|
166
|
-
this.setInteractionOpen(this.pinned, event.detail === 0 ? 'keyboard' : 'pointer');
|
|
167
|
-
};
|
|
168
|
-
onTriggerKeydown = (event) => {
|
|
169
|
-
if (event.key === 'Escape')
|
|
170
|
-
this.clearTimers();
|
|
171
|
-
};
|
|
172
|
-
onTriggerEnter = (event) => {
|
|
173
|
-
if (event.pointerType === 'touch')
|
|
174
|
-
return;
|
|
175
|
-
this.clearHideTimer();
|
|
176
|
-
if (this.internalOpen || this.showTimer !== null)
|
|
177
|
-
return;
|
|
178
|
-
this.showTimer = setTimeout(() => {
|
|
179
|
-
this.showTimer = null;
|
|
180
|
-
this.setInteractionOpen(true, 'pointer');
|
|
181
|
-
}, Math.max(0, this.showDelay));
|
|
182
|
-
};
|
|
183
|
-
onTriggerLeave = () => {
|
|
184
|
-
this.clearShowTimer();
|
|
185
|
-
if (this.focused || this.pinned || !this.internalOpen || this.hideTimer !== null)
|
|
186
|
-
return;
|
|
187
|
-
this.hideTimer = setTimeout(() => {
|
|
188
|
-
this.hideTimer = null;
|
|
189
|
-
this.setInteractionOpen(false, 'pointer');
|
|
190
|
-
}, Math.max(0, this.hideDelay));
|
|
191
|
-
};
|
|
192
|
-
onTriggerFocusIn = () => {
|
|
193
|
-
this.focused = true;
|
|
194
|
-
this.clearTimers();
|
|
195
|
-
this.setInteractionOpen(true, 'keyboard');
|
|
196
|
-
};
|
|
197
|
-
onTriggerFocusOut = (e) => {
|
|
198
|
-
const related = e.relatedTarget;
|
|
199
|
-
if (related && this.host.contains(related))
|
|
200
|
-
return;
|
|
201
|
-
this.focused = false;
|
|
202
|
-
this.pinned = false;
|
|
203
|
-
this.clearTimers();
|
|
204
|
-
this.setInteractionOpen(false, 'keyboard');
|
|
205
|
-
};
|
|
206
|
-
handleRequestClose(reason, trigger) {
|
|
207
|
-
if (reason === 'escape' || (reason === 'light-dismiss' && this.toggleOnClick)) {
|
|
208
|
-
this.pinned = false;
|
|
209
|
-
this.clearTimers();
|
|
210
|
-
if (!isControlled(this.open))
|
|
211
|
-
this.internalOpen = false;
|
|
212
|
-
dispatchDetail(this.host, 'close', {
|
|
213
|
-
open: false,
|
|
214
|
-
reason,
|
|
215
|
-
trigger: trigger,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
render() {
|
|
220
|
-
return (h(Host, { key: '2216e8f56c408e775140200881c9bfd99b45f381', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, h("div", { key: 'a547e43fb5f6c3c2f62cf7f1fb9198dc0024a28d', class: "tooltip__surface" }, h("slot", { key: 'dc8863505e8140565588c57ea200b7f548fb5df3' }))));
|
|
221
|
-
}
|
|
222
|
-
static get watchers() { return {
|
|
223
|
-
"open": [{
|
|
224
|
-
"syncFromProp": 0
|
|
225
|
-
}],
|
|
226
|
-
"for": [{
|
|
227
|
-
"resetSurface": 0
|
|
228
|
-
}],
|
|
229
|
-
"placement": [{
|
|
230
|
-
"resetSurface": 0
|
|
231
|
-
}],
|
|
232
|
-
"internalOpen": [{
|
|
233
|
-
"syncOverlay": 0
|
|
234
|
-
}]
|
|
235
|
-
}; }
|
|
236
|
-
};
|
|
237
|
-
UITooltip.style = uiTooltipCss();
|
|
238
|
-
|
|
239
|
-
export { UITooltip as ui_tooltip };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,g as i,h as o,H as r}from"./p-8BGiMGQ0.js";import{d as a,e as s}from"./p-JwSoedEO.js";const e=class{constructor(i){t(this,i)}get host(){return i(this)}value;defaultValue="";disabled=!1;invalid=!1;readOnly=!1;internalValue="";slotRef;syncFromProp(){void 0!==this.value&&(this.internalValue=this.value)}syncToInput(){const t=this.getInput();t&&(this.host.dataset.invalid=this.invalid?"true":"",void 0!==this.value&&(t.value=this.internalValue),t.defaultValue=this.defaultValue,t.disabled=this.disabled,t.readOnly=this.readOnly,t.setAttribute("aria-invalid",this.invalid?"true":"false"))}componentDidLoad(){this.syncFromProp(),this.slotRef?.addEventListener("slotchange",(()=>this.syncToInput())),this.syncToInput();const t=this.getInput();t?.addEventListener("input",this.onInput),t?.addEventListener("change",this.onChange)}disconnectedCallback(){const t=this.getInput();t?.removeEventListener("input",this.onInput),t?.removeEventListener("change",this.onChange)}componentDidUpdate(){this.syncToInput()}getInput(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"INPUT"===t.tagName))??null}onInput=t=>{const i=t.target;i&&(this.internalValue=i.value,a(this.host,"input",{value:this.internalValue,trigger:s(t)}))};onChange=t=>{const i=this.getInput();i&&(this.internalValue=i.value,a(this.host,"change",{value:this.internalValue,trigger:s(t)}))};render(){return o(r,{key:"90597a900e0504f0e729990dd8cbc84c35d8162f","data-invalid":this.invalid?"":void 0},o("slot",{key:"1c8ac0ad7e4d3a5a9b913c2687021ef7037ccfa7",ref:t=>this.slotRef=t}))}static get watchers(){return{value:[{syncFromProp:0}],internalValue:[{syncToInput:0}],defaultValue:[{syncToInput:0}],disabled:[{syncToInput:0}],invalid:[{syncToInput:0}],readOnly:[{syncToInput:0}]}}};e.style=":host{display:inline-flex;min-inline-size:0;color:var(--ui-text-primary)}::slotted(input){width:100%;appearance:none;min-block-size:var(--ui-control-min-block-size, 2.75rem);border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default));color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;transition:border-color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), background-color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(input:hover:not(:focus):not(:disabled)){border-color:var(--ui-control-border-hover, var(--ui-border-strong))}::slotted(input:focus){border-color:var(--ui-control-focus, var(--ui-focus-ring));box-shadow:0 0 0 3px var(--ui-control-focus-halo, var(--ui-accent-soft))}:host([data-invalid='true'])::slotted(input),::slotted(input[aria-invalid='true']){border-color:var(--ui-accent-active)}::slotted(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted));color:var(--ui-text-muted);cursor:not-allowed}::slotted(input:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}";export{e as ui_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,g as s,h as e,H as r}from"./p-8BGiMGQ0.js";import{o,c as h}from"./p-C-0syqXZ.js";import{d as a}from"./p-JwSoedEO.js";import{i as n,c as l}from"./p-BnGhGgTH.js";import{a as c}from"./p-Bu0dmLBE.js";const d=class{constructor(s){t(this,s),this.opened=i(this,"open"),this.closed=i(this,"close")}get host(){return s(this)}for="";open;defaultOpen=!1;placement="top-start";showDelay=500;hideDelay=100;toggleOnClick=!1;pinned=!1;focused=!1;opened;closed;internalOpen=!1;overlayId=`ui-tooltip-${Math.random().toString(36).slice(2,11)}`;trigger=null;surface=null;showTimer=null;hideTimer=null;syncFromProp(){this.clearTimers(),n(this.open)&&(this.internalOpen=this.open)}resetSurface(){this.syncTrigger(),this.setupSurface(),this.syncOverlay()}syncOverlay(){this.internalOpen?(this.surface?.show(),o({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.trigger?[this.trigger]:void 0,dismissible:!0,requestClose:(t,i)=>this.handleRequestClose(t,i)})):(this.surface?.hide(),h(this.overlayId))}componentDidLoad(){this.host.id||(this.host.id=this.overlayId),this.internalOpen=l(this.open,this.defaultOpen),this.syncTrigger(),this.setupSurface(),this.host.addEventListener("pointerenter",this.onSurfaceEnter),this.host.addEventListener("pointerleave",this.onTriggerLeave),this.syncOverlay()}componentDidUpdate(){this.syncTrigger()}disconnectedCallback(){this.clearTimers(),this.detachTriggerListeners(),this.surface?.destroy(),this.surface=null,this.host.removeEventListener("pointerenter",this.onSurfaceEnter),this.host.removeEventListener("pointerleave",this.onTriggerLeave),h(this.overlayId)}syncTrigger(){const t=this.for?this.host.getRootNode().getElementById(this.for):this.host.previousElementSibling;t!==this.trigger&&(this.detachTriggerListeners(),this.trigger=t,this.attachTriggerListeners(),this.surface?.setAnchor(t))}setupSurface(){this.surface?.destroy(),this.surface=c(this.host,{anchor:this.trigger,placement:this.placement})}attachTriggerListeners(){if(this.detachTriggerListeners(),!this.trigger)return;const t=new Set((this.trigger.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));t.add(this.host.id),this.trigger.setAttribute("aria-describedby",[...t].join(" ")),this.trigger.addEventListener("click",this.onTriggerClick),this.trigger.addEventListener("keydown",this.onTriggerKeydown),this.trigger.addEventListener("pointerenter",this.onTriggerEnter),this.trigger.addEventListener("pointerleave",this.onTriggerLeave),this.trigger.addEventListener("focusin",this.onTriggerFocusIn),this.trigger.addEventListener("focusout",this.onTriggerFocusOut)}detachTriggerListeners(){if(!this.trigger)return;const t=(this.trigger.getAttribute("aria-describedby")||"").split(/\s+/).filter((t=>t&&t!==this.host.id));t.length?this.trigger.setAttribute("aria-describedby",t.join(" ")):this.trigger.removeAttribute("aria-describedby"),this.trigger.removeEventListener("click",this.onTriggerClick),this.trigger.removeEventListener("keydown",this.onTriggerKeydown),this.trigger.removeEventListener("pointerenter",this.onTriggerEnter),this.trigger.removeEventListener("pointerleave",this.onTriggerLeave),this.trigger.removeEventListener("focusin",this.onTriggerFocusIn),this.trigger.removeEventListener("focusout",this.onTriggerFocusOut)}clearShowTimer(){null!==this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)}clearHideTimer(){null!==this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)}clearTimers(){this.clearShowTimer(),this.clearHideTimer()}setInteractionOpen(t,i){this.internalOpen!==t&&(n(this.open)||(this.internalOpen=t),a(this.host,t?"open":"close",{open:t,reason:"action",trigger:i}))}onSurfaceEnter=()=>this.clearHideTimer();onTriggerClick=t=>{this.toggleOnClick&&(this.clearTimers(),this.pinned=!this.pinned,this.setInteractionOpen(this.pinned,0===t.detail?"keyboard":"pointer"))};onTriggerKeydown=t=>{"Escape"===t.key&&this.clearTimers()};onTriggerEnter=t=>{"touch"!==t.pointerType&&(this.clearHideTimer(),this.internalOpen||null!==this.showTimer||(this.showTimer=setTimeout((()=>{this.showTimer=null,this.setInteractionOpen(!0,"pointer")}),Math.max(0,this.showDelay))))};onTriggerLeave=()=>{this.clearShowTimer(),this.focused||this.pinned||!this.internalOpen||null!==this.hideTimer||(this.hideTimer=setTimeout((()=>{this.hideTimer=null,this.setInteractionOpen(!1,"pointer")}),Math.max(0,this.hideDelay)))};onTriggerFocusIn=()=>{this.focused=!0,this.clearTimers(),this.setInteractionOpen(!0,"keyboard")};onTriggerFocusOut=t=>{const i=t.relatedTarget;i&&this.host.contains(i)||(this.focused=!1,this.pinned=!1,this.clearTimers(),this.setInteractionOpen(!1,"keyboard"))};handleRequestClose(t,i){("escape"===t||"light-dismiss"===t&&this.toggleOnClick)&&(this.pinned=!1,this.clearTimers(),n(this.open)||(this.internalOpen=!1),a(this.host,"close",{open:!1,reason:t,trigger:i}))}render(){return e(r,{key:"2216e8f56c408e775140200881c9bfd99b45f381",role:"tooltip",hidden:!this.internalOpen,"data-open":this.internalOpen?"":void 0},e("div",{key:"a547e43fb5f6c3c2f62cf7f1fb9198dc0024a28d",class:"tooltip__surface"},e("slot",{key:"dc8863505e8140565588c57ea200b7f548fb5df3"})))}static get watchers(){return{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncOverlay:0}]}}};d.style=":host{position:fixed;inset:auto;margin:0;display:inline-block;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent;opacity:0;transform:translateY(4px);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}.tooltip__surface{box-sizing:border-box;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md)}:host(:popover-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}";export{d as ui_tooltip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,g as e,h as s,H as o}from"./p-8BGiMGQ0.js";import{i as n,c as a}from"./p-BnGhGgTH.js";const r=class{constructor(e){t(this,e),this.editChange=i(this,"edit-change")}get host(){return e(this)}edit;defaultEdit=!1;disabled=!1;editChange;internalEdit=!1;trigger=null;syncFromProp(){n(this.edit)&&(this.internalEdit=this.edit)}componentWillLoad(){this.internalEdit=a(this.edit,this.defaultEdit)}componentDidLoad(){this.host.ownerDocument.addEventListener("pointerdown",this.onDocumentPointerDown,!0)}disconnectedCallback(){this.host.ownerDocument.removeEventListener("pointerdown",this.onDocumentPointerDown,!0)}requestEdit(t,i,e){this.disabled||this.internalEdit===t||(n(this.edit)||(this.internalEdit=t),this.editChange.emit({edit:t,reason:i,trigger:e}),t?requestAnimationFrame((()=>this.focusEditor())):requestAnimationFrame((()=>this.trigger?.focus())))}focusEditor(){const t=this.host.querySelector('[slot="edit"]'),i=t?.matches("input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox")?t:t?.querySelector("input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox"),e=i?.focusInput;"function"==typeof e?e.call(i):i?.focus()}eventTrigger(t){return t.composedPath().find((t=>t instanceof HTMLElement&&t.hasAttribute("data-ui-editable-trigger")))}onClick=t=>{if(this.internalEdit||this.disabled)return;const i=this.eventTrigger(t);i&&(this.trigger=i,this.requestEdit(!0,"activate","pointer"))};onKeyDown=t=>{if(this.internalEdit&&"Escape"===t.key)return t.preventDefault(),t.stopPropagation(),void this.requestEdit(!1,"escape","keyboard");if(this.internalEdit||!["Enter"," "].includes(t.key))return;const i=this.eventTrigger(t);i&&(t.preventDefault(),this.trigger=i,this.requestEdit(!0,"activate","keyboard"))};onDocumentPointerDown=t=>{this.internalEdit&&!t.composedPath().includes(this.host)&&this.requestEdit(!1,"light-dismiss","pointer")};render(){return s(o,{key:"7f0c77aa06281c94407af1f060f5f2b2c34af394","data-edit":this.internalEdit?"":void 0,"data-disabled":this.disabled?"":void 0,onClick:this.onClick,onKeyDown:this.onKeyDown},s("div",{key:"4dc13c26dc4080ed0ad972aa677d9e844a0e7597",part:"preview",hidden:this.internalEdit},s("slot",{key:"8332efed99f05173030d379088e8e97746f32ce6",name:"preview"})),s("div",{key:"ec3e11ec9218077da5f17a0c724cfab17d56fb17",part:"edit",hidden:!this.internalEdit},s("slot",{key:"46a4618614c6e55c0015d97e687a0f28e05eef38",name:"edit"})))}static get watchers(){return{edit:[{syncFromProp:0}]}}};r.style=":host{display:block;min-inline-size:0}[hidden]{display:none !important}";export{r as ui_editable}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as s,c as e,g as a}from"./p-8BGiMGQ0.js";import{a as o}from"./p-Bu0dmLBE.js";import{c as r,o as n}from"./p-C-0syqXZ.js";const h=class{constructor(t){i(this,t)}appearance="tag";size="xs";render(){return t(s,{key:"970cb48cf8d70c47feaab90fe428c09f0d052a03","data-appearance":this.appearance,"data-size":this.size},t("span",{key:"6d8c6104d2869520097a2a61bd2a887b363b4912",class:"chip__surface"},t("span",{key:"638fb68ff5dffa629576c9e1079bb3169f2adb4f",class:"chip__label"},t("slot",{key:"8b31f2130e202e18d7717aee6add6bc6e7f119b5"}))))}};h.style=":host{--ui-chip-surface:var(--ui-surface-subtle);--ui-chip-text:var(--ui-text-secondary);--ui-chip-border:var(--ui-border-default);--ui-chip-font-size:var(--ui-font-size-xs);--ui-chip-font-weight:var(--ui-font-normal);--ui-chip-line-height:var(--ui-line-height-tight);--ui-chip-padding-block:var(--ui-space-0-5);--ui-chip-padding-inline:var(--ui-space-2);--ui-chip-notch:var(--ui-space-1);display:inline-flex;min-width:0;max-width:100%}:host([data-size='sm']){--ui-chip-font-size:var(--ui-font-size-sm)}.chip__surface{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;max-width:100%;padding:var(--ui-chip-padding-block) var(--ui-chip-padding-inline);border:1px solid var(--ui-chip-border);background:var(--ui-chip-surface);color:var(--ui-chip-text) !important;font-family:var(--ui-font-family-sans) !important;font-size:var(--ui-chip-font-size) !important;font-weight:var(--ui-chip-font-weight) !important;line-height:var(--ui-chip-line-height) !important}.chip__label{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([data-appearance='pill']) .chip__surface{border-radius:var(--ui-radius-round)}:host([data-appearance='tag']) .chip__surface{border:0;padding-inline-end:calc(var(--ui-chip-padding-inline) + var(--ui-chip-notch));clip-path:polygon(0 0, calc(100% - var(--ui-chip-notch)) 0, 100% 50%, calc(100% - var(--ui-chip-notch)) 100%, 0 100%)}";const l=class{constructor(t){i(this,t),this.queryChange=e(this,"query-change"),this.valueChange=e(this,"value-change"),this.freeEntry=e(this,"free-entry"),this.createEntry=e(this,"create-entry"),this.dependencyInvalidate=e(this,"dependency-invalidate"),this.validationChange=e(this,"validation-change"),this.optionsChange=e(this,"options-change")}get host(){return a(this)}label="";placeholder="";name="";value;defaultValue;query;defaultQuery="";config={};disabled=!1;readOnly=!1;required=!1;size="md";labelVisibility="visible";disclosure=!1;clearable=!1;help="";queryChange;valueChange;freeEntry;createEntry;dependencyInvalidate;validationChange;optionsChange;raw="";display="";selected=null;expanded=!1;rows=[];active=-1;loading=!1;helpOpen=!1;lookupError="";validation={status:"pristine",touched:!1,dirty:!1,issues:[]};input;popup;field;surface;lookup;validationRun;lookupTimer;composing=!1;initialRaw="";overlayId=`ui-combobox-${Math.random().toString(36).slice(2)}`;alive=!1;fullSet=!1;knownOptions=new Map;awaitingLabel=null;proposedChange;formattedRaw;formattedWith;componentWillLoad(){this.selected=void 0!==this.value?this.value:this.defaultValue??null,this.raw=this.query??this.defaultQuery,void 0!==this.query||this.raw||null===this.selected||(this.raw=this.config.options?.find((i=>i.value===this.selected))?.label??this.selected),void 0===this.query&&null!==this.selected&&this.raw===this.selected&&(this.awaitingLabel=this.selected),this.display=this.raw,this.initialRaw=this.raw,this.applyServerIssues()}connectedCallback(){this.alive=!0,this.setupSurface()}componentDidLoad(){this.setupSurface()}componentDidUpdate(){this.input&&!this.composing&&this.input.value!==this.display&&(this.input.value=this.display),this.expanded&&this.surface?.refresh()}disconnectedCallback(){this.alive=!1,this.close(),this.validationRun?.abort(),this.surface?.destroy(),this.surface=void 0}setupSurface(){!this.surface&&this.popup&&this.field&&(this.surface=o(this.popup,{anchor:this.field,placement:"bottom-start"}))}syncValue(){if(void 0!==this.value){if(this.selected=this.value,void 0===this.query){const i=this.proposedChange,t=this.config.options?.find((i=>i.value===this.selected))??(null===this.selected?void 0:this.knownOptions.get(this.selected)),s=i?.value===this.selected?i.query:t?.label??this.selected??"";i?.value===this.selected&&s===this.raw||(this.raw=s,this.display=this.raw,this.formattedRaw=void 0),this.awaitingLabel=t||null===this.selected?null:this.selected}this.resetValidation()}}syncQuery(){void 0!==this.query&&this.query!==this.raw&&(void 0===this.value&&this.proposedChange?.query!==this.query&&(this.selected=null),this.awaitingLabel=null,this.formattedRaw=void 0,this.raw=this.query,this.display=this.raw,this.resetValidation(),this.expanded&&this.search("input"))}syncDisabled(){(this.disabled||this.readOnly)&&(this.close(),this.resetValidation())}syncConfig(i,t){if(this.validationRun?.abort(),i.provider===t?.provider&&i.context===t?.context||this.knownOptions.clear(),i.context!==t?.context){this.close();const t=i.invalidation??"retain-query";this.commit("retain"===t?this.selected:null,"clear"===t?"":this.raw,null,"invalidation","programmatic"),this.validation={status:"pristine",touched:!1,dirty:this.raw!==this.initialRaw,issues:[]}}this.applyServerIssues(),this.expanded&&this.search("context")}applyServerIssues(){const i=this.config.issues??[];i.length?this.setValidation({issues:i},this.validation.touched):this.resetValidation()}resetValidation(){this.validationRun?.abort(),this.validation={status:"pristine",touched:this.validation.touched,dirty:this.raw!==this.initialRaw,issues:[]},this.validationChange?.emit(this.validation)}cancelLookup(){clearTimeout(this.lookupTimer),this.lookup?.abort(),this.lookup=void 0,this.loading=!1}close(){this.expanded=!1,this.active=-1,this.cancelLookup(),this.surface?.hide(),r(this.overlayId)}open(i="input"){this.disabled||this.readOnly||(this.expanded=!0,this.popup&&this.field&&(this.popup.style.minWidth=`${this.field.getBoundingClientRect().width}px`),this.surface?.show(),n({id:this.overlayId,element:this.popup,relatedElements:[this.host],modal:!1,requestClose:()=>this.close()}),this.search(i))}search(i){this.cancelLookup(),this.fullSet="disclosure"===i,this.active=-1,this.lookupError="";const t=this.config,s=this.fullSet?"":this.raw,e=new AbortController;this.lookup=e;const a=i=>{if(e.signal.aborted||!this.alive)return;for(const t of i)this.knownOptions.set(t.value,t);const a=null===this.selected?void 0:this.knownOptions.get(this.selected);void 0===this.query&&this.awaitingLabel===this.selected&&a&&(this.raw=a.label,this.display=this.raw,this.awaitingLabel=null,this.formattedRaw=void 0,this.resetValidation());const o=new Set;this.rows=i.filter((i=>!o.has(i.id)&&(o.add(i.id),this.fullSet||(t.filter?t.filter(i,s,t.context):!!t.provider||i.label.toLocaleLowerCase().includes(s.toLocaleLowerCase())))));const r=new Map;for(const i of this.rows){const t=i.group??"";r.has(t)||r.set(t,[]),r.get(t).push(i)}this.rows=[...r.values()].flat(),this.loading=!1,this.optionsChange.emit(this.rows)};t.provider?(this.rows=[],this.loading=!0,this.lookupTimer=setTimeout((async()=>{try{a(await t.provider({query:s,context:t.context,signal:e.signal,reason:i}))}catch(i){if(e.signal.aborted||!this.alive)return;this.loading=!1,this.lookupError=i instanceof Error?i.message:"Unable to load suggestions."}}),"disclosure"===i?0:Math.max(0,t.debounce??200))):a(t.options??[])}get canCreate(){const i=this.config.options?[...this.config.options,...this.rows]:this.rows;return Boolean(this.config.allowCreate&&this.raw.trim()&&!this.loading&&!this.lookupError&&!i.some((i=>i.label.toLocaleLowerCase()===this.raw.toLocaleLowerCase())))}format(i){if((this.config.formatOn??"blur")!==i||!this.input)return;if(this.formattedRaw===this.raw&&this.formattedWith===this.config.format)return;const t=function(i,t,s){const e={display:i,selection:t};if(!s)return e;let a;try{a=s(i,t)}catch{return e}if(!a)return e;const o=Array.from(i);let r=0;for(const i of a.display)i===o[r]&&(r+=1);return!Number.isInteger(a.selection.start)||!Number.isInteger(a.selection.end)||r!==o.length||a.selection.start<0||a.selection.end<a.selection.start||a.selection.end>a.display.length?e:a}(this.raw,{start:this.input.selectionStart??this.raw.length,end:this.input.selectionEnd??this.raw.length,direction:this.input.selectionDirection??"none"},this.config.format);this.formattedRaw=this.raw,this.formattedWith=this.config.format,this.display=t.display,this.input.value!==t.display&&(this.input.value=t.display,this.input.setSelectionRange(t.selection.start,t.selection.end,t.selection.direction))}onInput=i=>{this.composing||i.isComposing||(this.awaitingLabel=null,this.formattedRaw=void 0,this.raw=this.input.value,this.display=this.raw,this.resetValidation(),this.format("input"),this.queryChange.emit({query:this.raw,display:this.display,trigger:"keyboard"}),null!==this.selected&&this.commit(null,this.raw,null,"clear","keyboard"),this.open(),"input"===this.config.validateOn&&this.validate(),queueMicrotask((()=>{void 0!==this.query&&this.query!==this.raw&&this.syncQuery()})))};commit(i,t,s,e,a){this.awaitingLabel=null;const o=t!==this.raw;void 0===this.value&&(this.selected=i),void 0===this.query&&o&&(this.raw=t,this.display=t,this.formattedRaw=void 0),this.resetValidation();const r={value:i,query:t,option:s,kind:e,trigger:a},n={value:i,query:t};this.proposedChange=n,this.valueChange.emit(r),o&&this.queryChange.emit({query:t,display:t,trigger:a}),"create"===e&&this.createEntry.emit(r),"free-entry"===e&&this.freeEntry.emit(r),"invalidation"===e&&this.dependencyInvalidate.emit(r),queueMicrotask((()=>{this.proposedChange===n&&(void 0!==this.value&&this.value!==n.value&&this.syncValue(),void 0!==this.query&&this.query!==n.query&&(void 0===this.value&&(this.selected=null,this.resetValidation()),this.syncQuery()),this.proposedChange=void 0)}))}choose(i,t){const s=this.rows[i];if(!s?.disabled){if(s)this.commit(s.value,s.label,s,"selection",t);else{if(!this.canCreate||i!==this.rows.length)return;this.commit(null,this.raw,null,"create",t)}this.close(),this.input?.focus(),"submit"!==this.config.validateOn&&queueMicrotask((()=>{this.validate()}))}}move(i){const t=this.rows.flatMap(((i,t)=>i.disabled?[]:[t]));if(this.canCreate&&t.push(this.rows.length),!t.length)return;const s=t.indexOf(this.active),e="Home"===i?0:"End"===i?t.length-1:"ArrowDown"===i?Math.min(s+1,t.length-1):s<0?t.length-1:Math.max(0,s-1);this.active=t[e],requestAnimationFrame((()=>this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({block:"nearest"})))}onKeydown=i=>{if(!(this.composing||i.isComposing||this.disabled||this.readOnly))return"Escape"===i.key&&this.expanded?(i.preventDefault(),i.stopPropagation(),void this.close()):void("Tab"!==i.key?i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||("ArrowDown"===i.key||"ArrowUp"===i.key?(i.preventDefault(),this.expanded||this.open("disclosure"),this.move(i.key)):("Home"===i.key||"End"===i.key)&&this.expanded&&this.active>=0?(i.preventDefault(),this.move(i.key)):"Enter"===i.key&&this.expanded&&(this.active>=0?(i.preventDefault(),this.choose(this.active,"keyboard")):this.config.allowFreeText&&(i.preventDefault(),this.commit(null,this.raw,null,"free-entry","keyboard"),this.close()))):this.close())};onFocusOut=i=>{i.relatedTarget instanceof Node&&this.host.shadowRoot?.contains(i.relatedTarget)||(this.close(),this.format("blur"),this.validation={...this.validation,touched:!0},this.config.allowFreeText&&null===this.selected&&this.commit(null,this.raw,null,"free-entry","keyboard"),"blur"===(this.config.validateOn??"blur")&&this.validate())};setValidation(i,t=this.validation.touched){const s=i.issues.some((i=>"warning"!==i.severity));this.validation={status:s?"error":i.issues.length?"warning":"valid",touched:t,dirty:this.raw!==this.initialRaw,...i},this.validationChange?.emit(this.validation)}async validate(){this.validationRun?.abort();const i=new AbortController;this.validationRun=i,this.validation={...this.validation,status:"pending",output:void 0},this.validationChange.emit(this.validation);try{const t=await async function(i,t){let s=i.raw,e=[];const a=()=>i.signal.throwIfAborted();try{if(a(),t.parse&&(s=await t.parse(i.raw,i)),a(),t.schema){const i=await t.schema["~standard"].validate(s);a(),i.issues?e=i.issues:"value"in i&&(s=i.value)}if(!e.some((i=>"warning"!==i.severity))&&(t.normalize&&(s=await t.normalize(s,i)),a(),t.validator)){const o=await t.validator(s,i);a(),e=[...e,...o.issues??[]],"output"in o&&(s=o.output)}}catch(i){a(),e=[{message:i instanceof Error?i.message:"Unable to validate this value."}]}return e=[...e,...t.issues??[]],{output:e.some((i=>"warning"!==i.severity))?void 0:s,issues:e}}({raw:this.raw,value:this.selected,context:this.config.context,signal:i.signal},this.config);this.required&&!this.raw.trim()?t.issues=[...t.issues,{message:"A value is required."}]:!this.raw||null!==this.selected||this.config.allowFreeText||this.config.allowCreate||(t.issues=[...t.issues,{message:"Choose a suggestion."}]),t.issues.some((i=>"warning"!==i.severity))&&(t.output=void 0),!i.signal.aborted&&this.alive&&this.setValidation(t)}catch{}return this.validation}async focusInput(){this.input?.focus()}render(){const i=[this.helpOpen?"help-text":"",this.validation.issues.length?"validation":""].filter(Boolean).join(" ")||void 0,e=this.loading?"Loading suggestions…":this.lookupError||(this.expanded?`${this.rows.length} suggestions available.`:""),a=[...new Set(this.rows.map((i=>i.group??"")))];return t(s,{key:"1f00d9a83729d9c2147ced7e5006b928d1b5e51d","data-size":this.size,"data-validation":this.validation.status,onFocusout:this.onFocusOut},t("label",{key:"10353b147cc68ef1d67be0988849af1527fcf9ba",htmlFor:"input",part:"label",class:"sr-only"===this.labelVisibility?"sr-only":void 0},this.label,this.required?" *":""),t("div",{key:"74bb53137d9343add37c22f3ac503eccf41807a9",class:"field",part:"field",ref:i=>this.field=i,onClick:i=>{i.composedPath().some((i=>i instanceof HTMLButtonElement))||this.input?.focus()}},t("slot",{key:"24c26916365013faa4a78bd4fe0d01f6c129c703",name:"start"}),t("input",{key:"835d19e66ec4a24c1a83f43bbc256fa2a9e3332f",id:"input",ref:i=>this.input=i,role:"combobox","aria-autocomplete":"list","aria-expanded":String(this.expanded),"aria-controls":"listbox","aria-activedescendant":this.expanded&&this.active>=0?`option-${this.active}`:void 0,"aria-describedby":i,"aria-invalid":String("error"===this.validation.status),"aria-busy":String("pending"===this.validation.status),value:this.display,placeholder:this.placeholder,name:this.name||void 0,disabled:this.disabled,readOnly:this.readOnly,required:this.required,autoComplete:"off",part:"input",onInput:this.onInput,onKeyDown:this.onKeydown,onCompositionstart:()=>this.composing=!0,onCompositionend:()=>{this.composing=!1,this.onInput(new InputEvent("input"))}}),this.clearable&&t("button",{key:"326c1e24d3c417c3a72acd8234a53937b388ba79",type:"button",part:"affordance","aria-label":`Clear ${this.label}`,disabled:this.disabled||this.readOnly,onClick:()=>{this.commit(null,"",null,"clear","pointer"),this.close(),this.input?.focus()}},"×"),this.help&&t("button",{key:"6aeb62dc2935eb95670caa1d2028c0931dc362b2",id:"help",type:"button",part:"affordance","aria-label":`Help for ${this.label}`,disabled:this.disabled},t("span",{key:"9317be0fbb0c1bbb91061be69f38037a97a4c36b","aria-hidden":"true"},"?")),this.disclosure&&t("button",{key:"1cd2a0ea92df1144ff2297fcf64df7b3d0f4713a",type:"button",part:"affordance","aria-label":`Suggestions for ${this.label}`,"aria-controls":"listbox","aria-expanded":String(this.expanded),disabled:this.disabled||this.readOnly,onClick:()=>{this.expanded?this.close():this.open("disclosure"),this.input?.focus()}},t("span",{key:"0188b2d0e8cc7b7ff4d1a2175a0ff0b47d9c7d98","aria-hidden":"true"},"⌄"))),this.help&&t("ui-tooltip",{key:"e09fd35274c3e1fa6e408850d72f7a07c2bb4baf",id:"help-text",for:"help",toggleOnClick:!0,onOpen:()=>this.helpOpen=!0,onClose:()=>this.helpOpen=!1},this.help),t("div",{key:"ddf83a5944dd03fc7eb580b81fcf291e06c03601",class:"popup",part:"popup",hidden:!this.expanded,ref:i=>this.popup=i},t("div",{key:"1d73de1dabb6eaa95af12f2af88dac74e3f163ea",id:"listbox",role:"listbox","aria-label":`${this.label} suggestions`,"aria-busy":String(this.loading)},a.map((i=>t("div",{role:i?"group":"presentation","aria-label":i||void 0},i&&t("div",{class:"group",part:"group"},i),this.rows.map(((s,e)=>(s.group??"")!==i?null:t("div",{id:`option-${e}`,role:"option","aria-selected":String(this.selected===s.value),"aria-disabled":String(Boolean(s.disabled)),"data-active":this.active===e?"":void 0,part:"option",class:"option",onPointerDown:i=>i.preventDefault(),onClick:()=>this.choose(e,"pointer")},t("slot",{name:`option-${s.id}`},t("span",{class:"primary",part:"option-primary"},s.label),s.description&&t("span",{class:"secondary",part:"option-secondary"},s.description)))))))),this.canCreate&&t("div",{key:"a0aaafa2f4ff79efa954ed780f3a7bd81d4b2ecd",id:`option-${this.rows.length}`,role:"option","aria-selected":"false",class:"option",part:"option","data-active":this.active===this.rows.length?"":void 0,onPointerDown:i=>i.preventDefault(),onClick:()=>this.choose(this.rows.length,"pointer")},t("slot",{key:"53a6706fc2c26097948b08cf0a7ee6040e37fe57",name:"create"},"Create “",this.raw,"”"))),this.loading?t("div",{class:"message"},t("slot",{name:"loading"},"Loading suggestions…")):this.lookupError?t("div",{class:"message"},t("slot",{name:"error"},this.lookupError)):this.rows.length||this.canCreate?null:t("div",{class:"message"},t("slot",{name:"empty"},"No suggestions.")),t("slot",{key:"7997a0233a3c1a560b820c846645405ec4ceec1d",name:"footer"})),t("div",{key:"9143eb79141f5f3660a63f7a2471d1eecd8e9332",id:"validation",class:"message",part:"validation",hidden:!this.validation.issues.length},this.validation.issues.map((i=>t("div",null,i.message)))),t("div",{key:"21f310613b058f528f8c4df329864fd8a2a94b55",class:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true"},e," ","pending"===this.validation.status?"Checking value…":this.validation.issues.map((i=>i.message)).join(" ")))}static get watchers(){return{value:[{syncValue:0}],query:[{syncQuery:0}],disabled:[{syncDisabled:0}],readOnly:[{syncDisabled:0}],config:[{syncConfig:0}]}}};l.style=":host{display:grid;gap:var(--ui-space-1);min-inline-size:0;color:var(--ui-text-primary);font:inherit}label{color:var(--ui-field-label-color, var(--ui-text-primary));font-size:var(--ui-field-label-size, 0.875rem);font-weight:var(--ui-field-label-weight, 500)}.field{display:flex;min-inline-size:0;border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default))}.field:focus-within{border-color:var(--ui-control-focus, var(--ui-focus-ring));outline:2px solid var(--ui-control-focus, var(--ui-focus-ring));outline-offset:1px}input{appearance:none;width:100%;min-inline-size:0;min-block-size:var(--ui-control-min-block-size, 2.75rem);box-sizing:border-box;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;outline:none}:host([data-size='sm']) input{min-block-size:var(--ui-field-compact-size, 2rem);padding:var(--ui-space-1) var(--ui-space-2)}button{appearance:none;border:0;border-radius:var(--ui-radius-2);background:transparent;color:var(--ui-field-affordance-color, var(--ui-text-secondary));font:inherit;font-weight:var(--ui-field-affordance-weight, 400);min-inline-size:2rem;padding:var(--ui-space-1);cursor:pointer}button:hover:enabled{background:var(--ui-surface-muted);color:var(--ui-text-primary)}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-3px}input:disabled,button:disabled{color:var(--ui-text-muted);cursor:not-allowed}.field:has(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted))}:host([data-validation='error']) .field{border-color:var(--ui-danger-solid, var(--ui-accent-active))}.popup{box-sizing:border-box;min-inline-size:12rem;max-inline-size:calc(100vw - 1rem);max-block-size:var(--ui-combobox-max-block-size, 18rem);overflow:auto;margin:0;padding:var(--ui-space-1);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-md)}[hidden]{display:none !important}.option{padding:var(--ui-space-2) var(--ui-space-3);border-radius:var(--ui-radius-1);cursor:pointer;overflow-wrap:anywhere}.option:hover,.option[data-active]{background:var(--ui-surface-muted);outline:1px solid var(--ui-focus-ring);outline-offset:-1px}.option[aria-disabled='true']{color:var(--ui-text-muted);cursor:not-allowed}.primary{display:block;color:var(--ui-option-primary-color, var(--ui-text-primary));font-weight:var(--ui-option-primary-weight, 500)}.secondary{display:block;color:var(--ui-option-secondary-color, var(--ui-text-secondary));font-weight:var(--ui-option-secondary-weight, 400);font-size:var(--ui-font-size-sm)}.message,.group{color:var(--ui-field-message-color, var(--ui-text-secondary));font-weight:var(--ui-field-message-weight, 400);font-size:var(--ui-font-size-sm);line-height:var(--ui-line-height-md);overflow-wrap:anywhere}.group,.popup .message{padding:var(--ui-space-2) var(--ui-space-3)}.sr-only{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (pointer: coarse){button{min-inline-size:2.75rem;min-block-size:2.75rem}}@media (forced-colors: active){.field,.popup{border-color:CanvasText}.option[data-active]{outline-color:Highlight}}";export{h as ui_chip,l as ui_combobox}
|
|
@@ -1 +0,0 @@
|
|
|
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 d,c as l}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(){d(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=l(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){d(this.open)||(this.internalOpen=!1),n(this.host,"close",{open:!1,reason:i,trigger:a})}onDialogClose=()=>{this.internalOpen&&(d(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:"f5b4441f54505e40851dd239d12cf8ed09daabfe","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},o("dialog",{key:"6896de6166cc085d9bd581dc053705fbce6328d8",ref:i=>this.dialogRef=i,open:this.internalOpen,"aria-label":this.accessibleLabel},o("slot",{key:"07515a7b8da25ccbd18bcde226129a569c999af7"})))}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;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}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,g as o,h as t,H as s}from"./p-8BGiMGQ0.js";import{o as r,c as i,r as a}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 d}from"./p-Bu0dmLBE.js";const c=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=d(this.host,{anchor:this.anchor,placement:this.placement}))}syncSurface(){this.surface&&(this.internalOpen?this.surface.show():this.surface.hide())}syncOverlay(){this.syncSurface(),this.internalOpen?r({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.anchor?[this.anchor]:void 0,dismissible:!0,requestClose:(e,o)=>this.handleRequestClose(e,o)}):i(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,i(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&&a("escape","keyboard")};render(){return t(s,{key:"f63907b8e49b8264c291048c509b6164fdd60ca4","data-open":this.internalOpen?"":void 0,onKeyDown:this.onKeydown},t("div",{key:"2425f4394749d994693f4a256256bd9e2f5daf60",class:"popover__surface"},t("slot",{key:"3b6f925da371d43e828842c4027cddee673d7ab3"})))}static get watchers(){return{open:[{syncFromProp:0}],internalOpen:[{onOpenChange:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}]}}};c.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:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.popover__surface{box-sizing:border-box;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}: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{c as ui_popover}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,g as t,h as i,H as s}from"./p-8BGiMGQ0.js";import{d as a,e as r}from"./p-JwSoedEO.js";import{o,c as n,r as l}from"./p-C-0syqXZ.js";import{i as c,c as h}from"./p-BnGhGgTH.js";import{a as u}from"./p-Bu0dmLBE.js";const d=class{constructor(t){e(this,t)}get host(){return t(this)}open;defaultOpen=!1;for;placement="bottom-start";internalOpen=!1;overlayId=`ui-menu-${Math.random().toString(36).slice(2,11)}`;anchor=null;surface=null;syncFromProp(){c(this.open)&&(this.internalOpen=this.open)}resetSurface(){this.setupSurface(),this.syncSurface()}syncSurface(){this.syncAnchorState(),this.surface&&(this.internalOpen?(this.surface.show(),o({id:this.overlayId,modal:!1,element:this.host,relatedElements:this.anchor?[this.anchor]:void 0,dismissible:!0,requestClose:(e,t)=>this.closeMenu(e,t)})):(this.surface.hide(),n(this.overlayId)))}componentDidLoad(){this.internalOpen=h(this.open,this.defaultOpen),this.host.addEventListener("click",this.onItemClick),this.host.addEventListener("keydown",this.onKeydown),this.setupSurface(),this.syncSurface()}disconnectedCallback(){this.host.removeEventListener("click",this.onItemClick),this.host.removeEventListener("keydown",this.onKeydown),this.surface?.destroy(),this.surface=null,n(this.overlayId)}setupSurface(){this.surface?.destroy(),this.surface=null,this.anchor=this.for?this.host.ownerDocument.getElementById(this.for):null,this.anchor&&(this.surface=u(this.host,{anchor:this.anchor,placement:this.placement}))}syncAnchorState(){this.anchor&&(this.anchor.setAttribute("aria-haspopup","menu"),this.anchor.setAttribute("aria-expanded",this.internalOpen?"true":"false"))}closeMenu(e,t){this.internalOpen&&(c(this.open)||(this.internalOpen=!1),a(this.host,"close",{open:!1,reason:e,trigger:t}),"escape"===e&&this.anchor?.focus())}getItems(){return Array.from(this.host.querySelectorAll("ui-menu-item"))}isItemDisabled(e){return"true"===e.getAttribute("aria-disabled")||e.hasAttribute("disabled")||"true"===e.getAttribute("disabled")||!0===e.disabled}onItemClick=e=>{const t=e.target.closest?.("ui-menu-item");if(!t||t.getRootNode()!==this.host.getRootNode())return;if(this.isItemDisabled(t))return;const i=t.getAttribute("value")??t.getAttribute("data-value")??"";a(this.host,"select",{value:i,trigger:r(e)}),a(this.host,"close",{open:!1,reason:"action",trigger:r(e)}),c(this.open)||(this.internalOpen=!1)};onKeydown=e=>{if("Escape"===e.key)return e.preventDefault(),void l("escape","keyboard");const t=this.getItems().filter((e=>!this.isItemDisabled(e)));if(0===t.length)return;const i=e.target.closest?.("ui-menu-item"),s=i&&i instanceof HTMLElement?t.indexOf(i):-1;if("Enter"!==e.key&&" "!==e.key)"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t["ArrowDown"===e.key?s<0?0:Math.min(s+1,t.length-1):s<=0?t.length-1:s-1].focus());else if(e.preventDefault(),i&&s>=0){const e=i.getAttribute("value")??i.getAttribute("data-value")??"";a(this.host,"select",{value:e,trigger:"keyboard"}),a(this.host,"close",{open:!1,reason:"action",trigger:"keyboard"}),c(this.open)||(this.internalOpen=!1)}};render(){return i(s,{key:"22689ca1b0514bb27a76bfb9a702c0d4ce49d136",role:"menu","aria-orientation":"vertical","data-open":this.internalOpen?"":void 0},i("div",{key:"cff891a33348f077631f1b92f1167285aafd25f1",class:"menu__surface"},i("slot",{key:"3a0e9ff4f36b1afbe5f879e0e51ff4943279b5b5"})))}static get watchers(){return{open:[{syncFromProp:0}],for:[{resetSurface:0}],placement:[{resetSurface:0}],internalOpen:[{syncSurface:0}]}}};d.style=":host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;box-sizing:border-box;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:auto;max-block-size:calc(100dvh - (var(--ui-menu-viewport-gap) * 2));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}}::slotted(ui-menu-item){display:block;width:100%}";export{d as ui_menu}
|
package/dist/looma/p-Bu0dmLBE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=16;let n=0;const o=new WeakMap;function a(t){try{return t.matches(":popover-open")}catch{return!t.hidden}}function i(t){if(t.setAttribute("popover","manual"),t.hidden=!1,"function"==typeof t.showPopover&&!a(t))try{t.showPopover()}catch{}}function e(t){if("function"==typeof t.hidePopover&&a(t))try{t.hidePopover()}catch{}t.hidden=!0}function r(t){return t.setAttribute("popover","manual"),t.dataset.uiPositioning="viewport",{show(){i(t)},hide(){e(t)},destroy(){e(t)}}}function l(t,n,o,a,i){const e=u(t.ownerDocument.defaultView??window),r=t.getBoundingClientRect(),l=o.startsWith("top"),c=o.endsWith("end"),s=e.bottom-n.bottom-i,h=n.top-e.top-i,p=(l?!(h<r.height+a&&s>h):s<r.height+a&&h>s)?n.top-r.height-a:n.bottom+a,f=c?n.right-r.width:n.left,d=function(t,n=u(),o=0){const a=Math.max(0,n.width-2*o),i=Math.max(0,n.height-2*o),e=t.width>a?n.left+o:Math.min(Math.max(t.left,n.left+o),n.right-o-t.width),r=t.height>i?n.top+o:Math.min(Math.max(t.top,n.top+o),n.bottom-o-t.height);return{x:e-t.left,y:r-t.top}}({left:f,top:p,width:r.width,height:r.height},e,i);t.style.left=`${Math.round(f+d.x)}px`,t.style.top=`${Math.round(p+d.y)}px`,t.style.right="auto",t.style.bottom="auto"}function c(t,a={}){const r=t.ownerDocument.defaultView??window,c=a.placement??"bottom-start",u=Math.max(0,a.gap??4),s=Math.max(0,a.viewportGap??8),h=function(t){const n=t.CSS;return"function"==typeof n?.supports&&n.supports("anchor-name: --ui-anchor-test")&&n.supports("position-anchor: --ui-anchor-test")&&n.supports("top: anchor(bottom)")}(r),p="--ui-anchor-"+ ++n;let f=a.anchor??null,d=null,m=!1,g=null,y=null;t.setAttribute("popover","manual"),t.dataset.uiPositioning=h?"anchor":"fallback",t.style.position="fixed",t.style.margin="0";const w=n=>{f&&function(t,n){const a=o.get(t);if(a)if(a.names.delete(n),a.names.size){const n=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",n.join(", "))}else a.original?t.style.setProperty("anchor-name",a.original):t.style.removeProperty("anchor-name"),o.delete(t)}(f,p),f=n,f?(function(t,n){const a=o.get(t)??{original:t.style.getPropertyValue("anchor-name"),names:new Set};a.names.add(n),o.set(t,a);const i=[a.original,...a.names].filter(Boolean);t.style.setProperty("anchor-name",i.join(", "))}(f,p),t.style.setProperty("position-anchor",p)):t.style.removeProperty("position-anchor")},v=()=>{g=null,m&&(d?l(t,{left:d.x,right:d.x,top:d.y,bottom:d.y},"bottom-start",u,s):f&&(h?(()=>{const n=c.startsWith("bottom"),o=c.endsWith("end");t.style.top=n?`calc(anchor(bottom) + ${u}px)`:"auto",t.style.bottom=n?"auto":`calc(anchor(top) + ${u}px)`,t.style.left=o?"auto":"anchor(left)",t.style.right=o?"anchor(right)":"auto",t.style.setProperty("position-try-fallbacks","flip-block, flip-inline")})():l(t,f.getBoundingClientRect(),c,u,s)))},b=()=>{m&&null===g&&(g=r.requestAnimationFrame(v))},M=()=>{if(!m||null===d&&h)return y?.abort(),void(y=null);if(y)return;y=new AbortController;const t=y.signal;r.addEventListener("resize",b,{passive:!0,signal:t}),r.addEventListener("scroll",b,{passive:!0,capture:!0,signal:t}),r.visualViewport?.addEventListener("resize",b,{passive:!0,signal:t}),r.visualViewport?.addEventListener("scroll",b,{passive:!0,signal:t})};return w(f),{setAnchor(t){d=null,w(t),M(),b()},show(){d=null,m=!0,M(),i(t),v()},showAtPoint(n){d=n,m=!0,M(),i(t),v()},hide(){m=!1,d=null,M(),null!==g&&r.cancelAnimationFrame(g),g=null,e(t)},refresh:b,destroy(){m=!1,y?.abort(),y=null,null!==g&&r.cancelAnimationFrame(g),g=null,e(t),w(null)}}}function u(t=window){const n=t.visualViewport,o=n?.offsetLeft??0,a=n?.offsetTop??0,i=n?.width??t.innerWidth,e=n?.height??t.innerHeight;return{left:o,top:a,right:o+i,bottom:a+e,width:i,height:e}}function s(t,n){const o=Math.max(n.left-t.x,0,t.x-n.right),a=Math.max(n.top-t.y,0,t.y-n.bottom);return Math.hypot(o,a)}function h(t,n={}){const o=t.ownerDocument.defaultView??window,a=n.pointerTarget??t,i=n.anchorSelector??"[data-ui-affordance]",e=n.nearRadius??16,r=Number.isFinite(e)?Math.max(0,e):16,l=new AbortController;let c=[],u=null,h=null,p=!1;const f=()=>{for(const{element:t}of c)t.hasAttribute("data-ui-proximity")&&t.removeAttribute("data-ui-proximity");t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},d=()=>{c=Array.from(t.querySelectorAll(i)).filter((t=>!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-disabled"))).map((t=>({element:t,rect:t.getBoundingClientRect()}))),p=!1},m=()=>{if(u=null,p&&d(),!h)return void f();let n=!1;for(const t of c){const o=s(h,t.rect)<=r;o&&"near"!==t.element.getAttribute("data-ui-proximity")?t.element.setAttribute("data-ui-proximity","near"):!o&&t.element.hasAttribute("data-ui-proximity")&&t.element.removeAttribute("data-ui-proximity"),n||=o}n&&"engaged"!==t.getAttribute("data-ui-interaction")?t.setAttribute("data-ui-interaction","engaged"):!n&&t.hasAttribute("data-ui-interaction")&&t.removeAttribute("data-ui-interaction")},g=()=>{null===u&&(u=o.requestAnimationFrame(m))},y=()=>{p=!0,g()};return a.addEventListener("pointermove",(t=>{h="touch"===t.pointerType?null:{x:t.clientX,y:t.clientY},g()}),{passive:!0,signal:l.signal}),o.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.addEventListener("scroll",y,{passive:!0,capture:!0,signal:l.signal}),o.visualViewport?.addEventListener("resize",y,{passive:!0,signal:l.signal}),o.visualViewport?.addEventListener("scroll",y,{passive:!0,signal:l.signal}),d(),{refresh:y,destroy(){l.abort(),null!==u&&o.cancelAnimationFrame(u),u=null,h=null,f(),c=[]}}}export{t as D,c as a,r as b,h as c}
|