@citruslime/ui 2.0.0-beta.12 → 2.0.0-beta.16

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.
Files changed (26) hide show
  1. package/dist/.stylelintrc.js +12 -0
  2. package/dist/citrus-lime-ui.es.js +1653 -1629
  3. package/dist/citrus-lime-ui.umd.js +2 -2
  4. package/dist/src/components/combo-box/cl-ui-combo-box.vue.d.ts +7 -4
  5. package/dist/src/components/combo-box/search-container/cl-ui-combo-box-search.vue.d.ts +3 -3
  6. package/dist/src/components/combo-box/search-container/header/cl-ui-combo-box-header.vue.d.ts +2 -2
  7. package/dist/src/components/grid/cell/cl-ui-grid-cell.vue.d.ts +3 -2
  8. package/dist/src/components/grid/cl-ui-grid.vue.d.ts +10 -4
  9. package/dist/src/components/grid/filter/cl-ui-grid-filter.vue.d.ts +3 -1
  10. package/dist/src/components/grid/footer/cl-ui-grid-footer.vue.d.ts +3 -1
  11. package/dist/src/components/grid/header/cl-ui-grid-header.vue.d.ts +1 -0
  12. package/dist/src/components/grid/view-manager/cl-ui-grid-view-manager.vue.d.ts +1 -0
  13. package/dist/src/components/header/menu/cl-ui-header-menu.vue.d.ts +2 -2
  14. package/dist/src/components/index.d.ts +0 -2
  15. package/dist/src/components/input/cl-ui-input.vue.d.ts +1 -300
  16. package/dist/src/components/input/utils.d.ts +1 -1
  17. package/dist/src/components/login/cl-ui-login.vue.d.ts +5 -1
  18. package/dist/src/components/slider/cl-ui-slider.vue.d.ts +2 -1
  19. package/dist/src/main.d.ts +2 -0
  20. package/dist/src/utils/extensions/date/types.d.ts +8 -0
  21. package/dist/src/utils/extensions/string/types.d.ts +48 -0
  22. package/dist/src/utils/i18n/types.d.ts +0 -1
  23. package/dist/src/utils/index.d.ts +0 -1
  24. package/dist/style.css +1 -1
  25. package/package.json +5 -2
  26. package/dist/src/utils/extensions/string/index.d.ts +0 -2
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  return target;
32
32
  };
33
33
  import { Icon } from "@iconify/vue";
34
- import { defineComponent, ref, openBlock, createElementBlock, renderSlot, normalizeProps, guardReactiveProps, resolveComponent, Fragment, createElementVNode, normalizeClass, createVNode, Transition, withCtx, withDirectives, vShow, reactive, toRefs, nextTick, createBlock, Teleport, renderList, unref, mergeProps, toDisplayString, computed, watch, onMounted, onUnmounted, createCommentVNode, withKeys, withModifiers, vModelText, isRef, createTextVNode, watchEffect, normalizeStyle, createSlots, vModelDynamic } from "vue";
34
+ import { defineComponent, ref, openBlock, createElementBlock, renderSlot, normalizeProps, guardReactiveProps, resolveComponent, Fragment, createElementVNode, normalizeClass, createVNode, Transition, withCtx, withDirectives, vShow, reactive, toRefs, nextTick, createBlock, Teleport, renderList, unref, mergeProps, toDisplayString, createCommentVNode, computed, watch, onMounted, onUnmounted, isRef, normalizeStyle, vModelText, withModifiers, vModelDynamic, withKeys, createTextVNode, watchEffect, createSlots } from "vue";
35
35
  import { createI18n, useI18n } from "vue-i18n";
36
36
  import Flatpickr from "flatpickr";
37
37
  const _hoisted_1$u = { class: "cl-overflow-hidden" };
@@ -76,7 +76,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
76
76
  const _hoisted_1$t = { class: "cl-absolute cl-left-5 cl-top-5" };
77
77
  const _hoisted_2$n = { class: "cl-font-semibold cl-ml-10 cl-p-4 cl-select-none cl-text-grey-5" };
78
78
  const _hoisted_3$h = { class: "cl-overflow-hidden" };
79
- const _hoisted_4$e = { class: "cl-ml-10 cl-p-4" };
79
+ const _hoisted_4$d = { class: "cl-ml-10 cl-p-4" };
80
80
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
81
81
  props: {
82
82
  open: { type: Boolean },
@@ -118,7 +118,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
118
118
  createElementVNode("div", _hoisted_3$h, [
119
119
  createVNode(Transition, { name: "grow-down" }, {
120
120
  default: withCtx(() => [
121
- withDirectives(createElementVNode("div", _hoisted_4$e, [
121
+ withDirectives(createElementVNode("div", _hoisted_4$d, [
122
122
  renderSlot(_ctx.$slots, "default")
123
123
  ], 512), [
124
124
  [vShow, __props.open]
@@ -183,237 +183,6 @@ function getParamsByName(stringToSearch, paramToFind) {
183
183
  }
184
184
  return valueToReturn;
185
185
  }
186
- function levenshtein(firstString, secondString) {
187
- if (firstString.length === 0) {
188
- return secondString.length;
189
- }
190
- if (secondString.length === 0) {
191
- return firstString.length;
192
- }
193
- if (firstString.length > secondString.length) {
194
- const tmp = firstString;
195
- firstString = secondString;
196
- secondString = tmp;
197
- }
198
- const row = new Int8Array(firstString.length + 1);
199
- for (let i = 0; i <= firstString.length; i++) {
200
- row[i] = i;
201
- }
202
- let temp;
203
- for (let i = 1; i <= secondString.length; i++) {
204
- let prev = i;
205
- const previousChar = secondString[i - 1];
206
- for (let j = 1; j <= firstString.length; j++) {
207
- if (previousChar === firstString[j - 1]) {
208
- temp = row[j - 1];
209
- } else {
210
- const a = prev + 1;
211
- const b = row[j] + 1;
212
- const c = a - (a - b & b - a >> 7);
213
- const d = row[j - 1] + 1;
214
- temp = c - (c - d & d - c >> 7);
215
- }
216
- row[j - 1] = prev;
217
- prev = temp;
218
- }
219
- row[firstString.length] = prev;
220
- }
221
- return row[firstString.length];
222
- }
223
- function camelCaseToArray(camelCase) {
224
- return camelCase.split(/(?=[A-Z])/g);
225
- }
226
- function kebabCaseToArray(kebabCase) {
227
- return kebabCase.split(/(?=-)/g).map((s) => s.replace(/-/g, ""));
228
- }
229
- function pascalCaseToArray(pascalCase) {
230
- return camelCaseToArray(pascalCase);
231
- }
232
- function sentenceCaseToArray(sentenceCase) {
233
- return sentenceCase.split(/ /g).map((s) => s.replace(/[^A-Za-z0-9]/g, ""));
234
- }
235
- function snakeCaseToArray(snakeCase) {
236
- return snakeCase.split(/(?=_)/g).map((s) => s.replace(/_/g, ""));
237
- }
238
- function titleCaseToArray(titleCase) {
239
- return sentenceCaseToArray(titleCase);
240
- }
241
- function arrayToCamelCase(array, locale) {
242
- let result = "";
243
- array.forEach((s, i) => {
244
- result += i === 0 ? s.toLocaleLowerCase(locale) : s.toLocaleLowerCase(locale).firstCharToUpperCase(locale);
245
- });
246
- return result;
247
- }
248
- function arrayToKebabCase(array, lowerCase, locale) {
249
- let result = "";
250
- array.forEach((s) => {
251
- result += `${lowerCase ? s.toLocaleLowerCase(locale) : s.toLocaleUpperCase(locale)}-`;
252
- });
253
- return result.trimEndChar("-");
254
- }
255
- function arrayToSentenceCase(array, locale) {
256
- let result = "";
257
- array.forEach((s, i) => {
258
- result += `${i === 0 ? s.toLowerCase().firstCharToUpperCase(locale) : s.toLocaleLowerCase(locale)} `;
259
- });
260
- return result.trimEndChar(" ");
261
- }
262
- function arrayToTitleCase(array, locale) {
263
- let result = "";
264
- array.forEach((s) => {
265
- result += `${s.toLocaleLowerCase(locale).firstCharToUpperCase(locale)} `;
266
- });
267
- return result.trimEndChar(" ");
268
- }
269
- String.prototype.toDateFromTime = function() {
270
- return new Date(`${new Date().toISOString().substr(0, 11)}${this}`);
271
- };
272
- String.prototype.similarity = function(comparisonString) {
273
- let similarityToReturn = 0;
274
- let longerString = this.toLowerCase();
275
- let shorterString = comparisonString.toLowerCase();
276
- if (longerString < shorterString) {
277
- const temp = shorterString;
278
- shorterString = longerString;
279
- longerString = temp;
280
- }
281
- const longerLength = longerString.length;
282
- if (longerLength === 0) {
283
- similarityToReturn = 100;
284
- } else {
285
- similarityToReturn = Math.round((longerLength - levenshtein(longerString, shorterString)) / longerLength * 100);
286
- }
287
- return similarityToReturn;
288
- };
289
- String.prototype.trimChar = function(character) {
290
- return this.trimStartChar(character).trimEndChar(character);
291
- };
292
- String.prototype.trimStartChar = function(character) {
293
- return character !== "" && this.startsWith(character) ? this.slice(1) : this;
294
- };
295
- String.prototype.trimEndChar = function(character) {
296
- return character !== "" && this.endsWith(character) ? this.slice(0, -1) : this;
297
- };
298
- String.prototype.trimToLength = function(length, addEllipsis = false) {
299
- const trimLength = this.length < length ? this.length : length;
300
- return addEllipsis && trimLength >= 4 && trimLength < this.length ? `${this.slice(0, Math.max(trimLength - 3, 1))}...` : this.slice(0, Math.max(trimLength, 1));
301
- };
302
- String.prototype.firstCharToUpperCase = function(locale) {
303
- return `${this.charAt(0).toLocaleUpperCase(locale)}${this.slice(1)}`;
304
- };
305
- String.prototype.firstCharToLowerCase = function(locale) {
306
- return `${this.charAt(0).toLocaleLowerCase(locale)}${this.slice(1)}`;
307
- };
308
- String.prototype.removeWhitespace = function() {
309
- return this.replace(/\s/g, "");
310
- };
311
- String.prototype.removeNonAlphanumeric = function() {
312
- return this.replace(/[^a-zA-Z0-9]/g, "");
313
- };
314
- String.prototype.removeNonAlphabetic = function() {
315
- return this.replace(/[^a-zA-Z]/g, "");
316
- };
317
- String.prototype.removeNonNumeric = function() {
318
- return this.replace(/[^0-9]/g, "");
319
- };
320
- String.prototype.replacePlaceholders = function(...args) {
321
- let i = 0;
322
- return this.replace(/{\d+}/g, () => typeof args[i] !== "undefined" ? args[i++] : "");
323
- };
324
- String.prototype.camelCaseToKebabCase = function(lowerCase = true, locale) {
325
- return arrayToKebabCase(camelCaseToArray(this), lowerCase, locale);
326
- };
327
- String.prototype.camelCaseToPascalCase = function(locale) {
328
- return this.firstCharToUpperCase(locale);
329
- };
330
- String.prototype.camelCaseToSentenceCase = function(locale) {
331
- return arrayToSentenceCase(camelCaseToArray(this), locale);
332
- };
333
- String.prototype.camelCaseToSnakeCase = function(lowerCase = true, locale) {
334
- return this.camelCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
335
- };
336
- String.prototype.camelCaseToTitleCase = function(locale) {
337
- return arrayToTitleCase(camelCaseToArray(this), locale);
338
- };
339
- String.prototype.kebabCaseToCamelCase = function(locale) {
340
- return arrayToCamelCase(kebabCaseToArray(this), locale);
341
- };
342
- String.prototype.kebabCaseToPascalCase = function(locale) {
343
- return this.kebabCaseToCamelCase().camelCaseToPascalCase(locale);
344
- };
345
- String.prototype.kebabCaseToSentenceCase = function(locale) {
346
- return arrayToSentenceCase(kebabCaseToArray(this), locale);
347
- };
348
- String.prototype.kebabCaseToSnakeCase = function(lowerCase = true, locale) {
349
- const result = this.replace(/-/g, "_");
350
- return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
351
- };
352
- String.prototype.kebabCaseToTitleCase = function(locale) {
353
- return arrayToTitleCase(kebabCaseToArray(this), locale);
354
- };
355
- String.prototype.pascalCaseToCamelCase = function(locale) {
356
- return arrayToCamelCase(pascalCaseToArray(this), locale);
357
- };
358
- String.prototype.pascalCaseToKebabCase = function(lowerCase = true, locale) {
359
- return arrayToKebabCase(pascalCaseToArray(this), lowerCase, locale);
360
- };
361
- String.prototype.pascalCaseToSentenceCase = function(locale) {
362
- return arrayToSentenceCase(pascalCaseToArray(this), locale);
363
- };
364
- String.prototype.pascalCaseToSnakeCase = function(lowerCase = true, locale) {
365
- return this.pascalCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
366
- };
367
- String.prototype.pascalCaseToTitleCase = function(locale) {
368
- return arrayToTitleCase(pascalCaseToArray(this), locale);
369
- };
370
- String.prototype.sentenceCaseToCamelCase = function(locale) {
371
- return arrayToCamelCase(sentenceCaseToArray(this), locale);
372
- };
373
- String.prototype.sentenceCaseToKebabCase = function(lowerCase = true, locale) {
374
- return arrayToKebabCase(sentenceCaseToArray(this), lowerCase, locale);
375
- };
376
- String.prototype.sentenceCaseToPascalCase = function(locale) {
377
- return this.sentenceCaseToCamelCase().camelCaseToPascalCase(locale);
378
- };
379
- String.prototype.sentenceCaseToSnakeCase = function(lowerCase = true, locale) {
380
- return this.sentenceCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
381
- };
382
- String.prototype.sentenceCaseToTitleCase = function(locale) {
383
- return arrayToTitleCase(sentenceCaseToArray(this), locale);
384
- };
385
- String.prototype.snakeCaseToCamelCase = function(locale) {
386
- return arrayToCamelCase(snakeCaseToArray(this), locale);
387
- };
388
- String.prototype.snakeCaseToKebabCase = function(lowerCase = true, locale) {
389
- const result = this.replace(/_/g, "-");
390
- return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
391
- };
392
- String.prototype.snakeCaseToPascalCase = function(locale) {
393
- return this.snakeCaseToCamelCase().camelCaseToPascalCase(locale);
394
- };
395
- String.prototype.snakeCaseToSentenceCase = function(locale) {
396
- return arrayToSentenceCase(snakeCaseToArray(this), locale);
397
- };
398
- String.prototype.snakeCaseToTitleCase = function(locale) {
399
- return arrayToTitleCase(snakeCaseToArray(this), locale);
400
- };
401
- String.prototype.titleCaseToCamelCase = function(locale) {
402
- return arrayToCamelCase(titleCaseToArray(this), locale);
403
- };
404
- String.prototype.titleCaseToKebabCase = function(lowerCase = true, locale) {
405
- return arrayToKebabCase(titleCaseToArray(this), lowerCase, locale);
406
- };
407
- String.prototype.titleCaseToPascalCase = function(locale) {
408
- return this.titleCaseToCamelCase().camelCaseToPascalCase(locale);
409
- };
410
- String.prototype.titleCaseToSentenceCase = function(locale) {
411
- return arrayToSentenceCase(titleCaseToArray(this), locale);
412
- };
413
- String.prototype.titleCaseToSnakeCase = function(lowerCase = true, locale) {
414
- return this.titleCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
415
- };
416
- const stringExtensionsEnabled = true;
417
186
  var NumberFormat;
418
187
  (function(NumberFormat2) {
419
188
  NumberFormat2["CURRENCY"] = "currency";
@@ -503,8 +272,7 @@ const messages = {
503
272
  login: "Login",
504
273
  email: "Email Address",
505
274
  password: "Password",
506
- validEmail: "Username is a valid email address.",
507
- invalidEmail: "Username must be a valid email address."
275
+ validEmail: "Username is a valid email address."
508
276
  },
509
277
  slider: {
510
278
  invalidProps: "The current combination of props is invalid. Please confirm the values provided are correct."
@@ -878,32 +646,88 @@ const buttonSizes = [
878
646
  "medium",
879
647
  "large"
880
648
  ];
881
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
882
- var de = { exports: {} };
883
- (function(module, exports) {
884
- (function(global2, factory) {
885
- factory(exports);
886
- })(commonjsGlobal, function(exports2) {
887
- var fp = typeof window !== "undefined" && window.flatpickr !== void 0 ? window.flatpickr : {
888
- l10ns: {}
889
- };
890
- var German = {
891
- weekdays: {
892
- shorthand: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
893
- longhand: [
894
- "Sonntag",
895
- "Montag",
896
- "Dienstag",
897
- "Mittwoch",
898
- "Donnerstag",
899
- "Freitag",
900
- "Samstag"
901
- ]
902
- },
903
- months: {
904
- shorthand: [
905
- "Jan",
906
- "Feb",
649
+ const _hoisted_1$n = { key: 0 };
650
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
651
+ props: {
652
+ size: { default: "medium" },
653
+ hover: { type: Boolean, default: false }
654
+ },
655
+ setup(__props) {
656
+ return (_ctx, _cache) => {
657
+ return openBlock(), createElementBlock("div", {
658
+ class: normalizeClass(["cl-border cl-border-transparent cl-overflow-hidden cl-relative cl-rounded-md cl-shadow-lg cl-transition-all", {
659
+ "cl-cursor-pointer hover:cl-shadow-xl hover:cl-border-grey-0": __props.hover
660
+ }])
661
+ }, [
662
+ _ctx.$slots.image ? (openBlock(), createElementBlock("div", _hoisted_1$n, [
663
+ renderSlot(_ctx.$slots, "image")
664
+ ])) : createCommentVNode("", true),
665
+ _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
666
+ key: 1,
667
+ class: normalizeClass(["cl-border-grey-2 cl-font-normal", {
668
+ "cl-p-2 cl-text-2xl cl-leading-8": __props.size === "small",
669
+ "cl-p-4 cl-text-3xl cl-leading-9": __props.size === "medium",
670
+ "cl-p-6 cl-text-4xl cl-leading-10": __props.size === "large",
671
+ "cl-border-t": _ctx.$slots.image
672
+ }])
673
+ }, [
674
+ renderSlot(_ctx.$slots, "title")
675
+ ], 2)) : createCommentVNode("", true),
676
+ createElementVNode("div", {
677
+ class: normalizeClass(["cl-border-grey-2", {
678
+ "cl-p-2": __props.size === "small",
679
+ "cl-p-4": __props.size === "medium",
680
+ "cl-p-6": __props.size === "large",
681
+ "cl-border-t": _ctx.$slots.image || _ctx.$slots.title
682
+ }])
683
+ }, [
684
+ renderSlot(_ctx.$slots, "default")
685
+ ], 2),
686
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
687
+ key: 2,
688
+ class: normalizeClass(["cl-border-grey-2 cl-border-t", {
689
+ "cl-p-2": __props.size === "small",
690
+ "cl-p-4": __props.size === "medium",
691
+ "cl-p-6": __props.size === "large"
692
+ }])
693
+ }, [
694
+ renderSlot(_ctx.$slots, "footer")
695
+ ], 2)) : createCommentVNode("", true)
696
+ ], 2);
697
+ };
698
+ }
699
+ });
700
+ const cardSizes = [
701
+ "small",
702
+ "medium",
703
+ "large"
704
+ ];
705
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
706
+ var de = { exports: {} };
707
+ (function(module, exports) {
708
+ (function(global2, factory) {
709
+ factory(exports);
710
+ })(commonjsGlobal, function(exports2) {
711
+ var fp = typeof window !== "undefined" && window.flatpickr !== void 0 ? window.flatpickr : {
712
+ l10ns: {}
713
+ };
714
+ var German = {
715
+ weekdays: {
716
+ shorthand: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
717
+ longhand: [
718
+ "Sonntag",
719
+ "Montag",
720
+ "Dienstag",
721
+ "Mittwoch",
722
+ "Donnerstag",
723
+ "Freitag",
724
+ "Samstag"
725
+ ]
726
+ },
727
+ months: {
728
+ shorthand: [
729
+ "Jan",
730
+ "Feb",
907
731
  "M\xE4r",
908
732
  "Apr",
909
733
  "Mai",
@@ -1313,7 +1137,7 @@ function generateFixedDate() {
1313
1137
  return new Date(`${FixedDate.YEAR}-${FixedDate.MONTH}-${FixedDate.DAY}T${FixedDate.HOUR}:${FixedDate.MINUTE}`);
1314
1138
  }
1315
1139
  function replaceDateWithPlaceholders(date, hourPlaceholder, yearPlaceholder) {
1316
- return date.replace(FixedDate.YEAR, yearPlaceholder).replace(FixedDate.HOUR, hourPlaceholder).replace(FixedDate.MONTH, "m").replace(FixedDate.MONTH_SHORT, "n").replace(FixedDate.DAY, "d").replace(FixedDate.DAY_SHORT, "j").replace(FixedDate.MINUTE, "i").replace(FixedDate.SUFFIX, "K").replace(",", "");
1140
+ return date.replace(FixedDate.YEAR, yearPlaceholder).replace(FixedDate.HOUR, hourPlaceholder).replace(FixedDate.MONTH, "m").replace(FixedDate.MONTH_SHORT, "n").replace(FixedDate.DAY, "d").replace(FixedDate.DAY_SHORT, "j").replace(FixedDate.MINUTE, "i").replace(FixedDate.SUFFIX, "K");
1317
1141
  }
1318
1142
  function getLocale(locale) {
1319
1143
  let result;
@@ -1367,9 +1191,9 @@ function getFormattedTimeForMinMax(date) {
1367
1191
  return formatted;
1368
1192
  }
1369
1193
  var clUiCalendar_vue_vue_type_style_index_0_lang = "";
1370
- const _hoisted_1$n = ["placeholder", "disabled"];
1371
- const _hoisted_2$l = { class: "cl-absolute cl-bg-white cl-flex cl-right-2 cl-text-grey-4 cl-top-3" };
1372
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
1194
+ const _hoisted_1$m = ["placeholder", "disabled"];
1195
+ const _hoisted_2$l = { class: "cl-absolute cl-bg-white cl-flex cl-right-2 cl-text-grey-4 cl-top-3.5" };
1196
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1373
1197
  props: {
1374
1198
  date: { default: () => null },
1375
1199
  datePlaceholder: { default: "Select date." },
@@ -1553,16 +1377,13 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1553
1377
  element.value = _value;
1554
1378
  }
1555
1379
  }, _ctx.$attrs, {
1556
- class: ["!cl-text-sm", {
1557
- "!cl-pr-12": __props.date !== null,
1558
- "!cl-pr-8": __props.date === null
1559
- }],
1380
+ class: ["!cl-text-sm cl-border-grey-1 cl-rounded-lg focus:cl-border-blue-light focus:cl-ring-0", { "cl-bg-off-white": __props.disabled }],
1560
1381
  type: "text",
1561
1382
  placeholder: unref(placeholder),
1562
1383
  disabled: __props.disabled
1563
- }), null, 16, _hoisted_1$n),
1384
+ }), null, 16, _hoisted_1$m),
1564
1385
  withDirectives(createVNode(_component_icon, {
1565
- class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3", {
1386
+ class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3.5", {
1566
1387
  "!cl-bg-off-white": __props.disabled
1567
1388
  }]),
1568
1389
  icon: "ph:calendar",
@@ -1572,7 +1393,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1572
1393
  [vShow, (__props.date === null || __props.disabled) && __props.type !== "time"]
1573
1394
  ]),
1574
1395
  withDirectives(createVNode(_component_icon, {
1575
- class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3", {
1396
+ class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3.5", {
1576
1397
  "!cl-bg-off-white": __props.disabled
1577
1398
  }]),
1578
1399
  icon: "ph-clock",
@@ -1606,580 +1427,1027 @@ const calendarTypes = [
1606
1427
  "datetime",
1607
1428
  "time"
1608
1429
  ];
1609
- const _hoisted_1$m = { key: 0 };
1610
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
1430
+ var clUiSlider_vue_vue_type_style_index_0_scoped_true_lang = "";
1431
+ const _hoisted_1$l = { class: "cl-flex cl-flex-wrap cl-items-center" };
1432
+ const _hoisted_2$k = { class: "cl-flex cl-flex-1 cl-flex-wrap cl-items-center cl-mb-2 cl-mt-3 cl-relative md:cl-mt-0" };
1433
+ const _hoisted_3$g = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-0 cl-px-3 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
1434
+ const _hoisted_4$c = {
1435
+ key: 0,
1436
+ class: "cl-w-full"
1437
+ };
1438
+ const _hoisted_5$9 = ["min", "max", "step", "disabled"];
1439
+ const _hoisted_6$7 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-2 cl-px-3 cl-right-0 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
1440
+ const _hoisted_7$7 = {
1441
+ key: 1,
1442
+ class: "emphasis-danger text-sm w-full"
1443
+ };
1444
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1611
1445
  props: {
1612
- size: { default: "medium" },
1613
- hover: { type: Boolean, default: false }
1446
+ value: null,
1447
+ min: null,
1448
+ max: null,
1449
+ step: { default: 1 },
1450
+ enforceStep: { type: Boolean, default: false },
1451
+ disabled: { type: Boolean, default: false },
1452
+ showNumericInput: { type: Boolean, default: true }
1614
1453
  },
1615
- setup(__props) {
1454
+ emits: {
1455
+ "update:value": null
1456
+ },
1457
+ setup(__props, { emit }) {
1458
+ const props = __props;
1459
+ const { n, t: t2 } = useI18n();
1460
+ const { debounce } = useDebouncer();
1461
+ const numericInputValue = ref(props.value);
1462
+ const currentValue = computed({
1463
+ get: () => props.value,
1464
+ set: (value) => emit("update:value", value)
1465
+ });
1466
+ const colour = computed(() => props.disabled ? "rgba(153, 153, 153, 0.8)" : "#9acd32");
1467
+ const percentage = computed(() => {
1468
+ let value = (currentValue.value - props.min) / (props.max - props.min) * 100;
1469
+ if (value < 35 && value > 0) {
1470
+ if (value < 20) {
1471
+ value += 0.5;
1472
+ } else {
1473
+ value += 0.25;
1474
+ }
1475
+ } else if (value > 65 && value < 100) {
1476
+ if (value > 80) {
1477
+ value -= 0.5;
1478
+ } else {
1479
+ value -= 0.25;
1480
+ }
1481
+ }
1482
+ return value;
1483
+ });
1484
+ const validProps = computed(() => props.min <= props.max && props.step > 0);
1485
+ function updateCurrentValue(target, forceUpdate) {
1486
+ var _a;
1487
+ const inputValue = (_a = target == null ? void 0 : target.value) != null ? _a : "";
1488
+ const value = Math.max(Math.min(parseFloat(inputValue) || props.min, props.max), props.min);
1489
+ currentValue.value = props.enforceStep ? Math.ceil(value / props.step) * props.step : value;
1490
+ nextTick(() => forceUpdate());
1491
+ }
1492
+ watch(() => props.value, () => numericInputValue.value = props.value);
1616
1493
  return (_ctx, _cache) => {
1617
- return openBlock(), createElementBlock("div", {
1618
- class: normalizeClass(["cl-border cl-border-transparent cl-overflow-hidden cl-relative cl-rounded-md cl-shadow-lg cl-transition-all", {
1619
- "cl-cursor-pointer hover:cl-shadow-xl hover:cl-border-grey-0": __props.hover
1620
- }])
1621
- }, [
1622
- _ctx.$slots.image ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
1623
- renderSlot(_ctx.$slots, "image")
1624
- ])) : createCommentVNode("", true),
1625
- _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
1626
- key: 1,
1627
- class: normalizeClass(["cl-border-grey-2 cl-font-normal", {
1628
- "cl-p-2 cl-text-2xl cl-leading-8": __props.size === "small",
1629
- "cl-p-4 cl-text-3xl cl-leading-9": __props.size === "medium",
1630
- "cl-p-6 cl-text-4xl cl-leading-10": __props.size === "large",
1631
- "cl-border-t": _ctx.$slots.image
1632
- }])
1633
- }, [
1634
- renderSlot(_ctx.$slots, "title")
1635
- ], 2)) : createCommentVNode("", true),
1636
- createElementVNode("div", {
1637
- class: normalizeClass(["cl-border-grey-2", {
1638
- "cl-p-2": __props.size === "small",
1639
- "cl-p-4": __props.size === "medium",
1640
- "cl-p-6": __props.size === "large",
1641
- "cl-border-t": _ctx.$slots.image || _ctx.$slots.title
1642
- }])
1643
- }, [
1644
- renderSlot(_ctx.$slots, "default")
1645
- ], 2),
1646
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
1647
- key: 2,
1648
- class: normalizeClass(["cl-border-grey-2 cl-border-t", {
1649
- "cl-p-2": __props.size === "small",
1650
- "cl-p-4": __props.size === "medium",
1651
- "cl-p-6": __props.size === "large"
1652
- }])
1653
- }, [
1654
- renderSlot(_ctx.$slots, "footer")
1655
- ], 2)) : createCommentVNode("", true)
1656
- ], 2);
1494
+ const _component_cl_ui_input = resolveComponent("cl-ui-input");
1495
+ return unref(validProps) ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), [
1496
+ withDirectives(createElementVNode("div", { class: "cl-bg-transparent cl-relative cl-text-center cl-text-sm" }, toDisplayString(unref(currentValue)), 513), [
1497
+ [vShow, !__props.showNumericInput]
1498
+ ]),
1499
+ createElementVNode("div", _hoisted_1$l, [
1500
+ withDirectives(createVNode(_component_cl_ui_input, {
1501
+ modelValue: numericInputValue.value,
1502
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => numericInputValue.value = $event),
1503
+ class: "!cl-text-sm md:!cl-w-auto",
1504
+ "input-type": "number",
1505
+ min: __props.min,
1506
+ max: __props.max,
1507
+ step: __props.step,
1508
+ disabled: __props.disabled,
1509
+ onInput: _cache[1] || (_cache[1] = ($event) => unref(debounce)(updateCurrentValue, [$event.target, _ctx.$forceUpdate]))
1510
+ }, null, 8, ["modelValue", "min", "max", "step", "disabled"]), [
1511
+ [vShow, __props.showNumericInput]
1512
+ ]),
1513
+ createElementVNode("div", _hoisted_2$k, [
1514
+ createElementVNode("span", _hoisted_3$g, toDisplayString(unref(n)(__props.min, Number.isInteger(__props.min) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1),
1515
+ typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
1516
+ withDirectives(createElementVNode("input", {
1517
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
1518
+ class: "cl-align-middle cl-appearance-none cl-bg-gradient-to-r cl-border cl-border-grey-2 cl-delay-500 cl-ease-in cl-flex-1 cl-h-5 cl-mb-2 cl-outline-none cl-rounded-full cl-transition-colors cl-w-full",
1519
+ style: normalizeStyle({
1520
+ background: `linear-gradient(to right, ${unref(colour)} 0%, ${unref(colour)} ${unref(percentage)}%, white ${unref(percentage)}%, white 100%)`
1521
+ }),
1522
+ type: "range",
1523
+ min: __props.min,
1524
+ max: __props.max,
1525
+ step: __props.step,
1526
+ disabled: __props.disabled
1527
+ }, null, 12, _hoisted_5$9), [
1528
+ [
1529
+ vModelText,
1530
+ unref(currentValue),
1531
+ void 0,
1532
+ { number: true }
1533
+ ]
1534
+ ])
1535
+ ])) : createCommentVNode("", true),
1536
+ createElementVNode("span", _hoisted_6$7, toDisplayString(unref(n)(__props.max, Number.isInteger(__props.max) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1)
1537
+ ])
1538
+ ])
1539
+ ], 16)) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(t2)("slider.invalidProps")), 1));
1657
1540
  };
