@shtabapp/ui-kit 1.32.0 → 1.33.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/SAvatar-C2gekygl.cjs +1 -0
  3. package/dist/SAvatar-DAfDAqrP.js +265 -0
  4. package/dist/{SAvatarGroup-CMa9KhUZ.cjs → SAvatarGroup-76j-sHCe.cjs} +1 -1
  5. package/dist/{SAvatarGroup-wkXHy_tK.js → SAvatarGroup-HvIlI5y0.js} +1 -1
  6. package/dist/{SSelect-iBb45tet.js → SSelect-CZe3djdm.js} +6 -1
  7. package/dist/{SSelect-CgL7ECfS.cjs → SSelect-DAPSmCWf.cjs} +1 -1
  8. package/dist/STag-BwzuI3cF.cjs +1 -0
  9. package/dist/STag-L6B4DxOx.js +122 -0
  10. package/dist/{STagGroup-BMyuxfVX.cjs → STagGroup-BMGq6jB5.cjs} +1 -1
  11. package/dist/{STagGroup-B2-_OG3R.js → STagGroup-DWsu0ket.js} +1 -1
  12. package/dist/components/SAvatar/SAvatar.vue.d.ts.map +1 -1
  13. package/dist/components/SAvatar/utils/getAvatarInitialsTextColor.d.ts +4 -0
  14. package/dist/components/SAvatar/utils/getAvatarInitialsTextColor.d.ts.map +1 -0
  15. package/dist/components/SAvatar/utils/resolveAvatarColor.d.ts +1 -3
  16. package/dist/components/SAvatar/utils/resolveAvatarColor.d.ts.map +1 -1
  17. package/dist/components/SSelect/SSelect.types.d.ts +5 -0
  18. package/dist/components/SSelect/SSelect.types.d.ts.map +1 -1
  19. package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
  20. package/dist/components/STag/utils/resolveTagColor.d.ts +1 -3
  21. package/dist/components/STag/utils/resolveTagColor.d.ts.map +1 -1
  22. package/dist/contrastSurfaceTextColor-Dl641cZ_.js +33 -0
  23. package/dist/contrastSurfaceTextColor-Ybh-FZof.cjs +1 -0
  24. package/dist/entries/avatar-group.cjs +1 -1
  25. package/dist/entries/avatar-group.js +1 -1
  26. package/dist/entries/avatar.cjs +1 -1
  27. package/dist/entries/avatar.js +1 -1
  28. package/dist/entries/select.cjs +1 -1
  29. package/dist/entries/select.js +1 -1
  30. package/dist/entries/tag-group.cjs +1 -1
  31. package/dist/entries/tag-group.js +2 -2
  32. package/dist/entries/tag.cjs +1 -1
  33. package/dist/entries/tag.js +1 -1
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.js +5 -5
  36. package/dist/uikit-components.css +1 -1
  37. package/dist/utils/color/contrastSurfaceTextColor.d.ts +4 -0
  38. package/dist/utils/color/contrastSurfaceTextColor.d.ts.map +1 -0
  39. package/dist/utils/color/index.d.ts +2 -0
  40. package/dist/utils/color/index.d.ts.map +1 -0
  41. package/package.json +1 -1
  42. package/dist/SAvatar-BS9Lu2eL.js +0 -249
  43. package/dist/SAvatar-BXABKIV0.cjs +0 -1
  44. package/dist/STag-CYoj7L-p.js +0 -118
  45. package/dist/STag-DVrSWByQ.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [@shtabapp/ui-kit-v1.33.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.32.0...@shtabapp/ui-kit@1.33.0) (2026-07-01)
