@shtabapp/ui-kit 1.51.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/{SColorPicker-Dl5H4iwH.js → SColorPicker-C1wT4fRa.js} +1 -1
- package/dist/{SColorPicker-CuuiFxI0.cjs → SColorPicker-hCvgFpwK.cjs} +1 -1
- package/dist/{SSelect-pXiw_NyB.js → SSelect-Bf1lDJ0M.js} +184 -173
- package/dist/SSelect-CPm2SRpw.cjs +1 -0
- package/dist/components/SSelect/SSelect.types.d.ts +16 -0
- package/dist/components/SSelect/SSelect.types.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.vue.d.ts +6 -1
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/uikit-components.css +1 -1
- package/package.json +1 -1
- package/dist/SSelect-CMR4dxSn.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./useSelectionGroup-TaektE-I.cjs"),r=require("./SDropdown-_QUOP-rw.cjs"),i=require("./SInput-DJL9QOIG.cjs"),a=require("./SList-qQ7B5u8o.cjs"),o=require("./SListItem-DBGDVeoJ.cjs");let s=require("vue"),c=require("@shtabapp/ui-kit-primitives");var l={key:0,class:`s-ui-dropdown-menu__header`},u={key:1,class:`s-ui-dropdown-menu__footer`},d=(0,s.defineComponent)({__name:`SDropdownMenu`,props:{width:{},maxHeight:{},accent:{type:Boolean,default:!1}},setup(e){let t=(0,s.useSlots)(),n=e=>typeof e==`number`?`${e}px`:e,r=(0,s.computed)(()=>({"s-ui-dropdown-menu--accent":e.accent,"s-ui-dropdown-menu--bounded":!!e.maxHeight})),i=(0,s.computed)(()=>({"s-ui-dropdown-menu__body--scrollable":!!e.maxHeight})),a=(0,s.computed)(()=>({"--s-ui-dropdown-menu-width":n(e.width),"--s-ui-dropdown-menu-max-height":n(e.maxHeight)}));return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu`,r.value]),style:(0,s.normalizeStyle)(a.value)},[(0,s.unref)(t).header?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,l,[(0,s.renderSlot)(e.$slots,`header`)])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu__body`,i.value])},[(0,s.renderSlot)(e.$slots,`default`)],2),(0,s.unref)(t).footer?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,u,[(0,s.renderSlot)(e.$slots,`footer`)])):(0,s.createCommentVNode)(``,!0)],6))}}),f=({listItemScope:e,itemTitle:t,itemSubtitle:n,itemDisabled:r,itemIconLeft:i,listActiveKey:o,isOptionSelected:s})=>{let c=e.item;return{rowKey:e.key,title:a.i(c,t),subtitle:a.i(c,n),disabled:a.n(c,r),iconLeft:a.r(c,i),selected:s,active:o===e.key,revealRight:e.revealRight,tiny:!0}},p=e=>typeof e==`string`||typeof e==`number`,m=(e,t)=>{let n=e[t];if(p(n))return n},h=e=>typeof e==`string`?e:String(e),g=e=>e==null?!1:typeof e==`string`?e.length>0:!0,_=(e,t,n)=>t.find(t=>h(m(t,n)??``)===e),v=e=>typeof e==`object`&&!!e,y=(e,t,n)=>{let r=_(e,t,n);if(r)return m(r,n)},b=function(e){return e.INPUT=`input`,e.CONTENT=`content`,e}({}),x=(e,t,n)=>{if(!e)return!0;let r=e.toLocaleLowerCase(),i=a.i(t,n.itemTitle)?.toLocaleLowerCase()??``,o=h(m(t,n.itemValue)??``).toLocaleLowerCase();return i.includes(r)||o.includes(r)},S=(e,t,n,r)=>{let i=r??((e,t)=>x(e,t,n));return t?e.filter(e=>i(t,e)):[...e]},C=e=>typeof e==`string`&&g(e),w=e=>typeof e==`number`&&g(e),T=(e,t,n)=>{if(t){if(!v(e))return;let t=m(e,n);return C(t)||w(t)?t:void 0}let r=typeof e==`string`||typeof e==`number`?e:void 0;if(C(r)||w(r))return r},E=(e,t,n)=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let r=T(e,t,n);return g(r)?[r]:[]}):[],D=(e,t)=>{if(C(t)){e.value=t;return}if(w(t)){e.value=t;return}e.value=void 0},O=(e,t,n)=>t.flatMap(t=>{let r=h(t),i=e.find(e=>h(m(e,n)??``)===r);return i?[i]:[]}),k=({modelValue:e,options:t,itemFields:r,multiple:i,returnObject:o,searchable:c,filterOption:l,isDropdownOpen:u,searchQuery:d})=>{let f=(0,s.computed)(()=>(0,s.toValue)(i)),p=(0,s.computed)(()=>(0,s.toValue)(o)),v=(0,s.computed)(()=>(0,s.toValue)(c)===b.INPUT),x=(0,s.computed)(()=>(0,s.toValue)(c)===b.CONTENT),C=(0,s.computed)(()=>!!(0,s.toValue)(c)),w=(0,s.computed)(()=>{let t=(0,s.toValue)(r);return E(e.value,p.value,t.itemValue)}),T=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return S(e,C.value?d.value:``,n,(0,s.toValue)(l))}),k=(0,s.computed)(()=>f.value?n.n.MULTIPLE:n.n.SINGLE),A=(t,n,r)=>{if(p.value){e.value=O(n,t,r);return}e.value=t},ee=(t,n,r)=>{if(!t){e.value=void 0;return}if(p.value){e.value=_(t,n,r)??void 0;return}D(e,y(t,n,r))},te=(0,s.computed)({get:()=>{if(f.value)return w.value.map(e=>h(e));let e=w.value[0];if(g(e))return h(e)},set:e=>{let n=(0,s.toValue)(t),i=(0,s.toValue)(r);if(f.value){A((Array.isArray(e)?e:[]).map(e=>y(e,n,i.itemValue)).filter(e=>g(e)),n,i.itemValue);return}ee(typeof e==`string`?e:void 0,n,i.itemValue)}}),ne=(0,s.computed)(()=>w.value.length>0),j=(e,t,n)=>{let r=h(t);return e.find(e=>h(m(e,n)??``)===r)},M=(0,s.computed)(()=>{let e=w.value[0];if(!g(e))return``;let n=(0,s.toValue)(r),i=j((0,s.toValue)(t),e,n.itemValue);return i?a.i(i,n.itemTitle)??``:h(e)}),N=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return w.value.map(t=>{let r=j(e,t,n.itemValue);return r?a.i(r,n.itemTitle)??``:h(t)})}),re=(0,s.computed)(()=>N.value.join(`, `)),ie=(0,s.computed)(()=>f.value?w.value.length===0:!M.value),ae=(0,s.computed)(()=>v.value&&(u.value||f.value)),P=()=>{d.value=``};return(0,s.watch)(u,e=>{e||P()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{P()}),{searchQuery:d,selectedValues:w,filteredOptions:T,listSelectionMode:k,listSelectedModel:te,hasSelectedValues:ne,singleDisplayLabel:M,multipleDisplayLabels:N,multipleDisplayText:re,showPlaceholder:ie,showInputSearchField:ae,isSearchableMode:C,isSearchableInputMode:v,isSearchableContentMode:x,isMultipleMode:f,isReturnObjectMode:p,clearSelection:()=>{e.value=void 0,P()},removeSelectedValue:e=>{let n=h(e);A(w.value.filter(e=>h(e)!==n),(0,s.toValue)(t),(0,s.toValue)(r).itemValue)},resetSearchQuery:P,formatSelectListKey:h,resolveValueFromListKey:e=>y(e,(0,s.toValue)(t),(0,s.toValue)(r).itemValue)}},A={key:0,class:`s-ui-select__options-divider`,role:`separator`},ee={key:1,class:`s-ui-select__empty s-ui-typography-body-14-regular`},te=[`id`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-readonly`,`aria-autocomplete`,`tabindex`],ne={key:0,class:`s-ui-select__value`},j={key:1,class:`s-ui-select__placeholder`},M={key:1,class:`s-ui-select__placeholder`},N={key:2,class:`s-ui-select__value`},re={key:3,class:`s-ui-select__value-suffix`},ie=[`name`,`placeholder`,`disabled`,`readonly`],ae=20,P=20,oe=`__s-ui-select-options-divider__`,F=(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},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(n,{expose:l,emit:u}){let p=(0,s.useModel)(n,`modelValue`),h=(0,s.useModel)(n,`searchQuery`),_=u,{t:v}=(0,c.useUiKitI18n)(),y=(0,s.useSlots)(),b=(0,s.useId)(),x=(0,s.useId)(),S=(0,s.useTemplateRef)(`triggerInputRef`),C=(0,s.ref)(``),w=(0,s.useTemplateRef)(`searchInputElementRef`),T=(0,s.useTemplateRef)(`panelSearchInputElementRef`),E=(0,s.useTemplateRef)(`listElementRef`),D=(0,s.ref)(),O=(0,s.ref)(!1),F=(0,s.ref)(!1),I=(0,s.computed)(()=>n.itemId??n.itemValue),se=(0,s.computed)(()=>({itemValue:n.itemValue,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemId:I.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:ce,listSelectedModel:z,hasSelectedValues:le,singleDisplayLabel:ue,multipleDisplayLabels:de,multipleDisplayText:B,showPlaceholder:V,showInputSearchField:H,isSearchableMode:fe,isSearchableInputMode:U,isSearchableContentMode:W,isMultipleMode:G,clearSelection:pe,removeSelectedValue:K,resolveValueFromListKey:me,formatSelectListKey:q}=k({modelValue:p,options:()=>n.options,itemFields:()=>se.value,multiple:()=>n.multiple,returnObject:()=>n.returnObject,searchable:()=>n.searchable,filterOption:()=>n.filterOption,isDropdownOpen:O,searchQuery:h}),he=(0,s.computed)(()=>!!y[`value-suffix`]),ge=(0,s.computed)(()=>({disabled:n.disabled,displayLabel:ue.value})),J=(0,s.computed)(()=>R.value.length>P),_e=(0,s.computed)(()=>W.value||J.value?n.listHeight:`auto`),ve=(0,s.computed)(()=>{if(!(W.value||J.value))return n.listHeight}),ye=(0,s.computed)(()=>L.value.map(e=>q(e))),Y=e=>ye.value.includes(e),be=(0,s.computed)(()=>({[I.value]:oe,[n.itemDisabled]:!0})),xe=e=>q(m(e,I.value)??``),Se=(0,s.computed)(()=>{if(!G.value)return R.value;let e=[],t=[];for(let n of R.value)Y(xe(n))?e.push(n):t.push(n);return e.length===0||t.length===0?R.value:[...e,be.value,...t]}),Ce=()=>({tiny:!0}),we=e=>f({listItemScope:e,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemDisabled:n.itemDisabled,itemIconLeft:n.itemIconLeft,listActiveKey:D.value,isOptionSelected:Y(e.key)}),Te=e=>{let t=me(e);if(g(t)){if(G.value){K(t);return}p.value=void 0}},Ee=(0,s.computed)(()=>n.id??b),De=(0,s.computed)(()=>x),Oe=(0,s.computed)(()=>S.value?.fieldElementRef??null),ke=(0,s.computed)(()=>({labels:de.value,values:L.value,displayText:B.value,disabled:n.disabled||n.readonly,removeValue:K})),Ae=(0,s.computed)(()=>{if(!n.disabled&&(n.readonly&&!U.value||!U.value))return 0}),je=(0,s.computed)(()=>({"s-ui-select--disabled":n.disabled,"s-ui-select--readonly":n.readonly,"s-ui-select--multiple":G.value,"s-ui-select--open":O.value})),Me=()=>{if(W.value){T.value?.focus();return}w.value?.focus()},Ne=async()=>{await(0,s.nextTick)(),T.value?.focus()},Pe=async()=>{await(0,s.nextTick)(),await E.value?.focusNavigation()},X=async()=>{if(!(n.disabled||n.readonly)&&!O.value){if(O.value=!0,_(`open`),W.value){await Ne();return}if(U.value){await(0,s.nextTick)(),w.value?.focus();return}await Pe()}},Fe=async()=>{n.disabled||n.readonly||O.value||await X()};(0,s.watch)(h,async e=>{U.value&&(n.disabled||n.readonly||e&&(O.value||await X()))});let Z=()=>{O.value&&(O.value=!1,D.value=void 0,_(`close`))},Q=()=>{!n.closeOnSelect||G.value||Z()};(0,s.watch)(p,(e,t)=>{!n.closeOnSelect||G.value||!O.value||!e||e===t||Z()});let Ie=e=>{O.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Le=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||O.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(O.value){Z();return}await X()},Re=async e=>{if(!(n.disabled||n.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){O.value||await X();return}await $()}},ze=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),O.value||await X(),await Pe(),await E.value?.handleKeyboardNavigation(e),!0),Be=e=>{let t=me(e);if(t){if(G.value){L.value.some(t=>q(t)===e)?K(t):z.value=[...L.value.map(e=>q(e)),e];return}z.value=e,Q()}},Ve=async e=>{if(!(n.disabled||n.readonly)&&!await ze(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),O.value&&D.value){Be(D.value);return}await $()}}},He=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await ze(e)},Ue=He,We=e=>{n.disabled||(F.value||_(`focus`,e),F.value=!0)},Ge=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(F.value=!1,_(`blur`,e))},Ke=()=>{pe(),_(`clear`)},qe=e=>{_(`endReached`,e)};return l({open:X,close:Z,toggle:$,focusSearchInput:Me}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,je.value])},[(0,s.createVNode)((0,s.unref)(r.t),{modelValue:O.value,"onUpdate:modelValue":u[4]||=e=>O.value=e,reference:Oe.value,disabled:n.disabled,"match-reference-width":!0,"fit-viewport":n.fitViewport,"content-id":De.value,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{content:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(d),{class:`s-ui-select__menu`,width:`100%`},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{class:`s-ui-select__menu-body`,onClick:Ie,onKeydown:Le},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,ref_key:`listElementRef`,ref:E,modelValue:D.value,"onUpdate:modelValue":u[2]||=e=>D.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:Se.value,"item-key":I.value,"title-key":n.itemTitle,"subtitle-key":n.itemSubtitle,"icon-left-key":n.itemIconLeft,"disabled-key":n.itemDisabled,"selection-mode":(0,s.unref)(ce),mandatory:!n.multiple,height:_e.value,"max-height":ve.value,virtual:J.value,"item-props":Ce,"can-load-more":n.canLoadMore,"end-reached-distance":n.endReachedDistance,onEndReached:qe},(0,s.createSlots)({_:2},[(0,s.unref)(y).option||(0,s.unref)(y)[`option-icon`]||n.closableOptions||(0,s.unref)(G)?{name:`item`,fn:(0,s.withCtx)(r=>[r.key===oe?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,A)):(0,s.unref)(y).option?(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.mergeProps)({key:1},r))):n.closableOptions?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.mergeProps)({key:2},we(r))),(0,s.createSlots)({_:2},[(0,s.unref)(y)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(r)))]),key:`0`}:void 0,Y(r.key)?{name:`right`,fn:(0,s.withCtx)(n=>[(0,s.createVNode)((0,s.unref)(t.t),{appearance:(0,s.unref)(e.t).BARE,variant:(0,s.unref)(e.r).NEUTRAL,size:(0,s.unref)(e.n).SMALL,icon:`closeMini`,"aria-label":(0,s.unref)(v)(`select.removeOption`),disabled:n.disabled||n.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>Te(r.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)(o.t),(0,s.normalizeProps)((0,s.mergeProps)({key:3},we(r))),(0,s.createSlots)({_:2},[(0,s.unref)(y)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(r)))]),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`,`can-load-more`,`end-reached-distance`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,ee,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(v)(`select.noOptions`)),1)])]))],32)]),_:2},[(0,s.unref)(W)||(0,s.unref)(y)[`panel-header`]?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-header`),(0,s.unref)(W)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(i.t),{key:0,ref_key:`panelSearchInputElementRef`,ref:T,modelValue:h.value,"onUpdate:modelValue":u[0]||=e=>h.value=e,placeholder:n.searchPlaceholder,disabled:n.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Ue)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])):(0,s.createCommentVNode)(``,!0)]),key:`0`}:void 0,(0,s.unref)(y)[`panel-footer`]?{name:`footer`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-footer`)]),key:`1`}:void 0]),1024)]),_:3},8,[`modelValue`,`reference`,`disabled`,`fit-viewport`,`content-id`]),(0,s.createVNode)((0,s.unref)(i.t),{ref_key:`triggerInputRef`,ref:S,modelValue:C.value,"onUpdate:modelValue":u[7]||=e=>C.value=e,label:n.label,"label-props":n.labelProps,placeholder:n.placeholder,"help-messages":n.helpMessages,"error-messages":n.errorMessages,bordered:n.bordered,disabled:n.disabled,readonly:n.readonly,clearable:n.clearable,"has-value":(0,s.unref)(le),focused:F.value||O.value,"icon-left":n.iconLeft,customize:n.customize,name:n.name,id:Ee.value,onClear:Ke,onFocus:We,onBlur:Ge},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:Ee.value,class:(0,s.normalizeClass)([`s-ui-select__control s-ui-typography-body-14-regular`,{"s-ui-select__control--multiple":(0,s.unref)(G),"s-ui-select__control--empty":(0,s.unref)(G)&&!(0,s.unref)(le)&&!(0,s.unref)(H),"s-ui-select__control--with-value-suffix":he.value&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)}]),role:`combobox`,"aria-expanded":O.value,"aria-controls":De.value,"aria-haspopup":`listbox`,"aria-disabled":n.disabled?!0:void 0,"aria-readonly":n.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(fe)?`list`:void 0,tabindex:Ae.value,onClick:Re,onKeydown:Ve},[(0,s.unref)(G)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},ke.value)),()=>[(0,s.unref)(B)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,ne,(0,s.toDisplayString)((0,s.unref)(B)),1)):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,j,(0,s.toDisplayString)(n.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,M,(0,s.toDisplayString)(n.placeholder),1)):(0,s.unref)(H)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,N,(0,s.toDisplayString)((0,s.unref)(ue)),1)),he.value&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,re,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(ge.value)))])):(0,s.createCommentVNode)(``,!0),(0,s.unref)(H)?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)(`input`,{key:4,ref_key:`searchInputElementRef`,ref:w,"onUpdate:modelValue":u[5]||=e=>h.value=e,class:`s-ui-select__search-input`,type:`text`,name:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Fe,onKeydown:He},null,40,ie)),[[s.vModelText,h.value]]):(0,s.createCommentVNode)(``,!0)],42,te)]),action:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.SIcon),{name:`chevronMiniDown`,size:ae,class:`s-ui-select__chevron`})]),_:2},[(0,s.unref)(y).label?{name:`label`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`label`)]),key:`0`}:void 0,(0,s.unref)(y).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)(y).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)(y).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 b}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return F}});
|
|
@@ -77,6 +77,11 @@ export interface ISSelectSlots<TItem extends Record<string, unknown> = ISSelectO
|
|
|
77
77
|
* Заменяет иконку из `itemIconLeft`; строка, подсветка и клавиатура остаются дефолтными.
|
|
78
78
|
*/
|
|
79
79
|
'option-icon'?: Slot<TSSelectOptionSlotScope<TItem>>;
|
|
80
|
+
/**
|
|
81
|
+
* Кастомная шапка панели над списком опций (например переключатель/табы).
|
|
82
|
+
* При `searchable="content"` поле поиска рендерится под содержимым слота.
|
|
83
|
+
*/
|
|
84
|
+
'panel-header'?: Slot;
|
|
80
85
|
empty?: Slot;
|
|
81
86
|
'panel-footer'?: Slot;
|
|
82
87
|
}
|
|
@@ -91,6 +96,10 @@ export interface ISSelectEmits {
|
|
|
91
96
|
open: [];
|
|
92
97
|
/** Панель закрылась. */
|
|
93
98
|
close: [];
|
|
99
|
+
/** Скролл списка опций достиг низа — запросите следующую порцию (infinite scroll). */
|
|
100
|
+
endReached: [payload: {
|
|
101
|
+
direction: 'bottom';
|
|
102
|
+
}];
|
|
94
103
|
}
|
|
95
104
|
export interface ISSelectProps<TItem extends Record<string, unknown> = ISSelectOption, TReturnObject extends boolean = boolean, TMultiple extends boolean = boolean> extends Pick<ISInputProps, 'label' | 'labelProps' | 'placeholder' | 'helpMessages' | 'errorMessages' | 'bordered' | 'disabled' | 'readonly' | 'iconLeft' | 'customize' | 'name' | 'id'> {
|
|
96
105
|
/** Набор опций выпадающего списка. */
|
|
@@ -130,6 +139,13 @@ export interface ISSelectProps<TItem extends Record<string, unknown> = ISSelectO
|
|
|
130
139
|
* Отключите (`false`) внутри контейнеров с `overflow: hidden`, если панель не появляется.
|
|
131
140
|
*/
|
|
132
141
|
fitViewport?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Предикат подгрузки для infinite scroll: можно ли запрашивать следующую порцию опций.
|
|
144
|
+
* Прокидывается в `SList`; при отсутствии `endReached` эмитится, пока есть, куда скроллить.
|
|
145
|
+
*/
|
|
146
|
+
canLoadMore?: () => boolean;
|
|
147
|
+
/** Расстояние в px до низа списка опций, на котором эмитится `endReached`. */
|
|
148
|
+
endReachedDistance?: number;
|
|
133
149
|
}
|
|
134
150
|
export type TSSelectExposed = {
|
|
135
151
|
open: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SSelect.types.d.ts","sourceRoot":"","sources":["../../../src/components/SSelect/SSelect.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,0EAA0E;AAC1E,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7D,iCAAiC;IAC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AAI,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,aAAa,EAAE,aAAa,CAAC,GAClF,eAAe,CAAA;AAEjB,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -15,6 +15,9 @@ declare const __VLS_export: <TItem extends Record<string, unknown>, TReturnObjec
|
|
|
15
15
|
onClear?: (() => any) | undefined;
|
|
16
16
|
"onUpdate:modelValue"?: ((value: TSSelectModelValue<TItem, TSSelectValueOfItem<TItem, undefined>, TReturnObject, TMultiple> | undefined) => any) | undefined;
|
|
17
17
|
onOpen?: (() => any) | undefined;
|
|
18
|
+
onEndReached?: ((payload: {
|
|
19
|
+
direction: "bottom";
|
|
20
|
+
}) => any) | undefined;
|
|
18
21
|
"onUpdate:searchQuery"?: ((value: string) => any) | undefined;
|
|
19
22
|
}> & (typeof globalThis extends {
|
|
20
23
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -22,7 +25,9 @@ declare const __VLS_export: <TItem extends Record<string, unknown>, TReturnObjec
|
|
|
22
25
|
expose: (exposed: import("vue").ShallowUnwrapRef<TSSelectExposed>) => void;
|
|
23
26
|
attrs: any;
|
|
24
27
|
slots: ISSelectSlots<TItem, TSSelectValueOfItem<TItem>>;
|
|
25
|
-
emit: (((evt: "close") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "clear") => void) & ((evt: "open") => void)
|
|
28
|
+
emit: (((evt: "close") => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "clear") => void) & ((evt: "open") => void) & ((evt: "endReached", payload: {
|
|
29
|
+
direction: "bottom";
|
|
30
|
+
}) => void)) & (((event: "update:modelValue", value: TSSelectModelValue<TItem, TSSelectValueOfItem<TItem>, TReturnObject, TMultiple> | undefined) => void) & ((event: "update:searchQuery", value: string) => void));
|
|
26
31
|
}>) => import("vue").VNode & {
|
|
27
32
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
28
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SSelect/SSelect.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SSelect/SSelect.vue"],"names":[],"mappings":"AAm1BA,OAAO,KAAK,EAEV,aAAa,EACb,aAAa,EACb,eAAe,EACf,kBAAkB,EAElB,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AAKxB,QAAA,MAAM,YAAY,GACd,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,aAAa,SAAS,OAAO,GAAG,KAAK,EACrC,SAAS,SAAS,OAAO,GAAG,KAAK,EAEpC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAyoCO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;qBAzmB3C,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC;QAC5F;;;;WAIG;sBACa,MAAM;;;;;;;;;;;;KAmmBqE,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,gBAAgB,iBAAsB,KAAK,IAAI;WACxE,GAAG;;UAEJ;;wNAAoC;EAEvC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SColorPicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SColorPicker-hCvgFpwK.cjs"),t=require("../SColorPalette-CqfVzhda.cjs"),n=require("../colorValue-Dda7fKd3.cjs");exports.EColorFormat=t.o,exports.MAX_RECENT_COLORS=e.i,exports.RECOMMENDED_COLOR_PALETTE=t.r,exports.SColorArea=e.r,exports.SColorPicker=e.t,exports.SColorValues=e.n,exports.isSameColor=n.r,exports.resolveColorPreview=n.a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "../SColorPicker-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../SColorPicker-C1wT4fRa.js";
|
|
2
2
|
import { o as i, r as a } from "../SColorPalette-D2WCADDX.js";
|
|
3
3
|
import { a as o, r as s } from "../colorValue-CSh0chxp.js";
|
|
4
4
|
export { i as EColorFormat, e as MAX_RECENT_COLORS, a as RECOMMENDED_COLOR_PALETTE, n as SColorArea, r as SColorPicker, t as SColorValues, s as isSameColor, o as resolveColorPreview };
|
package/dist/entries/select.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SSelect-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SSelect-CPm2SRpw.cjs");exports.ESSelectSearchable=e.n,exports.SSelect=e.t;
|
package/dist/entries/select.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../SSelect-
|
|
1
|
+
import { n as e, t } from "../SSelect-Bf1lDJ0M.js";
|
|
2
2
|
export { e as ESSelectSearchable, t as SSelect };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SBadge-d1GOPFP-.cjs"),t=require("./SAvatar-DTG0odWX.cjs"),n=require("./SColorPicker-CuuiFxI0.cjs"),r=require("./SColorPalette-CqfVzhda.cjs"),i=require("./colorValue-Dda7fKd3.cjs"),a=require("./SAvatarGroup-CTC_esUv.cjs"),o=require("./SButton.types-UKroD-ev.cjs"),s=require("./SButton-C-z_q5CG.cjs"),c=require("./useSelectionGroup-TaektE-I.cjs"),l=require("./useSelectLink-DDdMmsJB.cjs"),u=require("./SButtonGroup-BPy2YaEP.cjs"),d=require("./SCheckbox-D_YLWg6a.cjs"),f=require("./SCard-BzIQoACi.cjs"),p=require("./SSegmentControl-Dz-d3Y9v.cjs"),m=require("./STab-BbzowB-Y.cjs"),h=require("./STabs-DeHqnjNJ.cjs"),g=require("./useFloatingOverlay-B1UCUYQQ.cjs"),_=require("./STag-D1mmp1kd.cjs"),v=require("./STagGroup-CF2TFkb3.cjs"),y=require("./SChip-DRz5BA4Z.cjs"),b=require("./SDropdown-_QUOP-rw.cjs"),x=require("./SSelect-CMR4dxSn.cjs"),S=require("./SInput-DJL9QOIG.cjs"),C=require("./SInlineMessage-gjkMiE-W.cjs"),w=require("./SLabel-CTiOAAOu.cjs"),T=require("./SList-qQ7B5u8o.cjs"),E=require("./SListItem-DBGDVeoJ.cjs"),D=require("./SRadio-CcmuHaKk.cjs"),O=require("./SToggle-B5EdI-rG.cjs"),k=require("./SInlineInput-6LglCWSn.cjs"),ee=require("./STextarea-BJWrc9t1.cjs"),A=require("./SPhotoEdit-vg58q6I7.cjs"),j=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),te=require("./SChartLine-BF6Klm4j.cjs"),ne=require("./resolveSeriesPaletteColor-hI4YDdUg.cjs"),re=require("./SChartStackedArea-BLHs3sSH.cjs"),ie=require("./SChartStackedBar-CWNyvUj9.cjs"),ae=require("./SChartHorizontalBar-4H-lgfO4.cjs"),oe=require("./SChartPie-namQTFla.cjs"),se=require("./SChartMultiLine-Ddvfmf__.cjs"),ce=require("./SChartBurnup-C4x5kik6.cjs"),le=require("./SChartProgress-DsFHotRv.cjs"),M=require("./SChartLegend-DGtjd6zV.cjs"),ue=require("./useHasListener-BPgtbbo6.cjs"),N=require("./buildWorkTimeLegendItems-DjhLKbAP.cjs");let P=require("vue"),F=require("@shtabapp/ui-kit-primitives"),de=require("@vueuse/core");var I=[`--s-ui-chart-segmented-bar-palette-1`,`--s-ui-chart-segmented-bar-palette-2`,`--s-ui-chart-segmented-bar-palette-3`,`--s-ui-chart-segmented-bar-palette-4`,`--s-ui-chart-segmented-bar-palette-5`,`--s-ui-chart-segmented-bar-palette-6`,`--s-ui-chart-segmented-bar-palette-7`,`--s-ui-chart-segmented-bar-palette-8`],L=[`--s-ui-chart-segmented-bar-skeleton-palette-1`,`--s-ui-chart-segmented-bar-skeleton-palette-2`,`--s-ui-chart-segmented-bar-skeleton-palette-3`,`--s-ui-chart-segmented-bar-skeleton-palette-4`,`--s-ui-chart-segmented-bar-skeleton-palette-5`,`--s-ui-chart-segmented-bar-skeleton-palette-6`,`--s-ui-chart-segmented-bar-skeleton-palette-7`,`--s-ui-chart-segmented-bar-skeleton-palette-8`],fe=(e,t,n,r=!1)=>ne.t(e,t,n,r,{palette:I,paletteFallback:I[0],skeletonPalette:L,skeletonFallback:L[0]}),R=function(e){return e.INFO_ACCENT=`info-accent`,e.INFO_NORMAL=`info-normal`,e.SUCCESS=`success`,e.WARNING=`warning`,e.DANGER=`danger`,e.BILLING=`billing`,e}({}),z=function(e){return e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e}({}),B=function(e){return e.ICON=`icon`,e.AVATAR=`avatar`,e}({}),V=function(e){return e.BANNER=`banner`,e.TOAST=`toast`,e}({}),pe={[R.INFO_ACCENT]:F.ESIconName.infoCircle,[R.INFO_NORMAL]:F.ESIconName.infoCircle,[R.SUCCESS]:F.ESIconName.checkCircle,[R.WARNING]:F.ESIconName.alertCircle,[R.DANGER]:F.ESIconName.dangerCircleFill,[R.BILLING]:F.ESIconName.infoCircle},me=(e,t)=>t||pe[e],he=[`role`],ge={class:`s-ui-notification__body`},_e={key:0,class:`s-ui-notification__leftside`},ve={key:0,class:`s-ui-notification__icon`},ye={class:`s-ui-notification__content`},be={class:`s-ui-notification__title-row`},xe={class:`s-ui-notification__title s-ui-typography-label-14-medium`},Se={key:0,class:`s-ui-notification__description-block`},Ce={key:0,class:`s-ui-notification__description s-ui-typography-label-12-medium`},we={key:1,class:`s-ui-notification__actions-stack`},Te={key:1,class:`s-ui-notification__actions-row`},H=(0,P.defineComponent)({__name:`SNotification`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},surface:{default:()=>V.BANNER},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},width:{},maxWidth:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:n}){let r=n,i=(0,P.useSlots)(),a=(0,P.computed)(()=>[`s-ui-notification--type-${e.type}`,`s-ui-notification--layout-${e.layout}`,`s-ui-notification--surface-${e.surface}`]),c=(0,P.computed)(()=>{let t={};return e.width&&(t.width=typeof e.width==`number`?`${e.width}px`:e.width),e.maxWidth&&(t.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t}),l=(0,P.computed)(()=>e.type===R.DANGER?`alert`:`status`),u=(0,P.computed)(()=>me(e.type,e.icon)),d=(0,P.computed)(()=>e.type===R.BILLING),f=(0,P.computed)(()=>!!(e.leftside===B.AVATAR&&e.avatar||e.leftside===B.ICON)),p=(0,P.computed)(()=>!!(e.description||e.linkText||i.description)),m=(0,P.computed)(()=>e.showPrimaryButton&&(e.primaryButtonText||e.secondaryButtonText)),h=(0,P.computed)(()=>e.showPrimaryButton&&e.primaryButtonText||e.closable),g=(0,P.computed)(()=>e.type===R.BILLING?o.t.MAJOR:o.t.OUTLINED),_=(0,P.computed)(()=>e.type===R.BILLING?o.r.BILLING:o.r.MAIN),v=()=>{r(`close`)},y=()=>{r(`linkClick`)},b=()=>{r(`primaryAction`)},x=()=>{r(`secondaryAction`)};return(n,r)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:(0,P.normalizeClass)([`s-ui-notification`,a.value]),style:(0,P.normalizeStyle)(c.value),role:l.value},[(0,P.createElementVNode)(`div`,ge,[f.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,_e,[e.leftside===(0,P.unref)(B).ICON?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,ve,[(0,P.createVNode)((0,P.unref)(F.SIcon),{name:u.value,size:16,billing:d.value},null,8,[`name`,`billing`])])):e.leftside===(0,P.unref)(B).AVATAR&&e.avatar?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(t.t),{key:1,name:e.avatar.name,src:e.avatar.src,badge:e.avatar.badge,size:(0,P.unref)(t.o).SIZE_20,showName:!1},null,8,[`name`,`src`,`badge`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0),(0,P.createElementVNode)(`div`,ye,[(0,P.createElementVNode)(`div`,be,[(0,P.createElementVNode)(`span`,xe,[(0,P.renderSlot)(n.$slots,`title`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.title),1)])]),e.layout===(0,P.unref)(z).VERTICAL&&e.closable?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,class:`s-ui-notification__close`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,"aria-label":e.closeAriaLabel,icon:`closeMini`,onClick:v},null,8,[`appearance`,`variant`,`size`,`aria-label`])):(0,P.createCommentVNode)(``,!0)]),p.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,Se,[e.description||(0,P.unref)(i).description?((0,P.openBlock)(),(0,P.createElementBlock)(`span`,Ce,[(0,P.renderSlot)(n.$slots,`description`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.description),1)])])):(0,P.createCommentVNode)(``,!0),e.linkText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,class:`s-ui-notification__link`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).MAIN,size:(0,P.unref)(o.n).SMALL,onClick:y},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.linkText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0),e.layout===(0,P.unref)(z).VERTICAL&&m.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,we,[e.showPrimaryButton&&e.primaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:g.value,variant:_.value,size:(0,P.unref)(o.n).SMALL,onClick:b},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.primaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0),e.showPrimaryButton&&e.secondaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,onClick:x},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.secondaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0)]),e.layout===(0,P.unref)(z).HORIZONTAL&&h.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,Te,[e.showPrimaryButton&&e.primaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:g.value,variant:_.value,size:(0,P.unref)(o.n).SMALL,onClick:b},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.primaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0),e.layout===(0,P.unref)(z).HORIZONTAL&&e.closable?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,class:`s-ui-notification__close`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,"aria-label":e.closeAriaLabel,icon:`closeMini`,onClick:v},null,8,[`appearance`,`variant`,`size`,`aria-label`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0)])],14,he))}}),Ee=(0,P.defineComponent)({__name:`SBanner`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},maxWidth:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:t}){let n=t,r=(0,P.useSlots)();return(t,i)=>((0,P.openBlock)(),(0,P.createBlock)(H,{class:`s-ui-banner`,"data-qa":`ui:banner`,type:e.type,layout:e.layout,leftside:e.leftside,surface:(0,P.unref)(V).BANNER,title:e.title,description:e.description,linkText:e.linkText,primaryButtonText:e.primaryButtonText,secondaryButtonText:e.secondaryButtonText,showPrimaryButton:e.showPrimaryButton,closable:e.closable,closeAriaLabel:e.closeAriaLabel,icon:e.icon,avatar:e.avatar,maxWidth:e.maxWidth,onClose:i[0]||=e=>n(`close`),onLinkClick:i[1]||=e=>n(`linkClick`),onPrimaryAction:i[2]||=e=>n(`primaryAction`),onSecondaryAction:i[3]||=e=>n(`secondaryAction`)},(0,P.createSlots)({_:2},[(0,P.unref)(r).title?{name:`title`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,(0,P.unref)(r).description?{name:`description`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`description`)]),key:`1`}:void 0]),1032,[`type`,`layout`,`leftside`,`surface`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`maxWidth`]))}}),U=(0,P.defineComponent)({__name:`SToast`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},width:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:t}){let n=t,r=(0,P.useSlots)(),i=(0,P.computed)(()=>e.width??360);return(t,a)=>((0,P.openBlock)(),(0,P.createBlock)(H,{class:`s-ui-toast`,"data-qa":`ui:toast`,type:e.type,layout:e.layout,leftside:e.leftside,surface:(0,P.unref)(V).TOAST,title:e.title,description:e.description,linkText:e.linkText,primaryButtonText:e.primaryButtonText,secondaryButtonText:e.secondaryButtonText,showPrimaryButton:e.showPrimaryButton,closable:e.closable,closeAriaLabel:e.closeAriaLabel,icon:e.icon,avatar:e.avatar,width:i.value,onClose:a[0]||=e=>n(`close`),onLinkClick:a[1]||=e=>n(`linkClick`),onPrimaryAction:a[2]||=e=>n(`primaryAction`),onSecondaryAction:a[3]||=e=>n(`secondaryAction`)},(0,P.createSlots)({_:2},[(0,P.unref)(r).title?{name:`title`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,(0,P.unref)(r).description?{name:`description`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`description`)]),key:`1`}:void 0]),1032,[`type`,`layout`,`leftside`,`surface`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`width`]))}}),De=.05,Oe=[`data-mounted`,`data-front`,`data-expanded`,`data-removed`,`data-visible`],ke=(0,P.defineComponent)({__name:`SToastProviderToast`,props:{index:{},expanded:{type:Boolean},frontToastHeight:{},stackPeek:{},removed:{type:Boolean},visible:{type:Boolean},offsetY:{}},emits:[`heightChange`],setup(e,{emit:t}){let n=t,r=(0,P.ref)(null),i=(0,P.ref)(0),a=(0,P.ref)(!1),o=(0,P.computed)(()=>e.index===0),s=(0,P.computed)(()=>1-e.index*De),c=(0,P.computed)(()=>({"--s-ui-toast-provider-toasts-before":String(e.index),"--s-ui-toast-provider-lift-amount":`${e.stackPeek*-1}px`,"--s-ui-toast-provider-front-toast-height":`${e.frontToastHeight}px`,"--s-ui-toast-provider-offset-y":`${e.offsetY}px`,"--s-ui-toast-provider-initial-height":`${i.value}px`,"--s-ui-toast-provider-stack-scale":String(s.value),zIndex:String(1e3-e.index)}));return(0,de.useResizeObserver)(r,e=>{let t=e[0]?.contentRect.height??0;t!==i.value&&(i.value=t,n(`heightChange`,t))}),(0,P.onMounted)(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{a.value=!0})})}),(t,n)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:`s-ui-toast-provider__toast`,"data-mounted":a.value,"data-front":o.value,"data-expanded":e.expanded,"data-removed":e.removed,"data-visible":e.visible,style:(0,P.normalizeStyle)(c.value)},[(0,P.createElementVNode)(`div`,{ref_key:`contentRef`,ref:r,class:`s-ui-toast-provider__toast-content`},[(0,P.renderSlot)(t.$slots,`default`)],512)],12,Oe))}}),W=4e3,G=1e4,Ae=50,K=(e,t)=>{let n=W+(e.length+(t?.length??0))*50;return n>1e4?G:n},q=(0,P.shallowRef)([]),J=new Map,je=0,Me={type:R.INFO_ACCENT,layout:z.HORIZONTAL,leftside:B.ICON,showPrimaryButton:!1,closable:!0},Ne=()=>`toast-${Date.now()}-${++je}`,Y=e=>{let t=J.get(e);t&&(window.clearTimeout(t),J.delete(e))},X=e=>{Y(e.id);let t=e.duration===void 0?K(e.title,e.description):e.duration;if(t>0){let n=window.setTimeout(()=>{Z(e.id)},t);J.set(e.id,n)}},Z=e=>{let t=q.value.findIndex(t=>t.id===e);if(t===-1)return;let n=q.value[t];n&&(Y(e),n.onClose&&n.onClose(),q.value=q.value.filter(t=>t.id!==e))},Pe=()=>{J.forEach(e=>window.clearTimeout(e)),J.clear(),q.value=[]},Q=e=>e.length<=3?e:(e.slice(3).forEach(e=>{Y(e.id)}),e.slice(0,3)),Fe=e=>{let t=e.id??Ne(),n={...Me,...e,id:t},r=q.value.findIndex(e=>e.id===t);if(r>-1){let e=[...q.value];e[r]=n,q.value=Q(e)}else q.value=Q([n,...q.value]);return X(n),t},Ie=(e,t)=>{let n=q.value.findIndex(t=>t.id===e);if(n===-1)return;let r=q.value[n];if(!r)return;let i={...r,...t,id:r.id},a=[...q.value];a[n]=i,q.value=a,X(i)},$=()=>({toasts:q,show:Fe,hide:Z,hideAll:Pe,update:Ie}),Le=(0,P.defineComponent)({__name:`SToastProvider`,setup(e){let{toasts:t,hide:n}=$(),r=(0,P.computed)(()=>t.value.slice(0,3)),i=(0,P.ref)(!1),a=(0,P.shallowRef)({}),o=(0,P.ref)(new Set),s=(0,P.computed)(()=>t.value[0]??null),c=(0,P.computed)(()=>s.value?a.value[s.value.id]??0:0),l=(0,P.ref)(0),u=(0,P.computed)(()=>c.value>0?c.value:l.value);(0,P.watch)(c,e=>{e>0&&(l.value=e)});let d=(0,P.computed)(()=>{if(r.value.length===0)return{};if(i.value)return{height:`${r.value.reduce((e,t,n)=>{let r=a.value[t.id]??0,i=n>0?4:0;return e+r+i},0)}px`};let e=Math.min(r.value.length-1,2)*10;return{height:`${u.value+e}px`}}),f=e=>{let t=0;for(let n=0;n<e;n+=1){let e=r.value[n];e&&(t+=(a.value[e.id]??0)+4)}return t},p=e=>o.value.has(e),m=()=>{r.value.length>1&&(i.value=!0)},h=()=>{i.value=!1},g=(e,t)=>{a.value={...a.value,[e]:t}},_=e=>{o.value.has(e)||(o.value=new Set([...o.value,e]),window.setTimeout(()=>{n(e);let t=new Set(o.value);t.delete(e),o.value=t;let r={...a.value};delete r[e],a.value=r},200))},v=e=>{e.onLinkClick&&e.onLinkClick()},y=e=>{e.onPrimaryAction&&e.onPrimaryAction(e.id)},b=e=>{e.onSecondaryAction&&e.onSecondaryAction()};return(e,t)=>((0,P.openBlock)(),(0,P.createBlock)(P.Teleport,{to:`body`},[(0,P.createElementVNode)(`div`,{class:`s-ui-toast-provider`,onMouseenter:m,onMouseleave:h},[r.value.length>0?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{key:0,class:`s-ui-toast-provider__list`,style:(0,P.normalizeStyle)(d.value)},[((0,P.openBlock)(!0),(0,P.createElementBlock)(P.Fragment,null,(0,P.renderList)(r.value,(t,n)=>((0,P.openBlock)(),(0,P.createBlock)(ke,{key:t.id,index:n,expanded:i.value,"front-toast-height":u.value,"stack-peek":(0,P.unref)(10),removed:p(t.id),visible:n<(0,P.unref)(3),"offset-y":f(n),onHeightChange:e=>g(t.id,e)},{default:(0,P.withCtx)(()=>[(0,P.renderSlot)(e.$slots,`toast`,{toast:t},()=>[t.component?((0,P.openBlock)(),(0,P.createBlock)((0,P.resolveDynamicComponent)(t.component),(0,P.mergeProps)({key:0,ref_for:!0},t.componentProps,{toast:t,onClose:e=>_(t.id)}),null,16,[`toast`,`onClose`])):((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(U),{key:1,type:t.type,layout:t.layout,leftside:t.leftside,title:t.title,description:t.description,linkText:t.linkText,primaryButtonText:t.primaryButtonText,secondaryButtonText:t.secondaryButtonText,showPrimaryButton:t.showPrimaryButton,closable:t.closable,closeAriaLabel:t.closeAriaLabel,icon:t.icon,avatar:t.avatar,width:t.width,onClose:e=>_(t.id),onLinkClick:e=>v(t),onPrimaryAction:e=>y(t),onSecondaryAction:e=>b(t)},null,8,[`type`,`layout`,`leftside`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`width`,`onClose`,`onLinkClick`,`onPrimaryAction`,`onSecondaryAction`]))])]),_:2},1032,[`index`,`expanded`,`front-toast-height`,`stack-peek`,`removed`,`visible`,`offset-y`,`onHeightChange`]))),128))],4)):(0,P.createCommentVNode)(``,!0)],32)]))}}),Re=4,ze=4,Be=1,Ve=`400 12px var(--s-ui-font-family-label)`,He=4,Ue=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.arcTo(t+r,n,t+r,n+o,o),e.lineTo(t+r,n+i-o),e.arcTo(t+r,n+i,t+r-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.closePath()},We=e=>{let t=e.getProps([`x`,`y`,`base`],!0),n=Number(t.x),r=Number(t.y),i=Number(t.base);return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{left:Math.min(i,n),width:Math.abs(n-i),centerY:r}},Ge=(e,t,n,r)=>{let i=We(t);if(!i)return;let a=`${n}`,o=e.measureText(a).width+Re*2;if(i.width<o+He*2)return;let s=i.left+i.width/2;Ue(e,s-o/2,i.centerY-20/2,o,20,ze),e.fillStyle=r.background,e.fill(),e.lineWidth=Be,e.strokeStyle=r.border,e.stroke(),e.fillStyle=r.text,e.fillText(a,s,i.centerY)},Ke=e=>({id:`segmentedBarBadge`,afterDatasetsDraw(t){let n={background:j.w(j.v.pieBadgeBackground,e),border:j.w(j.v.pieBadgeBorder,e),text:j.w(j.v.pieBadgeText,e)},{ctx:r}=t;r.save(),r.font=Ve,r.textAlign=`center`,r.textBaseline=`middle`,t.data.datasets.forEach((e,i)=>{let a=t.getDatasetMeta(i)?.data[0],o=e.data[0];a&&typeof o==`number`&&o>0&&Ge(r,a,o,n)}),r.restore()}}),qe=40,Je=4,Ye=1,Xe=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],Ze=({segments:e,segmentColors:t,colorHostElement:n,skeleton:r=!1,onSegmentClick:i})=>{if(e.length===0)return null;let a=j.w(`--s-ui-color-surface-primary`,n),o=e.reduce((e,t)=>e+t.value,0),s=j.a({kind:`series`,skeleton:r,colorHostElement:n,onIndexClick:i});return{type:`bar`,data:{labels:[``],datasets:e.map((e,n)=>({label:e.label,data:[e.value],backgroundColor:t[n],hoverBackgroundColor:t[n],borderColor:a,borderWidth:{left:Ye,right:Ye},borderSkipped:!1,borderRadius:Je,barThickness:qe,stack:`track`}))},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,layout:{padding:0},events:r?[]:Xe,onHover:s.onHover,onClick:s.onClick,hover:r?void 0:{mode:`nearest`,intersect:!0},elements:r?void 0:{bar:{hoverBorderColor:a}},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,stacked:!0,min:0,max:o},y:{display:!1,stacked:!0}}},plugins:[...r?[]:[Ke(n)],...s.plugins]}},Qe=[4,1,2,1,3,1,2,1].map((e,t)=>({label:`Series ${t+1}`,value:e})),$e={class:`s-ui-chart-segmented-bar__canvas-wrap`},et=(0,P.defineComponent)({__name:`SChartSegmentedBar`,props:{segments:{default:()=>[]},showLegend:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},emits:[`segmentClick`],setup(e,{expose:t,emit:n}){let r=n,i=j.n,a=(0,P.useTemplateRef)(`chartRootRef`),o=(0,P.useTemplateRef)(`chartCanvasRef`),s=(0,P.computed)(()=>e.loading?Qe:e.segments),c=(0,P.computed)(()=>s.value.map((t,n)=>fe(n,a.value,t.fillColor,e.loading))),l=(0,P.computed)(()=>s.value.map((e,t)=>({segment:e,segmentIndex:t})).filter(({segment:e})=>e.value>0)),u=(0,P.computed)(()=>l.value.map(({segment:e})=>e)),d=(0,P.computed)(()=>l.value.map(({segmentIndex:e})=>c.value[e]??``)),f=(0,P.computed)(()=>{let e=new Map;return l.value.forEach(({segmentIndex:t},n)=>{e.set(t,n)}),e}),p=e=>{let t=l.value[e];t&&r(`segmentClick`,t.segmentIndex,t.segment)},m=ue.t(`onSegmentClick`),h=(0,P.computed)(()=>Ze({segments:u.value,segmentColors:d.value,colorHostElement:a.value,skeleton:e.loading,onSegmentClick:m()?p:void 0})),g=(0,P.computed)(()=>s.value.map((e,t)=>({label:e.label,color:c.value[t]??``}))),{chartInstance:_}=j.i({canvasRef:o,config:h,enabled:(0,P.computed)(()=>e.loading||u.value.length>0)}),{exportImage:v,handleLegendItemHover:y}=j.r({chartInstance:_,canvasRef:o,colorHostElement:a}),b=e=>{y(e===null?null:f.value.get(e)??null)};return t({exportImage:v}),(t,n)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:a,class:(0,P.normalizeClass)([`s-ui-chart-segmented-bar`,{"s-ui-chart-segmented-bar--skeleton":e.loading}]),"data-qa":`ui:chart-segmented-bar`},[(0,P.createElementVNode)(`div`,$e,[(0,P.createVNode)((0,P.unref)(j.t),{loading:e.loading,type:(0,P.unref)(i).CARTESIAN},{default:(0,P.withCtx)(()=>[(0,P.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-segmented-bar__canvas`},null,512)]),_:1},8,[`loading`,`type`])]),e.showLegend&&g.value.length?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(M.t),{key:0,items:g.value,disabled:e.loading,interactive:!e.loading,onItemHover:b},null,8,[`items`,`disabled`,`interactive`])):(0,P.createCommentVNode)(``,!0)],2))}}),tt={key:0,class:`s-ui-chart-widget__header`},nt={key:0,class:`s-ui-chart-widget__title-skeleton`,"aria-hidden":`true`},rt={key:1,class:`s-ui-chart-widget__title s-ui-typography-label-16-medium`},it={class:`s-ui-chart-widget__controls`},at={key:1,class:`s-ui-chart-widget__content`},ot=(0,P.defineComponent)({__name:`SChartWidget`,props:(0,P.mergeModels)({title:{default:``},collapsible:{type:Boolean,default:!1},hideContentWhenCollapsed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=(0,P.useModel)(e,`collapsed`),n=(0,P.useSlots)(),{t:r}=(0,F.useUiKitI18n)(),i=(0,P.computed)(()=>!!e.title||!!n.title||!!n.actions||e.collapsible),a=(0,P.computed)(()=>!t.value||!e.collapsible||!e.hideContentWhenCollapsed),c=(0,P.computed)(()=>r(t.value?`chartWidget.expand`:`chartWidget.collapse`));return(n,r)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:(0,P.normalizeClass)([`s-ui-chart-widget`,{"s-ui-chart-widget--skeleton":e.loading}]),"data-qa":`ui:chart-widget`},[i.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,tt,[e.loading?((0,P.openBlock)(),(0,P.createElementBlock)(`span`,nt)):((0,P.openBlock)(),(0,P.createElementBlock)(`span`,rt,[(0,P.renderSlot)(n.$slots,`title`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.title),1)])])),(0,P.createElementVNode)(`div`,it,[(0,P.renderSlot)(n.$slots,`actions`),e.collapsible?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:(0,P.unref)(o.t).OUTLINED,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,icon:t.value?(0,P.unref)(F.ESIconName).chevronDown:(0,P.unref)(F.ESIconName).chevronUp,"aria-label":c.value,"aria-expanded":!t.value,onClick:r[0]||=e=>t.value=!t.value},null,8,[`appearance`,`variant`,`size`,`icon`,`aria-label`,`aria-expanded`])):(0,P.createCommentVNode)(``,!0)])])):(0,P.createCommentVNode)(``,!0),a.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,at,[(0,P.renderSlot)(n.$slots,`default`)])):(0,P.createCommentVNode)(``,!0)],2))}});exports.CALENDAR_WEEK_SLOT_COUNT=N.a,exports.DAY_TIMELINE_MINUTES=N.r,exports.DEFAULT_COLOR_PALETTE=r.i,exports.EAccentColor=r.a,exports.EButtonAppearance=o.t,exports.EButtonGroupLayout=u.n,exports.EButtonSize=o.n,exports.ESSegmentControlSize=o.n,exports.EButtonVariant=o.r,exports.EColorFormat=r.o,exports.EConnectedPositionStrategy=g.r,exports.ENotificationLayout=z,exports.ENotificationLeftside=B,exports.ENotificationType=R,exports.ESAvatarBadge=t.n,exports.ESAvatarColor=t.r,exports.ESAvatarGroupSize=a.n,exports.ESAvatarIconBackground=t.i,exports.ESAvatarShape=t.a,exports.ESAvatarSize=t.o,exports.ESBadgeColor=e.n,exports.ESBadgePlacement=e.r,exports.ESCardLayout=f.n,exports.ESCheckboxColor=d.n,exports.ESCheckboxSize=d.r,exports.ESChipColor=y.n,exports.ESChipSize=y.r,exports.ESColorPaletteLayout=r.n,exports.ESDropdownPlacement=g.i,exports.ESInlineInputAppearance=k.n,exports.ESInlineMessageValidationStatus=C.n,exports.ESInputCustomize=S.n,exports.ESLabelSize=w.n,exports.ESLabelVariant=w.r,exports.ESListGap=T.a,exports.ESListItemVariant=E.n,exports.ESPhotoEditShape=A.n,exports.ESPhotoEditSize=A.r,exports.ESRadioLabelPlacement=D.n,exports.ESSelectSearchable=x.n,exports.ESTabAppearance=m.n,exports.ESTabSize=m.r,exports.ESTagColor=_.n,exports.ESTagSize=_.r,exports.ESToggleSize=O.n,exports.ESelectionFocusMode=c.t,exports.ESelectionMode=c.n,exports.ESelectionOrientation=c.r,exports.EWorkTimeSource=N.c,exports.MAX_RECENT_COLORS=n.i,exports.RECOMMENDED_COLOR_PALETTE=r.r,exports.SAvatar=t.t,exports.SAvatarGroup=a.t,exports.SBadge=e.t,exports.SBanner=Ee,exports.SButton=s.t,exports.SButtonGroup=u.t,exports.SCalendarMonth=N.l,exports.SCalendarWeekGrid=N.i,exports.SCard=f.t,exports.SChartBurnup=ce.t,exports.SChartHorizontalBar=ae.t,exports.SChartLegend=M.t,exports.SChartLine=te.t,exports.SChartMultiLine=se.t,exports.SChartPie=oe.t,exports.SChartProgress=le.t,exports.SChartSegmentedBar=et,exports.SChartStackedArea=re.t,exports.SChartStackedBar=ie.t,exports.SChartWidget=ot,exports.SCheckbox=d.t,exports.SChip=y.t,exports.SColorArea=n.r,exports.SColorPalette=r.t,exports.SColorPicker=n.t,exports.SColorValues=n.n,exports.SDayTimeline=N.n,exports.SDropdown=b.t,exports.SDropdownMenu=x.r,exports.SInlineInput=k.t,exports.SInlineMessage=C.t,exports.SInput=S.t,exports.SLabel=w.t,exports.SList=T.t,exports.SListItem=E.t,exports.SPhotoEdit=A.t,exports.SRadio=D.t,exports.SSegmentControl=p.t,exports.SSelect=x.t,exports.STab=m.t,exports.STabs=h.t,exports.STag=_.t,exports.STagGroup=v.t,exports.STextarea=ee.t,exports.SToast=U,exports.SToastProvider=Le,exports.SToggle=O.t,exports.TOAST_AUTO_DURATION_MAX_MS=G,exports.TOAST_AUTO_DURATION_MIN_MS=W,exports.TOAST_AUTO_DURATION_MS_PER_CHAR=Ae,exports.WORK_TIME_SOURCE_COLOR_VARS=N.o,exports.WORK_TIME_SOURCE_ORDER=N.s,exports.buildWorkTimeLegendItems=N.t,exports.computeAutoDuration=K,exports.computeConnectedPosition=g.n,Object.defineProperty(exports,"createUiKit",{enumerable:!0,get:function(){return F.createUiKit}}),exports.formatDurationHM=N.u,exports.isSameColor=i.r,exports.normalizeColorValue=i.i,exports.resolveColorPreview=i.a,exports.resolveOwnPropOrGroupedOrFallback=c.a,Object.defineProperty(exports,"setUiKitLocale",{enumerable:!0,get:function(){return F.setUiKitLocale}}),Object.defineProperty(exports,"uiKitLocaleEn",{enumerable:!0,get:function(){return F.uiKitLocaleEn}}),Object.defineProperty(exports,"uiKitLocaleRu",{enumerable:!0,get:function(){return F.uiKitLocaleRu}}),exports.useFlatTreeList=T.s,exports.useFloatingOverlay=g.t,exports.useSListEndReached=T.o,exports.useSelectionGroup=c.o,exports.useSelectionGroupItem=l.n,exports.useToast=$,Object.defineProperty(exports,"useUiKitI18n",{enumerable:!0,get:function(){return F.useUiKitI18n}});var st=require("@shtabapp/ui-kit-tokens");Object.keys(st).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return st[e]}})}),Object.keys(F).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return F[e]}})});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SBadge-d1GOPFP-.cjs"),t=require("./SAvatar-DTG0odWX.cjs"),n=require("./SColorPicker-hCvgFpwK.cjs"),r=require("./SColorPalette-CqfVzhda.cjs"),i=require("./colorValue-Dda7fKd3.cjs"),a=require("./SAvatarGroup-CTC_esUv.cjs"),o=require("./SButton.types-UKroD-ev.cjs"),s=require("./SButton-C-z_q5CG.cjs"),c=require("./useSelectionGroup-TaektE-I.cjs"),l=require("./useSelectLink-DDdMmsJB.cjs"),u=require("./SButtonGroup-BPy2YaEP.cjs"),d=require("./SCheckbox-D_YLWg6a.cjs"),f=require("./SCard-BzIQoACi.cjs"),p=require("./SSegmentControl-Dz-d3Y9v.cjs"),m=require("./STab-BbzowB-Y.cjs"),h=require("./STabs-DeHqnjNJ.cjs"),g=require("./useFloatingOverlay-B1UCUYQQ.cjs"),_=require("./STag-D1mmp1kd.cjs"),v=require("./STagGroup-CF2TFkb3.cjs"),y=require("./SChip-DRz5BA4Z.cjs"),b=require("./SDropdown-_QUOP-rw.cjs"),x=require("./SSelect-CPm2SRpw.cjs"),S=require("./SInput-DJL9QOIG.cjs"),C=require("./SInlineMessage-gjkMiE-W.cjs"),w=require("./SLabel-CTiOAAOu.cjs"),T=require("./SList-qQ7B5u8o.cjs"),E=require("./SListItem-DBGDVeoJ.cjs"),D=require("./SRadio-CcmuHaKk.cjs"),O=require("./SToggle-B5EdI-rG.cjs"),k=require("./SInlineInput-6LglCWSn.cjs"),ee=require("./STextarea-BJWrc9t1.cjs"),A=require("./SPhotoEdit-vg58q6I7.cjs"),j=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),te=require("./SChartLine-BF6Klm4j.cjs"),ne=require("./resolveSeriesPaletteColor-hI4YDdUg.cjs"),re=require("./SChartStackedArea-BLHs3sSH.cjs"),ie=require("./SChartStackedBar-CWNyvUj9.cjs"),ae=require("./SChartHorizontalBar-4H-lgfO4.cjs"),oe=require("./SChartPie-namQTFla.cjs"),se=require("./SChartMultiLine-Ddvfmf__.cjs"),ce=require("./SChartBurnup-C4x5kik6.cjs"),le=require("./SChartProgress-DsFHotRv.cjs"),M=require("./SChartLegend-DGtjd6zV.cjs"),ue=require("./useHasListener-BPgtbbo6.cjs"),N=require("./buildWorkTimeLegendItems-DjhLKbAP.cjs");let P=require("vue"),F=require("@shtabapp/ui-kit-primitives"),de=require("@vueuse/core");var I=[`--s-ui-chart-segmented-bar-palette-1`,`--s-ui-chart-segmented-bar-palette-2`,`--s-ui-chart-segmented-bar-palette-3`,`--s-ui-chart-segmented-bar-palette-4`,`--s-ui-chart-segmented-bar-palette-5`,`--s-ui-chart-segmented-bar-palette-6`,`--s-ui-chart-segmented-bar-palette-7`,`--s-ui-chart-segmented-bar-palette-8`],L=[`--s-ui-chart-segmented-bar-skeleton-palette-1`,`--s-ui-chart-segmented-bar-skeleton-palette-2`,`--s-ui-chart-segmented-bar-skeleton-palette-3`,`--s-ui-chart-segmented-bar-skeleton-palette-4`,`--s-ui-chart-segmented-bar-skeleton-palette-5`,`--s-ui-chart-segmented-bar-skeleton-palette-6`,`--s-ui-chart-segmented-bar-skeleton-palette-7`,`--s-ui-chart-segmented-bar-skeleton-palette-8`],fe=(e,t,n,r=!1)=>ne.t(e,t,n,r,{palette:I,paletteFallback:I[0],skeletonPalette:L,skeletonFallback:L[0]}),R=function(e){return e.INFO_ACCENT=`info-accent`,e.INFO_NORMAL=`info-normal`,e.SUCCESS=`success`,e.WARNING=`warning`,e.DANGER=`danger`,e.BILLING=`billing`,e}({}),z=function(e){return e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e}({}),B=function(e){return e.ICON=`icon`,e.AVATAR=`avatar`,e}({}),V=function(e){return e.BANNER=`banner`,e.TOAST=`toast`,e}({}),pe={[R.INFO_ACCENT]:F.ESIconName.infoCircle,[R.INFO_NORMAL]:F.ESIconName.infoCircle,[R.SUCCESS]:F.ESIconName.checkCircle,[R.WARNING]:F.ESIconName.alertCircle,[R.DANGER]:F.ESIconName.dangerCircleFill,[R.BILLING]:F.ESIconName.infoCircle},me=(e,t)=>t||pe[e],he=[`role`],ge={class:`s-ui-notification__body`},_e={key:0,class:`s-ui-notification__leftside`},ve={key:0,class:`s-ui-notification__icon`},ye={class:`s-ui-notification__content`},be={class:`s-ui-notification__title-row`},xe={class:`s-ui-notification__title s-ui-typography-label-14-medium`},Se={key:0,class:`s-ui-notification__description-block`},Ce={key:0,class:`s-ui-notification__description s-ui-typography-label-12-medium`},we={key:1,class:`s-ui-notification__actions-stack`},Te={key:1,class:`s-ui-notification__actions-row`},H=(0,P.defineComponent)({__name:`SNotification`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},surface:{default:()=>V.BANNER},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},width:{},maxWidth:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:n}){let r=n,i=(0,P.useSlots)(),a=(0,P.computed)(()=>[`s-ui-notification--type-${e.type}`,`s-ui-notification--layout-${e.layout}`,`s-ui-notification--surface-${e.surface}`]),c=(0,P.computed)(()=>{let t={};return e.width&&(t.width=typeof e.width==`number`?`${e.width}px`:e.width),e.maxWidth&&(t.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t}),l=(0,P.computed)(()=>e.type===R.DANGER?`alert`:`status`),u=(0,P.computed)(()=>me(e.type,e.icon)),d=(0,P.computed)(()=>e.type===R.BILLING),f=(0,P.computed)(()=>!!(e.leftside===B.AVATAR&&e.avatar||e.leftside===B.ICON)),p=(0,P.computed)(()=>!!(e.description||e.linkText||i.description)),m=(0,P.computed)(()=>e.showPrimaryButton&&(e.primaryButtonText||e.secondaryButtonText)),h=(0,P.computed)(()=>e.showPrimaryButton&&e.primaryButtonText||e.closable),g=(0,P.computed)(()=>e.type===R.BILLING?o.t.MAJOR:o.t.OUTLINED),_=(0,P.computed)(()=>e.type===R.BILLING?o.r.BILLING:o.r.MAIN),v=()=>{r(`close`)},y=()=>{r(`linkClick`)},b=()=>{r(`primaryAction`)},x=()=>{r(`secondaryAction`)};return(n,r)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:(0,P.normalizeClass)([`s-ui-notification`,a.value]),style:(0,P.normalizeStyle)(c.value),role:l.value},[(0,P.createElementVNode)(`div`,ge,[f.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,_e,[e.leftside===(0,P.unref)(B).ICON?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,ve,[(0,P.createVNode)((0,P.unref)(F.SIcon),{name:u.value,size:16,billing:d.value},null,8,[`name`,`billing`])])):e.leftside===(0,P.unref)(B).AVATAR&&e.avatar?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(t.t),{key:1,name:e.avatar.name,src:e.avatar.src,badge:e.avatar.badge,size:(0,P.unref)(t.o).SIZE_20,showName:!1},null,8,[`name`,`src`,`badge`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0),(0,P.createElementVNode)(`div`,ye,[(0,P.createElementVNode)(`div`,be,[(0,P.createElementVNode)(`span`,xe,[(0,P.renderSlot)(n.$slots,`title`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.title),1)])]),e.layout===(0,P.unref)(z).VERTICAL&&e.closable?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,class:`s-ui-notification__close`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,"aria-label":e.closeAriaLabel,icon:`closeMini`,onClick:v},null,8,[`appearance`,`variant`,`size`,`aria-label`])):(0,P.createCommentVNode)(``,!0)]),p.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,Se,[e.description||(0,P.unref)(i).description?((0,P.openBlock)(),(0,P.createElementBlock)(`span`,Ce,[(0,P.renderSlot)(n.$slots,`description`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.description),1)])])):(0,P.createCommentVNode)(``,!0),e.linkText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,class:`s-ui-notification__link`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).MAIN,size:(0,P.unref)(o.n).SMALL,onClick:y},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.linkText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0),e.layout===(0,P.unref)(z).VERTICAL&&m.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,we,[e.showPrimaryButton&&e.primaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:g.value,variant:_.value,size:(0,P.unref)(o.n).SMALL,onClick:b},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.primaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0),e.showPrimaryButton&&e.secondaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,onClick:x},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.secondaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0)]),e.layout===(0,P.unref)(z).HORIZONTAL&&h.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,Te,[e.showPrimaryButton&&e.primaryButtonText?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:g.value,variant:_.value,size:(0,P.unref)(o.n).SMALL,onClick:b},{default:(0,P.withCtx)(()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.primaryButtonText),1)]),_:1},8,[`appearance`,`variant`,`size`])):(0,P.createCommentVNode)(``,!0),e.layout===(0,P.unref)(z).HORIZONTAL&&e.closable?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:1,class:`s-ui-notification__close`,appearance:(0,P.unref)(o.t).BARE,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,"aria-label":e.closeAriaLabel,icon:`closeMini`,onClick:v},null,8,[`appearance`,`variant`,`size`,`aria-label`])):(0,P.createCommentVNode)(``,!0)])):(0,P.createCommentVNode)(``,!0)])],14,he))}}),Ee=(0,P.defineComponent)({__name:`SBanner`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},maxWidth:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:t}){let n=t,r=(0,P.useSlots)();return(t,i)=>((0,P.openBlock)(),(0,P.createBlock)(H,{class:`s-ui-banner`,"data-qa":`ui:banner`,type:e.type,layout:e.layout,leftside:e.leftside,surface:(0,P.unref)(V).BANNER,title:e.title,description:e.description,linkText:e.linkText,primaryButtonText:e.primaryButtonText,secondaryButtonText:e.secondaryButtonText,showPrimaryButton:e.showPrimaryButton,closable:e.closable,closeAriaLabel:e.closeAriaLabel,icon:e.icon,avatar:e.avatar,maxWidth:e.maxWidth,onClose:i[0]||=e=>n(`close`),onLinkClick:i[1]||=e=>n(`linkClick`),onPrimaryAction:i[2]||=e=>n(`primaryAction`),onSecondaryAction:i[3]||=e=>n(`secondaryAction`)},(0,P.createSlots)({_:2},[(0,P.unref)(r).title?{name:`title`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,(0,P.unref)(r).description?{name:`description`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`description`)]),key:`1`}:void 0]),1032,[`type`,`layout`,`leftside`,`surface`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`maxWidth`]))}}),U=(0,P.defineComponent)({__name:`SToast`,props:{type:{default:()=>R.INFO_ACCENT},layout:{default:()=>z.HORIZONTAL},leftside:{default:()=>B.ICON},title:{},description:{},linkText:{},primaryButtonText:{},secondaryButtonText:{},showPrimaryButton:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeAriaLabel:{default:``},icon:{},avatar:{},width:{}},emits:[`close`,`linkClick`,`primaryAction`,`secondaryAction`],setup(e,{emit:t}){let n=t,r=(0,P.useSlots)(),i=(0,P.computed)(()=>e.width??360);return(t,a)=>((0,P.openBlock)(),(0,P.createBlock)(H,{class:`s-ui-toast`,"data-qa":`ui:toast`,type:e.type,layout:e.layout,leftside:e.leftside,surface:(0,P.unref)(V).TOAST,title:e.title,description:e.description,linkText:e.linkText,primaryButtonText:e.primaryButtonText,secondaryButtonText:e.secondaryButtonText,showPrimaryButton:e.showPrimaryButton,closable:e.closable,closeAriaLabel:e.closeAriaLabel,icon:e.icon,avatar:e.avatar,width:i.value,onClose:a[0]||=e=>n(`close`),onLinkClick:a[1]||=e=>n(`linkClick`),onPrimaryAction:a[2]||=e=>n(`primaryAction`),onSecondaryAction:a[3]||=e=>n(`secondaryAction`)},(0,P.createSlots)({_:2},[(0,P.unref)(r).title?{name:`title`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,(0,P.unref)(r).description?{name:`description`,fn:(0,P.withCtx)(()=>[(0,P.renderSlot)(t.$slots,`description`)]),key:`1`}:void 0]),1032,[`type`,`layout`,`leftside`,`surface`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`width`]))}}),De=.05,Oe=[`data-mounted`,`data-front`,`data-expanded`,`data-removed`,`data-visible`],ke=(0,P.defineComponent)({__name:`SToastProviderToast`,props:{index:{},expanded:{type:Boolean},frontToastHeight:{},stackPeek:{},removed:{type:Boolean},visible:{type:Boolean},offsetY:{}},emits:[`heightChange`],setup(e,{emit:t}){let n=t,r=(0,P.ref)(null),i=(0,P.ref)(0),a=(0,P.ref)(!1),o=(0,P.computed)(()=>e.index===0),s=(0,P.computed)(()=>1-e.index*De),c=(0,P.computed)(()=>({"--s-ui-toast-provider-toasts-before":String(e.index),"--s-ui-toast-provider-lift-amount":`${e.stackPeek*-1}px`,"--s-ui-toast-provider-front-toast-height":`${e.frontToastHeight}px`,"--s-ui-toast-provider-offset-y":`${e.offsetY}px`,"--s-ui-toast-provider-initial-height":`${i.value}px`,"--s-ui-toast-provider-stack-scale":String(s.value),zIndex:String(1e3-e.index)}));return(0,de.useResizeObserver)(r,e=>{let t=e[0]?.contentRect.height??0;t!==i.value&&(i.value=t,n(`heightChange`,t))}),(0,P.onMounted)(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{a.value=!0})})}),(t,n)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:`s-ui-toast-provider__toast`,"data-mounted":a.value,"data-front":o.value,"data-expanded":e.expanded,"data-removed":e.removed,"data-visible":e.visible,style:(0,P.normalizeStyle)(c.value)},[(0,P.createElementVNode)(`div`,{ref_key:`contentRef`,ref:r,class:`s-ui-toast-provider__toast-content`},[(0,P.renderSlot)(t.$slots,`default`)],512)],12,Oe))}}),W=4e3,G=1e4,Ae=50,K=(e,t)=>{let n=W+(e.length+(t?.length??0))*50;return n>1e4?G:n},q=(0,P.shallowRef)([]),J=new Map,je=0,Me={type:R.INFO_ACCENT,layout:z.HORIZONTAL,leftside:B.ICON,showPrimaryButton:!1,closable:!0},Ne=()=>`toast-${Date.now()}-${++je}`,Y=e=>{let t=J.get(e);t&&(window.clearTimeout(t),J.delete(e))},X=e=>{Y(e.id);let t=e.duration===void 0?K(e.title,e.description):e.duration;if(t>0){let n=window.setTimeout(()=>{Z(e.id)},t);J.set(e.id,n)}},Z=e=>{let t=q.value.findIndex(t=>t.id===e);if(t===-1)return;let n=q.value[t];n&&(Y(e),n.onClose&&n.onClose(),q.value=q.value.filter(t=>t.id!==e))},Pe=()=>{J.forEach(e=>window.clearTimeout(e)),J.clear(),q.value=[]},Q=e=>e.length<=3?e:(e.slice(3).forEach(e=>{Y(e.id)}),e.slice(0,3)),Fe=e=>{let t=e.id??Ne(),n={...Me,...e,id:t},r=q.value.findIndex(e=>e.id===t);if(r>-1){let e=[...q.value];e[r]=n,q.value=Q(e)}else q.value=Q([n,...q.value]);return X(n),t},Ie=(e,t)=>{let n=q.value.findIndex(t=>t.id===e);if(n===-1)return;let r=q.value[n];if(!r)return;let i={...r,...t,id:r.id},a=[...q.value];a[n]=i,q.value=a,X(i)},$=()=>({toasts:q,show:Fe,hide:Z,hideAll:Pe,update:Ie}),Le=(0,P.defineComponent)({__name:`SToastProvider`,setup(e){let{toasts:t,hide:n}=$(),r=(0,P.computed)(()=>t.value.slice(0,3)),i=(0,P.ref)(!1),a=(0,P.shallowRef)({}),o=(0,P.ref)(new Set),s=(0,P.computed)(()=>t.value[0]??null),c=(0,P.computed)(()=>s.value?a.value[s.value.id]??0:0),l=(0,P.ref)(0),u=(0,P.computed)(()=>c.value>0?c.value:l.value);(0,P.watch)(c,e=>{e>0&&(l.value=e)});let d=(0,P.computed)(()=>{if(r.value.length===0)return{};if(i.value)return{height:`${r.value.reduce((e,t,n)=>{let r=a.value[t.id]??0,i=n>0?4:0;return e+r+i},0)}px`};let e=Math.min(r.value.length-1,2)*10;return{height:`${u.value+e}px`}}),f=e=>{let t=0;for(let n=0;n<e;n+=1){let e=r.value[n];e&&(t+=(a.value[e.id]??0)+4)}return t},p=e=>o.value.has(e),m=()=>{r.value.length>1&&(i.value=!0)},h=()=>{i.value=!1},g=(e,t)=>{a.value={...a.value,[e]:t}},_=e=>{o.value.has(e)||(o.value=new Set([...o.value,e]),window.setTimeout(()=>{n(e);let t=new Set(o.value);t.delete(e),o.value=t;let r={...a.value};delete r[e],a.value=r},200))},v=e=>{e.onLinkClick&&e.onLinkClick()},y=e=>{e.onPrimaryAction&&e.onPrimaryAction(e.id)},b=e=>{e.onSecondaryAction&&e.onSecondaryAction()};return(e,t)=>((0,P.openBlock)(),(0,P.createBlock)(P.Teleport,{to:`body`},[(0,P.createElementVNode)(`div`,{class:`s-ui-toast-provider`,onMouseenter:m,onMouseleave:h},[r.value.length>0?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{key:0,class:`s-ui-toast-provider__list`,style:(0,P.normalizeStyle)(d.value)},[((0,P.openBlock)(!0),(0,P.createElementBlock)(P.Fragment,null,(0,P.renderList)(r.value,(t,n)=>((0,P.openBlock)(),(0,P.createBlock)(ke,{key:t.id,index:n,expanded:i.value,"front-toast-height":u.value,"stack-peek":(0,P.unref)(10),removed:p(t.id),visible:n<(0,P.unref)(3),"offset-y":f(n),onHeightChange:e=>g(t.id,e)},{default:(0,P.withCtx)(()=>[(0,P.renderSlot)(e.$slots,`toast`,{toast:t},()=>[t.component?((0,P.openBlock)(),(0,P.createBlock)((0,P.resolveDynamicComponent)(t.component),(0,P.mergeProps)({key:0,ref_for:!0},t.componentProps,{toast:t,onClose:e=>_(t.id)}),null,16,[`toast`,`onClose`])):((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(U),{key:1,type:t.type,layout:t.layout,leftside:t.leftside,title:t.title,description:t.description,linkText:t.linkText,primaryButtonText:t.primaryButtonText,secondaryButtonText:t.secondaryButtonText,showPrimaryButton:t.showPrimaryButton,closable:t.closable,closeAriaLabel:t.closeAriaLabel,icon:t.icon,avatar:t.avatar,width:t.width,onClose:e=>_(t.id),onLinkClick:e=>v(t),onPrimaryAction:e=>y(t),onSecondaryAction:e=>b(t)},null,8,[`type`,`layout`,`leftside`,`title`,`description`,`linkText`,`primaryButtonText`,`secondaryButtonText`,`showPrimaryButton`,`closable`,`closeAriaLabel`,`icon`,`avatar`,`width`,`onClose`,`onLinkClick`,`onPrimaryAction`,`onSecondaryAction`]))])]),_:2},1032,[`index`,`expanded`,`front-toast-height`,`stack-peek`,`removed`,`visible`,`offset-y`,`onHeightChange`]))),128))],4)):(0,P.createCommentVNode)(``,!0)],32)]))}}),Re=4,ze=4,Be=1,Ve=`400 12px var(--s-ui-font-family-label)`,He=4,Ue=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.arcTo(t+r,n,t+r,n+o,o),e.lineTo(t+r,n+i-o),e.arcTo(t+r,n+i,t+r-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.closePath()},We=e=>{let t=e.getProps([`x`,`y`,`base`],!0),n=Number(t.x),r=Number(t.y),i=Number(t.base);return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{left:Math.min(i,n),width:Math.abs(n-i),centerY:r}},Ge=(e,t,n,r)=>{let i=We(t);if(!i)return;let a=`${n}`,o=e.measureText(a).width+Re*2;if(i.width<o+He*2)return;let s=i.left+i.width/2;Ue(e,s-o/2,i.centerY-20/2,o,20,ze),e.fillStyle=r.background,e.fill(),e.lineWidth=Be,e.strokeStyle=r.border,e.stroke(),e.fillStyle=r.text,e.fillText(a,s,i.centerY)},Ke=e=>({id:`segmentedBarBadge`,afterDatasetsDraw(t){let n={background:j.w(j.v.pieBadgeBackground,e),border:j.w(j.v.pieBadgeBorder,e),text:j.w(j.v.pieBadgeText,e)},{ctx:r}=t;r.save(),r.font=Ve,r.textAlign=`center`,r.textBaseline=`middle`,t.data.datasets.forEach((e,i)=>{let a=t.getDatasetMeta(i)?.data[0],o=e.data[0];a&&typeof o==`number`&&o>0&&Ge(r,a,o,n)}),r.restore()}}),qe=40,Je=4,Ye=1,Xe=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],Ze=({segments:e,segmentColors:t,colorHostElement:n,skeleton:r=!1,onSegmentClick:i})=>{if(e.length===0)return null;let a=j.w(`--s-ui-color-surface-primary`,n),o=e.reduce((e,t)=>e+t.value,0),s=j.a({kind:`series`,skeleton:r,colorHostElement:n,onIndexClick:i});return{type:`bar`,data:{labels:[``],datasets:e.map((e,n)=>({label:e.label,data:[e.value],backgroundColor:t[n],hoverBackgroundColor:t[n],borderColor:a,borderWidth:{left:Ye,right:Ye},borderSkipped:!1,borderRadius:Je,barThickness:qe,stack:`track`}))},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,layout:{padding:0},events:r?[]:Xe,onHover:s.onHover,onClick:s.onClick,hover:r?void 0:{mode:`nearest`,intersect:!0},elements:r?void 0:{bar:{hoverBorderColor:a}},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,stacked:!0,min:0,max:o},y:{display:!1,stacked:!0}}},plugins:[...r?[]:[Ke(n)],...s.plugins]}},Qe=[4,1,2,1,3,1,2,1].map((e,t)=>({label:`Series ${t+1}`,value:e})),$e={class:`s-ui-chart-segmented-bar__canvas-wrap`},et=(0,P.defineComponent)({__name:`SChartSegmentedBar`,props:{segments:{default:()=>[]},showLegend:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},emits:[`segmentClick`],setup(e,{expose:t,emit:n}){let r=n,i=j.n,a=(0,P.useTemplateRef)(`chartRootRef`),o=(0,P.useTemplateRef)(`chartCanvasRef`),s=(0,P.computed)(()=>e.loading?Qe:e.segments),c=(0,P.computed)(()=>s.value.map((t,n)=>fe(n,a.value,t.fillColor,e.loading))),l=(0,P.computed)(()=>s.value.map((e,t)=>({segment:e,segmentIndex:t})).filter(({segment:e})=>e.value>0)),u=(0,P.computed)(()=>l.value.map(({segment:e})=>e)),d=(0,P.computed)(()=>l.value.map(({segmentIndex:e})=>c.value[e]??``)),f=(0,P.computed)(()=>{let e=new Map;return l.value.forEach(({segmentIndex:t},n)=>{e.set(t,n)}),e}),p=e=>{let t=l.value[e];t&&r(`segmentClick`,t.segmentIndex,t.segment)},m=ue.t(`onSegmentClick`),h=(0,P.computed)(()=>Ze({segments:u.value,segmentColors:d.value,colorHostElement:a.value,skeleton:e.loading,onSegmentClick:m()?p:void 0})),g=(0,P.computed)(()=>s.value.map((e,t)=>({label:e.label,color:c.value[t]??``}))),{chartInstance:_}=j.i({canvasRef:o,config:h,enabled:(0,P.computed)(()=>e.loading||u.value.length>0)}),{exportImage:v,handleLegendItemHover:y}=j.r({chartInstance:_,canvasRef:o,colorHostElement:a}),b=e=>{y(e===null?null:f.value.get(e)??null)};return t({exportImage:v}),(t,n)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:a,class:(0,P.normalizeClass)([`s-ui-chart-segmented-bar`,{"s-ui-chart-segmented-bar--skeleton":e.loading}]),"data-qa":`ui:chart-segmented-bar`},[(0,P.createElementVNode)(`div`,$e,[(0,P.createVNode)((0,P.unref)(j.t),{loading:e.loading,type:(0,P.unref)(i).CARTESIAN},{default:(0,P.withCtx)(()=>[(0,P.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-segmented-bar__canvas`},null,512)]),_:1},8,[`loading`,`type`])]),e.showLegend&&g.value.length?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(M.t),{key:0,items:g.value,disabled:e.loading,interactive:!e.loading,onItemHover:b},null,8,[`items`,`disabled`,`interactive`])):(0,P.createCommentVNode)(``,!0)],2))}}),tt={key:0,class:`s-ui-chart-widget__header`},nt={key:0,class:`s-ui-chart-widget__title-skeleton`,"aria-hidden":`true`},rt={key:1,class:`s-ui-chart-widget__title s-ui-typography-label-16-medium`},it={class:`s-ui-chart-widget__controls`},at={key:1,class:`s-ui-chart-widget__content`},ot=(0,P.defineComponent)({__name:`SChartWidget`,props:(0,P.mergeModels)({title:{default:``},collapsible:{type:Boolean,default:!1},hideContentWhenCollapsed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},{collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:[`update:collapsed`],setup(e){let t=(0,P.useModel)(e,`collapsed`),n=(0,P.useSlots)(),{t:r}=(0,F.useUiKitI18n)(),i=(0,P.computed)(()=>!!e.title||!!n.title||!!n.actions||e.collapsible),a=(0,P.computed)(()=>!t.value||!e.collapsible||!e.hideContentWhenCollapsed),c=(0,P.computed)(()=>r(t.value?`chartWidget.expand`:`chartWidget.collapse`));return(n,r)=>((0,P.openBlock)(),(0,P.createElementBlock)(`div`,{class:(0,P.normalizeClass)([`s-ui-chart-widget`,{"s-ui-chart-widget--skeleton":e.loading}]),"data-qa":`ui:chart-widget`},[i.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,tt,[e.loading?((0,P.openBlock)(),(0,P.createElementBlock)(`span`,nt)):((0,P.openBlock)(),(0,P.createElementBlock)(`span`,rt,[(0,P.renderSlot)(n.$slots,`title`,{},()=>[(0,P.createTextVNode)((0,P.toDisplayString)(e.title),1)])])),(0,P.createElementVNode)(`div`,it,[(0,P.renderSlot)(n.$slots,`actions`),e.collapsible?((0,P.openBlock)(),(0,P.createBlock)((0,P.unref)(s.t),{key:0,appearance:(0,P.unref)(o.t).OUTLINED,variant:(0,P.unref)(o.r).NEUTRAL,size:(0,P.unref)(o.n).SMALL,icon:t.value?(0,P.unref)(F.ESIconName).chevronDown:(0,P.unref)(F.ESIconName).chevronUp,"aria-label":c.value,"aria-expanded":!t.value,onClick:r[0]||=e=>t.value=!t.value},null,8,[`appearance`,`variant`,`size`,`icon`,`aria-label`,`aria-expanded`])):(0,P.createCommentVNode)(``,!0)])])):(0,P.createCommentVNode)(``,!0),a.value?((0,P.openBlock)(),(0,P.createElementBlock)(`div`,at,[(0,P.renderSlot)(n.$slots,`default`)])):(0,P.createCommentVNode)(``,!0)],2))}});exports.CALENDAR_WEEK_SLOT_COUNT=N.a,exports.DAY_TIMELINE_MINUTES=N.r,exports.DEFAULT_COLOR_PALETTE=r.i,exports.EAccentColor=r.a,exports.EButtonAppearance=o.t,exports.EButtonGroupLayout=u.n,exports.EButtonSize=o.n,exports.ESSegmentControlSize=o.n,exports.EButtonVariant=o.r,exports.EColorFormat=r.o,exports.EConnectedPositionStrategy=g.r,exports.ENotificationLayout=z,exports.ENotificationLeftside=B,exports.ENotificationType=R,exports.ESAvatarBadge=t.n,exports.ESAvatarColor=t.r,exports.ESAvatarGroupSize=a.n,exports.ESAvatarIconBackground=t.i,exports.ESAvatarShape=t.a,exports.ESAvatarSize=t.o,exports.ESBadgeColor=e.n,exports.ESBadgePlacement=e.r,exports.ESCardLayout=f.n,exports.ESCheckboxColor=d.n,exports.ESCheckboxSize=d.r,exports.ESChipColor=y.n,exports.ESChipSize=y.r,exports.ESColorPaletteLayout=r.n,exports.ESDropdownPlacement=g.i,exports.ESInlineInputAppearance=k.n,exports.ESInlineMessageValidationStatus=C.n,exports.ESInputCustomize=S.n,exports.ESLabelSize=w.n,exports.ESLabelVariant=w.r,exports.ESListGap=T.a,exports.ESListItemVariant=E.n,exports.ESPhotoEditShape=A.n,exports.ESPhotoEditSize=A.r,exports.ESRadioLabelPlacement=D.n,exports.ESSelectSearchable=x.n,exports.ESTabAppearance=m.n,exports.ESTabSize=m.r,exports.ESTagColor=_.n,exports.ESTagSize=_.r,exports.ESToggleSize=O.n,exports.ESelectionFocusMode=c.t,exports.ESelectionMode=c.n,exports.ESelectionOrientation=c.r,exports.EWorkTimeSource=N.c,exports.MAX_RECENT_COLORS=n.i,exports.RECOMMENDED_COLOR_PALETTE=r.r,exports.SAvatar=t.t,exports.SAvatarGroup=a.t,exports.SBadge=e.t,exports.SBanner=Ee,exports.SButton=s.t,exports.SButtonGroup=u.t,exports.SCalendarMonth=N.l,exports.SCalendarWeekGrid=N.i,exports.SCard=f.t,exports.SChartBurnup=ce.t,exports.SChartHorizontalBar=ae.t,exports.SChartLegend=M.t,exports.SChartLine=te.t,exports.SChartMultiLine=se.t,exports.SChartPie=oe.t,exports.SChartProgress=le.t,exports.SChartSegmentedBar=et,exports.SChartStackedArea=re.t,exports.SChartStackedBar=ie.t,exports.SChartWidget=ot,exports.SCheckbox=d.t,exports.SChip=y.t,exports.SColorArea=n.r,exports.SColorPalette=r.t,exports.SColorPicker=n.t,exports.SColorValues=n.n,exports.SDayTimeline=N.n,exports.SDropdown=b.t,exports.SDropdownMenu=x.r,exports.SInlineInput=k.t,exports.SInlineMessage=C.t,exports.SInput=S.t,exports.SLabel=w.t,exports.SList=T.t,exports.SListItem=E.t,exports.SPhotoEdit=A.t,exports.SRadio=D.t,exports.SSegmentControl=p.t,exports.SSelect=x.t,exports.STab=m.t,exports.STabs=h.t,exports.STag=_.t,exports.STagGroup=v.t,exports.STextarea=ee.t,exports.SToast=U,exports.SToastProvider=Le,exports.SToggle=O.t,exports.TOAST_AUTO_DURATION_MAX_MS=G,exports.TOAST_AUTO_DURATION_MIN_MS=W,exports.TOAST_AUTO_DURATION_MS_PER_CHAR=Ae,exports.WORK_TIME_SOURCE_COLOR_VARS=N.o,exports.WORK_TIME_SOURCE_ORDER=N.s,exports.buildWorkTimeLegendItems=N.t,exports.computeAutoDuration=K,exports.computeConnectedPosition=g.n,Object.defineProperty(exports,"createUiKit",{enumerable:!0,get:function(){return F.createUiKit}}),exports.formatDurationHM=N.u,exports.isSameColor=i.r,exports.normalizeColorValue=i.i,exports.resolveColorPreview=i.a,exports.resolveOwnPropOrGroupedOrFallback=c.a,Object.defineProperty(exports,"setUiKitLocale",{enumerable:!0,get:function(){return F.setUiKitLocale}}),Object.defineProperty(exports,"uiKitLocaleEn",{enumerable:!0,get:function(){return F.uiKitLocaleEn}}),Object.defineProperty(exports,"uiKitLocaleRu",{enumerable:!0,get:function(){return F.uiKitLocaleRu}}),exports.useFlatTreeList=T.s,exports.useFloatingOverlay=g.t,exports.useSListEndReached=T.o,exports.useSelectionGroup=c.o,exports.useSelectionGroupItem=l.n,exports.useToast=$,Object.defineProperty(exports,"useUiKitI18n",{enumerable:!0,get:function(){return F.useUiKitI18n}});var st=require("@shtabapp/ui-kit-tokens");Object.keys(st).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return st[e]}})}),Object.keys(F).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return F[e]}})});
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "./SBadge-BDxQJh6c.js";
|
|
2
2
|
import { a as r, i, n as a, o, r as s, t as c } from "./SAvatar-BK8cEzGY.js";
|
|
3
|
-
import { i as l, n as u, r as d, t as f } from "./SColorPicker-
|
|
3
|
+
import { i as l, n as u, r as d, t as f } from "./SColorPicker-C1wT4fRa.js";
|
|
4
4
|
import { a as p, i as m, n as h, o as g, r as _, t as v } from "./SColorPalette-D2WCADDX.js";
|
|
5
5
|
import { a as y, i as b, r as ee } from "./colorValue-CSh0chxp.js";
|
|
6
6
|
import { n as te, t as ne } from "./SAvatarGroup-F5w88NGf.js";
|
|
@@ -19,7 +19,7 @@ import { n as Te, r as Ee, t as De } from "./STag-CluIVRKi.js";
|
|
|
19
19
|
import { t as Oe } from "./STagGroup-GzZhto7-.js";
|
|
20
20
|
import { n as ke, r as Ae, t as je } from "./SChip-DvPazz7Y.js";
|
|
21
21
|
import { t as Me } from "./SDropdown-CTQ5Qlez.js";
|
|
22
|
-
import { n as Ne, r as Pe, t as Fe } from "./SSelect-
|
|
22
|
+
import { n as Ne, r as Pe, t as Fe } from "./SSelect-Bf1lDJ0M.js";
|
|
23
23
|
import { n as Ie, t as Le } from "./SInput-ug89CYt3.js";
|
|
24
24
|
import { n as Re, t as ze } from "./SInlineMessage-Dirk5RwO.js";
|
|
25
25
|
import { n as Be, r as Ve, t as He } from "./SLabel-yzcX4qp5.js";
|