1658
1541
  }
1659
1542
  });
1660
- const cardSizes = [
1661
- "small",
1662
- "medium",
1663
- "large"
1664
- ];
1665
- const _hoisted_1$l = { class: "cl-align-items-center cl-bg-black cl-bg-opacity-40 cl-bottom-0 cl-fixed cl-flex cl-h-screen cl-justify-center cl-left-0 cl-right-0 cl-top-0 cl-w-full cl-z-40" };
1666
- const _hoisted_2$k = ["onKeypress"];
1667
- const _hoisted_3$g = { class: "cl-overflow-y-auto cl-p-2 cl-w-full" };
1668
- const __default__$2 = {
1669
- inheritAttrs: false
1670
- };
1671
- function setup$2(__props) {
1672
- const props = __props;
1673
- const visible = ref(false);
1674
- function open() {
1675
- visible.value = true;
1676
- document.addEventListener("keydown", closeOnKeyPress);
1677
- }
1678
- function close() {
1679
- if (!props.preventClose) {
1680
- visible.value = false;
1681
- document.removeEventListener("keydown", closeOnKeyPress);
1682
- }
1543
+ var clUiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-31c5214e"]]);
1544
+ function isInputText(type) {
1545
+ let isText = false;
1546
+ switch (type) {
1547
+ case "email":
1548
+ case "password":
1549
+ case "search":
1550
+ case "tel":
1551
+ case "text":
1552
+ case "url":
1553
+ isText = true;
1554
+ break;
1555
+ default:
1556
+ isText = false;
1557
+ break;
1683
1558
  }
1684
- function closeOnKeyPress(event) {
1685
- if (event.key === "Escape") {
1686
- close();
1687
- }
1559
+ return isText;
1560
+ }
1561
+ function isInputCalendarSupportedDate(type) {
1562
+ let isSupported = false;
1563
+ switch (type) {
1564
+ case "date":
1565
+ case "datetime":
1566
+ case "time":
1567
+ isSupported = true;
1568
+ break;
1569
+ default:
1570
+ isSupported = false;
1571
+ break;
1688
1572
  }
1689
- return (_ctx, _cache) => {
1690
- const _component_icon = resolveComponent("icon");
1691
- return openBlock(), createElementBlock(Fragment, null, [
1692
- renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps({ open }))),
1693
- (openBlock(), createBlock(Teleport, { to: "body" }, [
1694
- createVNode(Transition, { name: "fade" }, {
1695
- default: withCtx(() => [
1696
- withDirectives(createElementVNode("div", _hoisted_1$l, [
1697
- createElementVNode("div", mergeProps(_ctx.$attrs, {
1698
- class: ["cl-bg-white cl-flex cl-flex-wrap cl-mx-0 cl-my-auto cl-overflow-y-auto cl-relative cl-rounded-lg cl-shadow-lg", {
1699
- "lg:cl-w-2/12 cl-w-10/12": __props.size === "x-small",
1700
- "cl-w-6/12": __props.size === "small",
1701
- "cl-w-8/12": __props.size === "medium",
1702
- "cl-w-10/12": __props.size === "large"
1703
- }]
1704
- }), [
1705
- withDirectives(createElementVNode("div", {
1706
- class: normalizeClass(["cl-absolute cl-cursor-pointer cl-right-4 cl-top-4 cl-transition-colors cl-w-3", {
1707
- "cl-text-white hover:cl-text-off-white": __props.headerColour === "secondary" || __props.headerColour === "primary",
1708
- "cl-text-black hover:cl-text-grey-7": __props.headerColour === "white"
1709
- }]),
1710
- tabindex: 0,
1711
- onKeypress: withKeys(close, ["enter"]),
1712
- onClick: close
1713
- }, [
1714
- createVNode(_component_icon, { icon: "ph:x" })
1715
- ], 42, _hoisted_2$k), [
1716
- [vShow, !__props.preventClose]
1717
- ]),
1718
- createElementVNode("div", {
1719
- class: normalizeClass(["cl-leading-[2.75rem] cl-min-h-12 cl-overflow-hidden cl-pl-3 cl-pr-8 cl-text-2xl cl-w-full", {
1720
- "cl-border-b cl-border-grey-2": __props.headerColour === "white",
1721
- "cl-bg-secondary-default cl-text-white": __props.headerColour === "secondary",
1722
- "cl-bg-primary-default cl-text-white": __props.headerColour === "primary"
1723
- }])
1724
- }, [
1725
- renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({ close })))
1726
- ], 2),
1727
- createElementVNode("div", _hoisted_3$g, [
1728
- renderSlot(_ctx.$slots, "default")
1729
- ]),
1730
- renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ close })))
1731
- ], 16)
1732
- ], 512), [
1733
- [vShow, visible.value]
1734
- ])
1735
- ]),
1736
- _: 3
1737
- })
1738
- ]))
1739
- ], 64);
1740
- };
1573
+ return isSupported;
1741
1574
  }
