@shtabapp/ui-kit 1.58.0 → 1.59.1
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/SChip-BL47yJ-i.cjs +1 -0
- package/dist/SChip-XCYvlpaS.js +102 -0
- package/dist/SSegmentControl-Dh_HmD4Z.cjs +1 -0
- package/dist/SSegmentControl-hAAYltQR.js +202 -0
- package/dist/STabs-BUafXb2Q.js +150 -0
- package/dist/STabs-h8sm-3do.cjs +1 -0
- package/dist/components/SChip/SChip.types.d.ts +4 -0
- package/dist/components/SChip/SChip.types.d.ts.map +1 -1
- package/dist/components/SChip/SChip.vue.d.ts +6 -2
- package/dist/components/SChip/SChip.vue.d.ts.map +1 -1
- package/dist/components/SSegmentControl/utils/useSegmentIndicator.d.ts.map +1 -1
- package/dist/components/STabs/utils/useTabsIndicator.d.ts +1 -1
- package/dist/components/STabs/utils/useTabsIndicator.d.ts.map +1 -1
- package/dist/entries/chip.cjs +1 -1
- package/dist/entries/chip.js +1 -1
- package/dist/entries/segment-control.cjs +1 -1
- package/dist/entries/segment-control.js +1 -1
- package/dist/entries/tabs.cjs +1 -1
- package/dist/entries/tabs.js +1 -1
- package/dist/getIndicatorMetricsPercent-CFGy_nB8.cjs +1 -0
- package/dist/getIndicatorMetricsPercent-CWrH_ONg.js +19 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/uikit-components.css +1 -1
- package/dist/utils/getIndicatorMetricsPercent.d.ts +22 -0
- package/dist/utils/getIndicatorMetricsPercent.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/SChip-DRz5BA4Z.cjs +0 -1
- package/dist/SChip-DvPazz7Y.js +0 -67
- package/dist/SSegmentControl-CmJEjfSR.js +0 -212
- package/dist/SSegmentControl-Dz-d3Y9v.cjs +0 -1
- package/dist/STabs-CTM8Nji_.js +0 -164
- package/dist/STabs-DeHqnjNJ.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@shtabapp/ui-kit-v1.59.1](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.59.0...@shtabapp/ui-kit@1.59.1) (2026-08-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **components:** measure indicator in percent of the track ([fd78dbd](https://gitlab.com/mstikharev/shtab-ui-kit/commit/fd78dbd79446e5a5275b46e47fb709be759409bf))
|
|
6
|
+
|
|
7
|
+
## [@shtabapp/ui-kit-v1.59.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.58.0...@shtabapp/ui-kit@1.59.0) (2026-07-30)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **components:** schip deletable and selected ([332115e](https://gitlab.com/mstikharev/shtab-ui-kit/commit/332115e81105a4ce88874c447c3eed8cc30b62e2))
|
|
12
|
+
|
|
1
13
|
## [@shtabapp/ui-kit-v1.58.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.57.0...@shtabapp/ui-kit@1.58.0) (2026-07-30)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs");let n=require("vue"),r=require("@shtabapp/ui-kit-primitives");var i=function(e){return e.BLUE=`blue`,e.RED=`red`,e.WHITE=`white`,e.BILLING=`billing`,e}({}),a=function(e){return e.SIZE_20=`20`,e.SIZE_24=`24`,e.SIZE_32=`32`,e}({}),o=[`tabindex`,`aria-disabled`,`inert`],s={class:`s-ui-chip__content`},c={key:0,class:`s-ui-chip__icon`},l={key:1,class:`s-ui-chip__prefix`},u={key:0,class:`s-ui-chip__actions`},d={key:0,class:`s-ui-chip__action-delete`},f=(0,n.defineComponent)({__name:`SChip`,props:{color:{default:()=>i.BLUE},disabled:{type:Boolean,default:!1},size:{default:()=>a.SIZE_32},deletable:{type:Boolean,default:!1},selected:{type:Boolean,default:!1}},emits:[`delete`],setup(f,{emit:p}){let m=p,{t:h}=(0,r.useUiKitI18n)(),g=(0,n.useSlots)(),_=(0,n.computed)(()=>f.color===i.BILLING),v=(0,n.computed)(()=>f.disabled?!1:_.value),y=(0,n.computed)(()=>f.disabled?-1:0),b=(0,n.computed)(()=>!!g.actions||f.deletable),x=()=>{m(`delete`)},S=(0,n.computed)(()=>[`s-ui-chip--color-${f.color}`,`s-ui-chip--size-${f.size}`,{"s-ui-chip--disabled":f.disabled,"s-ui-chip--selected":f.selected}]),C=(0,n.computed)(()=>f.size===a.SIZE_20?`s-ui-typography-label-12-medium`:`s-ui-typography-label-14-medium`),w={[a.SIZE_20]:16,[a.SIZE_24]:20,[a.SIZE_32]:20},T=(0,n.computed)(()=>w[f.size]);return(r,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{class:(0,n.normalizeClass)([`s-ui-chip`,S.value]),tabindex:y.value,role:`group`,"aria-disabled":f.disabled?!0:void 0,inert:f.disabled?!0:void 0},[(0,n.createElementVNode)(`span`,s,[(0,n.unref)(g).icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,c,[(0,n.renderSlot)(r.$slots,`icon`,{billing:v.value,disabled:f.disabled,size:T.value})])):(0,n.createCommentVNode)(``,!0),(0,n.unref)(g).prefix?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,l,[(0,n.renderSlot)(r.$slots,`prefix`,{disabled:f.disabled,size:f.size})])):(0,n.createCommentVNode)(``,!0),(0,n.unref)(g).default?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:2,class:(0,n.normalizeClass)([`s-ui-chip__label`,C.value])},[(0,n.renderSlot)(r.$slots,`default`)],2)):(0,n.createCommentVNode)(``,!0)]),b.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,u,[(0,n.renderSlot)(r.$slots,`actions`,{billing:_.value,disabled:f.disabled}),f.deletable?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,d,[(0,n.createVNode)((0,n.unref)(t.t),{appearance:(0,n.unref)(e.t).BARE,variant:(0,n.unref)(e.r).NEUTRAL,size:(0,n.unref)(e.n).SMALL,disabled:f.disabled,tabindex:-1,icon:`closeMini`,"aria-label":(0,n.unref)(h)(`chip.delete`),onClick:(0,n.withModifiers)(x,[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`,`aria-label`])])):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0)],10,o))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
+
import { t as r } from "./SButton-DnU_XZ1C.js";
|
|
3
|
+
import { computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, renderSlot as f, unref as p, useSlots as m, withModifiers as h } from "vue";
|
|
4
|
+
import { useUiKitI18n as g } from "@shtabapp/ui-kit-primitives";
|
|
5
|
+
//#region src/components/SChip/SChip.types.ts
|
|
6
|
+
var _ = /* @__PURE__ */ function(e) {
|
|
7
|
+
return e.BLUE = "blue", e.RED = "red", e.WHITE = "white", e.BILLING = "billing", e;
|
|
8
|
+
}({}), v = /* @__PURE__ */ function(e) {
|
|
9
|
+
return e.SIZE_20 = "20", e.SIZE_24 = "24", e.SIZE_32 = "32", e;
|
|
10
|
+
}({}), y = [
|
|
11
|
+
"tabindex",
|
|
12
|
+
"aria-disabled",
|
|
13
|
+
"inert"
|
|
14
|
+
], b = { class: "s-ui-chip__content" }, x = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "s-ui-chip__icon"
|
|
17
|
+
}, S = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "s-ui-chip__prefix"
|
|
20
|
+
}, C = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "s-ui-chip__actions"
|
|
23
|
+
}, w = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "s-ui-chip__action-delete"
|
|
26
|
+
}, T = /* @__PURE__ */ l({
|
|
27
|
+
__name: "SChip",
|
|
28
|
+
props: {
|
|
29
|
+
color: { default: () => _.BLUE },
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
size: { default: () => v.SIZE_32 },
|
|
35
|
+
deletable: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
selected: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
emits: ["delete"],
|
|
45
|
+
setup(l, { emit: T }) {
|
|
46
|
+
let E = T, { t: D } = g(), O = m(), k = i(() => l.color === _.BILLING), A = i(() => l.disabled ? !1 : k.value), j = i(() => l.disabled ? -1 : 0), M = i(() => !!O.actions || l.deletable), N = () => {
|
|
47
|
+
E("delete");
|
|
48
|
+
}, P = i(() => [
|
|
49
|
+
`s-ui-chip--color-${l.color}`,
|
|
50
|
+
`s-ui-chip--size-${l.size}`,
|
|
51
|
+
{
|
|
52
|
+
"s-ui-chip--disabled": l.disabled,
|
|
53
|
+
"s-ui-chip--selected": l.selected
|
|
54
|
+
}
|
|
55
|
+
]), F = i(() => l.size === v.SIZE_20 ? "s-ui-typography-label-12-medium" : "s-ui-typography-label-14-medium"), I = {
|
|
56
|
+
[v.SIZE_20]: 16,
|
|
57
|
+
[v.SIZE_24]: 20,
|
|
58
|
+
[v.SIZE_32]: 20
|
|
59
|
+
}, L = i(() => I[l.size]);
|
|
60
|
+
return (i, m) => (d(), o("span", {
|
|
61
|
+
class: u(["s-ui-chip", P.value]),
|
|
62
|
+
tabindex: j.value,
|
|
63
|
+
role: "group",
|
|
64
|
+
"aria-disabled": l.disabled ? !0 : void 0,
|
|
65
|
+
inert: l.disabled ? !0 : void 0
|
|
66
|
+
}, [s("span", b, [
|
|
67
|
+
p(O).icon ? (d(), o("span", x, [f(i.$slots, "icon", {
|
|
68
|
+
billing: A.value,
|
|
69
|
+
disabled: l.disabled,
|
|
70
|
+
size: L.value
|
|
71
|
+
})])) : a("", !0),
|
|
72
|
+
p(O).prefix ? (d(), o("span", S, [f(i.$slots, "prefix", {
|
|
73
|
+
disabled: l.disabled,
|
|
74
|
+
size: l.size
|
|
75
|
+
})])) : a("", !0),
|
|
76
|
+
p(O).default ? (d(), o("span", {
|
|
77
|
+
key: 2,
|
|
78
|
+
class: u(["s-ui-chip__label", F.value])
|
|
79
|
+
}, [f(i.$slots, "default")], 2)) : a("", !0)
|
|
80
|
+
]), M.value ? (d(), o("span", C, [f(i.$slots, "actions", {
|
|
81
|
+
billing: k.value,
|
|
82
|
+
disabled: l.disabled
|
|
83
|
+
}), l.deletable ? (d(), o("span", w, [c(p(r), {
|
|
84
|
+
appearance: p(n).BARE,
|
|
85
|
+
variant: p(t).NEUTRAL,
|
|
86
|
+
size: p(e).SMALL,
|
|
87
|
+
disabled: l.disabled,
|
|
88
|
+
tabindex: -1,
|
|
89
|
+
icon: "closeMini",
|
|
90
|
+
"aria-label": p(D)("chip.delete"),
|
|
91
|
+
onClick: h(N, ["stop"])
|
|
92
|
+
}, null, 8, [
|
|
93
|
+
"appearance",
|
|
94
|
+
"variant",
|
|
95
|
+
"size",
|
|
96
|
+
"disabled",
|
|
97
|
+
"aria-label"
|
|
98
|
+
])])) : a("", !0)])) : a("", !0)], 10, y));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
export { _ as n, v as r, T as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./useSelectionGroup-TaektE-I.cjs"),n=require("./useSelectLink-DDdMmsJB.cjs"),r=require("./useLink-1LLWpdDZ.cjs"),i=require("./getIndicatorMetricsPercent-CFGy_nB8.cjs");let a=require("vue"),o=require("@shtabapp/ui-kit-primitives"),s=require("@vueuse/core");var c=Symbol(`SSegmentControl`),l={key:0,class:`s-ui-segment-control__icon`,"aria-hidden":`true`},u=(0,a.defineComponent)({__name:`SSegmentControlItem`,props:{item:{}},setup(t){let i=(0,a.inject)(c,null),s={[e.n.SMALL]:`s-ui-typography-label-12-medium`,[e.n.MEDIUM]:`s-ui-typography-label-14-medium`,[e.n.LARGE]:`s-ui-typography-label-16-medium`},u={[e.n.SMALL]:16,[e.n.MEDIUM]:20,[e.n.LARGE]:24},d=(0,a.computed)(()=>i?(0,a.toValue)(i.size):e.n.MEDIUM),f=(0,a.computed)(()=>s[d.value]),p=(0,a.computed)(()=>u[d.value]),m=(0,a.useTemplateRef)(`itemRootRef`),h=r.t(()=>t.item.link,()=>t.item.exact,()=>t.item.replace);n.t({isRouterLink:h.isRouterLink,isActive:h.isActive,group:()=>i,value:()=>t.item.value});let g=(0,a.computed)(()=>!!(i&&(0,a.toValue)(i.disabled))||!!t.item.disabled),_=n.n({group:()=>i,value:()=>t.item.value,el:m,disabled:g}),v=(0,a.computed)(()=>h.isRouterLink.value?h.isActive.value:_.isActive.value),y=h.linkPresentation,b=(0,a.computed)(()=>{let e=y.value;return e.mode===`none`?`button`:e.rootTag}),x=(0,a.computed)(()=>b.value===`button`),S=(0,a.computed)(()=>{if(i)return(0,a.toValue)(i.name)}),C=(0,a.computed)(()=>({"s-ui-segment-control__item--selected":v.value,"s-ui-segment-control__item--icon-only":!!t.item.iconOnly,"s-ui-segment-control__item--link":r.r(t.item.link)})),w=(0,a.computed)(()=>({...r.n(y.value,{replace:t.item.replace}),disabled:x.value&&g.value?!0:void 0,"aria-disabled":!x.value&&g.value?!0:void 0})),T=(0,a.computed)(()=>g.value?-1:_.tabIndex.value??-1),E=e=>{if(!g.value){if(h.isRouterLink.value&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),h.navigate();return}_.handleKeydown(e)}},D=e=>{if(g.value){e.preventDefault(),e.stopPropagation();return}h.isRouterLink.value||_.handleClick()};return(e,n)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(b.value),(0,a.mergeProps)({ref_key:`itemRootRef`,ref:m,role:`radio`,class:[`s-ui-segment-control__item`,C.value],type:x.value?`button`:void 0},w.value,{"aria-checked":v.value?`true`:`false`,tabindex:T.value,name:x.value?S.value:void 0,onClick:D,onKeydown:E}),{default:(0,a.withCtx)(()=>[t.item.icon?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,l,[(0,a.createVNode)((0,a.unref)(o.SIcon),{name:t.item.icon,size:p.value},null,8,[`name`,`size`])])):(0,a.createCommentVNode)(``,!0),t.item.label&&!t.item.iconOnly?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:1,class:(0,a.normalizeClass)([`s-ui-segment-control__label`,f.value])},(0,a.toDisplayString)(t.item.label),3)):(0,a.createCommentVNode)(``,!0)]),_:1},16,[`class`,`type`,`aria-checked`,`tabindex`,`name`]))}}),d=`.s-ui-segment-control__item`,f=({trackEl:e,activeIndex:t,itemCount:n})=>{let r=(0,a.ref)(i.t()),o=()=>{let n=(0,a.toValue)(e),o=(0,a.toValue)(t);if(!n||o<0){r.value=i.t();return}let s=n.querySelectorAll(d).item(o);if(!(s instanceof HTMLElement)){r.value=i.t();return}r.value=i.n(n,s)};return(0,s.useResizeObserver)(e,()=>{o()}),(0,a.watch)(()=>[(0,a.toValue)(t),(0,a.toValue)(n)],async()=>{await(0,a.nextTick)(),o()},{immediate:!0}),{indicatorStyle:(0,a.computed)(()=>{let{left:e,top:t,width:n,height:i}=r.value;return!n||!i?{opacity:`0`}:{opacity:`1`,left:`${e}%`,top:`${t}%`,width:`${n}%`,height:`${i}%`}}),updateMetrics:o}},p=[`aria-disabled`],m=(0,a.defineComponent)({__name:`SSegmentControl`,props:(0,a.mergeModels)({items:{},size:{default:()=>e.n.MEDIUM},disabled:{type:Boolean,default:!1},mandatory:{type:Boolean,default:!0},name:{}},{modelValue:{},modelModifiers:{}}),emits:(0,a.mergeModels)([`change`],[`update:modelValue`]),setup(e,{emit:n}){let r=(0,a.useModel)(e,`modelValue`),i=n,o=(0,a.useTemplateRef)(`trackRef`),s=t.o({modelValue:()=>r.value,onUpdateModelValue:e=>{t.i(e)&&(r.value=e,i(`change`,e))},mode:t.n.SINGLE,mandatory:()=>e.mandatory,orientation:t.r.HORIZONTAL,loop:!0});(0,a.provide)(c,{mode:()=>t.n.SINGLE,isSelected:s.isSelected,selectItem:s.select,registerItem:s.registerItem,getItemTabIndex:s.getItemTabIndex,getGroupTabIndex:s.getGroupTabIndex,handleItemKeydown:s.handleItemKeydown,disabled:()=>e.disabled,name:()=>e.name,size:()=>e.size});let{indicatorStyle:l}=f({trackEl:()=>o.value,activeIndex:(0,a.computed)(()=>{let t=e.items.findIndex(e=>s.isSelected(e.value));return t>=0?t:0}),itemCount:()=>e.items.length}),d=(0,a.computed)(()=>({[`s-ui-segment-control--size-${e.size}`]:!0,"s-ui-segment-control--disabled":e.disabled})),m=(e,t)=>`${String(e.value)}-${t}`,h=()=>{if(r.value!==void 0&&r.value!==null)return;let t=e.items.find(e=>!e.disabled);t&&(r.value=t.value)};return(0,a.watch)(()=>e.items,()=>{h()},{immediate:!0}),(t,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,(0,a.mergeProps)({ref_key:`trackRef`,ref:o,class:[`s-ui-segment-control`,d.value],role:`radiogroup`,"aria-disabled":e.disabled||void 0},t.$attrs),[(0,a.createElementVNode)(`span`,{class:`s-ui-segment-control__indicator`,style:(0,a.normalizeStyle)((0,a.unref)(l)),"aria-hidden":`true`},null,4),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(e.items,(e,t)=>((0,a.openBlock)(),(0,a.createBlock)(u,{key:m(e,t),item:e},null,8,[`item`]))),128))],16,p))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { n as e } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
+
import { i as t, n, o as r, r as i } from "./useSelectionGroup-cKj38lEN.js";
|
|
3
|
+
import { n as a, t as o } from "./useSelectLink-DClG5hGA.js";
|
|
4
|
+
import { n as s, r as c, t as l } from "./useLink-Com5VhOk.js";
|
|
5
|
+
import { n as u, t as d } from "./getIndicatorMetricsPercent-CWrH_ONg.js";
|
|
6
|
+
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createVNode as v, defineComponent as y, inject as b, mergeModels as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeStyle as T, openBlock as E, provide as D, ref as O, renderList as k, resolveDynamicComponent as A, toDisplayString as j, toValue as M, unref as N, useModel as P, useTemplateRef as F, watch as I, withCtx as L } from "vue";
|
|
7
|
+
import { SIcon as R } from "@shtabapp/ui-kit-primitives";
|
|
8
|
+
import { useResizeObserver as z } from "@vueuse/core";
|
|
9
|
+
//#region src/components/SSegmentControl/utils/context.ts
|
|
10
|
+
var B = Symbol("SSegmentControl"), V = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "s-ui-segment-control__icon",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, H = /* @__PURE__ */ y({
|
|
15
|
+
__name: "SSegmentControlItem",
|
|
16
|
+
props: { item: {} },
|
|
17
|
+
setup(t) {
|
|
18
|
+
let n = b(B, null), r = {
|
|
19
|
+
[e.SMALL]: "s-ui-typography-label-12-medium",
|
|
20
|
+
[e.MEDIUM]: "s-ui-typography-label-14-medium",
|
|
21
|
+
[e.LARGE]: "s-ui-typography-label-16-medium"
|
|
22
|
+
}, i = {
|
|
23
|
+
[e.SMALL]: 16,
|
|
24
|
+
[e.MEDIUM]: 20,
|
|
25
|
+
[e.LARGE]: 24
|
|
26
|
+
}, u = p(() => n ? M(n.size) : e.MEDIUM), d = p(() => r[u.value]), f = p(() => i[u.value]), _ = F("itemRootRef"), y = l(() => t.item.link, () => t.item.exact, () => t.item.replace);
|
|
27
|
+
o({
|
|
28
|
+
isRouterLink: y.isRouterLink,
|
|
29
|
+
isActive: y.isActive,
|
|
30
|
+
group: () => n,
|
|
31
|
+
value: () => t.item.value
|
|
32
|
+
});
|
|
33
|
+
let x = p(() => !!(n && M(n.disabled)) || !!t.item.disabled), C = a({
|
|
34
|
+
group: () => n,
|
|
35
|
+
value: () => t.item.value,
|
|
36
|
+
el: _,
|
|
37
|
+
disabled: x
|
|
38
|
+
}), T = p(() => y.isRouterLink.value ? y.isActive.value : C.isActive.value), D = y.linkPresentation, O = p(() => {
|
|
39
|
+
let e = D.value;
|
|
40
|
+
return e.mode === "none" ? "button" : e.rootTag;
|
|
41
|
+
}), k = p(() => O.value === "button"), P = p(() => {
|
|
42
|
+
if (n) return M(n.name);
|
|
43
|
+
}), I = p(() => ({
|
|
44
|
+
"s-ui-segment-control__item--selected": T.value,
|
|
45
|
+
"s-ui-segment-control__item--icon-only": !!t.item.iconOnly,
|
|
46
|
+
"s-ui-segment-control__item--link": c(t.item.link)
|
|
47
|
+
})), z = p(() => ({
|
|
48
|
+
...s(D.value, { replace: t.item.replace }),
|
|
49
|
+
disabled: k.value && x.value ? !0 : void 0,
|
|
50
|
+
"aria-disabled": !k.value && x.value ? !0 : void 0
|
|
51
|
+
})), H = p(() => x.value ? -1 : C.tabIndex.value ?? -1), U = (e) => {
|
|
52
|
+
if (!x.value) {
|
|
53
|
+
if (y.isRouterLink.value && (e.key === "Enter" || e.key === " " || e.key === "Spacebar")) {
|
|
54
|
+
e.preventDefault(), y.navigate();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
C.handleKeydown(e);
|
|
58
|
+
}
|
|
59
|
+
}, W = (e) => {
|
|
60
|
+
if (x.value) {
|
|
61
|
+
e.preventDefault(), e.stopPropagation();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
y.isRouterLink.value || C.handleClick();
|
|
65
|
+
};
|
|
66
|
+
return (e, n) => (E(), m(A(O.value), S({
|
|
67
|
+
ref_key: "itemRootRef",
|
|
68
|
+
ref: _,
|
|
69
|
+
role: "radio",
|
|
70
|
+
class: ["s-ui-segment-control__item", I.value],
|
|
71
|
+
type: k.value ? "button" : void 0
|
|
72
|
+
}, z.value, {
|
|
73
|
+
"aria-checked": T.value ? "true" : "false",
|
|
74
|
+
tabindex: H.value,
|
|
75
|
+
name: k.value ? P.value : void 0,
|
|
76
|
+
onClick: W,
|
|
77
|
+
onKeydown: U
|
|
78
|
+
}), {
|
|
79
|
+
default: L(() => [t.item.icon ? (E(), g("span", V, [v(N(R), {
|
|
80
|
+
name: t.item.icon,
|
|
81
|
+
size: f.value
|
|
82
|
+
}, null, 8, ["name", "size"])])) : h("", !0), t.item.label && !t.item.iconOnly ? (E(), g("span", {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: w(["s-ui-segment-control__label", d.value])
|
|
85
|
+
}, j(t.item.label), 3)) : h("", !0)]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 16, [
|
|
88
|
+
"class",
|
|
89
|
+
"type",
|
|
90
|
+
"aria-checked",
|
|
91
|
+
"tabindex",
|
|
92
|
+
"name"
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
}), U = ".s-ui-segment-control__item", W = ({ trackEl: e, activeIndex: t, itemCount: n }) => {
|
|
96
|
+
let r = O(d()), i = () => {
|
|
97
|
+
let n = M(e), i = M(t);
|
|
98
|
+
if (!n || i < 0) {
|
|
99
|
+
r.value = d();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let a = n.querySelectorAll(U).item(i);
|
|
103
|
+
if (!(a instanceof HTMLElement)) {
|
|
104
|
+
r.value = d();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
r.value = u(n, a);
|
|
108
|
+
};
|
|
109
|
+
return z(e, () => {
|
|
110
|
+
i();
|
|
111
|
+
}), I(() => [M(t), M(n)], async () => {
|
|
112
|
+
await C(), i();
|
|
113
|
+
}, { immediate: !0 }), {
|
|
114
|
+
indicatorStyle: p(() => {
|
|
115
|
+
let { left: e, top: t, width: n, height: i } = r.value;
|
|
116
|
+
return !n || !i ? { opacity: "0" } : {
|
|
117
|
+
opacity: "1",
|
|
118
|
+
left: `${e}%`,
|
|
119
|
+
top: `${t}%`,
|
|
120
|
+
width: `${n}%`,
|
|
121
|
+
height: `${i}%`
|
|
122
|
+
};
|
|
123
|
+
}),
|
|
124
|
+
updateMetrics: i
|
|
125
|
+
};
|
|
126
|
+
}, G = ["aria-disabled"], K = /* @__PURE__ */ y({
|
|
127
|
+
__name: "SSegmentControl",
|
|
128
|
+
props: /*@__PURE__*/ x({
|
|
129
|
+
items: {},
|
|
130
|
+
size: { default: () => e.MEDIUM },
|
|
131
|
+
disabled: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !1
|
|
134
|
+
},
|
|
135
|
+
mandatory: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !0
|
|
138
|
+
},
|
|
139
|
+
name: {}
|
|
140
|
+
}, {
|
|
141
|
+
modelValue: {},
|
|
142
|
+
modelModifiers: {}
|
|
143
|
+
}),
|
|
144
|
+
emits: /*@__PURE__*/ x(["change"], ["update:modelValue"]),
|
|
145
|
+
setup(e, { emit: a }) {
|
|
146
|
+
let o = P(e, "modelValue"), s = a, c = F("trackRef"), l = r({
|
|
147
|
+
modelValue: () => o.value,
|
|
148
|
+
onUpdateModelValue: (e) => {
|
|
149
|
+
t(e) && (o.value = e, s("change", e));
|
|
150
|
+
},
|
|
151
|
+
mode: n.SINGLE,
|
|
152
|
+
mandatory: () => e.mandatory,
|
|
153
|
+
orientation: i.HORIZONTAL,
|
|
154
|
+
loop: !0
|
|
155
|
+
});
|
|
156
|
+
D(B, {
|
|
157
|
+
mode: () => n.SINGLE,
|
|
158
|
+
isSelected: l.isSelected,
|
|
159
|
+
selectItem: l.select,
|
|
160
|
+
registerItem: l.registerItem,
|
|
161
|
+
getItemTabIndex: l.getItemTabIndex,
|
|
162
|
+
getGroupTabIndex: l.getGroupTabIndex,
|
|
163
|
+
handleItemKeydown: l.handleItemKeydown,
|
|
164
|
+
disabled: () => e.disabled,
|
|
165
|
+
name: () => e.name,
|
|
166
|
+
size: () => e.size
|
|
167
|
+
});
|
|
168
|
+
let { indicatorStyle: u } = W({
|
|
169
|
+
trackEl: () => c.value,
|
|
170
|
+
activeIndex: p(() => {
|
|
171
|
+
let t = e.items.findIndex((e) => l.isSelected(e.value));
|
|
172
|
+
return t >= 0 ? t : 0;
|
|
173
|
+
}),
|
|
174
|
+
itemCount: () => e.items.length
|
|
175
|
+
}), d = p(() => ({
|
|
176
|
+
[`s-ui-segment-control--size-${e.size}`]: !0,
|
|
177
|
+
"s-ui-segment-control--disabled": e.disabled
|
|
178
|
+
})), h = (e, t) => `${String(e.value)}-${t}`, v = () => {
|
|
179
|
+
if (o.value !== void 0 && o.value !== null) return;
|
|
180
|
+
let t = e.items.find((e) => !e.disabled);
|
|
181
|
+
t && (o.value = t.value);
|
|
182
|
+
};
|
|
183
|
+
return I(() => e.items, () => {
|
|
184
|
+
v();
|
|
185
|
+
}, { immediate: !0 }), (t, n) => (E(), g("div", S({
|
|
186
|
+
ref_key: "trackRef",
|
|
187
|
+
ref: c,
|
|
188
|
+
class: ["s-ui-segment-control", d.value],
|
|
189
|
+
role: "radiogroup",
|
|
190
|
+
"aria-disabled": e.disabled || void 0
|
|
191
|
+
}, t.$attrs), [_("span", {
|
|
192
|
+
class: "s-ui-segment-control__indicator",
|
|
193
|
+
style: T(N(u)),
|
|
194
|
+
"aria-hidden": "true"
|
|
195
|
+
}, null, 4), (E(!0), g(f, null, k(e.items, (e, t) => (E(), m(H, {
|
|
196
|
+
key: h(e, t),
|
|
197
|
+
item: e
|
|
198
|
+
}, null, 8, ["item"]))), 128))], 16, G));
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
//#endregion
|
|
202
|
+
export { K as t };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
+
import { t as r } from "./SButton-DnU_XZ1C.js";
|
|
3
|
+
import { i, n as a, o, r as s } from "./useSelectionGroup-cKj38lEN.js";
|
|
4
|
+
import { n as c, t as l } from "./getIndicatorMetricsPercent-CWrH_ONg.js";
|
|
5
|
+
import { i as u, n as d, r as f } from "./STab-DY1TGadw.js";
|
|
6
|
+
import { computed as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createVNode as _, defineComponent as v, mergeModels as y, nextTick as b, normalizeClass as x, normalizeStyle as S, openBlock as C, provide as w, ref as T, renderSlot as E, toValue as D, unref as O, useModel as k, useTemplateRef as A, watch as j } from "vue";
|
|
7
|
+
import { useResizeObserver as M, useScroll as N } from "@vueuse/core";
|
|
8
|
+
//#region src/components/STabs/utils/useTabsIndicator.ts
|
|
9
|
+
var P = ".s-ui-tab[aria-selected=\"true\"]", F = () => ({
|
|
10
|
+
...l(),
|
|
11
|
+
isBilling: !1
|
|
12
|
+
}), I = ({ trackEl: e, selectedValue: t, enabled: n }) => {
|
|
13
|
+
let r = T(F()), i = () => {
|
|
14
|
+
if (!D(n)) {
|
|
15
|
+
r.value = F();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let t = D(e);
|
|
19
|
+
if (!t) {
|
|
20
|
+
r.value = F();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let i = t.querySelector(P);
|
|
24
|
+
if (!(i instanceof HTMLElement)) {
|
|
25
|
+
r.value = F();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
r.value = {
|
|
29
|
+
...c(t, i),
|
|
30
|
+
isBilling: i.classList.contains("s-ui-tab--billing")
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
return M(e, () => {
|
|
34
|
+
i();
|
|
35
|
+
}), j(() => D(t), async () => {
|
|
36
|
+
await b(), i();
|
|
37
|
+
}, { immediate: !0 }), {
|
|
38
|
+
indicatorStyle: p(() => {
|
|
39
|
+
let { left: e, width: t } = r.value;
|
|
40
|
+
return t ? {
|
|
41
|
+
opacity: "1",
|
|
42
|
+
left: `${e}%`,
|
|
43
|
+
width: `${t}%`
|
|
44
|
+
} : { opacity: "0" };
|
|
45
|
+
}),
|
|
46
|
+
indicatorIsBilling: p(() => r.value.isBilling)
|
|
47
|
+
};
|
|
48
|
+
}, L = ["aria-disabled"], R = { class: "s-ui-tabs__body" }, z = /* @__PURE__ */ v({
|
|
49
|
+
__name: "STabs",
|
|
50
|
+
props: /*@__PURE__*/ y({
|
|
51
|
+
appearance: { default: () => d.PRIMARY },
|
|
52
|
+
size: { default: () => f.LARGE },
|
|
53
|
+
disabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
mandatory: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !0
|
|
60
|
+
},
|
|
61
|
+
addable: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
loop: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
modelValue: {},
|
|
71
|
+
modelModifiers: {}
|
|
72
|
+
}),
|
|
73
|
+
emits: /*@__PURE__*/ y(["add"], ["update:modelValue"]),
|
|
74
|
+
setup(c, { emit: l }) {
|
|
75
|
+
let f = k(c, "modelValue"), v = l, y = A("tabsBodyRef"), b = A("tabsTrackRef"), { arrivedState: T } = N(y, {
|
|
76
|
+
throttle: 100,
|
|
77
|
+
offset: { right: 1 }
|
|
78
|
+
}), D = o({
|
|
79
|
+
modelValue: () => f.value,
|
|
80
|
+
onUpdateModelValue: (e) => {
|
|
81
|
+
i(e) && (f.value = e);
|
|
82
|
+
},
|
|
83
|
+
mode: a.SINGLE,
|
|
84
|
+
mandatory: () => c.mandatory,
|
|
85
|
+
orientation: s.HORIZONTAL,
|
|
86
|
+
loop: () => c.loop
|
|
87
|
+
});
|
|
88
|
+
w(u, {
|
|
89
|
+
mode: () => a.SINGLE,
|
|
90
|
+
isSelected: D.isSelected,
|
|
91
|
+
selectItem: D.toggle,
|
|
92
|
+
registerItem: D.registerItem,
|
|
93
|
+
getItemTabIndex: D.getItemTabIndex,
|
|
94
|
+
getGroupTabIndex: D.getGroupTabIndex,
|
|
95
|
+
handleItemKeydown: D.handleItemKeydown,
|
|
96
|
+
appearance: () => c.appearance,
|
|
97
|
+
size: () => c.size,
|
|
98
|
+
disabled: () => c.disabled
|
|
99
|
+
});
|
|
100
|
+
let j = p(() => c.appearance === d.PRIMARY), { indicatorStyle: M, indicatorIsBilling: P } = I({
|
|
101
|
+
trackEl: () => b.value,
|
|
102
|
+
selectedValue: () => f.value,
|
|
103
|
+
enabled: j
|
|
104
|
+
}), F = p(() => c.addable && !T.right), z = p(() => [
|
|
105
|
+
`s-ui-tabs--appearance-${c.appearance}`,
|
|
106
|
+
`s-ui-tabs--size-${c.size}`,
|
|
107
|
+
c.addable ? "s-ui-tabs--addable" : void 0
|
|
108
|
+
]), B = () => {
|
|
109
|
+
c.disabled || v("add");
|
|
110
|
+
};
|
|
111
|
+
return (i, a) => (C(), h("div", {
|
|
112
|
+
class: x(["s-ui-tabs", z.value]),
|
|
113
|
+
role: "tablist",
|
|
114
|
+
"aria-orientation": "horizontal",
|
|
115
|
+
"aria-disabled": c.disabled ? !0 : void 0
|
|
116
|
+
}, [g("div", R, [g("div", {
|
|
117
|
+
ref_key: "tabsBodyRef",
|
|
118
|
+
ref: y,
|
|
119
|
+
class: "s-ui-tabs__scroll"
|
|
120
|
+
}, [g("div", {
|
|
121
|
+
ref_key: "tabsTrackRef",
|
|
122
|
+
ref: b,
|
|
123
|
+
class: "s-ui-tabs__track"
|
|
124
|
+
}, [j.value ? (C(), h("span", {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: x(["s-ui-tabs__indicator", { "s-ui-tabs__indicator--billing": O(P) }]),
|
|
127
|
+
style: S(O(M)),
|
|
128
|
+
"aria-hidden": "true"
|
|
129
|
+
}, null, 6)) : m("", !0), E(i.$slots, "default")], 512)], 512), c.addable ? (C(), h("span", {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: x(["s-ui-tabs__fade", { "s-ui-tabs__fade--visible": F.value }]),
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}, null, 2)) : m("", !0)]), c.addable ? E(i.$slots, "add", { key: 0 }, () => [_(O(r), {
|
|
134
|
+
class: "s-ui-tabs__add",
|
|
135
|
+
icon: "plus",
|
|
136
|
+
appearance: O(n).BARE,
|
|
137
|
+
variant: O(t).NEUTRAL,
|
|
138
|
+
size: O(e).SMALL,
|
|
139
|
+
disabled: c.disabled,
|
|
140
|
+
onClick: B
|
|
141
|
+
}, null, 8, [
|
|
142
|
+
"appearance",
|
|
143
|
+
"variant",
|
|
144
|
+
"size",
|
|
145
|
+
"disabled"
|
|
146
|
+
])]) : m("", !0)], 10, L));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
//#endregion
|
|
150
|
+
export { z as t };
|
|
@@ -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("./getIndicatorMetricsPercent-CFGy_nB8.cjs"),i=require("./STab-BbzowB-Y.cjs");let a=require("vue"),o=require("@vueuse/core");var s=`.s-ui-tab[aria-selected="true"]`,c=()=>({...r.t(),isBilling:!1}),l=({trackEl:e,selectedValue:t,enabled:n})=>{let i=(0,a.ref)(c()),l=()=>{if(!(0,a.toValue)(n)){i.value=c();return}let t=(0,a.toValue)(e);if(!t){i.value=c();return}let o=t.querySelector(s);if(!(o instanceof HTMLElement)){i.value=c();return}i.value={...r.n(t,o),isBilling:o.classList.contains(`s-ui-tab--billing`)}};return(0,o.useResizeObserver)(e,()=>{l()}),(0,a.watch)(()=>(0,a.toValue)(t),async()=>{await(0,a.nextTick)(),l()},{immediate:!0}),{indicatorStyle:(0,a.computed)(()=>{let{left:e,width:t}=i.value;return t?{opacity:`1`,left:`${e}%`,width:`${t}%`}:{opacity:`0`}}),indicatorIsBilling:(0,a.computed)(()=>i.value.isBilling)}},u=[`aria-disabled`],d={class:`s-ui-tabs__body`},f=(0,a.defineComponent)({__name:`STabs`,props:(0,a.mergeModels)({appearance:{default:()=>i.n.PRIMARY},size:{default:()=>i.r.LARGE},disabled:{type:Boolean,default:!1},mandatory:{type:Boolean,default:!0},addable:{type:Boolean,default:!1},loop:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:(0,a.mergeModels)([`add`],[`update:modelValue`]),setup(r,{emit:s}){let c=(0,a.useModel)(r,`modelValue`),f=s,p=(0,a.useTemplateRef)(`tabsBodyRef`),m=(0,a.useTemplateRef)(`tabsTrackRef`),{arrivedState:h}=(0,o.useScroll)(p,{throttle:100,offset:{right:1}}),g=n.o({modelValue:()=>c.value,onUpdateModelValue:e=>{n.i(e)&&(c.value=e)},mode:n.n.SINGLE,mandatory:()=>r.mandatory,orientation:n.r.HORIZONTAL,loop:()=>r.loop});(0,a.provide)(i.i,{mode:()=>n.n.SINGLE,isSelected:g.isSelected,selectItem:g.toggle,registerItem:g.registerItem,getItemTabIndex:g.getItemTabIndex,getGroupTabIndex:g.getGroupTabIndex,handleItemKeydown:g.handleItemKeydown,appearance:()=>r.appearance,size:()=>r.size,disabled:()=>r.disabled});let _=(0,a.computed)(()=>r.appearance===i.n.PRIMARY),{indicatorStyle:v,indicatorIsBilling:y}=l({trackEl:()=>m.value,selectedValue:()=>c.value,enabled:_}),b=(0,a.computed)(()=>r.addable&&!h.right),x=(0,a.computed)(()=>[`s-ui-tabs--appearance-${r.appearance}`,`s-ui-tabs--size-${r.size}`,r.addable?`s-ui-tabs--addable`:void 0]),S=()=>{r.disabled||f(`add`)};return(n,i)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:(0,a.normalizeClass)([`s-ui-tabs`,x.value]),role:`tablist`,"aria-orientation":`horizontal`,"aria-disabled":r.disabled?!0:void 0},[(0,a.createElementVNode)(`div`,d,[(0,a.createElementVNode)(`div`,{ref_key:`tabsBodyRef`,ref:p,class:`s-ui-tabs__scroll`},[(0,a.createElementVNode)(`div`,{ref_key:`tabsTrackRef`,ref:m,class:`s-ui-tabs__track`},[_.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:0,class:(0,a.normalizeClass)([`s-ui-tabs__indicator`,{"s-ui-tabs__indicator--billing":(0,a.unref)(y)}]),style:(0,a.normalizeStyle)((0,a.unref)(v)),"aria-hidden":`true`},null,6)):(0,a.createCommentVNode)(``,!0),(0,a.renderSlot)(n.$slots,`default`)],512)],512),r.addable?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:0,class:(0,a.normalizeClass)([`s-ui-tabs__fade`,{"s-ui-tabs__fade--visible":b.value}]),"aria-hidden":`true`},null,2)):(0,a.createCommentVNode)(``,!0)]),r.addable?(0,a.renderSlot)(n.$slots,`add`,{key:0},()=>[(0,a.createVNode)((0,a.unref)(t.t),{class:`s-ui-tabs__add`,icon:`plus`,appearance:(0,a.unref)(e.t).BARE,variant:(0,a.unref)(e.r).NEUTRAL,size:(0,a.unref)(e.n).SMALL,disabled:r.disabled,onClick:S},null,8,[`appearance`,`variant`,`size`,`disabled`])]):(0,a.createCommentVNode)(``,!0)],10,u))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -17,6 +17,10 @@ export interface ISChipProps {
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
/** Высота и типографика чипа. */
|
|
19
19
|
size?: ESChipSize;
|
|
20
|
+
/** Показывает кнопку удаления справа; клик отдаёт событие `delete`. */
|
|
21
|
+
deletable?: boolean;
|
|
22
|
+
/** Визуально выделенное состояние; ховер и нажатие продолжают работать поверх. */
|
|
23
|
+
selected?: boolean;
|
|
20
24
|
}
|
|
21
25
|
export type TSChipInstance = InstanceType<typeof SChip>;
|
|
22
26
|
//# sourceMappingURL=SChip.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SChip.types.d.ts","sourceRoot":"","sources":["../../../src/components/SChip/SChip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,CAAA;AAE9B,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,oBAAY,UAAU;IACpB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iCAAiC;IACjC,IAAI,CAAC,EAAE,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"SChip.types.d.ts","sourceRoot":"","sources":["../../../src/components/SChip/SChip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,CAAA;AAE9B,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,oBAAY,UAAU;IACpB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iCAAiC;IACjC,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,KAAK,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TSIconSize } from '@shtabapp/ui-kit-primitives';
|
|
2
2
|
import { ESChipSize, type ISChipProps } from './SChip.types';
|
|
3
3
|
type __VLS_Slots = {
|
|
4
4
|
actions?: (props: {
|
|
@@ -16,7 +16,11 @@ type __VLS_Slots = {
|
|
|
16
16
|
size: ESChipSize;
|
|
17
17
|
}) => unknown;
|
|
18
18
|
};
|
|
19
|
-
declare const __VLS_base: import("vue").DefineComponent<ISChipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<ISChipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
delete: () => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<ISChipProps> & Readonly<{
|
|
22
|
+
onDelete?: (() => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
24
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
25
|
declare const _default: typeof __VLS_export;
|
|
22
26
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SChip.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SChip/SChip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SChip.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SChip/SChip.vue"],"names":[],"mappings":"AA6IA,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,6BAA6B,CAAA;AAI3E,OAAO,EAAe,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAoBzE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAA;IACrE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO,CAAA;IACpF,OAAO,CAAC,EAAE,MAAM,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO,CAAA;CACrE,CAAC;AAwLF,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSegmentIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/SSegmentControl/utils/useSegmentIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSegmentIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/SSegmentControl/utils/useSegmentIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAWpF,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC7C,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACrC,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;AAED,eAAO,MAAM,mBAAmB,GAAI,sCAIjC,2BAA2B;;;;;;;;;;;;;;;CA0D7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTabsIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/STabs/utils/useTabsIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"useTabsIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/STabs/utils/useTabsIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAeZ,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC7C,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACxC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC/E,kBAAkB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CACzC;AAOD,eAAO,MAAM,gBAAgB,GAAI,sCAI9B,wBAAwB,KAAG,uBA8D7B,CAAA"}
|
package/dist/entries/chip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SChip-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SChip-BL47yJ-i.cjs");exports.ESChipColor=e.n,exports.ESChipSize=e.r,exports.SChip=e.t;
|
package/dist/entries/chip.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../SChip-
|
|
1
|
+
import { n as e, r as t, t as n } from "../SChip-XCYvlpaS.js";
|
|
2
2
|
export { e as ESChipColor, t as ESChipSize, n as SChip };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SButton.types-UKroD-ev.cjs"),t=require("../SSegmentControl-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../SButton.types-UKroD-ev.cjs"),t=require("../SSegmentControl-Dh_HmD4Z.cjs");exports.ESSegmentControlSize=e.n,exports.SSegmentControl=t.t;
|
package/dist/entries/tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../STab-BbzowB-Y.cjs"),t=require("../STabs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../STab-BbzowB-Y.cjs"),t=require("../STabs-h8sm-3do.cjs");exports.ESTabAppearance=e.n,exports.ESTabSize=e.r,exports.STab=e.t,exports.STabs=t.t;
|
package/dist/entries/tabs.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=()=>({left:0,top:0,width:0,height:0}),t=(t,n)=>{let r=t.getBoundingClientRect();if(!r.width||!r.height)return e();let i=n.getBoundingClientRect();return{left:(i.left-r.left)/r.width*100,top:(i.top-r.top)/r.height*100,width:i.width/r.width*100,height:i.height/r.height*100}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/utils/getIndicatorMetricsPercent.ts
|
|
2
|
+
var e = () => ({
|
|
3
|
+
left: 0,
|
|
4
|
+
top: 0,
|
|
5
|
+
width: 0,
|
|
6
|
+
height: 0
|
|
7
|
+
}), t = (t, n) => {
|
|
8
|
+
let r = t.getBoundingClientRect();
|
|
9
|
+
if (!r.width || !r.height) return e();
|
|
10
|
+
let i = n.getBoundingClientRect();
|
|
11
|
+
return {
|
|
12
|
+
left: (i.left - r.left) / r.width * 100,
|
|
13
|
+
top: (i.top - r.top) / r.height * 100,
|
|
14
|
+
width: i.width / r.width * 100,
|
|
15
|
+
height: i.height / r.height * 100
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as n, e as t };
|