@pantograph/vue 0.30.7 → 0.30.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Combobox/Combobox.d.ts +18 -18
- package/dist/Combobox/index.js +95 -95
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Comment/CommentMention.d.ts +34 -34
- package/dist/Comment/index.js +2 -0
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/DataTable/DataTable.d.ts +7 -1
- package/dist/DataTable/index.js +908 -882
- package/dist/DataTable/index.umd.cjs +1 -1
- package/dist/DataTable/types/index.d.ts +6 -0
- package/dist/DataTable/utils/index.d.ts +1 -0
- package/dist/DataTable/utils/useCol.d.ts +1 -2
- package/dist/DataTable/utils/useRow.d.ts +9 -0
- package/dist/GOPicker/GOPicker.d.ts +4 -110
- package/dist/GOPicker/GOPicker.model.d.ts +26 -1
- package/dist/GOPicker/index.js +210 -185
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/Tree/Tree.d.ts +7 -6
- package/dist/Tree/Tree.model.d.ts +1 -1
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/index.umd.cjs +1 -1
- package/dist/Tree/utils.d.ts +1 -1
- package/dist/Upload/Upload.d.ts +1 -1
- package/dist/index-CUuaEiq_.js +1 -0
- package/dist/index-_lrD3ofV.js +741 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/use/index.js +2 -2
- package/dist/use/index.umd.cjs +1 -1
- package/package.json +2 -2
- package/dist/index-DBiL8Htz.js +0 -1
- package/dist/index-Y3XMSR_o.js +0 -740
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ce=require("reka-ui"),x=require("es-toolkit"),_=require("@pantograph/utils-vue"),l=require("@pantograph/utils"),dt=require("../index-CaXYyVxq.js"),Me=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-DldQzFne.js"),gt=require("../GraphicalObjectGroup/index.umd.cjs"),mt=require("../index-SHgIzWWT.js"),ft=require("../Chip.vue_vue_type_style_index_0_lang-BgTLPRMz.js");require("../Input/index.umd.cjs");const Ae=require("@vueuse/core"),vt=require("../Input.vue_vue_type_script_setup_true_lang-DTTGUaRI.js"),ke=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),Re=require("../MenuItem.vue_vue_type_style_index_0_lang-DYhvQVbp.js"),K=require("../isArray-Bin_5of_.js"),qe=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-mMrUHRm_.js");require("../ScrollContainer/index.umd.cjs");require("../Empty/index.umd.cjs");const he=require("../index-DBiL8Htz.js");require("../MenuItem/index.umd.cjs");require("../Checkbox/index.umd.cjs");const yt=require("../Checkbox.vue_vue_type_style_index_0_lang-BfiCl2A5.js"),ht=require("../Skeleton.vue_vue_type_style_index_0_lang-vZBJnVJj.js"),_t=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),ze=require("../index-4j_iV_pN.js"),bt=require("../ConfigProvider/index.umd.cjs"),Te=require("../head-Bg_QoIT5.js"),Ct=require("../ScrollContainer.vue_vue_type_style_index_0_lang-Br7-ZHr3.js"),kt=require("../Empty.vue_vue_type_style_index_0_lang-CRS28Wia.js"),[pe,Fe]=Ce.createContext("Combobox"),O=l.getBemBlock("combobox"),Ke=l.getBemModifier(O,"value-placeholder"),_e=l.getBemElement(O,"option"),xe=["sm","md","lg"],Ne=["error","warning","success"],de=e.defineComponent({...l.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:{},clearIconCls:{},dividerCls:{},leadingCls:{},class:{},allowClear:{type:Boolean},bordered:{type:Boolean,default:void 0},simple:{type:Boolean},size:{},status:{},steps:{type:Boolean}},setup(G){const o=G,p=e.useSlots(),n=pe();Ae.whenever(()=>n.openModel.value&&n.inputRef.value,n.focusOnInput),e.onBeforeUnmount(()=>{n.comboboxInputFocused.value=!1});const k=e.computed(()=>{const z=o.placeholder??n.props.placeholder??"";return(n.props.headerSearch?z:n.placeholder.value)??z}),F=l.getBemElement(O,"input");return(z,b)=>(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(l.normCls)(e.unref(F),{[e.unref(Ke)]: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":b[0]||(b[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(m=>[e.renderSlot(z.$slots,g,e.normalizeProps(e.guardReactiveProps(m)))])})),e.unref(n).props.headerSearch?{name:"leading",fn:e.withCtx(g=>[e.renderSlot(z.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)),()=>[e.createVNode(e.unref(ke._sfc_main),{size:g.iconSize,icon:"tabler:search",flipOnDir:"rtl"},null,8,["size"])])]),key:"0"}:{name:"leading",fn:e.withCtx(g=>[e.renderSlot(z.$slots,"leading",e.normalizeProps(e.guardReactiveProps(g)))]),key:"1"}]),1040,["placeholder","onKeydown","class","contentFit","modelValue"]))}}),xt=e.defineComponent({...l.getComponentOptions("ComboboxTrigger"),__name:"ComboboxTrigger",setup(G){const o=pe(),p=({value:i})=>{i&&K.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)&&!l.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},z=e.computed(()=>F()),b=e.computed(()=>{if(!o.props.noTrailing)return o.props.trailingIcon??"tabler:chevron-down"}),g=e.computed(()=>{var v,y;const i=x.cloneDeep(o.model.value),C=K.isArray(o.model.value);return{modelValue:i,open:x.cloneDeep(o.openModel.value),option:C?void 0:o.getOptionByValue(o.model.value),options:C?(y=(v=o.model.value).map)==null?void 0:y.call(v,o.getOptionByValue).filter(Boolean):void 0}}),m=i=>({...g.value,option:o.getOptionByValue(i)}),s=l.getBemElement(O,"trigger"),R=Me.cva(s,{variants:{size:l.generateVariantClassList(xe,s),headerSearch:l.generateVariantClassList("header-search",s),status:l.generateVariantClassList(Ne,s),bordered:l.generateVariantClassList("bordered",s),multiple:l.generateVariantClassList("multiple",s),contentFit:l.generateVariantClassList("content-fit",s),wrapped:l.generateVariantClassList("wrapped",s),filled:l.generateVariantClassList("filled",s)}}),N=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:l.normCls(R({size:o.getSize.value,status:o.getStatus.value==="success"&&l.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:!l.isEmptyLikeLodash(o.model.value),headerSearch:o.props.headerSearch}),o.props.triggerCls),...o.comboboxTriggerBinding.value})),f=(i,C=n.value)=>e.h(ke._sfc_main,{icon:i,size:C}),J=()=>{var v,y;let i;const C=(y=(v=o.slots).triggerTrailing)==null?void 0:y.call(v,g.value);if(!_.isEmptyElement(C))i=C;else if(b.value&&b.value){const L=b.value===!0?"tabler:chevron-down":b.value;i=f(L)}if(i)return e.h("div",{class:l.normCls(l.getBemElement(s,"trailing"),o.props.triggerTrailingCls)},i)},$=i=>{var v,y;const C=o.getOptionByValue(i)??{_key:i};return e.h(be._sfc_main,{size:o.getTagSize.value,...C?((y=(v=o.props).getTagProps)==null?void 0:y.call(v,C))??{}:{}})},Z=i=>{var v,y;const C=o.getOptionByValue(i)??{_key:i};return e.h(qe._sfc_main,{...C?((y=(v=o.props).getTagProps)==null?void 0:y.call(v,C))??{}:{},size:o.getTagSize.value})},re=()=>{var i,C;if(!o.props.multiple&&!K.isArray(o.model.value)&&o.model.value){let v;x.isString(o.model.value)&&!l.isEmptyLikeLodash(o.model.value)&&(v=o.model.value);const y=v?(C=(i=o.slots).optionLeading)==null?void 0:C.call(i,Re.getMenuContentSlotProps(o.props.size,m(v))):null,L=!_.isEmptyElement(y);if(L||o.props.tagRenderMode&&["avatar","go"].includes(o.props.tagRenderMode)||z.value||o.props.leadingIcon){let T;if(L?T=y:o.props.tagRenderMode==="avatar"?T=$(o.model.value):o.props.tagRenderMode==="go"?T=Z(o.model.value):z.value?T=f(z.value):o.props.leadingIcon&&(T=f(o.props.leadingIcon)),!_.isEmptyElement(T))return e.h("div",{class:l.normCls(l.getBemElement(s,"leading"),o.props.triggerLeadingCls)},T)}}},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(Ce.Slot,x.omit(N.value,["class"]),()=>i);const v=()=>{const I=[],W=[l.getBemElement(s,"tags"),o.props.triggerContentCls,o.props.triggerContentValueCls],D=(()=>{if(o.props.multiple&&K.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:W},()=>o.model.value.map($));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:W},()=>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:W,onClose:p},()=>o.model.value.map(X=>{var oe,ne;const ge=()=>o.getLabelByValue(X),ae=({size:me})=>{const M=F(o.getOptionByValue(X))??o.props.leadingIcon;return M?f(M,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:l.normCls(l.getBemElement(s,"tag"),o.props.tagCls),closeIconCls:l.getBemElement(s,"tag__close")},{text:ge,leading:ae})}))}})();if(D&&I.push(D),o.props.headerSearch?(!o.props.noValueOnPlaceholder||o.props.placeholder)&&I.push(e.h("div",{class:l.normCls(l.getBemElement(s,"content__value"),{[Ke]:o.valuePlaceholder.value})},o.placeholder.value??o.props.placeholder)):I.push(e.h(de,{noValueOnPlaceholder:o.props.noValueOnPlaceholder,searchIcon:!1,bordered:!1,simple:!0})),!_.isEmptyElement(I)||!o.props.contentFit||o.props.trailingIcon)return e.h("div",{class:l.getBemElement(s,"content")},I)},y=[],L=re();_.isEmptyElement(L)||y.push(L),y.push(v());const T=J();return _.isEmptyElement(T)||y.push(T),e.h("button",N.value,y)};return(i,C)=>(e.openBlock(),e.createBlock(ee))}}),De=e.defineComponent({...l.getComponentOptions("ComboboxOption"),__name:"ComboboxOption",props:{option:{}},setup(G){const o=G,p=pe(),n=e.computed(()=>p.isOptionSelected(o.option._key)),k=b=>{var s,R,N,f,J,$;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:b.checkboxSize,disabled:o.option._disabled||p.getDisabled.value}));const m=(R=(s=p.slots).optionLeading)==null?void 0:R.call(s,{...b,option:o.option});return _.isEmptyElement(m)?p.props.tagRenderMode==="avatar"&&p.props.showTriggerTagOnOption?g.push(e.h(be._sfc_main,{size:b.avatarSize,...((f=(N=p.props).getTagProps)==null?void 0:f.call(N,o.option))??{}})):p.props.tagRenderMode==="go"&&p.props.showTriggerTagOnOption?g.push(e.h(qe._sfc_main,{size:b.iconSize,...(($=(J=p.props).getTagProps)==null?void 0:$.call(J,o.option))??{}})):o.option._icon&&g.push(e.h(ke._sfc_main,{icon:o.option._icon,size:p.getIconSize.value})):g.push(m),_.isEmptyElement(g)?null:g},F=e.useAttrs(),z=()=>{const b=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(Re._sfc_main$1,{unExtendParent:!0,class:l.getBemElement(O,"option"),unFocusable:!0,staticStyle:p.props.tree,description:b,title:o.option._label,key:o.option._key,selected:n.value,leadingCenter:!!b,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(b,g)=>(e.openBlock(),e.createBlock(z))}}),Bt=e.defineComponent({...l.getComponentOptions("ComboboxLabel"),__name:"ComboboxLabel",props:{label:{}},setup(G){return(o,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"label"))},e.toDisplayString(o.label),3))}}),Ge=e.defineComponent({...l.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:!0},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:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},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(G,{expose:o,emit:p}){const n=G,k=p,F=()=>{var t,r;n.tree&&(((t=n.filterOptions)==null?void 0:t.expandParent)==="collapse"?N([]):((r=n.filterOptions)==null?void 0:r.expandParent)==="expand"&&N(I.value.filter(a=>a._hasChildren).map(a=>a._key)))},z=x.debounce(t=>{k("search",t),F()},500),b=_.useVModel(n,"search",k,{passive:n.search===void 0,onChange:z}),g=Ae.refDebounced(b,500),m=_.useVModel(n,"open",k,{defaultValue:n.defaultOpen,passive:n.open===void 0,onChange(t){!t&&n.resetSearchTermOnBlur&&(b.value=void 0)}}),s=_.useVModel(n,"modelValue",k,{passive:n.modelValue===void 0,onChange:()=>{var t,r;m.value&&!n.multiple&&(m.value=!1),M!=null&&M.value&&n.sortSelectedItems&&((r=(t=M==null?void 0:M.value)==null?void 0:t.measure)==null||r.call(t))}}),R=_.useVModel(n,"expandedKeys",k,{passive:n.expandedKeys===void 0}),N=x.debounce(t=>{R.value=t},500,{edges:["leading"]}),f=e.useSlots(),J=Ce.useEmitAsProps(k),$=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=l.createOptionGetterFunc({key:"value",getter:n.getValue}),ee={getDisabled:l.createOptionGetterFunc({key:"disabled",getter:n.getDisabled,noReturnOption:!0,defaultValue:!1}),getDescription:l.createOptionGetterFunc({key:"description",getter:n.getDescription,noReturnOption:!0}),getValue:re,getLabel:l.createOptionGetterFunc({key:"label",getter:n.getLabel,noReturnOption:!0,defaultValue:re}),getNoCheckbox:l.createOptionGetterFunc({key:"noCheckbox",getter:n.getNoCheckbox,noReturnOption:!0,defaultValue:!1}),getSingle:l.createOptionGetterFunc({key:"single",getter:n.getSingle,noReturnOption:!0,defaultValue:!1}),getClear:l.createOptionGetterFunc({key:"clear",getter:n.getClear,noReturnOption:!0,defaultValue:!1}),getOptions:l.createOptionGetterFunc({key:"options",getter:n.getOptions,noReturnOption:!0}),getIcon:l.createOptionGetterFunc({key:"icon",getter:n.getIcon,noReturnOption:!0})},i=(t,r)=>{var u;const a=`get${r[0].toUpperCase()+r.slice(1)}`;return(u=ee[a])==null?void 0:u.call(ee,t)},C=(t,r,a)=>!!(!n.tree&&!(r!=null&&r.length)&&(a!=null&&a.length)),v=e.computed(()=>he.flattenByParentKeys({getValue:(t,r,a)=>{const u=i(t,"value");return l.isEmptyLikeLodash(u)&&C(t,r,a)?l.usePCId(_e):u},getDisabled:t=>i(t,"disabled"),arr:n.options??[],getChildren:(t,r)=>{if(!(r!=null&&r.length&&!n.tree))return i(t,"options")},getExtra:t=>{if(t){let r=i(t,"label");return l.isEmptyLikeLodash(r)||(r=String(r)),{_description:i(t,"description"),_label:r,_title:n.tree?r:void 0,_noCheckbox:i(t,"noCheckbox"),_single:i(t,"single"),_clear:i(t,"clear"),_icon:i(t,"icon"),_id:l.usePCId(ye)}}},allowNoValidKey:C})),y=(t,r=!1)=>t?v.value.filter(a=>{var u;if(r){const B=x.last(a._parentKeys??[]);return B&&B===t}return(u=a._parentKeys)==null?void 0:u.includes(t)}):[],L=t=>{var r;if((r=v.value)!=null&&r.length&&!l.isEmptyLikeLodash(t))return v.value.find(a=>a._key===t)},T=t=>{const r=L(t);return r&&(r._label||r._key)||t},te=t=>{const r=L(t);return r?r._single??!1:!1},Q=t=>t===void 0?!1:Array.isArray(s.value)?!!(t&&s.value.includes(t)):s.value===t,I=e.computed(()=>{var u,B;let t=[];const r=new Set,a=c=>{c!=null&&c._key&&!r.has(c._key)&&(t.push(x.cloneDeep(c)),r.add(c._key))};if(g.value?(v.value.forEach(c=>{var h,w;if(c._label&&c._label.toLowerCase().includes(g.value.toLowerCase())&&!r.has(c._key)){if(a(c),c._hasChildren&&y(c._key).forEach(a),(h=n.filterOptions)!=null&&h.strictNode)c._parentKeys&&c._parentKeys.forEach(d=>{if(!r.has(d)){const j=L(d);a(j)}});else if((w=c._parentKeys)!=null&&w.length){const d=Te.head(c._parentKeys);if(!l.isEmptyLikeLodash(d)){if(!r.has(d)){const H=L(d);a(H)}y(d).forEach(a)}}}}),t=t.sort((c,V)=>v.value.findIndex(h=>h._key===c._key)-v.value.findIndex(h=>h._key===V._key))):t=x.cloneDeep(v.value),n.sortSelectedItems&&!n.tree&&!l.isEmptyLikeLodash(s.value)){let c=x.cloneDeep(t);const V=c.filter(E=>Q(E._key)),h=Symbol("root"),w=Symbol("rootGroup"),d={},j=(E,A,P=1)=>{const q=c.splice(E,P);c.splice(A,0,...q)},H=E=>E?c.findIndex(A=>A._key===E):-1,ue=E=>{const A=d[E],P=H(A==null?void 0:A.key);return A!=null&&A.length?P+A.length+1:P+1};V.forEach(E=>{var A;if((A=E._parentKeys)!=null&&A.length){const P=Te.head(E._parentKeys);let q=H(P);const we=Math.max(ue(h),ue(w));if(q>we){const ce=y(P).length;j(q,we,ce+1)}if(d[w]={key:P,length:y(P).length},q=H(P),P&&q>-1){const ce=H(E._key);if(d[P]===void 0)j(ce,q+1);else{const pt=ue(P);j(ce,pt)}d[P]={length:void 0,key:E._key}}}else{const P=H(E._key),q=ue(h);P>q&&j(P,q),d[h]={key:E._key,length:E._hasChildren?y(E._key).length:void 0}}c=x.cloneDeep(c)}),t=c}if(!n.tree){const c=x.cloneDeep(t);for(let V=0;V<c.length-1;V++){const h=c[V],w=c[V+1];!w._divider&&(w._hasChildren||(u=h._parentKeys)!=null&&u.length&&!((B=w._parentKeys)!=null&&B.length))&&(c.splice(V+1,0,{_key:l.usePCId(_e),_divider:!0,_id:l.usePCId(_e)}),V++)}t=c}return t});F();const{getDisabled:W,getStatus:Be,getSize:D}=_.useFormInput({defaults:{size:"md"},exports:["getDisabled","getSize","getStatus"]}),X=e.computed(()=>{switch(D.value){case"sm":return"xsm";case"lg":return"md";case"md":default:return"sm"}}),ge=e.computed(()=>{switch(D.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 I.value.length},getScrollElement:()=>{var t;return(t=ae.value)==null?void 0:t.container.viewportElement},estimateSize:t=>{const r=I.value[t];if(!n.tree&&r){if(r._divider)return 1;if(r._label&&r._hasChildren)return 8+(oe[D.value]??oe.md);if(r._description)return ne[D.value]??ne.md}return ze.systemSizesMap[D.value]??ze.systemSizesMap.md},overscan:5,get gap(){return se[D.value]??0}}));let M,U;if(n.virtual){const{virtualizer:t,...r}=_.useVirtualScroll(me);M=t,U=r}const $e=e.computed(()=>{var t;return n.virtual?(((t=M==null?void 0:M.value)==null?void 0:t.getVirtualItems())??[]).map(r=>I.value[r.index]):I.value}),We=e.computed(()=>(U==null?void 0:U.containerStyles.value)??{}),{inputBindings:Ue,rootBindings:je,focused:He}=_.useInputDataStates({getDisabled:()=>W.value}),Y=e.ref(),fe=()=>{var t;if(m.value&&Y.value&&document.activeElement!==((t=Y.value)==null?void 0:t.input)){Y.value.input.style.pointerEvents="auto";const r=setTimeout(()=>{var a,u;(u=(a=Y.value)==null?void 0:a.focus)==null||u.call(a),clearTimeout(r)},100);Y.value.input.style.pointerEvents=""}},Se=e.computed(()=>!n.noValueOnPlaceholder&&(K.isArray(s.value)?s.value.length===1&&!l.isEmptyLikeLodash(s.value[0]):!l.isEmptyLikeLodash(s.value))),Je=e.computed(()=>{if(Se.value){if(n.multiple&&K.isArray(s.value))return T(x.last(s.value));if(!n.multiple&&!K.isArray(s.value))return T(s.value)}}),{CollectionSlot:Qe,CollectionItem:Ee,itemMap:Xe,getItems:Pe}=_.useCollection({isProvider:!0,key:O}),Oe=()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[],S=e.ref(),ve=t=>{S.value=t},Ie=t=>({"data-disabled":t._disabled?"":void 0,"data-highlighted":S.value===t._key?"":void 0}),le=e.ref(),Ve=(t,r)=>{var a,u;if(r&&((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=K.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(V=>V!==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}=bt.useConfig(),ie=Ye(),Le={props:n,emit:k,onKeyDown:t=>{var r,a,u,B,c,V;if(n.headerSearch||t.stopPropagation(),t.key==="Backspace"&&n.multiple&&K.isArray(s.value)&&l.isEmptyLikeLodash(b.value))s.value=s.value.slice(0,-1);else if(!m.value)(t.key==="ArrowDown"||t.key==="Enter")&&(m.value=!0);else if(m.value){const h=Pe(n.tree);if(t.key==="Escape")m.value=!1;else if(t.key==="Tab"&&!n.headerSearch)m.value=!1;else if(["ArrowDown","ArrowUp"].includes(t.key)){if(h.length){const w=h.findIndex(d=>S.value&&d.value&&d.value===S.value);if(t.key==="ArrowDown"){const d=h[w+1];S.value=(d==null?void 0:d.value)??S.value??h[0].value}else if(t.key==="ArrowUp"){const d=h[w-1];S.value=(d==null?void 0:d.value)??h[0].value}(a=(r=h.find(d=>S.value&&d.value&&d.value===S.value))==null?void 0:r.ref)==null||a.scrollIntoView()}}else if(["ArrowLeft","ArrowRight"].includes(t.key)){const w=L(S.value);h.length&&le.value&&n.tree&&S.value&&w&&((u=R.value)!=null&&u.includes(S.value)&&(ie.value==="ltr"&&t.key==="ArrowLeft"||ie.value==="rtl"&&t.key==="ArrowRight")||!((B=R.value)!=null&&B.includes(S.value))&&(ie.value==="ltr"&&t.key==="ArrowRight"||ie.value==="rtl"&&t.key==="ArrowLeft"))&&((V=(c=le.value).onExpandKey)==null||V.call(c,w))}else t.key==="Enter"&&(h.length===1&&h[0].value&&S.value!==h[0].value&&(S.value=h[0].value),S.value&&Ve(L(S.value),!0),k("keydownEnter",t,b.value));t.key==="Escape"&&k("keydownEscape",t)}},searchModel:b,openModel:m,model:s,slots:f,valuePlaceholder:Se,placeholder:Je,getOptionByValue:L,isOptionSelected:Q,getLabelByValue:T,getSingleByValue:te,inputRef:Y,focusOnInput:fe,getDisabled:W,getStatus:Be,getSize:D,getTagSize:X,getIconSize:ge,comboboxInputBinding:Ue,comboboxTriggerBinding:je,comboboxInputFocused:He,selectOption:Ve,itemMap:Xe,getItems:Pe,highlightedOptionKey:S};Fe(Le),e.watch(()=>[n.clearOnChangeMultiple,n.multiple],()=>{n.clearOnChangeMultiple&&(s.value=void 0)});const Ze=e.computed(()=>({defaultExpandAll:!0,showLine:!0,disabled:W.value,selectionBehavior:"replace",...n.treeProps??{},size:D.value,flattenData:!0,outerVirtualScroll:!0,selectable:!0,focusable:!1,multiple:n.multiple,checkable:n.multiple&&n.checkbox,virtual:M,syncCheckboxAndSelect:n.multiple,data:I.value,modelValue:Oe(),checkedKeys:Oe(),class:l.getBemElement(O,"tree")})),et=e.computed(()=>{const t=n.scrollContainerProps??{};return{...t,areaCls:[l.getBemElement(O,"scroll_area"),t==null?void 0:t.class,t==null?void 0:t.areaCls],wrapProps:{...(t==null?void 0:t.wrapProps)??{},style:(U==null?void 0:U.scrollWrapperStyles.value)??{}}}}),ye=l.getBemElement(O,"popup"),tt=Me.cva(ye,{variants:{size:l.generateVariantClassList(xe,ye)}}),ot=e.computed(()=>l.getPxSize(n.popupWidth,!0)),nt=e.computed(()=>l.getPxSize(n.popupHeight,!0)),lt=e.computed(()=>l.getPxSize(n.minWidth,!0)),rt=()=>{var a,u;const t=(u=f.header)==null?void 0:u.call(f,{isEmpty:!((a=I.value)!=null&&a.length),search:b.value}),r=!_.isEmptyElement(t);if(r||n.headerSearch)return e.h("div",{class:l.getBemElement(O,"header")},r?t:e.h(de,n.headerSearchInputProps||{}))},at=()=>{var a,u;const t=(u=f.footer)==null?void 0:u.call(f,{isEmpty:!((a=I.value)!=null&&a.length),search:b.value});if(!_.isEmptyElement(t))return e.h("div",{class:l.getBemElement(O,"footer")},t)},st=()=>{var a;const t={type:D.value==="sm"?"simple":"advance",...x.omit(n.emptyProps??{},["class"]),class:l.normCls(l.getBemElement(O,"empty"),n.emptyCls)},r=(a=f.empty)==null?void 0:a.call(f,t);return _.isEmptyElement(r)?e.h(kt._sfc_main,t,{title:f.emptyTitle,description:f.emptyDescription,actions:f.emptyActions,image:f.emptyImage}):r},it=()=>{var a;const t=(a=f.loading)==null?void 0:a.call(f,{});return _.isEmptyElement(t)?new Array(I.value.length?2:n.loadingRowCount).fill(1).map(()=>e.h(ht._sfc_main,{size:D.value,class:l.normCls(l.getBemElement(O,"skeleton"),n.skeletonCls),...x.omit(n.skeletonProps??{},["class"])})):t},ut=(t,r,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||!r?s.value=void 0:s.value=t._key;k("select",t._key,r,t)},ct=t=>{t.key==="ArrowDown"&&!m.value?m.value=!0:t.key==="Tab"&&m.value&&(m.value=!1)};return n.disableOutsidePointerEvents&&_.useDisableBodyPointerEvents(m),o(Le),(t,r)=>(e.openBlock(),e.createBlock(e.unref(dt._sfc_main),e.mergeProps({open:e.unref(m),"onUpdate:open":r[2]||(r[2]=a=>e.isRef(m)?m.value=a:null)},$.value,{containerProps:{...t.containerProps??{},onClick:fe},noPadding:!0,size:e.unref(D),containerStyle:{pointerEvents:"auto",display:e.unref(m)?void 0:"none",zIndex:t.zIndex,"--ptc-combobox-popup-width":t.samePopupWidth?void 0:ot.value,"--ptc-combobox-popup-height":nt.value,"--ptc-combobox-trigger-min-w":lt.value},containerCls:e.unref(l.normCls)(e.unref(tt)(n),t.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(()=>[I.value.length||t.loading?(e.openBlock(),e.createBlock(e.unref(Qe),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(O),"options"),t.optionsCls)),style:e.normalizeStyle(t.virtual?We.value:{}),onPointerleave:r[1]||(r[1]=a=>ve(void 0))},[t.tree?(e.openBlock(),e.createBlock(e.unref(he._sfc_main),e.mergeProps({key:0,ref_key:"treeRef",ref:le},Ze.value,{expandedKeys:e.unref(R),"onUpdate:expandedKeys":r[0]||(r[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(Ee),{key:u._key,value:u._key,id:u._id},{default:e.withCtx(()=>[e.createVNode(e.unref(he._sfc_main$1),e.mergeProps({node:u},{ref_for:!0},Ie(u),{onPointermove:B=>ve(u._key),id:u._id}),{default:e.withCtx(()=>[e.createVNode(De,{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($e.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a._key},[a._divider?(e.openBlock(),e.createBlock(_t._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(Ee),{key:2,value:a._key,id:a._id},{default:e.withCtx(()=>[e.createVNode(De,e.mergeProps({option:a},{ref_for:!0},Ie(a),{onPointermove:u=>ve(a._key),id:a._id}),null,16,["option","onPointermove","id"])]),_:2},1032,["value","id"]))],64))),128)),t.loading?(e.openBlock(),e.createBlock(it,{key:2})):e.createCommentVNode("",!0)],38)]),_:1})):(e.openBlock(),e.createBlock(st,{key:1})),t.lazyLoading?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"lazy_loading"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"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(Ge,l.getComponentName("Combobox")),Et=_.installComponent(de,l.getComponentName("ComboboxInput"));exports.Combobox=Ge;exports.ComboboxInput=de;exports.ComboboxInputPlugin=Et;exports.ComboboxPlugin=St;exports.ComboboxSizes=xe;exports.ComboboxStatuses=Ne;exports.injectComboboxContext=pe;exports.provideComboboxContext=Fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ce=require("reka-ui"),x=require("es-toolkit"),_=require("@pantograph/utils-vue"),l=require("@pantograph/utils"),dt=require("../index-CaXYyVxq.js"),Me=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-DldQzFne.js"),gt=require("../GraphicalObjectGroup/index.umd.cjs"),mt=require("../index-SHgIzWWT.js"),ft=require("../Chip.vue_vue_type_style_index_0_lang-BgTLPRMz.js");require("../Input/index.umd.cjs");const Ae=require("@vueuse/core"),vt=require("../Input.vue_vue_type_script_setup_true_lang-DTTGUaRI.js"),ke=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),Re=require("../MenuItem.vue_vue_type_style_index_0_lang-DYhvQVbp.js"),K=require("../isArray-Bin_5of_.js"),qe=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-mMrUHRm_.js");require("../ScrollContainer/index.umd.cjs");require("../Empty/index.umd.cjs");const he=require("../index-CUuaEiq_.js");require("../MenuItem/index.umd.cjs");require("../Checkbox/index.umd.cjs");const yt=require("../Checkbox.vue_vue_type_style_index_0_lang-BfiCl2A5.js"),ht=require("../Skeleton.vue_vue_type_style_index_0_lang-vZBJnVJj.js"),_t=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),ze=require("../index-4j_iV_pN.js"),bt=require("../ConfigProvider/index.umd.cjs"),Te=require("../head-Bg_QoIT5.js"),Ct=require("../ScrollContainer.vue_vue_type_style_index_0_lang-Br7-ZHr3.js"),kt=require("../Empty.vue_vue_type_style_index_0_lang-CRS28Wia.js"),[pe,Fe]=Ce.createContext("Combobox"),O=l.getBemBlock("combobox"),Ke=l.getBemModifier(O,"value-placeholder"),_e=l.getBemElement(O,"option"),xe=["sm","md","lg"],Ne=["error","warning","success"],de=e.defineComponent({...l.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:{},clearIconCls:{},dividerCls:{},leadingCls:{},class:{},allowClear:{type:Boolean},bordered:{type:Boolean,default:void 0},simple:{type:Boolean},size:{},status:{},steps:{type:Boolean}},setup(G){const o=G,p=e.useSlots(),n=pe();Ae.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=l.getBemElement(O,"input");return(T,b)=>(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(l.normCls)(e.unref(F),{[e.unref(Ke)]: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":b[0]||(b[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(m=>[e.renderSlot(T.$slots,g,e.normalizeProps(e.guardReactiveProps(m)))])})),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(ke._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({...l.getComponentOptions("ComboboxTrigger"),__name:"ComboboxTrigger",setup(G){const o=pe(),p=({value:i})=>{i&&K.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)&&!l.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()),b=e.computed(()=>{if(!o.props.noTrailing)return o.props.trailingIcon??"tabler:chevron-down"}),g=e.computed(()=>{var v,y;const i=x.cloneDeep(o.model.value),C=K.isArray(o.model.value);return{modelValue:i,open:x.cloneDeep(o.openModel.value),option:C?void 0:o.getOptionByValue(o.model.value),options:C?(y=(v=o.model.value).map)==null?void 0:y.call(v,o.getOptionByValue).filter(Boolean):void 0}}),m=i=>({...g.value,option:o.getOptionByValue(i)}),s=l.getBemElement(O,"trigger"),R=Me.cva(s,{variants:{size:l.generateVariantClassList(xe,s),headerSearch:l.generateVariantClassList("header-search",s),status:l.generateVariantClassList(Ne,s),bordered:l.generateVariantClassList("bordered",s),multiple:l.generateVariantClassList("multiple",s),contentFit:l.generateVariantClassList("content-fit",s),wrapped:l.generateVariantClassList("wrapped",s),filled:l.generateVariantClassList("filled",s)}}),N=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:l.normCls(R({size:o.getSize.value,status:o.getStatus.value==="success"&&l.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:!l.isEmptyLikeLodash(o.model.value),headerSearch:o.props.headerSearch}),o.props.triggerCls),...o.comboboxTriggerBinding.value})),f=(i,C=n.value)=>e.h(ke._sfc_main,{icon:i,size:C}),J=()=>{var v,y;let i;const C=(y=(v=o.slots).triggerTrailing)==null?void 0:y.call(v,g.value);if(!_.isEmptyElement(C))i=C;else if(b.value&&b.value){const L=b.value===!0?"tabler:chevron-down":b.value;i=f(L)}if(i)return e.h("div",{class:l.normCls(l.getBemElement(s,"trailing"),o.props.triggerTrailingCls)},i)},$=i=>{var v,y;const C=o.getOptionByValue(i)??{_key:i};return e.h(be._sfc_main,{size:o.getTagSize.value,...C?((y=(v=o.props).getTagProps)==null?void 0:y.call(v,C))??{}:{}})},Z=i=>{var v,y;const C=o.getOptionByValue(i)??{_key:i};return e.h(qe._sfc_main,{...C?((y=(v=o.props).getTagProps)==null?void 0:y.call(v,C))??{}:{},size:o.getTagSize.value})},re=()=>{var i,C;if(!o.props.multiple&&!K.isArray(o.model.value)&&o.model.value){let v;x.isString(o.model.value)&&!l.isEmptyLikeLodash(o.model.value)&&(v=o.model.value);const y=v?(C=(i=o.slots).optionLeading)==null?void 0:C.call(i,Re.getMenuContentSlotProps(o.props.size,m(v))):null,L=!_.isEmptyElement(y);if(L||o.props.tagRenderMode&&["avatar","go"].includes(o.props.tagRenderMode)||T.value||o.props.leadingIcon){let D;if(L?D=y:o.props.tagRenderMode==="avatar"?D=$(o.model.value):o.props.tagRenderMode==="go"?D=Z(o.model.value):T.value?D=f(T.value):o.props.leadingIcon&&(D=f(o.props.leadingIcon)),!_.isEmptyElement(D))return e.h("div",{class:l.normCls(l.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(Ce.Slot,x.omit(N.value,["class"]),()=>i);const v=()=>{const I=[],W=[l.getBemElement(s,"tags"),o.props.triggerContentCls,o.props.triggerContentValueCls],w=(()=>{if(o.props.multiple&&K.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:W},()=>o.model.value.map($));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:W},()=>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:W,onClose:p},()=>o.model.value.map(X=>{var oe,ne;const ge=()=>o.getLabelByValue(X),ae=({size:me})=>{const M=F(o.getOptionByValue(X))??o.props.leadingIcon;return M?f(M,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:l.normCls(l.getBemElement(s,"tag"),o.props.tagCls),closeIconCls:l.getBemElement(s,"tag__close")},{text:ge,leading:ae})}))}})();if(w&&I.push(w),o.props.headerSearch?(!o.props.noValueOnPlaceholder||o.props.placeholder)&&I.push(e.h("div",{class:l.normCls(l.getBemElement(s,"content__value"),{[Ke]:o.valuePlaceholder.value})},o.placeholder.value??o.props.placeholder)):I.push(e.h(de,{noValueOnPlaceholder:o.props.noValueOnPlaceholder,searchIcon:!1,bordered:!1,simple:!0})),!_.isEmptyElement(I)||!o.props.contentFit||o.props.trailingIcon)return e.h("div",{class:l.getBemElement(s,"content")},I)},y=[],L=re();_.isEmptyElement(L)||y.push(L),y.push(v());const D=J();return _.isEmptyElement(D)||y.push(D),e.h("button",N.value,y)};return(i,C)=>(e.openBlock(),e.createBlock(ee))}}),De=e.defineComponent({...l.getComponentOptions("ComboboxOption"),__name:"ComboboxOption",props:{option:{}},setup(G){const o=G,p=pe(),n=e.computed(()=>p.isOptionSelected(o.option._key)),k=b=>{var s,R,N,f,J,$;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:b.checkboxSize,disabled:o.option._disabled||p.getDisabled.value}));const m=(R=(s=p.slots).optionLeading)==null?void 0:R.call(s,{...b,option:o.option});return _.isEmptyElement(m)?p.props.tagRenderMode==="avatar"&&p.props.showTriggerTagOnOption?g.push(e.h(be._sfc_main,{size:b.avatarSize,...((f=(N=p.props).getTagProps)==null?void 0:f.call(N,o.option))??{}})):p.props.tagRenderMode==="go"&&p.props.showTriggerTagOnOption?g.push(e.h(qe._sfc_main,{size:b.iconSize,...(($=(J=p.props).getTagProps)==null?void 0:$.call(J,o.option))??{}})):o.option._icon&&g.push(e.h(ke._sfc_main,{icon:o.option._icon,size:p.getIconSize.value})):g.push(m),_.isEmptyElement(g)?null:g},F=e.useAttrs(),T=()=>{const b=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(Re._sfc_main$1,{unExtendParent:!0,class:l.getBemElement(O,"option"),unFocusable:!0,staticStyle:p.props.tree,description:b,title:o.option._label,key:o.option._key,selected:n.value,leadingCenter:!!b,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(b,g)=>(e.openBlock(),e.createBlock(T))}}),Bt=e.defineComponent({...l.getComponentOptions("ComboboxLabel"),__name:"ComboboxLabel",props:{label:{}},setup(G){return(o,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"label"))},e.toDisplayString(o.label),3))}}),Ge=e.defineComponent({...l.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:!0},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:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},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(G,{expose:o,emit:p}){const n=G,k=p,F=()=>{var t,r;n.tree&&(((t=n.filterOptions)==null?void 0:t.expandParent)==="collapse"?N([]):((r=n.filterOptions)==null?void 0:r.expandParent)==="expand"&&N(I.value.filter(a=>a._hasChildren).map(a=>a._key)))},T=x.debounce(t=>{k("search",t),F()},500),b=_.useVModel(n,"search",k,{passive:n.search===void 0,onChange:T}),g=Ae.refDebounced(b,500),m=_.useVModel(n,"open",k,{defaultValue:n.defaultOpen,passive:n.open===void 0,onChange(t){!t&&n.resetSearchTermOnBlur&&(b.value=void 0)}}),s=_.useVModel(n,"modelValue",k,{passive:n.modelValue===void 0,onChange:()=>{var t,r;m.value&&!n.multiple&&(m.value=!1),M!=null&&M.value&&n.sortSelectedItems&&((r=(t=M==null?void 0:M.value)==null?void 0:t.measure)==null||r.call(t))}}),R=_.useVModel(n,"expandedKeys",k,{passive:n.expandedKeys===void 0}),N=x.debounce(t=>{R.value=t},500,{edges:["leading"]}),f=e.useSlots(),J=Ce.useEmitAsProps(k),$=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=l.createOptionGetterFunc({key:"value",getter:n.getValue}),ee={getDisabled:l.createOptionGetterFunc({key:"disabled",getter:n.getDisabled,noReturnOption:!0,defaultValue:!1}),getDescription:l.createOptionGetterFunc({key:"description",getter:n.getDescription,noReturnOption:!0}),getValue:re,getLabel:l.createOptionGetterFunc({key:"label",getter:n.getLabel,noReturnOption:!0,defaultValue:re}),getNoCheckbox:l.createOptionGetterFunc({key:"noCheckbox",getter:n.getNoCheckbox,noReturnOption:!0,defaultValue:!1}),getSingle:l.createOptionGetterFunc({key:"single",getter:n.getSingle,noReturnOption:!0,defaultValue:!1}),getClear:l.createOptionGetterFunc({key:"clear",getter:n.getClear,noReturnOption:!0,defaultValue:!1}),getOptions:l.createOptionGetterFunc({key:"options",getter:n.getOptions,noReturnOption:!0}),getIcon:l.createOptionGetterFunc({key:"icon",getter:n.getIcon,noReturnOption:!0})},i=(t,r)=>{var u;const a=`get${r[0].toUpperCase()+r.slice(1)}`;return(u=ee[a])==null?void 0:u.call(ee,t)},C=(t,r,a)=>!!(!n.tree&&!(r!=null&&r.length)&&(a!=null&&a.length)),v=e.computed(()=>he.flattenByParentKeys({getValue:(t,r,a)=>{const u=i(t,"value");return l.isEmptyLikeLodash(u)&&C(t,r,a)?l.usePCId(_e):u},getDisabled:t=>i(t,"disabled"),arr:n.options??[],getChildren:(t,r)=>{if(!(r!=null&&r.length&&!n.tree))return i(t,"options")},getExtra:t=>{if(t){let r=i(t,"label");return l.isEmptyLikeLodash(r)||(r=String(r)),{_description:i(t,"description"),_label:r,_title:n.tree?r:void 0,_noCheckbox:i(t,"noCheckbox"),_single:i(t,"single"),_clear:i(t,"clear"),_icon:i(t,"icon"),_id:l.usePCId(ye)}}},allowNoValidKey:C})),y=(t,r=!1)=>t?v.value.filter(a=>{var u;if(r){const B=x.last(a._parentKeys??[]);return B&&B===t}return(u=a._parentKeys)==null?void 0:u.includes(t)}):[],L=t=>{var r;if((r=v.value)!=null&&r.length&&!l.isEmptyLikeLodash(t))return v.value.find(a=>a._key===t)},D=t=>{const r=L(t);return r&&(r._label||r._key)||t},te=t=>{const r=L(t);return r?r._single??!1:!1},Q=t=>t===void 0?!1:Array.isArray(s.value)?!!(t&&s.value.includes(t)):s.value===t,I=e.computed(()=>{var u,B;let t=[];const r=new Set,a=c=>{c!=null&&c._key&&!r.has(c._key)&&(t.push(x.cloneDeep(c)),r.add(c._key))};if(g.value?(v.value.forEach(c=>{var h,z;if(c._label&&c._label.toLowerCase().includes(g.value.toLowerCase())&&!r.has(c._key)){if(a(c),c._hasChildren&&y(c._key).forEach(a),(h=n.filterOptions)!=null&&h.strictNode)c._parentKeys&&c._parentKeys.forEach(d=>{if(!r.has(d)){const j=L(d);a(j)}});else if((z=c._parentKeys)!=null&&z.length){const d=Te.head(c._parentKeys);if(!l.isEmptyLikeLodash(d)){if(!r.has(d)){const H=L(d);a(H)}y(d).forEach(a)}}}}),t=t.sort((c,V)=>v.value.findIndex(h=>h._key===c._key)-v.value.findIndex(h=>h._key===V._key))):t=x.cloneDeep(v.value),n.sortSelectedItems&&!n.tree&&!l.isEmptyLikeLodash(s.value)){let c=x.cloneDeep(t);const V=c.filter(E=>Q(E._key)),h=Symbol("root"),z=Symbol("rootGroup"),d={},j=(E,A,P=1)=>{const q=c.splice(E,P);c.splice(A,0,...q)},H=E=>E?c.findIndex(A=>A._key===E):-1,ue=E=>{const A=d[E],P=H(A==null?void 0:A.key);return A!=null&&A.length?P+A.length+1:P+1};V.forEach(E=>{var A;if((A=E._parentKeys)!=null&&A.length){const P=Te.head(E._parentKeys);let q=H(P);const we=Math.max(ue(h),ue(z));if(q>we){const ce=y(P).length;j(q,we,ce+1)}if(d[z]={key:P,length:y(P).length},q=H(P),P&&q>-1){const ce=H(E._key);if(d[P]===void 0)j(ce,q+1);else{const pt=ue(P);j(ce,pt)}d[P]={length:void 0,key:E._key}}}else{const P=H(E._key),q=ue(h);P>q&&j(P,q),d[h]={key:E._key,length:E._hasChildren?y(E._key).length:void 0}}c=x.cloneDeep(c)}),t=c}if(!n.tree){const c=x.cloneDeep(t);for(let V=0;V<c.length-1;V++){const h=c[V],z=c[V+1];!z._divider&&(z._hasChildren||(u=h._parentKeys)!=null&&u.length&&!((B=z._parentKeys)!=null&&B.length))&&(c.splice(V+1,0,{_key:l.usePCId(_e),_divider:!0,_id:l.usePCId(_e)}),V++)}t=c}return t});F();const{getDisabled:W,getStatus:Be,getSize:w}=_.useFormInput({defaults:{size:"md"},exports:["getDisabled","getSize","getStatus"]}),X=e.computed(()=>{switch(w.value){case"sm":return"xsm";case"lg":return"md";case"md":default:return"sm"}}),ge=e.computed(()=>{switch(w.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 I.value.length},getScrollElement:()=>{var t;return(t=ae.value)==null?void 0:t.container.viewportElement},estimateSize:t=>{const r=I.value[t];if(!n.tree&&r){if(r._divider)return 1;if(r._label&&r._hasChildren)return 8+(oe[w.value]??oe.md);if(r._description)return ne[w.value]??ne.md}return ze.systemSizesMap[w.value]??ze.systemSizesMap.md},overscan:5,get gap(){return se[w.value]??0}}));let M,U;if(n.virtual){const{virtualizer:t,...r}=_.useVirtualScroll(me);M=t,U=r}const $e=e.computed(()=>{var t;return n.virtual?(((t=M==null?void 0:M.value)==null?void 0:t.getVirtualItems())??[]).map(r=>I.value[r.index]):I.value}),We=e.computed(()=>(U==null?void 0:U.containerStyles.value)??{}),{inputBindings:Ue,rootBindings:je,focused:He}=_.useInputDataStates({getDisabled:()=>W.value}),Y=e.ref(),fe=()=>{var t;if(m.value&&Y.value&&document.activeElement!==((t=Y.value)==null?void 0:t.input)){Y.value.input.style.pointerEvents="auto";const r=setTimeout(()=>{var a,u;(u=(a=Y.value)==null?void 0:a.focus)==null||u.call(a),clearTimeout(r)},100);Y.value.input.style.pointerEvents=""}},Se=e.computed(()=>!n.noValueOnPlaceholder&&(K.isArray(s.value)?s.value.length===1&&!l.isEmptyLikeLodash(s.value[0]):!l.isEmptyLikeLodash(s.value))),Je=e.computed(()=>{if(Se.value){if(n.multiple&&K.isArray(s.value))return D(x.last(s.value));if(!n.multiple&&!K.isArray(s.value))return D(s.value)}}),{CollectionSlot:Qe,CollectionItem:Ee,itemMap:Xe,getItems:Pe}=_.useCollection({isProvider:!0,key:O}),Oe=()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[],S=e.ref(),ve=t=>{S.value=t},Ie=t=>({"data-disabled":t._disabled?"":void 0,"data-highlighted":S.value===t._key?"":void 0}),le=e.ref(),Ve=(t,r)=>{var a,u;if(r&&((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=K.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(V=>V!==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}=bt.useConfig(),ie=Ye(),Le={props:n,emit:k,onKeyDown:t=>{var r,a,u,B,c,V;if(n.headerSearch||t.stopPropagation(),t.key==="Backspace"&&n.multiple&&K.isArray(s.value)&&l.isEmptyLikeLodash(b.value))s.value=s.value.slice(0,-1);else if(!m.value)(t.key==="ArrowDown"||t.key==="Enter")&&(m.value=!0);else if(m.value){const h=Pe(n.tree);if(t.key==="Escape")m.value=!1;else if(t.key==="Tab"&&!n.headerSearch)m.value=!1;else if(["ArrowDown","ArrowUp"].includes(t.key)){if(h.length){const z=h.findIndex(d=>S.value&&d.value&&d.value===S.value);if(t.key==="ArrowDown"){const d=h[z+1];S.value=(d==null?void 0:d.value)??S.value??h[0].value}else if(t.key==="ArrowUp"){const d=h[z-1];S.value=(d==null?void 0:d.value)??h[0].value}(a=(r=h.find(d=>S.value&&d.value&&d.value===S.value))==null?void 0:r.ref)==null||a.scrollIntoView()}}else if(["ArrowLeft","ArrowRight"].includes(t.key)){const z=L(S.value);h.length&&le.value&&n.tree&&S.value&&z&&((u=R.value)!=null&&u.includes(S.value)&&(ie.value==="ltr"&&t.key==="ArrowLeft"||ie.value==="rtl"&&t.key==="ArrowRight")||!((B=R.value)!=null&&B.includes(S.value))&&(ie.value==="ltr"&&t.key==="ArrowRight"||ie.value==="rtl"&&t.key==="ArrowLeft"))&&((V=(c=le.value).onExpandKey)==null||V.call(c,z))}else t.key==="Enter"&&(h.length===1&&h[0].value&&S.value!==h[0].value&&(S.value=h[0].value),S.value&&Ve(L(S.value),!0),k("keydownEnter",t,b.value));t.key==="Escape"&&k("keydownEscape",t)}},searchModel:b,openModel:m,model:s,slots:f,valuePlaceholder:Se,placeholder:Je,getOptionByValue:L,isOptionSelected:Q,getLabelByValue:D,getSingleByValue:te,inputRef:Y,focusOnInput:fe,getDisabled:W,getStatus:Be,getSize:w,getTagSize:X,getIconSize:ge,comboboxInputBinding:Ue,comboboxTriggerBinding:je,comboboxInputFocused:He,selectOption:Ve,itemMap:Xe,getItems:Pe,highlightedOptionKey:S};Fe(Le),e.watch(()=>[n.clearOnChangeMultiple,n.multiple],()=>{n.clearOnChangeMultiple&&(s.value=void 0)});const Ze=e.computed(()=>({defaultExpandAll:!0,showLine:!0,disabled:W.value,selectionBehavior:"replace",...n.treeProps??{},size:w.value,flattenData:!0,outerVirtualScroll:!0,selectable:!0,focusable:!1,multiple:n.multiple,checkable:n.multiple&&n.checkbox,virtual:M,syncCheckboxAndSelect:n.multiple,data:I.value,modelValue:Oe(),checkedKeys:Oe(),class:l.getBemElement(O,"tree")})),et=e.computed(()=>{const t=n.scrollContainerProps??{};return{...t,areaCls:[l.getBemElement(O,"scroll_area"),t==null?void 0:t.class,t==null?void 0:t.areaCls],wrapProps:{...(t==null?void 0:t.wrapProps)??{},style:(U==null?void 0:U.scrollWrapperStyles.value)??{}}}}),ye=l.getBemElement(O,"popup"),tt=Me.cva(ye,{variants:{size:l.generateVariantClassList(xe,ye)}}),ot=e.computed(()=>l.getPxSize(n.popupWidth,!0)),nt=e.computed(()=>l.getPxSize(n.popupHeight,!0)),lt=e.computed(()=>l.getPxSize(n.minWidth,!0)),rt=()=>{var a,u;const t=(u=f.header)==null?void 0:u.call(f,{isEmpty:!((a=I.value)!=null&&a.length),search:b.value}),r=!_.isEmptyElement(t);if(r||n.headerSearch)return e.h("div",{class:l.getBemElement(O,"header")},r?t:e.h(de,n.headerSearchInputProps||{}))},at=()=>{var a,u;const t=(u=f.footer)==null?void 0:u.call(f,{isEmpty:!((a=I.value)!=null&&a.length),search:b.value});if(!_.isEmptyElement(t))return e.h("div",{class:l.getBemElement(O,"footer")},t)},st=()=>{var a;const t={type:w.value==="sm"?"simple":"advance",...x.omit(n.emptyProps??{},["class"]),class:l.normCls(l.getBemElement(O,"empty"),n.emptyCls)},r=(a=f.empty)==null?void 0:a.call(f,t);return _.isEmptyElement(r)?e.h(kt._sfc_main,t,{title:f.emptyTitle,description:f.emptyDescription,actions:f.emptyActions,image:f.emptyImage}):r},it=()=>{var a;const t=(a=f.loading)==null?void 0:a.call(f,{});return _.isEmptyElement(t)?new Array(I.value.length?2:n.loadingRowCount).fill(1).map(()=>e.h(ht._sfc_main,{size:w.value,class:l.normCls(l.getBemElement(O,"skeleton"),n.skeletonCls),...x.omit(n.skeletonProps??{},["class"])})):t},ut=(t,r,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||!r?s.value=void 0:s.value=t._key;k("select",t._key,r,t)},ct=t=>{t.key==="ArrowDown"&&!m.value?m.value=!0:t.key==="Tab"&&m.value&&(m.value=!1)};return n.disableOutsidePointerEvents&&_.useDisableBodyPointerEvents(m),o(Le),(t,r)=>(e.openBlock(),e.createBlock(e.unref(dt._sfc_main),e.mergeProps({open:e.unref(m),"onUpdate:open":r[2]||(r[2]=a=>e.isRef(m)?m.value=a:null)},$.value,{containerProps:{...t.containerProps??{},onClick:fe},noPadding:!0,size:e.unref(w),containerStyle:{pointerEvents:"auto",display:e.unref(m)?void 0:"none",zIndex:t.zIndex,"--ptc-combobox-popup-width":t.samePopupWidth?void 0:ot.value,"--ptc-combobox-popup-height":nt.value,"--ptc-combobox-trigger-min-w":lt.value},containerCls:e.unref(l.normCls)(e.unref(tt)({size:e.unref(w)}),t.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(()=>[I.value.length||t.loading?(e.openBlock(),e.createBlock(e.unref(Qe),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(O),"options"),t.optionsCls)),style:e.normalizeStyle(t.virtual?We.value:{}),onPointerleave:r[1]||(r[1]=a=>ve(void 0))},[t.tree?(e.openBlock(),e.createBlock(e.unref(he._sfc_main),e.mergeProps({key:0,ref_key:"treeRef",ref:le},Ze.value,{expandedKeys:e.unref(R),"onUpdate:expandedKeys":r[0]||(r[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(Ee),{key:u._key,value:u._key,id:u._id},{default:e.withCtx(()=>[e.createVNode(e.unref(he._sfc_main$1),e.mergeProps({node:u},{ref_for:!0},Ie(u),{onPointermove:B=>ve(u._key),id:u._id}),{default:e.withCtx(()=>[e.createVNode(De,{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($e.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a._key},[a._divider?(e.openBlock(),e.createBlock(_t._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(Ee),{key:2,value:a._key,id:a._id},{default:e.withCtx(()=>[e.createVNode(De,e.mergeProps({option:a},{ref_for:!0},Ie(a),{onPointermove:u=>ve(a._key),id:a._id}),null,16,["option","onPointermove","id"])]),_:2},1032,["value","id"]))],64))),128)),t.loading?(e.openBlock(),e.createBlock(it,{key:2})):e.createCommentVNode("",!0)],38)]),_:1})):(e.openBlock(),e.createBlock(st,{key:1})),t.lazyLoading?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"lazy_loading"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(O),"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(Ge,l.getComponentName("Combobox")),Et=_.installComponent(de,l.getComponentName("ComboboxInput"));exports.Combobox=Ge;exports.ComboboxInput=de;exports.ComboboxInputPlugin=Et;exports.ComboboxPlugin=St;exports.ComboboxSizes=xe;exports.ComboboxStatuses=Ne;exports.injectComboboxContext=pe;exports.provideComboboxContext=Fe;
|
|
@@ -106,11 +106,11 @@ declare function __VLS_template(): {
|
|
|
106
106
|
readonly onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
107
107
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
108
108
|
readonly "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
109
|
+
readonly "onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
110
|
+
readonly onFetch?: (() => any) | undefined;
|
|
109
111
|
readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
110
112
|
readonly onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
|
|
111
113
|
readonly onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
|
|
112
|
-
readonly "onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
113
|
-
readonly onFetch?: (() => any) | undefined;
|
|
114
114
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
115
115
|
$attrs: {
|
|
116
116
|
[x: string]: unknown;
|
|
@@ -445,9 +445,9 @@ declare function __VLS_template(): {
|
|
|
445
445
|
}) => any) | undefined;
|
|
446
446
|
readonly "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
447
447
|
readonly onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
448
|
+
readonly onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
448
449
|
readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
449
450
|
readonly "onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
450
|
-
readonly onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
451
451
|
readonly onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
452
452
|
readonly onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
453
453
|
readonly onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -468,7 +468,7 @@ declare function __VLS_template(): {
|
|
|
468
468
|
$emit: ((event: "select", node: object | import('..').TreeNodeType, selected: boolean, selectedKeys: string[]) => void) & ((event: "change", value: {
|
|
469
469
|
modelValue: string[];
|
|
470
470
|
checkedKeys: string[];
|
|
471
|
-
}) => void) & ((event: "update:modelValue", value: string[]) => void) & ((event: "expand", node: object | import('..').TreeNodeType, expanded: boolean) => void) & ((event: "
|
|
471
|
+
}) => void) & ((event: "update:modelValue", value: string[]) => void) & ((event: "expand", node: object | import('..').TreeNodeType, expanded: boolean) => void) & ((event: "check", node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "update:checkedKeys", value: string[]) => void) & ((event: "dragStart", event: import('..').TreeDragEvent) => void) & ((event: "dragEnd", event: import('..').TreeDragEvent) => void) & ((event: "choose", event: import('@pantograph/sortable').SortableEvent) => void) & ((event: "unchoose", event: import('@pantograph/sortable').SortableEvent) => void);
|
|
472
472
|
$el: any;
|
|
473
473
|
$options: import('vue').ComponentOptionsBase<Readonly<import('..').TreeProps> & Readonly<{
|
|
474
474
|
onSelect?: ((node: object | import('..').TreeNodeType, selected: boolean, selectedKeys: string[]) => any) | undefined;
|
|
@@ -478,9 +478,9 @@ declare function __VLS_template(): {
|
|
|
478
478
|
}) => any) | undefined;
|
|
479
479
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
480
480
|
onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
481
|
+
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
481
482
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
482
483
|
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
483
|
-
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
484
484
|
onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
485
485
|
onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
486
486
|
onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -489,7 +489,7 @@ declare function __VLS_template(): {
|
|
|
489
489
|
disabled: import('vue').ComputedRef<boolean | undefined>;
|
|
490
490
|
props: import('..').TreeProps;
|
|
491
491
|
dir: import('vue').ComputedRef<import('..').Direction | undefined>;
|
|
492
|
-
expandedKeys: import('vue').Ref<string[]>;
|
|
492
|
+
expandedKeys: import('vue').Ref<string[] | undefined>;
|
|
493
493
|
model: import('vue').WritableComputedRef<string[]>;
|
|
494
494
|
checked: import('vue').Ref<string[]>;
|
|
495
495
|
dragging: import('vue').Ref<boolean>;
|
|
@@ -519,9 +519,9 @@ declare function __VLS_template(): {
|
|
|
519
519
|
}) => any;
|
|
520
520
|
"update:modelValue": (value: string[]) => any;
|
|
521
521
|
expand: (node: object | import('..').TreeNodeType, expanded: boolean) => any;
|
|
522
|
+
check: (node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any;
|
|
522
523
|
"update:expandedKeys": (value: string[]) => any;
|
|
523
524
|
"update:checkedKeys": (value: string[]) => any;
|
|
524
|
-
check: (node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any;
|
|
525
525
|
dragStart: (event: import('..').TreeDragEvent) => any;
|
|
526
526
|
dragEnd: (event: import('..').TreeDragEvent) => any;
|
|
527
527
|
choose: (event: import('@pantograph/sortable').SortableEvent) => any;
|
|
@@ -564,9 +564,9 @@ declare function __VLS_template(): {
|
|
|
564
564
|
}) => any) | undefined;
|
|
565
565
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
566
566
|
onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
567
|
+
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
567
568
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
568
569
|
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
569
|
-
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
570
570
|
onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
571
571
|
onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
572
572
|
onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -575,7 +575,7 @@ declare function __VLS_template(): {
|
|
|
575
575
|
disabled: import('vue').ComputedRef<boolean | undefined>;
|
|
576
576
|
props: import('..').TreeProps;
|
|
577
577
|
dir: import('vue').ComputedRef<import('..').Direction | undefined>;
|
|
578
|
-
expandedKeys: import('vue').Ref<string[]>;
|
|
578
|
+
expandedKeys: import('vue').Ref<string[] | undefined>;
|
|
579
579
|
model: import('vue').WritableComputedRef<string[]>;
|
|
580
580
|
checked: import('vue').Ref<string[]>;
|
|
581
581
|
dragging: import('vue').Ref<boolean>;
|
|
@@ -608,7 +608,7 @@ declare function __VLS_template(): {
|
|
|
608
608
|
$root: import('vue').ComponentPublicInstance | null;
|
|
609
609
|
$parent: import('vue').ComponentPublicInstance | null;
|
|
610
610
|
$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: "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:modelValue", value: string | string[]) => void) & ((event: "update:
|
|
611
|
+
$emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => 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:modelValue", value: string | string[]) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void);
|
|
612
612
|
$el: any;
|
|
613
613
|
$options: import('vue').ComponentOptionsBase<Readonly<ComboboxProps> & Readonly<{
|
|
614
614
|
onSearch?: ((value?: string | null | undefined) => any) | undefined;
|
|
@@ -621,11 +621,11 @@ declare function __VLS_template(): {
|
|
|
621
621
|
onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
622
622
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
623
623
|
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
624
|
+
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
625
|
+
onFetch?: (() => 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;
|
|
627
|
-
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
628
|
-
onFetch?: (() => any) | undefined;
|
|
629
629
|
}>, {
|
|
630
630
|
isOptionSelected: (value?: string) => boolean;
|
|
631
631
|
getOptionByValue: (value: string) => import('../Combobox/types').ComboboxFlattenOptionType | undefined;
|
|
@@ -665,11 +665,11 @@ declare function __VLS_template(): {
|
|
|
665
665
|
interactOutside: (event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any;
|
|
666
666
|
"update:open": (value: boolean) => any;
|
|
667
667
|
"update:modelValue": (value: string | string[]) => any;
|
|
668
|
+
"update:search": (value?: string | null | undefined) => any;
|
|
669
|
+
fetch: () => any;
|
|
668
670
|
"update:expandedKeys": (value: string[]) => any;
|
|
669
671
|
keydownEnter: (value: KeyboardEvent, searchModel?: string | undefined) => any;
|
|
670
672
|
keydownEscape: (value: KeyboardEvent) => any;
|
|
671
|
-
"update:search": (value?: string | null | undefined) => any;
|
|
672
|
-
fetch: () => any;
|
|
673
673
|
}, string, {
|
|
674
674
|
disabled: boolean;
|
|
675
675
|
bordered: boolean;
|
|
@@ -745,12 +745,12 @@ declare function __VLS_template(): {
|
|
|
745
745
|
onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
746
746
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
747
747
|
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
748
|
+
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
749
|
+
onFetch?: (() => any) | undefined;
|
|
748
750
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
749
751
|
onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
|
|
750
752
|
onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
|
|
751
|
-
|
|
752
|
-
onFetch?: (() => any) | undefined;
|
|
753
|
-
}>, "props" | "placeholder" | "slots" | "emit" | "getIconSize" | "getDisabled" | "getStatus" | "getSize" | "model" | "inputRef" | "getItems" | "itemMap" | "openModel" | "focusOnInput" | ("disabled" | "bordered" | "prioritizePosition" | "placement" | "sideOffset" | "avoidCollisions" | "defaultOpen" | "open" | "disableOutsidePointerEvents" | "checkbox" | "multiple" | "trailingIcon" | "selectedItemIconAsTrailingIcon" | "indicatorIcon" | "loadingRowCount" | "clearOnChangeMultiple" | "samePopupWidth" | "popupHeight" | "resetSearchTermOnBlur" | "resetSearchTermOnSelect" | "tagRenderMode") | "isOptionSelected" | "getOptionByValue" | "getLabelByValue" | "getSingleByValue" | "getTagSize" | "comboboxInputBinding" | "comboboxTriggerBinding" | "searchModel" | "valuePlaceholder" | "selectOption" | "highlightedOptionKey" | "comboboxInputFocused" | "onKeyDown"> & import('vue').ShallowUnwrapRef<{
|
|
753
|
+
}>, "props" | "placeholder" | "slots" | "emit" | "getIconSize" | "getDisabled" | "getStatus" | "getSize" | "model" | "inputRef" | "searchModel" | "getItems" | "itemMap" | "openModel" | "focusOnInput" | ("disabled" | "bordered" | "prioritizePosition" | "placement" | "sideOffset" | "avoidCollisions" | "defaultOpen" | "open" | "disableOutsidePointerEvents" | "checkbox" | "multiple" | "trailingIcon" | "selectedItemIconAsTrailingIcon" | "indicatorIcon" | "loadingRowCount" | "clearOnChangeMultiple" | "samePopupWidth" | "popupHeight" | "resetSearchTermOnBlur" | "resetSearchTermOnSelect" | "tagRenderMode") | "isOptionSelected" | "getOptionByValue" | "getLabelByValue" | "getSingleByValue" | "getTagSize" | "comboboxInputBinding" | "comboboxTriggerBinding" | "valuePlaceholder" | "selectOption" | "highlightedOptionKey" | "comboboxInputFocused" | "onKeyDown"> & import('vue').ShallowUnwrapRef<{
|
|
754
754
|
isOptionSelected: (value?: string) => boolean;
|
|
755
755
|
getOptionByValue: (value: string) => import('../Combobox/types').ComboboxFlattenOptionType | undefined;
|
|
756
756
|
getLabelByValue: (value: string) => string | undefined;
|
|
@@ -895,11 +895,11 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
895
895
|
readonly onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
896
896
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
897
897
|
readonly "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
898
|
+
readonly "onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
899
|
+
readonly onFetch?: (() => any) | undefined;
|
|
898
900
|
readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
899
901
|
readonly onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
|
|
900
902
|
readonly onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
|
|
901
|
-
readonly "onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
902
|
-
readonly onFetch?: (() => any) | undefined;
|
|
903
903
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
904
904
|
$attrs: {
|
|
905
905
|
[x: string]: unknown;
|
|
@@ -1234,9 +1234,9 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1234
1234
|
}) => any) | undefined;
|
|
1235
1235
|
readonly "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
1236
1236
|
readonly onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
1237
|
+
readonly onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1237
1238
|
readonly "onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
1238
1239
|
readonly "onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
1239
|
-
readonly onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1240
1240
|
readonly onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1241
1241
|
readonly onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1242
1242
|
readonly onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -1257,7 +1257,7 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1257
1257
|
$emit: ((event: "select", node: object | import('..').TreeNodeType, selected: boolean, selectedKeys: string[]) => void) & ((event: "change", value: {
|
|
1258
1258
|
modelValue: string[];
|
|
1259
1259
|
checkedKeys: string[];
|
|
1260
|
-
}) => void) & ((event: "update:modelValue", value: string[]) => void) & ((event: "expand", node: object | import('..').TreeNodeType, expanded: boolean) => void) & ((event: "
|
|
1260
|
+
}) => void) & ((event: "update:modelValue", value: string[]) => void) & ((event: "expand", node: object | import('..').TreeNodeType, expanded: boolean) => void) & ((event: "check", node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "update:checkedKeys", value: string[]) => void) & ((event: "dragStart", event: import('..').TreeDragEvent) => void) & ((event: "dragEnd", event: import('..').TreeDragEvent) => void) & ((event: "choose", event: import('@pantograph/sortable').SortableEvent) => void) & ((event: "unchoose", event: import('@pantograph/sortable').SortableEvent) => void);
|
|
1261
1261
|
$el: any;
|
|
1262
1262
|
$options: import('vue').ComponentOptionsBase<Readonly<import('..').TreeProps> & Readonly<{
|
|
1263
1263
|
onSelect?: ((node: object | import('..').TreeNodeType, selected: boolean, selectedKeys: string[]) => any) | undefined;
|
|
@@ -1267,9 +1267,9 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1267
1267
|
}) => any) | undefined;
|
|
1268
1268
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
1269
1269
|
onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
1270
|
+
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1270
1271
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
1271
1272
|
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
1272
|
-
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1273
1273
|
onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1274
1274
|
onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1275
1275
|
onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -1278,7 +1278,7 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1278
1278
|
disabled: import('vue').ComputedRef<boolean | undefined>;
|
|
1279
1279
|
props: import('..').TreeProps;
|
|
1280
1280
|
dir: import('vue').ComputedRef<import('..').Direction | undefined>;
|
|
1281
|
-
expandedKeys: import('vue').Ref<string[]>;
|
|
1281
|
+
expandedKeys: import('vue').Ref<string[] | undefined>;
|
|
1282
1282
|
model: import('vue').WritableComputedRef<string[]>;
|
|
1283
1283
|
checked: import('vue').Ref<string[]>;
|
|
1284
1284
|
dragging: import('vue').Ref<boolean>;
|
|
@@ -1308,9 +1308,9 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1308
1308
|
}) => any;
|
|
1309
1309
|
"update:modelValue": (value: string[]) => any;
|
|
1310
1310
|
expand: (node: object | import('..').TreeNodeType, expanded: boolean) => any;
|
|
1311
|
+
check: (node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any;
|
|
1311
1312
|
"update:expandedKeys": (value: string[]) => any;
|
|
1312
1313
|
"update:checkedKeys": (value: string[]) => any;
|
|
1313
|
-
check: (node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any;
|
|
1314
1314
|
dragStart: (event: import('..').TreeDragEvent) => any;
|
|
1315
1315
|
dragEnd: (event: import('..').TreeDragEvent) => any;
|
|
1316
1316
|
choose: (event: import('@pantograph/sortable').SortableEvent) => any;
|
|
@@ -1353,9 +1353,9 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1353
1353
|
}) => any) | undefined;
|
|
1354
1354
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
1355
1355
|
onExpand?: ((node: object | import('..').TreeNodeType, expanded: boolean) => any) | undefined;
|
|
1356
|
+
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1356
1357
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
1357
1358
|
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
1358
|
-
onCheck?: ((node: object | import('..').TreeNodeType, checked: boolean, checkedKeys: string[]) => any) | undefined;
|
|
1359
1359
|
onDragStart?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1360
1360
|
onDragEnd?: ((event: import('..').TreeDragEvent) => any) | undefined;
|
|
1361
1361
|
onChoose?: ((event: import('@pantograph/sortable').SortableEvent) => any) | undefined;
|
|
@@ -1364,7 +1364,7 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1364
1364
|
disabled: import('vue').ComputedRef<boolean | undefined>;
|
|
1365
1365
|
props: import('..').TreeProps;
|
|
1366
1366
|
dir: import('vue').ComputedRef<import('..').Direction | undefined>;
|
|
1367
|
-
expandedKeys: import('vue').Ref<string[]>;
|
|
1367
|
+
expandedKeys: import('vue').Ref<string[] | undefined>;
|
|
1368
1368
|
model: import('vue').WritableComputedRef<string[]>;
|
|
1369
1369
|
checked: import('vue').Ref<string[]>;
|
|
1370
1370
|
dragging: import('vue').Ref<boolean>;
|
|
@@ -1397,7 +1397,7 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1397
1397
|
$root: import('vue').ComponentPublicInstance | null;
|
|
1398
1398
|
$parent: import('vue').ComponentPublicInstance | null;
|
|
1399
1399
|
$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: "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:modelValue", value: string | string[]) => void) & ((event: "update:
|
|
1400
|
+
$emit: ((event: "search", value?: string | null | undefined) => void) & ((event: "select", value: string | undefined, selected: boolean, option?: import('../Combobox/types').ComboboxFlattenOptionType | undefined) => 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:modelValue", value: string | string[]) => void) & ((event: "update:search", value?: string | null | undefined) => void) & ((event: "fetch") => void) & ((event: "update:expandedKeys", value: string[]) => void) & ((event: "keydownEnter", value: KeyboardEvent, searchModel?: string | undefined) => void) & ((event: "keydownEscape", value: KeyboardEvent) => void);
|
|
1401
1401
|
$el: any;
|
|
1402
1402
|
$options: import('vue').ComponentOptionsBase<Readonly<ComboboxProps> & Readonly<{
|
|
1403
1403
|
onSearch?: ((value?: string | null | undefined) => any) | undefined;
|
|
@@ -1410,11 +1410,11 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1410
1410
|
onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
1411
1411
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
1412
1412
|
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
1413
|
+
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
1414
|
+
onFetch?: (() => any) | undefined;
|
|
1413
1415
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
1414
1416
|
onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
|
|
1415
1417
|
onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
|
|
1416
|
-
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
1417
|
-
onFetch?: (() => any) | undefined;
|
|
1418
1418
|
}>, {
|
|
1419
1419
|
isOptionSelected: (value?: string) => boolean;
|
|
1420
1420
|
getOptionByValue: (value: string) => import('../Combobox/types').ComboboxFlattenOptionType | undefined;
|
|
@@ -1454,11 +1454,11 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1454
1454
|
interactOutside: (event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any;
|
|
1455
1455
|
"update:open": (value: boolean) => any;
|
|
1456
1456
|
"update:modelValue": (value: string | string[]) => any;
|
|
1457
|
+
"update:search": (value?: string | null | undefined) => any;
|
|
1458
|
+
fetch: () => any;
|
|
1457
1459
|
"update:expandedKeys": (value: string[]) => any;
|
|
1458
1460
|
keydownEnter: (value: KeyboardEvent, searchModel?: string | undefined) => any;
|
|
1459
1461
|
keydownEscape: (value: KeyboardEvent) => any;
|
|
1460
|
-
"update:search": (value?: string | null | undefined) => any;
|
|
1461
|
-
fetch: () => any;
|
|
1462
1462
|
}, string, {
|
|
1463
1463
|
disabled: boolean;
|
|
1464
1464
|
bordered: boolean;
|
|
@@ -1534,12 +1534,12 @@ declare const __VLS_component: import('vue').DefineComponent<ComboboxProps, {
|
|
|
1534
1534
|
onInteractOutside?: ((event: import('reka-ui').PointerDownOutsideEvent | import('reka-ui').FocusOutsideEvent) => any) | undefined;
|
|
1535
1535
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
1536
1536
|
"onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
|
|
1537
|
+
"onUpdate:search"?: ((value?: string | null | undefined) => any) | undefined;
|
|
1538
|
+
onFetch?: (() => any) | undefined;
|
|
1537
1539
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
1538
1540
|
onKeydownEnter?: ((value: KeyboardEvent, searchModel?: string | undefined) => any) | undefined;
|
|
1539
1541
|
onKeydownEscape?: ((value: KeyboardEvent) => any) | undefined;
|
|
1540
|
-
|
|
1541
|
-
onFetch?: (() => any) | undefined;
|
|
1542
|
-
}>, "props" | "placeholder" | "slots" | "emit" | "getIconSize" | "getDisabled" | "getStatus" | "getSize" | "model" | "inputRef" | "getItems" | "itemMap" | "openModel" | "focusOnInput" | ("disabled" | "bordered" | "prioritizePosition" | "placement" | "sideOffset" | "avoidCollisions" | "defaultOpen" | "open" | "disableOutsidePointerEvents" | "checkbox" | "multiple" | "trailingIcon" | "selectedItemIconAsTrailingIcon" | "indicatorIcon" | "loadingRowCount" | "clearOnChangeMultiple" | "samePopupWidth" | "popupHeight" | "resetSearchTermOnBlur" | "resetSearchTermOnSelect" | "tagRenderMode") | "isOptionSelected" | "getOptionByValue" | "getLabelByValue" | "getSingleByValue" | "getTagSize" | "comboboxInputBinding" | "comboboxTriggerBinding" | "searchModel" | "valuePlaceholder" | "selectOption" | "highlightedOptionKey" | "comboboxInputFocused" | "onKeyDown"> & import('vue').ShallowUnwrapRef<{
|
|
1542
|
+
}>, "props" | "placeholder" | "slots" | "emit" | "getIconSize" | "getDisabled" | "getStatus" | "getSize" | "model" | "inputRef" | "searchModel" | "getItems" | "itemMap" | "openModel" | "focusOnInput" | ("disabled" | "bordered" | "prioritizePosition" | "placement" | "sideOffset" | "avoidCollisions" | "defaultOpen" | "open" | "disableOutsidePointerEvents" | "checkbox" | "multiple" | "trailingIcon" | "selectedItemIconAsTrailingIcon" | "indicatorIcon" | "loadingRowCount" | "clearOnChangeMultiple" | "samePopupWidth" | "popupHeight" | "resetSearchTermOnBlur" | "resetSearchTermOnSelect" | "tagRenderMode") | "isOptionSelected" | "getOptionByValue" | "getLabelByValue" | "getSingleByValue" | "getTagSize" | "comboboxInputBinding" | "comboboxTriggerBinding" | "valuePlaceholder" | "selectOption" | "highlightedOptionKey" | "comboboxInputFocused" | "onKeyDown"> & import('vue').ShallowUnwrapRef<{
|
|
1543
1543
|
isOptionSelected: (value?: string) => boolean;
|
|
1544
1544
|
getOptionByValue: (value: string) => import('../Combobox/types').ComboboxFlattenOptionType | undefined;
|
|
1545
1545
|
getLabelByValue: (value: string) => string | undefined;
|
package/dist/Comment/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("@pantograph/utils-vue"),D=require("../Avatar.vue_vue_type_style_index_0_lang-DldQzFne.js"),K=require("../Badge.vue_vue_type_script_setup_true_lang-BVE5H-tP.js"),W=require("class-variance-authority");require("../GraphicalObject/index.umd.cjs");require("../Icon/index.umd.cjs");const o=require("@pantograph/utils"),E=require("../IconButton.vue_vue_type_script_setup_true_lang-CxiVq3Pa.js"),Q=require("../ActionButton.vue_vue_type_script_setup_true_lang-CH_Oquxt.js"),A=require("../Upload/index.umd.cjs"),J=require("reka-ui"),X=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-mMrUHRm_.js"),T=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),Y=require("../index-CaXYyVxq.js"),O=require("../MenuItem.vue_vue_type_style_index_0_lang-DYhvQVbp.js"),Z=require("../GOPicker/index.umd.cjs"),ee=require("../Combobox/index.umd.cjs"),te=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),oe=require("../ScrollContainer.vue_vue_type_style_index_0_lang-Br7-ZHr3.js"),ne=require("../Shortcut.vue_vue_type_style_index_0_lang-ahrcqk01.js"),re=e.defineComponent({...o.getComponentOptions("CommentActions"),__name:"CommentActions",setup(d){const s=V(),r=e.ref(),t=e.ref(),u=()=>{s.emit("openActions",t.value)},l=()=>{s.emit("openReaction",r.value)},i=()=>{s.emit("reply",c=>{s.openReplies&&(c!==void 0?s.openReplies.value=c:s.openReplies.value=!s.openReplies.value)})};return(c,n)=>e.unref(s).props.hasReaction||e.unref(s).props.hasEdit||e.unref(s).props.hasDelete?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"actions"),e.unref(s).props.actionsCls))},[e.unref(s).props.hasReply?(e.openBlock(),e.createBlock(E._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:r,flipOnDir:"rtl",onClick:i},null,512)):e.createCommentVNode("",!0),e.unref(s).props.hasReaction?(e.openBlock(),e.createBlock(E._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:r,onPointerdown:n[0]||(n[0]=e.withModifiers(()=>{},["stop"])),onClick:l},null,512)):e.createCommentVNode("",!0),e.unref(s).props.hasEdit||e.unref(s).props.hasDelete?(e.openBlock(),e.createBlock(E._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onPointerdown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"])),onClick:u},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),se=e.defineComponent({...o.getComponentOptions("CommentReactions"),__name:"CommentReactions",setup(d){const s=V(),r=e.ref(),t=()=>{s.emit("openReaction",r.value)},u=l=>{l&&s.emit("reaction",l)};return(l,i)=>{var c;return e.unref(s).props.hasReaction&&((c=e.unref(s).props.reactions)!=null&&c.some(n=>n.count&&n.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"reactions"),e.unref(s).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s).props.reactions,n=>(e.openBlock(),e.createBlock(Q._sfc_main,{key:n==null?void 0:n.emoji,active:n==null?void 0:n.active,onClick:y=>u(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n==null?void 0:n.emoji)+" "+e.toDisplayString(n==null?void 0:n.count),1)]),_:2},1032,["active","onClick"]))),128)),e.createVNode(E._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:r,onPointerdown:i[0]||(i[0]=e.withModifiers(()=>{},["stop"])),onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),I=e.defineComponent({...o.getComponentOptions("CommentFileList"),__name:"CommentFileList",setup(d){const s=V(),r=()=>{var t;return e.h(A.UploadList,{...s.props.uploadProps??{},ref:s.fileListRef,listType:"card",fileListCls:o.normCls(o.getBemElement(v,"file_list"),(t=s.props.uploadProps)==null?void 0:t.fileListCls)},s.slots)};return(t,u)=>{var l,i;return(i=(l=e.unref(s).props.uploadProps)==null?void 0:l.fileList)!=null&&i.length?(e.openBlock(),e.createBlock(r,{key:0})):e.createCommentVNode("",!0)}}}),v=o.getBemBlock("comment"),[V,w]=J.createContext("Comment"),q=e.defineComponent({...o.getComponentOptions("Comment"),__name:"Comment",props:{class:{},headerCls:{},actionsCls:{},bodyCls:{},datetimeCls:{},uploadProps:{},contentCls:{},authorCls:{},repliesCls:{},headerContentCls:{},reactionsCls:{},repliesHeaderCls:{},repliesTitleCls:{},repliesContentCls:{},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(d,{emit:s}){const r=d,t=e.useSlots(),u=s,l=h.useVModel(r,"open",u,{passive:r.open===void 0}),i=()=>{var C;let p;const g=(C=t.author)==null?void 0:C.call(t,{});return!h.isEmptyElement(g)?p=g:p=r.author,p?e.h("div",{class:o.normCls(o.getBemElement(v,"author"),r.authorCls)},p):null},c=()=>{var C;let p;const g=(C=t.datetime)==null?void 0:C.call(t,{});return!h.isEmptyElement(g)?p=g:p=r.datetime,p?e.h("div",{class:o.normCls(o.getBemElement(v,"datetime"),r.datetimeCls)},p):null},n=()=>{var C,_;const p=(C=t.header)==null?void 0:C.call(t,{}),g=!h.isEmptyElement(p);let f;if(g)f=p;else{f=[];const S=(_=t.avatar)==null?void 0:_.call(t,{});!h.isEmptyElement(S)?f.push(S):r.avatar&&f.push(e.h(D._sfc_main,{...r.avatarProps??{},src:r.avatar}));const P=i(),k=c();(P||k)&&f.push(e.h("div",{class:o.normCls(o.getBemElement(v,"header__content"),r.headerContentCls)},[P,k])),f.length||(f=void 0)}return f?(f.push(e.h(re)),e.h("div",{class:o.normCls(o.getBemElement(v,"header"),r.headerCls)},f)):null},y=()=>{var f;const p=(f=t.content)==null?void 0:f.call(t,{}),g=!h.isEmptyElement(p);if(g||r.content)return e.h("div",{class:o.normCls(o.getBemElement(v,"content"),r.contentCls,"paragraph"),innerHTML:g?void 0:r.content},g?p:void 0)},m=o.getBemElement(v,"replies"),B=W.cva(m,{variants:{open:o.generateVariantClassList("open",m)}}),R=()=>{var _;const p=(_=t.replies)==null?void 0:_.call(t,{}),g=!h.isEmptyElement(p),f=()=>{var P,k,x;const S=(P=t.repliesHeader)==null?void 0:P.call(t,{open:!!l.value}),a=[];if(!h.isEmptyElement(S))a.push(S);else{a.push(e.h(X._sfc_main,{size:"xsm",bg:"transparent",br:"transparent"},{default:()=>e.h(T._sfc_main,{icon:"tabler:chevron-down",class:o.getBemElement(m,"icon"),size:"2xsm"})}));const M=(k=t.repliesCount)==null?void 0:k.call(t,{}),U=!h.isEmptyElement(M),z=(x=t.repliesTitle)==null?void 0:x.call(t,{}),G=!h.isEmptyElement(z);let N;G?N=z:N=r.repliesTitle,a.push(e.h("div",{class:o.normCls(o.getBemElement(m,"title"),r.repliesTitleCls)},N)),(U||r.repliesCount)&&a.push(e.h(K._sfc_main,{color:"primary-subtle",text:r.repliesCount,size:"xsm"},{text:()=>M}))}return e.h("div",{class:o.normCls(o.getBemElement(m,"header"),r.repliesHeaderCls),onClick:()=>{l.value=!l.value}},a)},C=()=>{if(l.value)return[e.h("div",{class:o.normCls(o.getBemElement(m,"content"),r.repliesContentCls)},p),e.h("div",{class:o.getBemElement(m,"line")})]};return g?e.h("div",{class:o.normCls(B({open:!!l.value}),r.repliesCls)},[f(),C()]):null},b=e.ref();return w({openReplies:l,emit:u,props:r,slots:t,fileListRef:b}),(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(v),r.class))},[e.createVNode(n),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"body"),r.bodyCls))},[e.createVNode(y),e.createVNode(I),e.createVNode(se),e.createVNode(R)],2)],2))}}),L=e.defineComponent({...o.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},modal:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},class:{},containerCls:{},containerClass:{},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},noPadding:{type:Boolean},zIndex:{},containerStyle:{},containerProps:{},useReferenceAttribute:{type:Boolean},noTrigger:{type:Boolean}},emits:["edit","delete","update:open"],setup(d,{emit:s}){const r=d,t=s,u=()=>{t("edit"),i.value=!1},l=()=>{t("delete"),i.value=!1},i=h.useVModel(r,"open",t,{passive:r.open===void 0});return(c,n)=>(e.openBlock(),e.createBlock(e.unref(Y._sfc_main),e.mergeProps(r,{open:e.unref(i),"onUpdate:open":n[0]||(n[0]=y=>e.isRef(i)?i.value=y:null),placement:"bottom-end",sideOffset:3,openDelay:0}),{content:e.withCtx(()=>[e.createVNode(O._sfc_main,{style:{width:"114px"}},{default:e.withCtx(()=>[c.hasEdit?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"edit",title:c.editText,onClick:u},{leading:e.withCtx(({iconSize:y})=>[e.createVNode(T._sfc_main,{icon:"tabler:edit",size:y},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),c.hasDelete?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"delete",title:c.deleteText,danger:"",onClick:l},{leading:e.withCtx(({iconSize:y})=>[e.createVNode(T._sfc_main,{icon:"tabler:trash",size:y},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),F=e.defineComponent({...o.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},borderless:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{},headerCls:{},groupCls:{},searchCls:{},colorsCls:{},emptyCls:{},gridCls:{},scrollContainerProps:{},size:{},id:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(d,{emit:s}){const r=d,t=s,u=i=>{t("reaction",i.value),l.value=!1},l=h.useVModel(r,"open",t,{passive:r.open===void 0});return(i,c)=>(e.openBlock(),e.createBlock(e.unref(Z.default),e.mergeProps(r,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...i.popoverProps??{},reference:i.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:u,open:e.unref(l),"onUpdate:open":c[0]||(c[0]=n=>e.isRef(l)?l.value=n:null)}),null,16,["popoverProps","open"]))}}),j=e.defineComponent({...o.getComponentOptions("CommentMention"),__name:"CommentMention",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean},disabled:{type:Boolean},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean]},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{type:[String,Number,Function]},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{type:[String,Number,Function]},getSingle:{type:[String,Number,Function]},getClear:{type:[String,Number,Function]},getOptions:{type:[String,Number,Function]},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},getMenuItemProps:{type:[Function,Object]},placement:{},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean},defaultOpen:{type:Boolean},sideOffset:{},alignOffset:{},reference:{},prioritizePosition:{type:Boolean},avoidCollisions:{type:Boolean},dir:{},noTrigger:{type:Boolean}},emits:["mention"],setup(d,{expose:s,emit:r}){const t=d,u=r,l=e.useSlots(),i=(n,y,m)=>{u("mention",n,m)},c=e.ref();return s({comboboxRef:c}),(n,y)=>(e.openBlock(),e.createBlock(e.unref(ee.Combobox),e.mergeProps({ref_key:"comboboxRef",ref:c},t,{modelValue:"",onSelect:i,noTrigger:"",popupWidth:200}),e.createSlots({_:2},[e.renderList(Object.keys(l),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(n.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040))}}),H=e.defineComponent({...o.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{},actionsCls:{},editorCls:{},footerCls:{},disabled:{type:Boolean,default:void 0},isEmpty:{type:Boolean},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(d,{emit:s}){const r=e.useSlots(),t=d,u=s,l=o.getBemElement(v,"editor"),i=e.ref(),c=()=>{u("openReaction",i.value)},n=e.ref(),y=()=>{u("openMention",n.value)},{getDisabled:m}=h.useFormInput({exports:["getDisabled"]}),{rootBindings:B,inputBindings:R}=h.useInputDataStates({getDisabled:()=>m.value,emit:u}),b=()=>u("submit"),p=e.computed(()=>o.getPxSize(t.maxHeight,!0)),g=e.ref(),f=C=>{var _;(_=g.value)!=null&&_.addFiles&&C.length&&g.value.addFiles(C)};return w({emit:u,props:t,slots:r,fileListRef:g}),(C,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(o.normCls)(e.unref(l),t.class)},e.unref(B)),[e.createVNode(oe._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:p.value})},{default:e.withCtx(()=>[e.renderSlot(C.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(R))))]),_:3},8,["class","style"]),e.createVNode(I,e.mergeProps(C.uploadProps,{ref:"uploadRef"}),null,16),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"footer"),t.footerCls))},[e.createVNode(te._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"actions"),t.actionsCls))},[e.createVNode(E._sfc_main,{icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:n,onPointerdown:_[0]||(_[0]=e.withModifiers(()=>{},["stop"])),onClick:y},null,512),e.createVNode(A.UploadTrigger,{accept:"image/*",multiple:"",onAddFiles:f},{default:e.withCtx(()=>[e.createVNode(E._sfc_main,{icon:"tabler:paperclip",color:"neutral",type:"ghost"})]),_:1}),e.createVNode(E._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:i,onPointerdown:_[1]||(_[1]=e.withModifiers(()=>{},["stop"])),onClick:c},null,512)],2),e.createVNode(E._sfc_main,{disabled:C.isEmpty,icon:"tabler:arrow-up",onClick:b},null,8,["disabled"])],2)],16))}}),le=["tabindex","disabled"],$=e.defineComponent({...o.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoreShortcut:{type:Boolean},disabled:{type:Boolean,default:void 0},avatarProps:{},shortcutProps:{}},emits:["add"],setup(d,{emit:s}){const r=e.useSlots(),t=d,u=s,l=o.getBemElement(v,"trigger"),i=n=>{!t.ignoreShortcut&&n.code==="KeyC"&&n.altKey&&c(n)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",i)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",i)}),t.withShortcut;const c=n=>u("add",n);return(n,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(l),t.class)),tabindex:n.disabled?-1:0,disabled:n.disabled?"":void 0,onPointerdown:e.withModifiers(c,["stop"]),onKeyup:e.withModifiers(c,["stop"])},[e.createVNode(D._sfc_main,e.mergeProps(n.avatarProps??{},{size:"sm",src:n.src}),e.createSlots({_:2},[e.renderList(Object.keys(r),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(n.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.getBemElement)(e.unref(l),"text"))},[e.renderSlot(n.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)])],2),e.createVNode(ne._sfc_main,e.mergeProps(n.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,le))}}),ie=h.installComponent(q,o.getComponentName("Comment")),ae=h.installComponent(L,o.getComponentName("CommentAction")),ce=h.installComponent(F,o.getComponentName("CommentReaction")),pe=h.installComponent(j,o.getComponentName("CommentMention")),ue=h.installComponent(H,o.getComponentName("CommentEditor")),me=h.installComponent($,o.getComponentName("CommentTrigger")),de=d=>{const s=e.ref(!1),r=e.ref(),t=e.ref(!1),u=(a,P=!1)=>{s.value=!0,t.value=P,r.value=a},l=e.ref(!1),i=e.ref(),c=a=>{l.value=!0,i.value=a},n=e.computed(()=>({open:s.value,reference:r.value,"onUpdate:open":a=>s.value=a,onReaction:a=>{var P,k;if(t.value)try{(P=d.addEmoji)==null||P.call(d,a)}catch(x){console.error("error on reaction",x)}try{(k=d.onReaction)==null||k.call(d,a)}catch(x){console.error("error on reaction",x)}}})),y=e.computed(()=>({open:l.value,reference:i.value,"onUpdate:open":a=>l.value=a})),m=e.ref(!1),B=e.ref(),R=e.ref(),b=e.ref(),p=e.ref(!1),g=e.computed(()=>({ref:R,open:m.value,"onUpdate:open":a=>m.value=a,search:B.value,"onUpdate:search":a=>B.value=a,reference:b.value,disableOutsidePointerEvents:!1,resetSearchTermOnBlur:!0,headerSearch:p.value,onPointerDownOutside:C,onEscapeKeyDown:C})),f=a=>{a&&(b.value={getBoundingClientRect:a},m.value=!0,p.value=!1)},C=()=>{b.value=void 0,m.value=!1,B.value=void 0},_=a=>{B.value=a},S=e.computed(()=>({onOpenReaction:a=>u(a,!0),onOpenMention:a=>{a&&(b.value=a,m.value=!0,p.value=!0)}}));return{forwardRefMention:R,reactionBinding:n,actionBinding:y,editorBinding:S,mentionBinding:g,openActions:c,openReaction:u,openMentionInEditor:f,closeMentionInEditor:C,updateMentionQuery:_}};exports.Comment=q;exports.CommentAction=L;exports.CommentActionPlugin=ae;exports.CommentEditor=H;exports.CommentEditorPlugin=ue;exports.CommentMention=j;exports.CommentMentionPlugin=pe;exports.CommentPlugin=ie;exports.CommentReaction=F;exports.CommentReactionPlugin=ce;exports.CommentTrigger=$;exports.CommentTriggerPlugin=me;exports.commentPrefix=v;exports.injectCommentContext=V;exports.provideCommentContext=w;exports.useComment=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("@pantograph/utils-vue"),D=require("../Avatar.vue_vue_type_style_index_0_lang-DldQzFne.js"),K=require("../Badge.vue_vue_type_script_setup_true_lang-BVE5H-tP.js"),W=require("class-variance-authority");require("../GraphicalObject/index.umd.cjs");require("../Icon/index.umd.cjs");const o=require("@pantograph/utils"),E=require("../IconButton.vue_vue_type_script_setup_true_lang-CxiVq3Pa.js"),Q=require("../ActionButton.vue_vue_type_script_setup_true_lang-CH_Oquxt.js"),A=require("../Upload/index.umd.cjs"),J=require("reka-ui"),X=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-mMrUHRm_.js"),T=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),Y=require("../index-CaXYyVxq.js"),O=require("../MenuItem.vue_vue_type_style_index_0_lang-DYhvQVbp.js"),Z=require("../GOPicker/index.umd.cjs"),ee=require("../Combobox/index.umd.cjs"),te=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),oe=require("../ScrollContainer.vue_vue_type_style_index_0_lang-Br7-ZHr3.js"),ne=require("../Shortcut.vue_vue_type_style_index_0_lang-ahrcqk01.js"),re=e.defineComponent({...o.getComponentOptions("CommentActions"),__name:"CommentActions",setup(d){const s=V(),r=e.ref(),t=e.ref(),u=()=>{s.emit("openActions",t.value)},l=()=>{s.emit("openReaction",r.value)},i=()=>{s.emit("reply",p=>{s.openReplies&&(p!==void 0?s.openReplies.value=p:s.openReplies.value=!s.openReplies.value)})};return(p,n)=>e.unref(s).props.hasReaction||e.unref(s).props.hasEdit||e.unref(s).props.hasDelete?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"actions"),e.unref(s).props.actionsCls))},[e.unref(s).props.hasReply?(e.openBlock(),e.createBlock(E._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:r,flipOnDir:"rtl",onClick:i},null,512)):e.createCommentVNode("",!0),e.unref(s).props.hasReaction?(e.openBlock(),e.createBlock(E._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:r,onPointerdown:n[0]||(n[0]=e.withModifiers(()=>{},["stop"])),onClick:l},null,512)):e.createCommentVNode("",!0),e.unref(s).props.hasEdit||e.unref(s).props.hasDelete?(e.openBlock(),e.createBlock(E._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onPointerdown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"])),onClick:u},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),se=e.defineComponent({...o.getComponentOptions("CommentReactions"),__name:"CommentReactions",setup(d){const s=V(),r=e.ref(),t=()=>{s.emit("openReaction",r.value)},u=l=>{l&&s.emit("reaction",l)};return(l,i)=>{var p;return e.unref(s).props.hasReaction&&((p=e.unref(s).props.reactions)!=null&&p.some(n=>n.count&&n.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"reactions"),e.unref(s).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s).props.reactions,n=>(e.openBlock(),e.createBlock(Q._sfc_main,{key:n==null?void 0:n.emoji,active:n==null?void 0:n.active,onClick:y=>u(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n==null?void 0:n.emoji)+" "+e.toDisplayString(n==null?void 0:n.count),1)]),_:2},1032,["active","onClick"]))),128)),e.createVNode(E._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:r,onPointerdown:i[0]||(i[0]=e.withModifiers(()=>{},["stop"])),onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),I=e.defineComponent({...o.getComponentOptions("CommentFileList"),__name:"CommentFileList",setup(d){const s=V(),r=()=>{var t;return e.h(A.UploadList,{...s.props.uploadProps??{},ref:s.fileListRef,listType:"card",fileListCls:o.normCls(o.getBemElement(v,"file_list"),(t=s.props.uploadProps)==null?void 0:t.fileListCls)},s.slots)};return(t,u)=>{var l,i;return(i=(l=e.unref(s).props.uploadProps)==null?void 0:l.fileList)!=null&&i.length?(e.openBlock(),e.createBlock(r,{key:0})):e.createCommentVNode("",!0)}}}),v=o.getBemBlock("comment"),[V,w]=J.createContext("Comment"),q=e.defineComponent({...o.getComponentOptions("Comment"),__name:"Comment",props:{class:{},headerCls:{},actionsCls:{},bodyCls:{},datetimeCls:{},uploadProps:{},contentCls:{},authorCls:{},repliesCls:{},headerContentCls:{},reactionsCls:{},repliesHeaderCls:{},repliesTitleCls:{},repliesContentCls:{},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(d,{emit:s}){const r=d,t=e.useSlots(),u=s,l=h.useVModel(r,"open",u,{passive:r.open===void 0}),i=()=>{var C;let c;const g=(C=t.author)==null?void 0:C.call(t,{});return!h.isEmptyElement(g)?c=g:c=r.author,c?e.h("div",{class:o.normCls(o.getBemElement(v,"author"),r.authorCls)},c):null},p=()=>{var C;let c;const g=(C=t.datetime)==null?void 0:C.call(t,{});return!h.isEmptyElement(g)?c=g:c=r.datetime,c?e.h("div",{class:o.normCls(o.getBemElement(v,"datetime"),r.datetimeCls)},c):null},n=()=>{var C,_;const c=(C=t.header)==null?void 0:C.call(t,{}),g=!h.isEmptyElement(c);let f;if(g)f=c;else{f=[];const S=(_=t.avatar)==null?void 0:_.call(t,{});!h.isEmptyElement(S)?f.push(S):r.avatar&&f.push(e.h(D._sfc_main,{...r.avatarProps??{},src:r.avatar}));const P=i(),k=p();(P||k)&&f.push(e.h("div",{class:o.normCls(o.getBemElement(v,"header__content"),r.headerContentCls)},[P,k])),f.length||(f=void 0)}return f?(f.push(e.h(re)),e.h("div",{class:o.normCls(o.getBemElement(v,"header"),r.headerCls)},f)):null},y=()=>{var f;const c=(f=t.content)==null?void 0:f.call(t,{}),g=!h.isEmptyElement(c);if(g||r.content)return e.h("div",{class:o.normCls(o.getBemElement(v,"content"),r.contentCls,"paragraph"),innerHTML:g?void 0:r.content},g?c:void 0)},m=o.getBemElement(v,"replies"),B=W.cva(m,{variants:{open:o.generateVariantClassList("open",m)}}),R=()=>{var _;const c=(_=t.replies)==null?void 0:_.call(t,{}),g=!h.isEmptyElement(c),f=()=>{var P,k,x;const S=(P=t.repliesHeader)==null?void 0:P.call(t,{open:!!l.value}),a=[];if(!h.isEmptyElement(S))a.push(S);else{a.push(e.h(X._sfc_main,{size:"xsm",bg:"transparent",br:"transparent"},{default:()=>e.h(T._sfc_main,{icon:"tabler:chevron-down",class:o.getBemElement(m,"icon"),size:"2xsm"})}));const M=(k=t.repliesCount)==null?void 0:k.call(t,{}),U=!h.isEmptyElement(M),z=(x=t.repliesTitle)==null?void 0:x.call(t,{}),G=!h.isEmptyElement(z);let N;G?N=z:N=r.repliesTitle,a.push(e.h("div",{class:o.normCls(o.getBemElement(m,"title"),r.repliesTitleCls)},N)),(U||r.repliesCount)&&a.push(e.h(K._sfc_main,{color:"primary-subtle",text:r.repliesCount,size:"xsm"},{text:()=>M}))}return e.h("div",{class:o.normCls(o.getBemElement(m,"header"),r.repliesHeaderCls),onClick:()=>{l.value=!l.value}},a)},C=()=>{if(l.value)return[e.h("div",{class:o.normCls(o.getBemElement(m,"content"),r.repliesContentCls)},c),e.h("div",{class:o.getBemElement(m,"line")})]};return g?e.h("div",{class:o.normCls(B({open:!!l.value}),r.repliesCls)},[f(),C()]):null},b=e.ref();return w({openReplies:l,emit:u,props:r,slots:t,fileListRef:b}),(c,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(v),r.class))},[e.createVNode(n),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(v),"body"),r.bodyCls))},[e.createVNode(y),e.createVNode(I),e.createVNode(se),e.createVNode(R)],2)],2))}}),L=e.defineComponent({...o.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},modal:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},class:{},containerCls:{},containerClass:{},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},noPadding:{type:Boolean},zIndex:{},containerStyle:{},containerProps:{},useReferenceAttribute:{type:Boolean},noTrigger:{type:Boolean}},emits:["edit","delete","update:open"],setup(d,{emit:s}){const r=d,t=s,u=()=>{t("edit"),i.value=!1},l=()=>{t("delete"),i.value=!1},i=h.useVModel(r,"open",t,{passive:r.open===void 0});return(p,n)=>(e.openBlock(),e.createBlock(e.unref(Y._sfc_main),e.mergeProps(r,{open:e.unref(i),"onUpdate:open":n[0]||(n[0]=y=>e.isRef(i)?i.value=y:null),placement:"bottom-end",sideOffset:3,openDelay:0}),{content:e.withCtx(()=>[e.createVNode(O._sfc_main,{style:{width:"114px"}},{default:e.withCtx(()=>[p.hasEdit?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"edit",title:p.editText,onClick:u},{leading:e.withCtx(({iconSize:y})=>[e.createVNode(T._sfc_main,{icon:"tabler:edit",size:y},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),p.hasDelete?(e.openBlock(),e.createBlock(O._sfc_main$1,{key:"delete",title:p.deleteText,danger:"",onClick:l},{leading:e.withCtx(({iconSize:y})=>[e.createVNode(T._sfc_main,{icon:"tabler:trash",size:y},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),F=e.defineComponent({...o.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},borderless:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{},headerCls:{},groupCls:{},searchCls:{},colorsCls:{},emptyCls:{},gridCls:{},scrollContainerProps:{},size:{},id:{},search:{},inputProps:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(d,{emit:s}){const r=d,t=s,u=i=>{t("reaction",i.value),l.value=!1},l=h.useVModel(r,"open",t,{passive:r.open===void 0});return(i,p)=>(e.openBlock(),e.createBlock(e.unref(Z.default),e.mergeProps(r,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...i.popoverProps??{},reference:i.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:u,open:e.unref(l),"onUpdate:open":p[0]||(p[0]=n=>e.isRef(l)?l.value=n:null)}),null,16,["popoverProps","open"]))}}),j=e.defineComponent({...o.getComponentOptions("CommentMention"),__name:"CommentMention",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean},disabled:{type:Boolean},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean]},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{type:[String,Number,Function]},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{type:[String,Number,Function]},getSingle:{type:[String,Number,Function]},getClear:{type:[String,Number,Function]},getOptions:{type:[String,Number,Function]},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{},triggerLeadingCls:{},triggerContentCls:{},triggerContentPlaceholderCls:{},triggerContentValueCls:{},triggerTrailingCls:{},itemLeadingCls:{},optionCls:{},tagCls:{},popupCls:{},labelCls:{},optionsCls:{},optionTextCls:{},optionContentCls:{},emptyCls:{},skeletonCls:{},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},getMenuItemProps:{type:[Function,Object]},placement:{},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean},defaultOpen:{type:Boolean},sideOffset:{},alignOffset:{},reference:{},prioritizePosition:{type:Boolean},avoidCollisions:{type:Boolean},dir:{},noTrigger:{type:Boolean}},emits:["mention"],setup(d,{expose:s,emit:r}){const t=d,u=r,l=e.useSlots(),i=(n,y,m)=>{u("mention",n,m)},p=e.ref();return s({comboboxRef:p}),(n,y)=>(e.openBlock(),e.createBlock(e.unref(ee.Combobox),e.mergeProps({ref_key:"comboboxRef",ref:p},t,{modelValue:"",onSelect:i,noTrigger:"",popupWidth:200}),e.createSlots({_:2},[e.renderList(Object.keys(l),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(n.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040))}}),H=e.defineComponent({...o.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{},actionsCls:{},editorCls:{},footerCls:{},disabled:{type:Boolean,default:void 0},isEmpty:{type:Boolean},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(d,{emit:s}){const r=e.useSlots(),t=d,u=s,l=o.getBemElement(v,"editor"),i=e.ref(),p=()=>{u("openReaction",i.value)},n=e.ref(),y=()=>{u("openMention",n.value)},{getDisabled:m}=h.useFormInput({exports:["getDisabled"]}),{rootBindings:B,inputBindings:R}=h.useInputDataStates({getDisabled:()=>m.value,emit:u}),b=()=>u("submit"),c=e.computed(()=>o.getPxSize(t.maxHeight,!0)),g=e.ref(),f=C=>{var _;(_=g.value)!=null&&_.addFiles&&C.length&&g.value.addFiles(C)};return w({emit:u,props:t,slots:r,fileListRef:g}),(C,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(o.normCls)(e.unref(l),t.class)},e.unref(B)),[e.createVNode(oe._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:c.value})},{default:e.withCtx(()=>[e.renderSlot(C.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(R))))]),_:3},8,["class","style"]),e.createVNode(I,e.mergeProps(C.uploadProps,{ref:"uploadRef"}),null,16),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"footer"),t.footerCls))},[e.createVNode(te._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(o.getBemElement)(e.unref(l),"actions"),t.actionsCls))},[e.createVNode(E._sfc_main,{icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:n,onPointerdown:_[0]||(_[0]=e.withModifiers(()=>{},["stop"])),onClick:y},null,512),e.createVNode(A.UploadTrigger,{accept:"image/*",multiple:"",onAddFiles:f},{default:e.withCtx(()=>[e.createVNode(E._sfc_main,{icon:"tabler:paperclip",color:"neutral",type:"ghost"})]),_:1}),e.createVNode(E._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:i,onPointerdown:_[1]||(_[1]=e.withModifiers(()=>{},["stop"])),onClick:p},null,512)],2),e.createVNode(E._sfc_main,{disabled:C.isEmpty,icon:"tabler:arrow-up",onClick:b},null,8,["disabled"])],2)],16))}}),le=["tabindex","disabled"],$=e.defineComponent({...o.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoreShortcut:{type:Boolean},disabled:{type:Boolean,default:void 0},avatarProps:{},shortcutProps:{}},emits:["add"],setup(d,{emit:s}){const r=e.useSlots(),t=d,u=s,l=o.getBemElement(v,"trigger"),i=n=>{!t.ignoreShortcut&&n.code==="KeyC"&&n.altKey&&p(n)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",i)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",i)}),t.withShortcut;const p=n=>u("add",n);return(n,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o.normCls)(e.unref(l),t.class)),tabindex:n.disabled?-1:0,disabled:n.disabled?"":void 0,onPointerdown:e.withModifiers(p,["stop"]),onKeyup:e.withModifiers(p,["stop"])},[e.createVNode(D._sfc_main,e.mergeProps(n.avatarProps??{},{size:"sm",src:n.src}),e.createSlots({_:2},[e.renderList(Object.keys(r),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(n.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.getBemElement)(e.unref(l),"text"))},[e.renderSlot(n.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)])],2),e.createVNode(ne._sfc_main,e.mergeProps(n.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,le))}}),ie=h.installComponent(q,o.getComponentName("Comment")),ae=h.installComponent(L,o.getComponentName("CommentAction")),pe=h.installComponent(F,o.getComponentName("CommentReaction")),ce=h.installComponent(j,o.getComponentName("CommentMention")),ue=h.installComponent(H,o.getComponentName("CommentEditor")),me=h.installComponent($,o.getComponentName("CommentTrigger")),de=d=>{const s=e.ref(!1),r=e.ref(),t=e.ref(!1),u=(a,P=!1)=>{s.value=!0,t.value=P,r.value=a},l=e.ref(!1),i=e.ref(),p=a=>{l.value=!0,i.value=a},n=e.computed(()=>({open:s.value,reference:r.value,"onUpdate:open":a=>s.value=a,onReaction:a=>{var P,k;if(t.value)try{(P=d.addEmoji)==null||P.call(d,a)}catch(x){console.error("error on reaction",x)}try{(k=d.onReaction)==null||k.call(d,a)}catch(x){console.error("error on reaction",x)}}})),y=e.computed(()=>({open:l.value,reference:i.value,"onUpdate:open":a=>l.value=a})),m=e.ref(!1),B=e.ref(),R=e.ref(),b=e.ref(),c=e.ref(!1),g=e.computed(()=>({ref:R,open:m.value,"onUpdate:open":a=>m.value=a,search:B.value,"onUpdate:search":a=>B.value=a,reference:b.value,disableOutsidePointerEvents:!1,resetSearchTermOnBlur:!0,headerSearch:c.value,onPointerDownOutside:C,onEscapeKeyDown:C})),f=a=>{a&&(b.value={getBoundingClientRect:a},m.value=!0,c.value=!1)},C=()=>{b.value=void 0,m.value=!1,B.value=void 0},_=a=>{B.value=a},S=e.computed(()=>({onOpenReaction:a=>u(a,!0),onOpenMention:a=>{a&&(b.value=a,m.value=!0,c.value=!0)}}));return{forwardRefMention:R,reactionBinding:n,actionBinding:y,editorBinding:S,mentionBinding:g,openActions:p,openReaction:u,openMentionInEditor:f,closeMentionInEditor:C,updateMentionQuery:_}};exports.Comment=q;exports.CommentAction=L;exports.CommentActionPlugin=ae;exports.CommentEditor=H;exports.CommentEditorPlugin=ue;exports.CommentMention=j;exports.CommentMentionPlugin=ce;exports.CommentPlugin=ie;exports.CommentReaction=F;exports.CommentReactionPlugin=pe;exports.CommentTrigger=$;exports.CommentTriggerPlugin=me;exports.commentPrefix=v;exports.injectCommentContext=V;exports.provideCommentContext=w;exports.useComment=de;
|