1742
- const _sfc_main$m = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
1743
- props: {
1744
- headerColour: { default: "white" },
1745
- preventClose: { type: Boolean, default: false },
1746
- size: { default: "medium" }
1747
- },
1748
- setup: setup$2
1749
- }));
1750
- const _hoisted_1$k = { class: "cl-bg-grey-2 cl-border-b cl-border-grey-2 cl-border-t cl-flex cl-p-1" };
1751
- const _hoisted_2$j = {
1575
+ function isInputButton(type) {
1576
+ return type === "button" || type === "submit" || type === "reset";
1577
+ }
1578
+ function getInputTypeAsCalendarType(type) {
1579
+ let calendarType;
1580
+ switch (type) {
1581
+ case "datetime":
1582
+ calendarType = calendarTypes[1];
1583
+ break;
1584
+ case "time":
1585
+ calendarType = calendarTypes[2];
1586
+ break;
1587
+ case "date":
1588
+ default:
1589
+ calendarType = calendarTypes[0];
1590
+ break;
1591
+ }
1592
+ return calendarType;
1593
+ }
1594
+ var clUiInput_vue_vue_type_style_index_0_scoped_true_lang = "";
1595
+ const _hoisted_1$k = { class: "cl-align-top cl-border-none cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
1596
+ const _hoisted_2$j = { class: "cl-flex cl-justify-between" };
1597
+ const _hoisted_3$f = { class: "cl-w-full" };
1598
+ const _hoisted_4$b = {
1752
1599
  key: 0,
1753
- class: "cl-w-1/2"
1600
+ class: "cl-block cl-left-auto cl-relative cl-text-danger-default"
1754
1601
  };
1755
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
1756
- props: {
1757
- showClearButton: { type: Boolean, default: false },
1758
- text: { default: "" },
1759
- additionalText: { default: "" }
1760
- },
1761
- emits: {
1762
- "clear-object": null
1763
- },
1764
- setup(__props) {
1765
- return (_ctx, _cache) => {
1766
- const _component_icon = resolveComponent("icon");
1767
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
1768
- __props.additionalText !== "" ? (openBlock(), createElementBlock("div", _hoisted_2$j, toDisplayString(__props.additionalText), 1)) : createCommentVNode("", true),
1769
- createElementVNode("div", {
1770
- class: normalizeClass({
1771
- "cl-w-1/2": __props.additionalText !== "",
1772
- "cl-w-full": __props.additionalText === ""
1773
- })
1774
- }, toDisplayString(__props.text), 3),
1775
- withDirectives(createElementVNode("div", {
1776
- class: "cl-cursor-pointer cl-float-right",
1777
- onMousedown: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("clear-object"))
1778
- }, [
1779
- createVNode(_component_icon, {
1780
- class: "cl-mt-0.5 cl-rounded-full cl-transition-colors hover:cl-text-link-default",
1781
- icon: "ph:x-circle"
1782
- })
1783
- ], 544), [
1784
- [vShow, __props.showClearButton]
1785
- ])
1786
- ]);
1787
- };
1788
- }
1789
- });
1790
- const _hoisted_1$j = {
1602
+ const _hoisted_5$8 = {
1603
+ key: 1,
1604
+ class: "cl-bg-danger-light cl-block cl-max-h-6 cl-mb-1 cl-ml-2 cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-uppercase"
1605
+ };
1606
+ const _hoisted_6$6 = ["type", "disabled", "min", "max", "minlength", "maxlength", "step", "placeholder", "accept", "name", "autocomplete", "onBlur", "onMousewheel"];
1607
+ const _hoisted_7$6 = { class: "cl-relative" };
1608
+ const _hoisted_8$5 = {
1609
+ key: 2,
1610
+ class: "cl-h-[5.78rem] cl-pb-2 md:cl-h-20"
1611
+ };
1612
+ const _hoisted_9$5 = {
1791
1613
  key: 0,
1792
- class: "cl-w-1/2"
1614
+ class: "cl-bg-primary-lighter cl-px-2 cl-rounded-md cl-text-center cl-text-secondary-light cl-text-xs cl-w-auto cl-whitespace-pre-line"
1615
+ };
1616
+ const _hoisted_10$5 = {
1617
+ key: 1,
1618
+ class: "cl-bg-danger-light cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-w-auto cl-whitespace-pre-line"
1793
1619
  };
1794
- const _hoisted_2$i = { class: "cl-float-right cl-py-1.5" };
1795
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
1620
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1796
1621
  props: {
1797
- isCreateNewOption: { type: Boolean, default: false },
1798
- selectedIndex: { default: -1 },
1799
- text: { default: "" },
1800
- option: { default: () => null },
1801
- index: null
1622
+ inputType: { default: "text" },
1623
+ modelValue: { type: [String, Number, Boolean, Date, null], default: void 0 },
1624
+ label: { default: "" },
1625
+ isRequired: { type: Boolean, default: false },
1626
+ customValidationFunction: { type: Function, default: void 0 },
1627
+ onInputFunction: { type: Function, default: void 0 },
1628
+ min: { default: -1e11 },
1629
+ max: { default: 1e11 },
1630
+ step: { default: 1 },
1631
+ validateImmediately: { type: Boolean, default: false },
1632
+ externalErrors: { default: () => [] },
1633
+ disabled: { type: Boolean, default: false },
1634
+ requiredText: { default: "" },
1635
+ placeholderText: { default: "" },
1636
+ fileExtensions: { default: "" },
1637
+ group: { default: "" },
1638
+ showLabel: { type: Boolean, default: true },
1639
+ showArrows: { type: Boolean, default: true },
1640
+ autocomplete: { default: "off" },
1641
+ highlightWhenValid: { type: Boolean, default: false },
1642
+ messageWhenValid: { default: "" },
1643
+ inputSpecificClasses: { default: "" }
1802
1644
  },
1803
1645
  emits: {
1804
- "create-object": null,
1805
- "select-object": null,
1806
- "option-highlighted": null
1646
+ "update:modelValue": null,
1647
+ click: null,
1648
+ focus: null,
1649
+ input: null,
1650
+ validated: null
1807
1651
  },
1808
1652
  setup(__props, { emit }) {
1809
1653
  const props = __props;
1810
- const displayedText = computed(() => {
1811
- var _a, _b;
1812
- return (_b = (_a = props.option) == null ? void 0 : _a.name) != null ? _b : props.text;
1654
+ const inputElement = ref(null);
1655
+ const focused = ref(false);
1656
+ const lostFocus = ref(false);
1657
+ const showRequiredAsterisk = computed(getShowAsteriskOrRequired);
1658
+ const placeholder = computed(() => props.placeholderText.trim() !== "" ? props.placeholderText : props.label);
1659
+ const dateFlaggedAsOutOfRange = ref(false);
1660
+ const { t: t2 } = useI18n();
1661
+ const currentValue = computed({
1662
+ get: () => props.modelValue,
1663
+ set: (value) => onValueChanged(value)
1813
1664
  });
1814
- const displayedParent = computed(() => {
1815
- var _a, _b;
1816
- return (_b = (_a = props.option) == null ? void 0 : _a.parentName) != null ? _b : "";
1665
+ const currentDateValue = computed({
1666
+ get: () => props.modelValue,
1667
+ set: (value) => updateDateValue(value)
1817
1668
  });
1818
- const isHighlighted = ref(false);
1819
- function optionSelected() {
1820
- var _a;
1821
- if (props.isCreateNewOption === true) {
1822
- emit("create-object");
1823
- } else {
1824
- emit("select-object", (_a = props.option) == null ? void 0 : _a.id);
1669
+ const minAsString = computed(() => typeof props.min === "number" ? props.min.toString() : props.min);
1670
+ const maxAsString = computed(() => typeof props.max === "number" ? props.max.toString() : props.max);
1671
+ const minAsNumber = computed(() => typeof props.min === "number" ? props.min : parseFloat(props.min));
1672
+ const maxAsNumber = computed(() => typeof props.max === "number" ? props.max : parseFloat(props.max));
1673
+ const validMessage = computed(() => props.messageWhenValid.trim() !== "" ? props.messageWhenValid : "");
1674
+ const isValid = ref(true);
1675
+ const internalErrors = ref([]);
1676
+ const errors = computed(() => {
1677
+ var _a, _b, _c, _d;
1678
+ return [
1679
+ ...(_b = (_a = internalErrors.value) == null ? void 0 : _a.filter((e) => {
1680
+ var _a2;
1681
+ return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
1682
+ })) != null ? _b : [],
1683
+ ...(_d = (_c = props.externalErrors) == null ? void 0 : _c.filter((e) => {
1684
+ var _a2;
1685
+ return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
1686
+ })) != null ? _d : []
1687
+ ].join("\n");
1688
+ });
1689
+ function updateDateValue(value) {
1690
+ updateAndValidateValue(value);
1691
+ dateFlaggedAsOutOfRange.value = false;
1692
+ }
1693
+ function onValueChanged(value) {
1694
+ if (props.onInputFunction !== void 0) {
1695
+ value = props.onInputFunction(value);
1696
+ }
1697
+ updateAndValidateValue(value);
1698
+ }
1699
+ function updateAndValidateValue(value) {
1700
+ const defaultSuccess = {
1701
+ message: "",
1702
+ valid: true
1703
+ };
1704
+ const validationPromises = [props.customValidationFunction === null || props.customValidationFunction === void 0 ? new Promise((resolve) => {
1705
+ resolve(defaultSuccess);
1706
+ }) : new Promise((resolve) => {
1707
+ resolve(props.customValidationFunction(props.label, value));
1708
+ })];
1709
+ if (typeof value === "string" || typeof value === "number" || value instanceof Date) {
1710
+ validationPromises.push(validateMinValue(props.min, props.inputType, props.label, value));
1711
+ validationPromises.push(validateMaxValue(props.max, props.inputType, props.label, value));
1712
+ }
1713
+ if (props.isRequired) {
1714
+ validationPromises.push(validateRequired(props.label, value));
1715
+ }
1716
+ if (props.inputType === "email" && typeof value === "string") {
1717
+ validationPromises.push(validateEmail(props.label, value));
1825
1718
  }
1719
+ Promise.all(validationPromises).then((internalValidationResults) => {
1720
+ const messages2 = [...internalValidationResults.map((e) => e.message)];
1721
+ let invalid = internalValidationResults.some((e) => e.valid === false) || props.externalErrors.length > 0;
1722
+ if (dateFlaggedAsOutOfRange.value) {
1723
+ messages2.push(t2("input.dateOutOfRange"));
1724
+ invalid = true;
1725
+ }
1726
+ if (invalid) {
1727
+ internalErrors.value = messages2;
1728
+ emit("validated", false, value);
1729
+ } else {
1730
+ internalErrors.value = [];
1731
+ emit("validated", true, value);
1732
+ }
1733
+ isValid.value = !invalid;
1734
+ emit("update:modelValue", value);
1735
+ });
1826
1736
  }
1827
- function onHover(hovered) {
1828
- if (hovered === true) {
1829
- isHighlighted.value = true;
1830
- emit("option-highlighted", props.index);
1831
- } else {
1832
- if (props.index !== props.selectedIndex) {
1833
- isHighlighted.value = false;
1737
+ function getStyle() {
1738
+ let style = "";
1739
+ if (props.inputType === "color" && currentValue.value) {
1740
+ if (props.disabled) {
1741
+ style = `background: #999999`;
1742
+ } else {
1743
+ style = `background: ${currentValue.value};`;
1834
1744
  }
1835
1745
  }
1746
+ return style;
1836
1747
  }
1837
- function updateHighlight() {
1838
- if (props.selectedIndex === props.index) {
1839
- isHighlighted.value = true;
1840
- } else {
1841
- isHighlighted.value = false;
1748
+ function emitClickIfButton(event) {
1749
+ if (isInputButton(props.inputType)) {
1750
+ event.preventDefault();
1751
+ emit("click", event);
1752
+ } else if (props.inputType === "checkbox") {
1753
+ emit("click", event);
1842
1754
  }
1843
1755
  }
1844
- watch(() => props.selectedIndex, () => updateHighlight());
1845
- return (_ctx, _cache) => {
1846
- var _a, _b;
1847
- const _component_icon = resolveComponent("icon");
1848
- return openBlock(), createElementBlock("div", {
1849
- class: normalizeClass(["cl-border-b cl-border-grey-0 cl-border-t cl-cursor-pointer cl-duration-75 cl-flex cl-p-1 cl-transition-colors", {
1850
- "cl-bg-grey-0": isHighlighted.value === false,
1851
- "cl-bg-primary-default cl-text-white": isHighlighted.value
1852
- }]),
1853
- onMousedown: optionSelected,
1854
- onMousemove: _cache[0] || (_cache[0] = ($event) => onHover(true)),
1855
- onMouseleave: _cache[1] || (_cache[1] = ($event) => onHover(false))
1856
- }, [
1857
- __props.option !== null && ((_a = __props.option) == null ? void 0 : _a.parentId) !== 0 && ((_b = __props.option) == null ? void 0 : _b.parentId) !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$j, toDisplayString(unref(displayedParent)), 1)) : createCommentVNode("", true),
1858
- createElementVNode("div", {
1859
- class: normalizeClass({
1860
- "cl-w-1/2": unref(displayedParent) !== "",
1861
- "cl-w-full": unref(displayedParent) === ""
1862
- })
1863
- }, toDisplayString(unref(displayedText)), 3),
1864
- withDirectives(createElementVNode("div", _hoisted_2$i, [
1865
- createVNode(_component_icon, {
1866
- class: "cl-bg-primary-default cl-rounded-full cl-text-white",
1867
- icon: "ph:plus-circle"
1868
- })
1869
- ], 512), [
1870
- [vShow, __props.isCreateNewOption]
1871
- ])
1872
- ], 34);
1873
- };
1874
- }
1875
- });
1876
- const _hoisted_1$i = ["onKeyup"];
1877
- const _hoisted_2$h = { class: "cl-flex" };
1878
- const _hoisted_3$f = ["placeholder"];
1879
- const _hoisted_4$d = { key: 5 };
1880
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
1881
- props: {
1882
- loading: { type: Boolean, default: false },
1883
- objectType: null,
1884
- objectParentType: { default: "" },
1885
- errorMessage: { default: "" },
1886
- canCreateNewObject: { type: Boolean, default: false },
1887
- canClearSelectedObject: { type: Boolean, default: true },
1888
- currentObjectName: { default: "" },
1889
- results: { default: () => [] },
1890
- isVisible: { type: Boolean, default: false }
1891
- },
1892
- emits: {
1893
- "clear-object": null,
1894
- "create-object": null,
1895
- "select-object": null,
1896
- search: null,
1897
- "hide-dropdown": null
1898
- },
1899
- setup(__props, { emit }) {
1900
- const props = __props;
1901
- const { t: t2 } = useI18n();
1902
- const searchText = ref("");
1903
- const showAddNewOption = ref(false);
1904
- const currentSelection = ref(-1);
1905
- const firstIndexInResults = computed(() => showAddNewOption.value ? -1 : 0);
1906
- const container = ref();
1907
- const searchBox = ref();
1908
- function search(keyboardEvent) {
1909
- if (keyboardEvent === void 0 || (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Arrow")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Control")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Shift")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Tab")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code) !== "Enter") {
1910
- emit("search", searchText.value);
1911
- currentSelection.value = -2;
1756
+ function incrementNumericValue() {
1757
+ if (inputElement.value) {
1758
+ inputElement.value.stepUp();
1759
+ inputElement.value.focus();
1760
+ onValueChanged(inputElement.value.valueAsNumber);
1761
+ const inputEvent = {
1762
+ target: inputElement.value
1763
+ };
1764
+ emit("input", inputEvent);
1912
1765
  }
1913
1766
  }
1914
- function selectObject(id) {
1915
- emit("select-object", id);
1916
- }
1917
- function createObject() {
1918
- emit("create-object", searchText.value);
1919
- hideDropdown();
1920
- }
1921
- function hideDropdown() {
1922
- emit("hide-dropdown");
1923
- }
1924
- function onKeyboardArrowDown(firstIndex) {
1925
- if (currentSelection.value < props.results.length - 1) {
1926
- if (currentSelection.value === -2 && searchText.value === "") {
1927
- currentSelection.value++;
1928
- }
1929
- currentSelection.value++;
1930
- } else {
1931
- currentSelection.value = firstIndex;
1767
+ function decrementNumericValue() {
1768
+ if (inputElement.value) {
1769
+ inputElement.value.stepDown();
1770
+ inputElement.value.focus();
1771
+ onValueChanged(inputElement.value.valueAsNumber);
1772
+ const inputEvent = {
1773
+ target: inputElement.value
1774
+ };
1775
+ emit("input", inputEvent);
1932
1776
  }
1933
- scroll();
1934
1777
  }
1935
- function onKeyboardArrowUp(firstIndex) {
1936
- if (currentSelection.value > firstIndex) {
1937
- currentSelection.value--;
1938
- } else {
1939
- currentSelection.value = props.results.length - 1;
1940
- }
1941
- scroll();
1778
+ function toggleFocus(focus) {
1779
+ focused.value = focus;
1942
1780
  }
1943
- function onKeyboardEnter() {
1944
- if (currentSelection.value >= 0 && props.results !== void 0) {
1945
- selectObject(props.results[currentSelection.value].id);
1946
- } else if (currentSelection.value === -1) {
1947
- createObject();
1948
- }
1781
+ function onLostFocus() {
1782
+ lostFocus.value = true;
1783
+ toggleFocus(false);
1949
1784
  }
1950
- function onKeyboardShiftTab(keyboardEvent) {
1951
- if (keyboardEvent.key === "Tab" && keyboardEvent.shiftKey === true) {
1952
- const selectableElements = document.getElementsByTagName("input");
1953
- let indexOfPreviouslySelectableItem = -1;
1954
- for (let i = 0; i < selectableElements.length; i++) {
1955
- if (selectableElements[i] === keyboardEvent.target) {
1956
- indexOfPreviouslySelectableItem = i - 1;
1957
- }
1958
- }
1959
- if (indexOfPreviouslySelectableItem >= 0) {
1960
- selectableElements[indexOfPreviouslySelectableItem].focus();
1961
- hideDropdown();
1962
- }
1963
- }
1785
+ function onMouseWheel(wheelEvent) {
1786
+ wheelEvent.target.blur();
1964
1787
  }
1965
- function scroll() {
1788
+ function getShowAsteriskOrRequired() {
1966
1789
  var _a;
1967
- if (props.results && props.results.length > 1) {
1968
- const heightOffset = 34;
1969
- (_a = container.value) == null ? void 0 : _a.scrollTo(0, (currentSelection.value + 1) * heightOffset - heightOffset * 2);
1970
- }
1971
- }
1972
- function updateAddNewOption() {
1973
- let finalResultMatches = false;
1974
- if (props.results !== null && props.results.length === 1) {
1975
- finalResultMatches = searchText.value.toUpperCase().trim() === props.results[0].name.toUpperCase().trim();
1790
+ let asterisk = true;
1791
+ const currentState = showRequiredAsterisk.value;
1792
+ if (focused.value) {
1793
+ asterisk = currentState;
1794
+ } else if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "") {
1795
+ asterisk = false;
1976
1796
  }
1977
- showAddNewOption.value = props.canCreateNewObject === true && props.errorMessage === "" && searchText.value.trim() !== "" && finalResultMatches === false;
1978
- }
1979
- function updateSelectedObjectIndex(index) {
1980
- currentSelection.value = index;
1797
+ return asterisk;
1981
1798
  }
1982
- function onVisibilityChanged() {
1983
- if (props.isVisible === true) {
1984
- searchText.value = "";
1985
- search();
1986
- nextTick(() => {
1987
- var _a;
1988
- return (_a = searchBox.value) == null ? void 0 : _a.focus();
1989
- });
1990
- }
1799
+ function onDateOutOfRange() {
1800
+ dateFlaggedAsOutOfRange.value = true;
1991
1801
  }
1992
- watch(() => props.results, () => updateAddNewOption());
1993
- watch(() => props.errorMessage, () => updateAddNewOption());
1994
- watch(() => props.isVisible, () => onVisibilityChanged());
1995
1802
  onMounted(() => {
1996
- var _a;
1997
- return (_a = container.value) == null ? void 0 : _a.addEventListener("keydown", onKeyboardShiftTab);
1998
- });
1999
- onUnmounted(() => {
2000
- var _a;
2001
- return (_a = container.value) == null ? void 0 : _a.removeEventListener("keydown", onKeyboardShiftTab);
1803
+ if (props.validateImmediately) {
1804
+ onValueChanged(props.modelValue);
1805
+ }
2002
1806
  });
1807
+ watch(() => props.isRequired, () => onValueChanged(props.modelValue));
1808
+ watch(() => props.externalErrors, () => updateAndValidateValue(currentValue.value));
2003
1809
  return (_ctx, _cache) => {
2004
- var _a;
2005
- const _component_cl_ui_loading_spinner = resolveComponent("cl-ui-loading-spinner");
2006
- return openBlock(), createElementBlock("div", {
2007
- ref: (_value, _refs) => {
2008
- _refs["container"] = _value;
2009
- container.value = _value;
2010
- },
2011
- class: "cl-bg-white cl-border cl-border-collapse cl-border-grey-0 cl-h-52 cl-overflow-y-auto cl-p-2 cl-text-sm",
2012
- onKeydown: [
2013
- _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => onKeyboardArrowUp(unref(firstIndexInResults)), ["prevent", "stop"]), ["up"])),
2014
- _cache[3] || (_cache[3] = withKeys(withModifiers(($event) => onKeyboardArrowDown(unref(firstIndexInResults)), ["prevent", "stop"]), ["down"]))
2015
- ],
2016
- onKeyup: withKeys(withModifiers(onKeyboardEnter, ["prevent", "stop"]), ["enter"])
2017
- }, [
2018
- createElementVNode("div", _hoisted_2$h, [
2019
- withDirectives(createElementVNode("input", {
1810
+ const _component_icon = resolveComponent("icon");
1811
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
1812
+ createElementVNode("div", {
1813
+ onMouseenter: _cache[10] || (_cache[10] = ($event) => toggleFocus(true)),
1814
+ onMouseleave: _cache[11] || (_cache[11] = ($event) => toggleFocus(false))
1815
+ }, [
1816
+ createElementVNode("div", _hoisted_2$j, [
1817
+ createElementVNode("div", _hoisted_3$f, [
1818
+ withDirectives(createElementVNode("label", { class: "cl-block cl-mb-1 cl-text-gray-400 cl-text-xs cl-tracking-widest cl-uppercase" }, toDisplayString(__props.label), 513), [
1819
+ [vShow, __props.showLabel && __props.label !== ""]
1820
+ ])
1821
+ ]),
1822
+ __props.isRequired && unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_4$b, " * ")) : createCommentVNode("", true),
1823
+ __props.isRequired && !unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_5$8, toDisplayString(__props.requiredText), 1)) : createCommentVNode("", true)
1824
+ ]),
1825
+ __props.inputType !== "range" && !unref(isInputCalendarSupportedDate)(__props.inputType) ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
1826
+ key: 0,
2020
1827
  ref: (_value, _refs) => {
2021
- _refs["searchBox"] = _value;
2022
- searchBox.value = _value;
1828
+ _refs["inputElement"] = _value;
1829
+ inputElement.value = _value;
2023
1830
  },
2024
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
2025
- type: "text",
2026
- placeholder: unref(t2)("comboBox.searchHint", { object: __props.objectType }),
2027
- onKeyup: search,
2028
- onBlur: hideDropdown
2029
- }, null, 40, _hoisted_3$f), [
2030
- [vModelText, searchText.value]
1831
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentValue) ? currentValue.value = $event : null)
1832
+ }, _ctx.$attrs, {
1833
+ class: ["cl-block cl-border cl-duration-300 cl-h-full cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
1834
+ "hover:!cl-border-grey-3": __props.disabled === false && !unref(isInputButton)(__props.inputType),
1835
+ "!cl-cursor-default": __props.disabled,
1836
+ "!cl-border-danger-default": !isValid.value,
1837
+ "!cl-border-primary-default": isValid.value && __props.highlightWhenValid,
1838
+ "cl-border-grey-0 focus:cl-border-blue-light": isValid.value && !unref(isInputButton)(__props.inputType),
1839
+ "!cl-p-2": __props.inputType === "checkbox" || __props.inputType === "radio",
1840
+ "cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType),
1841
+ [`${__props.inputSpecificClasses}`]: __props.inputSpecificClasses !== ""
1842
+ }],
1843
+ style: getStyle(),
1844
+ type: __props.inputType,
1845
+ disabled: __props.disabled,
1846
+ min: __props.min,
1847
+ max: __props.max,
1848
+ minlength: unref(isInputText)(__props.inputType) ? __props.min : 0,
1849
+ maxlength: unref(isInputText)(__props.inputType) ? __props.max : 0,
1850
+ step: __props.step,
1851
+ placeholder: unref(placeholder),
1852
+ accept: __props.fileExtensions,
1853
+ name: __props.group,
1854
+ autocomplete: __props.autocomplete,
1855
+ onClick: _cache[1] || (_cache[1] = ($event) => emitClickIfButton($event)),
1856
+ onFocus: _cache[2] || (_cache[2] = ($event) => emit("focus")),
1857
+ onBlur: withModifiers(onLostFocus, ["self"]),
1858
+ onMousewheel: withModifiers(onMouseWheel, ["prevent"]),
1859
+ onInput: _cache[3] || (_cache[3] = ($event) => emit("input", $event))
1860
+ }), null, 16, _hoisted_6$6)), [
1861
+ [vModelDynamic, unref(currentValue)]
1862
+ ]) : createCommentVNode("", true),
1863
+ unref(isInputCalendarSupportedDate)(__props.inputType) ? (openBlock(), createBlock(unref(_sfc_main$n), mergeProps({ key: 1 }, _ctx.$attrs, {
1864
+ ref: (_value, _refs) => {
1865
+ _refs["inputElement"] = _value;
1866
+ inputElement.value = _value;
1867
+ },
1868
+ date: unref(currentDateValue),
1869
+ "onUpdate:date": _cache[4] || (_cache[4] = ($event) => isRef(currentDateValue) ? currentDateValue.value = $event : null),
1870
+ class: ["cl-block cl-duration-300 cl-h-fit cl-mb-1 cl-rounded-lg cl-text-sm cl-transition cl-w-full focus:cl-outline-none", {
1871
+ "hover:cl-border-grey-3": !__props.disabled,
1872
+ "!cl-border-danger-default": !isValid.value,
1873
+ "!cl-border-primary-default": isValid.value && __props.highlightWhenValid
1874
+ }],
1875
+ disabled: __props.disabled,
1876
+ type: unref(getInputTypeAsCalendarType)(__props.inputType),
1877
+ min: unref(minAsString),
1878
+ max: unref(maxAsString),
1879
+ onBlur: withModifiers(onLostFocus, ["self"]),
1880
+ onValueOutOfRange: onDateOutOfRange,
1881
+ onFocus: _cache[5] || (_cache[5] = ($event) => emit("focus"))
1882
+ }), null, 16, ["date", "class", "disabled", "type", "min", "max", "onBlur"])) : createCommentVNode("", true),
1883
+ createElementVNode("div", _hoisted_7$6, [
1884
+ __props.inputType === "number" && !__props.disabled && __props.showArrows ? (openBlock(), createElementBlock("div", {
1885
+ key: 0,
1886
+ class: normalizeClass(["cl-absolute cl-duration-300 cl-right-1 cl-transition", {
1887
+ "cl-opacity-0": !focused.value
1888
+ }]),
1889
+ style: { "bottom": "1.625rem" }
1890
+ }, [
1891
+ createVNode(_component_icon, {
1892
+ icon: "ph:caret-up-bold",
1893
+ class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
1894
+ onClick: incrementNumericValue,
1895
+ onMousedown: _cache[6] || (_cache[6] = withModifiers(() => {
1896
+ }, ["prevent"]))
1897
+ })
1898
+ ], 2)) : createCommentVNode("", true),
1899
+ __props.inputType === "number" && !__props.disabled && __props.showArrows ? (openBlock(), createElementBlock("div", {
1900
+ key: 1,
1901
+ class: normalizeClass(["cl-absolute cl-bottom-2 cl-duration-300 cl-right-1 cl-transition", {
1902
+ "cl-opacity-0": !focused.value
1903
+ }])
1904
+ }, [
1905
+ createVNode(_component_icon, {
1906
+ icon: "ph:caret-down-bold",
1907
+ class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
1908
+ onClick: decrementNumericValue,
1909
+ onMousedown: _cache[7] || (_cache[7] = withModifiers(() => {
1910
+ }, ["prevent"]))
1911
+ })
1912
+ ], 2)) : createCommentVNode("", true)
2031
1913
  ]),
2032
- withDirectives(createVNode(_component_cl_ui_loading_spinner, { class: "cl-absolute cl-ml-2 cl-mt-11" }, null, 512), [
2033
- [vShow, __props.loading]
2034
- ])
2035
- ]),
2036
- __props.currentObjectName !== "" ? (openBlock(), createBlock(_sfc_main$l, {
2037
- key: 0,
2038
- "show-clear-button": __props.canClearSelectedObject,
2039
- text: __props.currentObjectName,
2040
- onClearObject: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("clear-object"))
2041
- }, null, 8, ["show-clear-button", "text"])) : createCommentVNode("", true),
2042
- __props.objectParentType !== "" && __props.results !== void 0 && __props.results.length > 0 && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$l, {
2043
- key: 1,
2044
- text: __props.objectType,
2045
- "additional-text": __props.objectParentType
2046
- }, null, 8, ["text", "additional-text"])) : createCommentVNode("", true),
2047
- __props.results !== null && ((_a = __props.results) == null ? void 0 : _a.length) === 0 && searchText.value.trim() !== "" && __props.canCreateNewObject === false && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$l, {
2048
- key: 2,
2049
- text: unref(t2)("comboBox.noResults", { object: __props.objectType })
2050
- }, null, 8, ["text"])) : createCommentVNode("", true),
2051
- __props.errorMessage !== "" ? (openBlock(), createBlock(_sfc_main$l, {
2052
- key: 3,
2053
- class: "!cl-bg-danger-light cl-text-danger-dark",
2054
- text: unref(t2)("comboBox.errorMessage", { error: __props.errorMessage })
2055
- }, null, 8, ["text"])) : createCommentVNode("", true),
2056
- showAddNewOption.value ? (openBlock(), createBlock(_sfc_main$k, {
2057
- key: 4,
2058
- "is-create-new-option": true,
2059
- text: unref(t2)("comboBox.addPrompt", { value: searchText.value, object: __props.objectType }),
2060
- index: -1,
2061
- "selected-index": currentSelection.value,
2062
- onCreateObject: createObject,
2063
- onOptionHighlighted: updateSelectedObjectIndex
2064
- }, null, 8, ["text", "selected-index"])) : createCommentVNode("", true),
2065
- __props.errorMessage === "" && __props.results !== null ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
2066
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.results, (result, index) => {
2067
- return openBlock(), createBlock(_sfc_main$k, {
2068
- key: index,
2069
- option: result,
2070
- index,
2071
- "selected-index": currentSelection.value,
2072
- onSelectObject: selectObject,
2073
- onOptionHighlighted: updateSelectedObjectIndex
2074
- }, null, 8, ["option", "index", "selected-index"]);
2075
- }), 128))
2076
- ])) : createCommentVNode("", true)
2077
- ], 40, _hoisted_1$i);
1914
+ __props.inputType === "range" && typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
1915
+ createVNode(unref(clUiSlider), {
1916
+ ref: (_value, _refs) => {
1917
+ _refs["inputElement"] = _value;
1918
+ inputElement.value = _value;
1919
+ },
1920
+ value: unref(currentValue),
1921
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
1922
+ min: unref(minAsNumber),
1923
+ max: unref(maxAsNumber),
1924
+ step: __props.step,
1925
+ disabled: __props.disabled,
1926
+ "show-numeric-input": false,
1927
+ onBlur: withModifiers(onLostFocus, ["self"]),
1928
+ onFocus: _cache[9] || (_cache[9] = ($event) => emit("focus"))
1929
+ }, null, 8, ["value", "min", "max", "step", "disabled", "onBlur"])
1930
+ ])) : createCommentVNode("", true)
1931
+ ], 32),
1932
+ isValid.value && unref(validMessage) ? (openBlock(), createElementBlock("div", _hoisted_9$5, toDisplayString(unref(validMessage)), 1)) : createCommentVNode("", true),
1933
+ !isValid.value && unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_10$5, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
1934
+ ]);
1935
+ };
1936
+ }
1937
+ });
1938
+ var ClUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-3848d1cc"]]);
1939
+ const _hoisted_1$j = { class: "cl-align-items-center cl-bg-black cl-bg-opacity-40 cl-bottom-0 cl-fixed cl-flex cl-h-screen cl-justify-center cl-left-0 cl-right-0 cl-top-0 cl-w-full cl-z-40" };
1940
+ const _hoisted_2$i = ["onKeypress"];
1941
+ const _hoisted_3$e = { class: "cl-overflow-y-auto cl-p-2 cl-w-full" };
1942
+ const __default__$2 = {
1943
+ inheritAttrs: false
1944
+ };
1945
+ function setup$2(__props) {
1946
+ const props = __props;
1947
+ const visible = ref(false);
1948
+ function open() {
1949
+ visible.value = true;
1950
+ document.addEventListener("keydown", closeOnKeyPress);
1951
+ }
1952
+ function close() {
1953
+ if (!props.preventClose) {
1954
+ visible.value = false;
1955
+ document.removeEventListener("keydown", closeOnKeyPress);
1956
+ }
1957
+ }
1958
+ function closeOnKeyPress(event) {
1959
+ if (event.key === "Escape") {
1960
+ close();
1961
+ }
1962
+ }
1963
+ return (_ctx, _cache) => {
1964
+ const _component_icon = resolveComponent("icon");
1965
+ return openBlock(), createElementBlock(Fragment, null, [
1966
+ renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps({ open }))),
1967
+ (openBlock(), createBlock(Teleport, { to: "body" }, [
1968
+ createVNode(Transition, { name: "fade" }, {
1969
+ default: withCtx(() => [
1970
+ withDirectives(createElementVNode("div", _hoisted_1$j, [
1971
+ createElementVNode("div", mergeProps(_ctx.$attrs, {
1972
+ class: ["cl-bg-white cl-flex cl-flex-wrap cl-mx-0 cl-my-auto cl-overflow-y-auto cl-relative cl-rounded-lg cl-shadow-lg", {
1973
+ "lg:cl-w-2/12 cl-w-10/12": __props.size === "x-small",
1974
+ "cl-w-6/12": __props.size === "small",
1975
+ "cl-w-8/12": __props.size === "medium",
1976
+ "cl-w-10/12": __props.size === "large"
1977
+ }]
1978
+ }), [
1979
+ withDirectives(createElementVNode("div", {
1980
+ class: normalizeClass(["cl-absolute cl-cursor-pointer cl-right-4 cl-top-4 cl-transition-colors cl-w-3", {
1981
+ "cl-text-white hover:cl-text-off-white": __props.headerColour === "secondary" || __props.headerColour === "primary",
1982
+ "cl-text-black hover:cl-text-grey-7": __props.headerColour === "white"
1983
+ }]),
1984
+ tabindex: 0,
1985
+ onKeypress: withKeys(close, ["enter"]),
1986
+ onClick: close
1987
+ }, [
1988
+ createVNode(_component_icon, { icon: "ph:x" })
1989
+ ], 42, _hoisted_2$i), [
1990
+ [vShow, !__props.preventClose]
1991
+ ]),
1992
+ createElementVNode("div", {
1993
+ class: normalizeClass(["cl-leading-[2.75rem] cl-min-h-12 cl-overflow-hidden cl-pl-3 cl-pr-8 cl-text-2xl cl-w-full", {
1994
+ "cl-border-b cl-border-grey-2": __props.headerColour === "white",
1995
+ "cl-bg-secondary-default cl-text-white": __props.headerColour === "secondary",
1996
+ "cl-bg-primary-default cl-text-white": __props.headerColour === "primary"
1997
+ }])
1998
+ }, [
1999
+ renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({ close })))
2000
+ ], 2),
2001
+ createElementVNode("div", _hoisted_3$e, [
2002
+ renderSlot(_ctx.$slots, "default")
2003
+ ]),
2004
+ renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ close })))
2005
+ ], 16)
2006
+ ], 512), [
2007
+ [vShow, visible.value]
2008
+ ])
2009
+ ]),
2010
+ _: 3
2011
+ })
2012
+ ]))
2013
+ ], 64);
2014
+ };
2015
+ }
2016
+ const _sfc_main$k = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
2017
+ props: {
2018
+ headerColour: { default: "white" },
2019
+ preventClose: { type: Boolean, default: false },
2020
+ size: { default: "medium" }
2021
+ },
2022
+ setup: setup$2
2023
+ }));
2024
+ const _hoisted_1$i = { class: "cl-bg-grey-2 cl-border-b cl-border-grey-2 cl-border-t cl-flex cl-p-1" };
2025
+ const _hoisted_2$h = {
2026
+ key: 0,
2027
+ class: "cl-w-1/2"
2028
+ };
2029
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2030
+ props: {
2031
+ showClearButton: { type: Boolean, default: false },
2032
+ text: { default: "" },
2033
+ additionalText: { default: "" }
2034
+ },
2035
+ emits: {
2036
+ "clear-object": null
2037
+ },
2038
+ setup(__props) {
2039
+ return (_ctx, _cache) => {
2040
+ const _component_icon = resolveComponent("icon");
2041
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
2042
+ __props.additionalText !== "" ? (openBlock(), createElementBlock("div", _hoisted_2$h, toDisplayString(__props.additionalText), 1)) : createCommentVNode("", true),
2043
+ createElementVNode("div", {
2044
+ class: normalizeClass({
2045
+ "cl-w-1/2": __props.additionalText !== "",
2046
+ "cl-w-full": __props.additionalText === ""
2047
+ })
2048
+ }, toDisplayString(__props.text), 3),
2049
+ withDirectives(createElementVNode("div", {
2050
+ class: "cl-cursor-pointer cl-float-right",
2051
+ onMousedown: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("clear-object"))
2052
+ }, [
2053
+ createVNode(_component_icon, {
2054
+ class: "cl-mt-0.5 cl-rounded-full cl-transition-colors hover:cl-text-link-default",
2055
+ icon: "ph:x-circle"
2056
+ })
2057
+ ], 544), [
2058
+ [vShow, __props.showClearButton]
2059
+ ])
2060
+ ]);
2078
2061
  };
2079
2062
  }
2080
2063
  });
