whelk-ui 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/index.d.ts +622 -0
- package/dist/whelk-ui.css +1 -1
- package/dist/whelk-ui.js +692 -27
- package/dist/whelk-ui.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/whelk-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as x, openBlock as s, createElementBlock as f, unref as R, renderSlot as L, createCommentVNode as g, toDisplayString as y, useModel as k, computed as _, withDirectives as V, createElementVNode as m, vModelCheckbox as j, mergeModels as $, ref as q, resolveComponent as B, Fragment as O, normalizeClass as A, withKeys as F, createVNode as I, createBlock as h, withCtx as N, createTextVNode as S, vModelText as D, renderList as G, resolveDynamicComponent as K, Transition as E, vShow as U } from "vue";
|
|
2
|
+
const C = {
|
|
3
3
|
Disable: "DISABLE",
|
|
4
4
|
Error: "ERROR",
|
|
5
5
|
Loading: "LOADING",
|
|
@@ -7,35 +7,688 @@ const o = {
|
|
|
7
7
|
LoggingOut: "LOGGING_OUT",
|
|
8
8
|
NoAction: "NO_ACTION",
|
|
9
9
|
Saving: "SAVING"
|
|
10
|
-
},
|
|
10
|
+
}, P = ["disabled"], z = { key: 1 }, X = /* @__PURE__ */ x({
|
|
11
11
|
__name: "ButtonComponent",
|
|
12
12
|
props: {
|
|
13
13
|
objectState: {
|
|
14
14
|
type: String,
|
|
15
|
-
default:
|
|
15
|
+
default: C.NoAction,
|
|
16
16
|
required: !1,
|
|
17
17
|
validator: function(e) {
|
|
18
|
-
return Object.values(
|
|
18
|
+
return Object.values(C).includes(e);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
return (
|
|
24
|
-
disabled: e.objectState !==
|
|
23
|
+
return (a, o) => (s(), f("button", {
|
|
24
|
+
disabled: e.objectState !== R(C).NoAction
|
|
25
25
|
}, [
|
|
26
|
-
e.objectState ===
|
|
27
|
-
e.objectState !==
|
|
28
|
-
], 8,
|
|
26
|
+
e.objectState === R(C).NoAction ? L(a.$slots, "default", { key: 0 }, void 0, !0) : g("", !0),
|
|
27
|
+
e.objectState !== R(C).NoAction ? (s(), f("span", z, y(e.objectState), 1)) : g("", !0)
|
|
28
|
+
], 8, P));
|
|
29
29
|
}
|
|
30
|
-
}),
|
|
31
|
-
const
|
|
32
|
-
for (const [
|
|
33
|
-
|
|
34
|
-
return
|
|
35
|
-
},
|
|
30
|
+
}), b = (e, a) => {
|
|
31
|
+
const o = e.__vccOpts || e;
|
|
32
|
+
for (const [t, i] of a)
|
|
33
|
+
o[t] = i;
|
|
34
|
+
return o;
|
|
35
|
+
}, H = /* @__PURE__ */ b(X, [["__scopeId", "data-v-3de7a432"]]), J = {}, Q = { class: "card" };
|
|
36
|
+
function W(e, a) {
|
|
37
|
+
return s(), f("div", Q, [
|
|
38
|
+
L(e.$slots, "default", {}, void 0, !0)
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
const Y = /* @__PURE__ */ b(J, [["render", W], ["__scopeId", "data-v-025f3983"]]), Z = { class: "checkbox-component" }, ee = ["id", "name"], te = ["for"], ae = /* @__PURE__ */ x({
|
|
42
|
+
__name: "CheckBox",
|
|
43
|
+
props: /* @__PURE__ */ $({
|
|
44
|
+
id: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: !0
|
|
47
|
+
},
|
|
48
|
+
label: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: !0
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
modelValue: {},
|
|
54
|
+
modelModifiers: {}
|
|
55
|
+
}),
|
|
56
|
+
emits: ["update:modelValue"],
|
|
57
|
+
setup(e) {
|
|
58
|
+
const a = k(e, "modelValue"), o = e, t = _(() => `checkbox-${o.id}`);
|
|
59
|
+
return (i, l) => (s(), f("div", Z, [
|
|
60
|
+
V(m("input", {
|
|
61
|
+
id: t.value,
|
|
62
|
+
name: e.label,
|
|
63
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => a.value = n),
|
|
64
|
+
type: "checkbox"
|
|
65
|
+
}, null, 8, ee), [
|
|
66
|
+
[j, a.value]
|
|
67
|
+
]),
|
|
68
|
+
m("label", { for: t.value }, y(o.label), 9, te)
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
}), le = /* @__PURE__ */ b(ae, [["__scopeId", "data-v-39385668"]]), oe = {}, ne = { class: "form-group" };
|
|
72
|
+
function re(e, a) {
|
|
73
|
+
return s(), f("div", ne, [
|
|
74
|
+
L(e.$slots, "default", {}, void 0, !0)
|
|
75
|
+
]);
|
|
76
|
+
}
|
|
77
|
+
const M = /* @__PURE__ */ b(oe, [["render", re], ["__scopeId", "data-v-142c8936"]]), ie = {}, se = { class: "render-error-message" };
|
|
78
|
+
function ue(e, a) {
|
|
79
|
+
return s(), f("span", se, [
|
|
80
|
+
L(e.$slots, "default", {}, void 0, !0)
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
const w = /* @__PURE__ */ b(ie, [["render", ue], ["__scopeId", "data-v-e384ff35"]]), de = ["id"], ce = {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "tooltip-title"
|
|
86
|
+
}, me = { class: "tooltip-message" }, pe = ["data-tooltip-target"], fe = /* @__PURE__ */ x({
|
|
87
|
+
__name: "ToolTip",
|
|
88
|
+
props: {
|
|
89
|
+
id: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: !0
|
|
92
|
+
},
|
|
93
|
+
message: {
|
|
94
|
+
type: String,
|
|
95
|
+
required: !0
|
|
96
|
+
},
|
|
97
|
+
title: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: ""
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
setup(e) {
|
|
103
|
+
const a = e, o = _(() => `tooltip-${a.id}`), t = q("tooltip");
|
|
104
|
+
return (i, l) => {
|
|
105
|
+
const n = B("Info");
|
|
106
|
+
return s(), f(O, null, [
|
|
107
|
+
m("div", {
|
|
108
|
+
id: o.value,
|
|
109
|
+
class: A(t.value),
|
|
110
|
+
role: "tooltip"
|
|
111
|
+
}, [
|
|
112
|
+
a.title !== "" && a.title !== null && a.title !== void 0 ? (s(), f("p", ce, y(a.title), 1)) : g("", !0),
|
|
113
|
+
m("p", me, y(a.message), 1)
|
|
114
|
+
], 10, de),
|
|
115
|
+
m("span", {
|
|
116
|
+
"data-tooltip-target": o.value,
|
|
117
|
+
type: "tooltip",
|
|
118
|
+
onMouseenter: l[0] || (l[0] = (u) => t.value = "tooltip show"),
|
|
119
|
+
onMouseleave: l[1] || (l[1] = (u) => t.value = "tooltip"),
|
|
120
|
+
onFocus: l[2] || (l[2] = (u) => t.value = "tooltip show"),
|
|
121
|
+
onBlur: l[3] || (l[3] = (u) => t.value = "tooltip"),
|
|
122
|
+
onKeydown: l[4] || (l[4] = F((u) => t.value = "tooltip", ["esc"]))
|
|
123
|
+
}, [
|
|
124
|
+
I(n)
|
|
125
|
+
], 40, pe)
|
|
126
|
+
], 64);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}), T = /* @__PURE__ */ b(fe, [["__scopeId", "data-v-5121adbc"]]), ve = ["for"], ge = {
|
|
130
|
+
key: 1,
|
|
131
|
+
"aria-description": "Field is required"
|
|
132
|
+
}, be = ["id", "name"], he = /* @__PURE__ */ x({
|
|
133
|
+
__name: "DatetimeComponent",
|
|
134
|
+
props: /* @__PURE__ */ $({
|
|
135
|
+
isRequired: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !1
|
|
138
|
+
},
|
|
139
|
+
label: {
|
|
140
|
+
type: String,
|
|
141
|
+
required: !0
|
|
142
|
+
},
|
|
143
|
+
tooltipMessage: {
|
|
144
|
+
type: String,
|
|
145
|
+
required: !1,
|
|
146
|
+
default: ""
|
|
147
|
+
},
|
|
148
|
+
tooltipTitle: {
|
|
149
|
+
type: String,
|
|
150
|
+
required: !1,
|
|
151
|
+
default: ""
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
model: {
|
|
155
|
+
type: Date,
|
|
156
|
+
required: !1
|
|
157
|
+
},
|
|
158
|
+
modelModifiers: {}
|
|
159
|
+
}),
|
|
160
|
+
emits: /* @__PURE__ */ $(["isValid"], ["update:model"]),
|
|
161
|
+
setup(e, { emit: a }) {
|
|
162
|
+
const o = a, t = e, i = k(e, "model"), l = q(!1), n = q(""), u = _(() => "input-" + t.label?.toLowerCase()?.replace(" ", "-"));
|
|
163
|
+
function v() {
|
|
164
|
+
l.value = !1, n.value = "";
|
|
165
|
+
let r = Number(i?.value?.toString().length);
|
|
166
|
+
r = isNaN(r) ? 0 : r, t.isRequired && r === 0 && (l.value = !0, n.value = "This field is required"), o("isValid", !l.value);
|
|
167
|
+
}
|
|
168
|
+
return (r, c) => (s(), h(M, { class: "datetime-component" }, {
|
|
169
|
+
default: N(() => [
|
|
170
|
+
m("label", { for: u.value }, [
|
|
171
|
+
t.tooltipMessage !== "" ? (s(), h(T, {
|
|
172
|
+
key: 0,
|
|
173
|
+
title: e.tooltipTitle,
|
|
174
|
+
message: e.tooltipMessage,
|
|
175
|
+
id: u.value
|
|
176
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
177
|
+
S(" " + y(e.label), 1),
|
|
178
|
+
e.isRequired ? (s(), f("span", ge, "*")) : g("", !0)
|
|
179
|
+
], 8, ve),
|
|
180
|
+
V(m("input", {
|
|
181
|
+
id: u.value,
|
|
182
|
+
type: "datetime-local",
|
|
183
|
+
name: t.label,
|
|
184
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => i.value = d),
|
|
185
|
+
onKeyup: v,
|
|
186
|
+
onFocusout: v
|
|
187
|
+
}, null, 40, be), [
|
|
188
|
+
[D, i.value]
|
|
189
|
+
]),
|
|
190
|
+
I(w, { "error-message": n.value }, null, 8, ["error-message"])
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
195
|
+
}), _e = /* @__PURE__ */ b(he, [["__scopeId", "data-v-905d8a98"]]), ye = { class: "drop-down-items" }, $e = ["onClick"], qe = /* @__PURE__ */ x({
|
|
196
|
+
__name: "DropDownItem",
|
|
197
|
+
props: {
|
|
198
|
+
dropDownItems: {
|
|
199
|
+
type: Array,
|
|
200
|
+
required: !0
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
emits: ["dropDownItemClicked"],
|
|
204
|
+
setup(e, { emit: a }) {
|
|
205
|
+
const o = a;
|
|
206
|
+
function t(i) {
|
|
207
|
+
o("dropDownItemClicked", i);
|
|
208
|
+
}
|
|
209
|
+
return (i, l) => (s(), f("div", ye, [
|
|
210
|
+
(s(!0), f(O, null, G(e.dropDownItems, (n) => (s(), f("div", {
|
|
211
|
+
class: "drop-down-item",
|
|
212
|
+
onClick: (u) => t(n.trigger),
|
|
213
|
+
key: n.label
|
|
214
|
+
}, [
|
|
215
|
+
(s(), h(K(n.icon))),
|
|
216
|
+
S(" " + y(n.label), 1)
|
|
217
|
+
], 8, $e))), 128))
|
|
218
|
+
]));
|
|
219
|
+
}
|
|
220
|
+
}), xe = /* @__PURE__ */ b(qe, [["__scopeId", "data-v-eb1af184"]]), Ie = { class: "drop-down" }, Ne = /* @__PURE__ */ x({
|
|
221
|
+
__name: "DropDown",
|
|
222
|
+
props: {
|
|
223
|
+
dropDownItems: {
|
|
224
|
+
type: Array,
|
|
225
|
+
required: !0
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
emits: ["dropDownItemClicked"],
|
|
229
|
+
setup(e, { emit: a }) {
|
|
230
|
+
const o = a, t = q(!1);
|
|
231
|
+
function i() {
|
|
232
|
+
t.value = !t.value;
|
|
233
|
+
}
|
|
234
|
+
function l(n) {
|
|
235
|
+
o("dropDownItemClicked", n), t.value = !1;
|
|
236
|
+
}
|
|
237
|
+
return (n, u) => (s(), f("div", Ie, [
|
|
238
|
+
m("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
onClick: i
|
|
241
|
+
}, [
|
|
242
|
+
L(n.$slots, "default", {}, void 0, !0)
|
|
243
|
+
]),
|
|
244
|
+
I(E, null, {
|
|
245
|
+
default: N(() => [
|
|
246
|
+
V(I(xe, {
|
|
247
|
+
onDropDownItemClicked: l,
|
|
248
|
+
"drop-down-items": e.dropDownItems
|
|
249
|
+
}, null, 8, ["drop-down-items"]), [
|
|
250
|
+
[U, t.value]
|
|
251
|
+
])
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}),
|
|
255
|
+
I(E, null, {
|
|
256
|
+
default: N(() => [
|
|
257
|
+
t.value ? (s(), f("div", {
|
|
258
|
+
key: 0,
|
|
259
|
+
onClick: i,
|
|
260
|
+
class: "drop-down-backdrop"
|
|
261
|
+
})) : g("", !0)
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
})
|
|
265
|
+
]));
|
|
266
|
+
}
|
|
267
|
+
}), ke = /* @__PURE__ */ b(Ne, [["__scopeId", "data-v-755569e8"]]), Ve = ["for"], Se = { class: "number-input-row" }, Me = ["aria-label", "disabled"], Te = ["aria-label", "disabled"], we = /* @__PURE__ */ x({
|
|
268
|
+
__name: "NumberInput",
|
|
269
|
+
props: /* @__PURE__ */ $({
|
|
270
|
+
label: {
|
|
271
|
+
type: String,
|
|
272
|
+
required: !0
|
|
273
|
+
},
|
|
274
|
+
maxValue: {
|
|
275
|
+
type: Number,
|
|
276
|
+
default: Number.MAX_SAFE_INTEGER
|
|
277
|
+
},
|
|
278
|
+
minValue: {
|
|
279
|
+
type: Number,
|
|
280
|
+
default: Number.MIN_SAFE_INTEGER
|
|
281
|
+
},
|
|
282
|
+
stepIncrement: {
|
|
283
|
+
type: Number,
|
|
284
|
+
default: 1
|
|
285
|
+
},
|
|
286
|
+
tooltipMessage: {
|
|
287
|
+
type: String,
|
|
288
|
+
required: !1,
|
|
289
|
+
default: ""
|
|
290
|
+
},
|
|
291
|
+
tooltipTitle: {
|
|
292
|
+
type: String,
|
|
293
|
+
required: !1,
|
|
294
|
+
default: ""
|
|
295
|
+
}
|
|
296
|
+
}, {
|
|
297
|
+
modelValue: {
|
|
298
|
+
type: Number,
|
|
299
|
+
default: 0
|
|
300
|
+
},
|
|
301
|
+
modelModifiers: {}
|
|
302
|
+
}),
|
|
303
|
+
emits: ["update:modelValue"],
|
|
304
|
+
setup(e) {
|
|
305
|
+
const a = e, o = k(e, "modelValue"), t = q(""), i = _(() => "input-" + a.label?.toLowerCase()?.replace(" ", "-")), l = _(() => o.value >= a.maxValue), n = _(() => o.value <= a.minValue);
|
|
306
|
+
function u() {
|
|
307
|
+
if (t.value = "", n.value) {
|
|
308
|
+
t.value = "Reached Lowest Value";
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
let c = Math.abs(a.minValue - o.value);
|
|
312
|
+
c = c < Math.abs(a.stepIncrement) ? c : Math.abs(a.stepIncrement);
|
|
313
|
+
let d = o.value - c;
|
|
314
|
+
d = d > a.maxValue ? a.maxValue : d, o.value = d;
|
|
315
|
+
}
|
|
316
|
+
function v() {
|
|
317
|
+
if (t.value = "", l.value) {
|
|
318
|
+
t.value = "Reached Maxium Value";
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
let c = Math.abs(a.maxValue - o.value);
|
|
322
|
+
c = c < Math.abs(a.stepIncrement) ? c : Math.abs(a.stepIncrement);
|
|
323
|
+
let d = o.value + c;
|
|
324
|
+
d = d < a.minValue ? a.minValue : d, o.value = d;
|
|
325
|
+
}
|
|
326
|
+
function r(c) {
|
|
327
|
+
t.value = "";
|
|
328
|
+
let p = c.target?.valueAsNumber;
|
|
329
|
+
p === void 0 && (t.value = "Model is undefined - default 0", p = 0), isNaN(p) && (t.value = "Not a number - default 0", p = 0), p = p > a.maxValue ? a.maxValue : p, p = p < a.minValue ? a.minValue : p, o.value = p;
|
|
330
|
+
}
|
|
331
|
+
return (c, d) => (s(), h(M, { class: "number-input" }, {
|
|
332
|
+
default: N(() => [
|
|
333
|
+
m("label", { for: i.value }, [
|
|
334
|
+
a.tooltipMessage !== "" ? (s(), h(T, {
|
|
335
|
+
key: 0,
|
|
336
|
+
title: e.tooltipTitle,
|
|
337
|
+
message: e.tooltipMessage,
|
|
338
|
+
id: i.value
|
|
339
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
340
|
+
S(" " + y(e.label), 1)
|
|
341
|
+
], 8, Ve),
|
|
342
|
+
m("div", Se, [
|
|
343
|
+
m("button", {
|
|
344
|
+
type: "button",
|
|
345
|
+
class: "negative",
|
|
346
|
+
"aria-label": `Decrement current value of ${o.value} by ${a.stepIncrement}`,
|
|
347
|
+
disabled: n.value,
|
|
348
|
+
onClick: u
|
|
349
|
+
}, " - ", 8, Me),
|
|
350
|
+
V(m("input", {
|
|
351
|
+
type: "number",
|
|
352
|
+
"aria-label": "Current value picked",
|
|
353
|
+
"aria-describedby": "helper-text-explanation",
|
|
354
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => o.value = p),
|
|
355
|
+
onChange: d[1] || (d[1] = (p) => r(p)),
|
|
356
|
+
onKeyup: d[2] || (d[2] = (p) => r(p))
|
|
357
|
+
}, null, 544), [
|
|
358
|
+
[D, o.value]
|
|
359
|
+
]),
|
|
360
|
+
m("button", {
|
|
361
|
+
type: "button",
|
|
362
|
+
class: "positive",
|
|
363
|
+
"aria-label": `Increment current value of ${o.value} by ${a.stepIncrement}`,
|
|
364
|
+
disabled: l.value,
|
|
365
|
+
onClick: v
|
|
366
|
+
}, " + ", 8, Te)
|
|
367
|
+
]),
|
|
368
|
+
I(w, { "error-message": t.value }, null, 8, ["error-message"])
|
|
369
|
+
]),
|
|
370
|
+
_: 1
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
}), Ce = /* @__PURE__ */ b(we, [["__scopeId", "data-v-06558243"]]), Le = ["for"], De = {
|
|
374
|
+
key: 1,
|
|
375
|
+
"aria-description": "Field is required"
|
|
376
|
+
}, Re = ["id", "name", "placeholder"], Ee = /* @__PURE__ */ x({
|
|
377
|
+
__name: "PasswordInput",
|
|
378
|
+
props: /* @__PURE__ */ $({
|
|
379
|
+
isRequired: {
|
|
380
|
+
type: Boolean,
|
|
381
|
+
default: !1
|
|
382
|
+
},
|
|
383
|
+
label: {
|
|
384
|
+
type: String,
|
|
385
|
+
required: !0
|
|
386
|
+
},
|
|
387
|
+
minLength: {
|
|
388
|
+
type: Number,
|
|
389
|
+
default: 0,
|
|
390
|
+
required: !1,
|
|
391
|
+
validator: (e) => !Number.isNaN(e)
|
|
392
|
+
},
|
|
393
|
+
placeholderText: {
|
|
394
|
+
type: String,
|
|
395
|
+
required: !1,
|
|
396
|
+
default: ""
|
|
397
|
+
},
|
|
398
|
+
tooltipMessage: {
|
|
399
|
+
type: String,
|
|
400
|
+
required: !1,
|
|
401
|
+
default: ""
|
|
402
|
+
},
|
|
403
|
+
tooltipTitle: {
|
|
404
|
+
type: String,
|
|
405
|
+
required: !1,
|
|
406
|
+
default: ""
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
modelValue: {},
|
|
410
|
+
modelModifiers: {}
|
|
411
|
+
}),
|
|
412
|
+
emits: /* @__PURE__ */ $(["isValid"], ["update:modelValue"]),
|
|
413
|
+
setup(e, { emit: a }) {
|
|
414
|
+
const o = a, t = e, i = k(e, "modelValue"), l = q(!1), n = q(""), u = _(() => "input-" + t.label?.toLowerCase()?.replace(" ", "-"));
|
|
415
|
+
function v() {
|
|
416
|
+
l.value = !1, n.value = "";
|
|
417
|
+
let r = Number(i?.value?.toString().length);
|
|
418
|
+
r = isNaN(r) ? 0 : r, t.isRequired && r === 0 && (l.value = !0, n.value = "This field is required"), t.minLength > 0 && r < t.minLength && (l.value = !0, n.value = `This field has a minimum length ${r} / ${t.minLength}`), o("isValid", !l.value);
|
|
419
|
+
}
|
|
420
|
+
return (r, c) => (s(), h(M, { class: "text-input" }, {
|
|
421
|
+
default: N(() => [
|
|
422
|
+
m("label", { for: u.value }, [
|
|
423
|
+
t.tooltipMessage !== "" ? (s(), h(T, {
|
|
424
|
+
key: 0,
|
|
425
|
+
title: e.tooltipTitle,
|
|
426
|
+
message: e.tooltipMessage,
|
|
427
|
+
id: u.value
|
|
428
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
429
|
+
S(" " + y(e.label), 1),
|
|
430
|
+
e.isRequired ? (s(), f("span", De, "*")) : g("", !0)
|
|
431
|
+
], 8, Le),
|
|
432
|
+
V(m("input", {
|
|
433
|
+
id: u.value,
|
|
434
|
+
type: "password",
|
|
435
|
+
name: t.label,
|
|
436
|
+
placeholder: t.placeholderText,
|
|
437
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => i.value = d),
|
|
438
|
+
onKeyup: v,
|
|
439
|
+
onFocusout: v
|
|
440
|
+
}, null, 40, Re), [
|
|
441
|
+
[D, i.value]
|
|
442
|
+
]),
|
|
443
|
+
I(w, { "error-message": n.value }, null, 8, ["error-message"])
|
|
444
|
+
]),
|
|
445
|
+
_: 1
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
}), Oe = /* @__PURE__ */ b(Ee, [["__scopeId", "data-v-d179e9e2"]]), Ae = ["for"], je = { class: "switch-text" }, Be = /* @__PURE__ */ x({
|
|
449
|
+
__name: "SwitchComponent",
|
|
450
|
+
props: /* @__PURE__ */ $({
|
|
451
|
+
label: {
|
|
452
|
+
type: String,
|
|
453
|
+
required: !0
|
|
454
|
+
},
|
|
455
|
+
offText: {
|
|
456
|
+
type: String,
|
|
457
|
+
required: !1,
|
|
458
|
+
default: ""
|
|
459
|
+
},
|
|
460
|
+
onText: {
|
|
461
|
+
type: String,
|
|
462
|
+
required: !1,
|
|
463
|
+
default: ""
|
|
464
|
+
},
|
|
465
|
+
tooltipMessage: {
|
|
466
|
+
type: String,
|
|
467
|
+
required: !1,
|
|
468
|
+
default: ""
|
|
469
|
+
},
|
|
470
|
+
tooltipTitle: {
|
|
471
|
+
type: String,
|
|
472
|
+
required: !1,
|
|
473
|
+
default: ""
|
|
474
|
+
}
|
|
475
|
+
}, {
|
|
476
|
+
modelValue: {
|
|
477
|
+
type: Boolean
|
|
478
|
+
},
|
|
479
|
+
modelModifiers: {}
|
|
480
|
+
}),
|
|
481
|
+
emits: ["update:modelValue"],
|
|
482
|
+
setup(e) {
|
|
483
|
+
const a = e, o = _(() => l.value ? "switch on" : "switch off"), t = _(() => "input-" + a.label?.toLowerCase()?.replace(" ", "-")), i = _(() => l.value ? a.onText : a.offText), l = k(e, "modelValue");
|
|
484
|
+
function n() {
|
|
485
|
+
l.value = !l.value;
|
|
486
|
+
}
|
|
487
|
+
return (u, v) => (s(), h(M, { class: "switch-component" }, {
|
|
488
|
+
default: N(() => [
|
|
489
|
+
m("label", { for: t.value }, [
|
|
490
|
+
a.tooltipMessage !== "" ? (s(), h(T, {
|
|
491
|
+
key: 0,
|
|
492
|
+
title: e.tooltipTitle,
|
|
493
|
+
message: e.tooltipMessage,
|
|
494
|
+
id: t.value
|
|
495
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
496
|
+
S(" " + y(e.label), 1)
|
|
497
|
+
], 8, Ae),
|
|
498
|
+
m("div", {
|
|
499
|
+
onClick: n,
|
|
500
|
+
class: A(o.value)
|
|
501
|
+
}, [
|
|
502
|
+
m("div", je, y(i.value), 1),
|
|
503
|
+
v[0] || (v[0] = m("div", { class: "switch-block" }, null, -1))
|
|
504
|
+
], 2)
|
|
505
|
+
]),
|
|
506
|
+
_: 1
|
|
507
|
+
}));
|
|
508
|
+
}
|
|
509
|
+
}), Fe = /* @__PURE__ */ b(Be, [["__scopeId", "data-v-f28e5f26"]]), Ge = ["for"], Ke = {
|
|
510
|
+
key: 1,
|
|
511
|
+
"aria-description": "Field is required"
|
|
512
|
+
}, Ue = ["id", "name", "placeholder"], Pe = /* @__PURE__ */ x({
|
|
513
|
+
__name: "TextArea",
|
|
514
|
+
props: /* @__PURE__ */ $({
|
|
515
|
+
isRequired: {
|
|
516
|
+
type: Boolean,
|
|
517
|
+
default: !1
|
|
518
|
+
},
|
|
519
|
+
label: {
|
|
520
|
+
type: String,
|
|
521
|
+
required: !0
|
|
522
|
+
},
|
|
523
|
+
minLength: {
|
|
524
|
+
type: Number,
|
|
525
|
+
default: 0,
|
|
526
|
+
required: !1,
|
|
527
|
+
validator: (e) => !Number.isNaN(e)
|
|
528
|
+
},
|
|
529
|
+
maxLength: {
|
|
530
|
+
type: Number,
|
|
531
|
+
default: 0,
|
|
532
|
+
required: !1,
|
|
533
|
+
validator: (e) => !Number.isNaN(e)
|
|
534
|
+
},
|
|
535
|
+
placeholderText: {
|
|
536
|
+
type: String,
|
|
537
|
+
required: !1,
|
|
538
|
+
default: ""
|
|
539
|
+
},
|
|
540
|
+
tooltipMessage: {
|
|
541
|
+
type: String,
|
|
542
|
+
required: !1,
|
|
543
|
+
default: ""
|
|
544
|
+
},
|
|
545
|
+
tooltipTitle: {
|
|
546
|
+
type: String,
|
|
547
|
+
required: !1,
|
|
548
|
+
default: ""
|
|
549
|
+
}
|
|
550
|
+
}, {
|
|
551
|
+
model: {
|
|
552
|
+
type: String,
|
|
553
|
+
required: !1,
|
|
554
|
+
default: ""
|
|
555
|
+
},
|
|
556
|
+
modelModifiers: {}
|
|
557
|
+
}),
|
|
558
|
+
emits: /* @__PURE__ */ $(["isValid"], ["update:model"]),
|
|
559
|
+
setup(e, { emit: a }) {
|
|
560
|
+
const o = a, t = e, i = k(e, "model"), l = q(!1), n = q(""), u = _(() => "input-" + t.label?.toLowerCase()?.replace(" ", "-"));
|
|
561
|
+
function v() {
|
|
562
|
+
l.value = !1, n.value = "";
|
|
563
|
+
let r = Number(i?.value?.toString().length);
|
|
564
|
+
r = isNaN(r) ? 0 : r, t.isRequired && r === 0 && (l.value = !0, n.value = "This field is required"), t.minLength > 0 && r < t.minLength && (l.value = !0, n.value = `This field has a minimum length ${r} / ${t.minLength}`), t.maxLength > 0 && r > t.maxLength && (l.value = !0, n.value = `This field has a maximum length ${r} / ${t.maxLength}`), o("isValid", !l.value);
|
|
565
|
+
}
|
|
566
|
+
return (r, c) => (s(), h(M, null, {
|
|
567
|
+
default: N(() => [
|
|
568
|
+
m("label", { for: u.value }, [
|
|
569
|
+
t.tooltipMessage !== "" ? (s(), h(T, {
|
|
570
|
+
key: 0,
|
|
571
|
+
title: e.tooltipTitle,
|
|
572
|
+
message: e.tooltipMessage,
|
|
573
|
+
id: u.value
|
|
574
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
575
|
+
S(" " + y(e.label), 1),
|
|
576
|
+
e.isRequired ? (s(), f("span", Ke, "*")) : g("", !0)
|
|
577
|
+
], 8, Ge),
|
|
578
|
+
V(m("textarea", {
|
|
579
|
+
rows: "10",
|
|
580
|
+
id: u.value,
|
|
581
|
+
type: "text",
|
|
582
|
+
name: t.label,
|
|
583
|
+
placeholder: t.placeholderText,
|
|
584
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => i.value = d),
|
|
585
|
+
onKeyup: v,
|
|
586
|
+
onFocusout: v
|
|
587
|
+
}, null, 40, Ue), [
|
|
588
|
+
[D, i.value]
|
|
589
|
+
]),
|
|
590
|
+
I(w, { "error-message": n.value }, null, 8, ["error-message"])
|
|
591
|
+
]),
|
|
592
|
+
_: 1
|
|
593
|
+
}));
|
|
594
|
+
}
|
|
595
|
+
}), ze = /* @__PURE__ */ b(Pe, [["__scopeId", "data-v-88c9adeb"]]), Xe = ["for"], He = {
|
|
596
|
+
key: 1,
|
|
597
|
+
"aria-description": "Field is required"
|
|
598
|
+
}, Je = ["id", "name", "placeholder"], Qe = /* @__PURE__ */ x({
|
|
599
|
+
__name: "TextInput",
|
|
600
|
+
props: /* @__PURE__ */ $({
|
|
601
|
+
isRequired: {
|
|
602
|
+
type: Boolean,
|
|
603
|
+
default: !1
|
|
604
|
+
},
|
|
605
|
+
label: {
|
|
606
|
+
type: String,
|
|
607
|
+
required: !0
|
|
608
|
+
},
|
|
609
|
+
minLength: {
|
|
610
|
+
type: Number,
|
|
611
|
+
default: 0,
|
|
612
|
+
required: !1,
|
|
613
|
+
validator: (e) => !Number.isNaN(e)
|
|
614
|
+
},
|
|
615
|
+
maxLength: {
|
|
616
|
+
type: Number,
|
|
617
|
+
default: 0,
|
|
618
|
+
required: !1,
|
|
619
|
+
validator: (e) => !Number.isNaN(e)
|
|
620
|
+
},
|
|
621
|
+
placeholderText: {
|
|
622
|
+
type: String,
|
|
623
|
+
required: !1,
|
|
624
|
+
default: ""
|
|
625
|
+
},
|
|
626
|
+
tooltipMessage: {
|
|
627
|
+
type: String,
|
|
628
|
+
required: !1,
|
|
629
|
+
default: ""
|
|
630
|
+
},
|
|
631
|
+
tooltipTitle: {
|
|
632
|
+
type: String,
|
|
633
|
+
required: !1,
|
|
634
|
+
default: ""
|
|
635
|
+
}
|
|
636
|
+
}, {
|
|
637
|
+
modelValue: { required: !0 },
|
|
638
|
+
modelModifiers: {}
|
|
639
|
+
}),
|
|
640
|
+
emits: /* @__PURE__ */ $(["isValid"], ["update:modelValue"]),
|
|
641
|
+
setup(e, { emit: a }) {
|
|
642
|
+
const o = a, t = e, i = k(e, "modelValue"), l = q(!1), n = q(""), u = _(() => "input-" + t.label?.toLowerCase()?.replace(" ", "-"));
|
|
643
|
+
function v() {
|
|
644
|
+
l.value = !1, n.value = "";
|
|
645
|
+
let r = Number(i?.value?.toString().length);
|
|
646
|
+
r = isNaN(r) ? 0 : r, t.isRequired && r === 0 && (l.value = !0, n.value = "This field is required"), t.minLength > 0 && r < t.minLength && (l.value = !0, n.value = `This field has a minimum length ${r} / ${t.minLength}`), t.maxLength > 0 && r > t.maxLength && (l.value = !0, n.value = `This field has a maximum length ${r} / ${t.maxLength}`), o("isValid", !l.value);
|
|
647
|
+
}
|
|
648
|
+
return (r, c) => (s(), h(M, { class: "text-input" }, {
|
|
649
|
+
default: N(() => [
|
|
650
|
+
m("label", { for: u.value }, [
|
|
651
|
+
t.tooltipMessage !== "" ? (s(), h(T, {
|
|
652
|
+
key: 0,
|
|
653
|
+
title: e.tooltipTitle,
|
|
654
|
+
message: e.tooltipMessage,
|
|
655
|
+
id: u.value
|
|
656
|
+
}, null, 8, ["title", "message", "id"])) : g("", !0),
|
|
657
|
+
S(" " + y(e.label), 1),
|
|
658
|
+
e.isRequired ? (s(), f("span", He, "*")) : g("", !0)
|
|
659
|
+
], 8, Xe),
|
|
660
|
+
V(m("input", {
|
|
661
|
+
id: u.value,
|
|
662
|
+
type: "text",
|
|
663
|
+
name: t.label,
|
|
664
|
+
placeholder: t.placeholderText,
|
|
665
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => i.value = d),
|
|
666
|
+
onKeyup: v,
|
|
667
|
+
onFocusout: v
|
|
668
|
+
}, null, 40, Je), [
|
|
669
|
+
[D, i.value]
|
|
670
|
+
]),
|
|
671
|
+
I(w, { "error-message": n.value }, null, 8, ["error-message"])
|
|
672
|
+
]),
|
|
673
|
+
_: 1
|
|
674
|
+
}));
|
|
675
|
+
}
|
|
676
|
+
}), We = /* @__PURE__ */ b(Qe, [["__scopeId", "data-v-354652ea"]]), Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
36
677
|
__proto__: null,
|
|
37
|
-
ButtonComponent:
|
|
38
|
-
|
|
678
|
+
ButtonComponent: H,
|
|
679
|
+
CardComponent: Y,
|
|
680
|
+
CheckBox: le,
|
|
681
|
+
DatetimeComponent: _e,
|
|
682
|
+
DropDown: ke,
|
|
683
|
+
FormGroup: M,
|
|
684
|
+
NumberInput: Ce,
|
|
685
|
+
PasswordInput: Oe,
|
|
686
|
+
RenderErrorMessage: w,
|
|
687
|
+
SwitchComponent: Fe,
|
|
688
|
+
TextArea: ze,
|
|
689
|
+
TextInput: We,
|
|
690
|
+
ToolTip: T
|
|
691
|
+
}, Symbol.toStringTag, { value: "Module" })), et = {
|
|
39
692
|
customer: "Customer",
|
|
40
693
|
group: "Group",
|
|
41
694
|
kanban_board: "Kanban Board",
|
|
@@ -47,7 +700,7 @@ const o = {
|
|
|
47
700
|
project: "Project",
|
|
48
701
|
task: "Task",
|
|
49
702
|
user: "User"
|
|
50
|
-
},
|
|
703
|
+
}, tt = {
|
|
51
704
|
customer: "customer",
|
|
52
705
|
kanban_board: "kanban_board",
|
|
53
706
|
kanban_card: "kanban_card",
|
|
@@ -57,17 +710,29 @@ const o = {
|
|
|
57
710
|
requirement_item: "requirement_item",
|
|
58
711
|
project: "project",
|
|
59
712
|
task: "task"
|
|
60
|
-
},
|
|
713
|
+
}, at = {
|
|
61
714
|
install(e) {
|
|
62
|
-
Object.entries(
|
|
63
|
-
e.component(
|
|
715
|
+
Object.entries(Ye).forEach(([a, o]) => {
|
|
716
|
+
e.component(a, o);
|
|
64
717
|
});
|
|
65
718
|
}
|
|
66
719
|
};
|
|
67
720
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
721
|
+
H as ButtonComponent,
|
|
722
|
+
Y as CardComponent,
|
|
723
|
+
le as CheckBox,
|
|
724
|
+
_e as DatetimeComponent,
|
|
725
|
+
ke as DropDown,
|
|
726
|
+
M as FormGroup,
|
|
727
|
+
Ce as NumberInput,
|
|
728
|
+
C as ObjectStateEnum,
|
|
729
|
+
et as ObjectTitleCaseEnums,
|
|
730
|
+
tt as ObjectTypeEnums,
|
|
731
|
+
Oe as PasswordInput,
|
|
732
|
+
w as RenderErrorMessage,
|
|
733
|
+
Fe as SwitchComponent,
|
|
734
|
+
ze as TextArea,
|
|
735
|
+
We as TextInput,
|
|
736
|
+
T as ToolTip,
|
|
737
|
+
at as default
|
|
73
738
|
};
|