whelk-ui 0.0.7 → 0.0.9

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