2081
- const _hoisted_1$h = { class: "cl-flex" };
2082
- const _hoisted_2$g = ["placeholder", "disabled"];
2083
- const _hoisted_3$e = { class: "cl-relative cl-right-20 cl-top-0.5" };
2084
- const _hoisted_4$c = { class: "cl-absolute cl-flex cl-float-right cl-font-semibold cl-mt-2 cl-text-danger-default cl-text-sm" };
2085
- const _hoisted_5$a = { class: "cl-mt-3" };
2086
- const _hoisted_6$8 = { class: "cl-p-2 cl-text-right cl-w-full" };
2064
+ const _hoisted_1$h = {
2065
+ key: 0,
2066
+ class: "cl-w-1/2"
2067
+ };
2068
+ const _hoisted_2$g = { class: "cl-float-right cl-py-1.5" };
2087
2069
  const _sfc_main$i = /* @__PURE__ */ defineComponent({
2088
2070
  props: {
2089
- loading: { type: Boolean, default: false },
2090
- disabled: { type: Boolean, default: false },
2091
- required: { type: Boolean, default: false },
2092
- objectType: null,
2093
- objectParentType: { default: "" },
2094
- canCreateNewObject: { type: Boolean, default: false },
2095
- canClearSelectedObject: { type: Boolean, default: true },
2096
- errorMessage: { default: "" },
2097
- objectCreatedResponse: { default: () => null },
2098
- parentObjectCreatedResponse: { default: () => null },
2099
- results: { default: () => [] },
2100
- parentResults: { default: () => [] },
2101
- currentObject: null
2071
+ isCreateNewOption: { type: Boolean, default: false },
2072
+ selectedIndex: { default: -1 },
2073
+ text: { default: "" },
2074
+ option: { default: () => null },
2075
+ index: null
2102
2076
  },
2103
2077
  emits: {
2104
- search: null,
2105
- "search-parent": null,
2106
2078
  "create-object": null,
2107
- "create-parent-object": null,
2108
- "update:current-object": null
2079
+ "select-object": null,
2080
+ "option-highlighted": null
2109
2081
  },
2110
2082
  setup(__props, { emit }) {
2111
2083
  const props = __props;
2112
- const { t: t2 } = useI18n();
2113
- const searchContainerVisible = ref(false);
2114
- const selectedItem = computed({
2115
- get: () => props.currentObject,
2116
- set: (value) => emit("update:current-object", value)
2084
+ const displayedText = computed(() => {
2085
+ var _a, _b;
2086
+ return (_b = (_a = props.option) == null ? void 0 : _a.name) != null ? _b : props.text;
2117
2087
  });
2118
- const parentItem = ref(null);
2119
- const currentText = computed(() => getDisplayName());
2120
- const objectToCreateValue = ref("");
2121
- const parentObjectToCreateValue = ref("");
2122
- const createObjectRequest = ref();
2123
- const objectToCreateValid = ref(true);
2124
- function toggleDropdown(forcedState) {
2125
- if (!props.disabled) {
2126
- if (typeof forcedState !== "undefined") {
2127
- searchContainerVisible.value = forcedState;
2128
- } else {
2129
- searchContainerVisible.value = !searchContainerVisible.value;
2130
- }
2088
+ const displayedParent = computed(() => {
2089
+ var _a, _b;
2090
+ return (_b = (_a = props.option) == null ? void 0 : _a.parentName) != null ? _b : "";
2091
+ });
2092
+ const isHighlighted = ref(false);
2093
+ function optionSelected() {
2094
+ var _a;
2095
+ if (props.isCreateNewOption === true) {
2096
+ emit("create-object");
2097
+ } else {
2098
+ emit("select-object", (_a = props.option) == null ? void 0 : _a.id);
2131
2099
  }
2132
2100
  }
2133
- function search(searchTerm) {
2134
- objectToCreateValue.value = searchTerm;
2135
- emit("search", searchTerm);
2136
- }
2137
- function searchParent(searchTerm) {
2138
- parentObjectToCreateValue.value = searchTerm;
2139
- emit("search-parent", searchTerm);
2140
- }
2141
- function clearObject() {
2142
- selectedItem.value = null;
2143
- toggleDropdown(false);
2144
- }
2145
- function selectObject(id) {
2146
- const item = getComboBoxItemById(id);
2147
- selectedItem.value = item;
2148
- toggleDropdown(false);
2149
- }
2150
- function getComboBoxItemById(id) {
2151
- let currentItem = null;
2152
- if (props.results !== null) {
2153
- for (let i = 0; i < props.results.length; i++) {
2154
- if (props.results[i].id === id) {
2155
- currentItem = props.results[i];
2156
- break;
2157
- }
2101
+ function onHover(hovered) {
2102
+ if (hovered === true) {
2103
+ isHighlighted.value = true;
2104
+ emit("option-highlighted", props.index);
2105
+ } else {
2106
+ if (props.index !== props.selectedIndex) {
2107
+ isHighlighted.value = false;
2158
2108
  }
2159
2109
  }
2160
- return currentItem;
2161
- }
2162
- function createObject() {
2163
- var _a, _b;
2164
- createObjectRequest.value = {
2165
- name: objectToCreateValue.value,
2166
- parentId: (_b = (_a = parentItem.value) == null ? void 0 : _a.id) != null ? _b : 0
2167
- };
2168
- emit("create-object", createObjectRequest.value);
2169
2110
  }
2170
- function createParentObject() {
2171
- createObjectRequest.value = {
2172
- name: parentObjectToCreateValue.value,
2173
- parentId: 0
2174
- };
2175
- emit("create-parent-object", createObjectRequest.value);
2111
+ function updateHighlight() {
2112
+ if (props.selectedIndex === props.index) {
2113
+ isHighlighted.value = true;
2114
+ } else {
2115
+ isHighlighted.value = false;
2116
+ }
2176
2117
  }
2177
- function handleObjectCreateResponse() {
2118
+ watch(() => props.selectedIndex, () => updateHighlight());
2119
+ return (_ctx, _cache) => {
2178
2120
  var _a, _b;
2179
- if ((_a = props.objectCreatedResponse) == null ? void 0 : _a.error) {
2180
- showNotification({
2181
- message: t2("comboBox.noResults", { name: objectToCreateValue.value, error: props.objectCreatedResponse.error }),
2182
- colour: "danger",
2121
+ const _component_icon = resolveComponent("icon");
2122
+ return openBlock(), createElementBlock("div", {
2123
+ class: normalizeClass(["cl-border-b cl-border-grey-0 cl-border-t cl-cursor-pointer cl-duration-75 cl-flex cl-p-1 cl-transition-colors", {
2124
+ "cl-bg-grey-0": isHighlighted.value === false,
2125
+ "cl-bg-primary-default cl-text-white": isHighlighted.value
2126
+ }]),
2127
+ onMousedown: optionSelected,
2128
+ onMousemove: _cache[0] || (_cache[0] = ($event) => onHover(true)),
2129
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => onHover(false))
2130
+ }, [
2131
+ __props.option !== null && ((_a = __props.option) == null ? void 0 : _a.parentId) !== 0 && ((_b = __props.option) == null ? void 0 : _b.parentId) !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$h, toDisplayString(unref(displayedParent)), 1)) : createCommentVNode("", true),
2132
+ createElementVNode("div", {
2133
+ class: normalizeClass({
2134
+ "cl-w-1/2": unref(displayedParent) !== "",
2135
+ "cl-w-full": unref(displayedParent) === ""
2136
+ })
2137
+ }, toDisplayString(unref(displayedText)), 3),
2138
+ withDirectives(createElementVNode("div", _hoisted_2$g, [
2139
+ createVNode(_component_icon, {
2140
+ class: "cl-bg-primary-default cl-rounded-full cl-text-white",
2141
+ icon: "ph:plus-circle"
2142
+ })
2143
+ ], 512), [
2144
+ [vShow, __props.isCreateNewOption]
2145
+ ])
2146
+ ], 34);
2147
+ };
2148
+ }
2149
+ });
2150
+ const _hoisted_1$g = ["onKeyup"];
2151
+ const _hoisted_2$f = { class: "cl-flex" };
2152
+ const _hoisted_3$d = { key: 5 };
2153
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2154
+ props: {
2155
+ loading: { type: Boolean, default: false },
2156
+ objectType: null,
2157
+ objectParentType: { default: "" },
2158
+ errorMessage: { default: "" },
2159
+ canCreateNewObject: { type: Boolean, default: false },
2160
+ canClearSelectedObject: { type: Boolean, default: true },
2161
+ currentObjectName: { default: "" },
2162
+ results: { default: () => [] },
2163
+ isVisible: { type: Boolean, default: false }
2164
+ },
2165
+ emits: {
2166
+ "clear-object": null,
2167
+ "create-object": null,
2168
+ "select-object": null,
2169
+ search: null,
2170
+ "hide-dropdown": null
2171
+ },
2172
+ setup(__props, { emit }) {
2173
+ const props = __props;
2174
+ const { t: t2 } = useI18n();
2175
+ const searchText = ref("");
2176
+ const showAddNewOption = ref(false);
2177
+ const currentSelection = ref(-1);
2178
+ const firstIndexInResults = computed(() => showAddNewOption.value ? -1 : 0);
2179
+ const container = ref();
2180
+ function search(keyboardEvent) {
2181
+ if (keyboardEvent === void 0 || (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Arrow")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Control")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Shift")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Tab")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code) !== "Enter") {
2182
+ emit("search", searchText.value);
2183
+ currentSelection.value = -2;
2184
+ }
2185
+ }
2186
+ function selectObject(id) {
2187
+ emit("select-object", id);
2188
+ }
2189
+ function createObject() {
2190
+ emit("create-object", searchText.value);
2191
+ hideDropdown();
2192
+ }
2193
+ function hideDropdown() {
2194
+ emit("hide-dropdown");
2195
+ }
2196
+ function onKeyboardArrowDown(firstIndex) {
2197
+ if (currentSelection.value < props.results.length - 1) {
2198
+ if (currentSelection.value === -2 && searchText.value === "") {
2199
+ currentSelection.value++;
2200
+ }
2201
+ currentSelection.value++;
2202
+ } else {
2203
+ currentSelection.value = firstIndex;
2204
+ }
2205
+ scroll();
2206
+ }
2207
+ function onKeyboardArrowUp(firstIndex) {
2208
+ if (currentSelection.value > firstIndex) {
2209
+ currentSelection.value--;
2210
+ } else {
2211
+ currentSelection.value = props.results.length - 1;
2212
+ }
2213
+ scroll();
2214
+ }
2215
+ function onKeyboardEnter() {
2216
+ if (currentSelection.value >= 0 && props.results !== void 0) {
2217
+ selectObject(props.results[currentSelection.value].id);
2218
+ } else if (currentSelection.value === -1) {
2219
+ createObject();
2220
+ }
2221
+ }
2222
+ function onKeyboardShiftTab(keyboardEvent) {
2223
+ if (keyboardEvent.key === "Tab" && keyboardEvent.shiftKey === true) {
2224
+ const selectableElements = document.getElementsByTagName("input");
2225
+ let indexOfPreviouslySelectableItem = -1;
2226
+ for (let i = 0; i < selectableElements.length; i++) {
2227
+ if (selectableElements[i] === keyboardEvent.target) {
2228
+ indexOfPreviouslySelectableItem = i - 1;
2229
+ }
2230
+ }
2231
+ if (indexOfPreviouslySelectableItem >= 0) {
2232
+ selectableElements[indexOfPreviouslySelectableItem].focus();
2233
+ hideDropdown();
2234
+ }
2235
+ }
2236
+ }
2237
+ function scroll() {
2238
+ var _a;
2239
+ if (props.results && props.results.length > 1) {
2240
+ const heightOffset = 34;
2241
+ (_a = container.value) == null ? void 0 : _a.scrollTo(0, (currentSelection.value + 1) * heightOffset - heightOffset * 2);
2242
+ }
2243
+ }
2244
+ function updateAddNewOption() {
2245
+ let finalResultMatches = false;
2246
+ if (props.results !== null && props.results.length === 1) {
2247
+ finalResultMatches = searchText.value.toUpperCase().trim() === props.results[0].name.toUpperCase().trim();
2248
+ }
2249
+ showAddNewOption.value = props.canCreateNewObject === true && props.errorMessage === "" && searchText.value.trim() !== "" && finalResultMatches === false;
2250
+ }
2251
+ function updateSelectedObjectIndex(index) {
2252
+ currentSelection.value = index;
2253
+ }
2254
+ function onVisibilityChanged() {
2255
+ if (props.isVisible === true) {
2256
+ searchText.value = "";
2257
+ search();
2258
+ nextTick(() => {
2259
+ var _a, _b;
2260
+ return (_b = (_a = container.value) == null ? void 0 : _a.querySelector("input")) == null ? void 0 : _b.focus();
2261
+ });
2262
+ }
2263
+ }
2264
+ watch(() => props.results, () => updateAddNewOption());
2265
+ watch(() => props.errorMessage, () => updateAddNewOption());
2266
+ watch(() => props.isVisible, () => onVisibilityChanged());
2267
+ onMounted(() => {
2268
+ var _a;
2269
+ return (_a = container.value) == null ? void 0 : _a.addEventListener("keydown", onKeyboardShiftTab);
2270
+ });
2271
+ onUnmounted(() => {
2272
+ var _a;
2273
+ return (_a = container.value) == null ? void 0 : _a.removeEventListener("keydown", onKeyboardShiftTab);
2274
+ });
2275
+ return (_ctx, _cache) => {
2276
+ var _a;
2277
+ const _component_cl_ui_loading_spinner = resolveComponent("cl-ui-loading-spinner");
2278
+ return openBlock(), createElementBlock("div", {
2279
+ ref: (_value, _refs) => {
2280
+ _refs["container"] = _value;
2281
+ container.value = _value;
2282
+ },
2283
+ class: "cl-bg-white cl-border cl-border-collapse cl-border-grey-0 cl-h-52 cl-overflow-y-auto cl-p-2 cl-rounded cl-text-sm",
2284
+ onKeydown: [
2285
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => onKeyboardArrowUp(unref(firstIndexInResults)), ["prevent", "stop"]), ["up"])),
2286
+ _cache[3] || (_cache[3] = withKeys(withModifiers(($event) => onKeyboardArrowDown(unref(firstIndexInResults)), ["prevent", "stop"]), ["down"]))
2287
+ ],
2288
+ onKeyup: withKeys(withModifiers(onKeyboardEnter, ["prevent", "stop"]), ["enter"])
2289
+ }, [
2290
+ createElementVNode("div", _hoisted_2$f, [
2291
+ createVNode(ClUiInput, {
2292
+ modelValue: searchText.value,
2293
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
2294
+ class: "!cl-mr-0 cl-mb-1 cl-w-full",
2295
+ "input-type": "text",
2296
+ "placeholder-text": unref(t2)("comboBox.searchHint", { object: __props.objectType }),
2297
+ onKeyup: search,
2298
+ onBlur: hideDropdown
2299
+ }, null, 8, ["modelValue", "placeholder-text"]),
2300
+ withDirectives(createVNode(_component_cl_ui_loading_spinner, { class: "cl-absolute cl-ml-2 cl-mt-11" }, null, 512), [
2301
+ [vShow, __props.loading]
2302
+ ])
2303
+ ]),
2304
+ __props.currentObjectName !== "" ? (openBlock(), createBlock(_sfc_main$j, {
2305
+ key: 0,
2306
+ "show-clear-button": __props.canClearSelectedObject,
2307
+ text: __props.currentObjectName,
2308
+ onClearObject: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("clear-object"))
2309
+ }, null, 8, ["show-clear-button", "text"])) : createCommentVNode("", true),
2310
+ __props.objectParentType !== "" && __props.results !== void 0 && __props.results.length > 0 && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$j, {
2311
+ key: 1,
2312
+ text: __props.objectType,
2313
+ "additional-text": __props.objectParentType
2314
+ }, null, 8, ["text", "additional-text"])) : createCommentVNode("", true),
2315
+ __props.results !== null && ((_a = __props.results) == null ? void 0 : _a.length) === 0 && searchText.value.trim() !== "" && __props.canCreateNewObject === false && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$j, {
2316
+ key: 2,
2317
+ text: unref(t2)("comboBox.noResults", { object: __props.objectType })
2318
+ }, null, 8, ["text"])) : createCommentVNode("", true),
2319
+ __props.errorMessage !== "" ? (openBlock(), createBlock(_sfc_main$j, {
2320
+ key: 3,
2321
+ class: "!cl-bg-danger-light cl-border-danger-light cl-rounded cl-text-danger-dark",
2322
+ text: unref(t2)("comboBox.errorMessage", { error: __props.errorMessage })
2323
+ }, null, 8, ["text"])) : createCommentVNode("", true),
2324
+ showAddNewOption.value ? (openBlock(), createBlock(_sfc_main$i, {
2325
+ key: 4,
2326
+ "is-create-new-option": true,
2327
+ text: unref(t2)("comboBox.addPrompt", { value: searchText.value, object: __props.objectType }),
2328
+ index: -1,
2329
+ "selected-index": currentSelection.value,
2330
+ onCreateObject: createObject,
2331
+ onOptionHighlighted: updateSelectedObjectIndex
2332
+ }, null, 8, ["text", "selected-index"])) : createCommentVNode("", true),
2333
+ __props.errorMessage === "" && __props.results !== null ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
2334
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.results, (result, index) => {
2335
+ return openBlock(), createBlock(_sfc_main$i, {
2336
+ key: index,
2337
+ option: result,
2338
+ index,
2339
+ "selected-index": currentSelection.value,
2340
+ onSelectObject: selectObject,
2341
+ onOptionHighlighted: updateSelectedObjectIndex
2342
+ }, null, 8, ["option", "index", "selected-index"]);
2343
+ }), 128))
2344
+ ])) : createCommentVNode("", true)
2345
+ ], 40, _hoisted_1$g);
2346
+ };
2347
+ }
2348
+ });
2349
+ const _hoisted_1$f = { class: "cl-flex" };
2350
+ const _hoisted_2$e = { class: "cl-relative cl-right-20 cl-top-0.5" };
2351
+ const _hoisted_3$c = { class: "cl-absolute cl-flex cl-float-right cl-font-semibold cl-mt-2 cl-text-danger-default cl-text-sm" };
2352
+ const _hoisted_4$a = { class: "cl-ml-4 cl-w-11/12" };
2353
+ const _hoisted_5$7 = { class: "cl-p-2 cl-text-right cl-w-full" };
2354
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2355
+ props: {
2356
+ loading: { type: Boolean, default: false },
2357
+ disabled: { type: Boolean, default: false },
2358
+ required: { type: Boolean, default: false },
2359
+ objectType: null,
2360
+ objectParentType: { default: "" },
2361
+ canCreateNewObject: { type: Boolean, default: false },
2362
+ canClearSelectedObject: { type: Boolean, default: true },
2363
+ errorMessage: { default: "" },
2364
+ objectCreatedResponse: { default: () => null },
2365
+ parentObjectCreatedResponse: { default: () => null },
2366
+ results: { default: () => [] },
2367
+ parentResults: { default: () => [] },
2368
+ currentObject: null
2369
+ },
2370
+ emits: {
2371
+ focus: null,
2372
+ search: null,
2373
+ "search-parent": null,
2374
+ "create-object": null,
2375
+ "create-parent-object": null,
2376
+ "update:current-object": null
2377
+ },
2378
+ setup(__props, { emit }) {
2379
+ const props = __props;
2380
+ const { t: t2 } = useI18n();
2381
+ const searchContainerVisible = ref(false);
2382
+ const selectedItem = computed({
2383
+ get: () => props.currentObject,
2384
+ set: (value) => emit("update:current-object", value)
2385
+ });
2386
+ const parentItem = ref(null);
2387
+ const currentText = computed(() => getDisplayName());
2388
+ const objectToCreateValue = ref("");
2389
+ const parentObjectToCreateValue = ref("");
2390
+ const createObjectRequest = ref();
2391
+ const objectToCreateValid = ref(true);
2392
+ function toggleDropdown(forcedState) {
2393
+ if (!props.disabled) {
2394
+ if (typeof forcedState !== "undefined") {
2395
+ searchContainerVisible.value = forcedState;
2396
+ } else {
2397
+ searchContainerVisible.value = !searchContainerVisible.value;
2398
+ }
2399
+ }
2400
+ }
2401
+ function search(searchTerm) {
2402
+ objectToCreateValue.value = searchTerm;
2403
+ emit("search", searchTerm);
2404
+ }
2405
+ function searchParent(searchTerm) {
2406
+ parentObjectToCreateValue.value = searchTerm;
2407
+ emit("search-parent", searchTerm);
2408
+ }
2409
+ function clearObject() {
2410
+ selectedItem.value = null;
2411
+ toggleDropdown(false);
2412
+ }
2413
+ function selectObject(id) {
2414
+ const item = getComboBoxItemById(id);
2415
+ selectedItem.value = item;
2416
+ toggleDropdown(false);
2417
+ }
2418
+ function getComboBoxItemById(id) {
2419
+ let currentItem = null;
2420
+ if (props.results !== null) {
2421
+ for (let i = 0; i < props.results.length; i++) {
2422
+ if (props.results[i].id === id) {
2423
+ currentItem = props.results[i];
2424
+ break;
2425
+ }
2426
+ }
2427
+ }
2428
+ return currentItem;
2429
+ }
2430
+ function createObject() {
2431
+ var _a, _b;
2432
+ createObjectRequest.value = {
2433
+ name: objectToCreateValue.value,
2434
+ parentId: (_b = (_a = parentItem.value) == null ? void 0 : _a.id) != null ? _b : 0
2435
+ };
2436
+ emit("create-object", createObjectRequest.value);
2437
+ }
2438
+ function createParentObject() {
2439
+ createObjectRequest.value = {
2440
+ name: parentObjectToCreateValue.value,
2441
+ parentId: 0
2442
+ };
2443
+ emit("create-parent-object", createObjectRequest.value);
2444
+ }
2445
+ function handleObjectCreateResponse() {
2446
+ var _a, _b;
2447
+ if ((_a = props.objectCreatedResponse) == null ? void 0 : _a.error) {
2448
+ showNotification({
2449
+ message: t2("comboBox.noResults", { name: objectToCreateValue.value, error: props.objectCreatedResponse.error }),
2450
+ colour: "danger",
2183
2451
  duration: 1e4
2184
2452
  });
2185
2453
  } else if ((_b = props.objectCreatedResponse) == null ? void 0 : _b.id) {
@@ -2242,21 +2510,22 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2242
2510
  const _component_icon = resolveComponent("icon");
2243
2511
  const _component_cl_ui_combo_box = resolveComponent("cl-ui-combo-box", true);
2244
2512
  return openBlock(), createElementBlock("div", null, [
2245
- createElementVNode("div", _hoisted_1$h, [
2246
- withDirectives(createElementVNode("input", {
2513
+ createElementVNode("div", _hoisted_1$f, [
2514
+ createVNode(ClUiInput, {
2515
+ modelValue: unref(currentText),
2247
2516
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentText) ? currentText.value = $event : null),
2248
- class: normalizeClass(["!cl-bg-transparent cl-z-10", {
2517
+ class: normalizeClass(["!cl-bg-transparent !cl-mr-0 cl-mb-0 cl-rounded-r-none cl-w-full cl-z-10", {
2249
2518
  "cl-cursor-pointer": __props.disabled === false
2250
2519
  }]),
2251
- type: "text",
2252
- placeholder: unref(t2)("comboBox.emptyHintText", { object: __props.objectType }),
2253
- disabled: __props.disabled,
2254
- onFocus: _cache[1] || (_cache[1] = ($event) => toggleDropdown(true))
2255
- }, null, 42, _hoisted_2$g), [
2256
- [vModelText, unref(currentText)]
2257
- ]),
2258
- withDirectives(createElementVNode("div", _hoisted_3$e, [
2259
- createElementVNode("div", _hoisted_4$c, [
2520
+ "input-type": "text",
2521
+ "placeholder-text": unref(t2)("comboBox.emptyHintText", { object: __props.objectType }),
2522
+ onFocus: _cache[1] || (_cache[1] = ($event) => {
2523
+ toggleDropdown(true);
2524
+ _ctx.$emit("focus");
2525
+ })
2526
+ }, null, 8, ["modelValue", "class", "placeholder-text"]),
2527
+ withDirectives(createElementVNode("div", _hoisted_2$e, [
2528
+ createElementVNode("div", _hoisted_3$c, [
2260
2529
  createTextVNode(toDisplayString(unref(t2)("comboBox.required")) + " ", 1),
2261
2530
  createVNode(_component_icon, {
2262
2531
  class: "cl-ml-1 cl-mt-1",
@@ -2267,7 +2536,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2267
2536
  [vShow, __props.required && __props.disabled === false && __props.currentObject === null]
2268
2537
  ]),
2269
2538
  createElementVNode("div", {
2270
- class: normalizeClass(["cl-border cl-border-grey-1 cl-float-right cl-px-1 cl-py-2.5 cl-text-grey-3 cl-transition-colors cl-w-min hover:cl-bg-primary-default hover:cl-text-white", {
2539
+ class: normalizeClass(["cl-border cl-border-grey-1 cl-float-right cl-h-10 cl-px-1 cl-py-2.5 cl-rounded cl-rounded-l-none cl-text-grey-3 cl-transition-colors cl-w-min hover:cl-bg-primary-default hover:cl-text-white", {
2271
2540
  "cl-bg-off-white cl-cursor-default hover:cl-bg-off-white hover:cl-text-grey-3": __props.disabled,
2272
2541
  "cl-cursor-pointer": __props.disabled === false
2273
2542
  }]),
@@ -2279,12 +2548,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2279
2548
  })
2280
2549
  ], 2)
2281
2550
  ]),
2282
- createVNode(_sfc_main$m, { size: "x-small" }, {
2551
+ createVNode(_sfc_main$k, { size: "x-small" }, {
2283
2552
  title: withCtx(() => [
2284
2553
  createTextVNode(toDisplayString(unref(t2)("comboBox.createTitle", { object: __props.objectType })), 1)
2285
2554
  ]),
2286
2555
  trigger: withCtx(({ open }) => [
2287
- withDirectives(createVNode(_sfc_main$j, {
2556
+ withDirectives(createVNode(_sfc_main$h, {
2288
2557
  "can-create-new-object": __props.canCreateNewObject,
2289
2558
  "can-clear-selected-object": __props.canClearSelectedObject,
2290
2559
  loading: __props.loading,
@@ -2304,7 +2573,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2304
2573
  ])
2305
2574
  ]),
2306
2575
  footer: withCtx(({ close }) => [
2307
- createElementVNode("div", _hoisted_6$8, [
2576
+ createElementVNode("div", _hoisted_5$7, [
2308
2577
  createVNode(_sfc_main$p, {
2309
2578
  class: "cl-mr-4",
2310
2579
  colour: "primary",
@@ -2333,28 +2602,29 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2333
2602
  ])
2334
2603
  ]),
2335
2604
  default: withCtx(() => [
2336
- __props.objectParentType ? (openBlock(), createBlock(_component_cl_ui_combo_box, {
2337
- key: 0,
2338
- "current-object": parentItem.value,
2339
- "onUpdate:current-object": _cache[4] || (_cache[4] = ($event) => parentItem.value = $event),
2340
- class: "cl-mt-3",
2341
- results: __props.parentResults,
2342
- loading: __props.loading,
2343
- "object-type": __props.objectParentType,
2344
- "object-created-response": __props.parentObjectCreatedResponse,
2345
- "can-create-new-object": __props.canCreateNewObject,
2346
- "can-clear-selected-object": __props.canClearSelectedObject,
2347
- "error-message": __props.errorMessage,
2348
- onSearch: searchParent,
2349
- onCreateObject: createParentObject
2350
- }, null, 8, ["current-object", "results", "loading", "object-type", "object-created-response", "can-create-new-object", "can-clear-selected-object", "error-message"])) : createCommentVNode("", true),
2351
- createElementVNode("label", _hoisted_5$a, toDisplayString(unref(t2)("comboBox.createProperty")), 1),
2352
- withDirectives(createElementVNode("input", {
2353
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => objectToCreateValue.value = $event),
2354
- class: "cl-mb-2",
2355
- type: "text"
2356
- }, null, 512), [
2357
- [vModelText, objectToCreateValue.value]
2605
+ createElementVNode("div", _hoisted_4$a, [
2606
+ __props.objectParentType ? (openBlock(), createBlock(_component_cl_ui_combo_box, {
2607
+ key: 0,
2608
+ "current-object": parentItem.value,
2609
+ "onUpdate:current-object": _cache[4] || (_cache[4] = ($event) => parentItem.value = $event),
2610
+ class: "cl-mt-3",
2611
+ results: __props.parentResults,
2612
+ loading: __props.loading,
2613
+ "object-type": __props.objectParentType,
2614
+ "object-created-response": __props.parentObjectCreatedResponse,
2615
+ "can-create-new-object": __props.canCreateNewObject,
2616
+ "can-clear-selected-object": __props.canClearSelectedObject,
2617
+ "error-message": __props.errorMessage,
2618
+ onSearch: searchParent,
2619
+ onCreateObject: createParentObject
2620
+ }, null, 8, ["current-object", "results", "loading", "object-type", "object-created-response", "can-create-new-object", "can-clear-selected-object", "error-message"])) : createCommentVNode("", true),
2621
+ createVNode(ClUiInput, {
2622
+ modelValue: objectToCreateValue.value,
2623
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => objectToCreateValue.value = $event),
2624
+ label: unref(t2)("comboBox.createProperty"),
2625
+ class: "cl-mb-2 cl-pt-2 cl-w-full",
2626
+ "input-type": "text"
2627
+ }, null, 8, ["modelValue", "label"])
2358
2628
  ])
2359
2629
  ]),
2360
2630
  _: 1
@@ -2369,42 +2639,41 @@ function isComboBoxItem(objectToTest) {
2369
2639
  function isComboBoxCreateRequest(objectToTest) {
2370
2640
  return typeof objectToTest.name === "string";
2371
2641
  }
2372
- const _sfc_main$h = {};
2373
- const _hoisted_1$g = { class: "cl-flex cl-flex-wrap cl-left-0 cl-mt-4 cl-w-full" };
2374
- const _hoisted_2$f = {
2642
+ const _sfc_main$f = {};
2643
+ const _hoisted_1$e = { class: "cl-flex cl-flex-wrap cl-left-0 cl-mt-4 cl-w-full" };
2644
+ const _hoisted_2$d = {
2375
2645
  key: 0,
2376
2646
  class: "cl-w-full"
2377
2647
  };
2378
- const _hoisted_3$d = {
2648
+ const _hoisted_3$b = {
2379
2649
  key: 1,
2380
2650
  class: "cl-leading-10 cl-text-sm cl-w-full"
2381
2651
  };
2382
- const _hoisted_4$b = { class: "cl-float-left" };
2383
- const _hoisted_5$9 = { class: "cl-float-right" };
2652
+ const _hoisted_4$9 = { class: "cl-float-left" };
2653
+ const _hoisted_5$6 = { class: "cl-float-right" };
2384
2654
  function _sfc_render$3(_ctx, _cache) {
2385
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
2386
- _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
2655
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
2656
+ _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
2387
2657
  renderSlot(_ctx.$slots, "default")
2388
2658
  ])) : createCommentVNode("", true),
2389
- _ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
2390
- createElementVNode("span", _hoisted_4$b, [
2659
+ _ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$b, [
2660
+ createElementVNode("span", _hoisted_4$9, [
2391
2661
  renderSlot(_ctx.$slots, "left")
2392
2662
  ]),
2393
- createElementVNode("span", _hoisted_5$9, [
2663
+ createElementVNode("span", _hoisted_5$6, [
2394
2664
  renderSlot(_ctx.$slots, "right")
2395
2665
  ])
2396
2666
  ])) : createCommentVNode("", true)
2397
2667
  ]);
2398
2668
  }
2399
- var clUiFooter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$3]]);
2400
- const _hoisted_1$f = { class: "cl-mr-2 lg:cl-hidden" };
2401
- const _hoisted_2$e = { class: "cl-mr-2 lg:cl-hidden" };
2402
- const _hoisted_3$c = ["checked"];
2403
- const _hoisted_4$a = {
2669
+ var clUiFooter = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$3]]);
2670
+ const _hoisted_1$d = { class: "cl-mr-2 lg:cl-hidden" };
2671
+ const _hoisted_2$c = { class: "cl-mr-2 lg:cl-hidden" };
2672
+ const _hoisted_3$a = {
2404
2673
  key: 0,
2405
2674
  class: "cl-inline-block cl-whitespace-nowrap"
2406
2675
  };
2407
- const _hoisted_5$8 = {
2676
+ const _hoisted_4$8 = {
2408
2677
  key: 1,
2409
2678
  class: "cl-inline-block cl-whitespace-nowrap"
2410
2679
  };
@@ -2451,7 +2720,7 @@ function setup$1(__props, { emit }) {
2451
2720
  "cl-bg-link-lighter": unref(edited)
2452
2721
  }]
2453
2722
  }), [
2454
- createElementVNode("strong", _hoisted_1$f, toDisplayString(__props.column.caption), 1),
2723
+ createElementVNode("strong", _hoisted_1$d, toDisplayString(__props.column.caption), 1),
2455
2724
  renderSlot(_ctx.$slots, `${__props.column.name}Edit`, normalizeProps(guardReactiveProps({
2456
2725
  cellFocused,
2457
2726
  column: __props.column,
@@ -2459,13 +2728,13 @@ function setup$1(__props, { emit }) {
2459
2728
  record: currentRecord.value
2460
2729
  })))
2461
2730
  ], 16)) : (openBlock(), createElementBlock("td", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)), [
2462
- createElementVNode("strong", _hoisted_2$e, toDisplayString(__props.column.caption), 1),
2463
- __props.column.type === "slot" ? renderSlot(_ctx.$slots, __props.column.name, normalizeProps(mergeProps({ key: 0 }, { column: __props.column, record: __props.record }))) : __props.column.type === "boolean" && __props.column.field !== void 0 ? (openBlock(), createElementBlock("input", {
2731
+ createElementVNode("strong", _hoisted_2$c, toDisplayString(__props.column.caption), 1),
2732
+ __props.column.type === "slot" ? renderSlot(_ctx.$slots, __props.column.name, normalizeProps(mergeProps({ key: 0 }, { column: __props.column, record: __props.record }))) : __props.column.type === "boolean" && __props.column.field !== void 0 ? (openBlock(), createBlock(ClUiInput, {
2464
2733
  key: 1,
2465
- type: "checkbox",
2466
- checked: getBooleanValue(__props.record, __props.column.field),
2467
- disabled: ""
2468
- }, null, 8, _hoisted_3$c)) : (__props.column.type === "date" || __props.column.type === "datetime") && __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2734
+ "input-type": "checkbox",
2735
+ "model-value": getBooleanValue(__props.record, __props.column.field),
2736
+ disabled: true
2737
+ }, null, 8, ["model-value"])) : (__props.column.type === "date" || __props.column.type === "datetime") && __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2469
2738
  __props.column.format !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2470
2739
  createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), __props.column.format)), 1)
2471
2740
  ], 64)) : __props.column.type === "date" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
@@ -2482,12 +2751,12 @@ function setup$1(__props, { emit }) {
2482
2751
  createTextVNode(toDisplayString(getNumericValue(__props.record, __props.column.field)), 1)
2483
2752
  ], 64))
2484
2753
  ], 64)) : __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2485
- __props.column.maxLength !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_4$a, toDisplayString(getStringValue(__props.record, __props.column.field).trimToLength(__props.column.maxLength, __props.column.format !== void 0 ? __props.column.format === "ellipsis" : false)), 1)) : (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString(getStringValue(__props.record, __props.column.field)), 1))
2754
+ __props.column.maxLength !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_3$a, toDisplayString(getStringValue(__props.record, __props.column.field).trimToLength(__props.column.maxLength, __props.column.format !== void 0 ? __props.column.format === "ellipsis" : false)), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$8, toDisplayString(getStringValue(__props.record, __props.column.field)), 1))
2486
2755
  ], 64)) : createCommentVNode("", true)
2487
2756
  ], 16));
2488
2757
  };
