@pantograph/vue 0.32.3 → 0.32.4

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.
Files changed (51) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +4 -2
  2. package/dist/ColorPicker/index.js +2 -2
  3. package/dist/ColorPicker/index.umd.cjs +1 -1
  4. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-D9G-d0r6.js → ColorPicker.vue_vue_type_style_index_0_lang-BEfDYfnf.js} +1 -1
  5. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CQT-bHho.js → ColorPicker.vue_vue_type_style_index_0_lang-I6QN70qq.js} +1 -1
  6. package/dist/ColorSwatchGroup/ColorSwatchGroup.d.ts +6 -0
  7. package/dist/ColorSwatchGroup/index.js +1 -1
  8. package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
  9. package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-awOxZml7.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-DDy2ee2d.js} +33 -30
  10. package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-T7Ym5IRz.js +1 -0
  11. package/dist/Combobox/Combobox.d.ts +4 -2
  12. package/dist/Combobox/index.js +1 -1
  13. package/dist/Combobox/index.umd.cjs +1 -1
  14. package/dist/Comment/CommentMention.d.ts +18 -10
  15. package/dist/Dialog/Dialog.d.ts +8 -2
  16. package/dist/Dialog/index.js +23 -23
  17. package/dist/Dialog/index.umd.cjs +1 -1
  18. package/dist/Drawer/Drawer.d.ts +4 -2
  19. package/dist/Drawer/index.js +1 -1
  20. package/dist/Drawer/index.umd.cjs +1 -1
  21. package/dist/GOPicker/index.js +1 -1
  22. package/dist/GOPicker/index.umd.cjs +1 -1
  23. package/dist/HoverCard/HoverCard.d.ts +2 -2
  24. package/dist/HoverCard/index.js +2 -2
  25. package/dist/HoverCard/index.umd.cjs +1 -1
  26. package/dist/Menu/Menu.d.ts +2 -2
  27. package/dist/Modal/Modal.d.ts +4 -2
  28. package/dist/Modal/index.js +17 -17
  29. package/dist/Modal/index.umd.cjs +1 -1
  30. package/dist/Popover/Popover.d.ts +5 -7
  31. package/dist/Popover/index.d.ts +2 -2
  32. package/dist/Popover/index.js +6 -6
  33. package/dist/Popover/index.umd.cjs +1 -1
  34. package/dist/Popover/type.d.ts +7 -0
  35. package/dist/Popover/utils.d.ts +4 -4
  36. package/dist/Select/Select.d.ts +2 -2
  37. package/dist/Select/index.js +2 -2
  38. package/dist/Select/index.umd.cjs +1 -1
  39. package/dist/{Select.vue_vue_type_style_index_0_lang-DQitB2YA.js → Select.vue_vue_type_style_index_0_lang-79nCnnn0.js} +1 -1
  40. package/dist/{Select.vue_vue_type_style_index_0_lang-CoTVc2XS.js → Select.vue_vue_type_style_index_0_lang-DjdX0Ab4.js} +1 -1
  41. package/dist/index.js +4 -4
  42. package/dist/index.umd.cjs +1 -1
  43. package/dist/style/index.css +1 -1
  44. package/dist/use/index.js +5 -5
  45. package/dist/use/index.umd.cjs +1 -1
  46. package/dist/utils-BurtTDf8.js +1 -0
  47. package/dist/utils-FYU7FkmA.js +200 -0
  48. package/package.json +1 -1
  49. package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-DE47Don1.js +0 -1
  50. package/dist/utils-DeYtvqtV.js +0 -197
  51. package/dist/utils-V8eBZdnq.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_e=require("reka-ui"),x=require("es-toolkit"),_=require("@pantograph/utils-vue"),r=require("@pantograph/utils"),dt=require("../Popover/index.umd.cjs"),De=require("class-variance-authority");require("../Icon/index.umd.cjs");require("../Avatar/index.umd.cjs");require("../GraphicalObject/index.umd.cjs");const be=require("../Avatar.vue_vue_type_style_index_0_lang-mKlk9pzA.js"),gt=require("../GraphicalObjectGroup/index.umd.cjs"),mt=require("../index-BUzezp9o.js"),ft=require("../Chip.vue_vue_type_style_index_0_lang-BguWH1di.js");require("../Input/index.umd.cjs");const Ne=require("@vueuse/core"),vt=require("../Input.vue_vue_type_script_setup_true_lang-BfK5xqDA.js"),Ce=require("../Icon.vue_vue_type_style_index_0_lang-v3QUxO-v.js"),Me=require("../Menu.vue_vue_type_style_index_0_lang-0Iq18-ro.js"),j=require("../isArray-Bin_5of_.js"),Re=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-DChtamWZ.js");require("../ScrollContainer/index.umd.cjs");require("../Empty/index.umd.cjs");const ye=require("../index-B2rTP8gs.js");require("../MenuItem/index.umd.cjs");require("../Checkbox/index.umd.cjs");const yt=require("../Checkbox.vue_vue_type_style_index_0_lang-DDa0cjqA.js"),ht=require("../Skeleton.vue_vue_type_style_index_0_lang-oMsTff2I.js"),bt=require("../Divider.vue_vue_type_style_index_0_lang-Heq87yk1.js"),ze=require("../index-4j_iV_pN.js"),_t=require("../ConfigProvider/index.umd.cjs"),Ae=require("../head-Bg_QoIT5.js"),Ct=require("../ScrollContainer.vue_vue_type_style_index_0_lang-XfGedoBb.js"),kt=require("../Empty.vue_vue_type_style_index_0_lang-Cvh6hCth.js"),[pe,qe]=_e.createContext("Combobox"),E=r.getBemBlock("combobox"),Fe=r.getBemModifier(E,"value-placeholder"),he=r.getBemElement(E,"option"),ke=["sm","md","lg"],je=["error","warning","success"],de=e.defineComponent({...r.getComponentOptions("ComboboxInput"),__name:"ComboboxInput",props:{id:{},maxlength:{},type:{},placeholder:{},disabled:{type:Boolean,default:void 0},required:{type:Boolean},readonly:{type:Boolean},contentFit:{type:Boolean},modelValue:{},defaultValue:{},immediateFocus:{type:Boolean},leading:{},trailing:{},clearIcon:{},trailingCls:{type:[Array,Object,String,Number,null,Boolean]},clearIconCls:{type:[Array,Object,String,Number,null,Boolean]},dividerCls:{type:[Array,Object,String,Number,null,Boolean]},leadingCls:{type:[Array,Object,String,Number,null,Boolean]},class:{type:[Array,Object,String,Number,null,Boolean]},allowClear:{type:Boolean},bordered:{type:Boolean,default:void 0},simple:{type:Boolean},size:{},status:{},steps:{type:Boolean}},setup(S){const o=S,p=e.useSlots(),n=pe();Ne.whenever(()=>n.openModel.value&&n.inputRef.value,n.focusOnInput),e.onBeforeUnmount(()=>{n.comboboxInputFocused.value=!1});const k=e.computed(()=>{const T=o.placeholder??n.props.placeholder??"";return(n.props.headerSearch?T:n.placeholder.value)??T}),F=r.getBemElement(E,"input");return(T,m)=>(e.openBlock(),e.createBlock(e.unref(vt._sfc_main),e.mergeProps({...e.unref(n).comboboxInputBinding.value,...o,disabled:e.unref(n).getDisabled.value||o.disabled},{placeholder:k.value,onKeydown:e.unref(n).onKeyDown,ref:e.unref(n).inputRef,class:e.unref(r.normCls)(e.unref(F),{[e.unref(Fe)]:e.unref(n).valuePlaceholder.value},o.class),contentFit:!e.unref(n).props.headerSearch&&e.unref(n).props.contentFit,modelValue:e.unref(n).searchModel.value,"onUpdate:modelValue":m[0]||(m[0]=g=>e.unref(n).searchModel.value=g)}),e.createSlots({_:2},[e.renderList(Object.keys(e.unref(x.omit)(p,["leading"])),g=>({name:g,fn:e.withCtx(f=>[e.renderSlot(T.$slots,g,e.normalizeProps(e.guardReactiveProps(f)))])})),e.unref(n).props.headerSearch?{name:"leading",fn:e.withCtx(g=>[e.renderSlot(T.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)),()=>[e.createVNode(e.unref(Ce._sfc_main),{size:g.iconSize,icon:"tabler:search",flipOnDir:"rtl"},null,8,["size"])])]),key:"0"}:{name:"leading",fn:e.withCtx(g=>[e.renderSlot(T.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)))]),key:"1"}]),1040,["placeholder","onKeydown","class","contentFit","modelValue"]))}}),xt=e.defineComponent({...r.getComponentOptions("ComboboxTrigger"),__name:"ComboboxTrigger",setup(S){const o=pe(),p=({value:i})=>{i&&j.isArray(o.model.value)&&!o.getDisabled.value&&(o.model.value=o.model.value.filter(C=>C!==i))},n=e.computed(()=>{switch(o.getSize.value){case"sm":return"2xsm";case"md":default:return"xsm"}}),k=e.computed(()=>{if(!o.props.multiple&&x.isString(o.model.value)&&!r.isEmptyLikeLodash(o.model.value))return o.getOptionByValue(o.model.value)}),F=(i=k.value)=>{if(o.props.selectedItemIconAsTrailingIcon&&(i!=null&&i._icon))return i._icon},T=e.computed(()=>F()),m=e.computed(()=>{if(!o.props.noTrailing)return o.props.trailingIcon??"tabler:chevron-down"}),g=e.computed(()=>{var y,h;const i=x.cloneDeep(o.model.value),C=j.isArray(o.model.value);return{modelValue:i,open:x.cloneDeep(o.openModel.value),option:C?void 0:o.getOptionByValue(o.model.value),options:C?(h=(y=o.model.value).map)==null?void 0:h.call(y,o.getOptionByValue).filter(Boolean):void 0}}),f=i=>({...g.value,option:o.getOptionByValue(i)}),s=r.getBemElement(E,"trigger"),R=De.cva(s,{variants:{size:r.generateVariantClassList(ke,s),headerSearch:r.generateVariantClassList("header-search",s),status:r.generateVariantClassList(je,s),bordered:r.generateVariantClassList("bordered",s),multiple:r.generateVariantClassList("multiple",s),contentFit:r.generateVariantClassList("content-fit",s),wrapped:r.generateVariantClassList("wrapped",s),filled:r.generateVariantClassList("filled",s)}}),K=e.computed(()=>({type:"button",disabled:o.getDisabled.value,tabindex:o.getDisabled.value||!o.props.headerSearch?-1:0,"data-disabled":o.getDisabled.value?"":void 0,"aria-disabled":o.getDisabled.value??void 0,"aria-label":"Show popup","aria-haspopup":"listbox","aria-expanded":o.openModel.value,"data-state":o.openModel.value?"open":"closed",class:r.normCls(R({size:o.getSize.value,status:o.getStatus.value==="success"&&r.isEmptyLikeLodash(o.model.value)?void 0:o.getStatus.value,bordered:o.props.bordered,multiple:o.props.multiple,contentFit:o.props.contentFit,wrapped:o.props.wrapped,filled:!r.isEmptyLikeLodash(o.model.value),headerSearch:o.props.headerSearch}),o.props.triggerCls),...o.comboboxTriggerBinding.value})),v=(i,C=n.value)=>e.h(Ce._sfc_main,{icon:i,size:C}),J=()=>{var y,h;let i;const C=(h=(y=o.slots).triggerTrailing)==null?void 0:h.call(y,g.value);if(!_.isEmptyElement(C))i=C;else if(m.value&&m.value){const w=m.value===!0?"tabler:chevron-down":m.value;i=v(w)}if(i)return e.h("div",{class:r.normCls(r.getBemElement(s,"trailing"),o.props.triggerTrailingCls)},i)},G=i=>{var y,h;const C=o.getOptionByValue(i)??{_key:i};return e.h(be._sfc_main,{size:o.getTagSize.value,...C?((h=(y=o.props).getTagProps)==null?void 0:h.call(y,C))??{}:{}})},Z=i=>{var y,h;const C=o.getOptionByValue(i)??{_key:i};return e.h(Re._sfc_main,{...C?((h=(y=o.props).getTagProps)==null?void 0:h.call(y,C))??{}:{},size:o.getTagSize.value})},re=()=>{var i,C;if(!o.props.multiple&&!j.isArray(o.model.value)&&o.model.value){let y;x.isString(o.model.value)&&!r.isEmptyLikeLodash(o.model.value)&&(y=o.model.value);const h=y?(C=(i=o.slots).optionLeading)==null?void 0:C.call(i,Me.getMenuContentSlotProps(o.props.size,f(y))):null,w=!_.isEmptyElement(h);if(w||o.props.tagRenderMode&&["avatar","go"].includes(o.props.tagRenderMode)||T.value||o.props.leadingIcon){let D;if(w?D=h:o.props.tagRenderMode==="avatar"?D=G(o.model.value):o.props.tagRenderMode==="go"?D=Z(o.model.value):T.value?D=v(T.value):o.props.leadingIcon&&(D=v(o.props.leadingIcon)),!_.isEmptyElement(D))return e.h("div",{class:r.normCls(r.getBemElement(s,"leading"),o.props.triggerLeadingCls)},D)}}},ee=()=>{var te,Q;const i=(Q=(te=o.slots).trigger)==null?void 0:Q.call(te,g.value);if(!_.isEmptyElement(i))return e.h(_e.Slot,x.omit(K.value,["class"]),()=>i);const y=()=>{const V=[],$=[r.getBemElement(s,"tags"),o.props.triggerContentCls,o.props.triggerContentValueCls],z=(()=>{if(o.props.multiple&&j.isArray(o.model.value)){if(o.props.tagRenderMode==="avatar")return e.h(be._sfc_main$1,{maxCount:o.props.maxCount,size:o.getTagSize.value,closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$},()=>o.model.value.map(G));if(o.props.tagRenderMode==="go")return e.h(gt.GraphicalObjectGroup,{maxCount:o.props.maxCount,size:o.getTagSize.value,closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$},()=>o.model.value.map(Z));if(o.props.tagRenderMode==="chip")return e.h(mt._sfc_main,{maxCount:o.props.maxCount,size:o.getTagSize.value,color:"primary",closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$,onClose:p},()=>o.model.value.map(X=>{var oe,ne;const ge=()=>o.getLabelByValue(X),ae=({size:me})=>{const N=F(o.getOptionByValue(X))??o.props.leadingIcon;return N?v(N,me):null},se=o.getOptionByValue(X);return e.h(ft._sfc_main,{...se?((ne=(oe=o.props).getTagProps)==null?void 0:ne.call(oe,se))??{}:{},value:X,class:r.normCls(r.getBemElement(s,"tag"),o.props.tagCls),closeIconCls:r.getBemElement(s,"tag__close")},{text:ge,leading:ae})}))}})();if(z&&V.push(z),o.props.headerSearch?(!o.props.noValueOnPlaceholder||o.props.placeholder)&&V.push(e.h("div",{class:r.normCls(r.getBemElement(s,"content__value"),{[Fe]:o.valuePlaceholder.value})},o.placeholder.value??o.props.placeholder)):V.push(e.h(de,{noValueOnPlaceholder:o.props.noValueOnPlaceholder,searchIcon:!1,bordered:!1,simple:!0})),!_.isEmptyElement(V)||!o.props.contentFit||o.props.trailingIcon)return e.h("div",{class:r.getBemElement(s,"content")},V)},h=[],w=re();_.isEmptyElement(w)||h.push(w),h.push(y());const D=J();return _.isEmptyElement(D)||h.push(D),e.h("button",K.value,h)};return(i,C)=>(e.openBlock(),e.createBlock(ee))}}),Te=e.defineComponent({...r.getComponentOptions("ComboboxOption"),__name:"ComboboxOption",props:{option:{}},setup(S){const o=S,p=pe(),n=e.computed(()=>p.isOptionSelected(o.option._key)),k=m=>{var s,R,K,v,J,G;const g=[];!p.props.tree&&p.props.multiple&&p.props.checkbox&&!o.option._noCheckbox&&g.push(e.h(yt._sfc_main,{unExtendParent:!0,modelValue:n.value,size:m.checkboxSize,disabled:o.option._disabled||p.getDisabled.value}));const f=(R=(s=p.slots).optionLeading)==null?void 0:R.call(s,{...m,option:o.option});return _.isEmptyElement(f)?p.props.tagRenderMode==="avatar"&&p.props.showTriggerTagOnOption?g.push(e.h(be._sfc_main,{size:m.avatarSize,...((v=(K=p.props).getTagProps)==null?void 0:v.call(K,o.option))??{}})):p.props.tagRenderMode==="go"&&p.props.showTriggerTagOnOption?g.push(e.h(Re._sfc_main,{size:m.iconSize,...((G=(J=p.props).getTagProps)==null?void 0:G.call(J,o.option))??{}})):o.option._icon&&g.push(e.h(Ce._sfc_main,{icon:o.option._icon,size:p.getIconSize.value})):g.push(f),_.isEmptyElement(g)?null:g},F=e.useAttrs(),T=()=>{const m=p.props.tree?void 0:o.option._description,g=(x.isFunction(p.props.getMenuItemProps)?p.props.getMenuItemProps(o.option):p.props.getMenuItemProps)??{};return e.h(Me._sfc_main$1,{unExtendParent:!0,class:r.getBemElement(E,"option"),unFocusable:!0,staticStyle:p.props.tree,description:m,title:o.option._label,key:o.option._key,selected:n.value,leadingCenter:!!m,size:p.getSize.value,disabled:p.props.tree?!1:o.option._disabled||p.getDisabled.value,onClick:()=>p.selectOption(o.option),slotProps:o,...g,...F},{leading:k,trailing:p.slots.optionTrailing,title:p.slots.optionTitle,description:p.slots.optionDescription})};return(m,g)=>(e.openBlock(),e.createBlock(T))}}),Bt=e.defineComponent({...r.getComponentOptions("ComboboxLabel"),__name:"ComboboxLabel",props:{label:{}},setup(S){return(o,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"label"))},e.toDisplayString(S.label),3))}}),Ke=e.defineComponent({...r.getComponentOptions("Combobox"),__name:"Combobox",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean,default:!0},resetSearchTermOnSelect:{type:Boolean,default:!1},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean,default:!0},tagRenderMode:{default:"chip"},getTagProps:{},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean],default:"tabler:chevron-down"},selectedItemIconAsTrailingIcon:{type:Boolean,default:!0},maxCount:{},to:{},placeholder:{},indicatorIcon:{default:"tabler:check"},options:{},getDisabled:{},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{},getSingle:{},getClear:{},getOptions:{},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{default:10},lazyLoading:{type:Boolean},bordered:{type:Boolean,default:!0},clearOnChangeMultiple:{type:Boolean,default:!0},triggerCls:{type:[Array,Object,String,Number,null,Boolean]},triggerLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentPlaceholderCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentValueCls:{type:[Array,Object,String,Number,null,Boolean]},triggerTrailingCls:{type:[Array,Object,String,Number,null,Boolean]},itemLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},optionCls:{type:[Array,Object,String,Number,null,Boolean]},tagCls:{type:[Array,Object,String,Number,null,Boolean]},popupCls:{type:[Array,Object,String,Number,null,Boolean]},labelCls:{type:[Array,Object,String,Number,null,Boolean]},optionsCls:{type:[Array,Object,String,Number,null,Boolean]},optionTextCls:{type:[Array,Object,String,Number,null,Boolean]},optionContentCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},skeletonCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean,default:!0},popupHeight:{default:384},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean,default:!0},getMenuItemProps:{},placement:{default:"bottom-start"},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},sideOffset:{default:4},alignOffset:{},reference:{},prioritizePosition:{type:Boolean,default:!1},avoidCollisions:{type:Boolean,default:void 0},dir:{},noTrigger:{type:Boolean}},emits:["update:modelValue","update:expandedKeys","keydownEnter","keydownEscape","update:search","fetch","search","select","update:open","escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(S,{expose:o,emit:p}){const n=S,k=p,F=()=>{var t,l;n.tree&&(((t=n.filterOptions)==null?void 0:t.expandParent)==="collapse"?K([]):((l=n.filterOptions)==null?void 0:l.expandParent)==="expand"&&K(V.value.filter(a=>a._hasChildren).map(a=>a._key)))},T=x.debounce(t=>{k("search",t),F()},500),m=_.useVModel(n,"search",k,{passive:n.search===void 0,onChange:T}),g=Ne.refDebounced(m,500),f=_.useVModel(n,"open",k,{defaultValue:n.defaultOpen,passive:n.open===void 0,onChange(t){!t&&n.resetSearchTermOnBlur&&(m.value=void 0)}}),s=_.useVModel(n,"modelValue",k,{passive:n.modelValue===void 0,onChange:()=>{var t,l;f.value&&!n.multiple&&(f.value=!1),N!=null&&N.value&&n.sortSelectedItems&&((l=(t=N==null?void 0:N.value)==null?void 0:t.measure)==null||l.call(t)),n.resetSearchTermOnSelect&&(m.value=void 0)}}),R=_.useVModel(n,"expandedKeys",k,{passive:n.expandedKeys===void 0}),K=x.debounce(t=>{R.value=t},500,{edges:["leading"]}),v=e.useSlots(),J=_e.useEmitAsProps(k),G=e.computed(()=>({...x.omit(J,["update:modelValue","update:search","select"]),...x.pick(n,["placement","reversePlacementOnDir","zIndex","to","sideOffset","alignOffset","reference","prioritizePosition","avoidCollisions","dir","size","noTrigger"])})),Z=e.ref();_.useLazyLoading({target:Z});const re=r.createOptionGetterFunc({key:"value",getter:n.getValue}),ee={getDisabled:r.createOptionGetterFunc({key:"disabled",getter:n.getDisabled,noReturnOption:!0,defaultValue:!1}),getDescription:r.createOptionGetterFunc({key:"description",getter:n.getDescription,noReturnOption:!0}),getValue:re,getLabel:r.createOptionGetterFunc({key:"label",getter:n.getLabel,noReturnOption:!0,defaultValue:re}),getNoCheckbox:r.createOptionGetterFunc({key:"noCheckbox",getter:n.getNoCheckbox,noReturnOption:!0,defaultValue:!1}),getSingle:r.createOptionGetterFunc({key:"single",getter:n.getSingle,noReturnOption:!0,defaultValue:!1}),getClear:r.createOptionGetterFunc({key:"clear",getter:n.getClear,noReturnOption:!0,defaultValue:!1}),getOptions:r.createOptionGetterFunc({key:"options",getter:n.getOptions,noReturnOption:!0}),getIcon:r.createOptionGetterFunc({key:"icon",getter:n.getIcon,noReturnOption:!0})},i=(t,l)=>{var u;const a=`get${l[0].toUpperCase()+l.slice(1)}`;return(u=ee[a])==null?void 0:u.call(ee,t)},C=(t,l,a)=>!!(!n.tree&&!(l!=null&&l.length)&&(a!=null&&a.length)),y=e.computed(()=>ye.flattenByParentKeys({getValue:(t,l,a)=>{const u=i(t,"value");return r.isEmptyLikeLodash(u)&&C(t,l,a)?r.usePCId(he):u},getDisabled:t=>i(t,"disabled"),arr:n.options??[],getChildren:(t,l)=>{if(!(l!=null&&l.length&&!n.tree))return i(t,"options")},getExtra:(t,l)=>{if(l){let a=i(l,"label");return r.isEmptyLikeLodash(a)||(a=String(a)),{_description:i(l,"description"),_label:a,_title:n.tree?a:void 0,_noCheckbox:i(l,"noCheckbox"),_single:i(l,"single"),_clear:i(l,"clear"),_icon:i(l,"icon"),_id:r.getBemElement(E,t)}}},allowNoValidKey:C})),h=(t,l=!1)=>t?y.value.filter(a=>{var u;if(l){const B=x.last(a._parentKeys??[]);return B&&B===t}return(u=a._parentKeys)==null?void 0:u.includes(t)}):[],w=t=>{var l;if((l=y.value)!=null&&l.length&&!r.isEmptyLikeLodash(t))return y.value.find(a=>a._key===t)},D=t=>{const l=w(t);return l&&(l._label||l._key)||t},te=t=>{const l=w(t);return l?l._single??!1:!1},Q=t=>t===void 0?!1:Array.isArray(s.value)?!!(t&&s.value.includes(t)):s.value===t,V=e.computed(()=>{var u,B;let t=[];const l=new Set,a=c=>{c!=null&&c._key&&!l.has(c._key)&&(t.push(x.cloneDeep(c)),l.add(c._key))};if(g.value?(y.value.forEach(c=>{var b,A;if(c._label&&c._label.toLowerCase().includes(g.value.toLowerCase())&&!l.has(c._key)){if(a(c),c._hasChildren&&h(c._key).forEach(a),(b=n.filterOptions)!=null&&b.strictNode)c._parentKeys&&c._parentKeys.forEach(d=>{if(!l.has(d)){const U=w(d);a(U)}});else if((A=c._parentKeys)!=null&&A.length){const d=Ae.head(c._parentKeys);if(!r.isEmptyLikeLodash(d)){if(!l.has(d)){const H=w(d);a(H)}h(d).forEach(a)}}}}),t=t.sort((c,L)=>y.value.findIndex(b=>b._key===c._key)-y.value.findIndex(b=>b._key===L._key))):t=x.cloneDeep(y.value),n.sortSelectedItems&&!n.tree&&!r.isEmptyLikeLodash(s.value)){let c=x.cloneDeep(t);const L=c.filter(P=>Q(P._key)),b=Symbol("root"),A=Symbol("rootGroup"),d={},U=(P,M,I=1)=>{const q=c.splice(P,I);c.splice(M,0,...q)},H=P=>P?c.findIndex(M=>M._key===P):-1,ue=P=>{const M=d[P],I=H(M==null?void 0:M.key);return M!=null&&M.length?I+M.length+1:I+1};L.forEach(P=>{var M;if((M=P._parentKeys)!=null&&M.length){const I=Ae.head(P._parentKeys);let q=H(I);const we=Math.max(ue(b),ue(A));if(q>we){const ce=h(I).length;U(q,we,ce+1)}if(d[A]={key:I,length:h(I).length},q=H(I),I&&q>-1){const ce=H(P._key);if(d[I]===void 0)U(ce,q+1);else{const pt=ue(I);U(ce,pt)}d[I]={length:void 0,key:P._key}}}else{const I=H(P._key),q=ue(b);I>q&&U(I,q),d[b]={key:P._key,length:P._hasChildren?h(P._key).length:void 0}}c=x.cloneDeep(c)}),t=c}if(!n.tree){const c=x.cloneDeep(t);for(let L=0;L<c.length-1;L++){const b=c[L],A=c[L+1];!A._divider&&(A._hasChildren||(u=b._parentKeys)!=null&&u.length&&!((B=A._parentKeys)!=null&&B.length))&&(c.splice(L+1,0,{_key:r.usePCId(he),_divider:!0,_id:r.usePCId(he)}),L++)}t=c}return t});F();const{getDisabled:$,getStatus:xe,getSize:z}=_.useFormInput({defaults:{size:"md"},exports:["getDisabled","getSize","getStatus"]}),X=e.computed(()=>{switch(z.value){case"sm":return"xsm";case"lg":return"md";case"md":default:return"sm"}}),ge=e.computed(()=>{switch(z.value){case"sm":return"2xsm";case"lg":return"sm";case"md":default:return"xsm"}}),ae=e.ref(),se={sm:4,md:6,lg:8},oe={sm:14,md:16},ne={sm:32,md:50,lg:54},me=e.computed(()=>({get count(){return V.value.length},getScrollElement:()=>{var t;return(t=ae.value)==null?void 0:t.container.viewportElement},estimateSize:t=>{const l=V.value[t];if(!n.tree&&l){if(l._divider)return 1;if(l._label&&l._hasChildren)return 8+(oe[z.value]??oe.md);if(l._description)return ne[z.value]??ne.md}return ze.systemSizesMap[z.value]??ze.systemSizesMap.md},overscan:5,get gap(){return se[z.value]??0}}));let N,W;if(n.virtual){const{virtualizer:t,...l}=_.useVirtualScroll(me);N=t,W=l}const Ge=e.computed(()=>{var t;return n.virtual?(((t=N==null?void 0:N.value)==null?void 0:t.getVirtualItems())??[]).map(l=>V.value[l.index]):V.value}),$e=e.computed(()=>(W==null?void 0:W.containerStyles.value)??{}),{inputBindings:We,rootBindings:Ue,focused:He}=_.useInputDataStates({getDisabled:()=>$.value}),Y=e.ref(),fe=()=>{var t;if(f.value&&Y.value&&document.activeElement!==((t=Y.value)==null?void 0:t.input)){Y.value.input.style.pointerEvents="auto";const l=setTimeout(()=>{var a,u;(u=(a=Y.value)==null?void 0:a.focus)==null||u.call(a),clearTimeout(l)},100);Y.value.input.style.pointerEvents=""}},Be=e.computed(()=>!n.noValueOnPlaceholder&&(j.isArray(s.value)?s.value.length===1&&!r.isEmptyLikeLodash(s.value[0]):!r.isEmptyLikeLodash(s.value))),Je=e.computed(()=>{if(Be.value){if(n.multiple&&j.isArray(s.value))return D(x.last(s.value));if(!n.multiple&&!j.isArray(s.value))return D(s.value)}}),{CollectionSlot:Qe,CollectionItem:Se,itemMap:Xe,getItems:Oe}=_.useCollection({isProvider:!0,key:E}),Ee=()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[],O=e.ref(),ve=t=>{O.value=t},Pe=t=>({"data-disabled":t._disabled?"":void 0,"data-highlighted":O.value===t._key?"":void 0}),le=e.ref(),Ie=(t,l)=>{var a,u;if(l&&((a=le.value)!=null&&a.onSelect)&&n.tree&&((u=le.value)==null||u.onSelect(t,!Q(t==null?void 0:t._key))),!(n.tree||!t||!t._key||t._disabled))if(n.multiple)if(t._clear)s.value=[],k("select",void 0,!1);else if(t._single)s.value=[t._key],k("select",t._key,!0,t);else{let B=j.isArray(s.value)?s.value:[];const c=B.includes(t._key);B.length===1&&te(B[0])&&t._key!==B[0]&&(B=[]),c?(s.value=B.filter(L=>L!==t._key),k("select",t._key,!0,t)):(s.value=[...B,t._key],k("select",t._key,!1,t))}else t._clear?(s.value=void 0,k("select",void 0,!1)):(s.value=t._key,k("select",t._key,!0,t))},{getDir:Ye}=_t.useConfig(),ie=Ye(),Ve={props:n,emit:k,onKeyDown:t=>{var l,a,u,B,c,L;if(n.headerSearch||t.stopPropagation(),t.key==="Backspace"&&n.multiple&&j.isArray(s.value)&&r.isEmptyLikeLodash(m.value))s.value=s.value.slice(0,-1);else if(!f.value)(t.key==="ArrowDown"||t.key==="Enter")&&(f.value=!0);else if(f.value){const b=Oe(n.tree);if(t.key==="Escape")t.preventDefault(),t.stopPropagation(),f.value=!1;else if(t.key==="Tab"&&!n.headerSearch)f.value=!1;else if(["ArrowDown","ArrowUp"].includes(t.key)){if(b.length){const A=b.findIndex(d=>O.value&&d.value&&d.value===O.value);if(t.key==="ArrowDown"){const d=b[A+1];O.value=(d==null?void 0:d.value)??O.value??b[0].value}else if(t.key==="ArrowUp"){const d=b[A-1];O.value=(d==null?void 0:d.value)??b[0].value}(a=(l=b.find(d=>O.value&&d.value&&d.value===O.value))==null?void 0:l.ref)==null||a.scrollIntoView()}}else if(["ArrowLeft","ArrowRight"].includes(t.key)){const A=w(O.value);b.length&&le.value&&n.tree&&O.value&&A&&((u=R.value)!=null&&u.includes(O.value)&&(ie.value==="ltr"&&t.key==="ArrowLeft"||ie.value==="rtl"&&t.key==="ArrowRight")||!((B=R.value)!=null&&B.includes(O.value))&&(ie.value==="ltr"&&t.key==="ArrowRight"||ie.value==="rtl"&&t.key==="ArrowLeft"))&&((L=(c=le.value).onExpandKey)==null||L.call(c,A))}else t.key==="Enter"&&(b.length===1&&b[0].value&&O.value!==b[0].value&&(O.value=b[0].value),O.value&&Ie(w(O.value),!0),k("keydownEnter",t,m.value));t.key==="Escape"&&k("keydownEscape",t)}},searchModel:m,openModel:f,model:s,slots:v,valuePlaceholder:Be,placeholder:Je,getOptionByValue:w,isOptionSelected:Q,getLabelByValue:D,getSingleByValue:te,inputRef:Y,focusOnInput:fe,getDisabled:$,getStatus:xe,getSize:z,getTagSize:X,getIconSize:ge,comboboxInputBinding:We,comboboxTriggerBinding:Ue,comboboxInputFocused:He,selectOption:Ie,itemMap:Xe,getItems:Oe,highlightedOptionKey:O};qe(Ve),e.watch(()=>[n.clearOnChangeMultiple,n.multiple],()=>{n.clearOnChangeMultiple&&(s.value=void 0)});const Ze=e.computed(()=>({defaultExpandAll:!0,showLine:!0,disabled:$.value,selectionBehavior:"replace",...n.treeProps??{},size:z.value,flattenData:!0,outerVirtualScroll:!0,selectable:!0,focusable:!1,multiple:n.multiple,checkable:n.multiple&&n.checkbox,virtual:N,syncCheckboxAndSelect:n.multiple,data:V.value,modelValue:Ee(),checkedKeys:Ee(),class:r.getBemElement(E,"tree")})),et=e.computed(()=>{const t=n.scrollContainerProps??{};return{...t,areaCls:[r.getBemElement(E,"scroll_area"),t==null?void 0:t.class,t==null?void 0:t.areaCls],wrapProps:{...(t==null?void 0:t.wrapProps)??{},style:(W==null?void 0:W.scrollWrapperStyles.value)??{}}}}),Le=r.getBemElement(E,"popup"),tt=De.cva(Le,{variants:{size:r.generateVariantClassList(ke,Le)}}),ot=e.computed(()=>r.getPxSize(n.popupWidth,!0)),nt=e.computed(()=>r.getPxSize(n.popupHeight,!0)),lt=e.computed(()=>r.getPxSize(n.minWidth,!0)),rt=()=>{var a,u;const t=(u=v.header)==null?void 0:u.call(v,{isEmpty:!((a=V.value)!=null&&a.length),search:m.value}),l=!_.isEmptyElement(t);if(l||n.headerSearch)return e.h("div",{class:r.getBemElement(E,"header")},l?t:e.h(de,n.headerSearchInputProps||{}))},at=()=>{var a,u;const t=(u=v.footer)==null?void 0:u.call(v,{isEmpty:!((a=V.value)!=null&&a.length),search:m.value});if(!_.isEmptyElement(t))return e.h("div",{class:r.getBemElement(E,"footer")},t)},st=()=>{var a;const t={type:z.value==="sm"?"simple":"advance",...x.omit(n.emptyProps??{},["class"]),class:r.normCls(r.getBemElement(E,"empty"),n.emptyCls)},l=(a=v.empty)==null?void 0:a.call(v,t);return _.isEmptyElement(l)?e.h(kt._sfc_main,t,{title:v.emptyTitle,description:v.emptyDescription,actions:v.emptyActions,image:v.emptyImage}):l},it=()=>{var a;const t=(a=v.loading)==null?void 0:a.call(v,{});return _.isEmptyElement(t)?new Array(V.value.length?2:n.loadingRowCount).fill(1).map(()=>e.h(ht._sfc_main,{size:z.value,class:r.normCls(r.getBemElement(E,"skeleton"),n.skeletonCls),...x.omit(n.skeletonProps??{},["class"])})):t},ut=(t,l,a)=>{const u=t._clear;if(n.multiple){const B=t._single;u?s.value=[]:B?s.value=[t._key]:s.value=a}else u||!l?s.value=void 0:s.value=t._key;k("select",t._key,l,t)},ct=t=>{t.key==="ArrowDown"&&!f.value?f.value=!0:t.key==="Tab"&&f.value&&(f.value=!1)};return n.disableOutsidePointerEvents&&_.useDisableBodyPointerEvents(f),o(Ve),(t,l)=>(e.openBlock(),e.createBlock(e.unref(dt.Popover),e.mergeProps({open:e.unref(f),"onUpdate:open":l[2]||(l[2]=a=>e.isRef(f)?f.value=a:null)},G.value,{containerProps:{...S.containerProps??{},onClick:fe},noPadding:!0,size:e.unref(z),containerStyle:{pointerEvents:"auto",display:e.unref(f)?void 0:"none",zIndex:S.zIndex,"--ptc-combobox-popup-width":S.samePopupWidth?void 0:ot.value,"--ptc-combobox-popup-height":nt.value,"--ptc-combobox-trigger-min-w":lt.value},containerCls:e.unref(r.normCls)(e.unref(tt)({size:e.unref(z)}),S.popupCls),onKeydown:ct}),{default:e.withCtx(()=>[e.createVNode(xt)]),content:e.withCtx(()=>[e.createVNode(rt),e.createVNode(e.unref(Ct._sfc_main),e.mergeProps({ref_key:"scrollContainerRef",ref:ae},et.value),{default:e.withCtx(()=>[V.value.length||S.loading?(e.openBlock(),e.createBlock(e.unref(Qe),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(E),"options"),S.optionsCls)),style:e.normalizeStyle(S.virtual?$e.value:{}),onPointerleave:l[1]||(l[1]=a=>ve(void 0))},[S.tree?(e.openBlock(),e.createBlock(e.unref(ye._sfc_main),e.mergeProps({key:0,ref_key:"treeRef",ref:le},Ze.value,{expandedKeys:e.unref(R),"onUpdate:expandedKeys":l[0]||(l[0]=a=>e.isRef(R)?R.value=a:null),onExpand:fe,onSelect:ut}),{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,u=>(e.openBlock(),e.createBlock(e.unref(Se),{key:u._key,value:u._key,id:u._id},{default:e.withCtx(()=>[e.createVNode(e.unref(ye._sfc_main$1),e.mergeProps({node:u},{ref_for:!0},Pe(u),{onPointermove:B=>ve(u._key),id:u._id}),{default:e.withCtx(()=>[e.createVNode(Te,{option:u},null,8,["option"])]),_:2},1040,["node","onPointermove","id"])]),_:2},1032,["value","id"]))),128))]),_:1},16,["expandedKeys"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ge.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a._key},[a._divider?(e.openBlock(),e.createBlock(bt._sfc_main,{key:0})):a._label&&a._hasChildren?(e.openBlock(),e.createBlock(Bt,{key:1,label:a._label},null,8,["label"])):a._hasChildren?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Se),{key:2,value:a._key,id:a._id},{default:e.withCtx(()=>[e.createVNode(Te,e.mergeProps({option:a},{ref_for:!0},Pe(a),{onPointermove:u=>ve(a._key),id:a._id}),null,16,["option","onPointermove","id"])]),_:2},1032,["value","id"]))],64))),128)),S.loading?(e.openBlock(),e.createBlock(it,{key:2})):e.createCommentVNode("",!0)],38)]),_:1})):(e.openBlock(),e.createBlock(st,{key:1})),S.lazyLoading?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"lazy_loading"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"lazy_loading_trigger")),ref_key:"target",ref:Z},null,2)],2)):e.createCommentVNode("",!0)]),_:1},16),e.createVNode(at)]),_:1},16,["open","containerProps","size","containerStyle","containerCls"]))}}),St=_.installComponent(Ke,r.getComponentName("Combobox")),Ot=_.installComponent(de,r.getComponentName("ComboboxInput"));exports.Combobox=Ke;exports.ComboboxInput=de;exports.ComboboxInputPlugin=Ot;exports.ComboboxPlugin=St;exports.ComboboxSizes=ke;exports.ComboboxStatuses=je;exports.injectComboboxContext=pe;exports.provideComboboxContext=qe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_e=require("reka-ui"),x=require("es-toolkit"),_=require("@pantograph/utils-vue"),r=require("@pantograph/utils"),dt=require("../Popover/index.umd.cjs"),De=require("class-variance-authority");require("../Icon/index.umd.cjs");require("../Avatar/index.umd.cjs");require("../GraphicalObject/index.umd.cjs");const be=require("../Avatar.vue_vue_type_style_index_0_lang-mKlk9pzA.js"),gt=require("../GraphicalObjectGroup/index.umd.cjs"),mt=require("../index-BUzezp9o.js"),ft=require("../Chip.vue_vue_type_style_index_0_lang-BguWH1di.js");require("../Input/index.umd.cjs");const Ne=require("@vueuse/core"),vt=require("../Input.vue_vue_type_script_setup_true_lang-BfK5xqDA.js"),Ce=require("../Icon.vue_vue_type_style_index_0_lang-v3QUxO-v.js"),Me=require("../Menu.vue_vue_type_style_index_0_lang-0Iq18-ro.js"),j=require("../isArray-Bin_5of_.js"),Re=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-DChtamWZ.js");require("../ScrollContainer/index.umd.cjs");require("../Empty/index.umd.cjs");const ye=require("../index-B2rTP8gs.js");require("../MenuItem/index.umd.cjs");require("../Checkbox/index.umd.cjs");const yt=require("../Checkbox.vue_vue_type_style_index_0_lang-DDa0cjqA.js"),ht=require("../Skeleton.vue_vue_type_style_index_0_lang-oMsTff2I.js"),bt=require("../Divider.vue_vue_type_style_index_0_lang-Heq87yk1.js"),ze=require("../index-4j_iV_pN.js"),_t=require("../ConfigProvider/index.umd.cjs"),Ae=require("../head-Bg_QoIT5.js"),Ct=require("../ScrollContainer.vue_vue_type_style_index_0_lang-XfGedoBb.js"),kt=require("../Empty.vue_vue_type_style_index_0_lang-Cvh6hCth.js"),[pe,qe]=_e.createContext("Combobox"),E=r.getBemBlock("combobox"),Fe=r.getBemModifier(E,"value-placeholder"),he=r.getBemElement(E,"option"),ke=["sm","md","lg"],je=["error","warning","success"],de=e.defineComponent({...r.getComponentOptions("ComboboxInput"),__name:"ComboboxInput",props:{id:{},maxlength:{},type:{},placeholder:{},disabled:{type:Boolean,default:void 0},required:{type:Boolean},readonly:{type:Boolean},contentFit:{type:Boolean},modelValue:{},defaultValue:{},immediateFocus:{type:Boolean},leading:{},trailing:{},clearIcon:{},trailingCls:{type:[Array,Object,String,Number,null,Boolean]},clearIconCls:{type:[Array,Object,String,Number,null,Boolean]},dividerCls:{type:[Array,Object,String,Number,null,Boolean]},leadingCls:{type:[Array,Object,String,Number,null,Boolean]},class:{type:[Array,Object,String,Number,null,Boolean]},allowClear:{type:Boolean},bordered:{type:Boolean,default:void 0},simple:{type:Boolean},size:{},status:{},steps:{type:Boolean}},setup(S){const o=S,p=e.useSlots(),n=pe();Ne.whenever(()=>n.openModel.value&&n.inputRef.value,n.focusOnInput),e.onBeforeUnmount(()=>{n.comboboxInputFocused.value=!1});const k=e.computed(()=>{const T=o.placeholder??n.props.placeholder??"";return(n.props.headerSearch?T:n.placeholder.value)??T}),F=r.getBemElement(E,"input");return(T,m)=>(e.openBlock(),e.createBlock(e.unref(vt._sfc_main),e.mergeProps({...e.unref(n).comboboxInputBinding.value,...o,disabled:e.unref(n).getDisabled.value||o.disabled},{placeholder:k.value,onKeydown:e.unref(n).onKeyDown,ref:e.unref(n).inputRef,class:e.unref(r.normCls)(e.unref(F),{[e.unref(Fe)]:e.unref(n).valuePlaceholder.value},o.class),contentFit:!e.unref(n).props.headerSearch&&e.unref(n).props.contentFit,modelValue:e.unref(n).searchModel.value,"onUpdate:modelValue":m[0]||(m[0]=g=>e.unref(n).searchModel.value=g)}),e.createSlots({_:2},[e.renderList(Object.keys(e.unref(x.omit)(p,["leading"])),g=>({name:g,fn:e.withCtx(f=>[e.renderSlot(T.$slots,g,e.normalizeProps(e.guardReactiveProps(f)))])})),e.unref(n).props.headerSearch?{name:"leading",fn:e.withCtx(g=>[e.renderSlot(T.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)),()=>[e.createVNode(e.unref(Ce._sfc_main),{size:g.iconSize,icon:"tabler:search",flipOnDir:"rtl"},null,8,["size"])])]),key:"0"}:{name:"leading",fn:e.withCtx(g=>[e.renderSlot(T.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)))]),key:"1"}]),1040,["placeholder","onKeydown","class","contentFit","modelValue"]))}}),xt=e.defineComponent({...r.getComponentOptions("ComboboxTrigger"),__name:"ComboboxTrigger",setup(S){const o=pe(),p=({value:i})=>{i&&j.isArray(o.model.value)&&!o.getDisabled.value&&(o.model.value=o.model.value.filter(C=>C!==i))},n=e.computed(()=>{switch(o.getSize.value){case"sm":return"2xsm";case"md":default:return"xsm"}}),k=e.computed(()=>{if(!o.props.multiple&&x.isString(o.model.value)&&!r.isEmptyLikeLodash(o.model.value))return o.getOptionByValue(o.model.value)}),F=(i=k.value)=>{if(o.props.selectedItemIconAsTrailingIcon&&(i!=null&&i._icon))return i._icon},T=e.computed(()=>F()),m=e.computed(()=>{if(!o.props.noTrailing)return o.props.trailingIcon??"tabler:chevron-down"}),g=e.computed(()=>{var y,h;const i=x.cloneDeep(o.model.value),C=j.isArray(o.model.value);return{modelValue:i,open:x.cloneDeep(o.openModel.value),option:C?void 0:o.getOptionByValue(o.model.value),options:C?(h=(y=o.model.value).map)==null?void 0:h.call(y,o.getOptionByValue).filter(Boolean):void 0}}),f=i=>({...g.value,option:o.getOptionByValue(i)}),s=r.getBemElement(E,"trigger"),R=De.cva(s,{variants:{size:r.generateVariantClassList(ke,s),headerSearch:r.generateVariantClassList("header-search",s),status:r.generateVariantClassList(je,s),bordered:r.generateVariantClassList("bordered",s),multiple:r.generateVariantClassList("multiple",s),contentFit:r.generateVariantClassList("content-fit",s),wrapped:r.generateVariantClassList("wrapped",s),filled:r.generateVariantClassList("filled",s)}}),K=e.computed(()=>({type:"button",disabled:o.getDisabled.value,tabindex:o.getDisabled.value||!o.props.headerSearch?-1:0,"data-disabled":o.getDisabled.value?"":void 0,"aria-disabled":o.getDisabled.value??void 0,"aria-label":"Show popup","aria-haspopup":"listbox","aria-expanded":o.openModel.value,"data-state":o.openModel.value?"open":"closed",class:r.normCls(R({size:o.getSize.value,status:o.getStatus.value==="success"&&r.isEmptyLikeLodash(o.model.value)?void 0:o.getStatus.value,bordered:o.props.bordered,multiple:o.props.multiple,contentFit:o.props.contentFit,wrapped:o.props.wrapped,filled:!r.isEmptyLikeLodash(o.model.value),headerSearch:o.props.headerSearch}),o.props.triggerCls),...o.comboboxTriggerBinding.value})),v=(i,C=n.value)=>e.h(Ce._sfc_main,{icon:i,size:C}),J=()=>{var y,h;let i;const C=(h=(y=o.slots).triggerTrailing)==null?void 0:h.call(y,g.value);if(!_.isEmptyElement(C))i=C;else if(m.value&&m.value){const w=m.value===!0?"tabler:chevron-down":m.value;i=v(w)}if(i)return e.h("div",{class:r.normCls(r.getBemElement(s,"trailing"),o.props.triggerTrailingCls)},i)},G=i=>{var y,h;const C=o.getOptionByValue(i)??{_key:i};return e.h(be._sfc_main,{size:o.getTagSize.value,...C?((h=(y=o.props).getTagProps)==null?void 0:h.call(y,C))??{}:{}})},Z=i=>{var y,h;const C=o.getOptionByValue(i)??{_key:i};return e.h(Re._sfc_main,{...C?((h=(y=o.props).getTagProps)==null?void 0:h.call(y,C))??{}:{},size:o.getTagSize.value})},re=()=>{var i,C;if(!o.props.multiple&&!j.isArray(o.model.value)&&o.model.value){let y;x.isString(o.model.value)&&!r.isEmptyLikeLodash(o.model.value)&&(y=o.model.value);const h=y?(C=(i=o.slots).optionLeading)==null?void 0:C.call(i,Me.getMenuContentSlotProps(o.props.size,f(y))):null,w=!_.isEmptyElement(h);if(w||o.props.tagRenderMode&&["avatar","go"].includes(o.props.tagRenderMode)||T.value||o.props.leadingIcon){let D;if(w?D=h:o.props.tagRenderMode==="avatar"?D=G(o.model.value):o.props.tagRenderMode==="go"?D=Z(o.model.value):T.value?D=v(T.value):o.props.leadingIcon&&(D=v(o.props.leadingIcon)),!_.isEmptyElement(D))return e.h("div",{class:r.normCls(r.getBemElement(s,"leading"),o.props.triggerLeadingCls)},D)}}},ee=()=>{var te,Q;const i=(Q=(te=o.slots).trigger)==null?void 0:Q.call(te,g.value);if(!_.isEmptyElement(i))return e.h(_e.Slot,x.omit(K.value,["class"]),()=>i);const y=()=>{const V=[],$=[r.getBemElement(s,"tags"),o.props.triggerContentCls,o.props.triggerContentValueCls],z=(()=>{if(o.props.multiple&&j.isArray(o.model.value)){if(o.props.tagRenderMode==="avatar")return e.h(be._sfc_main$1,{maxCount:o.props.maxCount,size:o.getTagSize.value,closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$},()=>o.model.value.map(G));if(o.props.tagRenderMode==="go")return e.h(gt.GraphicalObjectGroup,{maxCount:o.props.maxCount,size:o.getTagSize.value,closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$},()=>o.model.value.map(Z));if(o.props.tagRenderMode==="chip")return e.h(mt._sfc_main,{maxCount:o.props.maxCount,size:o.getTagSize.value,color:"primary",closeable:!o.getDisabled.value,noPopover:!0,noWrap:!o.props.wrapped,class:$,onClose:p},()=>o.model.value.map(X=>{var oe,ne;const ge=()=>o.getLabelByValue(X),ae=({size:me})=>{const N=F(o.getOptionByValue(X))??o.props.leadingIcon;return N?v(N,me):null},se=o.getOptionByValue(X);return e.h(ft._sfc_main,{...se?((ne=(oe=o.props).getTagProps)==null?void 0:ne.call(oe,se))??{}:{},value:X,class:r.normCls(r.getBemElement(s,"tag"),o.props.tagCls),closeIconCls:r.getBemElement(s,"tag__close")},{text:ge,leading:ae})}))}})();if(z&&V.push(z),o.props.headerSearch?(!o.props.noValueOnPlaceholder||o.props.placeholder)&&V.push(e.h("div",{class:r.normCls(r.getBemElement(s,"content__value"),{[Fe]:o.valuePlaceholder.value})},o.placeholder.value??o.props.placeholder)):V.push(e.h(de,{noValueOnPlaceholder:o.props.noValueOnPlaceholder,searchIcon:!1,bordered:!1,simple:!0})),!_.isEmptyElement(V)||!o.props.contentFit||o.props.trailingIcon)return e.h("div",{class:r.getBemElement(s,"content")},V)},h=[],w=re();_.isEmptyElement(w)||h.push(w),h.push(y());const D=J();return _.isEmptyElement(D)||h.push(D),e.h("button",K.value,h)};return(i,C)=>(e.openBlock(),e.createBlock(ee))}}),Te=e.defineComponent({...r.getComponentOptions("ComboboxOption"),__name:"ComboboxOption",props:{option:{}},setup(S){const o=S,p=pe(),n=e.computed(()=>p.isOptionSelected(o.option._key)),k=m=>{var s,R,K,v,J,G;const g=[];!p.props.tree&&p.props.multiple&&p.props.checkbox&&!o.option._noCheckbox&&g.push(e.h(yt._sfc_main,{unExtendParent:!0,modelValue:n.value,size:m.checkboxSize,disabled:o.option._disabled||p.getDisabled.value}));const f=(R=(s=p.slots).optionLeading)==null?void 0:R.call(s,{...m,option:o.option});return _.isEmptyElement(f)?p.props.tagRenderMode==="avatar"&&p.props.showTriggerTagOnOption?g.push(e.h(be._sfc_main,{size:m.avatarSize,...((v=(K=p.props).getTagProps)==null?void 0:v.call(K,o.option))??{}})):p.props.tagRenderMode==="go"&&p.props.showTriggerTagOnOption?g.push(e.h(Re._sfc_main,{size:m.iconSize,...((G=(J=p.props).getTagProps)==null?void 0:G.call(J,o.option))??{}})):o.option._icon&&g.push(e.h(Ce._sfc_main,{icon:o.option._icon,size:p.getIconSize.value})):g.push(f),_.isEmptyElement(g)?null:g},F=e.useAttrs(),T=()=>{const m=p.props.tree?void 0:o.option._description,g=(x.isFunction(p.props.getMenuItemProps)?p.props.getMenuItemProps(o.option):p.props.getMenuItemProps)??{};return e.h(Me._sfc_main$1,{unExtendParent:!0,class:r.getBemElement(E,"option"),unFocusable:!0,staticStyle:p.props.tree,description:m,title:o.option._label,key:o.option._key,selected:n.value,leadingCenter:!!m,size:p.getSize.value,disabled:p.props.tree?!1:o.option._disabled||p.getDisabled.value,onClick:()=>p.selectOption(o.option),slotProps:o,...g,...F},{leading:k,trailing:p.slots.optionTrailing,title:p.slots.optionTitle,description:p.slots.optionDescription})};return(m,g)=>(e.openBlock(),e.createBlock(T))}}),Bt=e.defineComponent({...r.getComponentOptions("ComboboxLabel"),__name:"ComboboxLabel",props:{label:{}},setup(S){return(o,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"label"))},e.toDisplayString(S.label),3))}}),Ke=e.defineComponent({...r.getComponentOptions("Combobox"),__name:"Combobox",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean,default:!0},resetSearchTermOnSelect:{type:Boolean,default:!1},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean,default:!0},tagRenderMode:{default:"chip"},getTagProps:{},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean],default:"tabler:chevron-down"},selectedItemIconAsTrailingIcon:{type:Boolean,default:!0},maxCount:{},to:{},placeholder:{},indicatorIcon:{default:"tabler:check"},options:{},getDisabled:{},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{},getSingle:{},getClear:{},getOptions:{},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{default:10},lazyLoading:{type:Boolean},bordered:{type:Boolean,default:!0},clearOnChangeMultiple:{type:Boolean,default:!0},triggerCls:{type:[Array,Object,String,Number,null,Boolean]},triggerLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentPlaceholderCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentValueCls:{type:[Array,Object,String,Number,null,Boolean]},triggerTrailingCls:{type:[Array,Object,String,Number,null,Boolean]},itemLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},optionCls:{type:[Array,Object,String,Number,null,Boolean]},tagCls:{type:[Array,Object,String,Number,null,Boolean]},popupCls:{type:[Array,Object,String,Number,null,Boolean]},labelCls:{type:[Array,Object,String,Number,null,Boolean]},optionsCls:{type:[Array,Object,String,Number,null,Boolean]},optionTextCls:{type:[Array,Object,String,Number,null,Boolean]},optionContentCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},skeletonCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean,default:!0},popupHeight:{default:384},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean,default:!0},getMenuItemProps:{},placement:{default:"bottom-start"},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},sideOffset:{default:4},alignOffset:{},reference:{},prioritizePosition:{type:Boolean,default:!1},avoidCollisions:{type:Boolean,default:void 0},dir:{},noTrigger:{type:Boolean}},emits:["update:modelValue","update:expandedKeys","keydownEnter","keydownEscape","update:search","fetch","search","select","update:open","escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus","openChange"],setup(S,{expose:o,emit:p}){const n=S,k=p,F=()=>{var t,l;n.tree&&(((t=n.filterOptions)==null?void 0:t.expandParent)==="collapse"?K([]):((l=n.filterOptions)==null?void 0:l.expandParent)==="expand"&&K(V.value.filter(a=>a._hasChildren).map(a=>a._key)))},T=x.debounce(t=>{k("search",t),F()},500),m=_.useVModel(n,"search",k,{passive:n.search===void 0,onChange:T}),g=Ne.refDebounced(m,500),f=_.useVModel(n,"open",k,{defaultValue:n.defaultOpen,passive:n.open===void 0,onChange(t){!t&&n.resetSearchTermOnBlur&&(m.value=void 0)}}),s=_.useVModel(n,"modelValue",k,{passive:n.modelValue===void 0,onChange:()=>{var t,l;f.value&&!n.multiple&&(f.value=!1),N!=null&&N.value&&n.sortSelectedItems&&((l=(t=N==null?void 0:N.value)==null?void 0:t.measure)==null||l.call(t)),n.resetSearchTermOnSelect&&(m.value=void 0)}}),R=_.useVModel(n,"expandedKeys",k,{passive:n.expandedKeys===void 0}),K=x.debounce(t=>{R.value=t},500,{edges:["leading"]}),v=e.useSlots(),J=_e.useEmitAsProps(k),G=e.computed(()=>({...x.omit(J,["update:modelValue","update:search","select"]),...x.pick(n,["placement","reversePlacementOnDir","zIndex","to","sideOffset","alignOffset","reference","prioritizePosition","avoidCollisions","dir","size","noTrigger"])})),Z=e.ref();_.useLazyLoading({target:Z});const re=r.createOptionGetterFunc({key:"value",getter:n.getValue}),ee={getDisabled:r.createOptionGetterFunc({key:"disabled",getter:n.getDisabled,noReturnOption:!0,defaultValue:!1}),getDescription:r.createOptionGetterFunc({key:"description",getter:n.getDescription,noReturnOption:!0}),getValue:re,getLabel:r.createOptionGetterFunc({key:"label",getter:n.getLabel,noReturnOption:!0,defaultValue:re}),getNoCheckbox:r.createOptionGetterFunc({key:"noCheckbox",getter:n.getNoCheckbox,noReturnOption:!0,defaultValue:!1}),getSingle:r.createOptionGetterFunc({key:"single",getter:n.getSingle,noReturnOption:!0,defaultValue:!1}),getClear:r.createOptionGetterFunc({key:"clear",getter:n.getClear,noReturnOption:!0,defaultValue:!1}),getOptions:r.createOptionGetterFunc({key:"options",getter:n.getOptions,noReturnOption:!0}),getIcon:r.createOptionGetterFunc({key:"icon",getter:n.getIcon,noReturnOption:!0})},i=(t,l)=>{var u;const a=`get${l[0].toUpperCase()+l.slice(1)}`;return(u=ee[a])==null?void 0:u.call(ee,t)},C=(t,l,a)=>!!(!n.tree&&!(l!=null&&l.length)&&(a!=null&&a.length)),y=e.computed(()=>ye.flattenByParentKeys({getValue:(t,l,a)=>{const u=i(t,"value");return r.isEmptyLikeLodash(u)&&C(t,l,a)?r.usePCId(he):u},getDisabled:t=>i(t,"disabled"),arr:n.options??[],getChildren:(t,l)=>{if(!(l!=null&&l.length&&!n.tree))return i(t,"options")},getExtra:(t,l)=>{if(l){let a=i(l,"label");return r.isEmptyLikeLodash(a)||(a=String(a)),{_description:i(l,"description"),_label:a,_title:n.tree?a:void 0,_noCheckbox:i(l,"noCheckbox"),_single:i(l,"single"),_clear:i(l,"clear"),_icon:i(l,"icon"),_id:r.getBemElement(E,t)}}},allowNoValidKey:C})),h=(t,l=!1)=>t?y.value.filter(a=>{var u;if(l){const B=x.last(a._parentKeys??[]);return B&&B===t}return(u=a._parentKeys)==null?void 0:u.includes(t)}):[],w=t=>{var l;if((l=y.value)!=null&&l.length&&!r.isEmptyLikeLodash(t))return y.value.find(a=>a._key===t)},D=t=>{const l=w(t);return l&&(l._label||l._key)||t},te=t=>{const l=w(t);return l?l._single??!1:!1},Q=t=>t===void 0?!1:Array.isArray(s.value)?!!(t&&s.value.includes(t)):s.value===t,V=e.computed(()=>{var u,B;let t=[];const l=new Set,a=c=>{c!=null&&c._key&&!l.has(c._key)&&(t.push(x.cloneDeep(c)),l.add(c._key))};if(g.value?(y.value.forEach(c=>{var b,A;if(c._label&&c._label.toLowerCase().includes(g.value.toLowerCase())&&!l.has(c._key)){if(a(c),c._hasChildren&&h(c._key).forEach(a),(b=n.filterOptions)!=null&&b.strictNode)c._parentKeys&&c._parentKeys.forEach(d=>{if(!l.has(d)){const U=w(d);a(U)}});else if((A=c._parentKeys)!=null&&A.length){const d=Ae.head(c._parentKeys);if(!r.isEmptyLikeLodash(d)){if(!l.has(d)){const H=w(d);a(H)}h(d).forEach(a)}}}}),t=t.sort((c,L)=>y.value.findIndex(b=>b._key===c._key)-y.value.findIndex(b=>b._key===L._key))):t=x.cloneDeep(y.value),n.sortSelectedItems&&!n.tree&&!r.isEmptyLikeLodash(s.value)){let c=x.cloneDeep(t);const L=c.filter(P=>Q(P._key)),b=Symbol("root"),A=Symbol("rootGroup"),d={},U=(P,M,I=1)=>{const q=c.splice(P,I);c.splice(M,0,...q)},H=P=>P?c.findIndex(M=>M._key===P):-1,ue=P=>{const M=d[P],I=H(M==null?void 0:M.key);return M!=null&&M.length?I+M.length+1:I+1};L.forEach(P=>{var M;if((M=P._parentKeys)!=null&&M.length){const I=Ae.head(P._parentKeys);let q=H(I);const we=Math.max(ue(b),ue(A));if(q>we){const ce=h(I).length;U(q,we,ce+1)}if(d[A]={key:I,length:h(I).length},q=H(I),I&&q>-1){const ce=H(P._key);if(d[I]===void 0)U(ce,q+1);else{const pt=ue(I);U(ce,pt)}d[I]={length:void 0,key:P._key}}}else{const I=H(P._key),q=ue(b);I>q&&U(I,q),d[b]={key:P._key,length:P._hasChildren?h(P._key).length:void 0}}c=x.cloneDeep(c)}),t=c}if(!n.tree){const c=x.cloneDeep(t);for(let L=0;L<c.length-1;L++){const b=c[L],A=c[L+1];!A._divider&&(A._hasChildren||(u=b._parentKeys)!=null&&u.length&&!((B=A._parentKeys)!=null&&B.length))&&(c.splice(L+1,0,{_key:r.usePCId(he),_divider:!0,_id:r.usePCId(he)}),L++)}t=c}return t});F();const{getDisabled:$,getStatus:xe,getSize:z}=_.useFormInput({defaults:{size:"md"},exports:["getDisabled","getSize","getStatus"]}),X=e.computed(()=>{switch(z.value){case"sm":return"xsm";case"lg":return"md";case"md":default:return"sm"}}),ge=e.computed(()=>{switch(z.value){case"sm":return"2xsm";case"lg":return"sm";case"md":default:return"xsm"}}),ae=e.ref(),se={sm:4,md:6,lg:8},oe={sm:14,md:16},ne={sm:32,md:50,lg:54},me=e.computed(()=>({get count(){return V.value.length},getScrollElement:()=>{var t;return(t=ae.value)==null?void 0:t.container.viewportElement},estimateSize:t=>{const l=V.value[t];if(!n.tree&&l){if(l._divider)return 1;if(l._label&&l._hasChildren)return 8+(oe[z.value]??oe.md);if(l._description)return ne[z.value]??ne.md}return ze.systemSizesMap[z.value]??ze.systemSizesMap.md},overscan:5,get gap(){return se[z.value]??0}}));let N,W;if(n.virtual){const{virtualizer:t,...l}=_.useVirtualScroll(me);N=t,W=l}const Ge=e.computed(()=>{var t;return n.virtual?(((t=N==null?void 0:N.value)==null?void 0:t.getVirtualItems())??[]).map(l=>V.value[l.index]):V.value}),$e=e.computed(()=>(W==null?void 0:W.containerStyles.value)??{}),{inputBindings:We,rootBindings:Ue,focused:He}=_.useInputDataStates({getDisabled:()=>$.value}),Y=e.ref(),fe=()=>{var t;if(f.value&&Y.value&&document.activeElement!==((t=Y.value)==null?void 0:t.input)){Y.value.input.style.pointerEvents="auto";const l=setTimeout(()=>{var a,u;(u=(a=Y.value)==null?void 0:a.focus)==null||u.call(a),clearTimeout(l)},100);Y.value.input.style.pointerEvents=""}},Be=e.computed(()=>!n.noValueOnPlaceholder&&(j.isArray(s.value)?s.value.length===1&&!r.isEmptyLikeLodash(s.value[0]):!r.isEmptyLikeLodash(s.value))),Je=e.computed(()=>{if(Be.value){if(n.multiple&&j.isArray(s.value))return D(x.last(s.value));if(!n.multiple&&!j.isArray(s.value))return D(s.value)}}),{CollectionSlot:Qe,CollectionItem:Se,itemMap:Xe,getItems:Oe}=_.useCollection({isProvider:!0,key:E}),Ee=()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[],O=e.ref(),ve=t=>{O.value=t},Pe=t=>({"data-disabled":t._disabled?"":void 0,"data-highlighted":O.value===t._key?"":void 0}),le=e.ref(),Ie=(t,l)=>{var a,u;if(l&&((a=le.value)!=null&&a.onSelect)&&n.tree&&((u=le.value)==null||u.onSelect(t,!Q(t==null?void 0:t._key))),!(n.tree||!t||!t._key||t._disabled))if(n.multiple)if(t._clear)s.value=[],k("select",void 0,!1);else if(t._single)s.value=[t._key],k("select",t._key,!0,t);else{let B=j.isArray(s.value)?s.value:[];const c=B.includes(t._key);B.length===1&&te(B[0])&&t._key!==B[0]&&(B=[]),c?(s.value=B.filter(L=>L!==t._key),k("select",t._key,!0,t)):(s.value=[...B,t._key],k("select",t._key,!1,t))}else t._clear?(s.value=void 0,k("select",void 0,!1)):(s.value=t._key,k("select",t._key,!0,t))},{getDir:Ye}=_t.useConfig(),ie=Ye(),Ve={props:n,emit:k,onKeyDown:t=>{var l,a,u,B,c,L;if(n.headerSearch||t.stopPropagation(),t.key==="Backspace"&&n.multiple&&j.isArray(s.value)&&r.isEmptyLikeLodash(m.value))s.value=s.value.slice(0,-1);else if(!f.value)(t.key==="ArrowDown"||t.key==="Enter")&&(f.value=!0);else if(f.value){const b=Oe(n.tree);if(t.key==="Escape")t.preventDefault(),t.stopPropagation(),f.value=!1;else if(t.key==="Tab"&&!n.headerSearch)f.value=!1;else if(["ArrowDown","ArrowUp"].includes(t.key)){if(b.length){const A=b.findIndex(d=>O.value&&d.value&&d.value===O.value);if(t.key==="ArrowDown"){const d=b[A+1];O.value=(d==null?void 0:d.value)??O.value??b[0].value}else if(t.key==="ArrowUp"){const d=b[A-1];O.value=(d==null?void 0:d.value)??b[0].value}(a=(l=b.find(d=>O.value&&d.value&&d.value===O.value))==null?void 0:l.ref)==null||a.scrollIntoView()}}else if(["ArrowLeft","ArrowRight"].includes(t.key)){const A=w(O.value);b.length&&le.value&&n.tree&&O.value&&A&&((u=R.value)!=null&&u.includes(O.value)&&(ie.value==="ltr"&&t.key==="ArrowLeft"||ie.value==="rtl"&&t.key==="ArrowRight")||!((B=R.value)!=null&&B.includes(O.value))&&(ie.value==="ltr"&&t.key==="ArrowRight"||ie.value==="rtl"&&t.key==="ArrowLeft"))&&((L=(c=le.value).onExpandKey)==null||L.call(c,A))}else t.key==="Enter"&&(b.length===1&&b[0].value&&O.value!==b[0].value&&(O.value=b[0].value),O.value&&Ie(w(O.value),!0),k("keydownEnter",t,m.value));t.key==="Escape"&&k("keydownEscape",t)}},searchModel:m,openModel:f,model:s,slots:v,valuePlaceholder:Be,placeholder:Je,getOptionByValue:w,isOptionSelected:Q,getLabelByValue:D,getSingleByValue:te,inputRef:Y,focusOnInput:fe,getDisabled:$,getStatus:xe,getSize:z,getTagSize:X,getIconSize:ge,comboboxInputBinding:We,comboboxTriggerBinding:Ue,comboboxInputFocused:He,selectOption:Ie,itemMap:Xe,getItems:Oe,highlightedOptionKey:O};qe(Ve),e.watch(()=>[n.clearOnChangeMultiple,n.multiple],()=>{n.clearOnChangeMultiple&&(s.value=void 0)});const Ze=e.computed(()=>({defaultExpandAll:!0,showLine:!0,disabled:$.value,selectionBehavior:"replace",...n.treeProps??{},size:z.value,flattenData:!0,outerVirtualScroll:!0,selectable:!0,focusable:!1,multiple:n.multiple,checkable:n.multiple&&n.checkbox,virtual:N,syncCheckboxAndSelect:n.multiple,data:V.value,modelValue:Ee(),checkedKeys:Ee(),class:r.getBemElement(E,"tree")})),et=e.computed(()=>{const t=n.scrollContainerProps??{};return{...t,areaCls:[r.getBemElement(E,"scroll_area"),t==null?void 0:t.class,t==null?void 0:t.areaCls],wrapProps:{...(t==null?void 0:t.wrapProps)??{},style:(W==null?void 0:W.scrollWrapperStyles.value)??{}}}}),Le=r.getBemElement(E,"popup"),tt=De.cva(Le,{variants:{size:r.generateVariantClassList(ke,Le)}}),ot=e.computed(()=>r.getPxSize(n.popupWidth,!0)),nt=e.computed(()=>r.getPxSize(n.popupHeight,!0)),lt=e.computed(()=>r.getPxSize(n.minWidth,!0)),rt=()=>{var a,u;const t=(u=v.header)==null?void 0:u.call(v,{isEmpty:!((a=V.value)!=null&&a.length),search:m.value}),l=!_.isEmptyElement(t);if(l||n.headerSearch)return e.h("div",{class:r.getBemElement(E,"header")},l?t:e.h(de,n.headerSearchInputProps||{}))},at=()=>{var a,u;const t=(u=v.footer)==null?void 0:u.call(v,{isEmpty:!((a=V.value)!=null&&a.length),search:m.value});if(!_.isEmptyElement(t))return e.h("div",{class:r.getBemElement(E,"footer")},t)},st=()=>{var a;const t={type:z.value==="sm"?"simple":"advance",...x.omit(n.emptyProps??{},["class"]),class:r.normCls(r.getBemElement(E,"empty"),n.emptyCls)},l=(a=v.empty)==null?void 0:a.call(v,t);return _.isEmptyElement(l)?e.h(kt._sfc_main,t,{title:v.emptyTitle,description:v.emptyDescription,actions:v.emptyActions,image:v.emptyImage}):l},it=()=>{var a;const t=(a=v.loading)==null?void 0:a.call(v,{});return _.isEmptyElement(t)?new Array(V.value.length?2:n.loadingRowCount).fill(1).map(()=>e.h(ht._sfc_main,{size:z.value,class:r.normCls(r.getBemElement(E,"skeleton"),n.skeletonCls),...x.omit(n.skeletonProps??{},["class"])})):t},ut=(t,l,a)=>{const u=t._clear;if(n.multiple){const B=t._single;u?s.value=[]:B?s.value=[t._key]:s.value=a}else u||!l?s.value=void 0:s.value=t._key;k("select",t._key,l,t)},ct=t=>{t.key==="ArrowDown"&&!f.value?f.value=!0:t.key==="Tab"&&f.value&&(f.value=!1)};return n.disableOutsidePointerEvents&&_.useDisableBodyPointerEvents(f),o(Ve),(t,l)=>(e.openBlock(),e.createBlock(e.unref(dt.Popover),e.mergeProps({open:e.unref(f),"onUpdate:open":l[2]||(l[2]=a=>e.isRef(f)?f.value=a:null)},G.value,{containerProps:{...S.containerProps??{},onClick:fe},noPadding:!0,size:e.unref(z),containerStyle:{pointerEvents:"auto",display:e.unref(f)?void 0:"none",zIndex:S.zIndex,"--ptc-combobox-popup-width":S.samePopupWidth?void 0:ot.value,"--ptc-combobox-popup-height":nt.value,"--ptc-combobox-trigger-min-w":lt.value},containerCls:e.unref(r.normCls)(e.unref(tt)({size:e.unref(z)}),S.popupCls),onKeydown:ct}),{default:e.withCtx(()=>[e.createVNode(xt)]),content:e.withCtx(()=>[e.createVNode(rt),e.createVNode(e.unref(Ct._sfc_main),e.mergeProps({ref_key:"scrollContainerRef",ref:ae},et.value),{default:e.withCtx(()=>[V.value.length||S.loading?(e.openBlock(),e.createBlock(e.unref(Qe),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.normCls)(e.unref(r.getBemElement)(e.unref(E),"options"),S.optionsCls)),style:e.normalizeStyle(S.virtual?$e.value:{}),onPointerleave:l[1]||(l[1]=a=>ve(void 0))},[S.tree?(e.openBlock(),e.createBlock(e.unref(ye._sfc_main),e.mergeProps({key:0,ref_key:"treeRef",ref:le},Ze.value,{expandedKeys:e.unref(R),"onUpdate:expandedKeys":l[0]||(l[0]=a=>e.isRef(R)?R.value=a:null),onExpand:fe,onSelect:ut}),{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,u=>(e.openBlock(),e.createBlock(e.unref(Se),{key:u._key,value:u._key,id:u._id},{default:e.withCtx(()=>[e.createVNode(e.unref(ye._sfc_main$1),e.mergeProps({node:u},{ref_for:!0},Pe(u),{onPointermove:B=>ve(u._key),id:u._id}),{default:e.withCtx(()=>[e.createVNode(Te,{option:u},null,8,["option"])]),_:2},1040,["node","onPointermove","id"])]),_:2},1032,["value","id"]))),128))]),_:1},16,["expandedKeys"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ge.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a._key},[a._divider?(e.openBlock(),e.createBlock(bt._sfc_main,{key:0})):a._label&&a._hasChildren?(e.openBlock(),e.createBlock(Bt,{key:1,label:a._label},null,8,["label"])):a._hasChildren?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Se),{key:2,value:a._key,id:a._id},{default:e.withCtx(()=>[e.createVNode(Te,e.mergeProps({option:a},{ref_for:!0},Pe(a),{onPointermove:u=>ve(a._key),id:a._id}),null,16,["option","onPointermove","id"])]),_:2},1032,["value","id"]))],64))),128)),S.loading?(e.openBlock(),e.createBlock(it,{key:2})):e.createCommentVNode("",!0)],38)]),_:1})):(e.openBlock(),e.createBlock(st,{key:1})),S.lazyLoading?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"lazy_loading"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r.getBemElement)(e.unref(E),"lazy_loading_trigger")),ref_key:"target",ref:Z},null,2)],2)):e.createCommentVNode("",!0)]),_:1},16),e.createVNode(at)]),_:1},16,["open","containerProps","size","containerStyle","containerCls"]))}}),St=_.installComponent(Ke,r.getComponentName("Combobox")),Ot=_.installComponent(de,r.getComponentName("ComboboxInput"));exports.Combobox=Ke;exports.ComboboxInput=de;exports.ComboboxInputPlugin=Ot;exports.ComboboxPlugin=St;exports.ComboboxSizes=ke;exports.ComboboxStatuses=je;exports.injectComboboxContext=pe;exports.provideComboboxContext=qe;
