@shtabapp/ui-kit 1.56.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/SButtonGroup-BOZQSxWY.js +90 -0
- package/dist/SButtonGroup-Cnuo4SzC.cjs +1 -0
- package/dist/{SColorPicker-Cucd749L.cjs → SColorPicker-BFw8CCDr.cjs} +1 -1
- package/dist/{SColorPicker-PI3xoFtS.js → SColorPicker-CTl7cSAO.js} +2 -2
- package/dist/SDropdown-LNVnMol3.cjs +1 -0
- package/dist/SDropdown-LOTCtlCX.js +356 -0
- package/dist/SInput-CRAegYKS.cjs +1 -0
- package/dist/SInput-Csy2uch7.js +224 -0
- package/dist/{SSelect-8RPurgr-.js → SSelect-fLtErA7p.js} +2 -2
- package/dist/{SSelect-BVs3lWQ9.cjs → SSelect-mFCdoFuO.cjs} +1 -1
- package/dist/STextarea-BDyy7Ku5.js +269 -0
- package/dist/STextarea-C4qDIp2k.cjs +1 -0
- package/dist/components/SButtonGroup/SButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/SButtonGroup/utils/context.d.ts.map +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts +12 -0
- package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
- package/dist/components/SDropdown/SDropdown.vue.d.ts +23 -2
- package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
- package/dist/components/SDropdown/index.d.ts +1 -1
- package/dist/components/SDropdown/index.d.ts.map +1 -1
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts +13 -0
- package/dist/components/SDropdown/parts/SDropdownSheet.types.d.ts.map +1 -0
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts +23 -0
- package/dist/components/SDropdown/parts/SDropdownSheet.vue.d.ts.map +1 -0
- package/dist/components/SDropdown/utils/useDropdownSheetMode.d.ts +7 -0
- package/dist/components/SDropdown/utils/useDropdownSheetMode.d.ts.map +1 -0
- package/dist/components/SDropdown/utils/useSheetDrag.d.ts +18 -0
- package/dist/components/SDropdown/utils/useSheetDrag.d.ts.map +1 -0
- package/dist/components/SInlineGroup/SInlineGroup.types.d.ts +11 -0
- package/dist/components/SInlineGroup/SInlineGroup.types.d.ts.map +1 -0
- package/dist/components/SInlineGroup/SInlineGroup.vue.d.ts +14 -0
- package/dist/components/SInlineGroup/SInlineGroup.vue.d.ts.map +1 -0
- package/dist/components/SInlineGroup/index.d.ts +4 -0
- package/dist/components/SInlineGroup/index.d.ts.map +1 -0
- package/dist/components/SInput/SInput.types.d.ts +5 -1
- package/dist/components/SInput/SInput.types.d.ts.map +1 -1
- package/dist/components/SInput/SInput.vue.d.ts.map +1 -1
- package/dist/components/STextarea/STextarea.types.d.ts +2 -0
- package/dist/components/STextarea/STextarea.types.d.ts.map +1 -1
- package/dist/components/STextarea/STextarea.vue.d.ts +5 -1
- package/dist/components/STextarea/STextarea.vue.d.ts.map +1 -1
- package/dist/composables/useFieldAttrs.d.ts +22 -0
- package/dist/composables/useFieldAttrs.d.ts.map +1 -0
- package/dist/composables/useFieldFilled.d.ts +19 -0
- package/dist/composables/useFieldFilled.d.ts.map +1 -0
- package/dist/composables/useResizeAutoScroll.d.ts +10 -0
- package/dist/composables/useResizeAutoScroll.d.ts.map +1 -0
- package/dist/entries/button-group.cjs +1 -1
- package/dist/entries/button-group.js +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/dropdown.cjs +1 -1
- package/dist/entries/dropdown.d.ts +2 -2
- package/dist/entries/dropdown.d.ts.map +1 -1
- package/dist/entries/dropdown.js +2 -2
- package/dist/entries/input.cjs +1 -1
- package/dist/entries/input.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/textarea.cjs +1 -1
- package/dist/entries/textarea.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +137 -137
- package/dist/uikit-components.css +1 -1
- package/dist/useFieldMessages-2TaArixP.cjs +1 -0
- package/dist/useFieldMessages-C-GXaf_q.js +43 -0
- package/package.json +2 -2
- package/dist/SButtonGroup-BPy2YaEP.cjs +0 -1
- package/dist/SButtonGroup-CmSlYnSv.js +0 -72
- package/dist/SDropdown-CTQ5Qlez.js +0 -175
- package/dist/SDropdown-_QUOP-rw.cjs +0 -1
- package/dist/SInput-C-_R5pug.js +0 -204
- package/dist/SInput-Cw8pt9Sr.cjs +0 -1
- package/dist/STextarea-Cz7Frk82.cjs +0 -1
- package/dist/STextarea-SwVygHwh.js +0 -148
- package/dist/useFieldMessages-Cb06My1W.js +0 -30
- package/dist/useFieldMessages-CzjU0ajM.cjs +0 -1
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./SInlineMessage-Dirk5RwO.js";
|
|
2
|
-
import { t as n } from "./SLabel-FHHPlcKq.js";
|
|
3
|
-
import { n as r, t as i } from "./useFieldMessages-Cb06My1W.js";
|
|
4
|
-
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, defineComponent as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, openBlock as _, renderList as v, toDisplayString as y, unref as b, useAttrs as x, useId as S, useModel as C, useTemplateRef as w, vModelText as T, watch as E, withCtx as D, withDirectives as O } from "vue";
|
|
5
|
-
//#region src/components/STextarea/STextarea.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var k = ["inert", "aria-disabled"], A = [
|
|
7
|
-
"id",
|
|
8
|
-
"name",
|
|
9
|
-
"placeholder",
|
|
10
|
-
"disabled",
|
|
11
|
-
"readonly",
|
|
12
|
-
"rows",
|
|
13
|
-
"maxlength",
|
|
14
|
-
"autocomplete"
|
|
15
|
-
], j = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "s-ui-textarea__footer"
|
|
18
|
-
}, M = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "s-ui-textarea__messages"
|
|
21
|
-
}, N = {
|
|
22
|
-
key: 1,
|
|
23
|
-
class: "s-ui-textarea__counter s-ui-typography-label-12-medium"
|
|
24
|
-
}, P = /* @__PURE__ */ f({
|
|
25
|
-
inheritAttrs: !1,
|
|
26
|
-
__name: "STextarea",
|
|
27
|
-
props: /*@__PURE__*/ p({
|
|
28
|
-
label: {},
|
|
29
|
-
labelProps: {},
|
|
30
|
-
placeholder: {},
|
|
31
|
-
helpMessages: {},
|
|
32
|
-
errorMessages: {},
|
|
33
|
-
bordered: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !0
|
|
36
|
-
},
|
|
37
|
-
disabled: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: !1
|
|
40
|
-
},
|
|
41
|
-
readonly: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
default: !1
|
|
44
|
-
},
|
|
45
|
-
maxlength: {},
|
|
46
|
-
counter: { type: Boolean },
|
|
47
|
-
resizable: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: !0
|
|
50
|
-
},
|
|
51
|
-
rows: {},
|
|
52
|
-
autoGrow: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: !1
|
|
55
|
-
},
|
|
56
|
-
minRows: { default: 1 },
|
|
57
|
-
maxRows: { default: 7 },
|
|
58
|
-
name: {},
|
|
59
|
-
id: {},
|
|
60
|
-
autocomplete: {}
|
|
61
|
-
}, {
|
|
62
|
-
modelValue: { default: "" },
|
|
63
|
-
modelModifiers: {}
|
|
64
|
-
}),
|
|
65
|
-
emits: /*@__PURE__*/ p(["focus", "blur"], ["update:modelValue"]),
|
|
66
|
-
setup(f, { emit: p }) {
|
|
67
|
-
let P = C(f, "modelValue"), F = p, I = x(), L = S(), R = w("textareaElementRef"), { isFocused: z, handleFocus: B, handleFocusOut: V } = r({
|
|
68
|
-
isDisabled: () => f.disabled,
|
|
69
|
-
blurField: () => R.value?.blur(),
|
|
70
|
-
emitFocus: (e) => F("focus", e),
|
|
71
|
-
emitBlur: (e) => F("blur", e)
|
|
72
|
-
}), H = (e) => {
|
|
73
|
-
let t = getComputedStyle(e), n = Number.parseFloat(t.lineHeight) || 0, r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom), i = Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), a = e.scrollHeight + i, o = n * f.minRows + r + i, s = n * f.maxRows + r + i;
|
|
74
|
-
return {
|
|
75
|
-
height: Math.min(Math.max(a, o), s),
|
|
76
|
-
isOverflowing: a > s
|
|
77
|
-
};
|
|
78
|
-
}, U = () => {
|
|
79
|
-
let e = R.value;
|
|
80
|
-
if (!e) return;
|
|
81
|
-
if (!f.autoGrow) {
|
|
82
|
-
e.style.height = "", e.style.overflowY = "";
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
e.style.height = "auto";
|
|
86
|
-
let { height: t, isOverflowing: n } = H(e);
|
|
87
|
-
e.style.height = `${t}px`, e.style.overflowY = n ? "auto" : "hidden";
|
|
88
|
-
};
|
|
89
|
-
E([
|
|
90
|
-
R,
|
|
91
|
-
P,
|
|
92
|
-
() => f.autoGrow,
|
|
93
|
-
() => f.minRows,
|
|
94
|
-
() => f.maxRows
|
|
95
|
-
], () => h(U), { immediate: !0 });
|
|
96
|
-
let { normalizedHelpMessages: W, normalizedErrorMessages: G, hasErrorMessages: K, hasHelpMessages: q } = i(() => f.helpMessages, () => f.errorMessages), J = o(() => f.id ? f.id : L), Y = o(() => !!f.label), X = o(() => q.value || K.value), Z = o(() => !(!f.maxlength || f.counter === !1)), Q = o(() => X.value || Z.value), $ = o(() => f.maxlength ? `${P.value.length}/${f.maxlength}` : ""), ee = o(() => P.value.length > 0), te = o(() => ({
|
|
97
|
-
"s-ui-textarea--disabled": f.disabled,
|
|
98
|
-
"s-ui-textarea--readonly": f.readonly
|
|
99
|
-
})), ne = o(() => ({
|
|
100
|
-
"s-ui-textarea__field--bordered": f.bordered,
|
|
101
|
-
"s-ui-textarea__field--borderless": !f.bordered,
|
|
102
|
-
"s-ui-textarea__field--disabled": f.disabled,
|
|
103
|
-
"s-ui-textarea__field--readonly": f.readonly,
|
|
104
|
-
"s-ui-textarea__field--error": K.value,
|
|
105
|
-
"s-ui-textarea__field--filled": ee.value,
|
|
106
|
-
"s-ui-textarea__field--focused": z.value,
|
|
107
|
-
"s-ui-textarea__field--resizable": f.resizable && !f.autoGrow && !f.disabled && !f.readonly
|
|
108
|
-
})), re = (e) => {
|
|
109
|
-
f.disabled || f.readonly || e.target instanceof HTMLElement && e.target !== R.value && R.value?.focus();
|
|
110
|
-
};
|
|
111
|
-
return (r, i) => (_(), l("div", { class: g(["s-ui-textarea", te.value]) }, [
|
|
112
|
-
Y.value ? (_(), s(b(n), m({ key: 0 }, f.labelProps, { "html-for": J.value }), {
|
|
113
|
-
default: D(() => [d(y(f.label), 1)]),
|
|
114
|
-
_: 1
|
|
115
|
-
}, 16, ["html-for"])) : c("", !0),
|
|
116
|
-
u("div", {
|
|
117
|
-
class: g(["s-ui-textarea__field", ne.value]),
|
|
118
|
-
inert: f.disabled ? !0 : void 0,
|
|
119
|
-
"aria-disabled": f.disabled ? !0 : void 0,
|
|
120
|
-
onClick: i[2] ||= (e) => re(e),
|
|
121
|
-
onFocusout: i[3] ||= (...e) => b(V) && b(V)(...e)
|
|
122
|
-
}, [O(u("textarea", m({
|
|
123
|
-
id: J.value,
|
|
124
|
-
ref_key: "textareaElementRef",
|
|
125
|
-
ref: R,
|
|
126
|
-
"onUpdate:modelValue": i[0] ||= (e) => P.value = e,
|
|
127
|
-
class: "s-ui-textarea__control s-ui-typography-body-16-regular",
|
|
128
|
-
name: f.name,
|
|
129
|
-
placeholder: f.placeholder,
|
|
130
|
-
disabled: f.disabled,
|
|
131
|
-
readonly: f.readonly,
|
|
132
|
-
rows: f.rows,
|
|
133
|
-
maxlength: f.maxlength,
|
|
134
|
-
autocomplete: f.autocomplete
|
|
135
|
-
}, b(I), { onFocus: i[1] ||= (...e) => b(B) && b(B)(...e) }), null, 16, A), [[T, P.value]])], 42, k),
|
|
136
|
-
Q.value ? (_(), l("div", j, [X.value ? (_(), l("div", M, [(_(!0), l(a, null, v(b(W), (e, n) => (_(), s(b(t), {
|
|
137
|
-
key: `help-${n}`,
|
|
138
|
-
message: e
|
|
139
|
-
}, null, 8, ["message"]))), 128)), (_(!0), l(a, null, v(b(G), (n, r) => (_(), s(b(t), {
|
|
140
|
-
key: `error-${r}`,
|
|
141
|
-
message: n,
|
|
142
|
-
"validation-status": b(e).ERROR
|
|
143
|
-
}, null, 8, ["message", "validation-status"]))), 128))])) : c("", !0), Z.value ? (_(), l("p", N, y($.value), 1)) : c("", !0)])) : c("", !0)
|
|
144
|
-
], 2));
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
//#endregion
|
|
148
|
-
export { P as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { computed as e, ref as t, toValue as n } from "vue";
|
|
2
|
-
//#region src/composables/useFieldFocus.ts
|
|
3
|
-
var r = (e) => {
|
|
4
|
-
let n = t(!1);
|
|
5
|
-
return {
|
|
6
|
-
isFocused: n,
|
|
7
|
-
handleFocus: (t) => {
|
|
8
|
-
if (e.isDisabled()) {
|
|
9
|
-
e.blurField();
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
n.value || (n.value = !0, e.emitFocus(t));
|
|
13
|
-
},
|
|
14
|
-
handleFocusOut: (t) => {
|
|
15
|
-
if (!(t.currentTarget instanceof HTMLElement)) return;
|
|
16
|
-
let r = t.relatedTarget;
|
|
17
|
-
r instanceof Node && t.currentTarget.contains(r) || n.value && (n.value = !1, e.emitBlur(t));
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}, i = (e) => e ? typeof e == "string" ? [e] : e.filter((e) => e.length > 0) : [], a = (t, r) => {
|
|
21
|
-
let a = e(() => i(n(t))), o = e(() => i(n(r)));
|
|
22
|
-
return {
|
|
23
|
-
normalizedHelpMessages: a,
|
|
24
|
-
normalizedErrorMessages: o,
|
|
25
|
-
hasHelpMessages: e(() => a.value.length > 0),
|
|
26
|
-
hasErrorMessages: e(() => o.value.length > 0)
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as n, a as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("vue");var t=t=>{let n=(0,e.ref)(!1);return{isFocused:n,handleFocus:e=>{if(t.isDisabled()){t.blurField();return}n.value||(n.value=!0,t.emitFocus(e))},handleFocusOut:e=>{if(!(e.currentTarget instanceof HTMLElement))return;let r=e.relatedTarget;r instanceof Node&&e.currentTarget.contains(r)||n.value&&(n.value=!1,t.emitBlur(e))}}},n=e=>e?typeof e==`string`?[e]:e.filter(e=>e.length>0):[],r=(t,r)=>{let i=(0,e.computed)(()=>n((0,e.toValue)(t))),a=(0,e.computed)(()=>n((0,e.toValue)(r)));return{normalizedHelpMessages:i,normalizedErrorMessages:a,hasHelpMessages:(0,e.computed)(()=>i.value.length>0),hasErrorMessages:(0,e.computed)(()=>a.value.length>0)}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|