2
+
3
+ ### Features
4
+
5
+ - contrast color text in avatars and tags & fitViewport in select ([1dd7352](https://gitlab.com/mstikharev/shtab-ui-kit/commit/1dd73524fafe22e79d28557d94acd3d440663f47))
6
+
1
7
  ## [@shtabapp/ui-kit-v1.32.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.31.0...@shtabapp/ui-kit@1.32.0) (2026-06-30)
2
8
 
3
9
  ### Features
@@ -0,0 +1 @@
1
+ const e=require("./SBadge-d1GOPFP-.cjs"),t=require("./contrastSurfaceTextColor-Ybh-FZof.cjs");let n=require("vue"),r=require("@shtabapp/ui-kit-primitives");var i=function(e){return e.SIZE_80=`80`,e.SIZE_72=`72`,e.SIZE_64=`64`,e.SIZE_56=`56`,e.SIZE_48=`48`,e.SIZE_40=`40`,e.SIZE_32=`32`,e.SIZE_24=`24`,e.SIZE_20=`20`,e.SIZE_16=`16`,e}({}),a=function(e){return e.CIRCLE=`circle`,e.SQUARE=`square`,e}({}),o=function(e){return e.TEAL=`teal`,e.CYAN=`cyan`,e.INDIGO=`indigo`,e.VIOLET=`violet`,e.PINK=`pink`,e.SURFACE=`surface`,e}({}),s=function(e){return e.NEUTRAL=`neutral`,e.MAIN=`main`,e}({}),c=function(e){return e.DEFAULT=`default`,e.ONLINE=`online`,e.OFFLINE=`offline`,e.RECENTLY=`recently`,e.ERROR=`error`,e.TRACK=`track`,e.DONE=`done`,e.CONTROLLER=`controller`,e.FAVORITE=`favorite`,e.PIN=`pin`,e.PRIVATE=`private`,e}({}),l=function(e){return e.SMALL=`s`,e.MEDIUM=`m`,e.LARGE=`l`,e}({}),u={[i.SIZE_80]:`s-ui-typography-heading-h3-semibold`,[i.SIZE_72]:`s-ui-typography-heading-h4-semibold`,[i.SIZE_64]:`s-ui-typography-heading-h4-semibold`,[i.SIZE_56]:`s-ui-typography-label-16-medium`,[i.SIZE_48]:`s-ui-typography-label-16-medium`,[i.SIZE_40]:`s-ui-typography-label-16-medium`,[i.SIZE_32]:`s-ui-typography-label-14-medium`,[i.SIZE_24]:`s-ui-typography-label-12-medium`,[i.SIZE_20]:`s-ui-typography-label-12-medium`,[i.SIZE_16]:`s-ui-typography-label-10-medium`},d={[i.SIZE_80]:40,[i.SIZE_72]:40,[i.SIZE_64]:40,[i.SIZE_56]:32,[i.SIZE_48]:32,[i.SIZE_40]:24,[i.SIZE_32]:24,[i.SIZE_24]:20,[i.SIZE_20]:16,[i.SIZE_16]:16},f={[i.SIZE_80]:l.LARGE,[i.SIZE_72]:l.LARGE,[i.SIZE_64]:l.MEDIUM,[i.SIZE_56]:l.MEDIUM,[i.SIZE_48]:l.SMALL,[i.SIZE_40]:l.SMALL,[i.SIZE_32]:l.SMALL,[i.SIZE_24]:l.SMALL,[i.SIZE_20]:l.SMALL,[i.SIZE_16]:l.SMALL},p={[l.SMALL]:e.i.SMALL,[l.MEDIUM]:e.i.MEDIUM,[l.LARGE]:e.i.LARGE},m={[e.i.SMALL]:8,[e.i.MEDIUM]:10,[e.i.LARGE]:12},h={[e.i.SMALL]:12,[e.i.MEDIUM]:16,[e.i.LARGE]:20},g=16,_={[i.SIZE_80]:0,[i.SIZE_72]:0,[i.SIZE_64]:0,[i.SIZE_56]:0,[i.SIZE_48]:0,[i.SIZE_40]:0,[i.SIZE_32]:-2,[i.SIZE_24]:-2,[i.SIZE_20]:-4,[i.SIZE_16]:-4},v={[i.SIZE_80]:-8,[i.SIZE_72]:-8,[i.SIZE_64]:-8,[i.SIZE_56]:-8,[i.SIZE_48]:-8,[i.SIZE_40]:-8,[i.SIZE_32]:-8,[i.SIZE_24]:-8,[i.SIZE_20]:-10,[i.SIZE_16]:-10},y={[c.DEFAULT]:e.n.MAIN,[c.ONLINE]:e.n.SUCCESS,[c.OFFLINE]:e.n.WHITE,[c.RECENTLY]:e.n.WARNING,[c.ERROR]:e.n.DANGER,[c.TRACK]:e.n.MAIN,[c.DONE]:e.n.SUCCESS,[c.CONTROLLER]:e.n.MAIN,[c.FAVORITE]:e.n.WARNING,[c.PIN]:e.n.MAIN,[c.PRIVATE]:e.n.BILLING},b={[c.TRACK]:r.ESIconName.playFill,[c.DONE]:r.ESIconName.checkBold,[c.CONTROLLER]:r.ESIconName.controlFill,[c.FAVORITE]:r.ESIconName.starFill,[c.PIN]:r.ESIconName.pinFill,[c.PRIVATE]:r.ESIconName.tabooBold},x=({avatarSize:e,badgeSize:t,hasIcon:n})=>{let r=_[e];return n?r:r+(h[t]-m[t])/2},S=(e,t)=>({offsetX:-e-t/2,offsetY:-e-t/2}),C=(e,t)=>({offsetX:-e-t/2,offsetY:e+t/2}),w=({badge:t,counter:r,size:i})=>{let a=(0,n.computed)(()=>{let r=(0,n.toValue)(t);if(!r)return;let a=(0,n.toValue)(i),o=b[r],s=p[f[a]],c=o?h[s]:m[s],l=S(x({avatarSize:a,badgeSize:s,hasIcon:!!o}),c);return{anchored:!0,color:y[r],icon:o,label:r,offsetX:l.offsetX,offsetY:l.offsetY,placement:e.r.BOTTOM_END,size:s}}),o=(0,n.computed)(()=>{let t=(0,n.toValue)(r);if(typeof t!=`number`)return;let a=v[(0,n.toValue)(i)],o=C(a,g);return{anchored:!0,color:e.n.MAIN,offsetX:o.offsetX,offsetY:o.offsetY,placement:e.r.TOP_END,size:e.i.MEDIUM,value:t}});return{avatarBadgeItemsProps:(0,n.computed)(()=>{let e=[];return o.value&&e.push(o.value),a.value&&e.push(a.value),e})}},T={[o.CYAN]:`#127c97`,[o.INDIGO]:`#755ace`,[o.PINK]:`#c33c86`,[o.TEAL]:`#158472`,[o.VIOLET]:`#8757c7`},E=e=>{if(t.n(e))return e;if(e!==o.SURFACE)return T[e]},D=e=>{let n=E(e);if(n)return t.t(n)},O=e=>t.n(e),k=e=>O(e)?`s-ui-avatar--color-custom`:`s-ui-avatar--color-${e}`,A=e=>{let t=D(e),n={};if(O(e)&&(n[`--s-ui-avatar-background`]=e),t&&(n[`--s-ui-avatar-color`]=t),Object.keys(n).length!==0)return n},j=[`aria-disabled`],M={class:`s-ui-avatar__content`},N=[`src`,`alt`],P={key:1,class:`s-ui-avatar__icon`},F=[`role`,`aria-label`],I={key:0,class:`s-ui-avatar__name`},L=(0,n.defineComponent)({inheritAttrs:!1,__name:`SAvatar`,props:{alt:{},badge:{},bordered:{type:Boolean,default:!0},color:{default:()=>o.TEAL},counter:{},disabled:{type:Boolean,default:!1},icon:{},iconBackground:{default:()=>s.NEUTRAL},initialLength:{default:1},name:{},shape:{default:()=>a.CIRCLE},showName:{type:Boolean,default:!0},size:{default:()=>i.SIZE_40},src:{}},setup(t){let i=(0,n.useAttrs)(),a=(0,n.ref)(!1),o=e=>typeof e==`number`||typeof e==`string`,s=(0,n.computed)(()=>{if(o(i.tabindex))return i.tabindex;if(o(i.tabIndex))return i.tabIndex}),c=(0,n.computed)(()=>o(i.tabindex)||o(i.tabIndex)),l=(0,n.computed)(()=>t.disabled?-1:c.value?s.value:0),f=(0,n.computed)(()=>({...i,tabindex:l.value})),p=(0,n.computed)(()=>[`s-ui-avatar--size-${t.size}`,`s-ui-avatar--shape-${t.shape}`,k(t.color),`s-ui-avatar--icon-background-${t.iconBackground}`,{"s-ui-avatar--bordered":t.bordered,"s-ui-avatar--disabled":t.disabled,"s-ui-avatar--icon":g.value,"s-ui-avatar--photo":h.value}]),m=(0,n.computed)(()=>{if(!g.value)return A(t.color)}),h=(0,n.computed)(()=>!!(t.src&&!a.value)),g=(0,n.computed)(()=>!!(!h.value&&t.icon)),_=e=>{let t=e.split(/\s+/).filter(Boolean);if(t.length===1){let e=t[0];if(e)return e}return t.map(e=>e.slice(0,1)).join(``)},v=(0,n.computed)(()=>t.name?_(t.name):``),y=(0,n.computed)(()=>t.alt?t.alt:t.name?t.name:v.value),b=(0,n.computed)(()=>{if(t.alt)return t.alt;if(t.name)return t.name}),x=(0,n.computed)(()=>v.value.slice(0,Math.max(t.initialLength,0))),S=(0,n.computed)(()=>u[t.size]),C=(0,n.computed)(()=>d[t.size]),{avatarBadgeItemsProps:T}=w({badge:()=>t.badge,counter:()=>t.counter,size:()=>t.size}),E=()=>{a.value=!0};return(0,n.watch)(()=>t.src,()=>{a.value=!1}),(i,o)=>((0,n.openBlock)(),(0,n.createElementBlock)(`span`,(0,n.mergeProps)(f.value,{class:[`s-ui-avatar`,p.value],style:m.value,"aria-disabled":t.disabled||void 0}),[(0,n.createElementVNode)(`span`,M,[t.src&&!a.value?((0,n.openBlock)(),(0,n.createElementBlock)(`img`,{key:0,class:`s-ui-avatar__image`,src:t.src,alt:y.value,onError:E},null,40,N)):t.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,P,[(0,n.createVNode)((0,n.unref)(r.SIcon),{name:t.icon,size:C.value,"aria-label":b.value},null,8,[`name`,`size`,`aria-label`])])):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:2,class:(0,n.normalizeClass)([`s-ui-avatar__initials`,S.value]),role:t.alt?`img`:void 0,"aria-label":t.alt},(0,n.toDisplayString)(x.value),11,F)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(T),t=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(e.t),(0,n.mergeProps)({key:t.placement},{ref_for:!0},t),null,16))),128))]),t.showName&&t.name?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,I,(0,n.toDisplayString)(t.name),1)):(0,n.createCommentVNode)(``,!0)],16,j))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return L}});
@@ -0,0 +1,265 @@
1
+ import { i as e, n as t, r as n, t as r } from "./SBadge-BDxQJh6c.js";
2
+ import { n as i, t as a } from "./contrastSurfaceTextColor-Dl641cZ_.js";
3
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeProps as m, normalizeClass as h, openBlock as g, ref as _, renderList as v, toDisplayString as y, toValue as b, unref as x, useAttrs as S, watch as C } from "vue";
4
+ import { ESIconName as w, SIcon as T } from "@shtabapp/ui-kit-primitives";
5
+ //#region src/components/SAvatar/SAvatar.types.ts
6
+ var E = /* @__PURE__ */ function(e) {
7
+ return e.SIZE_80 = "80", e.SIZE_72 = "72", e.SIZE_64 = "64", e.SIZE_56 = "56", e.SIZE_48 = "48", e.SIZE_40 = "40", e.SIZE_32 = "32", e.SIZE_24 = "24", e.SIZE_20 = "20", e.SIZE_16 = "16", e;
8
+ }({}), D = /* @__PURE__ */ function(e) {
9
+ return e.CIRCLE = "circle", e.SQUARE = "square", e;
10
+ }({}), O = /* @__PURE__ */ function(e) {
11
+ return e.TEAL = "teal", e.CYAN = "cyan", e.INDIGO = "indigo", e.VIOLET = "violet", e.PINK = "pink", e.SURFACE = "surface", e;
12
+ }({}), k = /* @__PURE__ */ function(e) {
13
+ return e.NEUTRAL = "neutral", e.MAIN = "main", e;
14
+ }({}), A = /* @__PURE__ */ function(e) {
15
+ return e.DEFAULT = "default", e.ONLINE = "online", e.OFFLINE = "offline", e.RECENTLY = "recently", e.ERROR = "error", e.TRACK = "track", e.DONE = "done", e.CONTROLLER = "controller", e.FAVORITE = "favorite", e.PIN = "pin", e.PRIVATE = "private", e;
16
+ }({}), j = /* @__PURE__ */ function(e) {
17
+ return e.SMALL = "s", e.MEDIUM = "m", e.LARGE = "l", e;
18
+ }({}), M = {
19
+ [E.SIZE_80]: "s-ui-typography-heading-h3-semibold",
20
+ [E.SIZE_72]: "s-ui-typography-heading-h4-semibold",
21
+ [E.SIZE_64]: "s-ui-typography-heading-h4-semibold",
22
+ [E.SIZE_56]: "s-ui-typography-label-16-medium",
23
+ [E.SIZE_48]: "s-ui-typography-label-16-medium",
24
+ [E.SIZE_40]: "s-ui-typography-label-16-medium",
25
+ [E.SIZE_32]: "s-ui-typography-label-14-medium",
26
+ [E.SIZE_24]: "s-ui-typography-label-12-medium",
27
+ [E.SIZE_20]: "s-ui-typography-label-12-medium",
28
+ [E.SIZE_16]: "s-ui-typography-label-10-medium"
29
+ }, N = {
30
+ [E.SIZE_80]: 40,
31
+ [E.SIZE_72]: 40,
32
+ [E.SIZE_64]: 40,
33
+ [E.SIZE_56]: 32,
34
+ [E.SIZE_48]: 32,
35
+ [E.SIZE_40]: 24,
36
+ [E.SIZE_32]: 24,
37
+ [E.SIZE_24]: 20,
38
+ [E.SIZE_20]: 16,
39
+ [E.SIZE_16]: 16
40
+ }, P = {
41
+ [E.SIZE_80]: j.LARGE,
42
+ [E.SIZE_72]: j.LARGE,
43
+ [E.SIZE_64]: j.MEDIUM,
44
+ [E.SIZE_56]: j.MEDIUM,
45
+ [E.SIZE_48]: j.SMALL,
46
+ [E.SIZE_40]: j.SMALL,
47
+ [E.SIZE_32]: j.SMALL,
48
+ [E.SIZE_24]: j.SMALL,
49
+ [E.SIZE_20]: j.SMALL,
50
+ [E.SIZE_16]: j.SMALL
51
+ }, F = {
52
+ [j.SMALL]: e.SMALL,
53
+ [j.MEDIUM]: e.MEDIUM,
54
+ [j.LARGE]: e.LARGE
55
+ }, I = {
56
+ [e.SMALL]: 8,
57
+ [e.MEDIUM]: 10,
58
+ [e.LARGE]: 12
59
+ }, L = {
60
+ [e.SMALL]: 12,
61
+ [e.MEDIUM]: 16,
62
+ [e.LARGE]: 20
63
+ }, R = 16, z = {
64
+ [E.SIZE_80]: 0,
65
+ [E.SIZE_72]: 0,
66
+ [E.SIZE_64]: 0,
67
+ [E.SIZE_56]: 0,
68
+ [E.SIZE_48]: 0,
69
+ [E.SIZE_40]: 0,
70
+ [E.SIZE_32]: -2,
71
+ [E.SIZE_24]: -2,
72
+ [E.SIZE_20]: -4,
73
+ [E.SIZE_16]: -4
74
+ }, B = {
75
+ [E.SIZE_80]: -8,
76
+ [E.SIZE_72]: -8,
77
+ [E.SIZE_64]: -8,
78
+ [E.SIZE_56]: -8,
79
+ [E.SIZE_48]: -8,
80
+ [E.SIZE_40]: -8,
81
+ [E.SIZE_32]: -8,
82
+ [E.SIZE_24]: -8,
83
+ [E.SIZE_20]: -10,
84
+ [E.SIZE_16]: -10
85
+ }, V = {
86
+ [A.DEFAULT]: t.MAIN,
87
+ [A.ONLINE]: t.SUCCESS,
88
+ [A.OFFLINE]: t.WHITE,
89
+ [A.RECENTLY]: t.WARNING,
90
+ [A.ERROR]: t.DANGER,
91
+ [A.TRACK]: t.MAIN,
92
+ [A.DONE]: t.SUCCESS,
93
+ [A.CONTROLLER]: t.MAIN,
94
+ [A.FAVORITE]: t.WARNING,
95
+ [A.PIN]: t.MAIN,
96
+ [A.PRIVATE]: t.BILLING
97
+ }, H = {
98
+ [A.TRACK]: w.playFill,
99
+ [A.DONE]: w.checkBold,
100
+ [A.CONTROLLER]: w.controlFill,
101
+ [A.FAVORITE]: w.starFill,
102
+ [A.PIN]: w.pinFill,
103
+ [A.PRIVATE]: w.tabooBold
104
+ }, U = ({ avatarSize: e, badgeSize: t, hasIcon: n }) => {
105
+ let r = z[e];
106
+ return n ? r : r + (L[t] - I[t]) / 2;
107
+ }, W = (e, t) => ({
108
+ offsetX: -e - t / 2,
109
+ offsetY: -e - t / 2
110
+ }), G = (e, t) => ({
111
+ offsetX: -e - t / 2,
112
+ offsetY: e + t / 2
113
+ }), K = ({ badge: r, counter: i, size: a }) => {
114
+ let o = s(() => {
115
+ let e = b(r);
116
+ if (!e) return;
117
+ let t = b(a), i = H[e], o = F[P[t]], s = i ? L[o] : I[o], c = W(U({
118
+ avatarSize: t,
119
+ badgeSize: o,
120
+ hasIcon: !!i
121
+ }), s);
122
+ return {
123
+ anchored: !0,
124
+ color: V[e],
125
+ icon: i,
126
+ label: e,
127
+ offsetX: c.offsetX,
128
+ offsetY: c.offsetY,
129
+ placement: n.BOTTOM_END,
130
+ size: o
131
+ };
132
+ }), c = s(() => {
133
+ let r = b(i);
134
+ if (typeof r != "number") return;
135
+ let o = B[b(a)], s = G(o, R);
136
+ return {
137
+ anchored: !0,
138
+ color: t.MAIN,
139
+ offsetX: s.offsetX,
140
+ offsetY: s.offsetY,
141
+ placement: n.TOP_END,
142
+ size: e.MEDIUM,
143
+ value: r
144
+ };
145
+ });
146
+ return { avatarBadgeItemsProps: s(() => {
147
+ let e = [];
148
+ return c.value && e.push(c.value), o.value && e.push(o.value), e;
149
+ }) };
150
+ }, q = {
151
+ [O.CYAN]: "#127c97",
152
+ [O.INDIGO]: "#755ace",
153
+ [O.PINK]: "#c33c86",
154
+ [O.TEAL]: "#158472",
155
+ [O.VIOLET]: "#8757c7"
156
+ }, J = (e) => {
157
+ if (i(e)) return e;
158
+ if (e !== O.SURFACE) return q[e];
159
+ }, Y = (e) => {
160
+ let t = J(e);
161
+ if (t) return a(t);
162
+ }, X = (e) => i(e), Z = (e) => X(e) ? "s-ui-avatar--color-custom" : `s-ui-avatar--color-${e}`, Q = (e) => {
163
+ let t = Y(e), n = {};
164
+ if (X(e) && (n["--s-ui-avatar-background"] = e), t && (n["--s-ui-avatar-color"] = t), Object.keys(n).length !== 0) return n;
165
+ }, $ = ["aria-disabled"], ee = { class: "s-ui-avatar__content" }, te = ["src", "alt"], ne = {
166
+ key: 1,
167
+ class: "s-ui-avatar__icon"
168
+ }, re = ["role", "aria-label"], ie = {
169
+ key: 0,
170
+ class: "s-ui-avatar__name"
171
+ }, ae = /* @__PURE__ */ p({
172
+ inheritAttrs: !1,
173
+ __name: "SAvatar",
174
+ props: {
175
+ alt: {},
176
+ badge: {},
177
+ bordered: {
178
+ type: Boolean,
179
+ default: !0
180
+ },
181
+ color: { default: () => O.TEAL },
182
+ counter: {},
183
+ disabled: {
184
+ type: Boolean,
185
+ default: !1
186
+ },
187
+ icon: {},
188
+ iconBackground: { default: () => k.NEUTRAL },
189
+ initialLength: { default: 1 },
190
+ name: {},
191
+ shape: { default: () => D.CIRCLE },
192
+ showName: {
193
+ type: Boolean,
194
+ default: !0
195
+ },
196
+ size: { default: () => E.SIZE_40 },
197
+ src: {}
198
+ },
199
+ setup(e) {
200
+ let t = S(), n = _(!1), i = (e) => typeof e == "number" || typeof e == "string", a = s(() => {
201
+ if (i(t.tabindex)) return t.tabindex;
202
+ if (i(t.tabIndex)) return t.tabIndex;
203
+ }), p = s(() => i(t.tabindex) || i(t.tabIndex)), b = s(() => e.disabled ? -1 : p.value ? a.value : 0), w = s(() => ({
204
+ ...t,
205
+ tabindex: b.value
206
+ })), E = s(() => [
207
+ `s-ui-avatar--size-${e.size}`,
208
+ `s-ui-avatar--shape-${e.shape}`,
209
+ Z(e.color),
210
+ `s-ui-avatar--icon-background-${e.iconBackground}`,
211
+ {
212
+ "s-ui-avatar--bordered": e.bordered,
213
+ "s-ui-avatar--disabled": e.disabled,
214
+ "s-ui-avatar--icon": k.value,
215
+ "s-ui-avatar--photo": O.value
216
+ }
217
+ ]), D = s(() => {
218
+ if (!k.value) return Q(e.color);
219
+ }), O = s(() => !!(e.src && !n.value)), k = s(() => !!(!O.value && e.icon)), A = (e) => {
220
+ let t = e.split(/\s+/).filter(Boolean);
221
+ if (t.length === 1) {
222
+ let e = t[0];
223
+ if (e) return e;
224
+ }
225
+ return t.map((e) => e.slice(0, 1)).join("");
226
+ }, j = s(() => e.name ? A(e.name) : ""), P = s(() => e.alt ? e.alt : e.name ? e.name : j.value), F = s(() => {
227
+ if (e.alt) return e.alt;
228
+ if (e.name) return e.name;
229
+ }), I = s(() => j.value.slice(0, Math.max(e.initialLength, 0))), L = s(() => M[e.size]), R = s(() => N[e.size]), { avatarBadgeItemsProps: z } = K({
230
+ badge: () => e.badge,
231
+ counter: () => e.counter,
232
+ size: () => e.size
233
+ }), B = () => {
234
+ n.value = !0;
235
+ };
236
+ return C(() => e.src, () => {
237
+ n.value = !1;
238
+ }), (t, i) => (g(), u("span", m(w.value, {
239
+ class: ["s-ui-avatar", E.value],
240
+ style: D.value,
241
+ "aria-disabled": e.disabled || void 0
242
+ }), [d("span", ee, [e.src && !n.value ? (g(), u("img", {
243
+ key: 0,
244
+ class: "s-ui-avatar__image",
245
+ src: e.src,
246
+ alt: P.value,
247
+ onError: B
248
+ }, null, 40, te)) : e.icon ? (g(), u("span", ne, [f(x(T), {
249
+ name: e.icon,
250
+ size: R.value,
251
+ "aria-label": F.value
252
+ }, null, 8, [
253
+ "name",
254
+ "size",
255
+ "aria-label"
256
+ ])])) : (g(), u("span", {
257
+ key: 2,
258
+ class: h(["s-ui-avatar__initials", L.value]),
259
+ role: e.alt ? "img" : void 0,
260
+ "aria-label": e.alt
261
+ }, y(I.value), 11, re)), (g(!0), u(o, null, v(x(z), (e) => (g(), c(x(r), m({ key: e.placement }, { ref_for: !0 }, e), null, 16))), 128))]), e.showName && e.name ? (g(), u("span", ie, y(e.name), 1)) : l("", !0)], 16, $));
262
+ }
263
+ });
264
+ //#endregion
265
+ export { D as a, k as i, A as n, E as o, O as r, ae as t };
@@ -1 +1 @@
1
- const e=require("./SAvatar-BXABKIV0.cjs"),t=require("./SOverflowGroup-DyVUzkNu.cjs");let n=require("vue");var r=function(e){return e.EXTRA_SMALL=`extra-small`,e.SMALL=`small`,e.MEDIUM=`medium`,e}({}),i={class:`s-ui-avatar-group__overflow`},a=(0,n.defineComponent)({__name:`SAvatarGroup`,props:{disabled:{type:Boolean,default:!1},maxVisible:{},size:{default:()=>r.SMALL}},setup(a){let o=(0,n.computed)(()=>[`s-ui-avatar-group--size-${a.size}`,{"s-ui-avatar-group--disabled":a.disabled}]),s={[r.EXTRA_SMALL]:e.o.SIZE_16,[r.SMALL]:e.o.SIZE_20,[r.MEDIUM]:e.o.SIZE_24},c=(0,n.computed)(()=>s[a.size]),l=(e,t)=>({"--s-ui-avatar-group-item-z-index":e-t}),u=(t,r)=>t.type===e.t?(0,n.cloneVNode)(t,{...a.disabled?{disabled:!0}:{},showName:!1,size:c.value,style:l(r.visibleCount,r.visibleIndex)}):t;return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(t.t,{class:(0,n.normalizeClass)([`s-ui-avatar-group`,o.value]),role:`group`,"aria-disabled":a.disabled||void 0,"cluster-class":`s-ui-avatar-group__cluster`,"max-visible":a.maxVisible,"map-vnode":u},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)(e),1)]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`)]),_:3},8,[`class`,`aria-disabled`,`max-visible`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
1
+ const e=require("./SAvatar-C2gekygl.cjs"),t=require("./SOverflowGroup-DyVUzkNu.cjs");let n=require("vue");var r=function(e){return e.EXTRA_SMALL=`extra-small`,e.SMALL=`small`,e.MEDIUM=`medium`,e}({}),i={class:`s-ui-avatar-group__overflow`},a=(0,n.defineComponent)({__name:`SAvatarGroup`,props:{disabled:{type:Boolean,default:!1},maxVisible:{},size:{default:()=>r.SMALL}},setup(a){let o=(0,n.computed)(()=>[`s-ui-avatar-group--size-${a.size}`,{"s-ui-avatar-group--disabled":a.disabled}]),s={[r.EXTRA_SMALL]:e.o.SIZE_16,[r.SMALL]:e.o.SIZE_20,[r.MEDIUM]:e.o.SIZE_24},c=(0,n.computed)(()=>s[a.size]),l=(e,t)=>({"--s-ui-avatar-group-item-z-index":e-t}),u=(t,r)=>t.type===e.t?(0,n.cloneVNode)(t,{...a.disabled?{disabled:!0}:{},showName:!1,size:c.value,style:l(r.visibleCount,r.visibleIndex)}):t;return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(t.t,{class:(0,n.normalizeClass)([`s-ui-avatar-group`,o.value]),role:`group`,"aria-disabled":a.disabled||void 0,"cluster-class":`s-ui-avatar-group__cluster`,"max-visible":a.maxVisible,"map-vnode":u},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)(e),1)]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`)]),_:3},8,[`class`,`aria-disabled`,`max-visible`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -1,4 +1,4 @@
1
- import { o as e, t } from "./SAvatar-BS9Lu2eL.js";
1
+ import { o as e, t } from "./SAvatar-DAfDAqrP.js";
2
2
  import { t as n } from "./SOverflowGroup-CVSon6Eg.js";
3
3
  import { cloneVNode as r, computed as i, createBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderSlot as u, toDisplayString as d, withCtx as f } from "vue";
4
4
  //#region src/components/SAvatarGroup/SAvatarGroup.types.ts
@@ -248,6 +248,10 @@ var fe = {
248
248
  listHeight: { default: 320 },
249
249
  searchPlaceholder: { default: "Search" },
250
250
  filterOption: { type: Function },
251
+ fitViewport: {
252
+ type: Boolean,
253
+ default: !0
254
+ },
251
255
  label: {},
252
256
  labelProps: {},
253
257
  placeholder: {},
@@ -436,7 +440,7 @@ var fe = {
436
440
  reference: Je.value,
437
441
  disabled: i.disabled,
438
442
  "match-reference-width": !0,
439
- "fit-viewport": !0,
443
+ "fit-viewport": i.fitViewport,
440
444
  "content-id": qe.value,
441
445
  "dismiss-on-click-outside": !0,
442
446
  "dismiss-on-escape": !0
@@ -541,6 +545,7 @@ var fe = {
541
545
  "modelValue",
542
546
  "reference",
543
547
  "disabled",
548
+ "fit-viewport",
544
549
  "content-id"
545
550
  ]), v(A(o), {
546
551
  ref_key: "triggerInputRef",
@@ -1 +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("./SInput-DYS84eMS.cjs"),i=require("./SDropdown-B6b7IDjp.cjs"),a=require("./SList-CU2Sy9Md.cjs"),o=require("./SListItem-BDkldLVt.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)}}),j=(0,s.computed)(()=>w.value.length>0),M=(e,t,n)=>{let r=h(t);return e.find(e=>h(m(e,n)??``)===r)},N=(0,s.computed)(()=>{let e=w.value[0];if(!g(e))return``;let n=(0,s.toValue)(r),i=M((0,s.toValue)(t),e,n.itemValue);return i?a.i(i,n.itemTitle)??``:h(e)}),P=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return w.value.map(t=>{let r=M(e,t,n.itemValue);return r?a.i(r,n.itemTitle)??``:h(t)})}),ne=(0,s.computed)(()=>P.value.join(`, `)),re=(0,s.computed)(()=>f.value?w.value.length===0:!N.value),F=(0,s.computed)(()=>v.value&&(u.value||f.value)),I=()=>{d.value=``};return(0,s.watch)(u,e=>{e||I()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{I()}),{searchQuery:d,selectedValues:w,filteredOptions:T,listSelectionMode:k,listSelectedModel:te,hasSelectedValues:j,singleDisplayLabel:N,multipleDisplayLabels:P,multipleDisplayText:ne,showPlaceholder:re,showInputSearchField:F,isSearchableMode:C,isSearchableInputMode:v,isSearchableContentMode:x,isMultipleMode:f,isReturnObjectMode:p,clearSelection:()=>{e.value=void 0,I()},removeSelectedValue:e=>{let n=h(e);A(w.value.filter(e=>h(e)!==n),(0,s.toValue)(t),(0,s.toValue)(r).itemValue)},resetSearchQuery:I,formatSelectListKey:h,resolveValueFromListKey:e=>y(e,(0,s.toValue)(t),(0,s.toValue)(r).itemValue)}},A={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`},j={key:1,class:`s-ui-select__placeholder`},M={key:1,class:`s-ui-select__placeholder`},N={key:2,class:`s-ui-select__value`},P={key:3,class:`s-ui-select__value-suffix`},ne=[`name`,`placeholder`,`disabled`,`readonly`],re=20,F=20,I=(0,s.defineComponent)({inheritAttrs:!1,__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},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>r.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`],[`update:modelValue`,`update:searchQuery`]),setup(n,{expose:l,emit:u}){let p=(0,s.useModel)(n,`modelValue`),m=(0,s.useModel)(n,`searchQuery`),h=u,_=(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)(),E=(0,s.ref)(!1),D=(0,s.ref)(!1),O=(0,s.computed)(()=>n.itemId??n.itemValue),I=(0,s.computed)(()=>({itemValue:n.itemValue,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemId:O.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:ie,listSelectedModel:z,hasSelectedValues:B,singleDisplayLabel:ae,multipleDisplayLabels:oe,multipleDisplayText:V,showPlaceholder:H,showInputSearchField:U,isSearchableMode:se,isSearchableInputMode:W,isSearchableContentMode:G,isMultipleMode:K,clearSelection:ce,removeSelectedValue:q,resolveValueFromListKey:le,formatSelectListKey:J}=k({modelValue:p,options:()=>n.options,itemFields:()=>I.value,multiple:()=>n.multiple,returnObject:()=>n.returnObject,searchable:()=>n.searchable,filterOption:()=>n.filterOption,isDropdownOpen:E,searchQuery:m}),ue=(0,s.computed)(()=>!!_[`value-suffix`]),de=(0,s.computed)(()=>({disabled:n.disabled,displayLabel:ae.value})),Y=(0,s.computed)(()=>R.value.length>F),fe=(0,s.computed)(()=>G.value||Y.value?n.listHeight:`auto`),pe=(0,s.computed)(()=>{if(!(G.value||Y.value))return n.listHeight}),me=(0,s.computed)(()=>L.value.map(e=>J(e))),he=e=>me.value.includes(e),ge=()=>({tiny:!0}),_e=e=>f({listItemScope:e,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemDisabled:n.itemDisabled,itemIconLeft:n.itemIconLeft,listActiveKey:T.value,isOptionSelected:he(e.key)}),ve=e=>{let t=le(e);if(g(t)){if(K.value){q(t);return}p.value=void 0}},ye=(0,s.computed)(()=>n.id??v),be=(0,s.computed)(()=>y),xe=(0,s.computed)(()=>b.value?.fieldElementRef??null),Se=(0,s.computed)(()=>({labels:oe.value,values:L.value,displayText:V.value,disabled:n.disabled||n.readonly,removeValue:q})),Ce=(0,s.computed)(()=>{if(!n.disabled&&(n.readonly&&!W.value||!W.value))return 0}),we=(0,s.computed)(()=>({"s-ui-select--disabled":n.disabled,"s-ui-select--readonly":n.readonly,"s-ui-select--multiple":K.value,"s-ui-select--open":E.value})),Te=()=>{if(G.value){C.value?.focus();return}S.value?.focus()},Ee=async()=>{await(0,s.nextTick)(),C.value?.focus()},De=async()=>{await(0,s.nextTick)(),await w.value?.focusNavigation()},X=async()=>{if(!(n.disabled||n.readonly)&&!E.value){if(E.value=!0,h(`open`),G.value){await Ee();return}if(W.value){await(0,s.nextTick)(),S.value?.focus();return}await De()}},Oe=async()=>{n.disabled||n.readonly||E.value||await X()};(0,s.watch)(m,async e=>{W.value&&(n.disabled||n.readonly||e&&(E.value||await X()))});let Z=()=>{E.value&&(E.value=!1,T.value=void 0,h(`close`))},Q=()=>{!n.closeOnSelect||K.value||Z()};(0,s.watch)(p,(e,t)=>{!n.closeOnSelect||K.value||!E.value||!e||e===t||Z()});let ke=e=>{E.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Ae=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||E.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(E.value){Z();return}await X()},je=async e=>{if(!(n.disabled||n.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){E.value||await X();return}await $()}},Me=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),E.value||await X(),await De(),await w.value?.handleKeyboardNavigation(e),!0),Ne=e=>{let t=le(e);if(t){if(K.value){L.value.some(t=>J(t)===e)?q(t):z.value=[...L.value.map(e=>J(e)),e];return}z.value=e,Q()}},Pe=async e=>{if(!(n.disabled||n.readonly)&&!await Me(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),E.value&&T.value){Ne(T.value);return}await $()}}},Fe=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await Me(e)},Ie=Fe,Le=e=>{n.disabled||(D.value||h(`focus`,e),D.value=!0)},Re=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(D.value=!1,h(`blur`,e))},ze=()=>{ce(),h(`clear`)};return l({open:X,close:Z,toggle:$,focusSearchInput:Te}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,we.value])},[(0,s.createVNode)((0,s.unref)(i.t),{modelValue:E.value,"onUpdate:modelValue":u[4]||=e=>E.value=e,reference:xe.value,disabled:n.disabled,"match-reference-width":!0,"fit-viewport":!0,"content-id":be.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:ke,onKeydown:Ae},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,ref_key:`listElementRef`,ref:w,modelValue:T.value,"onUpdate:modelValue":u[2]||=e=>T.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:(0,s.unref)(R),"item-key":O.value,"title-key":n.itemTitle,"subtitle-key":n.itemSubtitle,"icon-left-key":n.itemIconLeft,"disabled-key":n.itemDisabled,"selection-mode":(0,s.unref)(ie),mandatory:!n.multiple,height:fe.value,"max-height":pe.value,virtual:Y.value,"item-props":ge},(0,s.createSlots)({_:2},[(0,s.unref)(_).option?{name:`item`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`0`}:n.closableOptions?{name:`item`,fn:(0,s.withCtx)(n=>[(0,s.createVNode)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.guardReactiveProps)(_e(n))),(0,s.createSlots)({_:2},[he(n.key)?{name:`right`,fn:(0,s.withCtx)(r=>[(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`,disabled:r.disabled||r.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>ve(n.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`,`onClick`])]),key:`0`}:void 0]),1040)]),key:`1`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,A,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[u[8]||=(0,s.createTextVNode)(`No options`,-1)])]))],32)]),_:2},[(0,s.unref)(G)?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`panelSearchInputElementRef`,ref:C,modelValue:m.value,"onUpdate:modelValue":u[0]||=e=>m.value=e,placeholder:n.searchPlaceholder,disabled:n.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Ie)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])]),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]),1024)]),_:3},8,[`modelValue`,`reference`,`disabled`,`content-id`]),(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`triggerInputRef`,ref:b,modelValue:x.value,"onUpdate:modelValue":u[7]||=e=>x.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)(B),focused:D.value||E.value,"icon-left":n.iconLeft,customize:n.customize,name:n.name,id:ye.value,onClear:ze,onFocus:Le,onBlur:Re},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:ye.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)(B)&&!(0,s.unref)(U),"s-ui-select__control--with-value-suffix":ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)}]),role:`combobox`,"aria-expanded":E.value,"aria-controls":be.value,"aria-haspopup":`listbox`,"aria-disabled":n.disabled?!0:void 0,"aria-readonly":n.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(se)?`list`:void 0,tabindex:Ce.value,onClick:je,onKeydown:Pe},[(0,s.unref)(K)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Se.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`,j,(0,s.toDisplayString)(n.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,M,(0,s.toDisplayString)(n.placeholder),1)):(0,s.unref)(U)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,N,(0,s.toDisplayString)((0,s.unref)(ae)),1)),ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,P,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(de.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:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Oe,onKeydown:Fe},null,40,ne)),[[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:re,class:`s-ui-select__chevron`})]),_: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 b}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return I}});
1
+ const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./useSelectionGroup-TaektE-I.cjs"),r=require("./SInput-DYS84eMS.cjs"),i=require("./SDropdown-B6b7IDjp.cjs"),a=require("./SList-CU2Sy9Md.cjs"),o=require("./SListItem-BDkldLVt.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)}}),j=(0,s.computed)(()=>w.value.length>0),M=(e,t,n)=>{let r=h(t);return e.find(e=>h(m(e,n)??``)===r)},N=(0,s.computed)(()=>{let e=w.value[0];if(!g(e))return``;let n=(0,s.toValue)(r),i=M((0,s.toValue)(t),e,n.itemValue);return i?a.i(i,n.itemTitle)??``:h(e)}),P=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return w.value.map(t=>{let r=M(e,t,n.itemValue);return r?a.i(r,n.itemTitle)??``:h(t)})}),ne=(0,s.computed)(()=>P.value.join(`, `)),re=(0,s.computed)(()=>f.value?w.value.length===0:!N.value),F=(0,s.computed)(()=>v.value&&(u.value||f.value)),I=()=>{d.value=``};return(0,s.watch)(u,e=>{e||I()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{I()}),{searchQuery:d,selectedValues:w,filteredOptions:T,listSelectionMode:k,listSelectedModel:te,hasSelectedValues:j,singleDisplayLabel:N,multipleDisplayLabels:P,multipleDisplayText:ne,showPlaceholder:re,showInputSearchField:F,isSearchableMode:C,isSearchableInputMode:v,isSearchableContentMode:x,isMultipleMode:f,isReturnObjectMode:p,clearSelection:()=>{e.value=void 0,I()},removeSelectedValue:e=>{let n=h(e);A(w.value.filter(e=>h(e)!==n),(0,s.toValue)(t),(0,s.toValue)(r).itemValue)},resetSearchQuery:I,formatSelectListKey:h,resolveValueFromListKey:e=>y(e,(0,s.toValue)(t),(0,s.toValue)(r).itemValue)}},A={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`},j={key:1,class:`s-ui-select__placeholder`},M={key:1,class:`s-ui-select__placeholder`},N={key:2,class:`s-ui-select__value`},P={key:3,class:`s-ui-select__value-suffix`},ne=[`name`,`placeholder`,`disabled`,`readonly`],re=20,F=20,I=(0,s.defineComponent)({inheritAttrs:!1,__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},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>r.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`],[`update:modelValue`,`update:searchQuery`]),setup(n,{expose:l,emit:u}){let p=(0,s.useModel)(n,`modelValue`),m=(0,s.useModel)(n,`searchQuery`),h=u,_=(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)(),E=(0,s.ref)(!1),D=(0,s.ref)(!1),O=(0,s.computed)(()=>n.itemId??n.itemValue),I=(0,s.computed)(()=>({itemValue:n.itemValue,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemId:O.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:ie,listSelectedModel:z,hasSelectedValues:B,singleDisplayLabel:ae,multipleDisplayLabels:oe,multipleDisplayText:V,showPlaceholder:H,showInputSearchField:U,isSearchableMode:se,isSearchableInputMode:W,isSearchableContentMode:G,isMultipleMode:K,clearSelection:ce,removeSelectedValue:q,resolveValueFromListKey:le,formatSelectListKey:J}=k({modelValue:p,options:()=>n.options,itemFields:()=>I.value,multiple:()=>n.multiple,returnObject:()=>n.returnObject,searchable:()=>n.searchable,filterOption:()=>n.filterOption,isDropdownOpen:E,searchQuery:m}),ue=(0,s.computed)(()=>!!_[`value-suffix`]),de=(0,s.computed)(()=>({disabled:n.disabled,displayLabel:ae.value})),Y=(0,s.computed)(()=>R.value.length>F),fe=(0,s.computed)(()=>G.value||Y.value?n.listHeight:`auto`),pe=(0,s.computed)(()=>{if(!(G.value||Y.value))return n.listHeight}),me=(0,s.computed)(()=>L.value.map(e=>J(e))),he=e=>me.value.includes(e),ge=()=>({tiny:!0}),_e=e=>f({listItemScope:e,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemDisabled:n.itemDisabled,itemIconLeft:n.itemIconLeft,listActiveKey:T.value,isOptionSelected:he(e.key)}),ve=e=>{let t=le(e);if(g(t)){if(K.value){q(t);return}p.value=void 0}},ye=(0,s.computed)(()=>n.id??v),be=(0,s.computed)(()=>y),xe=(0,s.computed)(()=>b.value?.fieldElementRef??null),Se=(0,s.computed)(()=>({labels:oe.value,values:L.value,displayText:V.value,disabled:n.disabled||n.readonly,removeValue:q})),Ce=(0,s.computed)(()=>{if(!n.disabled&&(n.readonly&&!W.value||!W.value))return 0}),we=(0,s.computed)(()=>({"s-ui-select--disabled":n.disabled,"s-ui-select--readonly":n.readonly,"s-ui-select--multiple":K.value,"s-ui-select--open":E.value})),Te=()=>{if(G.value){C.value?.focus();return}S.value?.focus()},Ee=async()=>{await(0,s.nextTick)(),C.value?.focus()},De=async()=>{await(0,s.nextTick)(),await w.value?.focusNavigation()},X=async()=>{if(!(n.disabled||n.readonly)&&!E.value){if(E.value=!0,h(`open`),G.value){await Ee();return}if(W.value){await(0,s.nextTick)(),S.value?.focus();return}await De()}},Oe=async()=>{n.disabled||n.readonly||E.value||await X()};(0,s.watch)(m,async e=>{W.value&&(n.disabled||n.readonly||e&&(E.value||await X()))});let Z=()=>{E.value&&(E.value=!1,T.value=void 0,h(`close`))},Q=()=>{!n.closeOnSelect||K.value||Z()};(0,s.watch)(p,(e,t)=>{!n.closeOnSelect||K.value||!E.value||!e||e===t||Z()});let ke=e=>{E.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Ae=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||E.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(E.value){Z();return}await X()},je=async e=>{if(!(n.disabled||n.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){E.value||await X();return}await $()}},Me=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),E.value||await X(),await De(),await w.value?.handleKeyboardNavigation(e),!0),Ne=e=>{let t=le(e);if(t){if(K.value){L.value.some(t=>J(t)===e)?q(t):z.value=[...L.value.map(e=>J(e)),e];return}z.value=e,Q()}},Pe=async e=>{if(!(n.disabled||n.readonly)&&!await Me(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),E.value&&T.value){Ne(T.value);return}await $()}}},Fe=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await Me(e)},Ie=Fe,Le=e=>{n.disabled||(D.value||h(`focus`,e),D.value=!0)},Re=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(D.value=!1,h(`blur`,e))},ze=()=>{ce(),h(`clear`)};return l({open:X,close:Z,toggle:$,focusSearchInput:Te}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,we.value])},[(0,s.createVNode)((0,s.unref)(i.t),{modelValue:E.value,"onUpdate:modelValue":u[4]||=e=>E.value=e,reference:xe.value,disabled:n.disabled,"match-reference-width":!0,"fit-viewport":n.fitViewport,"content-id":be.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:ke,onKeydown:Ae},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,ref_key:`listElementRef`,ref:w,modelValue:T.value,"onUpdate:modelValue":u[2]||=e=>T.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:(0,s.unref)(R),"item-key":O.value,"title-key":n.itemTitle,"subtitle-key":n.itemSubtitle,"icon-left-key":n.itemIconLeft,"disabled-key":n.itemDisabled,"selection-mode":(0,s.unref)(ie),mandatory:!n.multiple,height:fe.value,"max-height":pe.value,virtual:Y.value,"item-props":ge},(0,s.createSlots)({_:2},[(0,s.unref)(_).option?{name:`item`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`0`}:n.closableOptions?{name:`item`,fn:(0,s.withCtx)(n=>[(0,s.createVNode)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.guardReactiveProps)(_e(n))),(0,s.createSlots)({_:2},[he(n.key)?{name:`right`,fn:(0,s.withCtx)(r=>[(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`,disabled:r.disabled||r.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>ve(n.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`,`onClick`])]),key:`0`}:void 0]),1040)]),key:`1`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,A,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[u[8]||=(0,s.createTextVNode)(`No options`,-1)])]))],32)]),_:2},[(0,s.unref)(G)?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`panelSearchInputElementRef`,ref:C,modelValue:m.value,"onUpdate:modelValue":u[0]||=e=>m.value=e,placeholder:n.searchPlaceholder,disabled:n.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Ie)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])]),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]),1024)]),_:3},8,[`modelValue`,`reference`,`disabled`,`fit-viewport`,`content-id`]),(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`triggerInputRef`,ref:b,modelValue:x.value,"onUpdate:modelValue":u[7]||=e=>x.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)(B),focused:D.value||E.value,"icon-left":n.iconLeft,customize:n.customize,name:n.name,id:ye.value,onClear:ze,onFocus:Le,onBlur:Re},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:ye.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)(B)&&!(0,s.unref)(U),"s-ui-select__control--with-value-suffix":ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)}]),role:`combobox`,"aria-expanded":E.value,"aria-controls":be.value,"aria-haspopup":`listbox`,"aria-disabled":n.disabled?!0:void 0,"aria-readonly":n.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(se)?`list`:void 0,tabindex:Ce.value,onClick:je,onKeydown:Pe},[(0,s.unref)(K)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Se.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`,j,(0,s.toDisplayString)(n.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,M,(0,s.toDisplayString)(n.placeholder),1)):(0,s.unref)(U)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,N,(0,s.toDisplayString)((0,s.unref)(ae)),1)),ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,P,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(de.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:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Oe,onKeydown:Fe},null,40,ne)),[[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:re,class:`s-ui-select__chevron`})]),_: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 b}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return I}});
@@ -0,0 +1 @@
1
+ const e=require("./contrastSurfaceTextColor-Ybh-FZof.cjs"),t=require("./SButton.types-UKroD-ev.cjs"),n=require("./SButton-C-z_q5CG.cjs"),r=require("./useLink-1LLWpdDZ.cjs");let i=require("vue");var a=function(e){return e.RED_ORANGE=`red-orange`,e.ORANGE=`orange`,e.YELLOW=`yellow`,e.GREEN=`green`,e.TEAL=`teal`,e.CYAN=`cyan`,e.BLUE=`blue`,e.INDIGO=`indigo`,e.VIOLET=`violet`,e.MAGENTA=`magenta`,e.PINK=`pink`,e.GRAY=`gray`,e.RED=`red`,e.WHITE_BORDER=`white-border`,e.BILLING=`billing`,e.BILLING_LIGHT=`billing-light`,e}({}),o=function(e){return e.SMALL=`small`,e.MEDIUM=`medium`,e}({}),s=t=>e.n(t)||t.startsWith(`var(--`),c=e=>s(e)?`s-ui-tag--color-custom`:`s-ui-tag--color-${e}`,l=t=>{let n={"--s-ui-tag-bg":t};return e.n(t)&&(n[`--s-ui-tag-text`]=e.t(t)),n},u={class:`s-ui-tag__content s-ui-typography-body-12-regular`},d={key:0,class:`s-ui-tag__actions`},f={class:`s-ui-tag__action-close`},p=(0,i.defineComponent)({inheritAttrs:!1,__name:`STag`,props:(0,i.mergeModels)({color:{default:()=>a.RED_ORANGE},size:{default:()=>o.MEDIUM},short:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},link:{},exact:{type:Boolean,default:!1},replace:{type:Boolean,default:!1}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,i.mergeModels)([`close`],[`update:modelValue`]),setup(e,{emit:a}){let o=(0,i.useAttrs)(),p=(0,i.useModel)(e,`modelValue`),m=a,h=r.t(()=>e.link,()=>e.exact,()=>e.replace),g=h.linkPresentation,_=(0,i.computed)(()=>{let e=g.value;return e.mode===`none`?`span`:e.rootTag}),v=(0,i.computed)(()=>r.n(g.value,{replace:e.replace})),y=(0,i.computed)(()=>({...v.value,...o})),b=(0,i.computed)(()=>h.isRouterLink.value?h.isActive.value:e.selected),x=(0,i.computed)(()=>e.closable&&!e.short),S=(0,i.computed)(()=>{if(e.disabled)return-1;if(!r.r(e.link))return x.value?0:-1}),C=(0,i.computed)(()=>[c(e.color),`s-ui-tag--size-${e.size}`,{"s-ui-tag--short":e.short,"s-ui-tag--disabled":e.disabled,"s-ui-tag--selected":b.value,"s-ui-tag--link":r.r(e.link)}]),w=(0,i.computed)(()=>{if(s(e.color))return l(e.color)}),T=(0,i.computed)(()=>e.short?p.value.slice(0,1):p.value),E=()=>{m(`close`)},D=[`Enter`,` `,`Spacebar`],O=[`Delete`,`Backspace`],k=t=>{if(!e.disabled){if(h.isRouterLink.value&&D.includes(t.key)){t.preventDefault(),h.navigate();return}if(t.target===t.currentTarget&&O.includes(t.key)){if(!x.value)return;t.preventDefault(),m(`close`)}}};return(r,a)=>((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(_.value),(0,i.mergeProps)({class:[`s-ui-tag`,C.value],style:w.value,tabindex:S.value,"aria-disabled":e.disabled?!0:void 0},y.value,{onKeydown:k}),{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`span`,u,(0,i.toDisplayString)(T.value),1),x.value?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,d,[(0,i.createElementVNode)(`span`,f,[(0,i.createVNode)((0,i.unref)(n.t),{appearance:(0,i.unref)(t.t).BARE,variant:(0,i.unref)(t.r).NEUTRAL,size:(0,i.unref)(t.n).SMALL,disabled:e.disabled,tabindex:-1,icon:`closeMini`,onClick:(0,i.withModifiers)(E,[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`])])])):(0,i.createCommentVNode)(``,!0)]),_:1},16,[`class`,`style`,`tabindex`,`aria-disabled`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -0,0 +1,122 @@
1
+ import { n as e, t } from "./contrastSurfaceTextColor-Dl641cZ_.js";
2
+ import { n, r, t as i } from "./SButton.types-CpdHQtyx.js";
3
+ import { t as a } from "./SButton-DnU_XZ1C.js";
4
+ import { n as o, r as s, t as c } from "./useLink-Com5VhOk.js";
5
+ import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as _, openBlock as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useAttrs as S, useModel as C, withCtx as w, withModifiers as T } from "vue";
6
+ //#region src/components/STag/STag.types.ts
7
+ var E = /* @__PURE__ */ function(e) {
8
+ return e.RED_ORANGE = "red-orange", e.ORANGE = "orange", e.YELLOW = "yellow", e.GREEN = "green", e.TEAL = "teal", e.CYAN = "cyan", e.BLUE = "blue", e.INDIGO = "indigo", e.VIOLET = "violet", e.MAGENTA = "magenta", e.PINK = "pink", e.GRAY = "gray", e.RED = "red", e.WHITE_BORDER = "white-border", e.BILLING = "billing", e.BILLING_LIGHT = "billing-light", e;
9
+ }({}), D = /* @__PURE__ */ function(e) {
10
+ return e.SMALL = "small", e.MEDIUM = "medium", e;
11
+ }({}), O = (t) => e(t) || t.startsWith("var(--"), k = (e) => O(e) ? "s-ui-tag--color-custom" : `s-ui-tag--color-${e}`, A = (n) => {
12
+ let r = { "--s-ui-tag-bg": n };
13
+ return e(n) && (r["--s-ui-tag-text"] = t(n)), r;
14
+ }, j = { class: "s-ui-tag__content s-ui-typography-body-12-regular" }, M = {
15
+ key: 0,
16
+ class: "s-ui-tag__actions"
17
+ }, N = { class: "s-ui-tag__action-close" }, P = /* @__PURE__ */ h({
18
+ inheritAttrs: !1,
19
+ __name: "STag",
20
+ props: /*@__PURE__*/ g({
21
+ color: { default: () => E.RED_ORANGE },
22
+ size: { default: () => D.MEDIUM },
23
+ short: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ closable: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ disabled: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ selected: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ link: {},
40
+ exact: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ replace: {
45
+ type: Boolean,
46
+ default: !1
47
+ }
48
+ }, {
49
+ modelValue: { default: "" },
50
+ modelModifiers: {}
51
+ }),
52
+ emits: /*@__PURE__*/ g(["close"], ["update:modelValue"]),
53
+ setup(e, { emit: t }) {
54
+ let h = S(), g = C(e, "modelValue"), E = t, D = c(() => e.link, () => e.exact, () => e.replace), P = D.linkPresentation, F = l(() => {
55
+ let e = P.value;
56
+ return e.mode === "none" ? "span" : e.rootTag;
57
+ }), I = l(() => o(P.value, { replace: e.replace })), L = l(() => ({
58
+ ...I.value,
59
+ ...h
60
+ })), R = l(() => D.isRouterLink.value ? D.isActive.value : e.selected), z = l(() => e.closable && !e.short), B = l(() => {
61
+ if (e.disabled) return -1;
62
+ if (!s(e.link)) return z.value ? 0 : -1;
63
+ }), V = l(() => [
64
+ k(e.color),
65
+ `s-ui-tag--size-${e.size}`,
66
+ {
67
+ "s-ui-tag--short": e.short,
68
+ "s-ui-tag--disabled": e.disabled,
69
+ "s-ui-tag--selected": R.value,
70
+ "s-ui-tag--link": s(e.link)
71
+ }
72
+ ]), H = l(() => {
73
+ if (O(e.color)) return A(e.color);
74
+ }), U = l(() => e.short ? g.value.slice(0, 1) : g.value), W = () => {
75
+ E("close");
76
+ }, G = [
77
+ "Enter",
78
+ " ",
79
+ "Spacebar"
80
+ ], K = ["Delete", "Backspace"], q = (t) => {
81
+ if (!e.disabled) {
82
+ if (D.isRouterLink.value && G.includes(t.key)) {
83
+ t.preventDefault(), D.navigate();
84
+ return;
85
+ }
86
+ if (t.target === t.currentTarget && K.includes(t.key)) {
87
+ if (!z.value) return;
88
+ t.preventDefault(), E("close");
89
+ }
90
+ }
91
+ };
92
+ return (t, o) => (v(), u(y(F.value), _({
93
+ class: ["s-ui-tag", V.value],
94
+ style: H.value,
95
+ tabindex: B.value,
96
+ "aria-disabled": e.disabled ? !0 : void 0
97
+ }, L.value, { onKeydown: q }), {
98
+ default: w(() => [p("span", j, b(U.value), 1), z.value ? (v(), f("span", M, [p("span", N, [m(x(a), {
99
+ appearance: x(i).BARE,
100
+ variant: x(r).NEUTRAL,
101
+ size: x(n).SMALL,
102
+ disabled: e.disabled,
103
+ tabindex: -1,
104
+ icon: "closeMini",
105
+ onClick: T(W, ["stop"])
106
+ }, null, 8, [
107
+ "appearance",
108
+ "variant",
109
+ "size",
110
+ "disabled"
111
+ ])])])) : d("", !0)]),
112
+ _: 1
113
+ }, 16, [
114
+ "class",
115
+ "style",
116
+ "tabindex",
117
+ "aria-disabled"
118
+ ]));
119
+ }
120
+ });
121
+ //#endregion
122
+ export { E as n, D as r, P as t };
@@ -1 +1 @@
1
- const e=require("./SOverflowGroup-DyVUzkNu.cjs"),t=require("./STag-DVrSWByQ.cjs");let n=require("vue");var r=(e,{size:r,short:i})=>e.type===t.t?(0,n.cloneVNode)(e,{size:r,short:i,...i?{closable:!1}:{}}):e,i=(0,n.defineComponent)({__name:`STagGroup`,props:{maxVisible:{},size:{default:()=>t.r.SMALL},short:{type:Boolean,default:!0}},setup(i){let a=e=>r(e,{size:i.size,short:i.short});return(r,o)=>((0,n.openBlock)(),(0,n.createBlock)(e.t,{class:`s-ui-tag-group`,role:`group`,"cluster-class":`s-ui-tag-group__cluster`,"max-visible":i.maxVisible,"map-vnode":a},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createVNode)((0,n.unref)(t.t),{color:(0,n.unref)(t.n).WHITE_BORDER,size:i.size,short:!1,"model-value":e},null,8,[`color`,`size`,`model-value`])]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(r.$slots,`default`)]),_:3},8,[`max-visible`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
1
+ const e=require("./SOverflowGroup-DyVUzkNu.cjs"),t=require("./STag-BwzuI3cF.cjs");let n=require("vue");var r=(e,{size:r,short:i})=>e.type===t.t?(0,n.cloneVNode)(e,{size:r,short:i,...i?{closable:!1}:{}}):e,i=(0,n.defineComponent)({__name:`STagGroup`,props:{maxVisible:{},size:{default:()=>t.r.SMALL},short:{type:Boolean,default:!0}},setup(i){let a=e=>r(e,{size:i.size,short:i.short});return(r,o)=>((0,n.openBlock)(),(0,n.createBlock)(e.t,{class:`s-ui-tag-group`,role:`group`,"cluster-class":`s-ui-tag-group__cluster`,"max-visible":i.maxVisible,"map-vnode":a},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createVNode)((0,n.unref)(t.t),{color:(0,n.unref)(t.n).WHITE_BORDER,size:i.size,short:!1,"model-value":e},null,8,[`color`,`size`,`model-value`])]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(r.$slots,`default`)]),_:3},8,[`max-visible`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./SOverflowGroup-CVSon6Eg.js";
2
- import { n as t, r as n, t as r } from "./STag-CYoj7L-p.js";
2
+ import { n as t, r as n, t as r } from "./STag-L6B4DxOx.js";
3
3
  import { cloneVNode as i, createBlock as a, createVNode as o, defineComponent as s, openBlock as c, renderSlot as l, unref as u, withCtx as d } from "vue";
4
4
  //#region src/components/STagGroup/utils/applyTagGroupItemProps.ts
5
5
  var f = (e, { size: t, short: n }) => e.type === r ? i(e, {
@@ -1 +1 @@
1
- {"version":3,"file":"SAvatar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SAvatar/SAvatar.vue"],"names":[],"mappings":"AAqPA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAA;AAsSxB,QAAA,MAAM,YAAY,sSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SAvatar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SAvatar/SAvatar.vue"],"names":[],"mappings":"AA6OA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAA;AA8RxB,QAAA,MAAM,YAAY,sSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,4 @@
1
+ import { type TSAvatarColorValue } from '../SAvatar.types';
2
+ export declare const resolveAvatarBackgroundHex: (color: TSAvatarColorValue) => `#${string}` | undefined;
3
+ export declare const getAvatarInitialsTextColor: (color: TSAvatarColorValue) => "var(--s-ui-color-text-surface-primary)" | "var(--s-ui-color-text-surface-static)" | undefined;
4
+ //# sourceMappingURL=getAvatarInitialsTextColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAvatarInitialsTextColor.d.ts","sourceRoot":"","sources":["../../../../src/components/SAvatar/utils/getAvatarInitialsTextColor.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,kBAAkB,EAAyB,MAAM,kBAAkB,CAAA;AAahG,eAAO,MAAM,0BAA0B,GAAI,OAAO,kBAAkB,6BAUnE,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,OAAO,kBAAkB,mGAQnE,CAAA"}
@@ -1,7 +1,5 @@
1
1
  import { type TSAvatarColorValue, type TSAvatarHexColor } from '../SAvatar.types';
2
2
  export declare const isAvatarHexColor: (color: TSAvatarColorValue) => color is TSAvatarHexColor;
3
3
  export declare const getAvatarColorClass: (color: TSAvatarColorValue) => string;
4
- export declare const getAvatarCustomColorStyle: (color: TSAvatarHexColor) => {
5
- '--s-ui-avatar-background': `#${string}`;
6
- };
4
+ export declare const getAvatarColorStyle: (color: TSAvatarColorValue) => Record<string, string> | undefined;
7
5
  //# sourceMappingURL=resolveAvatarColor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveAvatarColor.d.ts","sourceRoot":"","sources":["../../../../src/components/SAvatar/utils/resolveAvatarColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEjF,eAAO,MAAM,gBAAgB,GAAI,OAAO,kBAAkB,KAAG,KAAK,IAAI,gBAErE,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,kBAAkB,WAM5D,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,gBAAgB;;CAIhE,CAAA"}
1
+ {"version":3,"file":"resolveAvatarColor.d.ts","sourceRoot":"","sources":["../../../../src/components/SAvatar/utils/resolveAvatarColor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAGjF,eAAO,MAAM,gBAAgB,GAAI,OAAO,kBAAkB,KAAG,KAAK,IAAI,gBAErE,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,kBAAkB,WAM5D,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,kBAAkB,uCAiB5D,CAAA"}
@@ -107,6 +107,11 @@ export interface ISSelectProps<TItem extends Record<string, unknown> = ISSelectO
107
107
  searchPlaceholder?: string;
108
108
  /** Пользовательский предикат фильтрации опций. */
109
109
  filterOption?: (query: string, item: TItem) => boolean;
110
+ /**
111
+ * Ограничивать панель пересечением overflow-предков reference.
112
+ * Отключите (`false`) внутри контейнеров с `overflow: hidden`, если панель не появляется.
113
+ */
114
+ fitViewport?: boolean;
110
115
  }
111
116
  export type TSSelectExposed = {
112
117
  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;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB;AAED,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAA;AAE3C,0EAA0E;AAC1E,MAAM,MAAM,2BAA2B,CAAC,MAAM,SAAS,aAAa,GAAG,MAAM,IACzE,MAAM,GACN,MAAM,EAAE,GACR,SAAS,CAAA;AAEb;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAC5B,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,MAAM,SAAS,aAAa,GAAG,MAAM,EACrC,aAAa,SAAS,OAAO,GAAG,KAAK,IACnC,aAAa,SAAS,IAAI,GAAG,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