@useinsider/ab-components 0.0.8 → 0.0.10
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/dist/{FilledCautionTriangle-CH-ggpYw.js → FilledCautionTriangle-fCoO6aL0.js} +2 -2
- package/dist/{FilledCautionTriangle-CH-ggpYw.js.map → FilledCautionTriangle-fCoO6aL0.js.map} +1 -1
- package/dist/{FilledCheckCircle-CTFsLEFA.js → FilledCheckCircle-C-8rCgNk.js} +2 -2
- package/dist/{FilledCheckCircle-CTFsLEFA.js.map → FilledCheckCircle-C-8rCgNk.js.map} +1 -1
- package/dist/{FilledErrorBox-cOfeWLjE.js → FilledErrorBox-Bf-e1gi6.js} +2 -2
- package/dist/{FilledErrorBox-cOfeWLjE.js.map → FilledErrorBox-Bf-e1gi6.js.map} +1 -1
- package/dist/{FilledInfoCircle-SQZ-tevO.js → FilledInfoCircle-BVuqOp8c.js} +2 -2
- package/dist/{FilledInfoCircle-SQZ-tevO.js.map → FilledInfoCircle-BVuqOp8c.js.map} +1 -1
- package/dist/{LineCheck-Cqr6b9xw.js → LineCheck-357DQEBn.js} +2 -2
- package/dist/{LineCheck-Cqr6b9xw.js.map → LineCheck-357DQEBn.js.map} +1 -1
- package/dist/{LoadingCircle-DBQ2KdHQ.js → LoadingCircle-KaXR2IVD.js} +2 -2
- package/dist/{LoadingCircle-DBQ2KdHQ.js.map → LoadingCircle-KaXR2IVD.js.map} +1 -1
- package/dist/{SmartIcon-CHS1pqOk.js → SmartIcon-Cj_avk5U.js} +2 -2
- package/dist/{SmartIcon-CHS1pqOk.js.map → SmartIcon-Cj_avk5U.js.map} +1 -1
- package/dist/ab-components.cjs.js +1 -1
- package/dist/ab-components.cjs.js.map +1 -1
- package/dist/ab-components.css +1 -1
- package/dist/ab-components.es.js +7 -5
- package/dist/ab-components.iife.js +1 -1
- package/dist/ab-components.iife.js.map +1 -1
- package/dist/ab-components.umd.js +1 -1
- package/dist/ab-components.umd.js.map +1 -1
- package/dist/index-CvIq_105.js +680 -0
- package/dist/index-CvIq_105.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/package.json +1 -1
- package/dist/index-RMe94nFN.js +0 -550
- package/dist/index-RMe94nFN.js.map +0 -1
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
import { defineComponent as I, computed as j, openBlock as s, createElementBlock as d, normalizeClass as _, unref as t, createBlock as H, createCommentVNode as f, toDisplayString as h, ref as y, reactive as Y, onMounted as Q, watch as E, Fragment as W, createElementVNode as v, withDirectives as q, normalizeStyle as P, withModifiers as oe, vModelText as re, renderList as X, defineAsyncComponent as S, resolveDynamicComponent as ae, createVNode as le } from "vue";
|
|
2
|
+
const _e = "_button__size_default_16zzc_1", se = "_button__size_small_16zzc_8", ue = "_button_16zzc_1", ie = "_button__label_16zzc_193", de = "_button__solid_16zzc_205", ce = "_fill_16zzc_1125", x = {
|
|
3
|
+
button__size_default: _e,
|
|
4
|
+
button__size_small: se,
|
|
5
|
+
button: ue,
|
|
6
|
+
button__label: ie,
|
|
7
|
+
"button__solid-primary": "_button__solid-primary_16zzc_205",
|
|
8
|
+
"no-hover-effect": "_no-hover-effect_16zzc_212",
|
|
9
|
+
"button--selected": "_button--selected_16zzc_234",
|
|
10
|
+
"button__solid-subtle-primary": "_button__solid-subtle-primary_16zzc_241",
|
|
11
|
+
"button__solid-secondary": "_button__solid-secondary_16zzc_277",
|
|
12
|
+
"button__solid-danger": "_button__solid-danger_16zzc_313",
|
|
13
|
+
"button__solid-warning": "_button__solid-warning_16zzc_349",
|
|
14
|
+
"button__solid-smart": "_button__solid-smart_16zzc_385",
|
|
15
|
+
"button__ghost-primary": "_button__ghost-primary_16zzc_421",
|
|
16
|
+
"button__ghost-subtle-primary": "_button__ghost-subtle-primary_16zzc_457",
|
|
17
|
+
"button__ghost-secondary": "_button__ghost-secondary_16zzc_493",
|
|
18
|
+
"button__ghost-danger": "_button__ghost-danger_16zzc_529",
|
|
19
|
+
"button__ghost-warning": "_button__ghost-warning_16zzc_565",
|
|
20
|
+
"button__ghost-smart": "_button__ghost-smart_16zzc_601",
|
|
21
|
+
"button__text-primary": "_button__text-primary_16zzc_637",
|
|
22
|
+
"button__text-text": "_button__text-text_16zzc_673",
|
|
23
|
+
"button__text-subtle-primary": "_button__text-subtle-primary_16zzc_709",
|
|
24
|
+
"button__text-secondary": "_button__text-secondary_16zzc_745",
|
|
25
|
+
"button__text-danger": "_button__text-danger_16zzc_781",
|
|
26
|
+
"button__text-warning": "_button__text-warning_16zzc_817",
|
|
27
|
+
"button__text-smart": "_button__text-smart_16zzc_853",
|
|
28
|
+
"button__outline-primary": "_button__outline-primary_16zzc_889",
|
|
29
|
+
"button__outline-subtle-primary": "_button__outline-subtle-primary_16zzc_926",
|
|
30
|
+
"button__outline-secondary": "_button__outline-secondary_16zzc_963",
|
|
31
|
+
"button__outline-danger": "_button__outline-danger_16zzc_1000",
|
|
32
|
+
"button__outline-warning": "_button__outline-warning_16zzc_1037",
|
|
33
|
+
"button__outline-smart": "_button__outline-smart_16zzc_1074",
|
|
34
|
+
button__solid: de,
|
|
35
|
+
fill: ce
|
|
36
|
+
}, pe = ["disabled"], $t = /* @__PURE__ */ I({
|
|
37
|
+
__name: "Button",
|
|
38
|
+
props: {
|
|
39
|
+
variant: {},
|
|
40
|
+
color: {},
|
|
41
|
+
size: { default: "default" },
|
|
42
|
+
leftIconName: {},
|
|
43
|
+
rightIconName: {},
|
|
44
|
+
loadingStatus: { type: Boolean, default: !1 },
|
|
45
|
+
successStatus: { type: Boolean, default: !1 },
|
|
46
|
+
label: {},
|
|
47
|
+
disabled: { type: Boolean, default: !1 },
|
|
48
|
+
fill: { type: Boolean, default: !1 }
|
|
49
|
+
},
|
|
50
|
+
emits: ["click"],
|
|
51
|
+
setup(u, { emit: i }) {
|
|
52
|
+
const r = u, n = i, a = (o) => {
|
|
53
|
+
r.disabled || n("click", o);
|
|
54
|
+
}, p = j(() => r.loadingStatus ? "LoadingCircle" : r.successStatus ? "LineCheck" : r.leftIconName);
|
|
55
|
+
return (o, e) => (s(), d("button", {
|
|
56
|
+
class: _([
|
|
57
|
+
t(x).button,
|
|
58
|
+
t(x)[`button__${o.variant}`],
|
|
59
|
+
t(x)[`button__${o.variant}-${o.color}`],
|
|
60
|
+
t(x)[`button__size_${o.size}`],
|
|
61
|
+
{ [t(x).fill]: o.fill }
|
|
62
|
+
]),
|
|
63
|
+
disabled: r.disabled,
|
|
64
|
+
onClick: a
|
|
65
|
+
}, [
|
|
66
|
+
p.value ? (s(), H(t(F), {
|
|
67
|
+
key: 0,
|
|
68
|
+
name: p.value
|
|
69
|
+
}, null, 8, ["name"])) : f("", !0),
|
|
70
|
+
o.label ? (s(), d("span", {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: _(t(x).button__label)
|
|
73
|
+
}, h(o.label), 3)) : f("", !0),
|
|
74
|
+
o.rightIconName ? (s(), H(t(F), {
|
|
75
|
+
key: 2,
|
|
76
|
+
name: o.rightIconName
|
|
77
|
+
}, null, 8, ["name"])) : f("", !0)
|
|
78
|
+
], 10, pe));
|
|
79
|
+
}
|
|
80
|
+
}), me = {
|
|
81
|
+
mounted(u, i) {
|
|
82
|
+
u.clickOutsideEvent = (r) => {
|
|
83
|
+
[u, ...i.value.exclude || []].some((a) => a && (a === r.target || a.contains(r.target))) || i.value.handler();
|
|
84
|
+
}, document.addEventListener("click", u.clickOutsideEvent);
|
|
85
|
+
},
|
|
86
|
+
unmounted(u) {
|
|
87
|
+
u.clickOutsideEvent && document.removeEventListener("click", u.clickOutsideEvent);
|
|
88
|
+
}
|
|
89
|
+
}, be = (u, i) => {
|
|
90
|
+
var n;
|
|
91
|
+
let r = 0;
|
|
92
|
+
for (const a of u)
|
|
93
|
+
if (a.toLowerCase() === ((n = i[r]) == null ? void 0 : n.toLowerCase()) && r++, r === i.length)
|
|
94
|
+
return !0;
|
|
95
|
+
return !1;
|
|
96
|
+
}, fe = (u, i, r) => {
|
|
97
|
+
if (!r.trim())
|
|
98
|
+
return u;
|
|
99
|
+
const n = r.toLowerCase();
|
|
100
|
+
return u.filter((a) => {
|
|
101
|
+
const p = String(a[i]);
|
|
102
|
+
return be(p.toLowerCase(), n);
|
|
103
|
+
}).sort((a, p) => {
|
|
104
|
+
const o = String(a[i]).toLowerCase(), e = String(p[i]).toLowerCase();
|
|
105
|
+
return o === n ? -1 : e === n ? 1 : o.startsWith(n) && !e.startsWith(n) ? -1 : !o.startsWith(n) && e.startsWith(n) ? 1 : o.length - e.length;
|
|
106
|
+
});
|
|
107
|
+
}, we = "_dropdown_c02u6_1", he = "_menu_c02u6_1", ge = "_dropdown__valueContent_c02u6_183", ve = "_dropdown__label_c02u6_194", ze = "_dropdown__value_c02u6_183", ye = "_dropdown__placeholder_c02u6_202", ke = "_dropdown__arrowIcon_c02u6_210", $e = "_menu__searchContainer_c02u6_225", Ce = "_menu__searchInputWrap_c02u6_229", Ie = "_menu__searchInput_c02u6_229", Be = "_menu__errorMessage_c02u6_251", Ve = "_menu__addButton_c02u6_258", Me = "_menu__itemContainer_c02u6_266", Se = "_menu__item_c02u6_266", w = {
|
|
108
|
+
dropdown: we,
|
|
109
|
+
menu: he,
|
|
110
|
+
dropdown__valueContent: ge,
|
|
111
|
+
"dropdown__valueContent--open": "_dropdown__valueContent--open_c02u6_191",
|
|
112
|
+
dropdown__label: ve,
|
|
113
|
+
dropdown__value: ze,
|
|
114
|
+
dropdown__placeholder: ye,
|
|
115
|
+
dropdown__arrowIcon: ke,
|
|
116
|
+
menu__searchContainer: $e,
|
|
117
|
+
menu__searchInputWrap: Ce,
|
|
118
|
+
menu__searchInput: Ie,
|
|
119
|
+
"menu__searchInput--error": "_menu__searchInput--error_c02u6_248",
|
|
120
|
+
menu__errorMessage: Be,
|
|
121
|
+
menu__addButton: Ve,
|
|
122
|
+
menu__itemContainer: Me,
|
|
123
|
+
menu__item: Se,
|
|
124
|
+
"menu__item--active": "_menu__item--active_c02u6_304"
|
|
125
|
+
}, xe = ["for"], Le = ["placeholder"], je = ["onClick"], Ct = /* @__PURE__ */ I({
|
|
126
|
+
__name: "DropdownMenu",
|
|
127
|
+
props: {
|
|
128
|
+
id: {},
|
|
129
|
+
label: {},
|
|
130
|
+
modelValue: { default: "" },
|
|
131
|
+
menuHeight: { default: 154 },
|
|
132
|
+
placeholder: {},
|
|
133
|
+
addable: { type: Boolean },
|
|
134
|
+
addButtonText: {},
|
|
135
|
+
searchable: { type: Boolean },
|
|
136
|
+
searchPlaceHolder: {},
|
|
137
|
+
items: {},
|
|
138
|
+
validateAddItem: { type: Function, default: () => null }
|
|
139
|
+
},
|
|
140
|
+
emits: ["update:modelValue", "add-error", "item-added", "select-item"],
|
|
141
|
+
setup(u, { emit: i }) {
|
|
142
|
+
const r = me, n = u, a = i, p = y(), o = y(), e = y(!1), l = y(null), c = y(""), b = y(null), B = y({ x: 0, y: 0, width: 0, shouldOpenUp: !1, height: n.menuHeight }), V = Y([...n.items]), M = Y([...n.items]), T = () => {
|
|
143
|
+
if (!p.value)
|
|
144
|
+
return;
|
|
145
|
+
const { offsetTop: m, offsetLeft: g, offsetWidth: z } = p.value, G = window.innerHeight, O = m + p.value.offsetHeight, A = O + n.menuHeight > G;
|
|
146
|
+
B.value = {
|
|
147
|
+
x: g + window.scrollX,
|
|
148
|
+
y: A ? m + window.scrollY : O + window.scrollY,
|
|
149
|
+
width: z,
|
|
150
|
+
shouldOpenUp: A,
|
|
151
|
+
height: n.menuHeight
|
|
152
|
+
};
|
|
153
|
+
}, Z = () => {
|
|
154
|
+
T(), e.value = !e.value;
|
|
155
|
+
}, R = () => {
|
|
156
|
+
b.value = null, c.value = "", V.splice(0, V.length, ...M);
|
|
157
|
+
}, D = () => {
|
|
158
|
+
e.value = !1, R();
|
|
159
|
+
}, J = (m) => {
|
|
160
|
+
l.value = m, a("select-item", m), a("update:modelValue", m.value), D();
|
|
161
|
+
}, K = () => {
|
|
162
|
+
const m = c.value.trim(), g = n.validateAddItem(m, M);
|
|
163
|
+
if (g) {
|
|
164
|
+
b.value = g, a("add-error", g);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const z = {
|
|
168
|
+
text: m,
|
|
169
|
+
value: m
|
|
170
|
+
};
|
|
171
|
+
M.push(z), R(), a("item-added", z);
|
|
172
|
+
}, ee = () => {
|
|
173
|
+
const m = fe(M, "text", c.value);
|
|
174
|
+
V.splice(0, V.length, ...m);
|
|
175
|
+
}, te = () => {
|
|
176
|
+
b.value = "";
|
|
177
|
+
}, ne = j(() => ({
|
|
178
|
+
top: B.value.shouldOpenUp ? `${B.value.y - 10}px` : `${B.value.y}px`,
|
|
179
|
+
left: `${B.value.x}px`,
|
|
180
|
+
width: `${B.value.width}px`,
|
|
181
|
+
height: `${n.menuHeight}px`
|
|
182
|
+
}));
|
|
183
|
+
Q(() => {
|
|
184
|
+
if (T(), n.modelValue) {
|
|
185
|
+
const m = M.find((g) => g.value === n.modelValue);
|
|
186
|
+
m && (l.value = m);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
const U = j(() => l.value ? l.value.text : "");
|
|
190
|
+
return E(
|
|
191
|
+
() => n.items,
|
|
192
|
+
(m) => {
|
|
193
|
+
M.splice(0, M.length, ...m), V.splice(0, V.length, ...m);
|
|
194
|
+
},
|
|
195
|
+
{ deep: !0 }
|
|
196
|
+
), (m, g) => (s(), d(W, null, [
|
|
197
|
+
v("div", {
|
|
198
|
+
ref_key: "dropdownRef",
|
|
199
|
+
ref: p,
|
|
200
|
+
class: _(t(w).dropdown)
|
|
201
|
+
}, [
|
|
202
|
+
m.label ? (s(), d("label", {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: _(t(w).dropdown__label),
|
|
205
|
+
for: m.id
|
|
206
|
+
}, h(m.label), 11, xe)) : f("", !0),
|
|
207
|
+
v("button", {
|
|
208
|
+
class: _([
|
|
209
|
+
t(w).dropdown__valueContent,
|
|
210
|
+
{
|
|
211
|
+
[t(w)["dropdown__valueContent--open"]]: e.value
|
|
212
|
+
}
|
|
213
|
+
]),
|
|
214
|
+
onClick: Z
|
|
215
|
+
}, [
|
|
216
|
+
v("span", {
|
|
217
|
+
class: _(t(w).dropdown__value)
|
|
218
|
+
}, h(U.value), 3),
|
|
219
|
+
m.placeholder && !U.value ? (s(), d("span", {
|
|
220
|
+
key: 0,
|
|
221
|
+
class: _(t(w).dropdown__placeholder)
|
|
222
|
+
}, h(m.placeholder), 3)) : f("", !0),
|
|
223
|
+
(s(), d("svg", {
|
|
224
|
+
fill: "none",
|
|
225
|
+
height: "17",
|
|
226
|
+
viewBox: "0 0 16 17",
|
|
227
|
+
width: "16",
|
|
228
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
229
|
+
class: _(t(w).dropdown__arrowIcon)
|
|
230
|
+
}, g[2] || (g[2] = [
|
|
231
|
+
v("path", {
|
|
232
|
+
d: "M8 11.2021L4.5359 6.70215L11.4641 6.70215L8 11.2021Z",
|
|
233
|
+
fill: "#91949F"
|
|
234
|
+
}, null, -1)
|
|
235
|
+
]), 2))
|
|
236
|
+
], 2)
|
|
237
|
+
], 2),
|
|
238
|
+
e.value ? q((s(), d("div", {
|
|
239
|
+
key: 0,
|
|
240
|
+
ref_key: "menuRef",
|
|
241
|
+
ref: o,
|
|
242
|
+
class: _(t(w).menu),
|
|
243
|
+
style: P(ne.value),
|
|
244
|
+
onClick: g[1] || (g[1] = oe(() => {
|
|
245
|
+
}, ["prevent"]))
|
|
246
|
+
}, [
|
|
247
|
+
n.searchable ? (s(), d("div", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: _(t(w).menu__searchContainer)
|
|
250
|
+
}, [
|
|
251
|
+
v("div", {
|
|
252
|
+
class: _(t(w).menu__searchInputWrap)
|
|
253
|
+
}, [
|
|
254
|
+
q(v("input", {
|
|
255
|
+
type: "text",
|
|
256
|
+
class: _([
|
|
257
|
+
t(w).menu__searchInput,
|
|
258
|
+
{
|
|
259
|
+
[t(w)["menu__searchInput--error"]]: b.value
|
|
260
|
+
}
|
|
261
|
+
]),
|
|
262
|
+
placeholder: m.searchPlaceHolder,
|
|
263
|
+
"onUpdate:modelValue": g[0] || (g[0] = (z) => c.value = z),
|
|
264
|
+
onFocus: te,
|
|
265
|
+
onInput: ee
|
|
266
|
+
}, null, 42, Le), [
|
|
267
|
+
[re, c.value]
|
|
268
|
+
]),
|
|
269
|
+
b.value ? (s(), d("p", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: _(t(w).menu__errorMessage)
|
|
272
|
+
}, h(b.value), 3)) : f("", !0)
|
|
273
|
+
], 2),
|
|
274
|
+
n.addable ? (s(), d("button", {
|
|
275
|
+
key: 0,
|
|
276
|
+
class: _(t(w).menu__addButton),
|
|
277
|
+
onClick: K
|
|
278
|
+
}, h(m.addButtonText), 3)) : f("", !0)
|
|
279
|
+
], 2)) : f("", !0),
|
|
280
|
+
v("ul", {
|
|
281
|
+
class: _(t(w).menu__itemContainer)
|
|
282
|
+
}, [
|
|
283
|
+
(s(!0), d(W, null, X(V, (z, G) => (s(), d("li", {
|
|
284
|
+
key: `${z.value}-${G}`,
|
|
285
|
+
class: _([
|
|
286
|
+
t(w).menu__item,
|
|
287
|
+
{
|
|
288
|
+
[t(w)["menu__item--active"]]: l.value && z.value === l.value.value
|
|
289
|
+
}
|
|
290
|
+
]),
|
|
291
|
+
onClick: (O) => J(z)
|
|
292
|
+
}, h(z.text), 11, je))), 128))
|
|
293
|
+
], 2)
|
|
294
|
+
], 6)), [
|
|
295
|
+
[t(r), { handler: D, exclude: [p.value, o.value] }]
|
|
296
|
+
]) : f("", !0)
|
|
297
|
+
], 64));
|
|
298
|
+
}
|
|
299
|
+
}), He = {
|
|
300
|
+
FilledErrorBox: S(() => import("./FilledErrorBox-Bf-e1gi6.js")),
|
|
301
|
+
LineCheck: S(() => import("./LineCheck-357DQEBn.js")),
|
|
302
|
+
FilledCheckCircle: S(() => import("./FilledCheckCircle-C-8rCgNk.js")),
|
|
303
|
+
LoadingCircle: S(() => import("./LoadingCircle-KaXR2IVD.js")),
|
|
304
|
+
FilledInfoCircle: S(() => import("./FilledInfoCircle-BVuqOp8c.js")),
|
|
305
|
+
SmartIcon: S(() => import("./SmartIcon-Cj_avk5U.js")),
|
|
306
|
+
FilledCautionTriangle: S(() => import("./FilledCautionTriangle-fCoO6aL0.js"))
|
|
307
|
+
}, Fe = /* @__PURE__ */ I({
|
|
308
|
+
__name: "Icon",
|
|
309
|
+
props: {
|
|
310
|
+
name: {},
|
|
311
|
+
size: { default: 16 },
|
|
312
|
+
color: {}
|
|
313
|
+
},
|
|
314
|
+
setup(u) {
|
|
315
|
+
const i = u, r = j(() => typeof i.size == "number" ? `${i.size}px` : i.size);
|
|
316
|
+
return (n, a) => (s(), H(ae(t(He)[n.name]), {
|
|
317
|
+
class: "icon",
|
|
318
|
+
style: P({ width: r.value, height: r.value, fill: i.color || "currentColor" })
|
|
319
|
+
}, null, 8, ["style"]));
|
|
320
|
+
}
|
|
321
|
+
}), Ge = (u, i) => {
|
|
322
|
+
const r = u.__vccOpts || u;
|
|
323
|
+
for (const [n, a] of i)
|
|
324
|
+
r[n] = a;
|
|
325
|
+
return r;
|
|
326
|
+
}, F = /* @__PURE__ */ Ge(Fe, [["__scopeId", "data-v-3e9c3b20"]]), Oe = "_container_2joy4_1", Ne = "_container__text_2joy4_187", Ee = "_container__default_2joy4_191", We = "_container__warning_2joy4_199", Pe = "_container__alert_2joy4_207", Te = "_container__success_2joy4_215", N = {
|
|
327
|
+
container: Oe,
|
|
328
|
+
container__text: Ne,
|
|
329
|
+
container__default: Ee,
|
|
330
|
+
container__warning: We,
|
|
331
|
+
container__alert: Pe,
|
|
332
|
+
container__success: Te
|
|
333
|
+
}, It = /* @__PURE__ */ I({
|
|
334
|
+
__name: "OnPageMessage",
|
|
335
|
+
props: {
|
|
336
|
+
variant: { default: "default" },
|
|
337
|
+
text: {}
|
|
338
|
+
},
|
|
339
|
+
setup(u) {
|
|
340
|
+
const i = u, r = j(() => {
|
|
341
|
+
switch (i.variant) {
|
|
342
|
+
case "alert":
|
|
343
|
+
return "FilledErrorBox";
|
|
344
|
+
case "warning":
|
|
345
|
+
return "FilledCautionTriangle";
|
|
346
|
+
case "success":
|
|
347
|
+
return "FilledCheckCircle";
|
|
348
|
+
default:
|
|
349
|
+
return "FilledInfoCircle";
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
return (n, a) => (s(), d("div", {
|
|
353
|
+
class: _([
|
|
354
|
+
t(N).container,
|
|
355
|
+
t(N)[`container__${n.variant}`]
|
|
356
|
+
])
|
|
357
|
+
}, [
|
|
358
|
+
le(F, {
|
|
359
|
+
name: r.value,
|
|
360
|
+
size: 24
|
|
361
|
+
}, null, 8, ["name"]),
|
|
362
|
+
v("span", {
|
|
363
|
+
class: _(t(N).container__text)
|
|
364
|
+
}, h(n.text), 3)
|
|
365
|
+
], 2));
|
|
366
|
+
}
|
|
367
|
+
}), Re = "_button__size_default_4wo1i_1", De = "_button__size_small_4wo1i_8", Ue = "_button_4wo1i_1", Ae = "_button__label_4wo1i_191", Ye = "_button__solid_4wo1i_330", qe = "_segmentGroup_4wo1i_337", Qe = "_fill_4wo1i_359", k = {
|
|
368
|
+
button__size_default: Re,
|
|
369
|
+
button__size_small: De,
|
|
370
|
+
button: Ue,
|
|
371
|
+
button__label: Ae,
|
|
372
|
+
"button--primary": "_button--primary_4wo1i_208",
|
|
373
|
+
"button--selected": "_button--selected_4wo1i_218",
|
|
374
|
+
"button--secondary": "_button--secondary_4wo1i_231",
|
|
375
|
+
"button--danger": "_button--danger_4wo1i_254",
|
|
376
|
+
"button--warning": "_button--warning_4wo1i_277",
|
|
377
|
+
"button--smart": "_button--smart_4wo1i_300",
|
|
378
|
+
button__solid: Ye,
|
|
379
|
+
segmentGroup: qe,
|
|
380
|
+
"segmentGroup--vertical": "_segmentGroup--vertical_4wo1i_340",
|
|
381
|
+
"segmentGroup--horizontal": "_segmentGroup--horizontal_4wo1i_349",
|
|
382
|
+
fill: Qe
|
|
383
|
+
}, Xe = ["disabled", "onClick"], Bt = /* @__PURE__ */ I({
|
|
384
|
+
__name: "SegmentButton",
|
|
385
|
+
props: {
|
|
386
|
+
color: {},
|
|
387
|
+
size: { default: "default" },
|
|
388
|
+
align: { default: "horizontal" },
|
|
389
|
+
disabled: { type: Boolean, default: !1 },
|
|
390
|
+
segments: {},
|
|
391
|
+
fill: { type: Boolean },
|
|
392
|
+
modelValue: {}
|
|
393
|
+
},
|
|
394
|
+
emits: ["update:modelValue", "click"],
|
|
395
|
+
setup(u, { emit: i }) {
|
|
396
|
+
const r = u, n = i, a = y(r.modelValue || ""), p = (e) => {
|
|
397
|
+
r.disabled || e.disabled || (a.value = e.value, n("update:modelValue", e.value), n("click", e.value));
|
|
398
|
+
};
|
|
399
|
+
E(() => r.modelValue, (e) => {
|
|
400
|
+
a.value = e || "";
|
|
401
|
+
});
|
|
402
|
+
const o = y([...r.segments]);
|
|
403
|
+
return E(() => r.segments, (e) => {
|
|
404
|
+
o.value = [...e], e.some((l) => l.value === a.value) || (a.value = "", n("update:modelValue", ""));
|
|
405
|
+
}, { deep: !0 }), (e, l) => (s(), d("div", {
|
|
406
|
+
class: _([
|
|
407
|
+
t(k).segmentGroup,
|
|
408
|
+
t(k)[`segmentGroup--${e.align}`],
|
|
409
|
+
{ [t(k).fill]: e.fill }
|
|
410
|
+
])
|
|
411
|
+
}, [
|
|
412
|
+
(s(!0), d(W, null, X(o.value, (c, b) => (s(), d("button", {
|
|
413
|
+
key: `${c.value}-${b}`,
|
|
414
|
+
class: _([
|
|
415
|
+
t(k).button,
|
|
416
|
+
t(k)[`button--${e.color}`],
|
|
417
|
+
t(k)[`button__size_${e.size}`],
|
|
418
|
+
t(k).fill,
|
|
419
|
+
{
|
|
420
|
+
[t(k)["button--selected"]]: c.value === a.value
|
|
421
|
+
}
|
|
422
|
+
]),
|
|
423
|
+
disabled: c.disabled || r.disabled,
|
|
424
|
+
onClick: (B) => p(c)
|
|
425
|
+
}, [
|
|
426
|
+
c.icon ? (s(), H(t(F), {
|
|
427
|
+
key: 0,
|
|
428
|
+
name: c.icon
|
|
429
|
+
}, null, 8, ["name"])) : f("", !0),
|
|
430
|
+
c.label ? (s(), d("span", {
|
|
431
|
+
key: 1,
|
|
432
|
+
class: _(t(k).button__label)
|
|
433
|
+
}, h(c.label), 3)) : f("", !0)
|
|
434
|
+
], 10, Xe))), 128))
|
|
435
|
+
], 2));
|
|
436
|
+
}
|
|
437
|
+
}), Ze = "_wrapper__field_1ujuh_1", Je = "_wrapper__label_1ujuh_1", Ke = "_wrapper__errorMessage_1ujuh_1", et = "_wrapper__counter_1ujuh_1", tt = "_wrapper_1ujuh_1", nt = "_wrapper__bottom_1ujuh_220", $ = {
|
|
438
|
+
wrapper__field: Ze,
|
|
439
|
+
wrapper__label: Je,
|
|
440
|
+
wrapper__errorMessage: Ke,
|
|
441
|
+
wrapper__counter: et,
|
|
442
|
+
wrapper: tt,
|
|
443
|
+
wrapper__bottom: nt,
|
|
444
|
+
"wrapper--error": "_wrapper--error_1ujuh_233"
|
|
445
|
+
}, ot = ["for"], rt = ["id", "maxlength", "name", "placeholder", "value"], at = ["id", "maxlength", "name", "placeholder", "value"], Vt = /* @__PURE__ */ I({
|
|
446
|
+
__name: "TextInput",
|
|
447
|
+
props: {
|
|
448
|
+
id: {},
|
|
449
|
+
name: {},
|
|
450
|
+
modelValue: { default: "" },
|
|
451
|
+
label: { default: "" },
|
|
452
|
+
placeholder: { default: "" },
|
|
453
|
+
maxLength: { default: void 0 },
|
|
454
|
+
maxHeight: { default: void 0 },
|
|
455
|
+
error: { default: "" },
|
|
456
|
+
multiline: { type: Boolean, default: !1 },
|
|
457
|
+
autoGrow: { type: Boolean, default: !1 },
|
|
458
|
+
counter: { type: Boolean }
|
|
459
|
+
},
|
|
460
|
+
emits: ["update:modelValue", "input", "change", "paste", "focus", "blur"],
|
|
461
|
+
setup(u, { emit: i }) {
|
|
462
|
+
const r = u, n = i, a = y(null), p = () => {
|
|
463
|
+
if (r.autoGrow && a.value) {
|
|
464
|
+
a.value.style.height = "";
|
|
465
|
+
const e = Math.min(a.value.scrollHeight, r.maxHeight || a.value.scrollHeight);
|
|
466
|
+
a.value.style.height = `${e}px`;
|
|
467
|
+
}
|
|
468
|
+
}, o = (e) => {
|
|
469
|
+
const l = e.target;
|
|
470
|
+
n("input", e), n("update:modelValue", l.value), p();
|
|
471
|
+
};
|
|
472
|
+
return Q(() => {
|
|
473
|
+
p();
|
|
474
|
+
}), (e, l) => {
|
|
475
|
+
var c;
|
|
476
|
+
return s(), d("div", {
|
|
477
|
+
class: _(t($).wrapper)
|
|
478
|
+
}, [
|
|
479
|
+
e.label ? (s(), d("label", {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: _(t($).wrapper__label),
|
|
482
|
+
for: e.id
|
|
483
|
+
}, h(e.label), 11, ot)) : f("", !0),
|
|
484
|
+
e.multiline ? (s(), d("textarea", {
|
|
485
|
+
key: 1,
|
|
486
|
+
id: e.id,
|
|
487
|
+
ref_key: "textareaRef",
|
|
488
|
+
ref: a,
|
|
489
|
+
class: _([
|
|
490
|
+
t($).wrapper__field,
|
|
491
|
+
{
|
|
492
|
+
[t($)["wrapper--error"]]: e.error
|
|
493
|
+
}
|
|
494
|
+
]),
|
|
495
|
+
maxlength: e.maxLength,
|
|
496
|
+
name: e.name,
|
|
497
|
+
placeholder: e.placeholder,
|
|
498
|
+
style: P(e.maxHeight ? { maxHeight: `${e.maxHeight}px` } : void 0),
|
|
499
|
+
value: e.modelValue,
|
|
500
|
+
onBlur: l[0] || (l[0] = (b) => n("blur", b)),
|
|
501
|
+
onChange: l[1] || (l[1] = (b) => e.$emit("change", b)),
|
|
502
|
+
onFocus: l[2] || (l[2] = (b) => n("focus", b)),
|
|
503
|
+
onInput: o,
|
|
504
|
+
onPaste: l[3] || (l[3] = (b) => n("paste", b))
|
|
505
|
+
}, null, 46, rt)) : (s(), d("input", {
|
|
506
|
+
key: 2,
|
|
507
|
+
id: e.id,
|
|
508
|
+
type: "text",
|
|
509
|
+
class: _([
|
|
510
|
+
t($).wrapper__field,
|
|
511
|
+
{
|
|
512
|
+
[t($)["wrapper--error"]]: e.error
|
|
513
|
+
}
|
|
514
|
+
]),
|
|
515
|
+
maxlength: e.maxLength,
|
|
516
|
+
name: e.name,
|
|
517
|
+
placeholder: e.placeholder,
|
|
518
|
+
value: e.modelValue,
|
|
519
|
+
onBlur: l[4] || (l[4] = (b) => n("blur", b)),
|
|
520
|
+
onChange: l[5] || (l[5] = (b) => e.$emit("change", b)),
|
|
521
|
+
onFocus: l[6] || (l[6] = (b) => n("focus", b)),
|
|
522
|
+
onInput: o,
|
|
523
|
+
onPaste: l[7] || (l[7] = (b) => n("paste", b))
|
|
524
|
+
}, null, 42, at)),
|
|
525
|
+
v("div", {
|
|
526
|
+
class: _(t($).wrapper__bottom)
|
|
527
|
+
}, [
|
|
528
|
+
e.error ? (s(), d("div", {
|
|
529
|
+
key: 0,
|
|
530
|
+
class: _(t($).wrapper__errorMessage)
|
|
531
|
+
}, h(e.error), 3)) : f("", !0),
|
|
532
|
+
e.counter ? (s(), d("div", {
|
|
533
|
+
key: 1,
|
|
534
|
+
class: _(t($).wrapper__counter)
|
|
535
|
+
}, h(((c = e.modelValue) == null ? void 0 : c.toString().length) || 0), 3)) : f("", !0)
|
|
536
|
+
], 2)
|
|
537
|
+
], 2);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
}), lt = "_wrapper__label_3sncs_1", _t = "_wrapper__errorMessage_3sncs_1", st = "_wrapper__counter_3sncs_1", ut = "_wrapper_3sncs_1", it = "_wrapper__field_3sncs_8", dt = "_wrapper__size_default_3sncs_185", ct = "_wrapper__size_small_3sncs_188", pt = "_wrapper__bottom_3sncs_225", C = {
|
|
541
|
+
wrapper__label: lt,
|
|
542
|
+
wrapper__errorMessage: _t,
|
|
543
|
+
wrapper__counter: st,
|
|
544
|
+
wrapper: ut,
|
|
545
|
+
wrapper__field: it,
|
|
546
|
+
wrapper__size_default: dt,
|
|
547
|
+
wrapper__size_small: ct,
|
|
548
|
+
wrapper__bottom: pt,
|
|
549
|
+
"wrapper--error": "_wrapper--error_3sncs_238"
|
|
550
|
+
}, mt = ["for"], bt = ["id", "max", "maxlength", "min", "name", "placeholder", "value"], Mt = /* @__PURE__ */ I({
|
|
551
|
+
__name: "NumberInput",
|
|
552
|
+
props: {
|
|
553
|
+
id: {},
|
|
554
|
+
name: {},
|
|
555
|
+
modelValue: { default: "" },
|
|
556
|
+
label: { default: "" },
|
|
557
|
+
placeholder: { default: "" },
|
|
558
|
+
maxLength: { default: void 0 },
|
|
559
|
+
error: { default: "" },
|
|
560
|
+
errorStatus: { type: Boolean },
|
|
561
|
+
counter: { type: Boolean },
|
|
562
|
+
min: { default: void 0 },
|
|
563
|
+
max: { default: void 0 },
|
|
564
|
+
size: { default: "default" }
|
|
565
|
+
},
|
|
566
|
+
emits: ["update:modelValue", "input", "change", "paste", "focus", "blur"],
|
|
567
|
+
setup(u, { emit: i }) {
|
|
568
|
+
const r = u, n = i, a = (o) => {
|
|
569
|
+
var l, c;
|
|
570
|
+
if (o === "")
|
|
571
|
+
return o;
|
|
572
|
+
const e = Number(o);
|
|
573
|
+
return typeof r.min == "number" && e < r.min ? (l = r.min) == null ? void 0 : l.toString() : typeof r.max == "number" && e > r.max ? (c = r.max) == null ? void 0 : c.toString() : e.toString();
|
|
574
|
+
}, p = (o) => {
|
|
575
|
+
const e = o.target, l = a(e.value);
|
|
576
|
+
e.value = l, n("input", o), n("update:modelValue", l);
|
|
577
|
+
};
|
|
578
|
+
return (o, e) => {
|
|
579
|
+
var l;
|
|
580
|
+
return s(), d("div", {
|
|
581
|
+
class: _([t(C).wrapper, t(C)[`wrapper__size_${o.size}`]])
|
|
582
|
+
}, [
|
|
583
|
+
o.label ? (s(), d("label", {
|
|
584
|
+
key: 0,
|
|
585
|
+
class: _(t(C).wrapper__label),
|
|
586
|
+
for: o.id
|
|
587
|
+
}, h(o.label), 11, mt)) : f("", !0),
|
|
588
|
+
v("input", {
|
|
589
|
+
id: o.id,
|
|
590
|
+
type: "number",
|
|
591
|
+
class: _([
|
|
592
|
+
t(C).wrapper__field,
|
|
593
|
+
{
|
|
594
|
+
[t(C)["wrapper--error"]]: o.error || o.errorStatus
|
|
595
|
+
}
|
|
596
|
+
]),
|
|
597
|
+
max: o.max,
|
|
598
|
+
maxlength: o.maxLength,
|
|
599
|
+
min: o.min,
|
|
600
|
+
name: o.name,
|
|
601
|
+
placeholder: o.placeholder,
|
|
602
|
+
value: o.modelValue,
|
|
603
|
+
onBlur: e[0] || (e[0] = (c) => n("blur", c)),
|
|
604
|
+
onChange: e[1] || (e[1] = (c) => o.$emit("change", c)),
|
|
605
|
+
onFocus: e[2] || (e[2] = (c) => n("focus", c)),
|
|
606
|
+
onInput: p,
|
|
607
|
+
onPaste: e[3] || (e[3] = (c) => n("paste", c))
|
|
608
|
+
}, null, 42, bt),
|
|
609
|
+
o.counter || o.error ? (s(), d("div", {
|
|
610
|
+
key: 1,
|
|
611
|
+
class: _(t(C).wrapper__bottom)
|
|
612
|
+
}, [
|
|
613
|
+
o.error ? (s(), d("div", {
|
|
614
|
+
key: 0,
|
|
615
|
+
class: _(t(C).wrapper__errorMessage)
|
|
616
|
+
}, h(o.error), 3)) : f("", !0),
|
|
617
|
+
o.counter ? (s(), d("div", {
|
|
618
|
+
key: 1,
|
|
619
|
+
class: _(t(C).wrapper__counter)
|
|
620
|
+
}, h(((l = o.modelValue) == null ? void 0 : l.toString().length) || 0), 3)) : f("", !0)
|
|
621
|
+
], 2)) : f("", !0)
|
|
622
|
+
], 2);
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
}), ft = "_wrapper_ejnxx_169", wt = "_wrapper__label_ejnxx_176", ht = "_wrapper__input_ejnxx_200", gt = "_wrapper_checked_ejnxx_210", vt = "_wrapper_disabled_ejnxx_217", L = {
|
|
626
|
+
wrapper: ft,
|
|
627
|
+
wrapper__label: wt,
|
|
628
|
+
wrapper__input: ht,
|
|
629
|
+
wrapper_checked: gt,
|
|
630
|
+
wrapper_disabled: vt
|
|
631
|
+
}, zt = ["id", "checked", "disabled", "name"], yt = ["for"], St = /* @__PURE__ */ I({
|
|
632
|
+
__name: "Toggle",
|
|
633
|
+
props: {
|
|
634
|
+
id: {},
|
|
635
|
+
name: {},
|
|
636
|
+
checked: { type: Boolean, default: !1 },
|
|
637
|
+
disabled: { type: Boolean, default: !1 }
|
|
638
|
+
},
|
|
639
|
+
emits: ["click"],
|
|
640
|
+
setup(u, { emit: i }) {
|
|
641
|
+
const r = u, n = i, a = () => {
|
|
642
|
+
n("click", !r.checked);
|
|
643
|
+
};
|
|
644
|
+
return (p, o) => (s(), d("fieldset", {
|
|
645
|
+
class: _([
|
|
646
|
+
t(L).wrapper,
|
|
647
|
+
{
|
|
648
|
+
[t(L).wrapper_checked]: p.checked,
|
|
649
|
+
[t(L).wrapper_disabled]: p.disabled
|
|
650
|
+
}
|
|
651
|
+
])
|
|
652
|
+
}, [
|
|
653
|
+
v("input", {
|
|
654
|
+
id: p.id,
|
|
655
|
+
type: "checkbox",
|
|
656
|
+
checked: p.checked,
|
|
657
|
+
class: _(t(L).wrapper__input),
|
|
658
|
+
disabled: p.disabled,
|
|
659
|
+
name: p.name,
|
|
660
|
+
onClick: a
|
|
661
|
+
}, null, 10, zt),
|
|
662
|
+
v("label", {
|
|
663
|
+
class: _(t(L).wrapper__label),
|
|
664
|
+
for: p.id
|
|
665
|
+
}, null, 10, yt)
|
|
666
|
+
], 2));
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
export {
|
|
670
|
+
F as I,
|
|
671
|
+
Ge as _,
|
|
672
|
+
$t as a,
|
|
673
|
+
Ct as b,
|
|
674
|
+
It as c,
|
|
675
|
+
Bt as d,
|
|
676
|
+
Vt as e,
|
|
677
|
+
Mt as f,
|
|
678
|
+
St as g
|
|
679
|
+
};
|
|
680
|
+
//# sourceMappingURL=index-CvIq_105.js.map
|