2489
2758
  }
2490
- const _sfc_main$g = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
2759
+ const _sfc_main$e = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
2491
2760
  props: {
2492
2761
  column: null,
2493
2762
  record: null,
@@ -2670,27 +2939,25 @@ function isFilterResponse(objectToTest, resultValidator) {
2670
2939
  }
2671
2940
  return objectValid;
2672
2941
  }
2673
- const _hoisted_1$e = {
2942
+ const _hoisted_1$c = {
2674
2943
  key: 0,
2675
2944
  class: "cl-border-grey-2 cl-border-r cl-capitalize cl-group cl-inline cl-relative cl-w-auto"
2676
2945
  };
2677
- const _hoisted_2$d = { class: "cl-bg-off-white cl-flex cl-h-full cl-items-center cl-justify-center cl-w-10" };
2678
- const _hoisted_3$b = { class: "cl-p-3" };
2679
- const _hoisted_4$9 = { class: "cl-px-4 cl-py-1 cl-w-full" };
2680
- const _hoisted_5$7 = ["innerHTML"];
2681
- const _hoisted_6$7 = { class: "cl-p-3" };
2682
- const _hoisted_7$7 = ["onClick"];
2683
- const _hoisted_8$6 = ["innerHTML"];
2946
+ const _hoisted_2$b = { class: "cl-bg-off-white cl-flex cl-h-full cl-items-center cl-justify-center cl-w-10" };
2947
+ const _hoisted_3$9 = { class: "cl-p-3" };
2948
+ const _hoisted_4$7 = { class: "cl-px-4 cl-py-1 cl-w-full" };
2949
+ const _hoisted_5$5 = ["innerHTML"];
2950
+ const _hoisted_6$5 = { class: "cl-p-3" };
2951
+ const _hoisted_7$5 = ["onClick"];
2952
+ const _hoisted_8$4 = ["innerHTML"];
2684
2953
  const _hoisted_9$4 = /* @__PURE__ */ createElementVNode("option", { value: void 0 }, null, -1);
2685
2954
  const _hoisted_10$4 = ["selected"];
2686
- const _hoisted_11$4 = ["selected"];
2687
- const _hoisted_12$4 = ["value"];
2688
- const _hoisted_13$4 = ["value"];
2689
- const _hoisted_14$3 = {
2955
+ const _hoisted_11$3 = ["selected"];
2956
+ const _hoisted_12$3 = {
2690
2957
  key: 1,
2691
2958
  class: "cl-flex cl-w-full"
2692
2959
  };
2693
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
2960
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2694
2961
  props: {
2695
2962
  request: null,
2696
2963
  column: null,
@@ -2725,9 +2992,18 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2725
2992
  var _a, _b;
2726
2993
  return (_b = (_a = props.request.filters.find((f) => f.filterOnColumn === props.column.field)) == null ? void 0 : _a.filterValue) != null ? _b : "";
2727
2994
  });
2728
- const currentNumberFilter = computed(() => Number(currentFilter.value));
2729
2995
  const currentDateFilter = computed(() => currentFilter.value !== "" ? new Date(currentFilter.value) : null);
2996
+ const filterInput = ref(currentFilter.value);
2730
2997
  const decimalSeparator = computed(() => Intl.NumberFormat(locale.value).format(1.1).replace(/[0-9]+/g, ""));
2998
+ const columnInputType = computed(() => {
2999
+ let inputType = "text";
3000
+ if (props.column.slotType === "date" || props.column.type === "date") {
3001
+ inputType = "date";
3002
+ } else if (props.column.slotType === "datetime" || props.column.type === "datetime") {
3003
+ inputType = "datetime";
3004
+ }
3005
+ return inputType;
3006
+ });
2731
3007
  function getDefaultFilterOperation() {
2732
3008
  return props.column.type === "string" || props.column.slotType === "string" ? FilterOperation.CONTAINS : props.column.type === "datetime" || props.column.slotType === "datetime" ? FilterOperation.LESS_THAN : FilterOperation.EQUAL;
2733
3009
  }
@@ -2801,7 +3077,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2801
3077
  return (_ctx, _cache) => {
2802
3078
  var _a, _b;
2803
3079
  const _component_icon = resolveComponent("icon");
2804
- const _component_cl_ui_calendar = resolveComponent("cl-ui-calendar");
2805
3080
  return __props.column.filterable === void 0 || __props.column.filterable === true ? (openBlock(), createElementBlock("div", {
2806
3081
  key: 0,
2807
3082
  class: normalizeClass(["cl-border-grey-2 cl-flex cl-rounded cl-w-full", {
@@ -2809,8 +3084,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2809
3084
  "cl-border": __props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0
2810
3085
  }])
2811
3086
  }, [
2812
- __props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
2813
- createElementVNode("div", _hoisted_2$d, [
3087
+ __props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
3088
+ createElementVNode("div", _hoisted_2$b, [
2814
3089
  createVNode(_component_icon, {
2815
3090
  icon: "ph:sliders-horizontal",
2816
3091
  size: 20
@@ -2822,15 +3097,15 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2822
3097
  "cl--left-44": !__props.firstHalf
2823
3098
  }])
2824
3099
  }, [
2825
- createElementVNode("strong", _hoisted_3$b, toDisplayString(unref(t2)("grid.currentMethod")), 1),
2826
- createElementVNode("span", _hoisted_4$9, [
3100
+ createElementVNode("strong", _hoisted_3$9, toDisplayString(unref(t2)("grid.currentMethod")), 1),
3101
+ createElementVNode("span", _hoisted_4$7, [
2827
3102
  createTextVNode(toDisplayString((_a = unref(currentFilterMethod)) == null ? void 0 : _a.description) + " ", 1),
2828
3103
  createElementVNode("span", {
2829
3104
  class: "cl-float-right",
2830
3105
  innerHTML: (_b = unref(currentFilterMethod)) == null ? void 0 : _b.icon
2831
- }, null, 8, _hoisted_5$7)
3106
+ }, null, 8, _hoisted_5$5)
2832
3107
  ]),
2833
- createElementVNode("strong", _hoisted_6$7, toDisplayString(unref(t2)("grid.availableMethods")), 1),
3108
+ createElementVNode("strong", _hoisted_6$5, toDisplayString(unref(t2)("grid.availableMethods")), 1),
2834
3109
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(allowedFilterMethods), (filterMethod, index) => {
2835
3110
  return openBlock(), createElementBlock("span", {
2836
3111
  key: index,
@@ -2841,8 +3116,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2841
3116
  createElementVNode("span", {
2842
3117
  class: "cl-float-right",
2843
3118
  innerHTML: filterMethod.icon
2844
- }, null, 8, _hoisted_8$6)
2845
- ], 8, _hoisted_7$7);
3119
+ }, null, 8, _hoisted_8$4)
3120
+ ], 8, _hoisted_7$5);
2846
3121
  }), 128))
2847
3122
  ], 2)
2848
3123
  ])) : createCommentVNode("", true),
@@ -2859,57 +3134,57 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2859
3134
  createElementVNode("option", {
2860
3135
  value: "false",
2861
3136
  selected: unref(currentFilter) === "false"
2862
- }, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$4)
2863
- ], 32)) : __props.column.type === "date" || __props.column.type === "datetime" || (__props.column.slotType === "date" || __props.column.slotType === "datetime") && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(_component_cl_ui_calendar, {
3137
+ }, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$3)
3138
+ ], 32)) : __props.column.type === "date" || __props.column.type === "datetime" || (__props.column.slotType === "date" || __props.column.slotType === "datetime") && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
2864
3139
  key: 2,
2865
- date: unref(currentDateFilter),
2866
- class: "cl-border-none cl-w-full",
2867
- type: __props.column.type,
2868
- "date-placeholder": unref(t2)("grid.selectDate"),
2869
- "date-time-placeholder": unref(t2)("grid.selectDateTime"),
2870
- "onUpdate:date": _cache[1] || (_cache[1] = ($event) => setDateFilter($event))
2871
- }, null, 8, ["date", "type", "date-placeholder", "date-time-placeholder"])) : __props.column.type === "number" || __props.column.slotType === "number" && typeof __props.column.field !== "undefined" ? (openBlock(), createElementBlock("input", {
3140
+ "model-value": unref(currentDateFilter),
3141
+ class: "!cl-border-none !cl-mb-0 !cl-mr-0 cl-w-full",
3142
+ min: "1900-01-01",
3143
+ max: "2999-12-31T23:59",
3144
+ label: __props.column.name,
3145
+ "show-label": false,
3146
+ "input-type": unref(columnInputType),
3147
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => setDateFilter($event))
3148
+ }, null, 8, ["model-value", "label", "input-type"])) : __props.column.type === "number" || __props.column.slotType === "number" && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
2872
3149
  key: 3,
2873
- value: unref(currentFilter),
2874
- class: "cl-border-none cl-w-full",
2875
- type: "text",
2876
- onKeyup: [
2877
- _cache[2] || (_cache[2] = withKeys(($event) => setFilter(null, (unref(currentNumberFilter) + 1).toString()), ["arrow-up"])),
2878
- _cache[3] || (_cache[3] = withKeys(($event) => setFilter(null, (unref(currentNumberFilter) - 1).toString()), ["arrow-down"]))
2879
- ],
2880
- onInput: _cache[4] || (_cache[4] = ($event) => unref(debounce)(setNumberFilter, [$event.target]))
2881
- }, null, 40, _hoisted_12$4)) : __props.column.type !== "slot" || __props.column.slotType === "string" && typeof __props.column.field !== "undefined" ? (openBlock(), createElementBlock("input", {
3150
+ modelValue: filterInput.value,
3151
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filterInput.value = $event),
3152
+ class: "cl-border-none cl-mb-0 cl-w-full",
3153
+ "input-type": "number",
3154
+ "show-arrows": false,
3155
+ onInput: _cache[3] || (_cache[3] = ($event) => unref(debounce)(setNumberFilter, [$event.target]))
3156
+ }, null, 8, ["modelValue"])) : __props.column.type !== "slot" || __props.column.slotType === "string" && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
2882
3157
  key: 4,
2883
- value: unref(currentFilter),
2884
- class: "cl-border-none cl-w-full",
2885
- type: "text",
3158
+ modelValue: filterInput.value,
3159
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filterInput.value = $event),
3160
+ class: "cl-border-none cl-mb-0 cl-w-full",
3161
+ "input-type": "text",
2886
3162
  onInput: _cache[5] || (_cache[5] = ($event) => unref(debounce)(setFilter, [$event.target]))
2887
- }, null, 40, _hoisted_13$4)) : createCommentVNode("", true)
2888
- ], 2)) : (openBlock(), createElementBlock("div", _hoisted_14$3, " \xA0 "));
3163
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
3164
+ ], 2)) : (openBlock(), createElementBlock("div", _hoisted_12$3, " \xA0 "));
2889
3165
  };
2890
3166
  }
2891
3167
  });
