@shtabapp/ui-kit 1.70.0 → 1.71.2
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/CHANGELOG.md +18 -0
- package/dist/{SChartLine-Cp1csHeY.cjs → SChartLine-3l507dBg.cjs} +1 -1
- package/dist/{SChartLine-CTjiKi4H.js → SChartLine-v0tkmnN6.js} +1 -1
- package/dist/{SChartMultiLine-CbPSG0mN.js → SChartMultiLine-CG6dKmWm.js} +1 -1
- package/dist/{SChartMultiLine-Bt9Cf-L9.cjs → SChartMultiLine-vz7JdyA3.cjs} +1 -1
- package/dist/{SColorPicker-BmaA5Xnp.js → SColorPicker-BjtlrGHZ.js} +3 -3
- package/dist/{SColorPicker-D7mTRL7K.cjs → SColorPicker-Ct8FVU0D.cjs} +1 -1
- package/dist/SDropdown-B8Z4oNMk.cjs +1 -0
- package/dist/SDropdown-cNmJ5Lrz.js +400 -0
- package/dist/SSelect-mnobObXO.cjs +1 -0
- package/dist/{SSelect-DUtNtnqM.js → SSelect-rpJCD5PL.js} +22 -19
- package/dist/{STable-CunQFK-x.js → STable-1Bfr6VLH.js} +2 -2
- package/dist/{STable-Ch7thYCy.cjs → STable-uR69d9kL.cjs} +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts +4 -4
- package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
- package/dist/components/SDropdown/SDropdown.vue.d.ts +8 -8
- package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts +2 -0
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts.map +1 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts +3 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/utils/context.d.ts +13 -0
- package/dist/components/SDropdown/utils/context.d.ts.map +1 -0
- package/dist/components/SDropdown/utils/useDropdownTree.d.ts +18 -0
- package/dist/components/SDropdown/utils/useDropdownTree.d.ts.map +1 -0
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/composables/connectedPosition/computeConnectedPosition.d.ts.map +1 -1
- package/dist/composables/connectedPosition/getOverflow.d.ts +1 -0
- package/dist/composables/connectedPosition/getOverflow.d.ts.map +1 -1
- package/dist/composables/useEscapeDismiss.d.ts +15 -0
- package/dist/composables/useEscapeDismiss.d.ts.map +1 -0
- package/dist/composables/useFloatingOverlay.d.ts +4 -0
- package/dist/composables/useFloatingOverlay.d.ts.map +1 -1
- package/dist/createChartMarkersPlugin-Cg1yGzxW.cjs +1 -0
- package/dist/createChartMarkersPlugin-DkXituwE.js +43 -0
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/composables.cjs +1 -1
- package/dist/entries/composables.js +2 -2
- package/dist/entries/dropdown.cjs +1 -1
- package/dist/entries/dropdown.js +2 -2
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/table.cjs +1 -1
- package/dist/entries/table.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +8 -8
- package/dist/uikit-components.css +1 -1
- package/dist/useFloatingOverlay-CwGCMrig.cjs +1 -0
- package/dist/{useFloatingOverlay-b9_eDGNE.js → useFloatingOverlay-TxzVisMJ.js} +89 -86
- package/dist/utils/chart/core/createChartMarkersPlugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/SDropdown-BdgpPzfl.cjs +0 -1
- package/dist/SDropdown-xNcC6JDy.js +0 -362
- package/dist/SSelect-Coyrc99Y.cjs +0 -1
- package/dist/createChartMarkersPlugin-DSKGilFU.js +0 -40
- package/dist/createChartMarkersPlugin-S4oQKxO4.cjs +0 -1
- package/dist/useFloatingOverlay-Dp44TxvN.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SButton-CLTNdnCK.cjs"),t=require("./useSelectionGroup-NJvi3hNo.cjs"),n=require("./SDropdown-B8Z4oNMk.cjs"),r=require("./SDropdownMenu-k9SxaFVH.cjs"),i=require("./SInput-B4So5LGW.cjs"),a=require("./SListItem-BeaflFVf.cjs"),o=require("./SList-CvP0U6U1.cjs");let s=require("vue"),c=require("@shtabapp/ui-kit-primitives");var l=({listItemScope:e,itemTitle:t,itemSubtitle:n,itemDisabled:r,itemIconLeft:i,listActiveKey:a,isOptionSelected:s})=>{let c=e.item;return{rowKey:e.key,title:o.i(c,t),subtitle:o.i(c,n),disabled:o.n(c,r),iconLeft:o.r(c,i),selected:s,active:a===e.key,revealRight:e.revealRight,tiny:!0}},u=e=>typeof e==`string`||typeof e==`number`,d=(e,t)=>{let n=e[t];if(u(n))return n},f=e=>typeof e==`string`?e:String(e),p=e=>e==null?!1:typeof e==`string`?e.length>0:!0,m=(e,t,n)=>t.find(t=>f(d(t,n)??``)===e),h=e=>typeof e==`object`&&!!e,g=(e,t,n)=>{let r=m(e,t,n);if(r)return d(r,n)},_=function(e){return e.INPUT=`input`,e.CONTENT=`content`,e}({}),v=(e,t,n)=>{if(!e)return!0;let r=e.toLocaleLowerCase(),i=o.i(t,n.itemTitle)?.toLocaleLowerCase()??``,a=f(d(t,n.itemValue)??``).toLocaleLowerCase();return i.includes(r)||a.includes(r)},y=(e,t,n,r)=>{let i=r??((e,t)=>v(e,t,n));return t?e.filter(e=>i(t,e)):[...e]},b=e=>typeof e==`string`&&p(e),x=e=>typeof e==`number`&&p(e),S=(e,t,n)=>{if(t){if(!h(e))return;let t=d(e,n);return b(t)||x(t)?t:void 0}let r=typeof e==`string`||typeof e==`number`?e:void 0;if(b(r)||x(r))return r},C=(e,t,n)=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let r=S(e,t,n);return p(r)?[r]:[]}):[],w=(e,t)=>{if(b(t)){e.value=t;return}if(x(t)){e.value=t;return}e.value=void 0},T=(e,t,n)=>t.flatMap(t=>{let r=f(t),i=e.find(e=>f(d(e,n)??``)===r);return i?[i]:[]}),E=({modelValue:e,options:n,itemFields:r,multiple:i,returnObject:a,searchable:c,filterOption:l,isDropdownOpen:u,searchQuery:h})=>{let v=(0,s.computed)(()=>(0,s.toValue)(i)),b=(0,s.computed)(()=>(0,s.toValue)(a)),x=(0,s.computed)(()=>(0,s.toValue)(c)===_.INPUT),S=(0,s.computed)(()=>(0,s.toValue)(c)===_.CONTENT),E=(0,s.computed)(()=>!!(0,s.toValue)(c)),D=(0,s.computed)(()=>{let t=(0,s.toValue)(r);return C(e.value,b.value,t.itemValue)}),ee=(0,s.computed)(()=>{let e=(0,s.toValue)(n),t=(0,s.toValue)(r);return y(e,E.value?h.value:``,t,(0,s.toValue)(l))}),te=(0,s.computed)(()=>v.value?t.n.MULTIPLE:t.n.SINGLE),O=(t,n,r)=>{if(b.value){e.value=T(n,t,r);return}e.value=t},ne=(t,n,r)=>{if(!t){e.value=void 0;return}if(b.value){e.value=m(t,n,r)??void 0;return}w(e,g(t,n,r))},re=(0,s.computed)({get:()=>{if(v.value)return D.value.map(e=>f(e));let e=D.value[0];if(p(e))return f(e)},set:e=>{let t=(0,s.toValue)(n),i=(0,s.toValue)(r);if(v.value){O((Array.isArray(e)?e:[]).map(e=>g(e,t,i.itemValue)).filter(e=>p(e)),t,i.itemValue);return}ne(typeof e==`string`?e:void 0,t,i.itemValue)}}),ie=(0,s.computed)(()=>D.value.length>0),k=(e,t,n)=>{let r=f(t);return e.find(e=>f(d(e,n)??``)===r)},A=(0,s.computed)(()=>{let e=D.value[0];if(!p(e))return``;let t=(0,s.toValue)(r),i=k((0,s.toValue)(n),e,t.itemValue);return i?o.i(i,t.itemTitle)??``:f(e)}),j=(0,s.computed)(()=>{let e=(0,s.toValue)(n),t=(0,s.toValue)(r);return D.value.map(n=>{let r=k(e,n,t.itemValue);return r?o.i(r,t.itemTitle)??``:f(n)})}),M=(0,s.computed)(()=>j.value.join(`, `)),N=(0,s.computed)(()=>v.value?D.value.length===0:!A.value),P=(0,s.computed)(()=>x.value&&(u.value||v.value)),F=()=>{h.value=``};return(0,s.watch)(u,e=>{e||F()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{F()}),{searchQuery:h,selectedValues:D,filteredOptions:ee,listSelectionMode:te,listSelectedModel:re,hasSelectedValues:ie,singleDisplayLabel:A,multipleDisplayLabels:j,multipleDisplayText:M,showPlaceholder:N,showInputSearchField:P,isSearchableMode:E,isSearchableInputMode:x,isSearchableContentMode:S,isMultipleMode:v,isReturnObjectMode:b,clearSelection:()=>{e.value=void 0,F()},removeSelectedValue:e=>{let t=f(e);O(D.value.filter(e=>f(e)!==t),(0,s.toValue)(n),(0,s.toValue)(r).itemValue)},resetSearchQuery:F,formatSelectListKey:f,resolveValueFromListKey:e=>g(e,(0,s.toValue)(n),(0,s.toValue)(r).itemValue)}},D={key:1,class:`s-ui-select__empty s-ui-typography-body-14-regular`},ee=[`id`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-readonly`,`aria-autocomplete`,`tabindex`],te={key:0,class:`s-ui-select__value`},O={key:1,class:`s-ui-select__placeholder`},ne={key:1,class:`s-ui-select__placeholder`},re={key:2,class:`s-ui-select__value`},ie={key:3,class:`s-ui-select__value-suffix`},k=[`name`,`placeholder`,`disabled`,`readonly`],A=20,j=`100%`,M=20,N=(0,s.defineComponent)({__name:`SSelect`,props:(0,s.mergeModels)({options:{},itemValue:{default:`value`},itemTitle:{default:`label`},itemSubtitle:{default:`subtitle`},itemId:{},itemDisabled:{default:`disabled`},itemIconLeft:{default:`iconLeft`},multiple:{type:Boolean,default:!1},returnObject:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},closableOptions:{type:Boolean,default:!1},searchable:{type:[String,Boolean],default:!1},closeOnSelect:{type:Boolean,default:!0},listHeight:{default:320},searchPlaceholder:{default:`Search`},filterOption:{type:Function},fitViewport:{type:Boolean,default:!0},panelWidth:{},surfaceClass:{},canLoadMore:{type:Function},endReachedDistance:{default:0},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>i.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`,`endReached`],[`update:modelValue`,`update:searchQuery`]),setup(t,{expose:u,emit:d}){let f=(0,s.useModel)(t,`modelValue`),m=(0,s.useModel)(t,`searchQuery`),h=d,{t:g}=(0,c.useUiKitI18n)(),_=(0,s.useSlots)(),v=(0,s.useId)(),y=(0,s.useId)(),b=(0,s.useTemplateRef)(`triggerInputRef`),x=(0,s.ref)(``),S=(0,s.useTemplateRef)(`searchInputElementRef`),C=(0,s.useTemplateRef)(`panelSearchInputElementRef`),w=(0,s.useTemplateRef)(`listElementRef`),T=(0,s.ref)(),N=(0,s.ref)(!1),P=(0,s.ref)(!1),F=(0,s.computed)(()=>t.panelWidth===void 0),ae=(0,s.computed)(()=>t.panelWidth??j),oe=(0,s.computed)(()=>t.itemId??t.itemValue),se=(0,s.computed)(()=>({itemValue:t.itemValue,itemTitle:t.itemTitle,itemSubtitle:t.itemSubtitle,itemId:oe.value})),{selectedValues:I,filteredOptions:L,listSelectionMode:ce,listSelectedModel:R,hasSelectedValues:z,singleDisplayLabel:B,multipleDisplayLabels:le,multipleDisplayText:V,showPlaceholder:H,showInputSearchField:U,isSearchableMode:ue,isSearchableInputMode:W,isSearchableContentMode:G,isMultipleMode:K,clearSelection:de,removeSelectedValue:q,resolveValueFromListKey:fe,formatSelectListKey:J}=E({modelValue:f,options:()=>t.options,itemFields:()=>se.value,multiple:()=>t.multiple,returnObject:()=>t.returnObject,searchable:()=>t.searchable,filterOption:()=>t.filterOption,isDropdownOpen:N,searchQuery:m}),pe=(0,s.computed)(()=>({disabled:t.disabled,displayLabel:B.value})),Y=(0,s.computed)(()=>L.value.length>M),me=(0,s.computed)(()=>G.value||Y.value?t.listHeight:`auto`),he=(0,s.computed)(()=>{if(!(G.value||Y.value))return t.listHeight}),ge=(0,s.computed)(()=>I.value.map(e=>J(e))),_e=e=>ge.value.includes(e),ve=()=>({tiny:!0}),ye=e=>l({listItemScope:e,itemTitle:t.itemTitle,itemSubtitle:t.itemSubtitle,itemDisabled:t.itemDisabled,itemIconLeft:t.itemIconLeft,listActiveKey:T.value,isOptionSelected:_e(e.key)}),be=e=>{let t=fe(e);if(p(t)){if(K.value){q(t);return}f.value=void 0}},xe=(0,s.computed)(()=>t.id??v),Se=(0,s.computed)(()=>y),Ce=(0,s.computed)(()=>b.value?.fieldElementRef??null),we=(0,s.computed)(()=>({labels:le.value,values:I.value,displayText:V.value,disabled:t.disabled||t.readonly,removeValue:q})),Te=(0,s.computed)(()=>{if(!t.disabled&&(t.readonly&&!W.value||!W.value))return 0}),Ee=(0,s.computed)(()=>({"s-ui-select--disabled":t.disabled,"s-ui-select--readonly":t.readonly,"s-ui-select--multiple":K.value,"s-ui-select--open":N.value})),De=()=>{if(G.value){C.value?.focus();return}S.value?.focus()},Oe=async()=>{await(0,s.nextTick)(),C.value?.focus()},ke=async()=>{await(0,s.nextTick)(),await w.value?.focusNavigation()},X=async()=>{if(!(t.disabled||t.readonly)&&!N.value){if(N.value=!0,h(`open`),G.value){await Oe();return}if(W.value){await(0,s.nextTick)(),S.value?.focus();return}await ke()}},Ae=async()=>{t.disabled||t.readonly||N.value||await X()};(0,s.watch)(m,async e=>{W.value&&(t.disabled||t.readonly||e&&(N.value||await X()))});let Z=()=>{N.value&&(N.value=!1,T.value=void 0,h(`close`))},Q=()=>{!t.closeOnSelect||K.value||Z()};(0,s.watch)(f,(e,n)=>{!t.closeOnSelect||K.value||!N.value||!e||e===n||Z()});let je=e=>{N.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Me=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||N.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(N.value){Z();return}await X()},Ne=async e=>{if(!(t.disabled||t.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){N.value||await X();return}await $()}},Pe=async()=>{t.disabled||t.readonly||await $()},Fe=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),N.value||await X(),await ke(),await w.value?.handleKeyboardNavigation(e),!0),Ie=e=>{let t=fe(e);if(t){if(K.value){I.value.some(t=>J(t)===e)?q(t):R.value=[...I.value.map(e=>J(e)),e];return}R.value=e,Q()}},Le=async e=>{if(!(t.disabled||t.readonly)&&!await Fe(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),N.value&&T.value){Ie(T.value);return}await $()}}},Re=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await Fe(e)},ze=Re,Be=e=>{t.disabled||(P.value||h(`focus`,e),P.value=!0)},Ve=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(P.value=!1,h(`blur`,e))},He=()=>{de(),h(`clear`)},Ue=e=>{h(`endReached`,e)};return u({open:X,close:Z,toggle:$,focusSearchInput:De}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,Ee.value])},[(0,s.createVNode)((0,s.unref)(n.t),{modelValue:N.value,"onUpdate:modelValue":u[4]||=e=>N.value=e,reference:Ce.value,disabled:t.disabled,"match-reference-width":F.value,"fit-viewport":t.fitViewport,"surface-class":t.surfaceClass,"content-id":Se.value,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{content:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.t),{class:`s-ui-select__menu`,width:ae.value},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{class:`s-ui-select__menu-body`,onClick:je,onKeydown:Me},[(0,s.unref)(L).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(o.t),{key:0,ref_key:`listElementRef`,ref:w,modelValue:T.value,"onUpdate:modelValue":u[2]||=e=>T.value=e,selected:(0,s.unref)(R),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(R)?R.value=e:null,items:(0,s.unref)(L),"item-key":oe.value,"title-key":t.itemTitle,"subtitle-key":t.itemSubtitle,"icon-left-key":t.itemIconLeft,"disabled-key":t.itemDisabled,"selection-mode":(0,s.unref)(ce),mandatory:!t.multiple,height:me.value,"max-height":he.value,virtual:Y.value,"item-props":ve,"selected-on-top":(0,s.unref)(K),"can-load-more":t.canLoadMore,"end-reached-distance":t.endReachedDistance,onEndReached:Ue},(0,s.createSlots)({_:2},[(0,s.unref)(_).option||(0,s.unref)(_)[`option-icon`]||t.closableOptions||(0,s.unref)(K)?{name:`item`,fn:(0,s.withCtx)(n=>[(0,s.unref)(_).option?(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},n))):t.closableOptions?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),(0,s.normalizeProps)((0,s.mergeProps)({key:1},ye(n))),(0,s.createSlots)({_:2},[(0,s.unref)(_)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(n)))]),key:`0`}:void 0,_e(n.key)?{name:`right`,fn:(0,s.withCtx)(t=>[(0,s.createVNode)((0,s.unref)(e.t),{appearance:(0,s.unref)(e.n).BARE,variant:(0,s.unref)(e.i).NEUTRAL,size:(0,s.unref)(e.r).SMALL,icon:`closeMini`,"aria-label":(0,s.unref)(g)(`select.removeOption`),disabled:t.disabled||t.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>be(n.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`aria-label`,`disabled`,`onClick`])]),key:`1`}:void 0]),1040)):((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),(0,s.normalizeProps)((0,s.mergeProps)({key:2},ye(n))),(0,s.createSlots)({_:2},[(0,s.unref)(_)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(n)))]),key:`0`}:void 0]),1040))]),key:`0`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`,`selected-on-top`,`can-load-more`,`end-reached-distance`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,D,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(g)(`select.noOptions`)),1)])]))],32)]),_:2},[(0,s.unref)(G)||(0,s.unref)(_)[`panel-header`]?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-header`),(0,s.unref)(G)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(i.t),{key:0,ref_key:`panelSearchInputElementRef`,ref:C,modelValue:m.value,"onUpdate:modelValue":u[0]||=e=>m.value=e,placeholder:t.searchPlaceholder,disabled:t.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(ze)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])):(0,s.createCommentVNode)(``,!0)]),key:`0`}:void 0,(0,s.unref)(_)[`panel-footer`]?{name:`footer`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-footer`)]),key:`1`}:void 0]),1032,[`width`])]),_:3},8,[`modelValue`,`reference`,`disabled`,`match-reference-width`,`fit-viewport`,`surface-class`,`content-id`]),(0,s.createVNode)((0,s.unref)(i.t),{ref_key:`triggerInputRef`,ref:b,modelValue:x.value,"onUpdate:modelValue":u[7]||=e=>x.value=e,label:t.label,"label-props":t.labelProps,placeholder:t.placeholder,"help-messages":t.helpMessages,"error-messages":t.errorMessages,bordered:t.bordered,disabled:t.disabled,readonly:t.readonly,clearable:t.clearable,"has-value":(0,s.unref)(z),focused:P.value||N.value,"icon-left":t.iconLeft,customize:t.customize,name:t.name,id:xe.value,onClear:He,onFocus:Be,onBlur:Ve},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:xe.value,class:(0,s.normalizeClass)([`s-ui-select__control s-ui-typography-body-14-regular`,{"s-ui-select__control--multiple":(0,s.unref)(K),"s-ui-select__control--empty":(0,s.unref)(K)&&!(0,s.unref)(z)&&!(0,s.unref)(U),"s-ui-select__control--with-value-suffix":(0,s.unref)(_)[`value-suffix`]&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)}]),role:`combobox`,"aria-expanded":N.value,"aria-controls":Se.value,"aria-haspopup":`listbox`,"aria-disabled":t.disabled?!0:void 0,"aria-readonly":t.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(ue)?`list`:void 0,tabindex:Te.value,onClick:Ne,onKeydown:Le},[(0,s.unref)(K)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},we.value)),()=>[(0,s.unref)(V)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,te,(0,s.toDisplayString)((0,s.unref)(V)),1)):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,O,(0,s.toDisplayString)(t.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,ne,(0,s.toDisplayString)(t.placeholder),1)):(0,s.unref)(U)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,re,(0,s.toDisplayString)((0,s.unref)(B)),1)),(0,s.unref)(_)[`value-suffix`]&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,ie,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(pe.value)))])):(0,s.createCommentVNode)(``,!0),(0,s.unref)(U)?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)(`input`,{key:4,ref_key:`searchInputElementRef`,ref:S,"onUpdate:modelValue":u[5]||=e=>m.value=e,class:`s-ui-select__search-input`,type:`text`,name:t.name,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Ae,onKeydown:Re},null,40,k)),[[s.vModelText,m.value]]):(0,s.createCommentVNode)(``,!0)],42,ee)]),action:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.SIcon),{name:`chevronMiniDown`,size:A,class:`s-ui-select__chevron`,onClick:Pe})]),_:2},[(0,s.unref)(_).label?{name:`label`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`label`)]),key:`0`}:void 0,(0,s.unref)(_).prefix?{name:`prefix`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prefix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`1`}:void 0,(0,s.unref)(_).prepend?{name:`prepend`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prepend`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`2`}:void 0,(0,s.unref)(_).message?{name:`message`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`message`)]),key:`3`}:void 0]),1032,[`modelValue`,`label`,`label-props`,`placeholder`,`help-messages`,`error-messages`,`bordered`,`disabled`,`readonly`,`clearable`,`has-value`,`focused`,`icon-left`,`customize`,`name`,`id`])],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return N}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e, n as t, r as n, t as r } from "./SButton-LAOBxpd4.js";
|
|
2
2
|
import { n as i } from "./useSelectionGroup-BCAmPf3R.js";
|
|
3
|
-
import { t as a } from "./SDropdown-
|
|
3
|
+
import { t as a } from "./SDropdown-cNmJ5Lrz.js";
|
|
4
4
|
import { t as o } from "./SDropdownMenu-2koPU6IG.js";
|
|
5
5
|
import { n as s, t as c } from "./SInput-D8NftspL.js";
|
|
6
6
|
import { t as l } from "./SListItem-BOSQGRWA.js";
|
|
@@ -362,7 +362,9 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
362
362
|
}
|
|
363
363
|
await lt();
|
|
364
364
|
}
|
|
365
|
-
}, dt = async (
|
|
365
|
+
}, dt = async () => {
|
|
366
|
+
i.disabled || i.readonly || await lt();
|
|
367
|
+
}, ft = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), V.value || await Q(), await it(), await z.value?.handleKeyboardNavigation(e), !0), pt = (e) => {
|
|
366
368
|
let t = ze(e);
|
|
367
369
|
if (t) {
|
|
368
370
|
if (Z.value) {
|
|
@@ -371,35 +373,35 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
371
373
|
}
|
|
372
374
|
K.value = e, ot();
|
|
373
375
|
}
|
|
374
|
-
},
|
|
375
|
-
if (!(i.disabled || i.readonly) && !await
|
|
376
|
+
}, mt = async (e) => {
|
|
377
|
+
if (!(i.disabled || i.readonly) && !await ft(e)) {
|
|
376
378
|
if (e.key === "Escape") {
|
|
377
379
|
e.preventDefault(), $();
|
|
378
380
|
return;
|
|
379
381
|
}
|
|
380
382
|
if (e.key === "Enter" || e.key === " ") {
|
|
381
383
|
if (e.preventDefault(), V.value && B.value) {
|
|
382
|
-
|
|
384
|
+
pt(B.value);
|
|
383
385
|
return;
|
|
384
386
|
}
|
|
385
387
|
await lt();
|
|
386
388
|
}
|
|
387
389
|
}
|
|
388
|
-
},
|
|
390
|
+
}, ht = async (e) => {
|
|
389
391
|
if (e.key === "Escape") {
|
|
390
392
|
e.preventDefault(), $();
|
|
391
393
|
return;
|
|
392
394
|
}
|
|
393
|
-
await
|
|
394
|
-
},
|
|
395
|
+
await ft(e);
|
|
396
|
+
}, gt = ht, _t = (e) => {
|
|
395
397
|
i.disabled || (H.value || y("focus", e), H.value = !0);
|
|
396
|
-
},
|
|
398
|
+
}, vt = (e) => {
|
|
397
399
|
if (!(e.currentTarget instanceof HTMLElement)) return;
|
|
398
400
|
let t = e.relatedTarget;
|
|
399
401
|
t instanceof Node && e.currentTarget.contains(t) || (H.value = !1, y("blur", e));
|
|
400
|
-
},
|
|
402
|
+
}, yt = () => {
|
|
401
403
|
Le(), y("clear");
|
|
402
|
-
},
|
|
404
|
+
}, bt = (e) => {
|
|
403
405
|
y("endReached", e);
|
|
404
406
|
};
|
|
405
407
|
return s({
|
|
@@ -450,7 +452,7 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
450
452
|
"selected-on-top": A(Z),
|
|
451
453
|
"can-load-more": i.canLoadMore,
|
|
452
454
|
"end-reached-distance": i.endReachedDistance,
|
|
453
|
-
onEndReached:
|
|
455
|
+
onEndReached: bt
|
|
454
456
|
}, _({ _: 2 }, [A(k).option || A(k)["option-icon"] || i.closableOptions || A(Z) ? {
|
|
455
457
|
name: "item",
|
|
456
458
|
fn: M((a) => [A(k).option ? D(s.$slots, "option", w(S({ key: 0 }, a))) : i.closableOptions ? (T(), m(A(l), w(S({ key: 1 }, Je(a))), _({ _: 2 }, [A(k)["option-icon"] ? {
|
|
@@ -515,7 +517,7 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
515
517
|
clearable: !1,
|
|
516
518
|
"icon-left": "search",
|
|
517
519
|
onClick: u[1] ||= de(() => {}, ["stop"]),
|
|
518
|
-
onKeydown: A(
|
|
520
|
+
onKeydown: A(gt)
|
|
519
521
|
}, null, 8, [
|
|
520
522
|
"modelValue",
|
|
521
523
|
"placeholder",
|
|
@@ -557,9 +559,9 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
557
559
|
customize: i.customize,
|
|
558
560
|
name: i.name,
|
|
559
561
|
id: Xe.value,
|
|
560
|
-
onClear:
|
|
561
|
-
onFocus:
|
|
562
|
-
onBlur:
|
|
562
|
+
onClear: yt,
|
|
563
|
+
onFocus: _t,
|
|
564
|
+
onBlur: vt
|
|
563
565
|
}, _({
|
|
564
566
|
control: M(() => [te("div", {
|
|
565
567
|
id: Xe.value,
|
|
@@ -577,7 +579,7 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
577
579
|
"aria-autocomplete": A(Ie) ? "list" : void 0,
|
|
578
580
|
tabindex: et.value,
|
|
579
581
|
onClick: ut,
|
|
580
|
-
onKeydown:
|
|
582
|
+
onKeydown: mt
|
|
581
583
|
}, [
|
|
582
584
|
A(Z) ? D(s.$slots, "selection", w(S({ key: 0 }, $e.value)), () => [A(Fe) ? (T(), g("span", Se, O(A(Fe)), 1)) : A(q) && !A(J) ? (T(), g("span", Ce, O(i.placeholder), 1)) : h("", !0)]) : A(q) && !A(J) ? (T(), g("span", we, O(i.placeholder), 1)) : A(J) ? h("", !0) : (T(), g("span", Te, O(A(Ne)), 1)),
|
|
583
585
|
A(k)["value-suffix"] && !A(Z) && !A(J) && !A(q) ? (T(), g("div", Ee, [D(s.$slots, "value-suffix", w(b(Ve.value)))])) : h("", !0),
|
|
@@ -595,13 +597,14 @@ var me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
595
597
|
autocomplete: "off",
|
|
596
598
|
onClick: u[6] ||= de(() => {}, ["stop"]),
|
|
597
599
|
onFocus: at,
|
|
598
|
-
onKeydown:
|
|
600
|
+
onKeydown: ht
|
|
599
601
|
}, null, 40, De)), [[ce, f.value]]) : h("", !0)
|
|
600
602
|
], 42, xe)]),
|
|
601
603
|
action: M(() => [v(A(fe), {
|
|
602
604
|
name: "chevronMiniDown",
|
|
603
605
|
size: Oe,
|
|
604
|
-
class: "s-ui-select__chevron"
|
|
606
|
+
class: "s-ui-select__chevron",
|
|
607
|
+
onClick: dt
|
|
605
608
|
})]),
|
|
606
609
|
_: 2
|
|
607
610
|
}, [
|
|
@@ -2,8 +2,8 @@ import { n as e, t } from "./contrastSurfaceTextColor-BDlLSSXC.js";
|
|
|
2
2
|
import { t as n } from "./colorValue-CSh0chxp.js";
|
|
3
3
|
import { i as r, n as i, r as a, t as o } from "./SButton-LAOBxpd4.js";
|
|
4
4
|
import { i as s, t as c } from "./SCheckbox-BMkOc5cn.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as u } from "./SDropdown-
|
|
5
|
+
import { s as l } from "./useFloatingOverlay-TxzVisMJ.js";
|
|
6
|
+
import { t as u } from "./SDropdown-cNmJ5Lrz.js";
|
|
7
7
|
import { t as d } from "./SDropdownMenu-2koPU6IG.js";
|
|
8
8
|
import { a as f, o as p, r as m } from "./treeKeyboardNavigation-SmxTdnDz.js";
|
|
9
9
|
import { t as h } from "./SListItem-BOSQGRWA.js";
|