@@ -101,11 +101,12 @@ declare function __VLS_template(): {
101
101
  readonly "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
102
102
  readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
103
103
  readonly onOpenAutoFocus?: ((event: Event) => any) | undefined;
104
+ readonly onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
105
+ readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
104
106
  readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
105
107
  readonly onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
106
108
  readonly onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
107
109
  readonly onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
108
- readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
109
110
  readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
110
111
  readonly onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
111
112
  readonly onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -608,7 +609,7 @@ declare function __VLS_template(): {
608
609
  $root: import('vue').ComponentPublicInstance | null;
609
610
  $parent: import('vue').ComponentPublicInstance | null;
610
611
  $host: Element | null;
611
- $emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => void) & ((event: "update:modelValue", value: string | string[]) => void) & ((event: "closeAutoFocus", event: Event) => void) & ((event: "openAutoFocus", event: Event) => void) & ((event: "escapeKeyDown", event: KeyboardEvent) => void) & ((event: "pointerDownOutside", event: import('reka-ui').PointerDownOutsideEvent) => void) & ((event: "focusOutside", event: import('reka-ui').FocusOutsideEvent) => void) & ((event: "interactOutside", event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => void) & ((event: "update:open", value: boolean) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void);
612
+ $emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => void) & ((event: "update:modelValue", value: string | string[]) => void) & ((event: "closeAutoFocus", event: Event) => void) & ((event: "openAutoFocus", event: Event) => void) & ((event: "openChange", value?: boolean | null | undefined) => void) & ((event: "update:open", value: boolean) => void) & ((event: "escapeKeyDown", event: KeyboardEvent) => void) & ((event: "pointerDownOutside", event: import('reka-ui').PointerDownOutsideEvent) => void) & ((event: "focusOutside", event: import('reka-ui').FocusOutsideEvent) => void) & ((event: "interactOutside", event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void);
612
613
  $el: any;
613
614
  $options: import('vue').ComponentOptionsBase<Readonly<ComboboxProps> & Readonly<{
614
615
  onSearch?: ((value?: string | null | undefined) => any) | undefined;
@@ -616,11 +617,12 @@ declare function __VLS_template(): {
616
617
  "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
617
618
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
618
619
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
620
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
621
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
619
622
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
620
623
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
621
624
  onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
622
625
  onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
623
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
624
626
  "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
625
627
  onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
626
628
  onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -660,11 +662,12 @@ declare function __VLS_template(): {
660
662
  "update:modelValue": (value: string | string[]) => any;
661
663
  closeAutoFocus: (event: Event) => any;
662
664
  openAutoFocus: (event: Event) => any;
665
+ openChange: (value?: boolean | null | undefined) => any;
666
+ "update:open": (value: boolean) => any;
663
667
  escapeKeyDown: (event: KeyboardEvent) => any;
664
668
  pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
665
669
  focusOutside: (event: import('reka-ui').FocusOutsideEvent) => any;
666
670
  interactOutside: (event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any;
667
- "update:open": (value: boolean) => any;
668
671
  "update:expandedKeys": (value: string[]) => any;
669
672
  keydownEnter: (value: KeyboardEvent, searchModel?: string | undefined) => any;
670
673
  keydownEscape: (value: KeyboardEvent) => any;
@@ -740,11 +743,12 @@ declare function __VLS_template(): {
740
743
  "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
741
744
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
742
745
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
746
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
747
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
743
748
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
744
749
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
745
750
  onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
746
751
  onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
747
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
748
752
  "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
749
753
  onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
750
754
  onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -890,11 +894,12 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
890
894
  readonly "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
891
895
  readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
892
896
  readonly onOpenAutoFocus?: ((event: Event) => any) | undefined;
897
+ readonly onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
898
+ readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
893
899
  readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
894
900
  readonly onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
895
901
  readonly onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
896
902
  readonly onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
897
- readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
898
903
  readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
899
904
  readonly onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
900
905
  readonly onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -1397,7 +1402,7 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
1397
1402
  $root: import('vue').ComponentPublicInstance | null;
1398
1403
  $parent: import('vue').ComponentPublicInstance | null;
1399
1404
  $host: Element | null;
1400
- $emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => void) & ((event: "update:modelValue", value: string | string[]) => void) & ((event: "closeAutoFocus", event: Event) => void) & ((event: "openAutoFocus", event: Event) => void) & ((event: "escapeKeyDown", event: KeyboardEvent) => void) & ((event: "pointerDownOutside", event: import('reka-ui').PointerDownOutsideEvent) => void) & ((event: "focusOutside", event: import('reka-ui').FocusOutsideEvent) => void) & ((event: "interactOutside", event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => void) & ((event: "update:open", value: boolean) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void);
1405
+ $emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => void) & ((event: "update:modelValue", value: string | string[]) => void) & ((event: "closeAutoFocus", event: Event) => void) & ((event: "openAutoFocus", event: Event) => void) & ((event: "openChange", value?: boolean | null | undefined) => void) & ((event: "update:open", value: boolean) => void) & ((event: "escapeKeyDown", event: KeyboardEvent) => void) & ((event: "pointerDownOutside", event: import('reka-ui').PointerDownOutsideEvent) => void) & ((event: "focusOutside", event: import('reka-ui').FocusOutsideEvent) => void) & ((event: "interactOutside", event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void);
1401
1406
  $el: any;
1402
1407
  $options: import('vue').ComponentOptionsBase<Readonly<ComboboxProps> & Readonly<{
1403
1408
  onSearch?: ((value?: string | null | undefined) => any) | undefined;
@@ -1405,11 +1410,12 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
1405
1410
  "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
1406
1411
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
1407
1412
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
1413
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
1414
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
1408
1415
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
1409
1416
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
1410
1417
  onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
1411
1418
  onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
1412
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
1413
1419
  "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
1414
1420
  onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
1415
1421
  onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -1449,11 +1455,12 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
1449
1455
  "update:modelValue": (value: string | string[]) => any;
1450
1456
  closeAutoFocus: (event: Event) => any;
1451
1457
  openAutoFocus: (event: Event) => any;
1458
+ openChange: (value?: boolean | null | undefined) => any;
1459
+ "update:open": (value: boolean) => any;
1452
1460
  escapeKeyDown: (event: KeyboardEvent) => any;
1453
1461
  pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
1454
1462
  focusOutside: (event: import('reka-ui').FocusOutsideEvent) => any;
1455
1463
  interactOutside: (event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any;
1456
- "update:open": (value: boolean) => any;
1457
1464
  "update:expandedKeys": (value: string[]) => any;
1458
1465
  keydownEnter: (value: KeyboardEvent, searchModel?: string | undefined) => any;
1459
1466
  keydownEscape: (value: KeyboardEvent) => any;
@@ -1529,11 +1536,12 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
1529
1536
  "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
1530
1537
  onCloseAutoFocus?: ((event: Event) => any) | undefined;
1531
1538
  onOpenAutoFocus?: ((event: Event) => any) | undefined;
1539
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
1540
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
1532
1541
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
1533
1542
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
1534
1543
  onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
1535
1544
  onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
1536
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
1537
1545
  "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
1538
1546
  onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
1539
1547
  onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
@@ -524,24 +524,30 @@ export type DialogEmits = DialogRootEmits & Pick<DialogContentEmits, 'pointerDow
524
524
  * Emitted when the dialog is closed
525
525
  */
526
526
  close: [];
527
+ /**
528
+ * Emitted when the dialog open changed
529
+ */
530
+ openChange: [value?: boolean | null];
527
531
  };
528
532
  export declare const dialogPrefix: string;
529
533
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<DialogProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
530
534
  cancel: (event: Event) => any;
531
535
  close: () => any;
536
+ openChange: (value?: boolean | null | undefined) => any;
537
+ "update:open": (value: boolean) => any;
532
538
  escapeKeyDown: (event: KeyboardEvent) => any;
533
539
  pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
534
540
  focusOutside: (event: FocusOutsideEvent) => any;
535
- "update:open": (value: boolean) => any;
536
541
  ok: (event: Event) => any;
537
542
  "update:fullScreen": (value: boolean) => any;
538
543
  }, string, import('vue').PublicProps, Readonly<DialogProps> & Readonly<{
539
544
  onCancel?: ((event: Event) => any) | undefined;
540
545
  onClose?: (() => any) | undefined;
546
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
547
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
541
548
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
542
549
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
543
550
  onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
544
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
545
551
  onOk?: ((event: Event) => any) | undefined;
546
552
  "onUpdate:fullScreen"?: ((value: boolean) => any) | undefined;
547
553
  }>, {
@@ -4,7 +4,7 @@ import { DialogTitle as We, DialogRoot as Re, DialogPortal as Le, Primitive as U
4
4
  import { isEmptyElement as f, useVModel as Q, installComponent as re } from "@pantograph/utils-vue";
5
5
  import { getComponentOptions as ie, normCls as u, getBemElement as p, getBemBlock as Ye, generateVariantClassList as C, getValidNumber as qe, getPxSize as y, getBemModifier as H, getStyleObject as z, getComponentName as ae } from "@pantograph/utils";
6
6
  import "clsx";
7
- import { g as Je } from "../utils-DeYtvqtV.js";
7
+ import { g as Je } from "../utils-FYU7FkmA.js";
8
8
  import { _ as X } from "../IconButton.vue_vue_type_script_setup_true_lang-BWakPloG.js";
9
9
  import "../Blanket/index.js";
10
10
  import { isString as Z, isFunction as Qe } from "es-toolkit";
@@ -129,12 +129,12 @@ const le = /* @__PURE__ */ oe({
129
129
  forceMount: { type: Boolean },
130
130
  disableOutsidePointerEvents: { type: Boolean }
131
131
  }, ot),
132
- emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close"],
132
+ emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close", "openChange"],
133
133
  setup(i, { emit: S }) {
134
134
  const c = S, e = i, n = ne(), D = Fe(), v = Y(), j = Je({ triggerRef: v, props: e }), A = Q(e, "open", c, {
135
135
  passive: e.open === void 0,
136
136
  onChange(t) {
137
- t || c("close");
137
+ t || c("close"), c("openChange", t);
138
138
  }
139
139
  }), x = async (t) => {
140
140
  if (!t && Qe(e.beforeClose))
@@ -147,8 +147,8 @@ const le = /* @__PURE__ */ oe({
147
147
  return;
148
148
  }
149
149
  A.value = t;
150
- }, b = Q(e, "fullScreen", c, {}), ue = () => {
151
- e.canFullScreen && (b.value = !b.value);
150
+ }, h = Q(e, "fullScreen", c, {}), ue = () => {
151
+ e.canFullScreen && (h.value = !h.value);
152
152
  }, de = (t) => {
153
153
  c("ok", t);
154
154
  }, pe = (t) => {
@@ -193,11 +193,11 @@ const le = /* @__PURE__ */ oe({
193
193
  },
194
194
  () => t
195
195
  );
196
- }, be = () => {
196
+ }, he = () => {
197
197
  var o;
198
198
  const t = (o = n.beforeTitle) == null ? void 0 : o.call(n, {});
199
199
  if (!f(t)) return t;
200
- }, he = () => {
200
+ }, be = () => {
201
201
  const t = () => {
202
202
  var g;
203
203
  const d = (g = n.beforeActions) == null ? void 0 : g.call(n, {});
@@ -206,7 +206,7 @@ const le = /* @__PURE__ */ oe({
206
206
  const d = [];
207
207
  if (e.canFullScreen && d.push(
208
208
  s(X, {
209
- icon: b.value ? "tabler:arrows-minimize" : "tabler:arrows-maximize",
209
+ icon: h.value ? "tabler:arrows-minimize" : "tabler:arrows-maximize",
210
210
  type: "ghost",
211
211
  color: "neutral",
212
212
  onClick: ue
@@ -219,11 +219,11 @@ const le = /* @__PURE__ */ oe({
219
219
  onClick: () => x(!1)
220
220
  })
221
221
  ), d.length) return s(_, { gap: "sm" }, () => d);
222
- }, l = t(), h = o();
223
- if (l || h)
222
+ }, l = t(), b = o();
223
+ if (l || b)
224
224
  return s("div", { class: u(p(a, "actions"), e.actionsCls) }, [
225
225
  l,
226
- h
226
+ b
227
227
  ]);
228
228
  }, we = () => {
229
229
  var l;
@@ -246,7 +246,7 @@ const le = /* @__PURE__ */ oe({
246
246
  () => o ? t : e.description
247
247
  );
248
248
  }, Se = () => {
249
- const t = he(), o = be();
249
+ const t = be(), o = he();
250
250
  if (e.frameless) return t;
251
251
  const l = () => {
252
252
  const g = we();
@@ -256,18 +256,18 @@ const le = /* @__PURE__ */ oe({
256
256
  { class: u(p(a, "title_wrapper"), e.titleWrapperCls) },
257
257
  [o, g, t]
258
258
  );
259
- }, h = Ce(), d = l();
260
- if (d || h)
259
+ }, b = Ce(), d = l();
260
+ if (d || b)
261
261
  return s(
262
262
  "div",
263
263
  {
264
264
  class: u(p(a, "header"), e.headerCls)
265
265
  },
266
- [d, h]
266
+ [d, b]
267
267
  );
268
268
  }, De = () => {
269
269
  var U, $;
270
- const t = (U = n.footer) == null ? void 0 : U.call(n, {}), o = !f(t), l = ($ = n.beforeFooterActions) == null ? void 0 : $.call(n, {}), h = !f(l);
270
+ const t = (U = n.footer) == null ? void 0 : U.call(n, {}), o = !f(t), l = ($ = n.beforeFooterActions) == null ? void 0 : $.call(n, {}), b = !f(l);
271
271
  if (e.footer !== void 0 && !e.footer) return null;
272
272
  const g = o ? t : (() => {
273
273
  var K, G;
@@ -302,7 +302,7 @@ const le = /* @__PURE__ */ oe({
302
302
  )
303
303
  );
304
304
  const F = [];
305
- if (h && F.push(l), T.length && F.push(s(_, { gap: "sm" }, () => T)), F.length) return F;
305
+ if (b && F.push(l), T.length && F.push(s(_, { gap: "sm" }, () => T)), F.length) return F;
306
306
  })();
307
307
  if (g)
308
308
  return s(
@@ -342,7 +342,7 @@ const le = /* @__PURE__ */ oe({
342
342
  return 1;
343
343
  }
344
344
  }), B = k(
345
- () => !b.value && m.value.widthVariant !== "custom" && !(e.type === "drawer" && ["top", "bottom"].includes(e.side))
345
+ () => !h.value && m.value.widthVariant !== "custom" && !(e.type === "drawer" && ["top", "bottom"].includes(e.side))
346
346
  ), V = Y(), { isSwiping: W, direction: R, distanceY: L } = Xe(V, {
347
347
  disableTextSelect: !0,
348
348
  threshold: 50,
@@ -402,7 +402,7 @@ const le = /* @__PURE__ */ oe({
402
402
  },
403
403
  r(fe)({
404
404
  frameless: i.frameless,
405
- fullscreen: r(b),
405
+ fullscreen: r(h),
406
406
  width: m.value.widthVariant,
407
407
  type: i.type,
408
408
  side: i.side
@@ -421,7 +421,7 @@ const le = /* @__PURE__ */ oe({
421
421
  ...r(z)(i.style)
422
422
  })
423
423
  }, [
424
- !r(b) && i.mask ? (P(), N(r(Ze), {
424
+ !r(h) && i.mask ? (P(), N(r(Ze), {
425
425
  key: 0,
426
426
  onClick: me,
427
427
  class: M(r(u)(r(p)(r(a), "blanket"), i.blanketCls)),
@@ -451,7 +451,7 @@ const le = /* @__PURE__ */ oe({
451
451
  w(Se),
452
452
  w(ve),
453
453
  w(De),
454
- e.swipeTrigger && i.type === "drawer" && ["top", "bottom"].includes(e.side) && !r(b) ? (P(), Ee("div", {
454
+ e.swipeTrigger && i.type === "drawer" && ["top", "bottom"].includes(e.side) && !r(h) ? (P(), Ee("div", {
455
455
  key: 0,
456
456
  ref_key: "swipeTrigger",
457
457
  ref: V,
@@ -476,12 +476,12 @@ const le = /* @__PURE__ */ oe({
476
476
  _: 1
477
477
  }, 8, ["open", "modal"]));
478
478
  }
479
- }), ht = re(nt, ae("Dialog")), wt = re(le, ae("DialogTitle"));
479
+ }), bt = re(nt, ae("Dialog")), wt = re(le, ae("DialogTitle"));
480
480
  export {
481
481
  ot as DIALOG_DEFAULT_PROPS,
482
482
  nt as Dialog,
483
483
  et as DialogDrawerSides,
484
- ht as DialogPlugin,
484
+ bt as DialogPlugin,
485
485
  te as DialogSizes,
486
486
  le as DialogTitle,
487
487
  wt as DialogTitlePlugin,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("class-variance-authority"),y=require("reka-ui"),c=require("@pantograph/utils-vue"),n=require("@pantograph/utils");require("clsx");const ge=require("../utils-V8eBZdnq.js"),_=require("../IconButton.vue_vue_type_script_setup_true_lang-D3l2EAmu.js");require("../Blanket/index.umd.cjs");const P=require("es-toolkit"),q=require("../index-BOecemV4.js"),fe=require("@vueuse/core"),L=require("../Button.vue_vue_type_script_setup_true_lang-DuzKM6AI.js"),ye=require("../Blanket.vue_vue_type_style_index_0_lang-WQSz_s3C.js"),x=e.defineComponent({...n.getComponentOptions("DialogTitle"),__name:"DialogTitle",props:{class:{type:[Array,Object,String,Number,null,Boolean]},title:{}},setup(l){const h=e.useSlots(),u=l,t=()=>{var C;const i=(C=h.default)==null?void 0:C.call(h,{}),b=!c.isEmptyElement(i);if(b||u.title)return e.h(y.DialogTitle,{class:n.normCls(n.getBemElement(a,"title"),u.class)},()=>b?i:u.title)};return(i,b)=>(e.openBlock(),e.createBlock(t))}}),O=["sm","md","lg"],W=["modal","drawer"],R=["start","top","end","bottom"],he=["data-screen"],U={text:"Submit"},G={text:"Cancel",type:"ghost",color:"neutral"},K={keyboard:!0,openAutoFocus:!1,trapFocus:!1,closeOnClickOutside:!1,footer:void 0,open:!1,canFullScreen:!0,animated:!0,fullScreen:!1,width:"md",frameless:!1,closeable:!0,mask:!0,maskClosable:!0,screen:!0,type:"modal",side:"end",zIndex:1e3,asDrawerInMobile:!1,mobileDrawerMinHeight:void 0,mobileDrawerHeight:void 0,mobileDrawerMaxHeight:void 0,noBody:!1,headerCls:void 0,bodyCls:void 0,footerCls:void 0,swipeTriggerCls:void 0,swipeTrigger:void 0,okProps:()=>U,cancelProps:()=>G},a=n.getBemBlock("dialog"),E=e.defineComponent({...n.getComponentOptions("Dialog",!1),__name:"Dialog",props:e.mergeDefaults({wrapperStyle:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},noBody:{type:Boolean},keyboard:{type:Boolean},openAutoFocus:{type:Boolean},trapFocus:{type:Boolean},closeOnClickOutside:{type:Boolean},open:{type:Boolean},canFullScreen:{type:Boolean},fullScreen:{type:Boolean},minWidth:{},width:{},maxWidth:{},minHeight:{},height:{},maxHeight:{},title:{},description:{},frameless:{type:Boolean},footer:{type:[Boolean,null]},closeable:{type:Boolean},zIndex:{},okProps:{},cancelProps:{},mask:{type:Boolean},maskClosable:{type:Boolean},beforeClose:{type:Function},beforeCloseDebugger:{type:Boolean},to:{type:[String,Function]},animated:{type:[Boolean,String]},type:{},asDrawerInMobile:{type:Boolean},mobileDrawerMinHeight:{},mobileDrawerHeight:{},mobileDrawerMaxHeight:{},side:{},wrapperCls:{type:[Array,Object,String,Number,null,Boolean]},class:{type:[Array,Object,String,Number,null,Boolean]},blanketCls:{type:[Array,Object,String,Number,null,Boolean]},contentCls:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},titleWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},titleCls:{type:[Array,Object,String,Number,null,Boolean]},descriptionCls:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},bodyCls:{type:[Array,Object,String,Number,null,Boolean]},footerCls:{type:[Array,Object,String,Number,null,Boolean]},swipeTriggerCls:{type:[Array,Object,String,Number,null,Boolean]},screen:{type:Boolean},swipeTrigger:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean}},K),emits:["update:open","pointerDownOutside","escapeKeyDown","focusOutside","update:fullScreen","ok","cancel","close"],setup(l,{emit:h}){const u=h,t=l,i=e.useSlots(),b=e.useAttrs(),C=e.ref(),k=ge.getPopoverPortalProps({triggerRef:C,props:t}),S=c.useVModel(t,"open",u,{passive:t.open===void 0,onChange(o){o||u("close")}}),B=async o=>{if(!o&&P.isFunction(t.beforeClose))try{const r=await t.beforeClose();if(t.beforeCloseDebugger&&console.info("beforeClose response",r),!r)return}catch(r){t.beforeCloseDebugger&&console.error("beforeClose error",r);return}S.value=o},g=c.useVModel(t,"fullScreen",u,{}),$=()=>{t.canFullScreen&&(g.value=!g.value)},Y=o=>{u("ok",o)},J=o=>{u("cancel",o)},Q=()=>{t.maskClosable&&B(!1)},X=I.cva(a,{variants:{frameless:n.generateVariantClassList("frameless",a),fullscreen:n.generateVariantClassList("fullscreen",a),width:n.generateVariantClassList([...O,"custom"],a),type:n.generateVariantClassList(W,a),side:n.generateVariantClassList(R,a)}}),A=n.getBemElement(a,"content"),Z=I.cva(A,{variants:{swiping:n.generateVariantClassList("swiping",A)}}),m=e.computed(()=>{let o=n.getValidNumber(t.width);return o!==void 0?o=`${o}px`:P.isString(t.width)&&!O.includes(t.width)&&(o=t.width),{widthVariant:o?"custom":t.width,minWidth:n.getPxSize(t.minWidth,!0),width:o,maxWidth:n.getPxSize(t.maxWidth,!0),minHeight:n.getPxSize(t.minHeight,!0),height:n.getPxSize(t.height,!0),maxHeight:n.getPxSize(t.maxHeight,!0),mobileDrawerMinHeight:n.getPxSize(t.mobileDrawerMinHeight,!0),mobileDrawerHeight:n.getPxSize(t.mobileDrawerHeight,!0),mobileDrawerMaxHeight:n.getPxSize(t.mobileDrawerMaxHeight,!0)}}),ee=()=>{var r;const o=(r=i.trigger)==null?void 0:r.call(i,{});if(!c.isEmptyElement(o))return e.h(y.DialogTrigger,{asChild:!0,ref:C},()=>o)},te=()=>{var r;const o=(r=i.beforeTitle)==null?void 0:r.call(i,{});if(!c.isEmptyElement(o))return o},oe=()=>{const o=()=>{var p;const d=(p=i.beforeActions)==null?void 0:p.call(i,{});if(!c.isEmptyElement(d))return d},r=()=>{const d=[];if(t.canFullScreen&&d.push(e.h(_._sfc_main,{icon:g.value?"tabler:arrows-minimize":"tabler:arrows-maximize",type:"ghost",color:"neutral",onClick:$})),t.closeable&&d.push(e.h(_._sfc_main,{icon:"tabler:x",type:"ghost",color:"neutral",onClick:()=>B(!1)})),d.length)return e.h(q._sfc_main,{gap:"sm"},()=>d)},s=o(),f=r();if(s||f)return e.h("div",{class:n.normCls(n.getBemElement(a,"actions"),t.actionsCls)},[s,f])},ne=()=>{var s;const o=(s=i.title)==null?void 0:s.call(i,{}),r=!c.isEmptyElement(o);if(t.title||r)return e.h(x,{class:t.titleCls},()=>r?o:t.title)},re=()=>{var s;const o=(s=i.description)==null?void 0:s.call(i,{}),r=!c.isEmptyElement(o);if(t.description||r)return e.h(y.DialogDescription,{class:n.normCls(n.getBemElement(a,"description"),"paragraph",t.descriptionCls)},()=>r?o:t.description)},ie=()=>{const o=oe(),r=te();if(t.frameless)return o;const s=()=>{const p=ne();if(p||o||r)return e.h("div",{class:n.normCls(n.getBemElement(a,"title_wrapper"),t.titleWrapperCls)},[r,p,o])},f=re(),d=s();if(d||f)return e.h("div",{class:n.normCls(n.getBemElement(a,"header"),t.headerCls)},[d,f])},le=()=>{var V,z;const o=(V=i.footer)==null?void 0:V.call(i,{}),r=!c.isEmptyElement(o),s=(z=i.beforeFooterActions)==null?void 0:z.call(i,{}),f=!c.isEmptyElement(s);if(t.footer!==void 0&&!t.footer)return null;const p=r?o:(()=>{var H,j;const v=[];(H=t.cancelProps)!=null&&H.hide||v.push(e.h(L._sfc_main,{...G,...t.cancelProps??{},onClick:J},{default:i.cancel,preIcon:i.cancelPreIcon,postIcon:i.cancelPostIcon})),(j=t.okProps)!=null&&j.hide||v.push(e.h(L._sfc_main,{...U,...t.okProps??{},onClick:Y},{default:i.ok,preIcon:i.okPreIcon,postIcon:i.okPostIcon}));const D=[];if(f&&D.push(s),v.length&&D.push(e.h(q._sfc_main,{gap:"sm"},()=>v)),D.length)return D})();if(p)return e.h("div",{class:n.normCls(n.getBemElement(a,"footer"),t.footerCls)},p)},ae=()=>{var r;const o=(r=i.default)==null?void 0:r.call(i,{});if(!c.isEmptyElement(o))return t.noBody?o:e.h("div",{class:n.normCls(n.getBemElement(a,"body"),t.bodyCls)},o)},se=e.computed(()=>{if(t.animated&&P.isString(t.animated))return t.animated;if(t.type==="modal")return n.getBemModifier(a,"fade");switch(t.side){case"start":case"end":return n.getBemModifier(a,"side-x");case"bottom":case"top":return n.getBemModifier(a,"side-y")}}),ce=e.computed(()=>{switch(t.side){case"start":case"top":return-1;case"bottom":case"end":return 1}}),w=e.computed(()=>!g.value&&m.value.widthVariant!=="custom"&&!(t.type==="drawer"&&["top","bottom"].includes(t.side))),T=e.ref(),{isSwiping:M,direction:N,distanceY:F}=fe.usePointerSwipe(T,{disableTextSelect:!0,threshold:50,onSwipeEnd(){t.type==="drawer"&&t.closeable&&(t.side==="bottom"&&N.value==="down"||t.side==="top"&&N.value==="up")&&B(!1)}}),ue=e.computed(()=>{if(!M.value||t.type!=="drawer"||!["top","bottom"].includes(t.side))return;const o=Math.min(Math.abs(F.value)/100,1);let r=-F.value*o*.6;return t.side==="top"?r=Math.min(0,r):r=Math.max(0,r),r}),de=o=>{(!t.keyboard||!t.open)&&(o.preventDefault(),o.stopPropagation()),t.open&&u("escapeKeyDown",o)},me=o=>{t.openAutoFocus||(o.preventDefault(),o.stopPropagation())},pe=o=>{(!t.closeOnClickOutside||!t.open)&&(o.preventDefault(),o.stopPropagation())};return(o,r)=>(e.openBlock(),e.createBlock(e.unref(y.DialogRoot),{open:e.unref(S),"onUpdate:open":B,modal:l.trapFocus},{default:e.withCtx(()=>[e.createVNode(ee),e.createVNode(e.unref(y.DialogPortal),e.normalizeProps(e.guardReactiveProps(e.unref(k))),{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:se.value,css:!!l.animated,duration:l.type==="drawer"?250:200},{default:e.withCtx(()=>[e.unref(k).forceMount||e.unref(S)?(e.openBlock(),e.createBlock(e.unref(y.Primitive),e.mergeProps({"as-child":!w.value||!l.screen,key:String(!w.value||!l.screen),class:{[e.unref(n.normCls)("pc_grid",e.unref(n.getBemElement)(e.unref(a),"wrapper"),l.wrapperCls)]:w.value&&l.screen,[e.unref(n.getBemModifier)(e.unref(a),"as-drawer-in-mobile")]:t.type==="modal"&&l.asDrawerInMobile}},e.unref(b),{style:{zIndex:l.zIndex,"--ptc-dialog-transform":l.fullScreen||l.type==="modal"?"20px":"100%","--ptc-dialog-transform-ratio":ce.value,...e.unref(n.getStyleObject)(w.value&&l.screen?l.wrapperStyle:{})}}),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{"data-screen":l.screen?"":void 0,class:e.normalizeClass(e.unref(n.normCls)({pc_grid__container:w.value},e.unref(X)({frameless:l.frameless,fullscreen:e.unref(g),width:m.value.widthVariant,type:l.type,side:l.side}),t.class)),style:e.normalizeStyle({"--ptc-dialog-w":m.value.width,"--ptc-dialog-min-h":m.value.minHeight,"--ptc-dialog-h":m.value.height,"--ptc-dialog-max-h":m.value.maxHeight,"--ptc-dialog-mobile-drawer-min-h":m.value.mobileDrawerMinHeight,"--ptc-dialog-mobile-drawer-h":m.value.mobileDrawerHeight,"--ptc-dialog-mobile-drawer-max-h":m.value.mobileDrawerMaxHeight,...e.unref(n.getStyleObject)(l.style)})},[!e.unref(g)&&l.mask?(e.openBlock(),e.createBlock(e.unref(ye._sfc_main),{key:0,onClick:Q,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"blanket"),l.blanketCls)),screen:!1},null,8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.DialogContent),{forceMount:e.unref(k).forceMount,onInteractOutside:pe,onOpenAutoFocus:me,onEscapeKeyDown:de,onPointerDownOutside:r[0]||(r[0]=s=>u("pointerDownOutside",s)),onFocusOutside:r[1]||(r[1]=s=>u("focusOutside",s)),class:e.normalizeClass(e.unref(n.normCls)(e.unref(Z)({swiping:e.unref(M)}),l.contentCls)),style:e.normalizeStyle({"--ptc-dialog-swipe-transform":ue.value,...e.unref(n.getStyleObject)(l.contentStyle)})},{default:e.withCtx(()=>[e.createVNode(ie),e.createVNode(ae),e.createVNode(le),t.swipeTrigger&&l.type==="drawer"&&["top","bottom"].includes(t.side)&&!e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"swipeTrigger",ref:T,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"swipe_trigger"),l.swipeTriggerCls))},null,2)):e.createCommentVNode("",!0)]),_:1},8,["forceMount","class","style"])],14,he),[[e.vShow,e.unref(S)]])]),_:1},16,["as-child","class","style"])):e.createCommentVNode("",!0)]),_:1},8,["name","css","duration"])]),_:1},16)]),_:1},8,["open","modal"]))}}),be=c.installComponent(E,n.getComponentName("Dialog")),Ce=c.installComponent(x,n.getComponentName("DialogTitle"));exports.DIALOG_DEFAULT_PROPS=K;exports.Dialog=E;exports.DialogDrawerSides=R;exports.DialogPlugin=be;exports.DialogSizes=O;exports.DialogTitle=x;exports.DialogTitlePlugin=Ce;exports.DialogTypes=W;exports.default=E;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("class-variance-authority"),y=require("reka-ui"),u=require("@pantograph/utils-vue"),n=require("@pantograph/utils");require("clsx");const ge=require("../utils-BurtTDf8.js"),_=require("../IconButton.vue_vue_type_script_setup_true_lang-D3l2EAmu.js");require("../Blanket/index.umd.cjs");const P=require("es-toolkit"),q=require("../index-BOecemV4.js"),fe=require("@vueuse/core"),L=require("../Button.vue_vue_type_script_setup_true_lang-DuzKM6AI.js"),ye=require("../Blanket.vue_vue_type_style_index_0_lang-WQSz_s3C.js"),x=e.defineComponent({...n.getComponentOptions("DialogTitle"),__name:"DialogTitle",props:{class:{type:[Array,Object,String,Number,null,Boolean]},title:{}},setup(l){const h=e.useSlots(),c=l,t=()=>{var C;const i=(C=h.default)==null?void 0:C.call(h,{}),b=!u.isEmptyElement(i);if(b||c.title)return e.h(y.DialogTitle,{class:n.normCls(n.getBemElement(a,"title"),c.class)},()=>b?i:c.title)};return(i,b)=>(e.openBlock(),e.createBlock(t))}}),O=["sm","md","lg"],W=["modal","drawer"],R=["start","top","end","bottom"],he=["data-screen"],U={text:"Submit"},G={text:"Cancel",type:"ghost",color:"neutral"},K={keyboard:!0,openAutoFocus:!1,trapFocus:!1,closeOnClickOutside:!1,footer:void 0,open:!1,canFullScreen:!0,animated:!0,fullScreen:!1,width:"md",frameless:!1,closeable:!0,mask:!0,maskClosable:!0,screen:!0,type:"modal",side:"end",zIndex:1e3,asDrawerInMobile:!1,mobileDrawerMinHeight:void 0,mobileDrawerHeight:void 0,mobileDrawerMaxHeight:void 0,noBody:!1,headerCls:void 0,bodyCls:void 0,footerCls:void 0,swipeTriggerCls:void 0,swipeTrigger:void 0,okProps:()=>U,cancelProps:()=>G},a=n.getBemBlock("dialog"),E=e.defineComponent({...n.getComponentOptions("Dialog",!1),__name:"Dialog",props:e.mergeDefaults({wrapperStyle:{type:[Boolean,null,String,Object,Array]},style:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},noBody:{type:Boolean},keyboard:{type:Boolean},openAutoFocus:{type:Boolean},trapFocus:{type:Boolean},closeOnClickOutside:{type:Boolean},open:{type:Boolean},canFullScreen:{type:Boolean},fullScreen:{type:Boolean},minWidth:{},width:{},maxWidth:{},minHeight:{},height:{},maxHeight:{},title:{},description:{},frameless:{type:Boolean},footer:{type:[Boolean,null]},closeable:{type:Boolean},zIndex:{},okProps:{},cancelProps:{},mask:{type:Boolean},maskClosable:{type:Boolean},beforeClose:{type:Function},beforeCloseDebugger:{type:Boolean},to:{type:[String,Function]},animated:{type:[Boolean,String]},type:{},asDrawerInMobile:{type:Boolean},mobileDrawerMinHeight:{},mobileDrawerHeight:{},mobileDrawerMaxHeight:{},side:{},wrapperCls:{type:[Array,Object,String,Number,null,Boolean]},class:{type:[Array,Object,String,Number,null,Boolean]},blanketCls:{type:[Array,Object,String,Number,null,Boolean]},contentCls:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},titleWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},titleCls:{type:[Array,Object,String,Number,null,Boolean]},descriptionCls:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},bodyCls:{type:[Array,Object,String,Number,null,Boolean]},footerCls:{type:[Array,Object,String,Number,null,Boolean]},swipeTriggerCls:{type:[Array,Object,String,Number,null,Boolean]},screen:{type:Boolean},swipeTrigger:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean}},K),emits:["update:open","pointerDownOutside","escapeKeyDown","focusOutside","update:fullScreen","ok","cancel","close","openChange"],setup(l,{emit:h}){const c=h,t=l,i=e.useSlots(),b=e.useAttrs(),C=e.ref(),k=ge.getPopoverPortalProps({triggerRef:C,props:t}),S=u.useVModel(t,"open",c,{passive:t.open===void 0,onChange(o){o||c("close"),c("openChange",o)}}),B=async o=>{if(!o&&P.isFunction(t.beforeClose))try{const r=await t.beforeClose();if(t.beforeCloseDebugger&&console.info("beforeClose response",r),!r)return}catch(r){t.beforeCloseDebugger&&console.error("beforeClose error",r);return}S.value=o},g=u.useVModel(t,"fullScreen",c,{}),$=()=>{t.canFullScreen&&(g.value=!g.value)},Y=o=>{c("ok",o)},J=o=>{c("cancel",o)},Q=()=>{t.maskClosable&&B(!1)},X=I.cva(a,{variants:{frameless:n.generateVariantClassList("frameless",a),fullscreen:n.generateVariantClassList("fullscreen",a),width:n.generateVariantClassList([...O,"custom"],a),type:n.generateVariantClassList(W,a),side:n.generateVariantClassList(R,a)}}),A=n.getBemElement(a,"content"),Z=I.cva(A,{variants:{swiping:n.generateVariantClassList("swiping",A)}}),m=e.computed(()=>{let o=n.getValidNumber(t.width);return o!==void 0?o=`${o}px`:P.isString(t.width)&&!O.includes(t.width)&&(o=t.width),{widthVariant:o?"custom":t.width,minWidth:n.getPxSize(t.minWidth,!0),width:o,maxWidth:n.getPxSize(t.maxWidth,!0),minHeight:n.getPxSize(t.minHeight,!0),height:n.getPxSize(t.height,!0),maxHeight:n.getPxSize(t.maxHeight,!0),mobileDrawerMinHeight:n.getPxSize(t.mobileDrawerMinHeight,!0),mobileDrawerHeight:n.getPxSize(t.mobileDrawerHeight,!0),mobileDrawerMaxHeight:n.getPxSize(t.mobileDrawerMaxHeight,!0)}}),ee=()=>{var r;const o=(r=i.trigger)==null?void 0:r.call(i,{});if(!u.isEmptyElement(o))return e.h(y.DialogTrigger,{asChild:!0,ref:C},()=>o)},te=()=>{var r;const o=(r=i.beforeTitle)==null?void 0:r.call(i,{});if(!u.isEmptyElement(o))return o},oe=()=>{const o=()=>{var p;const d=(p=i.beforeActions)==null?void 0:p.call(i,{});if(!u.isEmptyElement(d))return d},r=()=>{const d=[];if(t.canFullScreen&&d.push(e.h(_._sfc_main,{icon:g.value?"tabler:arrows-minimize":"tabler:arrows-maximize",type:"ghost",color:"neutral",onClick:$})),t.closeable&&d.push(e.h(_._sfc_main,{icon:"tabler:x",type:"ghost",color:"neutral",onClick:()=>B(!1)})),d.length)return e.h(q._sfc_main,{gap:"sm"},()=>d)},s=o(),f=r();if(s||f)return e.h("div",{class:n.normCls(n.getBemElement(a,"actions"),t.actionsCls)},[s,f])},ne=()=>{var s;const o=(s=i.title)==null?void 0:s.call(i,{}),r=!u.isEmptyElement(o);if(t.title||r)return e.h(x,{class:t.titleCls},()=>r?o:t.title)},re=()=>{var s;const o=(s=i.description)==null?void 0:s.call(i,{}),r=!u.isEmptyElement(o);if(t.description||r)return e.h(y.DialogDescription,{class:n.normCls(n.getBemElement(a,"description"),"paragraph",t.descriptionCls)},()=>r?o:t.description)},ie=()=>{const o=oe(),r=te();if(t.frameless)return o;const s=()=>{const p=ne();if(p||o||r)return e.h("div",{class:n.normCls(n.getBemElement(a,"title_wrapper"),t.titleWrapperCls)},[r,p,o])},f=re(),d=s();if(d||f)return e.h("div",{class:n.normCls(n.getBemElement(a,"header"),t.headerCls)},[d,f])},le=()=>{var V,z;const o=(V=i.footer)==null?void 0:V.call(i,{}),r=!u.isEmptyElement(o),s=(z=i.beforeFooterActions)==null?void 0:z.call(i,{}),f=!u.isEmptyElement(s);if(t.footer!==void 0&&!t.footer)return null;const p=r?o:(()=>{var H,j;const v=[];(H=t.cancelProps)!=null&&H.hide||v.push(e.h(L._sfc_main,{...G,...t.cancelProps??{},onClick:J},{default:i.cancel,preIcon:i.cancelPreIcon,postIcon:i.cancelPostIcon})),(j=t.okProps)!=null&&j.hide||v.push(e.h(L._sfc_main,{...U,...t.okProps??{},onClick:Y},{default:i.ok,preIcon:i.okPreIcon,postIcon:i.okPostIcon}));const D=[];if(f&&D.push(s),v.length&&D.push(e.h(q._sfc_main,{gap:"sm"},()=>v)),D.length)return D})();if(p)return e.h("div",{class:n.normCls(n.getBemElement(a,"footer"),t.footerCls)},p)},ae=()=>{var r;const o=(r=i.default)==null?void 0:r.call(i,{});if(!u.isEmptyElement(o))return t.noBody?o:e.h("div",{class:n.normCls(n.getBemElement(a,"body"),t.bodyCls)},o)},se=e.computed(()=>{if(t.animated&&P.isString(t.animated))return t.animated;if(t.type==="modal")return n.getBemModifier(a,"fade");switch(t.side){case"start":case"end":return n.getBemModifier(a,"side-x");case"bottom":case"top":return n.getBemModifier(a,"side-y")}}),ce=e.computed(()=>{switch(t.side){case"start":case"top":return-1;case"bottom":case"end":return 1}}),w=e.computed(()=>!g.value&&m.value.widthVariant!=="custom"&&!(t.type==="drawer"&&["top","bottom"].includes(t.side))),T=e.ref(),{isSwiping:M,direction:N,distanceY:F}=fe.usePointerSwipe(T,{disableTextSelect:!0,threshold:50,onSwipeEnd(){t.type==="drawer"&&t.closeable&&(t.side==="bottom"&&N.value==="down"||t.side==="top"&&N.value==="up")&&B(!1)}}),ue=e.computed(()=>{if(!M.value||t.type!=="drawer"||!["top","bottom"].includes(t.side))return;const o=Math.min(Math.abs(F.value)/100,1);let r=-F.value*o*.6;return t.side==="top"?r=Math.min(0,r):r=Math.max(0,r),r}),de=o=>{(!t.keyboard||!t.open)&&(o.preventDefault(),o.stopPropagation()),t.open&&c("escapeKeyDown",o)},me=o=>{t.openAutoFocus||(o.preventDefault(),o.stopPropagation())},pe=o=>{(!t.closeOnClickOutside||!t.open)&&(o.preventDefault(),o.stopPropagation())};return(o,r)=>(e.openBlock(),e.createBlock(e.unref(y.DialogRoot),{open:e.unref(S),"onUpdate:open":B,modal:l.trapFocus},{default:e.withCtx(()=>[e.createVNode(ee),e.createVNode(e.unref(y.DialogPortal),e.normalizeProps(e.guardReactiveProps(e.unref(k))),{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:se.value,css:!!l.animated,duration:l.type==="drawer"?250:200},{default:e.withCtx(()=>[e.unref(k).forceMount||e.unref(S)?(e.openBlock(),e.createBlock(e.unref(y.Primitive),e.mergeProps({"as-child":!w.value||!l.screen,key:String(!w.value||!l.screen),class:{[e.unref(n.normCls)("pc_grid",e.unref(n.getBemElement)(e.unref(a),"wrapper"),l.wrapperCls)]:w.value&&l.screen,[e.unref(n.getBemModifier)(e.unref(a),"as-drawer-in-mobile")]:t.type==="modal"&&l.asDrawerInMobile}},e.unref(b),{style:{zIndex:l.zIndex,"--ptc-dialog-transform":l.fullScreen||l.type==="modal"?"20px":"100%","--ptc-dialog-transform-ratio":ce.value,...e.unref(n.getStyleObject)(w.value&&l.screen?l.wrapperStyle:{})}}),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{"data-screen":l.screen?"":void 0,class:e.normalizeClass(e.unref(n.normCls)({pc_grid__container:w.value},e.unref(X)({frameless:l.frameless,fullscreen:e.unref(g),width:m.value.widthVariant,type:l.type,side:l.side}),t.class)),style:e.normalizeStyle({"--ptc-dialog-w":m.value.width,"--ptc-dialog-min-h":m.value.minHeight,"--ptc-dialog-h":m.value.height,"--ptc-dialog-max-h":m.value.maxHeight,"--ptc-dialog-mobile-drawer-min-h":m.value.mobileDrawerMinHeight,"--ptc-dialog-mobile-drawer-h":m.value.mobileDrawerHeight,"--ptc-dialog-mobile-drawer-max-h":m.value.mobileDrawerMaxHeight,...e.unref(n.getStyleObject)(l.style)})},[!e.unref(g)&&l.mask?(e.openBlock(),e.createBlock(e.unref(ye._sfc_main),{key:0,onClick:Q,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"blanket"),l.blanketCls)),screen:!1},null,8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.DialogContent),{forceMount:e.unref(k).forceMount,onInteractOutside:pe,onOpenAutoFocus:me,onEscapeKeyDown:de,onPointerDownOutside:r[0]||(r[0]=s=>c("pointerDownOutside",s)),onFocusOutside:r[1]||(r[1]=s=>c("focusOutside",s)),class:e.normalizeClass(e.unref(n.normCls)(e.unref(Z)({swiping:e.unref(M)}),l.contentCls)),style:e.normalizeStyle({"--ptc-dialog-swipe-transform":ue.value,...e.unref(n.getStyleObject)(l.contentStyle)})},{default:e.withCtx(()=>[e.createVNode(ie),e.createVNode(ae),e.createVNode(le),t.swipeTrigger&&l.type==="drawer"&&["top","bottom"].includes(t.side)&&!e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"swipeTrigger",ref:T,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"swipe_trigger"),l.swipeTriggerCls))},null,2)):e.createCommentVNode("",!0)]),_:1},8,["forceMount","class","style"])],14,he),[[e.vShow,e.unref(S)]])]),_:1},16,["as-child","class","style"])):e.createCommentVNode("",!0)]),_:1},8,["name","css","duration"])]),_:1},16)]),_:1},8,["open","modal"]))}}),be=u.installComponent(E,n.getComponentName("Dialog")),Ce=u.installComponent(x,n.getComponentName("DialogTitle"));exports.DIALOG_DEFAULT_PROPS=K;exports.Dialog=E;exports.DialogDrawerSides=R;exports.DialogPlugin=be;exports.DialogSizes=O;exports.DialogTitle=x;exports.DialogTitlePlugin=Ce;exports.DialogTypes=W;exports.default=E;