2892
- const _hoisted_1$d = {
3168
+ const _hoisted_1$b = {
2893
3169
  key: 0,
2894
3170
  class: "cl-flex cl-flex-wrap cl-justify-end cl-mt-4 cl-w-full"
2895
3171
  };
2896
- const _hoisted_2$c = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-items-center cl-mb-2 cl-px-3 cl-py-2 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-w-auto" };
2897
- const _hoisted_3$a = { class: "cl-text-grey-3 cl-w-max" };
2898
- const _hoisted_4$8 = ["value"];
2899
- const _hoisted_5$6 = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-flex-wrap cl-items-center cl-mb-2 cl-px-3 cl-py-2 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-ml-2 lg:cl-w-auto mb:cl-flex-nowrap" };
2900
- const _hoisted_6$6 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
2901
- const _hoisted_7$6 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
2902
- const _hoisted_8$5 = { class: "cl-text-grey-3 cl-w-full lg:cl-mr-2 lg:cl-w-auto" };
2903
- const _hoisted_9$3 = { class: "cl-flex cl-flex-wrap cl-text-sm mb:cl-flex-nowrap" };
2904
- const _hoisted_10$3 = { class: "cl-pr-2" };
2905
- const _hoisted_11$3 = ["onClick"];
2906
- const _hoisted_12$3 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
2907
- const _hoisted_13$3 = { class: "cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
2908
- const _hoisted_14$2 = ["onClick"];
2909
- const _hoisted_15$2 = { class: "cl-mb-2 cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
2910
- const _hoisted_16$2 = { class: "cl-block cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-inline-block lg:cl-mb-0 lg:cl-mr-1 lg:cl-w-auto" };
2911
- const _hoisted_17$2 = { class: "cl-block lg:cl-inline-block" };
2912
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
3172
+ const _hoisted_2$a = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-items-center cl-mb-2 cl-px-3 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-w-auto" };
3173
+ const _hoisted_3$8 = { class: "cl-text-grey-3 cl-w-max" };
3174
+ const _hoisted_4$6 = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-flex-wrap cl-items-center cl-mb-2 cl-px-3 cl-py-2 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-ml-2 lg:cl-w-auto mb:cl-flex-nowrap" };
3175
+ const _hoisted_5$4 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3176
+ const _hoisted_6$4 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
3177
+ const _hoisted_7$4 = { class: "cl-text-grey-3 cl-w-full lg:cl-mr-2 lg:cl-w-auto" };
3178
+ const _hoisted_8$3 = { class: "cl-flex cl-flex-wrap cl-text-sm mb:cl-flex-nowrap" };
3179
+ const _hoisted_9$3 = { class: "cl-pr-2" };
3180
+ const _hoisted_10$3 = ["onClick"];
3181
+ const _hoisted_11$2 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3182
+ const _hoisted_12$2 = { class: "cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
3183
+ const _hoisted_13$1 = ["onClick"];
3184
+ const _hoisted_14$1 = { class: "cl-mb-2 cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
3185
+ const _hoisted_15$1 = { class: "cl-block cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-inline-block lg:cl-mb-0 lg:cl-mr-1 lg:cl-w-auto" };
3186
+ const _hoisted_16$1 = { class: "cl-block lg:cl-inline-block" };
3187
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2913
3188
  props: {
2914
3189
  request: null,
2915
3190
  data: { default: () => null }
@@ -2928,6 +3203,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2928
3203
  ];
2929
3204
  const { n, t: t2 } = useI18n();
2930
3205
  const { debounce } = useDebouncer();
3206
+ const currentPage = ref(props.request.pageNumber);
2931
3207
  const totalPages = computed(() => props.data !== null ? Math.ceil(props.data.totalRecords / props.request.pageSize) : 1);
2932
3208
  const pageNumbers = computed(() => {
2933
3209
  const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
@@ -2957,29 +3233,35 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2957
3233
  filterRequest.pageNumber = 1;
2958
3234
  emit("update:request", filterRequest);
2959
3235
  }
3236
+ watch(() => props.request.pageNumber, () => currentPage.value = props.request.pageNumber);
2960
3237
  return (_ctx, _cache) => {
2961
3238
  var _a;
2962
3239
  const _component_icon = resolveComponent("icon");
2963
- return __props.data && ((_a = __props.data.results) == null ? void 0 : _a.length) && __props.request ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
2964
- createElementVNode("div", _hoisted_2$c, [
2965
- createElementVNode("span", _hoisted_3$a, toDisplayString(unref(t2)("grid.jumpToPage")), 1),
2966
- createElementVNode("input", {
2967
- class: "!cl-h-8 !cl-inline-block !cl-ml-2 !cl-text-sm !cl-w-max",
2968
- value: __props.request.pageNumber,
2969
- type: "number",
2970
- onInput: _cache[0] || (_cache[0] = ($event) => unref(debounce)(setPageFromInput, [$event.target]))
2971
- }, null, 40, _hoisted_4$8)
3240
+ return __props.data && ((_a = __props.data.results) == null ? void 0 : _a.length) && __props.request ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
3241
+ createElementVNode("div", _hoisted_2$a, [
3242
+ createElementVNode("span", _hoisted_3$8, toDisplayString(unref(t2)("grid.jumpToPage")), 1),
3243
+ createVNode(ClUiInput, {
3244
+ modelValue: currentPage.value,
3245
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
3246
+ class: "!cl-inline-block !cl-ml-2 !cl-mt-2 !cl-text-sm !cl-w-max",
3247
+ "input-type": "number",
3248
+ label: "Page",
3249
+ "show-label": false,
3250
+ min: "1",
3251
+ max: unref(totalPages),
3252
+ onInput: _cache[1] || (_cache[1] = ($event) => unref(debounce)(setPageFromInput, [$event.target]))
3253
+ }, null, 8, ["modelValue", "max"])
2972
3254
  ]),
2973
- createElementVNode("div", _hoisted_5$6, [
2974
- createElementVNode("div", _hoisted_6$6, [
2975
- createElementVNode("li", _hoisted_7$6, [
2976
- createElementVNode("span", _hoisted_8$5, toDisplayString(unref(t2)("grid.page")), 1)
3255
+ createElementVNode("div", _hoisted_4$6, [
3256
+ createElementVNode("div", _hoisted_5$4, [
3257
+ createElementVNode("li", _hoisted_6$4, [
3258
+ createElementVNode("span", _hoisted_7$4, toDisplayString(unref(t2)("grid.page")), 1)
2977
3259
  ]),
2978
- createElementVNode("ul", _hoisted_9$3, [
2979
- createElementVNode("li", _hoisted_10$3, toDisplayString(unref(n)(__props.request.pageNumber, unref(NumberFormat).INTEGER)) + " / " + toDisplayString(unref(n)(unref(totalPages), unref(NumberFormat).INTEGER)), 1),
3260
+ createElementVNode("ul", _hoisted_8$3, [
3261
+ createElementVNode("li", _hoisted_9$3, toDisplayString(unref(n)(__props.request.pageNumber, unref(NumberFormat).INTEGER)) + " / " + toDisplayString(unref(n)(unref(totalPages), unref(NumberFormat).INTEGER)), 1),
2980
3262
  withDirectives(createElementVNode("li", {
2981
3263
  class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
2982
- onClick: _cache[1] || (_cache[1] = ($event) => setPage(1))
3264
+ onClick: _cache[2] || (_cache[2] = ($event) => setPage(1))
2983
3265
  }, [
2984
3266
  createVNode(_component_icon, {
2985
3267
  icon: "ph:caret-double-left",
@@ -2990,7 +3272,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2990
3272
  ]),
2991
3273
  withDirectives(createElementVNode("li", {
2992
3274
  class: "cl-cursor-pointer cl-mt-1 lg:cl-mr-2 mr-1",
2993
- onClick: _cache[2] || (_cache[2] = ($event) => setPage(__props.request.pageNumber - 1))
3275
+ onClick: _cache[3] || (_cache[3] = ($event) => setPage(__props.request.pageNumber - 1))
2994
3276
  }, [
2995
3277
  createVNode(_component_icon, {
2996
3278
  icon: "ph:caret-left",
@@ -3007,11 +3289,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3007
3289
  "cl-text-grey-6": __props.request.pageNumber !== number
3008
3290
  }]),
3009
3291
  onClick: ($event) => setPage(number)
3010
- }, toDisplayString(unref(n)(number, unref(NumberFormat).INTEGER)), 11, _hoisted_11$3);
3292
+ }, toDisplayString(unref(n)(number, unref(NumberFormat).INTEGER)), 11, _hoisted_10$3);
3011
3293
  }), 128)),
3012
3294
  withDirectives(createElementVNode("li", {
3013
3295
  class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
3014
- onClick: _cache[3] || (_cache[3] = ($event) => setPage(__props.request.pageNumber + 1))
3296
+ onClick: _cache[4] || (_cache[4] = ($event) => setPage(__props.request.pageNumber + 1))
3015
3297
  }, [
3016
3298
  createVNode(_component_icon, {
3017
3299
  icon: "ph:caret-right",
@@ -3022,7 +3304,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3022
3304
  ]),
3023
3305
  withDirectives(createElementVNode("li", {
3024
3306
  class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
3025
- onClick: _cache[4] || (_cache[4] = ($event) => setPage(unref(totalPages)))
3307
+ onClick: _cache[5] || (_cache[5] = ($event) => setPage(unref(totalPages)))
3026
3308
  }, [
3027
3309
  createVNode(_component_icon, {
3028
3310
  icon: "ph:caret-double-right",
@@ -3033,8 +3315,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3033
3315
  ])
3034
3316
  ])
3035
3317
  ]),
3036
- createElementVNode("ul", _hoisted_12$3, [
3037
- createElementVNode("li", _hoisted_13$3, toDisplayString(unref(t2)("grid.pageSize")), 1),
3318
+ createElementVNode("ul", _hoisted_11$2, [
3319
+ createElementVNode("li", _hoisted_12$2, toDisplayString(unref(t2)("grid.pageSize")), 1),
3038
3320
  (openBlock(), createElementBlock(Fragment, null, renderList(pageSizes, (size, index) => {
3039
3321
  return createElementVNode("li", {
3040
3322
  key: index,
@@ -3043,31 +3325,30 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3043
3325
  "cl-text-grey-6": __props.request.pageSize !== size
3044
3326
  }]),
3045
3327
  onClick: ($event) => setPageSize(size)
3046
- }, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11, _hoisted_14$2);
3328
+ }, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11, _hoisted_13$1);
3047
3329
  }), 64))
3048
3330
  ]),
3049
- createElementVNode("ul", _hoisted_15$2, [
3050
- createElementVNode("li", _hoisted_16$2, toDisplayString(unref(t2)("grid.totalRecords")), 1),
3051
- createElementVNode("li", _hoisted_17$2, toDisplayString(unref(n)(__props.data.totalRecords, unref(NumberFormat).INTEGER)), 1)
3331
+ createElementVNode("ul", _hoisted_14$1, [
3332
+ createElementVNode("li", _hoisted_15$1, toDisplayString(unref(t2)("grid.totalRecords")), 1),
3333
+ createElementVNode("li", _hoisted_16$1, toDisplayString(unref(n)(__props.data.totalRecords, unref(NumberFormat).INTEGER)), 1)
3052
3334
  ])
3053
3335
  ])
3054
3336
  ])) : createCommentVNode("", true);
3055
3337
  };
3056
3338
  }
3057
3339
  });
3058
- const _hoisted_1$c = { class: "cl-fixed cl-flex cl-h-full cl-justify-end cl-right-0 cl-shadow-lg cl-top-0 cl-z-40" };
3059
- const _hoisted_2$b = { class: "cl-bg-secondary-default cl-h-full cl-overflow-y-auto cl-px-10 cl-py-20 cl-relative cl-text-grey-2 cl-w-80" };
3060
- const _hoisted_3$9 = { class: "cl-mb-4 cl-text-2xl cl-text-off-white" };
3061
- const _hoisted_4$7 = { class: "cl-border-grey-3 cl-border-t cl-flex cl-flex-wrap cl-text-sm cl-w-full" };
3062
- const _hoisted_5$5 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-py-2 cl-text-sm cl-w-full" };
3063
- const _hoisted_6$5 = { class: "cl-flex-1 cl-py-2" };
3064
- const _hoisted_7$5 = { class: "cl-py-2 cl-w-1/4" };
3065
- const _hoisted_8$4 = { class: "cl-py-2 cl-w-1/5" };
3340
+ const _hoisted_1$a = { class: "cl-fixed cl-flex cl-h-full cl-justify-end cl-right-0 cl-shadow-lg cl-top-0 cl-z-40" };
3341
+ const _hoisted_2$9 = { class: "cl-bg-secondary-default cl-h-full cl-overflow-y-auto cl-px-10 cl-py-20 cl-relative cl-text-grey-2 cl-w-80" };
3342
+ const _hoisted_3$7 = { class: "cl-mb-4 cl-text-2xl cl-text-off-white" };
3343
+ const _hoisted_4$5 = { class: "cl-border-grey-3 cl-border-t cl-flex cl-flex-wrap cl-text-sm cl-w-full" };
3344
+ const _hoisted_5$3 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-py-2 cl-text-sm cl-w-full" };
3345
+ const _hoisted_6$3 = { class: "cl-flex-1 cl-py-2" };
3346
+ const _hoisted_7$3 = { class: "cl-py-2 cl-w-1/4" };
3347
+ const _hoisted_8$2 = { class: "cl-py-2 cl-w-1/5" };
3066
3348
  const _hoisted_9$2 = { class: "cl-flex-1 cl-py-2" };
3067
3349
  const _hoisted_10$2 = { class: "cl-py-2 cl-w-1/4" };
3068
- const _hoisted_11$2 = ["checked", "onClick"];
3069
- const _hoisted_12$2 = { class: "cl-py-2 cl-text-off-white cl-w-1/5" };
3070
- const _hoisted_13$2 = { key: 1 };
3350
+ const _hoisted_11$1 = { class: "cl-py-2 cl-text-off-white cl-w-1/5" };
3351
+ const _hoisted_12$1 = { key: 1 };
3071
3352
  const __default__ = {
3072
3353
  inheritAttrs: false
3073
3354
  };
@@ -3112,20 +3393,20 @@ function setup(__props, { emit }) {
3112
3393
  (openBlock(), createBlock(Teleport, { to: "body" }, [
3113
3394
  createVNode(Transition, { name: "slide-left" }, {
3114
3395
  default: withCtx(() => [
3115
- withDirectives(createElementVNode("div", _hoisted_1$c, [
3116
- createElementVNode("div", _hoisted_2$b, [
3396
+ withDirectives(createElementVNode("div", _hoisted_1$a, [
3397
+ createElementVNode("div", _hoisted_2$9, [
3117
3398
  createVNode(_component_icon, {
3118
3399
  class: "cl-absolute cl-cursor-pointer cl-right-3 cl-text-off-white cl-top-3",
3119
3400
  icon: "ph:x",
3120
3401
  size: 16,
3121
3402
  onClick: _cache[1] || (_cache[1] = ($event) => visible.value = false)
3122
3403
  }),
3123
- createElementVNode("h3", _hoisted_3$9, toDisplayString(unref(t2)("grid.manageView")), 1),
3124
- createElementVNode("ul", _hoisted_4$7, [
3125
- createElementVNode("li", _hoisted_5$5, [
3126
- createElementVNode("strong", _hoisted_6$5, toDisplayString(unref(t2)("grid.column")), 1),
3127
- createElementVNode("strong", _hoisted_7$5, toDisplayString(unref(t2)("grid.visible")), 1),
3128
- createElementVNode("strong", _hoisted_8$4, toDisplayString(unref(t2)("grid.order")), 1)
3404
+ createElementVNode("h3", _hoisted_3$7, toDisplayString(unref(t2)("grid.manageView")), 1),
3405
+ createElementVNode("ul", _hoisted_4$5, [
3406
+ createElementVNode("li", _hoisted_5$3, [
3407
+ createElementVNode("strong", _hoisted_6$3, toDisplayString(unref(t2)("grid.column")), 1),
3408
+ createElementVNode("strong", _hoisted_7$3, toDisplayString(unref(t2)("grid.visible")), 1),
3409
+ createElementVNode("strong", _hoisted_8$2, toDisplayString(unref(t2)("grid.order")), 1)
3129
3410
  ]),
3130
3411
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, index) => {
3131
3412
  return openBlock(), createElementBlock("li", {
@@ -3134,13 +3415,13 @@ function setup(__props, { emit }) {
3134
3415
  }, [
3135
3416
  createElementVNode("div", _hoisted_9$2, toDisplayString(column.caption), 1),
3136
3417
  createElementVNode("div", _hoisted_10$2, [
3137
- createElementVNode("input", {
3138
- checked: column.visible === void 0 || column.visible === true,
3139
- type: "checkbox",
3418
+ createVNode(ClUiInput, {
3419
+ "model-value": column.visible === void 0 || column.visible === true,
3420
+ "input-type": "checkbox",
3140
3421
  onClick: ($event) => updateColumnVisibility($event.target, column)
3141
- }, null, 8, _hoisted_11$2)
3422
+ }, null, 8, ["model-value", "onClick"])
3142
3423
  ]),
3143
- createElementVNode("div", _hoisted_12$2, [
3424
+ createElementVNode("div", _hoisted_11$1, [
3144
3425
  column.visible === void 0 || column.visible === true ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3145
3426
  index !== 0 ? (openBlock(), createBlock(_component_icon, {
3146
3427
  key: 0,
@@ -3154,7 +3435,7 @@ function setup(__props, { emit }) {
3154
3435
  icon: "ph:arrow-right",
3155
3436
  onClick: ($event) => changeColumnOrder(index, "up")
3156
3437
  }, null, 8, ["onClick"])) : createCommentVNode("", true)
3157
- ], 64)) : (openBlock(), createElementBlock("em", _hoisted_13$2, toDisplayString(unref(t2)("grid.hidden")), 1))
3438
+ ], 64)) : (openBlock(), createElementBlock("em", _hoisted_12$1, toDisplayString(unref(t2)("grid.hidden")), 1))
3158
3439
  ])
3159
3440
  ]);
3160
3441
  }), 128))
@@ -3170,7 +3451,7 @@ function setup(__props, { emit }) {
3170
3451
  ], 64);
3171
3452
  };
3172
3453
  }
3173
- const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
3454
+ const _sfc_main$b = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
3174
3455
  props: {
3175
3456
  columns: null
3176
3457
  },
@@ -3179,14 +3460,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
3179
3460
  },
3180
3461
  setup
3181
3462
  }));
3182
- const _hoisted_1$b = {
3463
+ const _hoisted_1$9 = {
3183
3464
  key: 0,
3184
3465
  class: "cl-pb-2 cl-pr-2 cl-w-1/2 lg:cl-pb-0 lg:cl-w-auto"
3185
3466
  };
3186
- const _hoisted_2$a = { class: "cl-hidden cl-pr-2 lg:cl-inline-block" };
3187
- const _hoisted_3$8 = { class: "cl-pb-2 cl-pr-2 cl-w-1/2 lg:cl-pb-0 lg:cl-pr-0 lg:cl-w-auto" };
3188
- const _hoisted_4$6 = { class: "cl-pr-2 cl-w-full lg:cl-hidden md:cl-w-1/2" };
3189
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
3467
+ const _hoisted_2$8 = { class: "cl-hidden cl-pr-2 lg:cl-inline-block" };
3468
+ const _hoisted_3$6 = { class: "cl-pb-2 cl-pr-2 cl-w-1/2 lg:cl-pb-0 lg:cl-pr-0 lg:cl-w-auto" };
3469
+ const _hoisted_4$4 = { class: "cl-pr-2 cl-w-full lg:cl-hidden md:cl-w-1/2" };
3470
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3190
3471
  props: {
3191
3472
  columns: null,
3192
3473
  editMode: { type: Boolean },
@@ -3208,7 +3489,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3208
3489
  });
3209
3490
  return (_ctx, _cache) => {
3210
3491
  return openBlock(), createElementBlock(Fragment, null, [
3211
- __props.editEnabled ? (openBlock(), createElementBlock("span", _hoisted_1$b, [
3492
+ __props.editEnabled ? (openBlock(), createElementBlock("span", _hoisted_1$9, [
3212
3493
  createVNode(_sfc_main$p, {
3213
3494
  class: "cl-w-full lg:cl-w-auto",
3214
3495
  size: "small",
@@ -3225,13 +3506,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3225
3506
  _: 1
3226
3507
  })
3227
3508
  ])) : createCommentVNode("", true),
3228
- createElementVNode("span", _hoisted_2$a, [
3229
- createVNode(_sfc_main$d, {
3509
+ createElementVNode("span", _hoisted_2$8, [
3510
+ createVNode(_sfc_main$b, {
3230
3511
  columns: unref(currentColumns),
3231
3512
  "onUpdate:columns": _cache[1] || (_cache[1] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null)
3232
3513
  }, null, 8, ["columns"])
3233
3514
  ]),
3234
- createElementVNode("span", _hoisted_3$8, [
3515
+ createElementVNode("span", _hoisted_3$6, [
3235
3516
  createVNode(_sfc_main$p, {
3236
3517
  class: "cl-w-full lg:cl-w-auto",
3237
3518
  size: "small",
@@ -3243,7 +3524,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3243
3524
  _: 1
3244
3525
  })
3245
3526
  ]),
3246
- createElementVNode("span", _hoisted_4$6, [
3527
+ createElementVNode("span", _hoisted_4$4, [
3247
3528
  createVNode(_sfc_main$p, {
3248
3529
  class: "cl-w-full",
3249
3530
  colour: "blue",
@@ -3261,26 +3542,26 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3261
3542
  }
3262
3543
  });
3263
3544
  var clUiGrid_vue_vue_type_style_index_0_scoped_true_lang = "";
3264
- const _hoisted_1$a = { class: "cl-hidden cl-mb-4 cl-w-full lg:cl-block lg:cl-text-right" };
3265
- const _hoisted_2$9 = ["data-loading"];
3266
- const _hoisted_3$7 = { class: "cl-absolute cl-bg-white cl-h-full cl-opacity-40 cl-w-full cl-z-20" };
3267
- const _hoisted_4$5 = { class: "cl-bg-white cl-flex cl-flex-wrap cl-sticky cl-top-0 cl-w-full lg:cl-hidden" };
3268
- const _hoisted_5$4 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-flex-wrap cl-px-2 cl-py-4 cl-w-full" };
3269
- const _hoisted_6$4 = { class: "cl-mb-4 cl-text-sm cl-w-full" };
3270
- const _hoisted_7$4 = { class: "cl-flex cl-flex-wrap cl-w-full" };
3271
- const _hoisted_8$3 = { class: "cl-absolute cl-bg-white cl-h-screen cl-overflow-x-auto cl-p-4 cl-text-sm cl-w-full cl-z-10" };
3545
+ const _hoisted_1$8 = { class: "cl-hidden cl-mb-4 cl-w-full lg:cl-block lg:cl-text-right" };
3546
+ const _hoisted_2$7 = ["data-loading"];
3547
+ const _hoisted_3$5 = { class: "cl-absolute cl-bg-white cl-h-full cl-opacity-40 cl-w-full cl-z-20" };
3548
+ const _hoisted_4$3 = { class: "cl-bg-white cl-flex cl-flex-wrap cl-sticky cl-top-0 cl-w-full lg:cl-hidden" };
3549
+ const _hoisted_5$2 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-flex-wrap cl-px-2 cl-py-4 cl-w-full" };
3550
+ const _hoisted_6$2 = { class: "cl-mb-4 cl-text-sm cl-w-full" };
3551
+ const _hoisted_7$2 = { class: "cl-flex cl-flex-wrap cl-w-full" };
3552
+ const _hoisted_8$1 = { class: "!cl-bg-white cl-absolute cl-h-screen cl-overflow-x-auto cl-p-4 cl-text-sm cl-w-full cl-z-10" };
3272
3553
  const _hoisted_9$1 = { class: "cl-border-b cl-border-grey-2 cl-mb-2 cl-pb-2 cl-text-right cl-w-full" };
3273
3554
  const _hoisted_10$1 = { class: "cl-grid cl-grid-cols-3" };
3274
- const _hoisted_11$1 = {
3555
+ const _hoisted_11 = {
3275
3556
  key: 1,
3276
3557
  class: "cl-ml-2"
3277
3558
  };
3278
- const _hoisted_12$1 = { class: "cl-overflow-auto cl-w-full" };
3279
- const _hoisted_13$1 = { class: "cl-min-w-full cl-table-fixed" };
3280
- const _hoisted_14$1 = { class: "cl-hidden lg:cl-table-column-group" };
3281
- const _hoisted_15$1 = { class: "cl-hidden lg:cl-table-header-group" };
3282
- const _hoisted_16$1 = ["onClick"];
3283
- const _hoisted_17$1 = { key: 1 };
3559
+ const _hoisted_12 = { class: "cl-overflow-auto cl-w-full" };
3560
+ const _hoisted_13 = { class: "cl-min-w-full cl-table-fixed" };
3561
+ const _hoisted_14 = { class: "cl-hidden lg:cl-table-column-group" };
3562
+ const _hoisted_15 = { class: "cl-hidden lg:cl-table-header-group" };
3563
+ const _hoisted_16 = ["onClick"];
3564
+ const _hoisted_17 = { key: 1 };
3284
3565
  const _hoisted_18 = { key: 0 };
3285
3566
  const _hoisted_19 = { key: 1 };
3286
3567
  const _hoisted_20 = ["colspan"];
@@ -3289,7 +3570,7 @@ const _hoisted_22 = {
3289
3570
  key: 0,
3290
3571
  class: "cl-w-full"
3291
3572
  };
3292
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
3573
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3293
3574
  props: {
3294
3575
  columns: null,
3295
3576
  request: null,
@@ -3405,8 +3686,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3405
3686
  var _a, _b;
3406
3687
  const _component_icon = resolveComponent("icon");
3407
3688
  return openBlock(), createElementBlock(Fragment, null, [
3408
- createElementVNode("div", _hoisted_1$a, [
3409
- createVNode(_sfc_main$c, {
3689
+ createElementVNode("div", _hoisted_1$8, [
3690
+ createVNode(_sfc_main$a, {
3410
3691
  columns: unref(currentColumns),
3411
3692
  "onUpdate:columns": _cache[0] || (_cache[0] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null),
3412
3693
  "edit-mode": editMode.value,
@@ -3421,17 +3702,17 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3421
3702
  }, [
3422
3703
  createVNode(Transition, { name: "fade" }, {
3423
3704
  default: withCtx(() => [
3424
- withDirectives(createElementVNode("div", _hoisted_3$7, null, 512), [
3705
+ withDirectives(createElementVNode("div", _hoisted_3$5, null, 512), [
3425
3706
  [vShow, __props.loading]
3426
3707
  ])
3427
3708
  ]),
3428
3709
  _: 1
3429
3710
  }),
3430
- createElementVNode("div", _hoisted_4$5, [
3431
- createElementVNode("div", _hoisted_5$4, [
3432
- createElementVNode("strong", _hoisted_6$4, toDisplayString(unref(t2)("grid.gridTools")), 1),
3433
- createElementVNode("div", _hoisted_7$4, [
3434
- createVNode(_sfc_main$c, {
3711
+ createElementVNode("div", _hoisted_4$3, [
3712
+ createElementVNode("div", _hoisted_5$2, [
3713
+ createElementVNode("strong", _hoisted_6$2, toDisplayString(unref(t2)("grid.gridTools")), 1),
3714
+ createElementVNode("div", _hoisted_7$2, [
3715
+ createVNode(_sfc_main$a, {
3435
3716
  columns: unref(currentColumns),
3436
3717
  "onUpdate:columns": _cache[2] || (_cache[2] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null),
3437
3718
  "edit-mode": editMode.value,
@@ -3445,7 +3726,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3445
3726
  ]),
3446
3727
  createVNode(Transition, { name: "grow-down" }, {
3447
3728
  default: withCtx(() => [
3448
- withDirectives(createElementVNode("div", _hoisted_8$3, [
3729
+ withDirectives(createElementVNode("div", _hoisted_8$1, [
3449
3730
  createElementVNode("div", _hoisted_9$1, [
3450
3731
  createVNode(_component_icon, {
3451
3732
  class: "cl--mt-1 cl-inline-block cl-text-grey-5",
@@ -3467,7 +3748,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3467
3748
  class: "cl-grid cl-grid-cols-3 cl-mb-4 cl-w-full"
3468
3749
  }, [
3469
3750
  createElementVNode("div", null, toDisplayString(column.caption), 1),
3470
- createVNode(_sfc_main$f, {
3751
+ createVNode(_sfc_main$d, {
3471
3752
  request: unref(currentRequest),
3472
3753
  "onUpdate:request": _cache[6] || (_cache[6] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
3473
3754
  column
@@ -3489,7 +3770,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3489
3770
  icon: "ph:caret-up",
3490
3771
  onClick: ($event) => setSort(column.field)
3491
3772
  }, null, 8, ["onClick"]))
3492
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_11$1, " \xA0 "))
3773
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_11, " \xA0 "))
3493
3774
  ]);
3494
3775
  }), 128))
3495
3776
  ], 512), [
@@ -3499,9 +3780,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3499
3780
  _: 1
3500
3781
  })
3501
3782
  ]),
3502
- createElementVNode("div", _hoisted_12$1, [
3503
- createElementVNode("table", _hoisted_13$1, [
3504
- createElementVNode("colgroup", _hoisted_14$1, [
3783
+ createElementVNode("div", _hoisted_12, [
3784
+ createElementVNode("table", _hoisted_13, [
3785
+ createElementVNode("colgroup", _hoisted_14, [
3505
3786
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
3506
3787
  return openBlock(), createElementBlock("col", {
3507
3788
  key: index,
@@ -3510,7 +3791,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3510
3791
  }, null, 4);
3511
3792
  }), 128))
3512
3793
  ]),
3513
- createElementVNode("thead", _hoisted_15$1, [
3794
+ createElementVNode("thead", _hoisted_15, [
3514
3795
  createElementVNode("tr", null, [
3515
3796
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
3516
3797
  var _a2;
@@ -3537,7 +3818,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3537
3818
  }, null, 512), [
3538
3819
  [vShow, unref(currentRequest).sort !== null && unref(currentRequest).sort.sortOnColumn === column.field && unref(currentRequest).sort.sortByAscending === false]
3539
3820
  ])
3540
- ], 8, _hoisted_16$1)) : (openBlock(), createElementBlock("span", _hoisted_17$1, toDisplayString(column.caption), 1))
3821
+ ], 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(column.caption), 1))
3541
3822
  ], 4);
3542
3823
  }), 128))
3543
3824
  ]),
@@ -3548,7 +3829,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3548
3829
  class: "cl-p-1",
3549
3830
  style: normalizeStyle(getStyleForColumn(column.name))
3550
3831
  }, [
3551
- createVNode(_sfc_main$f, {
3832
+ createVNode(_sfc_main$d, {
3552
3833
  request: unref(currentRequest),
3553
3834
  "onUpdate:request": _cache[7] || (_cache[7] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
3554
3835
  column,
@@ -3568,7 +3849,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3568
3849
  })
3569
3850
  }, [
3570
3851
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, columnIndex) => {
3571
- return openBlock(), createBlock(_sfc_main$g, {
3852
+ return openBlock(), createBlock(_sfc_main$e, {
3572
3853
  key: columnIndex,
3573
3854
  class: "cl-align-top cl-p-2 cl-rounded cl-whitespace-nowrap",
3574
3855
  style: normalizeStyle(getStyleForColumn(column.name)),
@@ -3617,559 +3898,96 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3617
3898
  ])
3618
3899
  ])
3619
3900
  ]),
3620
- createVNode(_sfc_main$e, {
3621
- request: unref(currentRequest),
3622
- "onUpdate:request": _cache[8] || (_cache[8] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
3623
- data: __props.data
3624
- }, null, 8, ["request", "data"])
3625
- ], 8, _hoisted_2$9)
3626
- ], 64);
3627
- };
3628
- }
3629
- });
3630
- var clUiGrid = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-435e22be"]]);
3631
- const _sfc_main$a = {};
3632
- const _hoisted_1$9 = { class: "cl-absolute cl-bg-secondary-default cl-flex cl-h-20 cl-items-center cl-justify-between cl-left-0 cl-top-0 cl-w-full cl-z-40" };
3633
- const _hoisted_2$8 = { class: "cl-flex cl-flex-nowrap" };
3634
- function _sfc_render$2(_ctx, _cache) {
3635
- return openBlock(), createElementBlock("header", _hoisted_1$9, [
3636
- renderSlot(_ctx.$slots, "logo"),
3637
- createElementVNode("div", _hoisted_2$8, [
3638
- renderSlot(_ctx.$slots, "menu"),
3639
- renderSlot(_ctx.$slots, "icon")
3640
- ])
3641
- ]);
3642
- }
3643
- var clUiHeader = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$2]]);
3644
- const _hoisted_1$8 = { class: "md:cl-relative" };
3645
- const _hoisted_2$7 = { class: "cl-bg-blue-light cl-flex cl-items-center cl-select-none md:cl-min-w-[320px]" };
3646
- const _hoisted_3$6 = ["src"];
3647
- const _hoisted_4$4 = { class: "cl-cursor-default cl-flex-grow cl-hidden cl-my-4 cl-text-white md:cl-block" };
3648
- const _hoisted_5$3 = {
3649
- key: 0,
3650
- class: "cl-cursor-default cl-overflow-ellipsis cl-whitespace-nowrap"
3651
- };
3652
- const _hoisted_6$3 = {
3653
- key: 1,
3654
- class: "cl-cursor-default cl-overflow-ellipsis cl-text-xs cl-whitespace-nowrap"
3655
- };
3656
- const _hoisted_7$3 = { class: "cl-absolute cl-bg-white cl-right-0 cl-shadow-2xl cl-top-20 cl-w-full cl-z-20" };
3657
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3658
- props: {
3659
- username: { default: "" },
3660
- group: { default: "" },
3661
- image: { default: "" }
3662
- },
3663
- setup(__props) {
3664
- const isOpen = ref(false);
3665
- return (_ctx, _cache) => {
3666
- const _component_icon = resolveComponent("icon");
3667
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
3668
- createElementVNode("div", _hoisted_2$7, [
3669
- __props.image ? (openBlock(), createElementBlock("img", {
3670
- key: 0,
3671
- src: __props.image,
3672
- class: "cl-hidden cl-m-4 cl-max-h-12 cl-max-w-12 cl-ring-2 cl-ring-white cl-rounded-full md:cl-block"
3673
- }, null, 8, _hoisted_3$6)) : (openBlock(), createBlock(_component_icon, {
3674
- key: 1,
3675
- class: "cl-hidden cl-m-4 cl-text-white md:cl-block",
3676
- icon: "ph:user-circle",
3677
- width: "48",
3678
- height: "48"
3679
- })),
3680
- createElementVNode("div", _hoisted_4$4, [
3681
- __props.username ? (openBlock(), createElementBlock("div", _hoisted_5$3, toDisplayString(__props.username), 1)) : createCommentVNode("", true),
3682
- __props.group ? (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString(__props.group), 1)) : createCommentVNode("", true)
3683
- ]),
3684
- createElementVNode("div", {
3685
- class: "cl-bg-transparent cl-content-center cl-cursor-pointer cl-flex cl-h-20 cl-items-center cl-justify-center cl-justify-items-center cl-transition-all cl-w-10 hover:cl-bg-opacity-10 hover:cl-bg-white md:cl-ml-4 md:cl-w-20",
3686
- onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
3687
- }, [
3688
- createVNode(_component_icon, {
3689
- class: normalizeClass(["cl-text-white cl-transform-gpu cl-transition-transform", {
3690
- "cl-rotate-180": isOpen.value
3691
- }]),
3692
- icon: "ph:caret-down"
3693
- }, null, 8, ["class"])
3694
- ])
3695
- ]),
3696
- createVNode(Transition, { name: "fade" }, {
3697
- default: withCtx(() => [
3698
- withDirectives(createElementVNode("div", _hoisted_7$3, [
3699
- renderSlot(_ctx.$slots, "default")
3700
- ], 512), [
3701
- [vShow, isOpen.value]
3702
- ])
3703
- ]),
3704
- _: 3
3705
- })
3706
- ]);
3707
- };
3708
- }
3709
- });
3710
- var clUiSlider_vue_vue_type_style_index_0_scoped_true_lang = "";
3711
- const _hoisted_1$7 = { class: "cl-flex cl-flex-wrap cl-items-center" };
3712
- const _hoisted_2$6 = ["value", "min", "max", "step", "disabled"];
3713
- const _hoisted_3$5 = { class: "cl-flex cl-flex-1 cl-flex-wrap cl-items-center cl-mb-2 cl-mt-3 cl-relative md:cl-mt-0" };
3714
- const _hoisted_4$3 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-0 cl-px-3 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
3715
- const _hoisted_5$2 = { key: 0 };
3716
- const _hoisted_6$2 = ["min", "max", "step", "disabled"];
3717
- const _hoisted_7$2 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-2 cl-px-3 cl-right-0 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
3718
- const _hoisted_8$2 = {
3719
- key: 1,
3720
- class: "emphasis-danger text-sm w-full"
3721
- };
3722
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3723
- props: {
3724
- value: null,
3725
- min: null,
3726
- max: null,
3727
- step: { default: 1 },
3728
- enforceStep: { type: Boolean, default: false },
3729
- disabled: { type: Boolean, default: false },
3730
- showNumericInput: { type: Boolean, default: true }
3731
- },
3732
- emits: {
3733
- "update:value": null
3734
- },
3735
- setup(__props, { emit }) {
3736
- const props = __props;
3737
- const { n, t: t2 } = useI18n();
3738
- const { debounce } = useDebouncer();
3739
- const currentValue = computed({
3740
- get: () => props.value,
3741
- set: (value) => emit("update:value", value)
3742
- });
3743
- const colour = computed(() => props.disabled ? "rgba(153, 153, 153, 0.8)" : "#9acd32");
3744
- const percentage = computed(() => {
3745
- let value = (currentValue.value - props.min) / (props.max - props.min) * 100;
3746
- if (value < 35 && value > 0) {
3747
- if (value < 20) {
3748
- value += 0.5;
3749
- } else {
3750
- value += 0.25;
3751
- }
3752
- } else if (value > 65 && value < 100) {
3753
- if (value > 80) {
3754
- value -= 0.5;
3755
- } else {
3756
- value -= 0.25;
3757
- }
3758
- }
3759
- return value;
3760
- });
3761
- const validProps = computed(() => props.min <= props.max && props.step > 0);
3762
- function updateCurrentValue(target, forceUpdate) {
3763
- var _a;
3764
- const inputValue = (_a = target == null ? void 0 : target.value) != null ? _a : "";
3765
- const value = Math.max(Math.min(parseFloat(inputValue) || props.min, props.max), props.min);
3766
- currentValue.value = props.enforceStep ? Math.ceil(value / props.step) * props.step : value;
3767
- nextTick(() => forceUpdate());
3768
- }
3769
- return (_ctx, _cache) => {
3770
- return unref(validProps) ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), [
3771
- withDirectives(createElementVNode("div", { class: "cl-bg-transparent cl-relative cl-text-center cl-text-sm" }, toDisplayString(unref(currentValue)), 513), [
3772
- [vShow, !__props.showNumericInput]
3773
- ]),
3774
- createElementVNode("div", _hoisted_1$7, [
3775
- withDirectives(createElementVNode("input", {
3776
- class: "!cl-text-sm md:!cl-h-8 md:!cl-w-auto",
3777
- type: "number",
3778
- value: unref(currentValue),
3779
- min: __props.min,
3780
- max: __props.max,
3781
- step: __props.step,
3782
- disabled: __props.disabled,
3783
- onInput: _cache[0] || (_cache[0] = ($event) => unref(debounce)(updateCurrentValue, [$event.target, _ctx.$forceUpdate]))
3784
- }, null, 40, _hoisted_2$6), [
3785
- [vShow, __props.showNumericInput]
3786
- ]),
3787
- createElementVNode("div", _hoisted_3$5, [
3788
- createElementVNode("span", _hoisted_4$3, toDisplayString(unref(n)(__props.min, Number.isInteger(__props.min) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1),
3789
- typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
3790
- withDirectives(createElementVNode("input", {
3791
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
3792
- class: "cl-align-middle cl-appearance-none cl-bg-gradient-to-r cl-border cl-border-grey-2 cl-delay-500 cl-ease-in cl-flex-1 cl-h-5 cl-mb-2 cl-outline-none cl-rounded-full cl-transition-colors",
3793
- style: normalizeStyle({
3794
- background: `linear-gradient(to right, ${unref(colour)} 0%, ${unref(colour)} ${unref(percentage)}%, white ${unref(percentage)}%, white 100%)`
3795
- }),
3796
- type: "range",
3797
- min: __props.min,
3798
- max: __props.max,
3799
- step: __props.step,
3800
- disabled: __props.disabled
3801
- }, null, 12, _hoisted_6$2), [
3802
- [
3803
- vModelText,
3804
- unref(currentValue),
3805
- void 0,
3806
- { number: true }
3807
- ]
3808
- ])
3809
- ])) : createCommentVNode("", true),
3810
- createElementVNode("span", _hoisted_7$2, toDisplayString(unref(n)(__props.max, Number.isInteger(__props.max) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1)
3811
- ])
3812
- ])
3813
- ], 16)) : (openBlock(), createElementBlock("div", _hoisted_8$2, toDisplayString(unref(t2)("slider.invalidProps")), 1));
3814
- };
3815
- }
3816
- });
3817
- var clUiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-3cc89ae4"]]);
3818
- function isInputText(type) {
3819
- let isText = false;
3820
- switch (type) {
3821
- case "email":
3822
- case "password":
3823
- case "search":
3824
- case "tel":
3825
- case "text":
3826
- case "url":
3827
- isText = true;
3828
- break;
3829
- default:
3830
- isText = false;
3831
- break;
3832
- }
3833
- return isText;
3834
- }
3835
- function isInputCalendarSupportedDate(type) {
3836
- let isSupported = false;
3837
- switch (type) {
3838
- case "date":
3839
- case "datetime":
3840
- case "time":
3841
- isSupported = true;
3842
- break;
3843
- default:
3844
- isSupported = false;
3845
- break;
3846
- }
3847
- return isSupported;
3848
- }
3849
- function isInputButton(type) {
3850
- return type === "button" || type === "submit" || type === "reset";
3851
- }
3852
- function getInputTypeAsCalendarType(type) {
3853
- let calendarType;
3854
- switch (type) {
3855
- case "datetime":
3856
- calendarType = calendarTypes[1];
3857
- break;
3858
- case "time":
3859
- calendarType = calendarTypes[2];
3860
- break;
3861
- case "date":
3862
- default:
3863
- calendarType = calendarTypes[0];
3864
- break;
3901
+ createVNode(_sfc_main$c, {
3902
+ request: unref(currentRequest),
3903
+ "onUpdate:request": _cache[8] || (_cache[8] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
3904
+ data: __props.data
3905
+ }, null, 8, ["request", "data"])
3906
+ ], 8, _hoisted_2$7)
3907
+ ], 64);
3908
+ };
3865
3909
  }
3866
- return calendarType;
3910
+ });
3911
+ var clUiGrid = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-4e7c7908"]]);
3912
+ const _sfc_main$8 = {};
3913
+ const _hoisted_1$7 = { class: "cl-absolute cl-bg-secondary-default cl-flex cl-h-20 cl-items-center cl-justify-between cl-left-0 cl-top-0 cl-w-full cl-z-40" };
3914
+ const _hoisted_2$6 = { class: "cl-flex cl-flex-nowrap" };
3915
+ function _sfc_render$2(_ctx, _cache) {
3916
+ return openBlock(), createElementBlock("header", _hoisted_1$7, [
3917
+ renderSlot(_ctx.$slots, "logo"),
3918
+ createElementVNode("div", _hoisted_2$6, [
3919
+ renderSlot(_ctx.$slots, "menu"),
3920
+ renderSlot(_ctx.$slots, "icon")
3921
+ ])
3922
+ ]);
3867
3923
  }
3868
- var clUiInput_vue_vue_type_style_index_0_scoped_true_lang = "";
3869
- const _hoisted_1$6 = { class: "cl-align-top cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
3870
- const _hoisted_2$5 = { class: "cl-flex cl-justify-between" };
3871
- const _hoisted_3$4 = { class: "cl-text-gray-400 cl-text-xs cl-tracking-widest cl-uppercase cl-w:70%" };
3872
- const _hoisted_4$2 = {
3924
+ var clUiHeader = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$2]]);
3925
+ const _hoisted_1$6 = { class: "md:cl-relative" };
3926
+ const _hoisted_2$5 = { class: "cl-bg-blue-light cl-flex cl-items-center cl-select-none md:cl-min-w-[320px]" };
3927
+ const _hoisted_3$4 = ["src"];
3928
+ const _hoisted_4$2 = { class: "cl-cursor-default cl-flex-grow cl-hidden cl-my-4 cl-text-white md:cl-block" };
3929
+ const _hoisted_5$1 = {
3873
3930
  key: 0,
3874
- class: "cl-left-auto cl-relative cl-text-danger-default"
3931
+ class: "cl-cursor-default cl-overflow-ellipsis cl-whitespace-nowrap"
3875
3932
  };
3876
- const _hoisted_5$1 = {
3933
+ const _hoisted_6$1 = {
3877
3934
  key: 1,
3878
- class: "cl-bg-danger-light cl-block cl-max-h-6 cl-ml-2 cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-uppercase"
3879
- };
3880
- const _hoisted_6$1 = ["type", "disabled", "min", "max", "minlength", "maxlength", "step", "placeholder", "accept", "name", "onBlur"];
3881
- const _hoisted_7$1 = {
3882
- key: 4,
3883
- class: "cl-pb-2"
3884
- };
3885
- const _hoisted_8$1 = {
3886
- key: 0,
3887
- class: "cl-bg-danger-light cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-w-auto cl-whitespace-pre-line"
3935
+ class: "cl-cursor-default cl-overflow-ellipsis cl-text-xs cl-whitespace-nowrap"
3888
3936
  };
3937
+ const _hoisted_7$1 = { class: "cl-absolute cl-bg-white cl-right-0 cl-shadow-2xl cl-top-20 cl-w-full cl-z-20" };
3889
3938
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3890
3939
  props: {
3891
- inputType: { default: "text" },
3892
- modelValue: { type: [String, Number, Boolean, Date], default: void 0 },
3893
- label: { default: "" },
3894
- isRequired: { type: Boolean, default: false },
3895
- customValidationFunction: { type: Function, default: void 0 },
3896
- onInputFunction: { type: Function, default: void 0 },
3897
- min: { default: 0 },
3898
- max: { default: 512 },
3899
- step: { default: 1 },
3900
- validateImmediately: { type: Boolean, default: false },
3901
- externalErrors: { default: () => [] },
3902
- disabled: { type: Boolean, default: false },
3903
- requiredText: { default: "" },
3904
- placeholderText: { default: "" },
3905
- fileExtensions: { default: "" },
3906
- group: { default: "" }
3907
- },
3908
- emits: {
3909
- "update:modelValue": null,
3910
- click: null,
3911
- validated: null
3940
+ username: { default: "" },
3941
+ group: { default: "" },
3942
+ image: { default: "" }
3912
3943
  },
3913
- setup(__props, { emit }) {
3914
- const props = __props;
3915
- const inputElement = ref(null);
3916
- const focused = ref(false);
3917
- const lostFocus = ref(false);
3918
- const showRequiredAsterisk = computed(getShowAsteriskOrRequired);
3919
- const dateFlaggedAsOutOfRange = ref(false);
3920
- const { t: t2 } = useI18n();
3921
- const currentValue = computed({
3922
- get: () => props.modelValue,
3923
- set: (value) => onValueChanged(value)
3924
- });
3925
- const currentDateValue = computed({
3926
- get: () => props.modelValue,
3927
- set: (value) => updateDateValue(value)
3928
- });
3929
- const minAsString = computed(() => typeof props.min === "number" ? props.min.toString() : props.min);
3930
- const maxAsString = computed(() => typeof props.max === "number" ? props.max.toString() : props.max);
3931
- const minAsNumber = computed(() => typeof props.min === "number" ? props.min : parseFloat(props.min));
3932
- const maxAsNumber = computed(() => typeof props.max === "number" ? props.max : parseFloat(props.max));
3933
- const internalErrors = ref([]);
3934
- const errors = computed(() => {
3935
- var _a, _b;
3936
- return [
3937
- ...(_a = internalErrors.value) == null ? void 0 : _a.filter((e) => {
3938
- var _a2;
3939
- return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
3940
- }),
3941
- ...(_b = props.externalErrors) == null ? void 0 : _b.filter((e) => {
3942
- var _a2;
3943
- return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
3944
- })
3945
- ].join("\n");
3946
- });
3947
- function updateDateValue(value) {
3948
- updateAndValidateValue(value);
3949
- dateFlaggedAsOutOfRange.value = false;
3950
- }
3951
- function onValueChanged(value) {
3952
- if (props.onInputFunction !== void 0) {
3953
- value = props.onInputFunction(value);
3954
- }
3955
- updateAndValidateValue(value);
3956
- }
3957
- function updateAndValidateValue(value) {
3958
- const defaultSuccess = {
3959
- message: "",
3960
- valid: true
3961
- };
3962
- const customValidationSuccess = props.customValidationFunction === null || props.customValidationFunction === void 0 ? defaultSuccess : props.customValidationFunction(props.label, value);
3963
- const validationPromises = [props.customValidationFunction === null || props.customValidationFunction === void 0 ? new Promise((resolve) => {
3964
- resolve(defaultSuccess);
3965
- }) : new Promise((resolve) => {
3966
- resolve(props.customValidationFunction(props.label, value));
3967
- })];
3968
- if (typeof value === "string" || typeof value === "number" || value instanceof Date) {
3969
- validationPromises.push(validateMinValue(props.min, props.inputType, props.label, value));
3970
- validationPromises.push(validateMaxValue(props.max, props.inputType, props.label, value));
3971
- }
3972
- if (props.isRequired) {
3973
- validationPromises.push(validateRequired(props.label, value));
3974
- }
3975
- if (props.inputType === "email" && typeof value === "string") {
3976
- validationPromises.push(validateEmail(props.label, value));
3977
- }
3978
- Promise.all(validationPromises).then((internalValidationResults) => {
3979
- const messages2 = [...internalValidationResults.map((e) => e.message)];
3980
- let invalid = internalValidationResults.some((e) => e.valid === false) || !customValidationSuccess.valid;
3981
- if (dateFlaggedAsOutOfRange.value) {
3982
- messages2.push(t2("input.dateOutOfRange"));
3983
- invalid = true;
3984
- }
3985
- if (invalid) {
3986
- internalErrors.value = messages2;
3987
- emit("validated", false);
3988
- } else {
3989
- internalErrors.value = [];
3990
- emit("validated", true);
3991
- }
3992
- emit("update:modelValue", value);
3993
- });
3994
- }
3995
- function getStyle() {
3996
- let style = "";
3997
- if (props.inputType === "color" && currentValue.value) {
3998
- if (props.disabled) {
3999
- style = `background: #999999`;
4000
- } else {
4001
- style = `background: ${currentValue.value};`;
4002
- }
4003
- }
4004
- return style;
4005
- }
4006
- function emitClickIfButton(event) {
4007
- if (isInputButton(props.inputType)) {
4008
- event.preventDefault();
4009
- emit("click");
4010
- }
4011
- }
4012
- function incrementNumericValue() {
4013
- if (inputElement.value) {
4014
- inputElement.value.stepUp();
4015
- inputElement.value.focus();
4016
- onValueChanged(inputElement.value.valueAsNumber);
4017
- }
4018
- }
4019
- function decrementNumericValue() {
4020
- if (inputElement.value) {
4021
- inputElement.value.stepDown();
4022
- inputElement.value.focus();
4023
- onValueChanged(inputElement.value.valueAsNumber);
4024
- }
4025
- }
4026
- function toggleFocus(focus) {
4027
- focused.value = focus;
4028
- }
4029
- function onLostFocus() {
4030
- lostFocus.value = true;
4031
- toggleFocus(false);
4032
- }
4033
- function onMouseWheel(wheelEvent) {
4034
- wheelEvent.target.blur();
4035
- }
4036
- function getShowAsteriskOrRequired() {
4037
- var _a;
4038
- let asterisk = true;
4039
- const currentState = showRequiredAsterisk.value;
4040
- if (focused.value) {
4041
- asterisk = currentState;
4042
- } else if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "") {
4043
- asterisk = false;
4044
- }
4045
- return asterisk;
4046
- }
4047
- function onDateOutOfRange() {
4048
- dateFlaggedAsOutOfRange.value = true;
4049
- }
4050
- onMounted(() => {
4051
- if (props.validateImmediately) {
4052
- onValueChanged(props.modelValue);
4053
- }
4054
- });
4055
- watch(() => props.isRequired, () => onValueChanged(props.modelValue));
3944
+ setup(__props) {
3945
+ const isOpen = ref(false);
4056
3946
  return (_ctx, _cache) => {
4057
3947
  const _component_icon = resolveComponent("icon");
4058
3948
  return openBlock(), createElementBlock("div", _hoisted_1$6, [
4059
- createElementVNode("div", {
4060
- class: "cl-relative",
4061
- onMouseenter: _cache[7] || (_cache[7] = ($event) => toggleFocus(true)),
4062
- onMouseleave: _cache[8] || (_cache[8] = ($event) => toggleFocus(false))
4063
- }, [
4064
- createElementVNode("div", _hoisted_2$5, [
4065
- createElementVNode("label", _hoisted_3$4, toDisplayString(__props.label), 1),
4066
- __props.isRequired && unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_4$2, " * ")) : createCommentVNode("", true),
4067
- __props.isRequired && !unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_5$1, toDisplayString(__props.requiredText), 1)) : createCommentVNode("", true)
4068
- ]),
4069
- __props.inputType !== "range" && !unref(isInputCalendarSupportedDate)(__props.inputType) ? withDirectives((openBlock(), createElementBlock("input", {
3949
+ createElementVNode("div", _hoisted_2$5, [
3950
+ __props.image ? (openBlock(), createElementBlock("img", {
4070
3951
  key: 0,
4071
- ref: (_value, _refs) => {
4072
- _refs["inputElement"] = _value;
4073
- inputElement.value = _value;
4074
- },
4075
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
4076
- class: normalizeClass(["cl-block cl-border cl-duration-300 cl-h-fit cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
4077
- "hover:!cl-border-grey-3": __props.disabled === false && !unref(isInputButton)(__props.inputType),
4078
- "!cl-cursor-default": __props.disabled,
4079
- "!cl-border-danger-default": unref(errors).length > 0,
4080
- "cl-border-grey-0 focus:cl-border-blue-light": unref(errors).length === 0 && !unref(isInputButton)(__props.inputType),
4081
- "!cl-p-2": __props.inputType === "checkbox" || __props.inputType === "radio",
4082
- "cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType)
4083
- }]),
4084
- style: normalizeStyle(getStyle()),
4085
- type: __props.inputType,
4086
- disabled: __props.disabled,
4087
- min: __props.min,
4088
- max: __props.max,
4089
- minlength: unref(isInputText)(__props.inputType) ? __props.min : 0,
4090
- maxlength: unref(isInputText)(__props.inputType) ? __props.max : 0,
4091
- step: __props.step,
4092
- placeholder: __props.placeholderText,
4093
- accept: __props.fileExtensions,
4094
- name: __props.group,
4095
- onClick: _cache[1] || (_cache[1] = ($event) => emitClickIfButton($event)),
4096
- onFocus: _cache[2] || (_cache[2] = ($event) => toggleFocus(true)),
4097
- onBlur: withModifiers(onLostFocus, ["self"]),
4098
- onMousewheel: onMouseWheel
4099
- }, null, 46, _hoisted_6$1)), [
4100
- [vModelDynamic, unref(currentValue)]
4101
- ]) : createCommentVNode("", true),
4102
- unref(isInputCalendarSupportedDate)(__props.inputType) ? (openBlock(), createBlock(unref(_sfc_main$o), {
3952
+ src: __props.image,
3953
+ class: "cl-hidden cl-m-4 cl-max-h-12 cl-max-w-12 cl-ring-2 cl-ring-white cl-rounded-full md:cl-block"
3954
+ }, null, 8, _hoisted_3$4)) : (openBlock(), createBlock(_component_icon, {
4103
3955
  key: 1,
4104
- ref: (_value, _refs) => {
4105
- _refs["inputElement"] = _value;
4106
- inputElement.value = _value;
4107
- },
4108
- date: unref(currentDateValue),
4109
- "onUpdate:date": _cache[3] || (_cache[3] = ($event) => isRef(currentDateValue) ? currentDateValue.value = $event : null),
4110
- class: normalizeClass(["cl-block cl-duration-300 cl-h-fit cl-mb-1 cl-rounded-lg cl-text-sm cl-transition cl-w-full focus:cl-outline-none", {
4111
- "hover:cl-border-grey-3": !__props.disabled,
4112
- "!cl-border-danger-default": unref(errors).length > 0
4113
- }]),
4114
- disabled: __props.disabled,
4115
- type: unref(getInputTypeAsCalendarType)(__props.inputType),
4116
- min: unref(minAsString),
4117
- max: unref(maxAsString),
4118
- onBlur: withModifiers(onLostFocus, ["self"]),
4119
- onValueOutOfRange: onDateOutOfRange
4120
- }, null, 8, ["date", "class", "disabled", "type", "min", "max", "onBlur"])) : createCommentVNode("", true),
4121
- __props.inputType === "number" && !__props.disabled ? (openBlock(), createElementBlock("div", {
4122
- key: 2,
4123
- class: normalizeClass(["cl-absolute cl-duration-300 cl-right-1 cl-transition", {
4124
- "cl-opacity-0": !focused.value
4125
- }]),
4126
- style: { "bottom": "1.625rem" }
4127
- }, [
4128
- createVNode(_component_icon, {
4129
- icon: "ph:caret-up-bold",
4130
- class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
4131
- onClick: incrementNumericValue,
4132
- onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {
4133
- }, ["prevent"]))
4134
- })
4135
- ], 2)) : createCommentVNode("", true),
4136
- __props.inputType === "number" && !__props.disabled ? (openBlock(), createElementBlock("div", {
4137
- key: 3,
4138
- class: normalizeClass(["cl-absolute cl-bottom-2 cl-duration-300 cl-right-1 cl-transition", {
4139
- "cl-opacity-0": !focused.value
4140
- }])
3956
+ class: "cl-hidden cl-m-4 cl-text-white md:cl-block",
3957
+ icon: "ph:user-circle",
3958
+ width: "48",
3959
+ height: "48"
3960
+ })),
3961
+ createElementVNode("div", _hoisted_4$2, [
3962
+ __props.username ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString(__props.username), 1)) : createCommentVNode("", true),
3963
+ __props.group ? (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(__props.group), 1)) : createCommentVNode("", true)
3964
+ ]),
3965
+ createElementVNode("div", {
3966
+ class: "cl-bg-transparent cl-content-center cl-cursor-pointer cl-flex cl-h-20 cl-items-center cl-justify-center cl-justify-items-center cl-transition-all cl-w-10 hover:cl-bg-opacity-10 hover:cl-bg-white md:cl-ml-4 md:cl-w-20",
3967
+ onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
4141
3968
  }, [
4142
3969
  createVNode(_component_icon, {
4143
- icon: "ph:caret-down-bold",
4144
- class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
4145
- onClick: decrementNumericValue,
4146
- onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {
4147
- }, ["prevent"]))
4148
- })
4149
- ], 2)) : createCommentVNode("", true),
4150
- __props.inputType === "range" && typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
4151
- createVNode(unref(clUiSlider), {
4152
- ref: (_value, _refs) => {
4153
- _refs["inputElement"] = _value;
4154
- inputElement.value = _value;
4155
- },
4156
- value: unref(currentValue),
4157
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
4158
- min: unref(minAsNumber),
4159
- max: unref(maxAsNumber),
4160
- step: __props.step,
4161
- disabled: __props.disabled,
4162
- "show-numeric-input": false,
4163
- onBlur: withModifiers(onLostFocus, ["self"])
4164
- }, null, 8, ["value", "min", "max", "step", "disabled", "onBlur"])
4165
- ])) : createCommentVNode("", true)
4166
- ], 32),
4167
- unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
3970
+ class: normalizeClass(["cl-text-white cl-transform-gpu cl-transition-transform", {
3971
+ "cl-rotate-180": isOpen.value
3972
+ }]),
3973
+ icon: "ph:caret-down"
3974
+ }, null, 8, ["class"])
3975
+ ])
3976
+ ]),
3977
+ createVNode(Transition, { name: "fade" }, {
3978
+ default: withCtx(() => [
3979
+ withDirectives(createElementVNode("div", _hoisted_7$1, [
3980
+ renderSlot(_ctx.$slots, "default")
3981
+ ], 512), [
3982
+ [vShow, isOpen.value]
3983
+ ])
3984
+ ]),
3985
+ _: 3
3986
+ })
4168
3987
  ]);
4169
3988
  };
4170
3989
  }
4171
3990
  });
4172
- var clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-311ed452"]]);
4173
3991
  const inputTypes = [
4174
3992
  "button",
4175
3993
  "checkbox",
@@ -4281,7 +4099,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4281
4099
  };
4282
4100
  }
4283
4101
  });
4284
- var clUiLogin_vue_vue_type_style_index_0_scoped_true_lang = "";
4285
4102
  const _hoisted_1$4 = { class: "cl-relative" };
4286
4103
  const _hoisted_2$3 = { class: "cl-h-screen cl-z-0" };
4287
4104
  const _hoisted_3$2 = { class: "cl-absolute cl-bg-secondary-default cl-gap-y-1 cl-grid cl-grid-cols-1 cl-left-0 cl-opacity-95 cl-p-6 cl-top-0 cl-w-full cl-z-10 lg:cl-gap-x-1 lg:cl-grid-cols-10 lg:cl-p-10" };
@@ -4292,16 +4109,9 @@ const _hoisted_5 = {
4292
4109
  };
4293
4110
  const _hoisted_6 = { class: "cl-col-span-3" };
4294
4111
  const _hoisted_7 = { class: "cl-inline cl-relative cl-text-grey-4" };
4295
- const _hoisted_8 = ["data-valid", "placeholder"];
4296
- const _hoisted_9 = { class: "cl-text-grey-3 cl-text-sm" };
4297
- const _hoisted_10 = { class: "cl-flex cl-mt-2" };
4298
- const _hoisted_11 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
4299
- const _hoisted_12 = { class: "cl-flex cl-mt-2" };
4300
- const _hoisted_13 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
4301
- const _hoisted_14 = { class: "cl-col-span-3" };
4302
- const _hoisted_15 = { class: "cl-inline cl-relative cl-text-grey-4" };
4303
- const _hoisted_16 = ["type", "data-valid", "placeholder"];
4304
- const _hoisted_17 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
4112
+ const _hoisted_8 = { class: "cl-col-span-3" };
4113
+ const _hoisted_9 = { class: "cl-inline cl-relative cl-text-grey-4" };
4114
+ const _hoisted_10 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
4305
4115
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4306
4116
  props: {
4307
4117
  errors: { default: () => [] },
@@ -4316,7 +4126,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4316
4126
  const username = ref("");
4317
4127
  const password = ref("");
4318
4128
  const passwordFieldType = ref("password");
4319
- const usernameValid = computed(() => /[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)/gi.test(username.value));
4129
+ const usernameValid = ref();
4320
4130
  function login() {
4321
4131
  const authentication = {
4322
4132
  username: username.value,
@@ -4327,18 +4137,31 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4327
4137
  function clearErrors() {
4328
4138
  emit("update:errors", []);
4329
4139
  }
4140
+ function emptyIsInvalidValidation(_, value) {
4141
+ const state = {
4142
+ valid: true,
4143
+ message: ""
4144
+ };
4145
+ if (typeof value === "string" && value.trim() === "") {
4146
+ state.valid = false;
4147
+ }
4148
+ return state;
4149
+ }
4150
+ function onUsernameValidated(valid, _) {
4151
+ usernameValid.value = valid;
4152
+ }
4330
4153
  return (_ctx, _cache) => {
4331
4154
  const _component_icon = resolveComponent("icon");
4332
4155
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
4333
4156
  createElementVNode("div", _hoisted_2$3, [
4334
- renderSlot(_ctx.$slots, "background", {}, void 0, true)
4157
+ renderSlot(_ctx.$slots, "background")
4335
4158
  ]),
4336
4159
  createElementVNode("form", _hoisted_3$2, [
4337
4160
  createElementVNode("div", _hoisted_4, [
4338
- renderSlot(_ctx.$slots, "logo", {}, void 0, true)
4161
+ renderSlot(_ctx.$slots, "logo")
4339
4162
  ]),
4340
4163
  _ctx.$slots["language-switcher"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
4341
- renderSlot(_ctx.$slots, "language-switcher", {}, void 0, true)
4164
+ renderSlot(_ctx.$slots, "language-switcher")
4342
4165
  ])) : createCommentVNode("", true),
4343
4166
  createElementVNode("div", {
4344
4167
  class: normalizeClass(["cl-gap-y-4 cl-grid cl-grid-cols-1 lg:cl-gap-x-2 lg:cl-grid-cols-8", {
@@ -4349,66 +4172,39 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4349
4172
  createElementVNode("div", _hoisted_6, [
4350
4173
  createElementVNode("div", _hoisted_7, [
4351
4174
  createVNode(_component_icon, {
4352
- class: "cl-absolute cl-left-3 cl-top-2",
4175
+ class: "cl-absolute cl-left-3 cl-top-2.5",
4353
4176
  icon: "ph:user",
4354
4177
  size: 18
4355
4178
  }),
4356
- withDirectives(createElementVNode("input", {
4179
+ createVNode(ClUiInput, {
4180
+ modelValue: username.value,
4357
4181
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => username.value = $event),
4358
- class: "!cl-pb-1 !cl-pl-9",
4359
- type: "email",
4360
- "data-valid": unref(usernameValid),
4361
- placeholder: unref(t2)("login.email"),
4182
+ modelModifiers: { trim: true },
4183
+ class: "!cl-border-2 !cl-mb-1 cl-w-full",
4184
+ "input-type": "email",
4185
+ "highlight-when-valid": true,
4186
+ label: "Username",
4187
+ "show-label": false,
4188
+ "placeholder-text": unref(t2)("login.email"),
4362
4189
  autocomplete: "username",
4363
- onInput: clearErrors
4364
- }, null, 40, _hoisted_8), [
4365
- [
4366
- vModelText,
4367
- username.value,
4368
- void 0,
4369
- { trim: true }
4370
- ]
4371
- ])
4372
- ]),
4373
- createVNode(Transition, { name: "fade" }, {
4374
- default: withCtx(() => [
4375
- withDirectives(createElementVNode("div", _hoisted_9, [
4376
- withDirectives(createElementVNode("div", _hoisted_10, [
4377
- createVNode(_component_icon, {
4378
- class: "cl-mt-1 cl-text-primary-default",
4379
- icon: "ph:check",
4380
- size: 16
4381
- }),
4382
- createElementVNode("em", _hoisted_11, toDisplayString(unref(t2)("login.validEmail")), 1)
4383
- ], 512), [
4384
- [vShow, unref(usernameValid)]
4385
- ]),
4386
- withDirectives(createElementVNode("div", _hoisted_12, [
4387
- createVNode(_component_icon, {
4388
- class: "cl-mt-1 cl-text-danger-default",
4389
- icon: "ph:x",
4390
- size: 16
4391
- }),
4392
- createElementVNode("em", _hoisted_13, toDisplayString(unref(t2)("login.invalidEmail")), 1)
4393
- ], 512), [
4394
- [vShow, !unref(usernameValid)]
4395
- ])
4396
- ], 512), [
4397
- [vShow, username.value !== ""]
4398
- ])
4399
- ]),
4400
- _: 1
4401
- })
4190
+ "validate-immediately": true,
4191
+ "custom-validation-function": emptyIsInvalidValidation,
4192
+ "input-specific-classes": "!cl-pl-9",
4193
+ "message-when-valid": unref(t2)("login.validEmail"),
4194
+ onInput: clearErrors,
4195
+ onValidated: onUsernameValidated
4196
+ }, null, 8, ["modelValue", "placeholder-text", "message-when-valid"])
4197
+ ])
4402
4198
  ]),
4403
- createElementVNode("div", _hoisted_14, [
4404
- createElementVNode("div", _hoisted_15, [
4199
+ createElementVNode("div", _hoisted_8, [
4200
+ createElementVNode("div", _hoisted_9, [
4405
4201
  createVNode(_component_icon, {
4406
- class: "cl-absolute cl-left-3 cl-top-2",
4202
+ class: "cl-absolute cl-left-3 cl-top-2.5",
4407
4203
  icon: "ph:lock",
4408
4204
  size: 18
4409
4205
  }),
4410
4206
  withDirectives(createVNode(_component_icon, {
4411
- class: "cl-absolute cl-cursor-pointer cl-right-3 cl-top-2",
4207
+ class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
4412
4208
  icon: "ph:eye",
4413
4209
  size: 18,
4414
4210
  onClick: _cache[1] || (_cache[1] = ($event) => passwordFieldType.value = "text")
@@ -4416,24 +4212,26 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4416
4212
  [vShow, passwordFieldType.value === "password"]
4417
4213
  ]),
4418
4214
  withDirectives(createVNode(_component_icon, {
4419
- class: "cl-absolute cl-cursor-pointer cl-right-3 cl-top-2",
4215
+ class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
4420
4216
  icon: "ph:eye-slash",
4421
4217
  size: 18,
4422
4218
  onClick: _cache[2] || (_cache[2] = ($event) => passwordFieldType.value = "password")
4423
4219
  }, null, 512), [
4424
4220
  [vShow, passwordFieldType.value === "text"]
4425
4221
  ]),
4426
- withDirectives(createElementVNode("input", {
4222
+ createVNode(ClUiInput, {
4223
+ modelValue: password.value,
4427
4224
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => password.value = $event),
4428
- class: "!cl-pb-1 !cl-pl-9 !cl-pr-9",
4429
- type: passwordFieldType.value,
4430
- "data-valid": password.value !== "",
4431
- placeholder: unref(t2)("login.password"),
4225
+ class: "!cl-border-2 cl-w-full",
4226
+ "input-type": passwordFieldType.value,
4227
+ "highlight-when-valid": true,
4228
+ "placeholder-text": unref(t2)("login.password"),
4432
4229
  autocomplete: "current-password",
4230
+ "validate-immediately": true,
4231
+ "input-specific-classes": "!cl-pl-9 !cl-pr-9",
4232
+ "custom-validation-function": emptyIsInvalidValidation,
4433
4233
  onInput: clearErrors
4434
- }, null, 40, _hoisted_16), [
4435
- [vModelDynamic, password.value]
4436
- ])
4234
+ }, null, 8, ["modelValue", "input-type", "placeholder-text"])
4437
4235
  ])
4438
4236
  ]),
4439
4237
  createElementVNode("div", {
@@ -4442,10 +4240,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4442
4240
  }])
4443
4241
  }, [
4444
4242
  createVNode(_sfc_main$p, {
4445
- class: "cl-w-full",
4243
+ class: "!cl-leading-9 cl-w-full",
4446
4244
  colour: "blue",
4447
4245
  loading: __props.loading,
4448
- disabled: !unref(usernameValid) || password.value === "",
4246
+ disabled: !usernameValid.value || password.value === "",
4449
4247
  onClick: withModifiers(login, ["prevent"])
4450
4248
  }, {
4451
4249
  default: withCtx(() => [
@@ -4459,7 +4257,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4459
4257
  default: withCtx(() => {
4460
4258
  var _a;
4461
4259
  return [
4462
- withDirectives(createElementVNode("span", _hoisted_17, [
4260
+ withDirectives(createElementVNode("span", _hoisted_10, [
4463
4261
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.errors, (error, index) => {
4464
4262
  return openBlock(), createElementBlock("div", {
4465
4263
  key: index,
@@ -4478,7 +4276,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4478
4276
  };
4479
4277
  }
4480
4278
  });
4481
- var clUiLogin = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2e5cd708"]]);
4482
4279
  const modalSizes = [
4483
4280
  "x-small",
4484
4281
  "small",
@@ -4646,11 +4443,9 @@ var components = /* @__PURE__ */ Object.freeze({
4646
4443
  clUiButton: _sfc_main$p,
4647
4444
  buttonColours,
4648
4445
  buttonSizes,
4649
- clUiCalendar: _sfc_main$o,
4650
- calendarTypes,
4651
- clUiCard: _sfc_main$n,
4446
+ clUiCard: _sfc_main$o,
4652
4447
  cardSizes,
4653
- clUiComboBox: _sfc_main$i,
4448
+ clUiComboBox: _sfc_main$g,
4654
4449
  isComboBoxItem,
4655
4450
  isComboBoxCreateRequest,
4656
4451
  clUiFooter,
@@ -4666,15 +4461,15 @@ var components = /* @__PURE__ */ Object.freeze({
4666
4461
  isFilterRequest,
4667
4462
  isFilterResponse,
4668
4463
  clUiHeader,
4669
- clUiHeaderMenu: _sfc_main$9,
4670
- clUiInput,
4464
+ clUiHeaderMenu: _sfc_main$7,
4465
+ clUiInput: ClUiInput,
4671
4466
  inputTypes,
4672
4467
  clUiLanguageSwitcher: _sfc_main$6,
4673
4468
  isLanguageLocaleFormat,
4674
4469
  isLanguageArray,
4675
4470
  clUiLoadingSpinner: ClUiLoadingSpinner,
4676
- clUiLogin,
4677
- clUiModal: _sfc_main$m,
4471
+ clUiLogin: _sfc_main$5,
4472
+ clUiModal: _sfc_main$k,
4678
4473
  modalSizes,
4679
4474
  modalColours,
4680
4475
  clUiNavigation,
@@ -4682,10 +4477,238 @@ var components = /* @__PURE__ */ Object.freeze({
4682
4477
  clUiNavigationGroup: _sfc_main$2,
4683
4478
  clUiNavigationSection,
4684
4479
  clUiNavigationItem,
4685
- clUiNotification: _sfc_main$s,
4686
- clUiSlider
4480
+ clUiNotification: _sfc_main$s
4687
4481
  });
4688
- var main = "";
4482
+ function levenshtein(firstString, secondString) {
4483
+ if (firstString.length === 0) {
4484
+ return secondString.length;
4485
+ }
4486
+ if (secondString.length === 0) {
4487
+ return firstString.length;
4488
+ }
4489
+ if (firstString.length > secondString.length) {
4490
+ const tmp = firstString;
4491
+ firstString = secondString;
4492
+ secondString = tmp;
4493
+ }
4494
+ const row = new Int8Array(firstString.length + 1);
4495
+ for (let i = 0; i <= firstString.length; i++) {
4496
+ row[i] = i;
4497
+ }
4498
+ let temp;
4499
+ for (let i = 1; i <= secondString.length; i++) {
4500
+ let prev = i;
4501
+ const previousChar = secondString[i - 1];
4502
+ for (let j = 1; j <= firstString.length; j++) {
4503
+ if (previousChar === firstString[j - 1]) {
4504
+ temp = row[j - 1];
4505
+ } else {
4506
+ const a = prev + 1;
4507
+ const b = row[j] + 1;
4508
+ const c = a - (a - b & b - a >> 7);
4509
+ const d = row[j - 1] + 1;
4510
+ temp = c - (c - d & d - c >> 7);
4511
+ }
4512
+ row[j - 1] = prev;
4513
+ prev = temp;
4514
+ }
4515
+ row[firstString.length] = prev;
4516
+ }
4517
+ return row[firstString.length];
4518
+ }
4519
+ function camelCaseToArray(camelCase) {
4520
+ return camelCase.split(/(?=[A-Z])/g);
4521
+ }
4522
+ function kebabCaseToArray(kebabCase) {
4523
+ return kebabCase.split(/(?=-)/g).map((s) => s.replace(/-/g, ""));
4524
+ }
4525
+ function pascalCaseToArray(pascalCase) {
4526
+ return camelCaseToArray(pascalCase);
4527
+ }
4528
+ function sentenceCaseToArray(sentenceCase) {
4529
+ return sentenceCase.split(/ /g).map((s) => s.replace(/[^A-Za-z0-9]/g, ""));
4530
+ }
4531
+ function snakeCaseToArray(snakeCase) {
4532
+ return snakeCase.split(/(?=_)/g).map((s) => s.replace(/_/g, ""));
4533
+ }
4534
+ function titleCaseToArray(titleCase) {
4535
+ return sentenceCaseToArray(titleCase);
4536
+ }
4537
+ function arrayToCamelCase(array, locale) {
4538
+ let result = "";
4539
+ array.forEach((s, i) => {
4540
+ result += i === 0 ? s.toLocaleLowerCase(locale) : s.toLocaleLowerCase(locale).firstCharToUpperCase(locale);
4541
+ });
4542
+ return result;
4543
+ }
4544
+ function arrayToKebabCase(array, lowerCase, locale) {
4545
+ let result = "";
4546
+ array.forEach((s) => {
4547
+ result += `${lowerCase ? s.toLocaleLowerCase(locale) : s.toLocaleUpperCase(locale)}-`;
4548
+ });
4549
+ return result.trimEndChar("-");
4550
+ }
4551
+ function arrayToSentenceCase(array, locale) {
4552
+ let result = "";
4553
+ array.forEach((s, i) => {
4554
+ result += `${i === 0 ? s.toLowerCase().firstCharToUpperCase(locale) : s.toLocaleLowerCase(locale)} `;
4555
+ });
4556
+ return result.trimEndChar(" ");
4557
+ }
4558
+ function arrayToTitleCase(array, locale) {
4559
+ let result = "";
4560
+ array.forEach((s) => {
4561
+ result += `${s.toLocaleLowerCase(locale).firstCharToUpperCase(locale)} `;
4562
+ });
4563
+ return result.trimEndChar(" ");
4564
+ }
4565
+ String.prototype.similarity = function(comparisonString) {
4566
+ let similarityToReturn = 0;
4567
+ let longerString = this.toLowerCase();
4568
+ let shorterString = comparisonString.toLowerCase();
4569
+ if (longerString < shorterString) {
4570
+ const temp = shorterString;
4571
+ shorterString = longerString;
4572
+ longerString = temp;
4573
+ }
4574
+ const longerLength = longerString.length;
4575
+ if (longerLength === 0) {
4576
+ similarityToReturn = 100;
4577
+ } else {
4578
+ similarityToReturn = Math.round((longerLength - levenshtein(longerString, shorterString)) / longerLength * 100);
4579
+ }
4580
+ return similarityToReturn;
4581
+ };
4582
+ String.prototype.trimChar = function(character) {
4583
+ return this.trimStartChar(character).trimEndChar(character);
4584
+ };
4585
+ String.prototype.trimStartChar = function(character) {
4586
+ return character !== "" && this.startsWith(character) ? this.slice(1) : this;
4587
+ };
4588
+ String.prototype.trimEndChar = function(character) {
4589
+ return character !== "" && this.endsWith(character) ? this.slice(0, -1) : this;
4590
+ };
4591
+ String.prototype.trimToLength = function(length, addEllipsis = false) {
4592
+ const trimLength = this.length < length ? this.length : length;
4593
+ return addEllipsis && trimLength >= 4 && trimLength < this.length ? `${this.slice(0, Math.max(trimLength - 3, 1))}...` : this.slice(0, Math.max(trimLength, 1));
4594
+ };
4595
+ String.prototype.firstCharToUpperCase = function(locale) {
4596
+ return `${this.charAt(0).toLocaleUpperCase(locale)}${this.slice(1)}`;
4597
+ };
4598
+ String.prototype.firstCharToLowerCase = function(locale) {
4599
+ return `${this.charAt(0).toLocaleLowerCase(locale)}${this.slice(1)}`;
4600
+ };
4601
+ String.prototype.removeWhitespace = function() {
4602
+ return this.replace(/\s/g, "");
4603
+ };
4604
+ String.prototype.removeNonAlphanumeric = function() {
4605
+ return this.replace(/[^a-zA-Z0-9]/g, "");
4606
+ };
4607
+ String.prototype.removeNonAlphabetic = function() {
4608
+ return this.replace(/[^a-zA-Z]/g, "");
4609
+ };
4610
+ String.prototype.removeNonNumeric = function() {
4611
+ return this.replace(/[^0-9]/g, "");
4612
+ };
4613
+ String.prototype.replacePlaceholders = function(...args) {
4614
+ let i = 0;
4615
+ return this.replace(/{\d+}/g, () => typeof args[i] !== "undefined" ? args[i++] : "");
4616
+ };
4617
+ String.prototype.camelCaseToKebabCase = function(lowerCase = true, locale) {
4618
+ return arrayToKebabCase(camelCaseToArray(this), lowerCase, locale);
4619
+ };
4620
+ String.prototype.camelCaseToPascalCase = function(locale) {
4621
+ return this.firstCharToUpperCase(locale);
4622
+ };
4623
+ String.prototype.camelCaseToSentenceCase = function(locale) {
4624
+ return arrayToSentenceCase(camelCaseToArray(this), locale);
4625
+ };
4626
+ String.prototype.camelCaseToSnakeCase = function(lowerCase = true, locale) {
4627
+ return this.camelCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
4628
+ };
4629
+ String.prototype.camelCaseToTitleCase = function(locale) {
4630
+ return arrayToTitleCase(camelCaseToArray(this), locale);
4631
+ };
4632
+ String.prototype.kebabCaseToCamelCase = function(locale) {
4633
+ return arrayToCamelCase(kebabCaseToArray(this), locale);
4634
+ };
4635
+ String.prototype.kebabCaseToPascalCase = function(locale) {
4636
+ return this.kebabCaseToCamelCase().camelCaseToPascalCase(locale);
4637
+ };
4638
+ String.prototype.kebabCaseToSentenceCase = function(locale) {
4639
+ return arrayToSentenceCase(kebabCaseToArray(this), locale);
4640
+ };
4641
+ String.prototype.kebabCaseToSnakeCase = function(lowerCase = true, locale) {
4642
+ const result = this.replace(/-/g, "_");
4643
+ return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
4644
+ };
4645
+ String.prototype.kebabCaseToTitleCase = function(locale) {
4646
+ return arrayToTitleCase(kebabCaseToArray(this), locale);
4647
+ };
4648
+ String.prototype.pascalCaseToCamelCase = function(locale) {
4649
+ return arrayToCamelCase(pascalCaseToArray(this), locale);
4650
+ };
4651
+ String.prototype.pascalCaseToKebabCase = function(lowerCase = true, locale) {
4652
+ return arrayToKebabCase(pascalCaseToArray(this), lowerCase, locale);
4653
+ };
4654
+ String.prototype.pascalCaseToSentenceCase = function(locale) {
4655
+ return arrayToSentenceCase(pascalCaseToArray(this), locale);
4656
+ };
4657
+ String.prototype.pascalCaseToSnakeCase = function(lowerCase = true, locale) {
4658
+ return this.pascalCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
4659
+ };
4660
+ String.prototype.pascalCaseToTitleCase = function(locale) {
4661
+ return arrayToTitleCase(pascalCaseToArray(this), locale);
4662
+ };
4663
+ String.prototype.sentenceCaseToCamelCase = function(locale) {
4664
+ return arrayToCamelCase(sentenceCaseToArray(this), locale);
4665
+ };
4666
+ String.prototype.sentenceCaseToKebabCase = function(lowerCase = true, locale) {
4667
+ return arrayToKebabCase(sentenceCaseToArray(this), lowerCase, locale);
4668
+ };
4669
+ String.prototype.sentenceCaseToPascalCase = function(locale) {
4670
+ return this.sentenceCaseToCamelCase().camelCaseToPascalCase(locale);
4671
+ };
4672
+ String.prototype.sentenceCaseToSnakeCase = function(lowerCase = true, locale) {
4673
+ return this.sentenceCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
4674
+ };
4675
+ String.prototype.sentenceCaseToTitleCase = function(locale) {
4676
+ return arrayToTitleCase(sentenceCaseToArray(this), locale);
4677
+ };
4678
+ String.prototype.snakeCaseToCamelCase = function(locale) {
4679
+ return arrayToCamelCase(snakeCaseToArray(this), locale);
4680
+ };
4681
+ String.prototype.snakeCaseToKebabCase = function(lowerCase = true, locale) {
4682
+ const result = this.replace(/_/g, "-");
4683
+ return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
4684
+ };
4685
+ String.prototype.snakeCaseToPascalCase = function(locale) {
4686
+ return this.snakeCaseToCamelCase().camelCaseToPascalCase(locale);
4687
+ };
4688
+ String.prototype.snakeCaseToSentenceCase = function(locale) {
4689
+ return arrayToSentenceCase(snakeCaseToArray(this), locale);
4690
+ };
4691
+ String.prototype.snakeCaseToTitleCase = function(locale) {
4692
+ return arrayToTitleCase(snakeCaseToArray(this), locale);
4693
+ };
4694
+ String.prototype.titleCaseToCamelCase = function(locale) {
4695
+ return arrayToCamelCase(titleCaseToArray(this), locale);
4696
+ };
4697
+ String.prototype.titleCaseToKebabCase = function(lowerCase = true, locale) {
4698
+ return arrayToKebabCase(titleCaseToArray(this), lowerCase, locale);
4699
+ };
4700
+ String.prototype.titleCaseToPascalCase = function(locale) {
4701
+ return this.titleCaseToCamelCase().camelCaseToPascalCase(locale);
4702
+ };
4703
+ String.prototype.titleCaseToSentenceCase = function(locale) {
4704
+ return arrayToSentenceCase(titleCaseToArray(this), locale);
4705
+ };
4706
+ String.prototype.titleCaseToSnakeCase = function(lowerCase = true, locale) {
4707
+ return this.titleCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
4708
+ };
4709
+ String.prototype.toDateFromTime = function() {
4710
+ return new Date(`${new Date().toISOString().substr(0, 11)}${this}`);
4711
+ };
4689
4712
  Date.prototype.toLocaleMonthString = function(locale) {
4690
4713
  return i18n.global.d(this, DateFormat.MONTH_YEAR, locale != null ? locale : i18n.global.locale.value);
4691
4714
  };
@@ -4695,6 +4718,7 @@ Date.prototype.toLocaleTimeStringWithoutMilliseconds = function(locale) {
4695
4718
  Date.prototype.toLocaleStringWithoutMilliseconds = function(locale) {
4696
4719
  return i18n.global.d(this, DateFormat.DATETIME, locale != null ? locale : i18n.global.locale.value);
4697
4720
  };
4721
+ var main = "";
4698
4722
  const install = (app) => {
4699
4723
  app.use(i18n);
4700
4724
  app.component("Icon", Icon);
@@ -4705,4 +4729,4 @@ const install = (app) => {
4705
4729
  app.component(name, component);
4706
4730
  });
4707
4731
  };
4708
- export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes, calendarTypes, cardSizes, _sfc_main$v as clUiAccordion, clUiAccordionHeader, _sfc_main$u as clUiAccordionItem, _sfc_main$r as clUiApp, _sfc_main$p as clUiButton, _sfc_main$o as clUiCalendar, _sfc_main$n as clUiCard, _sfc_main$i as clUiComboBox, clUiFooter, clUiGrid, clUiHeader, _sfc_main$9 as clUiHeaderMenu, clUiInput, _sfc_main$6 as clUiLanguageSwitcher, ClUiLoadingSpinner as clUiLoadingSpinner, clUiLogin, _sfc_main$m as clUiModal, clUiNavigation, _sfc_main$2 as clUiNavigationGroup, _sfc_main$3 as clUiNavigationIcon, clUiNavigationItem, clUiNavigationSection, _sfc_main$s as clUiNotification, clUiSlider, compareByProperty, copy, datetimeFormats, install as default, filterMethodTypes, generateStringId, getParamsByName, gridColumnTypes, i18n, inputTypes, isComboBoxCreateRequest, isComboBoxItem, isFilterRequest, isFilterResponse, isGridColumn, isGridColumnArray, isLanguageArray, isLanguageLocaleFormat, messages, modalColours, modalSizes, nameOf, numberFormats, setCurrentLocale, setLocaleDateTimeFormats, setLocaleMessages, setLocaleNumberFormats, showNotification, stringExtensionsEnabled, stringFormats, useDebouncer, validateEmail, validateMaxValue, validateMinValue };
4732
+ export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes, cardSizes, _sfc_main$v as clUiAccordion, clUiAccordionHeader, _sfc_main$u as clUiAccordionItem, _sfc_main$r as clUiApp, _sfc_main$p as clUiButton, _sfc_main$o as clUiCard, _sfc_main$g as clUiComboBox, clUiFooter, clUiGrid, clUiHeader, _sfc_main$7 as clUiHeaderMenu, ClUiInput as clUiInput, _sfc_main$6 as clUiLanguageSwitcher, ClUiLoadingSpinner as clUiLoadingSpinner, _sfc_main$5 as clUiLogin, _sfc_main$k as clUiModal, clUiNavigation, _sfc_main$2 as clUiNavigationGroup, _sfc_main$3 as clUiNavigationIcon, clUiNavigationItem, clUiNavigationSection, _sfc_main$s as clUiNotification, compareByProperty, copy, datetimeFormats, install as default, filterMethodTypes, generateStringId, getParamsByName, gridColumnTypes, i18n, inputTypes, isComboBoxCreateRequest, isComboBoxItem, isFilterRequest, isFilterResponse, isGridColumn, isGridColumnArray, isLanguageArray, isLanguageLocaleFormat, messages, modalColours, modalSizes, nameOf, numberFormats, setCurrentLocale, setLocaleDateTimeFormats, setLocaleMessages, setLocaleNumberFormats, showNotification, stringFormats, useDebouncer, validateEmail, validateMaxValue, validateMinValue };