@qualcomm-ui/core 1.0.9 → 1.0.11
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/combobox/combobox.api.d.ts.map +1 -1
- package/dist/combobox/index.cjs +1 -1
- package/dist/combobox/index.cjs.map +2 -2
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +2 -2
- package/dist/input/input.types.d.ts +1 -0
- package/dist/input/input.types.d.ts.map +1 -1
- package/dist/number-input/index.cjs +1 -1
- package/dist/number-input/index.cjs.map +2 -2
- package/dist/number-input/index.js +1 -1
- package/dist/number-input/index.js.map +2 -2
- package/dist/number-input/number-input.api.d.ts.map +1 -1
- package/dist/password-input/index.cjs +1 -1
- package/dist/password-input/index.cjs.map +2 -2
- package/dist/password-input/index.js +1 -1
- package/dist/password-input/index.js.map +2 -2
- package/dist/password-input/password-input.api.d.ts.map +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.cjs.map +2 -2
- package/dist/progress/index.js +1 -1
- package/dist/progress/index.js.map +2 -2
- package/dist/progress/progress.api.d.ts.map +1 -1
- package/dist/progress/progress.types.d.ts +1 -0
- package/dist/progress/progress.types.d.ts.map +1 -1
- package/dist/select/index.cjs +1 -1
- package/dist/select/index.cjs.map +2 -2
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +2 -2
- package/dist/select/select.api.d.ts.map +1 -1
- package/dist/text-input/index.cjs +1 -1
- package/dist/text-input/index.cjs.map +2 -2
- package/dist/text-input/index.js +1 -1
- package/dist/text-input/index.js.map +2 -2
- package/dist/text-input/text-input.api.d.ts.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.api.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.api.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAGV,OAAO,EACP,cAAc,EACf,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EACV,WAAW,EAiBX,cAAc,EAEf,MAAM,kBAAkB,CAAA;AASzB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,EAChC,SAAS,EAAE,cAAc,GACxB,WAAW,
|
|
1
|
+
{"version":3,"file":"combobox.api.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.api.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAGV,OAAO,EACP,cAAc,EACf,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EACV,WAAW,EAiBX,cAAc,EAEf,MAAM,kBAAkB,CAAA;AASzB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,EAChC,SAAS,EAAE,cAAc,GACxB,WAAW,CAykBb"}
|
package/dist/combobox/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var G=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Ce=(e,t)=>{for(var o in t)G(e,o,{get:t[o],enumerable:!0})},fe=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pe(t))!Ie.call(e,n)&&n!==o&&G(e,n,{get:()=>t[n],enumerable:!(i=he(t,n))||i.enumerable});return e};var Oe=e=>fe(G({},"__esModule",{value:!0}),e);var ye={};Ce(ye,{comboboxCollection:()=>Ee,comboboxMachine:()=>Ve,comboboxProps:()=>le,createComboboxApi:()=>be,emptyCollection:()=>W,splitComboboxProps:()=>ve});module.exports=Oe(ye);var Q=require("@qualcomm-ui/dom/floating-ui"),X=require("@qualcomm-ui/dom/focus-visible"),O=require("@qualcomm-ui/dom/query"),g=require("@qualcomm-ui/utils/attributes"),Z=require("@qualcomm-ui/utils/guard");var $=require("@qualcomm-ui/dom/query"),h={clearTrigger:e=>e.ids.get("clearTrigger"),content:e=>e.ids.get("content"),control:e=>e.ids.get("control"),errorText:e=>e.ids.get("errorText"),hint:e=>e.ids.get("hint"),input:e=>e.ids.get("input"),label:e=>e.ids.get("label"),positioner:e=>e.ids.get("positioner"),root:e=>e.ids.get("root"),trigger:e=>e.ids.get("trigger")},c={clearTrigger:e=>e.getById(h.clearTrigger(e)),content:e=>e.getById(h.content(e)),control:e=>e.getById(h.control(e)),errorText:e=>e.getById(h.errorText(e)),hint:e=>e.getById(h.hint(e)),input:e=>e.getById(h.input(e)),label:e=>e.getById(h.label?.(e)),positioner:e=>e.getById(h.positioner(e)),root:e=>e.getById(h.root(e)),trigger:e=>e.getById(h.trigger(e))};function j(e,t){return`${e.ids.get("root")}-item-group-${t}`}function w(e,t){return`${h.root(e)}-item-${t}`}function _(e,t){return`${h.root(e)}-item-group-label-${t}`}function N(e,t){if(t==null)return null;let o=`[role=option][data-value="${CSS.escape(t)}"]`;return(0,$.query)(c.content(e),o)}function K(e){let t=c.input(e);e.isActiveElement(t)||t?.focus({preventScroll:!0})}function J(e){let t=c.trigger(e);e.isActiveElement(t)||t?.focus({preventScroll:!0})}function be(e,t){let{computed:o,context:i,event:n,prop:a,refs:d,scope:s,send:u,state:V}=e,S=a("translations"),y=a("collection"),I=!!a("disabled"),k=o("isInteractive"),v=!!a("invalid"),D=!!a("required"),L=!!a("readOnly"),f=V.hasTag("open"),M=V.hasTag("focused"),A=a("composite"),R=i.get("highlightedValue"),ae=(0,Q.getPlacementStyles)({...a("positioning"),placement:i.get("currentPlacement")});function re(l){let r=y.getItemDisabled(l.item),b=y.getItemValue(l.item);return(0,Z.ensure)(b,()=>`[@qualcomm-ui/core] No value found for item ${JSON.stringify(l.item)}`),{...l,disabled:I||r,highlighted:R===b,selected:i.get("value").includes(b),value:b}}let C={"data-scope":"combobox",dir:a("dir")};return{clearHighlightValue(){u({type:"HIGHLIGHTED_VALUE.CLEAR"})},clearValue(l){l!=null?u({type:"ITEM.CLEAR",value:l}):u({type:"VALUE.CLEAR"})},collection:a("collection"),disabled:!!I,focus(){c.input(s)?.focus()},focused:M,hasSelectedItems:o("hasSelectedItems"),highlightedItem:i.get("highlightedItem"),highlightedValue:R,inputValue:i.get("inputValue"),multiple:!!a("multiple"),open:f,reposition(l={}){u({options:l,type:"POSITIONING.SET"})},required:a("required"),selectedItems:i.get("selectedItems"),selectValue(l){u({type:"ITEM.SELECT",value:l})},setHighlightValue(l){u({type:"HIGHLIGHTED_VALUE.SET",value:l})},setInputValue(l,r="script"){u({src:r,type:"INPUT_VALUE.SET",value:l})},setOpen(l,r="script"){V.hasTag("open")!==l&&u({src:r,type:l?"OPEN":"CLOSE"})},setScrollToIndexFn(l){d.set("scrollToIndexFn",l)},setValue(l){u({type:"VALUE.SET",value:l})},syncSelectedItems(){u({type:"SELECTED_ITEMS.SYNC"})},value:i.get("value"),valueAsString:o("valueAsString"),getClearTriggerBindings(l){return s.ids.register("clearTrigger",l),t.button({...C,"aria-controls":h.input(s),"aria-label":S.clearTriggerLabel,"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"clear-trigger",disabled:I,hidden:!i.get("value").length,id:l.id,onClick(r){r.defaultPrevented||k&&u({src:"clear-trigger",type:"VALUE.CLEAR"})},onPointerDown(r){(0,O.isLeftClick)(r)&&r.preventDefault()},tabIndex:-1,type:"button"})},getContentBindings(l){return s.ids.register("content",l),t.element({...C,"aria-labelledby":h.label(s),"aria-multiselectable":a("multiple")&&A?"true":void 0,"data-disabled":(0,g.booleanDataAttr)(I),"data-empty":(0,g.booleanDataAttr)(y.size===0),"data-focus-visible":(0,g.booleanDataAttr)((0,X.isFocusVisible)()),"data-part":"content","data-placement":i.get("currentPlacement"),"data-state":f?"open":"closed",hidden:!f,id:l.id,onPointerDown(r){(0,O.isLeftClick)(r)&&r.preventDefault()},role:A?"listbox":"dialog",tabIndex:-1})},getControlBindings(l){return s.ids.register("control",l),t.element({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-focus":(0,g.booleanDataAttr)(M),"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"control","data-state":f?"open":"closed",id:l.id})},getEmptyBindings(){return t.element({...C,"data-part":"empty",hidden:y.size>0,role:"presentation"})},getErrorIndicatorBindings(){return t.element({...C,"aria-label":"Error","data-part":"error-indicator",hidden:!a("invalid")})},getErrorTextBindings(l){return s.ids.register("errorText",l),t.element({...C,"aria-live":"polite","data-part":"error-text",hidden:!a("invalid"),id:l.id})},getHintBindings(l){return s.ids.register("hint",l),t.element({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-part":"hint",id:l.id})},getInputBindings(l){return s.ids.register("input",l),t.input({...C,"aria-activedescendant":R?w(s,R):void 0,"aria-autocomplete":o("autoComplete")?"both":"list","aria-controls":h.content(s),"aria-expanded":(0,g.booleanAriaAttr)(f),"aria-invalid":(0,g.booleanAriaAttr)(v),autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":(0,g.booleanDataAttr)(a("autoFocus")),"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"input","data-state":f?"open":"closed",defaultValue:i.get("inputValue"),disabled:I,form:a("form"),id:l.id,name:a("name"),onBlur(){I||u({type:"INPUT.BLUR"})},onChange(r){u({src:"input-change",type:"INPUT.CHANGE",value:r.currentTarget.value})},onClick(r){r.defaultPrevented||a("openOnClick")&&k&&u({src:"input-click",type:"INPUT.CLICK"})},onFocus(){I||u({type:"INPUT.FOCUS"})},onKeyDown(r){if(r.defaultPrevented||!k||r.ctrlKey||r.shiftKey||(0,O.isComposingEvent)(r))return;let b=a("openOnKeyPress"),H=r.ctrlKey||r.metaKey||r.shiftKey,T=!0,se={ArrowDown(P){!b&&!f||(u({keypress:T,src:"arrow-key",type:P.altKey?"OPEN":"INPUT.ARROW_DOWN"}),P.preventDefault())},ArrowUp(){!b&&!f||(u({keypress:T,src:"arrow-key",type:r.altKey?"CLOSE":"INPUT.ARROW_UP"}),r.preventDefault())},End(P){H||(u({keypress:T,type:"INPUT.END"}),f&&P.preventDefault())},Enter(P){u({keypress:T,src:"item-select",type:"INPUT.ENTER"});let ge=o("isCustomValue")&&a("allowCustomValue"),de=R!=null,me=a("alwaysSubmitOnEnter");f&&!ge&&!me&&de&&P.preventDefault()},Escape(){u({keypress:T,src:"escape-key",type:"INPUT.ESCAPE"}),r.preventDefault()},Home(P){H||(u({keypress:T,type:"INPUT.HOME"}),f&&P.preventDefault())}},ue=(0,O.getEventKey)(r,{dir:a("dir")}),ce=se[ue];ce?.(r)},placeholder:a("placeholder"),readOnly:L,required:a("required"),role:"combobox",spellCheck:"false",type:"text"})},getItemBindings(l){let r=l.value;return t.element({...C,"aria-disabled":(0,g.booleanAriaAttr)(l.disabled),"aria-selected":(0,g.booleanAriaAttr)(l.highlighted),"data-disabled":(0,g.booleanDataAttr)(l.disabled),"data-highlighted":(0,g.booleanDataAttr)(l.highlighted),"data-part":"item","data-state":l.selected?"checked":"unchecked","data-value":l.value,id:w(s,r),onClick(b){(0,O.isDownloadingEvent)(b)||(0,O.isOpeningInNewTab)(b)||(0,O.isContextMenuEvent)(b)||l.disabled||u({src:"item-select",type:"ITEM.CLICK",value:r})},onPointerLeave(){l.persistFocus||l.disabled||!n.previous()?.type.includes("POINTER")||u({type:"ITEM.POINTER_LEAVE",value:r})},onPointerMove(){l.disabled||l.highlighted||u({type:"ITEM.POINTER_MOVE",value:r})},role:"option",tabIndex:-1})},getItemGroupBindings(l){let{id:r}=l;return t.element({...C,"aria-labelledby":_(s,r),"data-empty":(0,g.booleanDataAttr)(y.size===0),"data-part":"item-group",id:j(s,r),role:"group"})},getItemGroupLabelBindings(l){return t.element({...C,"data-part":"item-group-label",id:_(s,l.htmlFor),role:"presentation"})},getItemIndicatorBindings(l){return t.element({...C,"aria-hidden":!0,"data-part":"item-indicator","data-state":l.selected?"checked":"unchecked",hidden:!l.selected})},getItemState:re,getItemTextBindings(l){return t.element({...C,"data-disabled":(0,g.booleanDataAttr)(l.disabled),"data-highlighted":(0,g.booleanDataAttr)(l.highlighted),"data-part":"item-text","data-state":l.selected?"checked":"unchecked"})},getLabelBindings(l){return s.ids.register("label",l),t.label({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-focus":(0,g.booleanDataAttr)(M),"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"label","data-readonly":(0,g.booleanDataAttr)(L),"data-required":(0,g.booleanDataAttr)(D),htmlFor:h.input(s),id:l.id,onClick(r){A||(r.preventDefault(),c.trigger(s)?.focus({preventScroll:!0}))}})},getPositionerBindings(l){return s.ids.register("positioner",l),t.element({...C,"data-part":"positioner",id:l.id,style:ae.floating})},getRootBindings(l){return s.ids.register("root",l),t.element({...C,"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"root","data-readonly":(0,g.booleanDataAttr)(L),id:l.id,onClick:r=>{r.target===c.control(s)&&c.input(s)?.focus({preventScroll:!0})}})},getTriggerBindings(l){return s.ids.register("trigger",l),t.button({...C,"aria-controls":f?h.content(s):void 0,"aria-expanded":(0,g.booleanAriaAttr)(f),"aria-haspopup":A?"listbox":"dialog","aria-label":S.triggerLabel,"data-disabled":(0,g.booleanDataAttr)(I),"data-focusable":(0,g.booleanDataAttr)(l.focusable),"data-invalid":(0,g.booleanDataAttr)(v),"data-part":"trigger","data-readonly":(0,g.booleanDataAttr)(L),"data-state":f?"open":"closed",disabled:I,id:l.id,onClick(r){r.defaultPrevented||k&&(0,O.isLeftClick)(r)&&u({src:"trigger-click",type:"TRIGGER.CLICK"})},onFocus(){l.focusable&&u({src:"trigger",type:"INPUT.FOCUS"})},onKeyDown(r){if(r.defaultPrevented||A)return;let b={ArrowDown(){u({src:"arrow-key",type:"INPUT.ARROW_DOWN"})},ArrowUp(){u({src:"arrow-key",type:"INPUT.ARROW_UP"})}},H=(0,O.getEventKey)(r,{dir:a("dir")}),T=b[H];T&&(T(r),r.preventDefault())},onPointerDown(r){k&&r.pointerType!=="touch"&&(0,O.isLeftClick)(r)&&(r.preventDefault(),queueMicrotask(()=>{c.input(s)?.focus({preventScroll:!0})}))},tabIndex:l.focusable?void 0:-1,type:"button"})}}}var q=require("@qualcomm-ui/utils/collection"),Ee=e=>new q.ListCollection(e),W=()=>new q.ListCollection({items:[]});var ee=require("@qualcomm-ui/dom/aria-hidden"),te=require("@qualcomm-ui/dom/dismissable"),Y=require("@qualcomm-ui/dom/floating-ui"),oe=require("@qualcomm-ui/dom/focus-visible"),m=require("@qualcomm-ui/dom/query"),B=require("@qualcomm-ui/utils/array"),ne=require("@qualcomm-ui/utils/equal"),x=require("@qualcomm-ui/utils/functions"),ie=require("@qualcomm-ui/utils/guard"),F=require("@qualcomm-ui/utils/machine");var{and:p,not:E}=(0,F.createGuards)(),Ve=(0,F.createMachine)({actions:{autofillInputValue({computed:e,context:t,event:o,prop:i,scope:n}){let a=c.input(n),d=i("collection");if(!e("autoComplete")||!a||!o.keypress)return;let s=d.stringify(t.get("highlightedValue"));(0,m.raf)(()=>{a.value=s||t.get("inputValue")})},clearHighlightedValue({context:e}){e.set("highlightedValue",null)},clearInputValue({context:e}){e.set("inputValue","")},clearItem(e){let{context:t,event:o,flush:i,prop:n}=e;o.value!=null&&i(()=>{let a=(0,B.remove)(t.get("value"),o.value);t.set("value",a);let d=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(a)});t.set("inputValue",d)})},clearSelectedItems(e){let{context:t,flush:o,prop:i}=e;o(()=>{t.set("value",[]);let n=(0,x.match)(i("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i("collection").stringifyMany([])});t.set("inputValue",n)})},highlightFirstItem({context:e,prop:t,scope:o}){(c.content(o)?queueMicrotask:m.raf)(()=>{let n=t("collection").firstValue;n&&e.set("highlightedValue",n)})},highlightFirstItemIfNeeded({action:e,computed:t}){t("autoHighlight")&&e(["highlightFirstItem"])},highlightFirstOrSelectedItem({computed:e,context:t,prop:o}){(0,m.raf)(()=>{let i=null;e("hasSelectedItems")?i=o("collection").sort(t.get("value"))[0]:i=o("collection").firstValue,i&&t.set("highlightedValue",i)})},highlightFirstSelectedItem({context:e,prop:t}){(0,m.raf)(()=>{let[o]=t("collection").sort(e.get("value"));o&&e.set("highlightedValue",o)})},highlightLastItem({context:e,prop:t,scope:o}){(c.content(o)?queueMicrotask:m.raf)(()=>{let n=t("collection").lastValue;n&&e.set("highlightedValue",n)})},highlightLastOrSelectedItem({computed:e,context:t,prop:o}){(0,m.raf)(()=>{let i=o("collection"),n=null;e("hasSelectedItems")?n=i.sort(t.get("value"))[0]:n=i.lastValue,n&&t.set("highlightedValue",n)})},highlightNextItem({context:e,prop:t}){let o=null,i=e.get("highlightedValue"),n=t("collection");i?(o=n.getNextValue(i),!o&&t("loopFocus")&&(o=n.firstValue)):o=n.firstValue,o&&e.set("highlightedValue",o)},highlightPrevItem({context:e,prop:t}){let o=null,i=e.get("highlightedValue"),n=t("collection");i?(o=n.getPreviousValue(i),!o&&t("loopFocus")&&(o=n.lastValue)):o=n.lastValue,o&&e.set("highlightedValue",o)},invokeOnClose({event:e,prop:t}){let o=z(e);t("onOpenChange")?.({open:!1,reason:o})},invokeOnOpen({event:e,prop:t}){let o=z(e);t("onOpenChange")?.({open:!0,reason:o})},reposition({context:e,event:t,prop:o,scope:i}){(0,Y.getPlacement)(()=>c.control(i),()=>c.positioner(i),{...o("positioning"),...t.options,defer:!0,listeners:!1,onComplete(d){e.set("currentPlacement",d.placement)}})},revertInputValue({computed:e,context:t,prop:o}){let i=o("selectionBehavior");(0,m.raf)(()=>{let n=(0,x.match)(i,{clear:"",preserve:t.get("inputValue"),replace:e("hasSelectedItems")?e("valueAsString"):""});t.set("inputValue",n)})},scrollContentToTop({prop:e,refs:t,scope:o}){let i=t.get("scrollToIndexFn");if(i){let n=e("collection").firstValue;i({getElement:()=>N(o,n),immediate:!0,index:0})}else{let n=c.content(o);if(!n)return;n.scrollTop=0}},scrollToHighlightedItem({context:e,prop:t,refs:o,scope:i}){(0,m.nextTick)(()=>{let n=e.get("highlightedValue");if(n==null)return;let a=N(i,n),d=c.content(i),s=o.get("scrollToIndexFn");if(s){let u=t("collection").indexOf(n);s({getElement:()=>N(i,n),immediate:!0,index:u});return}(0,m.scrollIntoView)(a,{block:"nearest",rootEl:d})})},selectHighlightedItem(e){let{context:t,prop:o}=e,i=o("collection"),n=t.get("highlightedValue");if(!n||!i.has(n))return;let a=o("multiple")?(0,B.addOrRemove)(t.get("value"),n):[n];o("onSelect")?.({itemValue:n,value:a}),t.set("value",a);let d=(0,x.match)(o("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i.stringifyMany(a)});t.set("inputValue",d)},selectItem(e){let{context:t,event:o,flush:i,prop:n}=e;o.value!=null&&i(()=>{let a=n("multiple")?(0,B.addOrRemove)(t.get("value"),o.value):[o.value];n("onSelect")?.({itemValue:o.value,value:a}),t.set("value",a);let d=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(a)});t.set("inputValue",d)})},setFinalFocus({scope:e}){(0,m.raf)(()=>{c.trigger(e)?.dataset.focusable==null?K(e):J(e)})},setHighlightedValue({context:e,event:t}){t.value!=null&&e.set("highlightedValue",t.value)},setInitialFocus({scope:e}){(0,m.raf)(()=>{K(e)})},setInputValue({context:e,event:t}){e.set("inputValue",t.value)},setValue(e){let{context:t,event:o,flush:i,prop:n}=e;i(()=>{t.set("value",o.value);let a=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(o.value)});t.set("inputValue",a)})},syncHighlightedItem({context:e,prop:t}){let o=t("collection").find(e.get("highlightedValue"));e.set("highlightedItem",o,{})},syncInputFocus({scope:e,state:t}){let o=c.input(e);o&&o.ownerDocument.activeElement===o&&t.get()!=="focused"&&t.set("focused")},syncInputValue({context:e,event:t,scope:o}){let i=c.input(o);i&&(i.value=e.get("inputValue"),queueMicrotask(()=>{t.current().type!=="INPUT.CHANGE"&&(0,m.setCaretToEnd)(i)}))},syncSelectedItems(e){queueMicrotask(()=>{let{context:t,prop:o}=e,i=o("collection"),n=t.get("value"),a=n.map(s=>t.get("selectedItems").find(V=>i.getItemValue(V)===s)||i.find(s));t.set("selectedItems",a);let d=(0,x.match)(o("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i.stringifyMany(n)});t.set("inputValue",d)})},toggleVisibility({event:e,prop:t,send:o}){o({previousEvent:e,type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE"})}},computed:{autoComplete:({prop:e})=>e("inputBehavior")==="autocomplete",autoHighlight:({prop:e})=>e("inputBehavior")==="autohighlight",hasSelectedItems:({context:e})=>e.get("value").length>0,isCustomValue:({computed:e,context:t})=>t.get("inputValue")!==e("valueAsString"),isInputValueEmpty:({context:e})=>e.get("inputValue").length===0,isInteractive:({prop:e})=>!(e("readOnly")||e("disabled")),valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems"))},context({bindable:e,getContext:t,getEvent:o,prop:i}){return{currentPlacement:e(()=>({defaultValue:void 0})),highlightedItem:e(()=>{let n=i("highlightedValue");return{defaultValue:i("collection").find(n)}}),highlightedValue:e(()=>({defaultValue:i("defaultHighlightedValue")||null,onChange(n){let a=i("collection").find(n);i("onHighlightChange")?.({highlightedItem:a,highlightedValue:n})},value:i("highlightedValue")})),inputValue:e(()=>{let n=i("inputValue")||i("defaultInputValue")||"",a=i("value")||i("defaultValue")||[];if(!n.trim()&&!i("multiple")){let d=i("collection").stringifyMany(a);n=(0,x.match)(i("selectionBehavior"),{clear:"",preserve:n||d,replace:d})}return{defaultValue:n,onChange(d){let s=o(),u=(s.previousEvent||s).src;i("onInputValueChange")?.({inputValue:d,reason:u})},value:i("inputValue")}}),selectedItems:e(()=>{let n=i("value")||i("defaultValue")||[];return{defaultValue:i("collection").findMany(n)}}),value:e(()=>({defaultValue:i("defaultValue"),hash(n){return n.join(",")},isEqual:ne.isEqual,onChange(n){let a=t(),d=a.get("selectedItems"),s=i("collection"),u=n.map(V=>d.find(y=>s.getItemValue(y)===V)||s.find(V));a.set("selectedItems",u),i("onValueChange")?.({items:u,value:n})},value:i("value")}))}},effects:{hideOtherElements({scope:e}){return(0,ee.ariaHidden)([c.input(e),c.content(e),c.trigger(e),c.clearTrigger(e)])},scrollToHighlightedItem({context:e,event:t,prop:o,refs:i,scope:n}){let a=c.input(n),d=[],s=S=>{let y=t.current().type.includes("POINTER"),I=e.get("highlightedValue");if(y||!I)return;let k=c.content(n),v=i.get("scrollToIndexFn");if(v){let f=o("collection").indexOf(I);v({getElement:()=>N(n,I),immediate:S,index:f});return}let D=N(n,I),L=(0,m.raf)(()=>{(0,m.scrollIntoView)(D,{block:"nearest",rootEl:k})});d.push(L)},u=(0,m.raf)(()=>s(!0));d.push(u);let V=(0,m.observeAttributes)(a,{attributes:["aria-activedescendant"],callback:()=>s(!1)});return d.push(V),()=>{d.forEach(S=>S())}},trackDismissableLayer({prop:e,scope:t,send:o}){return e("disableLayer")?void 0:(0,te.trackDismissableElement)(()=>c.content(t),{defer:!0,exclude:()=>[c.input(t),c.trigger(t),c.clearTrigger(t)],onDismiss(){o({restoreFocus:!1,src:"interact-outside",type:"LAYER.INTERACT_OUTSIDE"})},onEscapeKeyDown(n){n.preventDefault(),n.stopPropagation(),o({src:"escape-key",type:"LAYER.ESCAPE"})},onFocusOutside:e("onFocusOutside"),onInteractOutside:e("onInteractOutside"),onPointerDownOutside:e("onPointerDownOutside"),type:"listbox"})},trackFocusVisible({scope:e}){return(0,oe.trackFocusVisible)({root:e.getRootNode?.()})},trackPlacement({context:e,prop:t,scope:o}){let i=()=>c.control(o)||c.trigger(o),n=()=>c.positioner(o);return e.set("currentPlacement",t("positioning").placement),(0,Y.getPlacement)(i,n,{...t("positioning"),defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})}},guards:{allowCustomValue:({prop:e})=>!!e("allowCustomValue"),autoComplete:({computed:e,prop:t})=>e("autoComplete")&&!t("multiple"),autoFocus:({prop:e})=>!!e("autoFocus"),autoHighlight:({computed:e})=>e("autoHighlight"),closeOnSelect:({prop:e})=>!!e("closeOnSelect"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isChangeEvent:({event:e})=>e.previousEvent?.type==="INPUT.CHANGE",isCustomValue:({computed:e})=>e("isCustomValue"),isFirstItemHighlighted:({context:e,prop:t})=>t("collection").firstValue===e.get("highlightedValue"),isHighlightedItemRemoved:({context:e,prop:t})=>!t("collection").has(e.get("highlightedValue")),isInputValueEmpty:({computed:e})=>e("isInputValueEmpty"),isLastItemHighlighted:({context:e,prop:t})=>t("collection").lastValue===e.get("highlightedValue"),isOpenControlled:({prop:e})=>e("open")!=null,openOnChange:({context:e,prop:t})=>{let o=t("openOnChange");return(0,ie.isBoolean)(o)?o:!!o?.({inputValue:e.get("inputValue")})},restoreFocus:({event:e})=>e.restoreFocus==null?!0:!!e.restoreFocus},ids:({bindableId:e,ids:t})=>({clearTrigger:e(t?.clearTrigger),content:e(t?.content),control:e(t?.control),errorText:e(t?.errorText),hint:e(t?.hint),input:e(t?.input),label:e(t?.label),positioner:e(t?.positioner),root:e(t?.root),trigger:e(t?.trigger)}),initialState({prop:e}){return e("open")||e("defaultOpen")?"suggesting":"idle"},on:{"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"ITEM.CLEAR":{actions:["clearItem"]},"ITEM.SELECT":{actions:["selectItem"]},"POSITIONING.SET":{actions:["reposition"]},"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"VALUE.SET":{actions:["setValue"]}},onInit:{actions:[(0,F.createChoose)([{actions:["setInitialFocus"],guard:"autoFocus"}]),"syncInputFocus"],effects:["trackFocusVisible"]},props({props:e}){return{allowCustomValue:!1,alwaysSubmitOnEnter:!1,closeOnSelect:!e.multiple,collection:e.collection||W(),composite:!0,defaultInputValue:"",defaultValue:[],inputBehavior:"none",loopFocus:!0,openOnChange:!0,openOnClick:!1,openOnKeyPress:!0,selectionBehavior:e.multiple?"clear":"replace",...e,positioning:{gutter:2,placement:"bottom-start",sameWidth:!0,...e.positioning},translations:{clearTriggerLabel:"Clear value",triggerLabel:"Toggle suggestions",...e.translations}}},refs:({prop:e})=>({scrollToIndexFn:e("scrollToIndexFn")}),states:{focused:{entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.ARROW_DOWN":[{actions:["invokeOnOpen"],guard:p("isOpenControlled","autoComplete")},{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["highlightFirstOrSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstOrSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.ARROW_UP":[{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["highlightLastOrSelectedItem","invokeOnOpen"],target:"interacting"},{actions:["highlightLastOrSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.BLUR":{target:"idle"},"INPUT.CHANGE":[{actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"],guard:p("isOpenControlled","openOnChange")},{actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"],guard:"openOnChange",target:"suggesting"},{actions:["setInputValue"]}],"INPUT.CLICK":[{actions:["highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.ESCAPE":{actions:["revertInputValue"],guard:p("isCustomValue",E("allowCustomValue"))},"LAYER.INTERACT_OUTSIDE":{target:"idle"},OPEN:[{actions:["invokeOnOpen"],guard:"isOpenControlled"},{actions:["invokeOnOpen"],target:"interacting"}],"TRIGGER.CLICK":[{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}},tags:["focused","closed"]},idle:{entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"INPUT.CLICK":[{actions:["highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.FOCUS":{target:"focused"},OPEN:[{actions:["invokeOnOpen"],guard:"isOpenControlled"},{actions:["invokeOnOpen"],target:"interacting"}],"TRIGGER.CLICK":[{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems","setInitialFocus"],target:"focused"}},tags:["idle","closed"]},interacting:{effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{CHILDREN_CHANGE:[{actions:["clearHighlightedValue"],guard:"isHighlightedItemRemoved"},{actions:["scrollToHighlightedItem"]}],CLOSE:[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"CONTROLLED.CLOSE":[{actions:["setFinalFocus"],guard:"restoreFocus",target:"focused"},{target:"idle"}],"INPUT.ARROW_DOWN":[{actions:["clearHighlightedValue","scrollContentToTop"],guard:p("autoComplete","isLastItemHighlighted")},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{actions:["clearHighlightedValue"],guard:p("autoComplete","isFirstItemHighlighted")},{actions:["highlightPrevItem"]}],"INPUT.CHANGE":[{actions:["setInputValue"],guard:"autoComplete",target:"suggesting"},{actions:["clearHighlightedValue","setInputValue"],target:"suggesting"}],"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ENTER":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("hasHighlightedItem"),E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("hasHighlightedItem"),E("allowCustomValue")),target:"focused"},{actions:["selectHighlightedItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"ITEM.CLICK":[{actions:["selectItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectItem"]}],"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"LAYER.ESCAPE":[{actions:["syncInputValue","invokeOnClose"],guard:p("isOpenControlled","autoComplete")},{actions:["syncInputValue","invokeOnClose"],guard:"autoComplete",target:"focused"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"LAYER.INTERACT_OUTSIDE":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("allowCustomValue")),target:"idle"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"idle"}],"TRIGGER.CLICK":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"VALUE.CLEAR":[{actions:["clearInputValue","clearSelectedItems","invokeOnClose"],guard:"isOpenControlled"},{actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"],target:"focused"}]},tags:["open","focused"]},suggesting:{effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{CHILDREN_CHANGE:[{actions:["highlightFirstItem"],guard:"autoHighlight"},{actions:["clearHighlightedValue"],guard:"isHighlightedItemRemoved"}],CLOSE:[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"CONTROLLED.CLOSE":[{actions:["setFinalFocus"],guard:"restoreFocus",target:"focused"},{target:"idle"}],"INPUT.ARROW_DOWN":{actions:["highlightNextItem"],target:"interacting"},"INPUT.ARROW_UP":{actions:["highlightPrevItem"],target:"interacting"},"INPUT.CHANGE":{actions:["setInputValue"]},"INPUT.END":{actions:["highlightLastItem"],target:"interacting"},"INPUT.ENTER":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("hasHighlightedItem"),E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("hasHighlightedItem"),E("allowCustomValue")),target:"focused"},{actions:["selectHighlightedItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"],target:"interacting"},"ITEM.CLICK":[{actions:["selectItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectItem"]}],"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"],target:"interacting"},"LAYER.ESCAPE":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"LAYER.INTERACT_OUTSIDE":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("allowCustomValue")),target:"idle"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"idle"}],"TRIGGER.CLICK":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"VALUE.CLEAR":[{actions:["clearInputValue","clearSelectedItems","invokeOnClose"],guard:"isOpenControlled"},{actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"],target:"focused"}]},tags:["open","focused"]}},watch({action:e,context:t,prop:o,send:i,track:n}){n([()=>t.hash("value")],()=>{e(["syncSelectedItems"])}),n([()=>t.get("inputValue")],()=>{e(["syncInputValue"])}),n([()=>t.get("highlightedValue")],()=>{e(["syncHighlightedItem","autofillInputValue"])}),n([()=>o("open")],()=>{e(["toggleVisibility"])}),n([()=>o("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})}});function z(e){return(e.previousEvent||e).src}var U=require("@qualcomm-ui/utils/object"),le=(0,U.createProps)()("allowCustomValue","alwaysSubmitOnEnter","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value"),ve=(0,U.createSplitProps)(le);
|
|
1
|
+
"use strict";var G=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Ce=(e,t)=>{for(var o in t)G(e,o,{get:t[o],enumerable:!0})},fe=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pe(t))!Ie.call(e,n)&&n!==o&&G(e,n,{get:()=>t[n],enumerable:!(i=he(t,n))||i.enumerable});return e};var Oe=e=>fe(G({},"__esModule",{value:!0}),e);var ye={};Ce(ye,{comboboxCollection:()=>Ee,comboboxMachine:()=>Ve,comboboxProps:()=>le,createComboboxApi:()=>be,emptyCollection:()=>W,splitComboboxProps:()=>ve});module.exports=Oe(ye);var Q=require("@qualcomm-ui/dom/floating-ui"),X=require("@qualcomm-ui/dom/focus-visible"),O=require("@qualcomm-ui/dom/query"),g=require("@qualcomm-ui/utils/attributes"),Z=require("@qualcomm-ui/utils/guard");var $=require("@qualcomm-ui/dom/query"),h={clearTrigger:e=>e.ids.get("clearTrigger"),content:e=>e.ids.get("content"),control:e=>e.ids.get("control"),errorText:e=>e.ids.get("errorText"),hint:e=>e.ids.get("hint"),input:e=>e.ids.get("input"),label:e=>e.ids.get("label"),positioner:e=>e.ids.get("positioner"),root:e=>e.ids.get("root"),trigger:e=>e.ids.get("trigger")},c={clearTrigger:e=>e.getById(h.clearTrigger(e)),content:e=>e.getById(h.content(e)),control:e=>e.getById(h.control(e)),errorText:e=>e.getById(h.errorText(e)),hint:e=>e.getById(h.hint(e)),input:e=>e.getById(h.input(e)),label:e=>e.getById(h.label?.(e)),positioner:e=>e.getById(h.positioner(e)),root:e=>e.getById(h.root(e)),trigger:e=>e.getById(h.trigger(e))};function j(e,t){return`${e.ids.get("root")}-item-group-${t}`}function w(e,t){return`${h.root(e)}-item-${t}`}function _(e,t){return`${h.root(e)}-item-group-label-${t}`}function N(e,t){if(t==null)return null;let o=`[role=option][data-value="${CSS.escape(t)}"]`;return(0,$.query)(c.content(e),o)}function K(e){let t=c.input(e);e.isActiveElement(t)||t?.focus({preventScroll:!0})}function J(e){let t=c.trigger(e);e.isActiveElement(t)||t?.focus({preventScroll:!0})}function be(e,t){let{computed:o,context:i,event:n,prop:a,refs:d,scope:s,send:u,state:v}=e,S=a("translations"),y=a("collection"),I=!!a("disabled"),k=o("isInteractive"),V=!!a("invalid"),D=!!a("required"),L=!!a("readOnly"),f=v.hasTag("open"),M=v.hasTag("focused"),A=a("composite"),R=i.get("highlightedValue"),ae=(0,Q.getPlacementStyles)({...a("positioning"),placement:i.get("currentPlacement")});function re(l){let r=y.getItemDisabled(l.item),b=y.getItemValue(l.item);return(0,Z.ensure)(b,()=>`[@qualcomm-ui/core] No value found for item ${JSON.stringify(l.item)}`),{...l,disabled:I||r,highlighted:R===b,selected:i.get("value").includes(b),value:b}}let C={"data-scope":"combobox",dir:a("dir")};return{clearHighlightValue(){u({type:"HIGHLIGHTED_VALUE.CLEAR"})},clearValue(l){l!=null?u({type:"ITEM.CLEAR",value:l}):u({type:"VALUE.CLEAR"})},collection:a("collection"),disabled:!!I,focus(){c.input(s)?.focus()},focused:M,hasSelectedItems:o("hasSelectedItems"),highlightedItem:i.get("highlightedItem"),highlightedValue:R,inputValue:i.get("inputValue"),multiple:!!a("multiple"),open:f,reposition(l={}){u({options:l,type:"POSITIONING.SET"})},required:a("required"),selectedItems:i.get("selectedItems"),selectValue(l){u({type:"ITEM.SELECT",value:l})},setHighlightValue(l){u({type:"HIGHLIGHTED_VALUE.SET",value:l})},setInputValue(l,r="script"){u({src:r,type:"INPUT_VALUE.SET",value:l})},setOpen(l,r="script"){v.hasTag("open")!==l&&u({src:r,type:l?"OPEN":"CLOSE"})},setScrollToIndexFn(l){d.set("scrollToIndexFn",l)},setValue(l){u({type:"VALUE.SET",value:l})},syncSelectedItems(){u({type:"SELECTED_ITEMS.SYNC"})},value:i.get("value"),valueAsString:o("valueAsString"),getClearTriggerBindings(l){return s.ids.register("clearTrigger",l),t.button({...C,"aria-controls":h.input(s),"aria-label":S.clearTriggerLabel,"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"clear-trigger",disabled:I,hidden:!i.get("value").length,id:l.id,onClick(r){r.defaultPrevented||k&&u({src:"clear-trigger",type:"VALUE.CLEAR"})},onPointerDown(r){(0,O.isLeftClick)(r)&&r.preventDefault()},tabIndex:-1,type:"button"})},getContentBindings(l){return s.ids.register("content",l),t.element({...C,"aria-labelledby":h.label(s),"aria-multiselectable":a("multiple")&&A?"true":void 0,"data-disabled":(0,g.booleanDataAttr)(I),"data-empty":(0,g.booleanDataAttr)(y.size===0),"data-focus-visible":(0,g.booleanDataAttr)((0,X.isFocusVisible)()),"data-part":"content","data-placement":i.get("currentPlacement"),"data-state":f?"open":"closed",hidden:!f,id:l.id,onPointerDown(r){(0,O.isLeftClick)(r)&&r.preventDefault()},role:A?"listbox":"dialog",tabIndex:-1})},getControlBindings(l){return s.ids.register("control",l),t.element({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-focus":(0,g.booleanDataAttr)(M),"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"control","data-state":f?"open":"closed",id:l.id})},getEmptyBindings(){return t.element({...C,"data-part":"empty",hidden:y.size>0,role:"presentation"})},getErrorIndicatorBindings(){return t.element({...C,"aria-label":"Error","data-part":"error-indicator",hidden:!a("invalid")})},getErrorTextBindings(l){return s.ids.register("errorText",l),t.element({...C,"aria-live":"polite","data-part":"error-text",hidden:!a("invalid"),id:l.id})},getHintBindings(l){return s.ids.register("hint",l),t.element({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-part":"hint",hidden:V,id:l.id})},getInputBindings(l){return s.ids.register("input",l),t.input({...C,"aria-activedescendant":R?w(s,R):void 0,"aria-autocomplete":o("autoComplete")?"both":"list","aria-controls":h.content(s),"aria-expanded":(0,g.booleanAriaAttr)(f),"aria-invalid":(0,g.booleanAriaAttr)(V),autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":(0,g.booleanDataAttr)(a("autoFocus")),"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"input","data-state":f?"open":"closed",defaultValue:i.get("inputValue"),disabled:I,form:a("form"),id:l.id,name:a("name"),onBlur(){I||u({type:"INPUT.BLUR"})},onChange(r){u({src:"input-change",type:"INPUT.CHANGE",value:r.currentTarget.value})},onClick(r){r.defaultPrevented||a("openOnClick")&&k&&u({src:"input-click",type:"INPUT.CLICK"})},onFocus(){I||u({type:"INPUT.FOCUS"})},onKeyDown(r){if(r.defaultPrevented||!k||r.ctrlKey||r.shiftKey||(0,O.isComposingEvent)(r))return;let b=a("openOnKeyPress"),H=r.ctrlKey||r.metaKey||r.shiftKey,T=!0,se={ArrowDown(P){!b&&!f||(u({keypress:T,src:"arrow-key",type:P.altKey?"OPEN":"INPUT.ARROW_DOWN"}),P.preventDefault())},ArrowUp(){!b&&!f||(u({keypress:T,src:"arrow-key",type:r.altKey?"CLOSE":"INPUT.ARROW_UP"}),r.preventDefault())},End(P){H||(u({keypress:T,type:"INPUT.END"}),f&&P.preventDefault())},Enter(P){u({keypress:T,src:"item-select",type:"INPUT.ENTER"});let ge=o("isCustomValue")&&a("allowCustomValue"),de=R!=null,me=a("alwaysSubmitOnEnter");f&&!ge&&!me&&de&&P.preventDefault()},Escape(){u({keypress:T,src:"escape-key",type:"INPUT.ESCAPE"}),r.preventDefault()},Home(P){H||(u({keypress:T,type:"INPUT.HOME"}),f&&P.preventDefault())}},ue=(0,O.getEventKey)(r,{dir:a("dir")}),ce=se[ue];ce?.(r)},placeholder:a("placeholder"),readOnly:L,required:a("required"),role:"combobox",spellCheck:"false",type:"text"})},getItemBindings(l){let r=l.value;return t.element({...C,"aria-disabled":(0,g.booleanAriaAttr)(l.disabled),"aria-selected":(0,g.booleanAriaAttr)(l.highlighted),"data-disabled":(0,g.booleanDataAttr)(l.disabled),"data-highlighted":(0,g.booleanDataAttr)(l.highlighted),"data-part":"item","data-state":l.selected?"checked":"unchecked","data-value":l.value,id:w(s,r),onClick(b){(0,O.isDownloadingEvent)(b)||(0,O.isOpeningInNewTab)(b)||(0,O.isContextMenuEvent)(b)||l.disabled||u({src:"item-select",type:"ITEM.CLICK",value:r})},onPointerLeave(){l.persistFocus||l.disabled||!n.previous()?.type.includes("POINTER")||u({type:"ITEM.POINTER_LEAVE",value:r})},onPointerMove(){l.disabled||l.highlighted||u({type:"ITEM.POINTER_MOVE",value:r})},role:"option",tabIndex:-1})},getItemGroupBindings(l){let{id:r}=l;return t.element({...C,"aria-labelledby":_(s,r),"data-empty":(0,g.booleanDataAttr)(y.size===0),"data-part":"item-group",id:j(s,r),role:"group"})},getItemGroupLabelBindings(l){return t.element({...C,"data-part":"item-group-label",id:_(s,l.htmlFor),role:"presentation"})},getItemIndicatorBindings(l){return t.element({...C,"aria-hidden":!0,"data-part":"item-indicator","data-state":l.selected?"checked":"unchecked",hidden:!l.selected})},getItemState:re,getItemTextBindings(l){return t.element({...C,"data-disabled":(0,g.booleanDataAttr)(l.disabled),"data-highlighted":(0,g.booleanDataAttr)(l.highlighted),"data-part":"item-text","data-state":l.selected?"checked":"unchecked"})},getLabelBindings(l){return s.ids.register("label",l),t.label({...C,"data-disabled":(0,g.booleanDataAttr)(I),"data-focus":(0,g.booleanDataAttr)(M),"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"label","data-readonly":(0,g.booleanDataAttr)(L),"data-required":(0,g.booleanDataAttr)(D),htmlFor:h.input(s),id:l.id,onClick(r){A||(r.preventDefault(),c.trigger(s)?.focus({preventScroll:!0}))}})},getPositionerBindings(l){return s.ids.register("positioner",l),t.element({...C,"data-part":"positioner",id:l.id,style:ae.floating})},getRootBindings(l){return s.ids.register("root",l),t.element({...C,"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"root","data-readonly":(0,g.booleanDataAttr)(L),id:l.id,onClick:r=>{r.target===c.control(s)&&c.input(s)?.focus({preventScroll:!0})}})},getTriggerBindings(l){return s.ids.register("trigger",l),t.button({...C,"aria-controls":f?h.content(s):void 0,"aria-expanded":(0,g.booleanAriaAttr)(f),"aria-haspopup":A?"listbox":"dialog","aria-label":S.triggerLabel,"data-disabled":(0,g.booleanDataAttr)(I),"data-focusable":(0,g.booleanDataAttr)(l.focusable),"data-invalid":(0,g.booleanDataAttr)(V),"data-part":"trigger","data-readonly":(0,g.booleanDataAttr)(L),"data-state":f?"open":"closed",disabled:I,id:l.id,onClick(r){r.defaultPrevented||k&&(0,O.isLeftClick)(r)&&u({src:"trigger-click",type:"TRIGGER.CLICK"})},onFocus(){l.focusable&&u({src:"trigger",type:"INPUT.FOCUS"})},onKeyDown(r){if(r.defaultPrevented||A)return;let b={ArrowDown(){u({src:"arrow-key",type:"INPUT.ARROW_DOWN"})},ArrowUp(){u({src:"arrow-key",type:"INPUT.ARROW_UP"})}},H=(0,O.getEventKey)(r,{dir:a("dir")}),T=b[H];T&&(T(r),r.preventDefault())},onPointerDown(r){k&&r.pointerType!=="touch"&&(0,O.isLeftClick)(r)&&(r.preventDefault(),queueMicrotask(()=>{c.input(s)?.focus({preventScroll:!0})}))},tabIndex:l.focusable?void 0:-1,type:"button"})}}}var q=require("@qualcomm-ui/utils/collection"),Ee=e=>new q.ListCollection(e),W=()=>new q.ListCollection({items:[]});var ee=require("@qualcomm-ui/dom/aria-hidden"),te=require("@qualcomm-ui/dom/dismissable"),Y=require("@qualcomm-ui/dom/floating-ui"),oe=require("@qualcomm-ui/dom/focus-visible"),m=require("@qualcomm-ui/dom/query"),B=require("@qualcomm-ui/utils/array"),ne=require("@qualcomm-ui/utils/equal"),x=require("@qualcomm-ui/utils/functions"),ie=require("@qualcomm-ui/utils/guard"),F=require("@qualcomm-ui/utils/machine");var{and:p,not:E}=(0,F.createGuards)(),Ve=(0,F.createMachine)({actions:{autofillInputValue({computed:e,context:t,event:o,prop:i,scope:n}){let a=c.input(n),d=i("collection");if(!e("autoComplete")||!a||!o.keypress)return;let s=d.stringify(t.get("highlightedValue"));(0,m.raf)(()=>{a.value=s||t.get("inputValue")})},clearHighlightedValue({context:e}){e.set("highlightedValue",null)},clearInputValue({context:e}){e.set("inputValue","")},clearItem(e){let{context:t,event:o,flush:i,prop:n}=e;o.value!=null&&i(()=>{let a=(0,B.remove)(t.get("value"),o.value);t.set("value",a);let d=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(a)});t.set("inputValue",d)})},clearSelectedItems(e){let{context:t,flush:o,prop:i}=e;o(()=>{t.set("value",[]);let n=(0,x.match)(i("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i("collection").stringifyMany([])});t.set("inputValue",n)})},highlightFirstItem({context:e,prop:t,scope:o}){(c.content(o)?queueMicrotask:m.raf)(()=>{let n=t("collection").firstValue;n&&e.set("highlightedValue",n)})},highlightFirstItemIfNeeded({action:e,computed:t}){t("autoHighlight")&&e(["highlightFirstItem"])},highlightFirstOrSelectedItem({computed:e,context:t,prop:o}){(0,m.raf)(()=>{let i=null;e("hasSelectedItems")?i=o("collection").sort(t.get("value"))[0]:i=o("collection").firstValue,i&&t.set("highlightedValue",i)})},highlightFirstSelectedItem({context:e,prop:t}){(0,m.raf)(()=>{let[o]=t("collection").sort(e.get("value"));o&&e.set("highlightedValue",o)})},highlightLastItem({context:e,prop:t,scope:o}){(c.content(o)?queueMicrotask:m.raf)(()=>{let n=t("collection").lastValue;n&&e.set("highlightedValue",n)})},highlightLastOrSelectedItem({computed:e,context:t,prop:o}){(0,m.raf)(()=>{let i=o("collection"),n=null;e("hasSelectedItems")?n=i.sort(t.get("value"))[0]:n=i.lastValue,n&&t.set("highlightedValue",n)})},highlightNextItem({context:e,prop:t}){let o=null,i=e.get("highlightedValue"),n=t("collection");i?(o=n.getNextValue(i),!o&&t("loopFocus")&&(o=n.firstValue)):o=n.firstValue,o&&e.set("highlightedValue",o)},highlightPrevItem({context:e,prop:t}){let o=null,i=e.get("highlightedValue"),n=t("collection");i?(o=n.getPreviousValue(i),!o&&t("loopFocus")&&(o=n.lastValue)):o=n.lastValue,o&&e.set("highlightedValue",o)},invokeOnClose({event:e,prop:t}){let o=z(e);t("onOpenChange")?.({open:!1,reason:o})},invokeOnOpen({event:e,prop:t}){let o=z(e);t("onOpenChange")?.({open:!0,reason:o})},reposition({context:e,event:t,prop:o,scope:i}){(0,Y.getPlacement)(()=>c.control(i),()=>c.positioner(i),{...o("positioning"),...t.options,defer:!0,listeners:!1,onComplete(d){e.set("currentPlacement",d.placement)}})},revertInputValue({computed:e,context:t,prop:o}){let i=o("selectionBehavior");(0,m.raf)(()=>{let n=(0,x.match)(i,{clear:"",preserve:t.get("inputValue"),replace:e("hasSelectedItems")?e("valueAsString"):""});t.set("inputValue",n)})},scrollContentToTop({prop:e,refs:t,scope:o}){let i=t.get("scrollToIndexFn");if(i){let n=e("collection").firstValue;i({getElement:()=>N(o,n),immediate:!0,index:0})}else{let n=c.content(o);if(!n)return;n.scrollTop=0}},scrollToHighlightedItem({context:e,prop:t,refs:o,scope:i}){(0,m.nextTick)(()=>{let n=e.get("highlightedValue");if(n==null)return;let a=N(i,n),d=c.content(i),s=o.get("scrollToIndexFn");if(s){let u=t("collection").indexOf(n);s({getElement:()=>N(i,n),immediate:!0,index:u});return}(0,m.scrollIntoView)(a,{block:"nearest",rootEl:d})})},selectHighlightedItem(e){let{context:t,prop:o}=e,i=o("collection"),n=t.get("highlightedValue");if(!n||!i.has(n))return;let a=o("multiple")?(0,B.addOrRemove)(t.get("value"),n):[n];o("onSelect")?.({itemValue:n,value:a}),t.set("value",a);let d=(0,x.match)(o("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i.stringifyMany(a)});t.set("inputValue",d)},selectItem(e){let{context:t,event:o,flush:i,prop:n}=e;o.value!=null&&i(()=>{let a=n("multiple")?(0,B.addOrRemove)(t.get("value"),o.value):[o.value];n("onSelect")?.({itemValue:o.value,value:a}),t.set("value",a);let d=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(a)});t.set("inputValue",d)})},setFinalFocus({scope:e}){(0,m.raf)(()=>{c.trigger(e)?.dataset.focusable==null?K(e):J(e)})},setHighlightedValue({context:e,event:t}){t.value!=null&&e.set("highlightedValue",t.value)},setInitialFocus({scope:e}){(0,m.raf)(()=>{K(e)})},setInputValue({context:e,event:t}){e.set("inputValue",t.value)},setValue(e){let{context:t,event:o,flush:i,prop:n}=e;i(()=>{t.set("value",o.value);let a=(0,x.match)(n("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:n("collection").stringifyMany(o.value)});t.set("inputValue",a)})},syncHighlightedItem({context:e,prop:t}){let o=t("collection").find(e.get("highlightedValue"));e.set("highlightedItem",o,{})},syncInputFocus({scope:e,state:t}){let o=c.input(e);o&&o.ownerDocument.activeElement===o&&t.get()!=="focused"&&t.set("focused")},syncInputValue({context:e,event:t,scope:o}){let i=c.input(o);i&&(i.value=e.get("inputValue"),queueMicrotask(()=>{t.current().type!=="INPUT.CHANGE"&&(0,m.setCaretToEnd)(i)}))},syncSelectedItems(e){queueMicrotask(()=>{let{context:t,prop:o}=e,i=o("collection"),n=t.get("value"),a=n.map(s=>t.get("selectedItems").find(v=>i.getItemValue(v)===s)||i.find(s));t.set("selectedItems",a);let d=(0,x.match)(o("selectionBehavior"),{clear:"",preserve:t.get("inputValue"),replace:i.stringifyMany(n)});t.set("inputValue",d)})},toggleVisibility({event:e,prop:t,send:o}){o({previousEvent:e,type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE"})}},computed:{autoComplete:({prop:e})=>e("inputBehavior")==="autocomplete",autoHighlight:({prop:e})=>e("inputBehavior")==="autohighlight",hasSelectedItems:({context:e})=>e.get("value").length>0,isCustomValue:({computed:e,context:t})=>t.get("inputValue")!==e("valueAsString"),isInputValueEmpty:({context:e})=>e.get("inputValue").length===0,isInteractive:({prop:e})=>!(e("readOnly")||e("disabled")),valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems"))},context({bindable:e,getContext:t,getEvent:o,prop:i}){return{currentPlacement:e(()=>({defaultValue:void 0})),highlightedItem:e(()=>{let n=i("highlightedValue");return{defaultValue:i("collection").find(n)}}),highlightedValue:e(()=>({defaultValue:i("defaultHighlightedValue")||null,onChange(n){let a=i("collection").find(n);i("onHighlightChange")?.({highlightedItem:a,highlightedValue:n})},value:i("highlightedValue")})),inputValue:e(()=>{let n=i("inputValue")||i("defaultInputValue")||"",a=i("value")||i("defaultValue")||[];if(!n.trim()&&!i("multiple")){let d=i("collection").stringifyMany(a);n=(0,x.match)(i("selectionBehavior"),{clear:"",preserve:n||d,replace:d})}return{defaultValue:n,onChange(d){let s=o(),u=(s.previousEvent||s).src;i("onInputValueChange")?.({inputValue:d,reason:u})},value:i("inputValue")}}),selectedItems:e(()=>{let n=i("value")||i("defaultValue")||[];return{defaultValue:i("collection").findMany(n)}}),value:e(()=>({defaultValue:i("defaultValue"),hash(n){return n.join(",")},isEqual:ne.isEqual,onChange(n){let a=t(),d=a.get("selectedItems"),s=i("collection"),u=n.map(v=>d.find(y=>s.getItemValue(y)===v)||s.find(v));a.set("selectedItems",u),i("onValueChange")?.({items:u,value:n})},value:i("value")}))}},effects:{hideOtherElements({scope:e}){return(0,ee.ariaHidden)([c.input(e),c.content(e),c.trigger(e),c.clearTrigger(e)])},scrollToHighlightedItem({context:e,event:t,prop:o,refs:i,scope:n}){let a=c.input(n),d=[],s=S=>{let y=t.current().type.includes("POINTER"),I=e.get("highlightedValue");if(y||!I)return;let k=c.content(n),V=i.get("scrollToIndexFn");if(V){let f=o("collection").indexOf(I);V({getElement:()=>N(n,I),immediate:S,index:f});return}let D=N(n,I),L=(0,m.raf)(()=>{(0,m.scrollIntoView)(D,{block:"nearest",rootEl:k})});d.push(L)},u=(0,m.raf)(()=>s(!0));d.push(u);let v=(0,m.observeAttributes)(a,{attributes:["aria-activedescendant"],callback:()=>s(!1)});return d.push(v),()=>{d.forEach(S=>S())}},trackDismissableLayer({prop:e,scope:t,send:o}){return e("disableLayer")?void 0:(0,te.trackDismissableElement)(()=>c.content(t),{defer:!0,exclude:()=>[c.input(t),c.trigger(t),c.clearTrigger(t)],onDismiss(){o({restoreFocus:!1,src:"interact-outside",type:"LAYER.INTERACT_OUTSIDE"})},onEscapeKeyDown(n){n.preventDefault(),n.stopPropagation(),o({src:"escape-key",type:"LAYER.ESCAPE"})},onFocusOutside:e("onFocusOutside"),onInteractOutside:e("onInteractOutside"),onPointerDownOutside:e("onPointerDownOutside"),type:"listbox"})},trackFocusVisible({scope:e}){return(0,oe.trackFocusVisible)({root:e.getRootNode?.()})},trackPlacement({context:e,prop:t,scope:o}){let i=()=>c.control(o)||c.trigger(o),n=()=>c.positioner(o);return e.set("currentPlacement",t("positioning").placement),(0,Y.getPlacement)(i,n,{...t("positioning"),defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})}},guards:{allowCustomValue:({prop:e})=>!!e("allowCustomValue"),autoComplete:({computed:e,prop:t})=>e("autoComplete")&&!t("multiple"),autoFocus:({prop:e})=>!!e("autoFocus"),autoHighlight:({computed:e})=>e("autoHighlight"),closeOnSelect:({prop:e})=>!!e("closeOnSelect"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isChangeEvent:({event:e})=>e.previousEvent?.type==="INPUT.CHANGE",isCustomValue:({computed:e})=>e("isCustomValue"),isFirstItemHighlighted:({context:e,prop:t})=>t("collection").firstValue===e.get("highlightedValue"),isHighlightedItemRemoved:({context:e,prop:t})=>!t("collection").has(e.get("highlightedValue")),isInputValueEmpty:({computed:e})=>e("isInputValueEmpty"),isLastItemHighlighted:({context:e,prop:t})=>t("collection").lastValue===e.get("highlightedValue"),isOpenControlled:({prop:e})=>e("open")!=null,openOnChange:({context:e,prop:t})=>{let o=t("openOnChange");return(0,ie.isBoolean)(o)?o:!!o?.({inputValue:e.get("inputValue")})},restoreFocus:({event:e})=>e.restoreFocus==null?!0:!!e.restoreFocus},ids:({bindableId:e,ids:t})=>({clearTrigger:e(t?.clearTrigger),content:e(t?.content),control:e(t?.control),errorText:e(t?.errorText),hint:e(t?.hint),input:e(t?.input),label:e(t?.label),positioner:e(t?.positioner),root:e(t?.root),trigger:e(t?.trigger)}),initialState({prop:e}){return e("open")||e("defaultOpen")?"suggesting":"idle"},on:{"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"ITEM.CLEAR":{actions:["clearItem"]},"ITEM.SELECT":{actions:["selectItem"]},"POSITIONING.SET":{actions:["reposition"]},"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"VALUE.SET":{actions:["setValue"]}},onInit:{actions:[(0,F.createChoose)([{actions:["setInitialFocus"],guard:"autoFocus"}]),"syncInputFocus"],effects:["trackFocusVisible"]},props({props:e}){return{allowCustomValue:!1,alwaysSubmitOnEnter:!1,closeOnSelect:!e.multiple,collection:e.collection||W(),composite:!0,defaultInputValue:"",defaultValue:[],inputBehavior:"none",loopFocus:!0,openOnChange:!0,openOnClick:!1,openOnKeyPress:!0,selectionBehavior:e.multiple?"clear":"replace",...e,positioning:{gutter:2,placement:"bottom-start",sameWidth:!0,...e.positioning},translations:{clearTriggerLabel:"Clear value",triggerLabel:"Toggle suggestions",...e.translations}}},refs:({prop:e})=>({scrollToIndexFn:e("scrollToIndexFn")}),states:{focused:{entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.ARROW_DOWN":[{actions:["invokeOnOpen"],guard:p("isOpenControlled","autoComplete")},{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["highlightFirstOrSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstOrSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.ARROW_UP":[{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["invokeOnOpen"],guard:"autoComplete",target:"interacting"},{actions:["highlightLastOrSelectedItem","invokeOnOpen"],target:"interacting"},{actions:["highlightLastOrSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.BLUR":{target:"idle"},"INPUT.CHANGE":[{actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"],guard:p("isOpenControlled","openOnChange")},{actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"],guard:"openOnChange",target:"suggesting"},{actions:["setInputValue"]}],"INPUT.CLICK":[{actions:["highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.ESCAPE":{actions:["revertInputValue"],guard:p("isCustomValue",E("allowCustomValue"))},"LAYER.INTERACT_OUTSIDE":{target:"idle"},OPEN:[{actions:["invokeOnOpen"],guard:"isOpenControlled"},{actions:["invokeOnOpen"],target:"interacting"}],"TRIGGER.CLICK":[{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}},tags:["focused","closed"]},idle:{entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"INPUT.CLICK":[{actions:["highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"INPUT.FOCUS":{target:"focused"},OPEN:[{actions:["invokeOnOpen"],guard:"isOpenControlled"},{actions:["invokeOnOpen"],target:"interacting"}],"TRIGGER.CLICK":[{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],guard:"isOpenControlled"},{actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"],target:"interacting"}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems","setInitialFocus"],target:"focused"}},tags:["idle","closed"]},interacting:{effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{CHILDREN_CHANGE:[{actions:["clearHighlightedValue"],guard:"isHighlightedItemRemoved"},{actions:["scrollToHighlightedItem"]}],CLOSE:[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"CONTROLLED.CLOSE":[{actions:["setFinalFocus"],guard:"restoreFocus",target:"focused"},{target:"idle"}],"INPUT.ARROW_DOWN":[{actions:["clearHighlightedValue","scrollContentToTop"],guard:p("autoComplete","isLastItemHighlighted")},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{actions:["clearHighlightedValue"],guard:p("autoComplete","isFirstItemHighlighted")},{actions:["highlightPrevItem"]}],"INPUT.CHANGE":[{actions:["setInputValue"],guard:"autoComplete",target:"suggesting"},{actions:["clearHighlightedValue","setInputValue"],target:"suggesting"}],"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ENTER":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("hasHighlightedItem"),E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("hasHighlightedItem"),E("allowCustomValue")),target:"focused"},{actions:["selectHighlightedItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"ITEM.CLICK":[{actions:["selectItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectItem"]}],"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"LAYER.ESCAPE":[{actions:["syncInputValue","invokeOnClose"],guard:p("isOpenControlled","autoComplete")},{actions:["syncInputValue","invokeOnClose"],guard:"autoComplete",target:"focused"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"LAYER.INTERACT_OUTSIDE":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("allowCustomValue")),target:"idle"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"idle"}],"TRIGGER.CLICK":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"VALUE.CLEAR":[{actions:["clearInputValue","clearSelectedItems","invokeOnClose"],guard:"isOpenControlled"},{actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"],target:"focused"}]},tags:["open","focused"]},suggesting:{effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{CHILDREN_CHANGE:[{actions:["highlightFirstItem"],guard:"autoHighlight"},{actions:["clearHighlightedValue"],guard:"isHighlightedItemRemoved"}],CLOSE:[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose","setFinalFocus"],target:"focused"}],"CONTROLLED.CLOSE":[{actions:["setFinalFocus"],guard:"restoreFocus",target:"focused"},{target:"idle"}],"INPUT.ARROW_DOWN":{actions:["highlightNextItem"],target:"interacting"},"INPUT.ARROW_UP":{actions:["highlightPrevItem"],target:"interacting"},"INPUT.CHANGE":{actions:["setInputValue"]},"INPUT.END":{actions:["highlightLastItem"],target:"interacting"},"INPUT.ENTER":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("hasHighlightedItem"),E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("hasHighlightedItem"),E("allowCustomValue")),target:"focused"},{actions:["selectHighlightedItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"],target:"interacting"},"ITEM.CLICK":[{actions:["selectItem","invokeOnClose"],guard:p("isOpenControlled","closeOnSelect")},{actions:["selectItem","invokeOnClose","setFinalFocus"],guard:"closeOnSelect",target:"focused"},{actions:["selectItem"]}],"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"],target:"interacting"},"LAYER.ESCAPE":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"LAYER.INTERACT_OUTSIDE":[{actions:["revertInputValue","invokeOnClose"],guard:p("isOpenControlled","isCustomValue",E("allowCustomValue"))},{actions:["revertInputValue","invokeOnClose"],guard:p("isCustomValue",E("allowCustomValue")),target:"idle"},{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"idle"}],"TRIGGER.CLICK":[{actions:["invokeOnClose"],guard:"isOpenControlled"},{actions:["invokeOnClose"],target:"focused"}],"VALUE.CLEAR":[{actions:["clearInputValue","clearSelectedItems","invokeOnClose"],guard:"isOpenControlled"},{actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"],target:"focused"}]},tags:["open","focused"]}},watch({action:e,context:t,prop:o,send:i,track:n}){n([()=>t.hash("value")],()=>{e(["syncSelectedItems"])}),n([()=>t.get("inputValue")],()=>{e(["syncInputValue"])}),n([()=>t.get("highlightedValue")],()=>{e(["syncHighlightedItem","autofillInputValue"])}),n([()=>o("open")],()=>{e(["toggleVisibility"])}),n([()=>o("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})}});function z(e){return(e.previousEvent||e).src}var U=require("@qualcomm-ui/utils/object"),le=(0,U.createProps)()("allowCustomValue","alwaysSubmitOnEnter","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value"),ve=(0,U.createSplitProps)(le);
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|