@@ -50,19 +50,21 @@ export declare const DRAWER_DEFAULT_PROPS: {
50
50
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<DrawerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
51
51
  cancel: (event: Event) => any;
52
52
  close: () => any;
53
+ openChange: (value?: boolean | null | undefined) => any;
54
+ "update:open": (value: boolean) => any;
53
55
  escapeKeyDown: (event: KeyboardEvent) => any;
54
56
  pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
55
57
  focusOutside: (event: import('reka-ui').FocusOutsideEvent) => any;
56
- "update:open": (value: boolean) => any;
57
58
  ok: (event: Event) => any;
58
59
  "update:fullScreen": (value: boolean) => any;
59
60
  }, string, import('vue').PublicProps, Readonly<DrawerProps> & Readonly<{
60
61
  onCancel?: ((event: Event) => any) | undefined;
61
62
  onClose?: (() => any) | undefined;
63
+ onOpenChange?: ((value?: boolean | null | undefined) => any) | undefined;
64
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
62
65
  onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
63
66
  onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
64
67
  onFocusOutside?: ((event: import('reka-ui').FocusOutsideEvent) => any) | undefined;
65
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
66
68
  onOk?: ((event: Event) => any) | undefined;
67
69
  "onUpdate:fullScreen"?: ((value: boolean) => any) | undefined;
68
70
  }>, {
@@ -67,7 +67,7 @@ const d = [
67
67
  forceMount: { type: Boolean },
68
68
  disableOutsidePointerEvents: { type: Boolean }
69
69
  }, E),
70
- emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close"],
70
+ emits: ["update:open", "pointerDownOutside", "escapeKeyDown", "focusOutside", "update:fullScreen", "ok", "cancel", "close", "openChange"],
71
71
  setup(e, { emit: t }) {
72
72
  const o = e, l = C(), S = i(), D = x(t), f = _(() => ({
73
73
  ...g(l, d),