@useinsider/ab-components 0.0.7 → 0.0.8
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-Den_JoCB.js → FilledCautionTriangle-CH-ggpYw.js} +2 -2
- package/dist/{FilledCautionTriangle-Den_JoCB.js.map → FilledCautionTriangle-CH-ggpYw.js.map} +1 -1
- package/dist/{FilledCheckCircle-BR6BSl0B.js → FilledCheckCircle-CTFsLEFA.js} +2 -2
- package/dist/{FilledCheckCircle-BR6BSl0B.js.map → FilledCheckCircle-CTFsLEFA.js.map} +1 -1
- package/dist/{FilledErrorBox-CzGGEQKK.js → FilledErrorBox-cOfeWLjE.js} +2 -2
- package/dist/{FilledErrorBox-CzGGEQKK.js.map → FilledErrorBox-cOfeWLjE.js.map} +1 -1
- package/dist/{FilledInfoCircle-DD2GTz7X.js → FilledInfoCircle-SQZ-tevO.js} +2 -2
- package/dist/{FilledInfoCircle-DD2GTz7X.js.map → FilledInfoCircle-SQZ-tevO.js.map} +1 -1
- package/dist/{LineCheck-D7vZtNt6.js → LineCheck-Cqr6b9xw.js} +2 -2
- package/dist/{LineCheck-D7vZtNt6.js.map → LineCheck-Cqr6b9xw.js.map} +1 -1
- package/dist/{LoadingCircle-Bzwjmwjs.js → LoadingCircle-DBQ2KdHQ.js} +2 -2
- package/dist/{LoadingCircle-Bzwjmwjs.js.map → LoadingCircle-DBQ2KdHQ.js.map} +1 -1
- package/dist/{SmartIcon-D_SgnXu7.js → SmartIcon-CHS1pqOk.js} +2 -2
- package/dist/{SmartIcon-D_SgnXu7.js.map → SmartIcon-CHS1pqOk.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 +1 -1
- 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-RMe94nFN.js +550 -0
- package/dist/index-RMe94nFN.js.map +1 -0
- package/dist/index.d.ts +9 -6
- package/package.json +1 -1
- package/dist/index-CzHOuBwI.js +0 -537
- package/dist/index-CzHOuBwI.js.map +0 -1
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import { defineComponent as M, computed as L, openBlock as r, createElementBlock as p, normalizeClass as _, unref as t, createBlock as S, createCommentVNode as h, toDisplayString as g, ref as z, reactive as U, onMounted as Y, watch as E, Fragment as N, createElementVNode as C, withDirectives as A, normalizeStyle as W, withModifiers as te, vModelText as ne, renderList as q, defineAsyncComponent as B, resolveDynamicComponent as oe, createVNode as le } from "vue";
|
|
2
|
+
const ae = "_button__size_default_16zzc_1", _e = "_button__size_small_16zzc_8", re = "_button_16zzc_1", se = "_button__label_16zzc_193", ue = "_button__solid_16zzc_205", ie = "_fill_16zzc_1125", V = {
|
|
3
|
+
button__size_default: ae,
|
|
4
|
+
button__size_small: _e,
|
|
5
|
+
button: re,
|
|
6
|
+
button__label: se,
|
|
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: ue,
|
|
35
|
+
fill: ie
|
|
36
|
+
}, ce = ["disabled"], at = /* @__PURE__ */ M({
|
|
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(s, { emit: u }) {
|
|
52
|
+
const o = s, n = u, l = (c) => {
|
|
53
|
+
o.disabled || n("click", c);
|
|
54
|
+
}, m = L(() => o.loadingStatus ? "LoadingCircle" : o.successStatus ? "LineCheck" : o.leftIconName);
|
|
55
|
+
return (c, e) => (r(), p("button", {
|
|
56
|
+
class: _([
|
|
57
|
+
t(V).button,
|
|
58
|
+
t(V)[`button__${c.variant}`],
|
|
59
|
+
t(V)[`button__${c.variant}-${c.color}`],
|
|
60
|
+
t(V)[`button__size_${c.size}`],
|
|
61
|
+
{ [t(V).fill]: c.fill }
|
|
62
|
+
]),
|
|
63
|
+
disabled: o.disabled,
|
|
64
|
+
onClick: l
|
|
65
|
+
}, [
|
|
66
|
+
m.value ? (r(), S(t(H), {
|
|
67
|
+
key: 0,
|
|
68
|
+
name: m.value
|
|
69
|
+
}, null, 8, ["name"])) : h("", !0),
|
|
70
|
+
c.label ? (r(), p("span", {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: _(t(V).button__label)
|
|
73
|
+
}, g(c.label), 3)) : h("", !0),
|
|
74
|
+
c.rightIconName ? (r(), S(t(H), {
|
|
75
|
+
key: 2,
|
|
76
|
+
name: c.rightIconName
|
|
77
|
+
}, null, 8, ["name"])) : h("", !0)
|
|
78
|
+
], 10, ce));
|
|
79
|
+
}
|
|
80
|
+
}), de = {
|
|
81
|
+
mounted(s, u) {
|
|
82
|
+
s.clickOutsideEvent = (o) => {
|
|
83
|
+
[s, ...u.value.exclude || []].some((l) => l && (l === o.target || l.contains(o.target))) || u.value.handler();
|
|
84
|
+
}, document.addEventListener("click", s.clickOutsideEvent);
|
|
85
|
+
},
|
|
86
|
+
unmounted(s) {
|
|
87
|
+
s.clickOutsideEvent && document.removeEventListener("click", s.clickOutsideEvent);
|
|
88
|
+
}
|
|
89
|
+
}, pe = (s, u) => {
|
|
90
|
+
var n;
|
|
91
|
+
let o = 0;
|
|
92
|
+
for (const l of s)
|
|
93
|
+
if (l.toLowerCase() === ((n = u[o]) == null ? void 0 : n.toLowerCase()) && o++, o === u.length)
|
|
94
|
+
return !0;
|
|
95
|
+
return !1;
|
|
96
|
+
}, me = (s, u, o) => {
|
|
97
|
+
if (!o.trim())
|
|
98
|
+
return s;
|
|
99
|
+
const n = o.toLowerCase();
|
|
100
|
+
return s.filter((l) => {
|
|
101
|
+
const m = String(l[u]);
|
|
102
|
+
return pe(m.toLowerCase(), n);
|
|
103
|
+
}).sort((l, m) => {
|
|
104
|
+
const c = String(l[u]).toLowerCase(), e = String(m[u]).toLowerCase();
|
|
105
|
+
return c === n ? -1 : e === n ? 1 : c.startsWith(n) && !e.startsWith(n) ? -1 : !c.startsWith(n) && e.startsWith(n) ? 1 : c.length - e.length;
|
|
106
|
+
});
|
|
107
|
+
}, be = "_dropdown_olekc_1", fe = "_menu_olekc_1", ve = "_dropdown__valueContent_olekc_182", he = "_dropdown__label_olekc_193", ge = "_dropdown__value_olekc_182", we = "_dropdown__placeholder_olekc_200", ze = "_dropdown__arrowIcon_olekc_208", ye = "_menu__searchContainer_olekc_223", ke = "_menu__searchInputWrap_olekc_227", Ce = "_menu__searchInput_olekc_227", Ie = "_menu__errorMessage_olekc_249", $e = "_menu__addButton_olekc_256", xe = "_menu__itemContainer_olekc_264", Be = "_menu__item_olekc_264", f = {
|
|
108
|
+
dropdown: be,
|
|
109
|
+
menu: fe,
|
|
110
|
+
dropdown__valueContent: ve,
|
|
111
|
+
"dropdown__valueContent--open": "_dropdown__valueContent--open_olekc_190",
|
|
112
|
+
dropdown__label: he,
|
|
113
|
+
dropdown__value: ge,
|
|
114
|
+
dropdown__placeholder: we,
|
|
115
|
+
dropdown__arrowIcon: ze,
|
|
116
|
+
menu__searchContainer: ye,
|
|
117
|
+
menu__searchInputWrap: ke,
|
|
118
|
+
menu__searchInput: Ce,
|
|
119
|
+
"menu__searchInput--error": "_menu__searchInput--error_olekc_246",
|
|
120
|
+
menu__errorMessage: Ie,
|
|
121
|
+
menu__addButton: $e,
|
|
122
|
+
menu__itemContainer: xe,
|
|
123
|
+
menu__item: Be,
|
|
124
|
+
"menu__item--active": "_menu__item--active_olekc_302"
|
|
125
|
+
}, Ve = ["for"], Me = ["placeholder"], Le = ["onClick"], _t = /* @__PURE__ */ M({
|
|
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(s, { emit: u }) {
|
|
142
|
+
const o = de, n = s, l = u, m = z(), c = z(), e = z(!1), a = z(null), b = z(""), d = z(null), I = z({ x: 0, y: 0, width: 0, shouldOpenUp: !1, height: n.menuHeight }), $ = U([...n.items]), x = U([...n.items]), P = () => {
|
|
143
|
+
if (!m.value)
|
|
144
|
+
return;
|
|
145
|
+
const { offsetTop: i, offsetLeft: v, offsetWidth: w } = m.value, F = window.innerHeight, G = i + m.value.offsetHeight, D = G + n.menuHeight > F;
|
|
146
|
+
I.value = {
|
|
147
|
+
x: v + window.scrollX,
|
|
148
|
+
y: D ? i + window.scrollY : G + window.scrollY,
|
|
149
|
+
width: w,
|
|
150
|
+
shouldOpenUp: D,
|
|
151
|
+
height: n.menuHeight
|
|
152
|
+
};
|
|
153
|
+
}, Q = () => {
|
|
154
|
+
P(), e.value = !e.value;
|
|
155
|
+
}, j = () => {
|
|
156
|
+
d.value = null, b.value = "", $.splice(0, $.length, ...x);
|
|
157
|
+
}, R = () => {
|
|
158
|
+
e.value = !1, j();
|
|
159
|
+
}, X = (i) => {
|
|
160
|
+
a.value = i, l("select-item", i), l("update:modelValue", i.value), R();
|
|
161
|
+
}, Z = () => {
|
|
162
|
+
const i = b.value.trim(), v = n.validateAddItem(i, x);
|
|
163
|
+
if (v) {
|
|
164
|
+
d.value = v, l("add-error", v);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const w = {
|
|
168
|
+
text: i,
|
|
169
|
+
value: i
|
|
170
|
+
};
|
|
171
|
+
x.push(w), j(), l("item-added", w);
|
|
172
|
+
}, J = () => {
|
|
173
|
+
const i = me(x, "text", b.value);
|
|
174
|
+
$.splice(0, $.length, ...i);
|
|
175
|
+
}, K = () => {
|
|
176
|
+
d.value = "";
|
|
177
|
+
}, ee = L(() => ({
|
|
178
|
+
top: I.value.shouldOpenUp ? `${I.value.y - 10}px` : `${I.value.y}px`,
|
|
179
|
+
left: `${I.value.x}px`,
|
|
180
|
+
width: `${I.value.width}px`,
|
|
181
|
+
height: `${n.menuHeight}px`
|
|
182
|
+
}));
|
|
183
|
+
Y(() => {
|
|
184
|
+
if (P(), n.modelValue) {
|
|
185
|
+
const i = x.find((v) => v.value === n.modelValue);
|
|
186
|
+
i && (a.value = i);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
const T = L(() => a.value ? a.value.text : "");
|
|
190
|
+
return E(
|
|
191
|
+
() => n.items,
|
|
192
|
+
(i) => {
|
|
193
|
+
x.splice(0, x.length, ...i), $.splice(0, $.length, ...i);
|
|
194
|
+
},
|
|
195
|
+
{ deep: !0 }
|
|
196
|
+
), (i, v) => (r(), p(N, null, [
|
|
197
|
+
C("div", {
|
|
198
|
+
ref_key: "dropdownRef",
|
|
199
|
+
ref: m,
|
|
200
|
+
class: _(t(f).dropdown)
|
|
201
|
+
}, [
|
|
202
|
+
i.label ? (r(), p("label", {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: _(t(f).dropdown__label),
|
|
205
|
+
for: i.id
|
|
206
|
+
}, g(i.label), 11, Ve)) : h("", !0),
|
|
207
|
+
C("button", {
|
|
208
|
+
class: _([
|
|
209
|
+
t(f).dropdown__valueContent,
|
|
210
|
+
{
|
|
211
|
+
[t(f)["dropdown__valueContent--open"]]: e.value
|
|
212
|
+
}
|
|
213
|
+
]),
|
|
214
|
+
onClick: Q
|
|
215
|
+
}, [
|
|
216
|
+
C("span", {
|
|
217
|
+
class: _(t(f).dropdown__value)
|
|
218
|
+
}, g(T.value), 3),
|
|
219
|
+
i.placeholder && !T.value ? (r(), p("span", {
|
|
220
|
+
key: 0,
|
|
221
|
+
class: _(t(f).dropdown__placeholder)
|
|
222
|
+
}, g(i.placeholder), 3)) : h("", !0),
|
|
223
|
+
(r(), p("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(f).dropdown__arrowIcon)
|
|
230
|
+
}, v[2] || (v[2] = [
|
|
231
|
+
C("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 ? A((r(), p("div", {
|
|
239
|
+
key: 0,
|
|
240
|
+
ref_key: "menuRef",
|
|
241
|
+
ref: c,
|
|
242
|
+
class: _(t(f).menu),
|
|
243
|
+
style: W(ee.value),
|
|
244
|
+
onClick: v[1] || (v[1] = te(() => {
|
|
245
|
+
}, ["prevent"]))
|
|
246
|
+
}, [
|
|
247
|
+
n.searchable ? (r(), p("div", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: _(t(f).menu__searchContainer)
|
|
250
|
+
}, [
|
|
251
|
+
C("div", {
|
|
252
|
+
class: _(t(f).menu__searchInputWrap)
|
|
253
|
+
}, [
|
|
254
|
+
A(C("input", {
|
|
255
|
+
type: "text",
|
|
256
|
+
class: _([
|
|
257
|
+
t(f).menu__searchInput,
|
|
258
|
+
{
|
|
259
|
+
[t(f)["menu__searchInput--error"]]: d.value
|
|
260
|
+
}
|
|
261
|
+
]),
|
|
262
|
+
placeholder: i.searchPlaceHolder,
|
|
263
|
+
"onUpdate:modelValue": v[0] || (v[0] = (w) => b.value = w),
|
|
264
|
+
onFocus: K,
|
|
265
|
+
onInput: J
|
|
266
|
+
}, null, 42, Me), [
|
|
267
|
+
[ne, b.value]
|
|
268
|
+
]),
|
|
269
|
+
d.value ? (r(), p("p", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: _(t(f).menu__errorMessage)
|
|
272
|
+
}, g(d.value), 3)) : h("", !0)
|
|
273
|
+
], 2),
|
|
274
|
+
n.addable ? (r(), p("button", {
|
|
275
|
+
key: 0,
|
|
276
|
+
class: _(t(f).menu__addButton),
|
|
277
|
+
onClick: Z
|
|
278
|
+
}, g(i.addButtonText), 3)) : h("", !0)
|
|
279
|
+
], 2)) : h("", !0),
|
|
280
|
+
C("ul", {
|
|
281
|
+
class: _(t(f).menu__itemContainer)
|
|
282
|
+
}, [
|
|
283
|
+
(r(!0), p(N, null, q($, (w, F) => (r(), p("li", {
|
|
284
|
+
key: `${w.value}-${F}`,
|
|
285
|
+
class: _([
|
|
286
|
+
t(f).menu__item,
|
|
287
|
+
{
|
|
288
|
+
[t(f)["menu__item--active"]]: a.value && w.value === a.value.value
|
|
289
|
+
}
|
|
290
|
+
]),
|
|
291
|
+
onClick: (G) => X(w)
|
|
292
|
+
}, g(w.text), 11, Le))), 128))
|
|
293
|
+
], 2)
|
|
294
|
+
], 6)), [
|
|
295
|
+
[t(o), { handler: R, exclude: [m.value, c.value] }]
|
|
296
|
+
]) : h("", !0)
|
|
297
|
+
], 64));
|
|
298
|
+
}
|
|
299
|
+
}), Se = {
|
|
300
|
+
FilledErrorBox: B(() => import("./FilledErrorBox-cOfeWLjE.js")),
|
|
301
|
+
LineCheck: B(() => import("./LineCheck-Cqr6b9xw.js")),
|
|
302
|
+
FilledCheckCircle: B(() => import("./FilledCheckCircle-CTFsLEFA.js")),
|
|
303
|
+
LoadingCircle: B(() => import("./LoadingCircle-DBQ2KdHQ.js")),
|
|
304
|
+
FilledInfoCircle: B(() => import("./FilledInfoCircle-SQZ-tevO.js")),
|
|
305
|
+
SmartIcon: B(() => import("./SmartIcon-CHS1pqOk.js")),
|
|
306
|
+
FilledCautionTriangle: B(() => import("./FilledCautionTriangle-CH-ggpYw.js"))
|
|
307
|
+
}, He = /* @__PURE__ */ M({
|
|
308
|
+
__name: "Icon",
|
|
309
|
+
props: {
|
|
310
|
+
name: {},
|
|
311
|
+
size: { default: 16 },
|
|
312
|
+
color: {}
|
|
313
|
+
},
|
|
314
|
+
setup(s) {
|
|
315
|
+
const u = s, o = L(() => typeof u.size == "number" ? `${u.size}px` : u.size);
|
|
316
|
+
return (n, l) => (r(), S(oe(t(Se)[n.name]), {
|
|
317
|
+
class: "icon",
|
|
318
|
+
style: W({ width: o.value, height: o.value, fill: u.color || "currentColor" })
|
|
319
|
+
}, null, 8, ["style"]));
|
|
320
|
+
}
|
|
321
|
+
}), Fe = (s, u) => {
|
|
322
|
+
const o = s.__vccOpts || s;
|
|
323
|
+
for (const [n, l] of u)
|
|
324
|
+
o[n] = l;
|
|
325
|
+
return o;
|
|
326
|
+
}, H = /* @__PURE__ */ Fe(He, [["__scopeId", "data-v-3e9c3b20"]]), Ge = "_container_2joy4_1", Oe = "_container__text_2joy4_187", Ee = "_container__default_2joy4_191", Ne = "_container__warning_2joy4_199", We = "_container__alert_2joy4_207", Pe = "_container__success_2joy4_215", O = {
|
|
327
|
+
container: Ge,
|
|
328
|
+
container__text: Oe,
|
|
329
|
+
container__default: Ee,
|
|
330
|
+
container__warning: Ne,
|
|
331
|
+
container__alert: We,
|
|
332
|
+
container__success: Pe
|
|
333
|
+
}, rt = /* @__PURE__ */ M({
|
|
334
|
+
__name: "OnPageMessage",
|
|
335
|
+
props: {
|
|
336
|
+
variant: { default: "default" },
|
|
337
|
+
text: {}
|
|
338
|
+
},
|
|
339
|
+
setup(s) {
|
|
340
|
+
const u = s, o = L(() => {
|
|
341
|
+
switch (u.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, l) => (r(), p("div", {
|
|
353
|
+
class: _([
|
|
354
|
+
t(O).container,
|
|
355
|
+
t(O)[`container__${n.variant}`]
|
|
356
|
+
])
|
|
357
|
+
}, [
|
|
358
|
+
le(H, {
|
|
359
|
+
name: o.value,
|
|
360
|
+
size: 24
|
|
361
|
+
}, null, 8, ["name"]),
|
|
362
|
+
C("span", {
|
|
363
|
+
class: _(t(O).container__text)
|
|
364
|
+
}, g(n.text), 3)
|
|
365
|
+
], 2));
|
|
366
|
+
}
|
|
367
|
+
}), je = "_button__size_default_150xv_1", Re = "_button__size_small_150xv_8", Te = "_button_150xv_1", De = "_button__label_150xv_193", Ue = "_button__solid_150xv_330", Ae = "_segmentGroup_150xv_337", Ye = "_fill_150xv_359", y = {
|
|
368
|
+
button__size_default: je,
|
|
369
|
+
button__size_small: Re,
|
|
370
|
+
button: Te,
|
|
371
|
+
button__label: De,
|
|
372
|
+
"button--primary": "_button--primary_150xv_208",
|
|
373
|
+
"button--selected": "_button--selected_150xv_218",
|
|
374
|
+
"button--secondary": "_button--secondary_150xv_231",
|
|
375
|
+
"button--danger": "_button--danger_150xv_254",
|
|
376
|
+
"button--warning": "_button--warning_150xv_277",
|
|
377
|
+
"button--smart": "_button--smart_150xv_300",
|
|
378
|
+
button__solid: Ue,
|
|
379
|
+
segmentGroup: Ae,
|
|
380
|
+
"segmentGroup--vertical": "_segmentGroup--vertical_150xv_340",
|
|
381
|
+
"segmentGroup--horizontal": "_segmentGroup--horizontal_150xv_349",
|
|
382
|
+
fill: Ye
|
|
383
|
+
}, qe = ["disabled", "onClick"], st = /* @__PURE__ */ M({
|
|
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(s, { emit: u }) {
|
|
396
|
+
const o = s, n = u, l = z(o.modelValue || ""), m = (e) => {
|
|
397
|
+
o.disabled || e.disabled || (l.value = e.value, n("update:modelValue", e.value), n("click", e.value));
|
|
398
|
+
};
|
|
399
|
+
E(() => o.modelValue, (e) => {
|
|
400
|
+
l.value = e || "";
|
|
401
|
+
});
|
|
402
|
+
const c = z([...o.segments]);
|
|
403
|
+
return E(() => o.segments, (e) => {
|
|
404
|
+
c.value = [...e], e.some((a) => a.value === l.value) || (l.value = "", n("update:modelValue", ""));
|
|
405
|
+
}, { deep: !0 }), (e, a) => (r(), p("div", {
|
|
406
|
+
class: _([
|
|
407
|
+
t(y).segmentGroup,
|
|
408
|
+
t(y)[`segmentGroup--${e.align}`],
|
|
409
|
+
{ [t(y).fill]: e.fill }
|
|
410
|
+
])
|
|
411
|
+
}, [
|
|
412
|
+
(r(!0), p(N, null, q(c.value, (b, d) => (r(), p("button", {
|
|
413
|
+
key: `${b.value}-${d}`,
|
|
414
|
+
class: _([
|
|
415
|
+
t(y).button,
|
|
416
|
+
t(y)[`button--${e.color}`],
|
|
417
|
+
t(y)[`button__size_${e.size}`],
|
|
418
|
+
t(y).fill,
|
|
419
|
+
{
|
|
420
|
+
[t(y)["button--selected"]]: b.value === e.modelValue
|
|
421
|
+
}
|
|
422
|
+
]),
|
|
423
|
+
disabled: b.disabled || o.disabled,
|
|
424
|
+
onClick: (I) => m(b)
|
|
425
|
+
}, [
|
|
426
|
+
b.icon ? (r(), S(t(H), {
|
|
427
|
+
key: 0,
|
|
428
|
+
name: b.icon
|
|
429
|
+
}, null, 8, ["name"])) : h("", !0),
|
|
430
|
+
b.label ? (r(), p("span", {
|
|
431
|
+
key: 1,
|
|
432
|
+
class: _(t(y).button__label)
|
|
433
|
+
}, g(b.label), 3)) : h("", !0)
|
|
434
|
+
], 10, qe))), 128))
|
|
435
|
+
], 2));
|
|
436
|
+
}
|
|
437
|
+
}), Qe = "_wrapper_1pges_169", Xe = "_wrapper__field_1pges_174", Ze = "_wrapper__label_1pges_208", Je = "_wrapper__bottom_1pges_216", Ke = "_wrapper__errorMessage_1pges_220", et = "_wrapper__counter_1pges_225", k = {
|
|
438
|
+
wrapper: Qe,
|
|
439
|
+
wrapper__field: Xe,
|
|
440
|
+
wrapper__label: Ze,
|
|
441
|
+
wrapper__bottom: Je,
|
|
442
|
+
wrapper__errorMessage: Ke,
|
|
443
|
+
wrapper__counter: et,
|
|
444
|
+
"wrapper--error": "_wrapper--error_1pges_231"
|
|
445
|
+
}, tt = ["for"], nt = ["id", "maxlength", "name", "placeholder", "value"], ot = ["id", "maxlength", "name", "placeholder", "value"], ut = /* @__PURE__ */ M({
|
|
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(s, { emit: u }) {
|
|
462
|
+
const o = s, n = u, l = z(null), m = () => {
|
|
463
|
+
if (o.autoGrow && l.value) {
|
|
464
|
+
l.value.style.height = "";
|
|
465
|
+
const e = Math.min(l.value.scrollHeight, o.maxHeight || l.value.scrollHeight);
|
|
466
|
+
l.value.style.height = `${e}px`;
|
|
467
|
+
}
|
|
468
|
+
}, c = (e) => {
|
|
469
|
+
const a = e.target;
|
|
470
|
+
n("input", e), n("update:modelValue", a.value), m();
|
|
471
|
+
};
|
|
472
|
+
return Y(() => {
|
|
473
|
+
m();
|
|
474
|
+
}), (e, a) => {
|
|
475
|
+
var b;
|
|
476
|
+
return r(), p("div", {
|
|
477
|
+
class: _(t(k).wrapper)
|
|
478
|
+
}, [
|
|
479
|
+
e.label ? (r(), p("label", {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: _(t(k).wrapper__label),
|
|
482
|
+
for: e.id
|
|
483
|
+
}, g(e.label), 11, tt)) : h("", !0),
|
|
484
|
+
e.multiline ? (r(), p("textarea", {
|
|
485
|
+
key: 1,
|
|
486
|
+
id: e.id,
|
|
487
|
+
ref_key: "textareaRef",
|
|
488
|
+
ref: l,
|
|
489
|
+
class: _([
|
|
490
|
+
t(k).wrapper__field,
|
|
491
|
+
{
|
|
492
|
+
[t(k)["wrapper--error"]]: e.error
|
|
493
|
+
}
|
|
494
|
+
]),
|
|
495
|
+
maxlength: e.maxLength,
|
|
496
|
+
name: e.name,
|
|
497
|
+
placeholder: e.placeholder,
|
|
498
|
+
style: W(e.maxHeight ? { maxHeight: `${e.maxHeight}px` } : void 0),
|
|
499
|
+
value: e.modelValue,
|
|
500
|
+
onBlur: a[0] || (a[0] = (d) => n("blur", d)),
|
|
501
|
+
onChange: a[1] || (a[1] = (d) => e.$emit("change", d)),
|
|
502
|
+
onFocus: a[2] || (a[2] = (d) => n("focus", d)),
|
|
503
|
+
onInput: c,
|
|
504
|
+
onPaste: a[3] || (a[3] = (d) => n("paste", d))
|
|
505
|
+
}, null, 46, nt)) : (r(), p("input", {
|
|
506
|
+
key: 2,
|
|
507
|
+
id: e.id,
|
|
508
|
+
type: "text",
|
|
509
|
+
class: _([
|
|
510
|
+
t(k).wrapper__field,
|
|
511
|
+
{
|
|
512
|
+
[t(k)["wrapper--error"]]: e.error
|
|
513
|
+
}
|
|
514
|
+
]),
|
|
515
|
+
maxlength: e.maxLength,
|
|
516
|
+
name: e.name,
|
|
517
|
+
placeholder: e.placeholder,
|
|
518
|
+
value: e.modelValue,
|
|
519
|
+
onBlur: a[4] || (a[4] = (d) => n("blur", d)),
|
|
520
|
+
onChange: a[5] || (a[5] = (d) => e.$emit("change", d)),
|
|
521
|
+
onFocus: a[6] || (a[6] = (d) => n("focus", d)),
|
|
522
|
+
onInput: c,
|
|
523
|
+
onPaste: a[7] || (a[7] = (d) => n("paste", d))
|
|
524
|
+
}, null, 42, ot)),
|
|
525
|
+
C("div", {
|
|
526
|
+
class: _(t(k).wrapper__bottom)
|
|
527
|
+
}, [
|
|
528
|
+
e.error ? (r(), p("div", {
|
|
529
|
+
key: 0,
|
|
530
|
+
class: _(t(k).wrapper__errorMessage)
|
|
531
|
+
}, g(e.error), 3)) : h("", !0),
|
|
532
|
+
e.counter ? (r(), p("div", {
|
|
533
|
+
key: 1,
|
|
534
|
+
class: _(t(k).wrapper__counter)
|
|
535
|
+
}, g(((b = e.modelValue) == null ? void 0 : b.toString().length) || 0), 3)) : h("", !0)
|
|
536
|
+
], 2)
|
|
537
|
+
], 2);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
export {
|
|
542
|
+
H as I,
|
|
543
|
+
Fe as _,
|
|
544
|
+
at as a,
|
|
545
|
+
_t as b,
|
|
546
|
+
rt as c,
|
|
547
|
+
st as d,
|
|
548
|
+
ut as e
|
|
549
|
+
};
|
|
550
|
+
//# sourceMappingURL=index-RMe94nFN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-RMe94nFN.js","sources":["../src/components/Button/Button.vue","../src/directives/clickOutside.ts","../src/utils/search.ts","../src/components/Dropdown/DropdownMenu.vue","../src/components/Icon/icons/index.ts","../src/components/Icon/Icon.vue","../src/components/OnPageMessage/OnPageMessage.vue","../src/components/SegmentButton/SegmentButton.vue","../src/components/TextInput/TextInput.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport type { IconNames } from '@/components/Icon/types';\nimport { Icon } from '@/index';\nimport styles from './Button.module.scss';\n\ninterface ButtonProps {\n variant: 'solid' | 'ghost' | 'text' | 'outline';\n color: 'primary' | 'subtle-primary' | 'secondary' | 'danger' | 'warning' | 'smart';\n size?: 'default' | 'small';\n leftIconName?: IconNames;\n rightIconName?: IconNames;\n loadingStatus?: boolean;\n successStatus?: boolean;\n label?: string;\n disabled?: boolean;\n fill?: boolean;\n}\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n loadingStatus: false,\n successStatus: false,\n disabled: false,\n fill: false,\n size: 'default',\n});\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n}>();\n\nconst onClick = (event: MouseEvent) => {\n if (props.disabled) {\n return;\n }\n\n emit('click', event);\n};\n\nconst leftIcon = computed<IconNames | undefined>(() => {\n if (props.loadingStatus) {\n return 'LoadingCircle';\n } else if (props.successStatus) {\n return 'LineCheck';\n }\n\n return props.leftIconName;\n});\n</script>\n\n<template>\n <button\n :class=\"[\n styles.button,\n styles[`button__${variant}`],\n styles[`button__${variant}-${color}`],\n styles[`button__size_${size}`],\n { [styles.fill]: fill },\n ]\"\n :disabled=\"props.disabled\"\n @click=\"onClick\">\n <Icon\n v-if=\"leftIcon\"\n :name=\"leftIcon\" />\n <span\n v-if=\"label\"\n :class=\"styles.button__label\">\n {{ label }}\n </span>\n <Icon\n v-if=\"rightIconName\"\n :name=\"rightIconName\" />\n </button>\n</template>\n","import type { DirectiveBinding } from 'vue';\n\ninterface ClickOutsideElement extends HTMLElement {\n clickOutsideEvent?: (event: Event) => void;\n}\n\nexport default {\n mounted(el: ClickOutsideElement, binding: DirectiveBinding<{ handler: () => void; exclude?: HTMLElement[] }>) {\n el.clickOutsideEvent = (event: Event) => {\n const isClickInside = [el, ...(binding.value.exclude || [])].some(element => {\n return element && (element === event.target || element.contains(event.target as Node))\n });\n\n if (!isClickInside) {\n binding.value.handler(); // Close handler\n }\n };\n\n document.addEventListener('click', el.clickOutsideEvent);\n },\n unmounted(el: ClickOutsideElement) {\n if (el.clickOutsideEvent) {\n document.removeEventListener('click', el.clickOutsideEvent);\n }\n },\n};","const isFuzzyMatch = (choiceValue: string, searchTerm: string): boolean => {\n let searchIndex = 0;\n for (const char of choiceValue) {\n if (char.toLowerCase() === searchTerm[searchIndex]?.toLowerCase()) {\n searchIndex++;\n }\n if (searchIndex === searchTerm.length) {\n return true;\n }\n }\n return false;\n};\n\n\nexport const fuzzySearch = <T>(\n choices: T[],\n key: keyof T,\n searchTerm: string,\n): T[] => {\n if (!searchTerm.trim()) {\n return choices;\n }\n\n const normalizedSearchTerm = searchTerm.toLowerCase();\n\n return choices\n .filter(choice => {\n const value = String(choice[key]);\n\n return isFuzzyMatch(value.toLowerCase(), normalizedSearchTerm)\n })\n .sort((a, b) => {\n const aValue = String(a[key]).toLowerCase();\n const bValue = String(b[key]).toLowerCase();\n\n if (aValue === normalizedSearchTerm) return -1;\n if (bValue === normalizedSearchTerm) return 1;\n\n if (aValue.startsWith(normalizedSearchTerm) && !bValue.startsWith(normalizedSearchTerm))\n return -1;\n if (!aValue.startsWith(normalizedSearchTerm) && bValue.startsWith(normalizedSearchTerm))\n return 1;\n\n return aValue.length - bValue.length;\n });\n};\n","<script lang=\"ts\" setup>\nimport { ref, computed, type StyleValue, onMounted, reactive, watch } from 'vue';\nimport clickOutside from '@/directives/clickOutside';\nimport { fuzzySearch } from '@/utils/search';\nimport styles from './Dropdown.module.scss';\n\nconst vClickOutside = clickOutside;\n\ninterface MenuItem {\n text: string;\n value: string;\n}\n\ninterface DropdownProps {\n id: string;\n label?: string;\n modelValue?: string;\n menuHeight?: number;\n placeholder?: string;\n addable?: boolean;\n addButtonText?: string;\n searchable?: boolean;\n searchPlaceHolder?: string;\n items: MenuItem[];\n validateAddItem?: (item: string, items: MenuItem[]) => string | null;\n}\n\ninterface Emits {\n (e: 'update:modelValue', value: string): void;\n (e: 'add-error', error: string): void;\n (e: 'item-added', item: MenuItem): void;\n (e: 'select-item', item: MenuItem): void;\n}\n\nconst props = withDefaults(defineProps<DropdownProps>(), {\n menuHeight: 154,\n searchBar: false,\n addItem: false,\n modelValue: '',\n validateAddItem: () => null,\n});\n\nconst emit = defineEmits<Emits>();\nconst dropdownRef = ref<HTMLDivElement>();\nconst menuRef = ref<HTMLDivElement>();\nconst isOpen = ref(false);\nconst selectedItem = ref<MenuItem | null>(null);\nconst searchQuery = ref('');\nconst errorMessage = ref<string | null>(null);\nconst menuPosition = ref({ x: 0, y: 0, width: 0, shouldOpenUp: false, height: props.menuHeight });\nconst filteredItems = reactive([...props.items]);\nconst allItems = reactive([...props.items]);\n\nconst calculateMenuPosition = () => {\n if (!dropdownRef.value) {\n return;\n }\n\n const { offsetTop: top, offsetLeft: left, offsetWidth: width } = dropdownRef.value;\n const viewportHeight = window.innerHeight;\n const bottom = top + dropdownRef.value.offsetHeight;\n const shouldOpenUp = bottom + props.menuHeight > viewportHeight;\n\n menuPosition.value = {\n x: left + window.scrollX,\n y: shouldOpenUp ? top + window.scrollY : bottom + window.scrollY,\n width,\n shouldOpenUp,\n height: props.menuHeight,\n };\n};\n\nconst toggleMenu = () => {\n calculateMenuPosition();\n isOpen.value = !isOpen.value;\n};\n\nconst resetSettings = () => {\n errorMessage.value = null;\n searchQuery.value = '';\n filteredItems.splice(0, filteredItems.length, ...allItems);\n};\n\nconst closeMenu = () => {\n isOpen.value = false;\n\n resetSettings();\n};\n\nconst selectItem = (item: MenuItem) => {\n selectedItem.value = item;\n\n emit('select-item', item);\n emit('update:modelValue', item.value);\n\n closeMenu();\n};\n\nconst addItem = () => {\n const query = searchQuery.value.trim();\n const error = props.validateAddItem(query, allItems);\n\n if (error) {\n errorMessage.value = error;\n\n emit('add-error', error);\n\n return;\n }\n\n const newItem: MenuItem = {\n text: query,\n value: query,\n };\n\n allItems.push(newItem);\n resetSettings();\n\n emit('item-added', newItem);\n};\n\nconst onSearch = () => {\n const results = fuzzySearch<MenuItem>(allItems, 'text', searchQuery.value);\n\n filteredItems.splice(0, filteredItems.length, ...results);\n};\n\nconst onFocusSearch = () => {\n errorMessage.value = '';\n};\n\nconst menuStyle = computed<Partial<StyleValue>>(() => ({\n top: menuPosition.value.shouldOpenUp ? `${menuPosition.value.y - 10}px` : `${menuPosition.value.y}px`,\n left: `${menuPosition.value.x}px`,\n width: `${menuPosition.value.width}px`,\n height: `${props.menuHeight}px`,\n}));\n\nonMounted(() => {\n calculateMenuPosition();\n\n if (props.modelValue) {\n const defaultItem = allItems.find(item => item.value === props.modelValue);\n\n if (defaultItem) {\n selectedItem.value = defaultItem;\n }\n }\n});\n\nconst selectedValue = computed(() => (selectedItem.value ? selectedItem.value.text : ''));\n\nwatch(\n () => props.items,\n newItems => {\n allItems.splice(0, allItems.length, ...newItems);\n filteredItems.splice(0, filteredItems.length, ...newItems);\n },\n { deep: true }\n);\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n :class=\"styles.dropdown\">\n <label\n v-if=\"label\"\n :class=\"styles.dropdown__label\"\n :for=\"id\">\n {{ label }}\n </label>\n <button\n :class=\"[\n styles.dropdown__valueContent, {\n [styles['dropdown__valueContent--open']]: isOpen,\n },\n ]\"\n @click=\"toggleMenu\">\n <span :class=\"styles.dropdown__value\">\n {{ selectedValue }}\n </span>\n <span\n v-if=\"placeholder && !selectedValue\"\n :class=\"styles.dropdown__placeholder\">\n {{ placeholder }}\n </span>\n <svg\n fill=\"none\"\n height=\"17\"\n viewBox=\"0 0 16 17\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n :class=\"styles.dropdown__arrowIcon\">\n <path\n d=\"M8 11.2021L4.5359 6.70215L11.4641 6.70215L8 11.2021Z\"\n fill=\"#91949F\" />\n </svg>\n </button>\n </div>\n\n <div\n v-if=\"isOpen\"\n ref=\"menuRef\"\n :class=\"styles.menu\"\n :style=\"menuStyle\"\n v-click-outside=\"{ handler: closeMenu, exclude: [dropdownRef, menuRef] }\"\n @click.prevent>\n <div\n v-if=\"props.searchable\"\n :class=\"styles.menu__searchContainer\">\n <div :class=\"styles.menu__searchInputWrap\">\n <input\n type=\"text\"\n :class=\"[\n styles.menu__searchInput, {\n [styles['menu__searchInput--error']]: errorMessage,\n },\n ]\"\n :placeholder=\"searchPlaceHolder\"\n v-model=\"searchQuery\"\n @focus=\"onFocusSearch\"\n @input=\"onSearch\">\n <p\n v-if=\"errorMessage\"\n :class=\"styles.menu__errorMessage\">\n {{ errorMessage }}\n </p>\n </div>\n <button\n v-if=\"props.addable\"\n :class=\"styles.menu__addButton\"\n @click=\"addItem\">\n {{ addButtonText }}\n </button>\n </div>\n <ul :class=\"styles.menu__itemContainer\">\n <li\n v-for=\"(item, index) in filteredItems\"\n :key=\"`${item.value}-${index}`\"\n :class=\"[\n styles.menu__item, {\n [styles['menu__item--active']]: selectedItem && item.value === selectedItem.value,\n },\n ]\"\n @click=\"selectItem(item)\">\n {{ item.text }}\n </li>\n </ul>\n </div>\n</template>\n","import { defineAsyncComponent } from 'vue';\n\nconst iconMap = {\n FilledErrorBox: defineAsyncComponent(() => import('./FilledErrorBox.vue')),\n LineCheck: defineAsyncComponent(() => import('./LineCheck.vue')),\n FilledCheckCircle: defineAsyncComponent(() => import('./FilledCheckCircle.vue')),\n LoadingCircle: defineAsyncComponent(() => import('./LoadingCircle.vue')),\n FilledInfoCircle: defineAsyncComponent(() => import('./FilledInfoCircle.vue')),\n SmartIcon: defineAsyncComponent(() => import('./SmartIcon.vue')),\n FilledCautionTriangle: defineAsyncComponent(() => import('./FilledCautionTriangle.vue')),\n};\n\nexport default iconMap;\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport iconMap from '@/components/Icon/icons';\nimport type { IconNames } from '@/components/Icon/types';\n\ninterface IconProps {\n name: IconNames;\n size?: 16 | 24;\n color?: string;\n}\n\nconst props = withDefaults(defineProps<IconProps>(), {\n size: 16,\n});\n\nconst iconSize = computed(() => (typeof props.size === 'number' ? `${props.size}px` : props.size));\n</script>\n\n<template>\n <component\n :is=\"iconMap[name]\"\n class=\"icon\"\n :style=\"{ width: iconSize, height: iconSize, fill: props.color || 'currentColor' }\" />\n</template>\n\n<style scoped>\n.icon {\n display: inline-block;\n line-height: 0;\n vertical-align: middle;\n}\n</style>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport Icon from '@/components/Icon/Icon.vue';\nimport type { IconNames } from '@/components/Icon/types';\nimport styles from './OnPageMessage.module.scss';\n\ninterface OnPageMessageProps {\n variant?: 'default' | 'warning' | 'alert' | 'success';\n text: string;\n}\n\nconst props = withDefaults(defineProps<OnPageMessageProps>(), {\n variant: 'default',\n});\n\nconst IconName = computed<IconNames>(() => {\n switch (props.variant) {\n case 'alert': return 'FilledErrorBox';\n case 'warning': return 'FilledCautionTriangle';\n case 'success': return 'FilledCheckCircle';\n\n default: return 'FilledInfoCircle';\n }\n});\n</script>\n\n<template>\n <div\n :class=\"[\n styles.container,\n styles[`container__${variant}`],\n ]\">\n <Icon\n :name=\"IconName\"\n :size=\"24\" />\n <span :class=\"styles.container__text\">{{ text }}</span>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport { ref, watch } from 'vue';\nimport type { IconNames } from '@/components/Icon/types';\nimport { Icon } from '@/index';\nimport styles from './SegmentButton.module.scss';\n\nexport interface SegmentType {\n value: string;\n label: string;\n disabled?: boolean;\n icon?: IconNames;\n}\n\nexport interface SegmentButtonProps {\n color: 'primary' | 'secondary' | 'danger' | 'warning' | 'smart';\n size?: 'default' | 'small';\n align?: 'vertical' | 'horizontal';\n disabled?: boolean;\n segments: SegmentType[];\n fill?: boolean;\n modelValue?: string;\n}\n\ninterface SegmentButtonEmits {\n 'update:modelValue': [value: string];\n click: [value: SegmentType['value']];\n}\n\nconst props = withDefaults(defineProps<SegmentButtonProps>(), {\n loadingStatus: false,\n successStatus: false,\n disabled: false,\n size: 'default',\n align: 'horizontal',\n});\n\nconst emit = defineEmits<SegmentButtonEmits>();\nconst selected = ref<string>(props.modelValue || '');\n\nconst setSelect = (segment: SegmentType) => {\n if (props.disabled || segment.disabled) {\n return;\n }\n\n selected.value = segment.value;\n emit('update:modelValue', segment.value);\n emit('click', segment.value);\n};\n\nwatch(() => props.modelValue, newValue => {\n selected.value = newValue || '';\n});\n\nconst filteredSegments = ref<SegmentType[]>([...props.segments]);\n\nwatch(() => props.segments, newSegments => {\n filteredSegments.value = [...newSegments];\n\n if (!newSegments.some(segment => segment.value === selected.value)) {\n selected.value = '';\n emit('update:modelValue', '');\n }\n}, { deep: true });\n</script>\n\n<template>\n <div\n :class=\"[\n styles.segmentGroup,\n styles[`segmentGroup--${align}`],\n { [styles.fill]: fill },\n ]\">\n <button\n v-for=\"(segment, index) in filteredSegments\"\n :key=\"`${segment.value}-${index}`\"\n :class=\"[\n styles.button,\n styles[`button--${color}`],\n styles[`button__size_${size}`],\n styles.fill,\n {\n [styles[`button--selected`]]: segment.value === modelValue,\n },\n ]\"\n :disabled=\"segment.disabled || props.disabled\"\n @click=\"setSelect(segment)\">\n <Icon\n v-if=\"segment.icon\"\n :name=\"segment.icon\" />\n <span\n v-if=\"segment.label\"\n :class=\"styles.button__label\">\n {{ segment.label }}\n </span>\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue';\nimport styles from './TextInput.module.scss';\n\nexport interface Props {\n id: string;\n name: string;\n modelValue?: string;\n label?: string;\n placeholder?: string;\n maxLength?: number;\n maxHeight?: number;\n error?: string;\n multiline?: boolean;\n autoGrow?: boolean;\n counter?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n label: '',\n placeholder: '',\n maxLength: undefined,\n maxHeight: undefined,\n error: '',\n multiline: false,\n autoGrow: false,\n modelValue: '',\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [Props['modelValue']];\n input: [event: Event];\n change: [event: Event];\n paste: [event: ClipboardEvent];\n focus: [event: FocusEvent];\n blur: [event: FocusEvent];\n}>();\n\nconst textareaRef = ref<HTMLTextAreaElement | null>(null);\n\nconst autoGrow = () => {\n if (props.autoGrow && textareaRef.value) {\n textareaRef.value.style.height = '';\n\n const newHeight = Math.min(textareaRef.value.scrollHeight, props.maxHeight || textareaRef.value.scrollHeight);\n\n textareaRef.value.style.height = `${newHeight}px`;\n }\n};\n\nconst handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n\n emit('input', event);\n emit('update:modelValue', target.value);\n\n autoGrow();\n};\n\nonMounted(() => {\n autoGrow();\n});\n</script>\n\n<template>\n <div :class=\"styles.wrapper\">\n <label\n v-if=\"label\"\n :class=\"styles.wrapper__label\"\n :for=\"id\">\n {{ label }}\n </label>\n <template v-if=\"multiline\">\n <textarea\n :id=\"id\"\n ref=\"textareaRef\"\n :class=\"[\n styles.wrapper__field, {\n [styles['wrapper--error']]: error,\n },\n ]\"\n :maxlength=\"maxLength\"\n :name=\"name\"\n :placeholder=\"placeholder\"\n :style=\"maxHeight ? { maxHeight: `${maxHeight}px` } : undefined\"\n :value=\"modelValue\"\n @blur=\"emit('blur', $event)\"\n @change=\"$emit('change', $event)\"\n @focus=\"emit('focus', $event)\"\n @input=\"handleInput\"\n @paste=\"emit('paste', $event)\" />\n </template>\n <template v-else>\n <input\n :id=\"id\"\n type=\"text\"\n :class=\"[\n styles.wrapper__field, {\n [styles['wrapper--error']]: error,\n },\n ]\"\n :maxlength=\"maxLength\"\n :name=\"name\"\n :placeholder=\"placeholder\"\n :value=\"modelValue\"\n @blur=\"emit('blur', $event)\"\n @change=\"$emit('change', $event)\"\n @focus=\"emit('focus', $event)\"\n @input=\"handleInput\"\n @paste=\"emit('paste', $event)\">\n </template>\n\n <div :class=\"styles.wrapper__bottom\">\n <div\n v-if=\"error\"\n :class=\"styles.wrapper__errorMessage\">\n {{ error }}\n </div>\n <div\n v-if=\"counter\"\n :class=\"styles.wrapper__counter\">\n {{ modelValue?.toString().length || 0 }}\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","onClick","event","leftIcon","computed","clickOutside","el","binding","element","isFuzzyMatch","choiceValue","searchTerm","searchIndex","char","_a","fuzzySearch","choices","key","normalizedSearchTerm","choice","value","a","b","aValue","bValue","vClickOutside","dropdownRef","ref","menuRef","isOpen","selectedItem","searchQuery","errorMessage","menuPosition","filteredItems","reactive","allItems","calculateMenuPosition","top","left","width","viewportHeight","bottom","shouldOpenUp","toggleMenu","resetSettings","closeMenu","selectItem","item","addItem","query","error","newItem","onSearch","results","onFocusSearch","menuStyle","onMounted","defaultItem","selectedValue","watch","newItems","iconMap","defineAsyncComponent","iconSize","IconName","selected","setSelect","segment","newValue","filteredSegments","newSegments","textareaRef","autoGrow","newHeight","handleInput","target"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,UAAMA,IAAQC,GAQRC,IAAOC,GAIPC,IAAU,CAACC,MAAsB;AACnC,MAAIL,EAAM,YAIVE,EAAK,SAASG,CAAK;AAAA,IACvB,GAEMC,IAAWC,EAAgC,MACzCP,EAAM,gBACC,kBACAA,EAAM,gBACN,cAGJA,EAAM,YAChB;;;;;;;;;;;;;;;;;;;;;;;;;;ICzCcQ,KAAA;AAAA,EACX,QAAQC,GAAyBC,GAA6E;AACvG,IAAAD,EAAA,oBAAoB,CAACJ,MAAiB;AAKrC,MAJsB,CAACI,GAAI,GAAIC,EAAQ,MAAM,WAAW,EAAG,EAAE,KAAK,CAAWC,MAClEA,MAAYA,MAAYN,EAAM,UAAUM,EAAQ,SAASN,EAAM,MAAc,EACvF,KAGGK,EAAQ,MAAM,QAAQ;AAAA,IAE9B,GAES,SAAA,iBAAiB,SAASD,EAAG,iBAAiB;AAAA,EAC3D;AAAA,EACA,UAAUA,GAAyB;AAC/B,IAAIA,EAAG,qBACM,SAAA,oBAAoB,SAASA,EAAG,iBAAiB;AAAA,EAC9D;AAER,GCzBMG,KAAe,CAACC,GAAqBC,M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AAA;AACtB,MAAAD,EAAA,QAAQ,CAAC,GAAGC,CAAW,GAEnCA,EAAY,KAAK,CAAAH,MAAWA,EAAQ,UAAUF,EAAS,KAAK,MAC7DA,EAAS,QAAQ,IACjBnE,EAAK,qBAAqB,EAAE;AAAA,IAChC,GACD,EAAE,MAAM,IAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CjB,UAAMF,IAAQC,GAWRC,IAAOC,GASPwE,IAAc7C,EAAgC,IAAI,GAElD8C,IAAW,MAAM;AACf,UAAA5E,EAAM,YAAY2E,EAAY,OAAO;AACzB,QAAAA,EAAA,MAAM,MAAM,SAAS;AAE3B,cAAAE,IAAY,KAAK,IAAIF,EAAY,MAAM,cAAc3E,EAAM,aAAa2E,EAAY,MAAM,YAAY;AAE5G,QAAAA,EAAY,MAAM,MAAM,SAAS,GAAGE,CAAS;AAAA,MAAA;AAAA,IAErD,GAEMC,IAAc,CAACzE,MAAiB;AAClC,YAAM0E,IAAS1E,EAAM;AAErB,MAAAH,EAAK,SAASG,CAAK,GACdH,EAAA,qBAAqB6E,EAAO,KAAK,GAE7BH,EAAA;AAAA,IACb;AAEA,WAAAhB,EAAU,MAAM;AACH,MAAAgB,EAAA;AAAA,IAAA,CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ declare interface OnPageMessageProps {
|
|
|
100
100
|
declare interface Props {
|
|
101
101
|
id: string;
|
|
102
102
|
name: string;
|
|
103
|
-
modelValue
|
|
103
|
+
modelValue?: string;
|
|
104
104
|
label?: string;
|
|
105
105
|
placeholder?: string;
|
|
106
106
|
maxLength?: number;
|
|
@@ -112,9 +112,11 @@ declare interface Props {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export declare const SegmentButton: DefineComponent<SegmentButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
115
|
-
click: (
|
|
115
|
+
click: (value: string) => any;
|
|
116
|
+
"update:modelValue": (value: string) => any;
|
|
116
117
|
}, string, PublicProps, Readonly<SegmentButtonProps> & Readonly<{
|
|
117
|
-
onClick?: ((
|
|
118
|
+
onClick?: ((value: string) => any) | undefined;
|
|
119
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
118
120
|
}>, {
|
|
119
121
|
size: "default" | "small";
|
|
120
122
|
disabled: boolean;
|
|
@@ -128,6 +130,7 @@ declare interface SegmentButtonProps {
|
|
|
128
130
|
disabled?: boolean;
|
|
129
131
|
segments: SegmentType[];
|
|
130
132
|
fill?: boolean;
|
|
133
|
+
modelValue?: string;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
declare interface SegmentType {
|
|
@@ -143,18 +146,18 @@ blur: (event: FocusEvent) => any;
|
|
|
143
146
|
change: (event: Event) => any;
|
|
144
147
|
focus: (event: FocusEvent) => any;
|
|
145
148
|
paste: (event: ClipboardEvent) => any;
|
|
146
|
-
"update:modelValue": (args_0: string |
|
|
149
|
+
"update:modelValue": (args_0: string | undefined) => any;
|
|
147
150
|
}, string, PublicProps, Readonly<Props> & Readonly<{
|
|
148
151
|
onInput?: ((event: Event) => any) | undefined;
|
|
149
152
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
150
153
|
onChange?: ((event: Event) => any) | undefined;
|
|
151
154
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
152
155
|
onPaste?: ((event: ClipboardEvent) => any) | undefined;
|
|
153
|
-
"onUpdate:modelValue"?: ((args_0: string |
|
|
156
|
+
"onUpdate:modelValue"?: ((args_0: string | undefined) => any) | undefined;
|
|
154
157
|
}>, {
|
|
155
158
|
label: string;
|
|
156
159
|
error: string;
|
|
157
|
-
modelValue: string
|
|
160
|
+
modelValue: string;
|
|
158
161
|
placeholder: string;
|
|
159
162
|
maxHeight: number;
|
|
160
163
|
maxLength: number;
|