@citruslime/ui 4.1.0-beta.2 → 4.1.0-beta.21

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.
@@ -1,11 +1,11 @@
1
1
  import { Icon } from "@iconify/vue";
2
2
  import { defineComponent, ref, createElementBlock, openBlock, renderSlot, normalizeProps, guardReactiveProps, Fragment, createElementVNode, normalizeClass, createVNode, unref, Transition, withCtx, withDirectives, mergeProps, vShow, createBlock, Teleport, renderList, toDisplayString, createCommentVNode, computed, createTextVNode, mergeModels, useModel, watch, createSlots, vModelDynamic, shallowRef, toValue, toRefs, withKeys, onMounted, onUnmounted, withModifiers, nextTick, useAttrs, resolveComponent, inject, vModelCheckbox, watchEffect, vModelText, useCssVars, toHandlers, normalizeStyle, isRef, useSlots, provide } from "vue";
3
- import { generateStringId, highlightText, isTouchDevice, validateEmail as validateEmail$1, escapeStringForRegExp } from "@citruslime/utils";
3
+ import { generateStringId, highlightText, validateEmail as validateEmail$1, isTouchDevice, escapeStringForRegExp } from "@citruslime/utils";
4
4
  import { useFocusWithin, onKeyDown, toArray, unrefElement, tryOnScopeDispose, onClickOutside, useBreakpoints, breakpointsTailwind, useTimeoutFn, useMouseInElement, useMediaQuery, useThrottle, useDebounceFn, useMouse, useDraggable, defaultDocument, tryOnMounted, useThrottleFn, useWindowSize, useElementSize, useElementBounding } from "@vueuse/core";
5
5
  import { useI18n, createI18n } from "vue-i18n";
6
6
  import { createFocusTrap } from "focus-trap";
7
7
  import { copy } from "@citruslime/vue-utils";
8
- import { DateTime } from "luxon";
8
+ import { DateTime, Info } from "luxon";
9
9
  import { DatePicker } from "v-calendar";
10
10
  import { useCurrencyInput } from "vue-currency-input";
11
11
  const _hoisted_1$13 = { class: "cl:overflow-hidden" };
@@ -50,7 +50,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
50
50
  });
51
51
  const _hoisted_1$12 = { class: "cl:absolute cl:left-5 cl:top-5" };
52
52
  const _hoisted_2$M = { class: "cl:font-semibold cl:ml-10 cl:p-4 cl:select-none cl:text-grey-5" };
53
- const _hoisted_3$t = { class: "cl:overflow-hidden" };
53
+ const _hoisted_3$u = { class: "cl:overflow-hidden" };
54
54
  const _sfc_main$1g = /* @__PURE__ */ defineComponent({
55
55
  ...{
56
56
  inheritAttrs: false
@@ -91,7 +91,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
91
91
  renderSlot(_ctx.$slots, "title")
92
92
  ])
93
93
  ], 2),
94
- createElementVNode("div", _hoisted_3$t, [
94
+ createElementVNode("div", _hoisted_3$u, [
95
95
  createVNode(Transition, { name: "grow-down" }, {
96
96
  default: withCtx(() => [
97
97
  withDirectives(createElementVNode("div", mergeProps(_ctx.$attrs, { class: "cl:ml-10 cl:p-4" }), [
@@ -359,7 +359,7 @@ const cardSizes = [
359
359
  ];
360
360
  const _hoisted_1$X = { class: "cl:sm:w-auto cl:w-full" };
361
361
  const _hoisted_2$J = { class: "cl:flex cl:flex-nowrap cl:gap-2 cl:text-grey-4 cl:text-xs cl:tracking-widest" };
362
- const _hoisted_3$s = {
362
+ const _hoisted_3$t = {
363
363
  key: 0,
364
364
  class: "cl:self-center"
365
365
  };
@@ -393,7 +393,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
393
393
  class: normalizeClass(["cl:flex", { "cl:flex-col": _ctx.labelPosition === "above", "cl:flex-row-reverse cl:gap-2 cl:items-center cl:justify-end": _ctx.labelPosition === "right" }])
394
394
  }, [
395
395
  createElementVNode("div", _hoisted_2$J, [
396
- _ctx.$slots.label ? (openBlock(), createElementBlock("span", _hoisted_3$s, [
396
+ _ctx.$slots.label ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
397
397
  renderSlot(_ctx.$slots, "label")
398
398
  ])) : createCommentVNode("", true),
399
399
  _ctx.showRequiredAsterisk ? (openBlock(), createElementBlock("span", _hoisted_4$n, "*")) : createCommentVNode("", true)
@@ -414,7 +414,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
414
414
  ])) : _ctx.errors || _ctx.$slots.helpText ? (openBlock(), createElementBlock("div", _hoisted_7$9, [
415
415
  createElementVNode("span", _hoisted_8$8, [
416
416
  renderSlot(_ctx.$slots, "helpText", {}, () => [
417
- _cache[0] || (_cache[0] = createTextVNode(" "))
417
+ _cache[0] || (_cache[0] = createTextVNode(" ", -1))
418
418
  ])
419
419
  ])
420
420
  ])) : createCommentVNode("", true)
@@ -448,9 +448,8 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
448
448
  const inputRef = ref();
449
449
  const { focused } = useFocusWithin(inputRef);
450
450
  watch(focused, () => {
451
- var _a;
452
451
  if (focused.value && props.selectOnFocus) {
453
- (_a = inputRef.value) == null ? void 0 : _a.select();
452
+ inputRef.value?.select();
454
453
  }
455
454
  });
456
455
  onKeyDown(true, (e) => emit("keySinglePress", e.key), {
@@ -458,18 +457,9 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
458
457
  dedupe: true
459
458
  });
460
459
  __expose({
461
- focus: () => {
462
- var _a;
463
- return (_a = inputRef.value) == null ? void 0 : _a.focus();
464
- },
465
- blur: () => {
466
- var _a;
467
- return (_a = inputRef.value) == null ? void 0 : _a.blur();
468
- },
469
- select: () => {
470
- var _a;
471
- return (_a = inputRef.value) == null ? void 0 : _a.select();
472
- }
460
+ focus: () => inputRef.value?.focus(),
461
+ blur: () => inputRef.value?.blur(),
462
+ select: () => inputRef.value?.select()
473
463
  });
474
464
  return (_ctx, _cache) => {
475
465
  return openBlock(), createBlock(_sfc_main$19, {
@@ -486,8 +476,8 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
486
476
  maxlength: _ctx.maxlength ?? void 0,
487
477
  disabled: _ctx.disabled,
488
478
  placeholder: _ctx.placeholder ?? void 0,
489
- onFocus: _cache[1] || (_cache[1] = ($event) => emit("focus")),
490
- onBlur: _cache[2] || (_cache[2] = ($event) => emit("blur"))
479
+ onFocus: _cache[1] || (_cache[1] = ($event) => emit("focus", $event)),
480
+ onBlur: _cache[2] || (_cache[2] = ($event) => emit("blur", $event))
491
481
  }), null, 16, _hoisted_1$W), [
492
482
  [vModelDynamic, value.value]
493
483
  ])
@@ -545,21 +535,29 @@ function useFocusTrap(target, options = {}) {
545
535
  (els) => {
546
536
  if (!els.length)
547
537
  return;
548
- trap = createFocusTrap(els, {
549
- ...focusTrapOptions,
550
- onActivate() {
551
- hasFocus.value = true;
552
- if (options.onActivate)
553
- options.onActivate();
554
- },
555
- onDeactivate() {
556
- hasFocus.value = false;
557
- if (options.onDeactivate)
558
- options.onDeactivate();
538
+ if (!trap) {
539
+ trap = createFocusTrap(els, {
540
+ ...focusTrapOptions,
541
+ onActivate() {
542
+ hasFocus.value = true;
543
+ if (options.onActivate)
544
+ options.onActivate();
545
+ },
546
+ onDeactivate() {
547
+ hasFocus.value = false;
548
+ if (options.onDeactivate)
549
+ options.onDeactivate();
550
+ }
551
+ });
552
+ if (immediate)
553
+ activate();
554
+ } else {
555
+ const isActive = trap == null ? void 0 : trap.active;
556
+ trap == null ? void 0 : trap.updateContainerElements(els);
557
+ if (!isActive && immediate) {
558
+ activate();
559
559
  }
560
- });
561
- if (immediate)
562
- activate();
560
+ }
563
561
  },
564
562
  { flush: "post" }
565
563
  );
@@ -747,21 +745,14 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
747
745
  setup(__props, { emit: __emit }) {
748
746
  const props = __props;
749
747
  const emit = __emit;
750
- const displayedText = computed(() => {
751
- var _a;
752
- return ((_a = props.option) == null ? void 0 : _a.name) ?? props.text;
753
- });
754
- const displayedParent = computed(() => {
755
- var _a;
756
- return ((_a = props.option) == null ? void 0 : _a.parentName) ?? "";
757
- });
748
+ const displayedText = computed(() => props.option?.name ?? props.text);
749
+ const displayedParent = computed(() => props.option?.parentName ?? "");
758
750
  const isHighlighted = ref(false);
759
751
  function optionSelected() {
760
- var _a;
761
752
  if (props.isCreateNewOption === true) {
762
753
  emit("create-object");
763
754
  } else {
764
- emit("select-object", (_a = props.option) == null ? void 0 : _a.id);
755
+ emit("select-object", props.option?.id);
765
756
  }
766
757
  }
767
758
  function onHover(hovered) {
@@ -783,7 +774,6 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
783
774
  }
784
775
  watch(() => props.selectedIndex, () => updateHighlight());
785
776
  return (_ctx, _cache) => {
786
- var _a, _b;
787
777
  return openBlock(), createElementBlock("div", {
788
778
  class: normalizeClass(["cl:cursor-pointer cl:duration-75 cl:flex cl:p-1 cl:text-left cl:transition-colors", {
789
779
  "cl:bg-white": isHighlighted.value === false,
@@ -794,7 +784,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
794
784
  onMousemove: _cache[0] || (_cache[0] = ($event) => onHover(true)),
795
785
  onMouseleave: _cache[1] || (_cache[1] = ($event) => onHover(false))
796
786
  }, [
797
- _ctx.option !== null && ((_a = _ctx.option) == null ? void 0 : _a.parentId) !== 0 && ((_b = _ctx.option) == null ? void 0 : _b.parentId) !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$T, toDisplayString(displayedParent.value), 1)) : createCommentVNode("", true),
787
+ _ctx.option !== null && _ctx.option?.parentId !== 0 && _ctx.option?.parentId !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$T, toDisplayString(displayedParent.value), 1)) : createCommentVNode("", true),
798
788
  createElementVNode("div", {
799
789
  class: normalizeClass({
800
790
  "cl:w-1/2": displayedParent.value !== "",
@@ -818,7 +808,7 @@ const _hoisted_2$F = {
818
808
  key: 0,
819
809
  class: "cl:absolute cl:bg-off-white cl:flex cl:h-full cl:items-center cl:justify-center cl:top-0 cl:w-full cl:z-20"
820
810
  };
821
- const _hoisted_3$r = { class: "cl:bg-white cl:flex cl:p-2 cl:pb-1 cl:sticky cl:top-0 cl:w-full cl:z-10" };
811
+ const _hoisted_3$s = { class: "cl:bg-white cl:flex cl:p-2 cl:pb-1 cl:sticky cl:top-0 cl:w-full cl:z-10" };
822
812
  const _hoisted_4$m = { class: "cl:inline-block cl:w-full" };
823
813
  const _hoisted_5$f = { key: 6 };
824
814
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
@@ -903,10 +893,9 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
903
893
  }
904
894
  }
905
895
  function scroll() {
906
- var _a;
907
896
  if (props.results && props.results.length > 1) {
908
897
  const heightOffset = 34;
909
- (_a = container.value) == null ? void 0 : _a.scrollTo(0, (currentSelection.value + 1) * heightOffset - heightOffset * 2);
898
+ container.value?.scrollTo(0, (currentSelection.value + 1) * heightOffset - heightOffset * 2);
910
899
  }
911
900
  }
912
901
  function updateAddNewOption() {
@@ -923,25 +912,15 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
923
912
  if (props.isVisible === true) {
924
913
  searchText.value = "";
925
914
  search();
926
- nextTick(() => {
927
- var _a, _b;
928
- return (_b = (_a = container.value) == null ? void 0 : _a.querySelector("input")) == null ? void 0 : _b.focus();
929
- });
915
+ nextTick(() => container.value?.querySelector("input")?.focus());
930
916
  }
931
917
  }
932
918
  watch(() => props.results, () => updateAddNewOption());
933
919
  watch(() => props.errorMessage, () => updateAddNewOption());
934
920
  watch(() => props.isVisible, () => onVisibilityChanged());
935
- onMounted(() => {
936
- var _a;
937
- return (_a = container.value) == null ? void 0 : _a.addEventListener("keydown", onKeyboardShiftTab);
938
- });
939
- onUnmounted(() => {
940
- var _a;
941
- return (_a = container.value) == null ? void 0 : _a.removeEventListener("keydown", onKeyboardShiftTab);
942
- });
921
+ onMounted(() => container.value?.addEventListener("keydown", onKeyboardShiftTab));
922
+ onUnmounted(() => container.value?.removeEventListener("keydown", onKeyboardShiftTab));
943
923
  return (_ctx, _cache) => {
944
- var _a;
945
924
  return _ctx.isVisible ? (openBlock(), createElementBlock("div", {
946
925
  key: 0,
947
926
  ref_key: "container",
@@ -958,7 +937,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
958
937
  _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_2$F, [
959
938
  createVNode(clUiLoadingSpinner)
960
939
  ])) : createCommentVNode("", true),
961
- createElementVNode("div", _hoisted_3$r, [
940
+ createElementVNode("div", _hoisted_3$s, [
962
941
  createElementVNode("div", _hoisted_4$m, [
963
942
  createVNode(_sfc_main$18, {
964
943
  id: `cl-ui-combo-box-search-input-${_ctx.objectType}`,
@@ -970,9 +949,9 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
970
949
  onKeyup: search,
971
950
  onBlur: hideDropdown
972
951
  }, {
973
- default: withCtx(() => _cache[4] || (_cache[4] = [
952
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
974
953
  createElementVNode("span", null, null, -1)
975
- ])),
954
+ ])]),
976
955
  _: 1
977
956
  }, 8, ["id", "modelValue", "placeholder"])
978
957
  ])
@@ -989,7 +968,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
989
968
  "additional-text": _ctx.objectParentType,
990
969
  class: "cl:bg-grey-2 cl:mt-1"
991
970
  }, null, 8, ["text", "additional-text"])) : createCommentVNode("", true),
992
- _ctx.results !== null && ((_a = _ctx.results) == null ? void 0 : _a.length) === 0 && searchText.value.trim() !== "" && _ctx.canCreateNewObject === false && _ctx.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$16, {
971
+ _ctx.results !== null && _ctx.results?.length === 0 && searchText.value.trim() !== "" && _ctx.canCreateNewObject === false && _ctx.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$16, {
993
972
  key: 3,
994
973
  text: unref(t2)("comboBox.noResults", { value: searchText.value })
995
974
  }, null, 8, ["text"])) : createCommentVNode("", true),
@@ -1027,7 +1006,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
1027
1006
  });
1028
1007
  const _hoisted_1$R = { class: "cl:flex cl:rounded-lg" };
1029
1008
  const _hoisted_2$E = { class: "cl:inline-block cl:w-full" };
1030
- const _hoisted_3$q = { class: "cl:pointer-events-none cl:relative cl:top-0.5" };
1009
+ const _hoisted_3$r = { class: "cl:pointer-events-none cl:relative cl:top-0.5" };
1031
1010
  const _hoisted_4$l = { class: "cl:absolute cl:flex cl:float-right cl:font-semibold cl:mt-[5px] cl:right-2 cl:text-danger-default cl:text-sm cl:z-10" };
1032
1011
  const _hoisted_5$e = ["disabled"];
1033
1012
  const _hoisted_6$a = ["disabled"];
@@ -1079,8 +1058,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1079
1058
  const objectToCreateValid = ref(true);
1080
1059
  const comboBoxBottomOfView = ref(false);
1081
1060
  function toggleDropdown(forcedState) {
1082
- var _a;
1083
- const comboPosition = ((_a = outsideRef.value) == null ? void 0 : _a.getBoundingClientRect().top) || 0;
1061
+ const comboPosition = outsideRef.value?.getBoundingClientRect().top || 0;
1084
1062
  comboBoxBottomOfView.value = window.innerHeight - comboPosition < 280;
1085
1063
  if (!props.disabled) {
1086
1064
  if (typeof forcedState !== "undefined") {
@@ -1103,12 +1081,11 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1103
1081
  toggleDropdown(false);
1104
1082
  }
1105
1083
  function selectObject(id2) {
1106
- var _a;
1107
1084
  const item = getComboBoxItemById(id2 ?? 0);
1108
1085
  selectedItem.value = item;
1109
1086
  toggleDropdown(false);
1110
1087
  if (!props.openDropDownOnFocus) {
1111
- (_a = inputRef.value) == null ? void 0 : _a.focus();
1088
+ inputRef.value?.focus();
1112
1089
  }
1113
1090
  }
1114
1091
  function getComboBoxItemById(id2) {
@@ -1124,10 +1101,9 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1124
1101
  return currentItem;
1125
1102
  }
1126
1103
  function createObject() {
1127
- var _a;
1128
1104
  createObjectRequest.value = {
1129
1105
  name: objectToCreateValue.value,
1130
- parentId: ((_a = parentItem.value) == null ? void 0 : _a.id) ?? 0
1106
+ parentId: parentItem.value?.id ?? 0
1131
1107
  };
1132
1108
  emit("create-object", createObjectRequest.value);
1133
1109
  }
@@ -1139,8 +1115,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1139
1115
  emit("create-parent-object", createObjectRequest.value);
1140
1116
  }
1141
1117
  function handleObjectCreateResponse() {
1142
- var _a, _b;
1143
- if ((_a = props.objectCreatedResponse) == null ? void 0 : _a.error) {
1118
+ if (props.objectCreatedResponse?.error) {
1144
1119
  showNotification({
1145
1120
  message: t2("comboBox.createFailed", {
1146
1121
  name: objectToCreateValue.value,
@@ -1149,13 +1124,12 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1149
1124
  colour: "danger",
1150
1125
  duration: 1e4
1151
1126
  });
1152
- } else if ((_b = props.objectCreatedResponse) == null ? void 0 : _b.id) {
1127
+ } else if (props.objectCreatedResponse?.id) {
1153
1128
  handleSuccessfulObjectCreation();
1154
1129
  }
1155
1130
  }
1156
1131
  function handleParentObjectCreateResponse() {
1157
- var _a;
1158
- if ((_a = props.parentObjectCreatedResponse) == null ? void 0 : _a.id) {
1132
+ if (props.parentObjectCreatedResponse?.id) {
1159
1133
  parentItem.value = {
1160
1134
  id: props.parentObjectCreatedResponse.id,
1161
1135
  name: props.parentObjectCreatedResponse.name ?? ""
@@ -1163,23 +1137,22 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1163
1137
  }
1164
1138
  }
1165
1139
  function handleSuccessfulObjectCreation() {
1166
- var _a, _b, _c, _d, _e;
1167
1140
  showNotification({
1168
1141
  message: t2("comboBox.createSuccessful", {
1169
1142
  object: props.objectType,
1170
- name: ((_a = props.objectCreatedResponse) == null ? void 0 : _a.name) ?? ""
1143
+ name: props.objectCreatedResponse?.name ?? ""
1171
1144
  }),
1172
1145
  colour: "primary",
1173
1146
  duration: 1e4
1174
1147
  });
1175
1148
  let parentName = "";
1176
- if (parentItem.value && parentItem.value.id === ((_b = props.objectCreatedResponse) == null ? void 0 : _b.parentId)) {
1149
+ if (parentItem.value && parentItem.value.id === props.objectCreatedResponse?.parentId) {
1177
1150
  parentName = parentItem.value.name;
1178
1151
  }
1179
1152
  selectedItem.value = {
1180
- id: ((_c = props.objectCreatedResponse) == null ? void 0 : _c.id) ?? 0,
1181
- name: ((_d = props.objectCreatedResponse) == null ? void 0 : _d.name) ?? "",
1182
- parentId: ((_e = props.objectCreatedResponse) == null ? void 0 : _e.parentId) ?? 0,
1153
+ id: props.objectCreatedResponse?.id ?? 0,
1154
+ name: props.objectCreatedResponse?.name ?? "",
1155
+ parentId: props.objectCreatedResponse?.parentId ?? 0,
1183
1156
  parentName
1184
1157
  };
1185
1158
  }
@@ -1216,10 +1189,9 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1216
1189
  });
1217
1190
  const inputRef = ref();
1218
1191
  function handleEscapeKeyPress() {
1219
- var _a;
1220
1192
  toggleDropdown(false);
1221
1193
  if (!props.openDropDownOnFocus) {
1222
- (_a = inputRef.value) == null ? void 0 : _a.focus();
1194
+ inputRef.value?.focus();
1223
1195
  }
1224
1196
  }
1225
1197
  function focusInternal() {
@@ -1229,10 +1201,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1229
1201
  emit("focus");
1230
1202
  }
1231
1203
  __expose({
1232
- focus: () => {
1233
- var _a;
1234
- return (_a = inputRef.value) == null ? void 0 : _a.focus();
1235
- }
1204
+ focus: () => inputRef.value?.focus()
1236
1205
  });
1237
1206
  return (_ctx, _cache) => {
1238
1207
  const _component_cl_ui_combo_box = resolveComponent("cl-ui-combo-box", true);
@@ -1258,13 +1227,13 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
1258
1227
  onFocus: focusInternal,
1259
1228
  onKeydown: _cache[2] || (_cache[2] = withKeys(($event) => toggleDropdown(true), ["enter"]))
1260
1229
  }, {
1261
- default: withCtx(() => _cache[8] || (_cache[8] = [
1230
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
1262
1231
  createElementVNode("span", null, null, -1)
1263
- ])),
1232
+ ])]),
1264
1233
  _: 1
1265
1234
  }, 8, ["id", "modelValue", "class", "placeholder", "disabled"])
1266
1235
  ]),
1267
- withDirectives(createElementVNode("div", _hoisted_3$q, [
1236
+ withDirectives(createElementVNode("div", _hoisted_3$r, [
1268
1237
  createElementVNode("div", _hoisted_4$l, [
1269
1238
  createTextVNode(toDisplayString(unref(t2)("comboBox.required")) + " ", 1),
1270
1239
  createVNode(unref(Icon), {
@@ -1408,7 +1377,7 @@ const _hoisted_2$D = {
1408
1377
  key: 0,
1409
1378
  class: "cl:w-full"
1410
1379
  };
1411
- const _hoisted_3$p = {
1380
+ const _hoisted_3$q = {
1412
1381
  key: 1,
1413
1382
  class: "cl:leading-10 cl:text-sm cl:w-full"
1414
1383
  };
@@ -1419,7 +1388,7 @@ function _sfc_render$5(_ctx, _cache) {
1419
1388
  _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
1420
1389
  renderSlot(_ctx.$slots, "default")
1421
1390
  ])) : createCommentVNode("", true),
1422
- _ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$p, [
1391
+ _ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$q, [
1423
1392
  createElementVNode("span", _hoisted_4$k, [
1424
1393
  renderSlot(_ctx.$slots, "left")
1425
1394
  ]),
@@ -1455,17 +1424,14 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
1455
1424
  setup(__props) {
1456
1425
  return (_ctx, _cache) => {
1457
1426
  return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row) => {
1458
- return openBlock(), createElementBlock("div", mergeProps({
1459
- key: row,
1460
- ref_for: true
1461
- }, _ctx.$attrs, { class: "cl:flex cl:gap-1 cl:items-start" }), [
1427
+ return openBlock(), createElementBlock("div", mergeProps({ key: row }, { ref_for: true }, _ctx.$attrs, { class: "cl:flex cl:gap-1 cl:items-start" }), [
1462
1428
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.words, (word) => {
1463
1429
  return openBlock(), createElementBlock("span", {
1464
1430
  key: word,
1465
1431
  class: "cl:rounded-full cl:w-16 skeleton-loader-background"
1466
1432
  }, [
1467
1433
  renderSlot(_ctx.$slots, "default", {}, () => [
1468
- _cache[0] || (_cache[0] = createTextVNode("   "))
1434
+ _cache[0] || (_cache[0] = createTextVNode("   ", -1))
1469
1435
  ])
1470
1436
  ]);
1471
1437
  }), 128))
@@ -1499,7 +1465,7 @@ const _hoisted_1$N = {
1499
1465
  class: "cl:flex cl:gap-2 cl:justify-between cl:mb-2 cl:w-full"
1500
1466
  };
1501
1467
  const _hoisted_2$C = { key: 1 };
1502
- const _hoisted_3$o = { class: "cl:flex cl:flex-wrap cl:gap-1 cl:lg:flex-nowrap cl:lg:gap-2 cl:md:justify-end cl:pb-2" };
1468
+ const _hoisted_3$p = { class: "cl:flex cl:flex-wrap cl:gap-1 cl:lg:flex-nowrap cl:lg:gap-2 cl:md:justify-end cl:pb-2" };
1503
1469
  const _hoisted_4$j = { class: "cl:basis-full cl:col-span-2 cl:grow cl:lg:basis-0" };
1504
1470
  const _hoisted_5$c = {
1505
1471
  key: 2,
@@ -1540,7 +1506,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
1540
1506
  }, [
1541
1507
  createElementVNode("strong", null, toDisplayString(unref(t2)("grid.gridTools")), 1)
1542
1508
  ], 2),
1543
- createElementVNode("div", _hoisted_3$o, [
1509
+ createElementVNode("div", _hoisted_3$p, [
1544
1510
  createElementVNode("div", _hoisted_4$j, [
1545
1511
  renderSlot(_ctx.$slots, "additional-grid-actions", normalizeProps(guardReactiveProps({
1546
1512
  loading: _ctx.loading,
@@ -1606,6 +1572,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
1606
1572
  unref(anyFilterableColumns)(_ctx.columns) ? (openBlock(), createBlock(_sfc_main$1b, {
1607
1573
  key: 0,
1608
1574
  id: `${unref(gridId)}-clear-filters`,
1575
+ "clear-filters-button": "",
1609
1576
  size: "small",
1610
1577
  colour: "danger",
1611
1578
  disabled: !hasFilters.value || _ctx.loading,
@@ -1647,14 +1614,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1647
1614
  const emit = __emit;
1648
1615
  const inputRef = ref();
1649
1616
  __expose({
1650
- focus: () => {
1651
- var _a;
1652
- return (_a = inputRef.value) == null ? void 0 : _a.focus();
1653
- },
1654
- blur: () => {
1655
- var _a;
1656
- return (_a = inputRef.value) == null ? void 0 : _a.blur();
1657
- }
1617
+ focus: () => inputRef.value?.focus(),
1618
+ blur: () => inputRef.value?.blur()
1658
1619
  });
1659
1620
  return (_ctx, _cache) => {
1660
1621
  return openBlock(), createBlock(_sfc_main$19, {
@@ -1778,6 +1739,7 @@ const messages = {
1778
1739
  onOrBefore: "On or before",
1779
1740
  onOrAfter: "On or after",
1780
1741
  selectAll: "Select all",
1742
+ clearAll: "Clear all",
1781
1743
  allEntriesSelected: "All entries selected",
1782
1744
  page: "Page",
1783
1745
  pageSize: "Page Size",
@@ -1845,7 +1807,8 @@ const messages = {
1845
1807
  endDate: "End Date"
1846
1808
  },
1847
1809
  select: {
1848
- displayTextOverflow: "{count} options selected"
1810
+ displayTextOverflow: "{count} options selected",
1811
+ notFound: "Not found"
1849
1812
  }
1850
1813
  }
1851
1814
  };
@@ -2071,11 +2034,10 @@ function getPartsForValue(intlFormat, value, ...types) {
2071
2034
  return intlFormat.formatToParts(value).filter((part) => types.includes(part.type)).map((part) => part.value);
2072
2035
  }
2073
2036
  function callNumberFormatterImpl(value, options) {
2074
- var _a;
2075
2037
  if (isNaN(value)) {
2076
2038
  return "";
2077
2039
  } else {
2078
- return ((_a = newNumberFormatImpl(options)) == null ? void 0 : _a.format(value)) ?? null;
2040
+ return newNumberFormatImpl(options)?.format(value) ?? null;
2079
2041
  }
2080
2042
  }
2081
2043
  function newNumberFormatImpl(options) {
@@ -2087,9 +2049,9 @@ function newNumberFormatImpl(options) {
2087
2049
  }
2088
2050
  }
2089
2051
  function buildFormatOptions(format, options) {
2090
- const normalisedLocale = toValue(options == null ? void 0 : options.locale) || unref(locale);
2052
+ const normalisedLocale = toValue(options?.locale) || unref(locale);
2091
2053
  const i18nFormat = getNumberFormat(normalisedLocale);
2092
- const additionalOptions = copy(toValue(options == null ? void 0 : options.additionalOptions) ?? {});
2054
+ const additionalOptions = copy(toValue(options?.additionalOptions) ?? {});
2093
2055
  let style = "decimal";
2094
2056
  switch (format) {
2095
2057
  case NumberFormat.PERCENTAGE:
@@ -2143,7 +2105,7 @@ function CitrusLimeUI() {
2143
2105
  }
2144
2106
  const { t } = i18n.global;
2145
2107
  function validateMinValue(minimumValue, typeOfValue, valueName, actualValue, timeZone) {
2146
- return new Promise((resolve) => {
2108
+ return new Promise(((resolve) => {
2147
2109
  let validatedState = {
2148
2110
  valid: false,
2149
2111
  message: ""
@@ -2159,7 +2121,7 @@ function validateMinValue(minimumValue, typeOfValue, valueName, actualValue, tim
2159
2121
  case "tel":
2160
2122
  case "text":
2161
2123
  case "url":
2162
- isValid = ((actualValue == null ? void 0 : actualValue.length) ?? 0) >= (Number(minimumValue) || 0);
2124
+ isValid = (actualValue?.length ?? 0) >= (Number(minimumValue) || 0);
2163
2125
  validatedState = getValidatedInputState(isValid, t("input.greaterOrEqualToCharacters", {
2164
2126
  label: valueName,
2165
2127
  min: minimumValue.toString()
@@ -2218,10 +2180,10 @@ function validateMinValue(minimumValue, typeOfValue, valueName, actualValue, tim
2218
2180
  }
2219
2181
  }
2220
2182
  resolve(validatedState);
2221
- });
2183
+ }));
2222
2184
  }
2223
2185
  function validateMaxValue(maximumValue, typeOfValue, valueName, actualValue, timeZone) {
2224
- return new Promise((resolve) => {
2186
+ return new Promise(((resolve) => {
2225
2187
  let validatedState = {
2226
2188
  valid: false,
2227
2189
  message: ""
@@ -2237,7 +2199,7 @@ function validateMaxValue(maximumValue, typeOfValue, valueName, actualValue, tim
2237
2199
  case "tel":
2238
2200
  case "text":
2239
2201
  case "url":
2240
- isValid = ((actualValue == null ? void 0 : actualValue.length) ?? 0) <= (Number(maximumValue) || 0);
2202
+ isValid = (actualValue?.length ?? 0) <= (Number(maximumValue) || 0);
2241
2203
  validatedState = getValidatedInputState(isValid, t("input.lessOrEqualToCharacters", {
2242
2204
  label: valueName,
2243
2205
  max: maximumValue.toString()
@@ -2293,22 +2255,22 @@ function validateMaxValue(maximumValue, typeOfValue, valueName, actualValue, tim
2293
2255
  }
2294
2256
  }
2295
2257
  resolve(validatedState);
2296
- });
2258
+ }));
2297
2259
  }
2298
2260
  function validateRequired(valueName, value) {
2299
- return new Promise((resolve) => {
2261
+ return new Promise(((resolve) => {
2300
2262
  const isValid = value !== void 0 && value !== null && value !== "" && value.toString().trim() !== "";
2301
2263
  const validatedState = getValidatedInputState(isValid, t("input.valueIsRequired", { label: valueName }));
2302
2264
  resolve(validatedState);
2303
- });
2265
+ }));
2304
2266
  }
2305
2267
  function validateEmail(valueName, value) {
2306
- return new Promise((resolve) => {
2268
+ return new Promise(((resolve) => {
2307
2269
  const regex = /[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/;
2308
2270
  const isValid = value === "" || regex.exec(value) !== null;
2309
2271
  const validatedState = getValidatedInputState(isValid, t("input.valueNotValidEmail", { label: valueName }));
2310
2272
  resolve(validatedState);
2311
- });
2273
+ }));
2312
2274
  }
2313
2275
  function getValidatedInputState(validationCheck, message) {
2314
2276
  const validation = {
@@ -2325,7 +2287,7 @@ const _hoisted_2$A = {
2325
2287
  key: 4,
2326
2288
  class: "cl:inline-block cl:whitespace-nowrap"
2327
2289
  };
2328
- const _hoisted_3$n = {
2290
+ const _hoisted_3$o = {
2329
2291
  key: 5,
2330
2292
  class: "cl:inline-block cl:whitespace-nowrap"
2331
2293
  };
@@ -2351,11 +2313,11 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2351
2313
  let date;
2352
2314
  if (props.timeZone) {
2353
2315
  date = DateTime.fromISO(value, {
2354
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value
2316
+ locale: dateFormatLocaleOverride?.value ?? locale2.value
2355
2317
  }).setZone(props.timeZone);
2356
2318
  } else {
2357
2319
  date = DateTime.fromISO(value, {
2358
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value,
2320
+ locale: dateFormatLocaleOverride?.value ?? locale2.value,
2359
2321
  zone: "UTC"
2360
2322
  });
2361
2323
  }
@@ -2385,17 +2347,18 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2385
2347
  }
2386
2348
  function formatString() {
2387
2349
  let value = props.data[props.column.field];
2388
- if (!value || typeof value !== "string") {
2350
+ if (!value) {
2389
2351
  return "";
2390
- }
2391
- if (props.column.maxLength) {
2392
- value = value.trimToLength(props.column.maxLength, props.column.format !== void 0 ? props.column.format === "ellipsis" : false);
2393
- }
2394
- if (props.searchValue && props.column.searchable) {
2395
- value = highlightText(value, props.searchValue.split(" "));
2396
- }
2397
- if (props.column.format === "wrap-text") {
2398
- value = `<span class="cl:break-words cl:whitespace-pre-wrap">${value}</span>`;
2352
+ } else if (typeof value === "string") {
2353
+ if (props.column.maxLength) {
2354
+ value = value.trimToLength(props.column.maxLength, props.column.format !== void 0 ? props.column.format === "ellipsis" : false);
2355
+ }
2356
+ if (props.searchValue && props.column.searchable) {
2357
+ value = highlightText(value, props.searchValue.split(" "));
2358
+ }
2359
+ if (props.column.format === "wrap-text") {
2360
+ value = `<span class="cl:break-words cl:whitespace-pre-wrap">${value}</span>`;
2361
+ }
2399
2362
  }
2400
2363
  return value;
2401
2364
  }
@@ -2419,7 +2382,6 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2419
2382
  }
2420
2383
  }
2421
2384
  return (_ctx, _cache) => {
2422
- var _a;
2423
2385
  return _ctx.column.type === "slot" ? renderSlot(_ctx.$slots, _ctx.column.name, {
2424
2386
  key: 0,
2425
2387
  formattedStringContent: formatString()
@@ -2436,7 +2398,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2436
2398
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2437
2399
  createTextVNode(toDisplayString(formatDate(_ctx.data[_ctx.column.field], unref(DateFormat).DATETIME)), 1)
2438
2400
  ], 64))
2439
- ], 64)) : _ctx.column.type === "list" && _ctx.column.field !== void 0 && _ctx.column.listEntries !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_1$L, toDisplayString(unref(t2)(((_a = _ctx.column.listEntries.find((entry) => entry.value === _ctx.data[_ctx.column.field])) == null ? void 0 : _a.translationKey) ?? "")), 1)) : _ctx.column.type === "number" && _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_2$A, toDisplayString(formatNumberToString(_ctx.data[_ctx.column.field], unref(locale2))), 1)) : _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_3$n, [
2401
+ ], 64)) : _ctx.column.type === "list" && _ctx.column.field !== void 0 && _ctx.column.listEntries !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_1$L, toDisplayString(unref(t2)(_ctx.column.listEntries.find((entry) => entry.value === _ctx.data[_ctx.column.field])?.translationKey ?? "")), 1)) : _ctx.column.type === "number" && _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_2$A, toDisplayString(formatNumberToString(_ctx.data[_ctx.column.field], unref(locale2))), 1)) : _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_3$o, [
2440
2402
  createElementVNode("span", {
2441
2403
  title: showUntruncatedStringValue.value ? _ctx.data[_ctx.column.field] : void 0,
2442
2404
  innerHTML: formatString()
@@ -2463,13 +2425,10 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
2463
2425
  const { t: t2 } = useI18n();
2464
2426
  const currentRecord = ref(copy(props.data));
2465
2427
  const edited = computed(() => props.column.field !== void 0 && currentRecord.value[props.column.field] !== props.data[props.column.field]);
2466
- const listEntries = computed(() => {
2467
- var _a;
2468
- return ((_a = props.column.listEntries) == null ? void 0 : _a.map((entry, id) => ({
2469
- id,
2470
- name: t2(entry.translationKey)
2471
- }))) ?? [];
2472
- });
2428
+ const listEntries = computed(() => props.column.listEntries?.map((entry, id) => ({
2429
+ id,
2430
+ name: t2(entry.translationKey)
2431
+ })) ?? []);
2473
2432
  watchEffect(() => currentRecord.value = copy(props.data));
2474
2433
  watch(currentRecord, (newValue) => {
2475
2434
  const property = props.column.field ?? "";
@@ -2612,7 +2571,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
2612
2571
  });
2613
2572
  const _hoisted_1$K = ["colspan"];
2614
2573
  const _hoisted_2$z = ["colspan"];
2615
- const _hoisted_3$m = { key: 2 };
2574
+ const _hoisted_3$n = { key: 2 };
2616
2575
  const _hoisted_4$h = ["colspan"];
2617
2576
  const _hoisted_5$b = { class: "cl:flex cl:flex-wrap cl:justify-center cl:text-center cl:text-sm cl:w-full" };
2618
2577
  const _hoisted_6$9 = { key: 0 };
@@ -2679,22 +2638,19 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2679
2638
  }
2680
2639
  }
2681
2640
  const clickCounters = ref({});
2682
- watch(() => props.data, () => {
2683
- var _a, _b;
2684
- return clickCounters.value = Object.fromEntries(((_b = (_a = props.data) == null ? void 0 : _a.results) == null ? void 0 : _b.map((_, i) => [
2685
- [i],
2686
- {
2687
- count: 0,
2688
- target: null,
2689
- reset: useTimeoutFn(() => {
2690
- if (clickCounters.value[i]) {
2691
- clickCounters.value[i].count = 0;
2692
- clickCounters.value[i].target = null;
2693
- }
2694
- }, 400, { immediate: false })
2695
- }
2696
- ])) ?? []);
2697
- }, {
2641
+ watch(() => props.data, () => clickCounters.value = Object.fromEntries(props.data?.results?.map((_, i) => [
2642
+ [i],
2643
+ {
2644
+ count: 0,
2645
+ target: null,
2646
+ reset: useTimeoutFn(() => {
2647
+ if (clickCounters.value[i]) {
2648
+ clickCounters.value[i].count = 0;
2649
+ clickCounters.value[i].target = null;
2650
+ }
2651
+ }, 400, { immediate: false })
2652
+ }
2653
+ ]) ?? []), {
2698
2654
  deep: true,
2699
2655
  immediate: true
2700
2656
  });
@@ -2716,10 +2672,9 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2716
2672
  }
2717
2673
  }
2718
2674
  function handleRowSelect(rowIndex, row, event) {
2719
- var _a;
2720
2675
  const { target } = event;
2721
2676
  if (target && target instanceof HTMLElement) {
2722
- const rowspan = (_a = target.closest("td")) == null ? void 0 : _a.getAttribute("rowspan");
2677
+ const rowspan = target.closest("td")?.getAttribute("rowspan");
2723
2678
  if (rowspan && parseInt(rowspan) > 1) {
2724
2679
  return;
2725
2680
  }
@@ -2734,15 +2689,13 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2734
2689
  selectedRowIndex.value = void 0;
2735
2690
  }
2736
2691
  function displayBorderForEndOfGroup(data, index2) {
2737
- var _a;
2738
- const grouping = (_a = props.options) == null ? void 0 : _a.groupByField;
2692
+ const grouping = props.options?.groupByField;
2739
2693
  const currentRow = data.results[index2];
2740
2694
  const nextRow = data.results[index2 + 1];
2741
2695
  return !!grouping && index2 < data.results.length - 1 && currentRow[grouping] !== nextRow[grouping];
2742
2696
  }
2743
2697
  function getGroupGridAreaSpan(data, index2) {
2744
- var _a;
2745
- const grouping = (_a = props.options) == null ? void 0 : _a.groupByField;
2698
+ const grouping = props.options?.groupByField;
2746
2699
  if (grouping) {
2747
2700
  const previousRow = data.results[index2 - 1];
2748
2701
  const currentRow = data.results[index2];
@@ -2763,13 +2716,11 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2763
2716
  watch(() => props.options.rowSelectionEnabled, clearSelectedRow);
2764
2717
  watch(() => props.request, clearSelectedRow);
2765
2718
  watch(selectedRowIndex, () => {
2766
- var _a;
2767
- if (selectedRowIndex.value !== void 0 && ((_a = props.data) == null ? void 0 : _a.results[selectedRowIndex.value])) {
2719
+ if (selectedRowIndex.value !== void 0 && props.data?.results[selectedRowIndex.value]) {
2768
2720
  emit("row-select", props.data.results[selectedRowIndex.value]);
2769
2721
  }
2770
2722
  });
2771
2723
  return (_ctx, _cache) => {
2772
- var _a;
2773
2724
  return openBlock(), createElementBlock("tbody", null, [
2774
2725
  _ctx.initialLoad ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.request.pageSize, (row) => {
2775
2726
  return openBlock(), createElementBlock("tr", { key: row }, [
@@ -2784,9 +2735,8 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2784
2735
  }, "   ", 10, _hoisted_1$K)
2785
2736
  ]);
2786
2737
  }), 128)) : createCommentVNode("", true),
2787
- _ctx.data && ((_a = _ctx.data.results) == null ? void 0 : _a.length) && !_ctx.initialLoad ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2738
+ _ctx.data && _ctx.data.results?.length && !_ctx.initialLoad ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2788
2739
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.results, (row, index2) => {
2789
- var _a2;
2790
2740
  return openBlock(), createBlock(_sfc_main$W, {
2791
2741
  key: index2,
2792
2742
  data: row,
@@ -2804,7 +2754,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2804
2754
  "cl:border-b-2 cl:border-solid cl:border-primary-dark": displayBorderForEndOfGroup(_ctx.data, index2)
2805
2755
  }]),
2806
2756
  "row-index": index2,
2807
- "group-by": ((_a2 = _ctx.options) == null ? void 0 : _a2.groupByField) ?? "",
2757
+ "group-by": _ctx.options?.groupByField ?? "",
2808
2758
  "group-grid-area-span": getGroupGridAreaSpan(_ctx.data, index2),
2809
2759
  onClick: ($event) => {
2810
2760
  _ctx.editMode ? () => {
@@ -2841,7 +2791,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2841
2791
  }, "   ", 8, _hoisted_2$z)
2842
2792
  ], 2);
2843
2793
  }), 128)) : createCommentVNode("", true)
2844
- ], 64)) : !_ctx.loading ? (openBlock(), createElementBlock("tr", _hoisted_3$m, [
2794
+ ], 64)) : !_ctx.loading ? (openBlock(), createElementBlock("tr", _hoisted_3$n, [
2845
2795
  createElementVNode("td", {
2846
2796
  colspan: _ctx.columns.length
2847
2797
  }, [
@@ -2871,7 +2821,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2871
2821
  });
2872
2822
  const _hoisted_1$J = ["value", "inputmode", "disabled", "placeholder"];
2873
2823
  const _hoisted_2$y = { class: "cl:absolute cl:flex-col cl:flex-nowrap cl:h-full cl:hidden cl:justify-between cl:py-0.5 cl:right-1 cl:text-xs cl:top-0 cl:xl:flex" };
2874
- const _hoisted_3$l = ["disabled"];
2824
+ const _hoisted_3$m = ["disabled"];
2875
2825
  const _hoisted_4$g = ["disabled"];
2876
2826
  const _sfc_main$U = /* @__PURE__ */ defineComponent({
2877
2827
  ...{
@@ -2914,8 +2864,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
2914
2864
  stagingValueChanged.value = false;
2915
2865
  if (selectInputValueTriggered.value || props.selectOnFocus || modelValue.value === 0) {
2916
2866
  setTimeout(() => {
2917
- var _a, _b;
2918
- (_b = inputRef.value) == null ? void 0 : _b.setSelectionRange(0, ((_a = stagingValue.value) == null ? void 0 : _a.length) ?? 0);
2867
+ inputRef.value?.setSelectionRange(0, stagingValue.value?.length ?? 0);
2919
2868
  });
2920
2869
  }
2921
2870
  selectInputValueTriggered.value = false;
@@ -3003,23 +2952,15 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
3003
2952
  }
3004
2953
  const selectInputValueTriggered = ref(false);
3005
2954
  function selectInputValue() {
3006
- var _a;
3007
2955
  selectInputValueTriggered.value = true;
3008
- (_a = inputRef.value) == null ? void 0 : _a.focus();
2956
+ inputRef.value?.focus();
3009
2957
  }
3010
2958
  __expose({
3011
- focus: () => {
3012
- var _a;
3013
- return (_a = inputRef.value) == null ? void 0 : _a.focus();
3014
- },
3015
- blur: () => {
3016
- var _a;
3017
- return (_a = inputRef.value) == null ? void 0 : _a.blur();
3018
- },
2959
+ focus: () => inputRef.value?.focus(),
2960
+ blur: () => inputRef.value?.blur(),
3019
2961
  select: () => selectInputValue()
3020
2962
  });
3021
2963
  return (_ctx, _cache) => {
3022
- const _component_icon = resolveComponent("icon");
3023
2964
  return openBlock(), createBlock(_sfc_main$19, {
3024
2965
  "show-required-asterisk": _ctx.required,
3025
2966
  errors: _ctx.errors
@@ -3060,8 +3001,8 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
3060
3001
  _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => incrementOrDecrement(false), ["stop", "prevent"]), ["up"]))
3061
3002
  ]
3062
3003
  }, [
3063
- createVNode(_component_icon, { icon: "ph:caret-up-bold" })
3064
- ], 40, _hoisted_3$l),
3004
+ createVNode(unref(Icon), { icon: "ph:caret-up-bold" })
3005
+ ], 40, _hoisted_3$m),
3065
3006
  createElementVNode("button", {
3066
3007
  class: "cl:bg-secondary-light/30 cl:border cl:border-grey-3 cl:hover:bg-secondary-light/20 cl:px-1 cl:rounded",
3067
3008
  disabled: _ctx.disabled,
@@ -3071,7 +3012,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
3071
3012
  _cache[9] || (_cache[9] = withKeys(withModifiers(($event) => incrementOrDecrement(false), ["stop", "prevent"]), ["up"]))
3072
3013
  ]
3073
3014
  }, [
3074
- createVNode(_component_icon, { icon: "ph:caret-down-bold" })
3015
+ createVNode(unref(Icon), { icon: "ph:caret-down-bold" })
3075
3016
  ], 40, _hoisted_4$g)
3076
3017
  ], 512), [
3077
3018
  [vShow, showArrowsComputed.value && !_ctx.disabled]
@@ -3103,7 +3044,7 @@ const _hoisted_1$I = {
3103
3044
  class: "cl:flex cl:flex-col cl:lg:flex-row cl:lg:gap-2"
3104
3045
  };
3105
3046
  const _hoisted_2$x = { class: "cl:border cl:border-off-white cl:flex cl:items-center cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:p-2 cl:rounded-lg cl:w-full" };
3106
- const _hoisted_3$k = { class: "cl:border cl:border-off-white cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:p-2 cl:rounded-lg" };
3047
+ const _hoisted_3$l = { class: "cl:border cl:border-off-white cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:p-2 cl:rounded-lg" };
3107
3048
  const _hoisted_4$f = ["inert"];
3108
3049
  const _hoisted_5$a = { class: "cl:basis-full cl:bg-off-white cl:border cl:border-grey-1 cl:flex cl:flex-1 cl:items-center cl:justify-between cl:lg:basis-0 cl:lg:px-4 cl:lg:py-3 cl:mt-2 cl:p-2 cl:rounded-lg cl:shadow cl:text-sm" };
3109
3050
  const _hoisted_6$8 = { class: "cl:flex cl:flex-wrap cl:gap-x-4 cl:gap-y-2 cl:items-center cl:justify-between cl:w-full" };
@@ -3143,10 +3084,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3143
3084
  const props = __props;
3144
3085
  const emit = __emit;
3145
3086
  const { t: t2 } = useI18n();
3146
- const totalPages = computed(() => {
3147
- var _a;
3148
- return props.data !== null ? Math.ceil((((_a = props.data) == null ? void 0 : _a.totalRecords) ?? 0) / props.request.pageSize) : 1;
3149
- });
3087
+ const totalPages = computed(() => props.data !== null ? Math.ceil((props.data?.totalRecords ?? 0) / props.request.pageSize) : 1);
3150
3088
  const pageNumbers = computed(() => {
3151
3089
  const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
3152
3090
  let results = [];
@@ -3161,7 +3099,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3161
3099
  function setPage(pageNumber) {
3162
3100
  if (props.showUnsavedChangesWarning === false || window.confirm(t2("grid.unsavedChangesWarningMessage"))) {
3163
3101
  const filterRequest = copy(props.request);
3164
- pageNumber ?? (pageNumber = 1);
3102
+ pageNumber ??= 1;
3165
3103
  if (filterRequest.pageNumber !== pageNumber) {
3166
3104
  filterRequest.pageNumber = Math.max(Math.min(Math.trunc(pageNumber), totalPages.value), 1);
3167
3105
  emit("update:request", filterRequest);
@@ -3185,7 +3123,6 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3185
3123
  }
3186
3124
  }
3187
3125
  return (_ctx, _cache) => {
3188
- var _a, _b, _c;
3189
3126
  return _ctx.initialLoad ? (openBlock(), createElementBlock("div", _hoisted_1$I, [
3190
3127
  createElementVNode("div", _hoisted_2$x, [
3191
3128
  createVNode(unref(_sfc_main$$), { words: 3 }),
@@ -3194,10 +3131,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3194
3131
  words: 2
3195
3132
  })
3196
3133
  ]),
3197
- createElementVNode("div", _hoisted_3$k, [
3134
+ createElementVNode("div", _hoisted_3$l, [
3198
3135
  createVNode(unref(clUiSkeletonInput), { class: "cl:w-64" })
3199
3136
  ])
3200
- ])) : _ctx.loading || ((_b = (_a = _ctx.data) == null ? void 0 : _a.results) == null ? void 0 : _b.length) && _ctx.request ? (openBlock(), createElementBlock("div", {
3137
+ ])) : _ctx.loading || _ctx.data?.results?.length && _ctx.request ? (openBlock(), createElementBlock("div", {
3201
3138
  key: 1,
3202
3139
  class: normalizeClass(["cl:flex cl:flex-wrap cl:lg:gap-2", {
3203
3140
  "cl:opacity-40": _ctx.loading
@@ -3213,7 +3150,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3213
3150
  ]),
3214
3151
  createElementVNode("div", _hoisted_10$3, [
3215
3152
  createElementVNode("span", _hoisted_11$3, toDisplayString(unref(t2)("grid.totalRecords")), 1),
3216
- createElementVNode("span", null, toDisplayString(unref(formatNumberAsInteger)(((_c = _ctx.data) == null ? void 0 : _c.totalRecords) ?? 0)), 1)
3153
+ createElementVNode("span", null, toDisplayString(unref(formatNumberAsInteger)(_ctx.data?.totalRecords ?? 0)), 1)
3217
3154
  ]),
3218
3155
  _ctx.options.hidePageSizeOptions === false ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
3219
3156
  createElementVNode("span", _hoisted_13$1, toDisplayString(unref(t2)("grid.pageSize")), 1),
@@ -3311,9 +3248,9 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3311
3248
  autocomplete: "off",
3312
3249
  "onUpdate:modelValue": setPage
3313
3250
  }, {
3314
- default: withCtx(() => _cache[4] || (_cache[4] = [
3251
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
3315
3252
  createElementVNode("span", null, null, -1)
3316
- ])),
3253
+ ])]),
3317
3254
  _: 1
3318
3255
  }, 8, ["model-value", "max", "disabled"])
3319
3256
  ])
@@ -3418,9 +3355,12 @@ function convertDateToIsoString(dateToConvert, forcedTimeOfDay, includeOffset, s
3418
3355
  } else if (forcedTimeOfDay === "end") {
3419
3356
  returnValueDate = returnValueDate.endOf("day").set({ millisecond: 0 });
3420
3357
  }
3421
- let returnValue = returnValueDate.toISO({ includeOffset });
3358
+ let returnValue = returnValueDate.toISO({
3359
+ includeOffset,
3360
+ suppressMilliseconds: true
3361
+ });
3422
3362
  if (selectedTimeZone === null) {
3423
- returnValue = (returnValue == null ? void 0 : returnValue.replace("Z", "")) ?? null;
3363
+ returnValue = returnValue?.replace("Z", "") ?? null;
3424
3364
  }
3425
3365
  return returnValue;
3426
3366
  }
@@ -3586,12 +3526,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
3586
3526
  return (_ctx, _cache) => {
3587
3527
  return openBlock(), createElementBlock("div", _hoisted_1$H, [
3588
3528
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dates, (date, index2) => {
3589
- var _a, _b;
3590
3529
  return openBlock(), createElementBlock("button", {
3591
3530
  key: index2,
3592
3531
  class: normalizeClass(["cl:border cl:cursor-pointer cl:py-1 cl:rounded-md cl:text-center", {
3593
- "cl:bg-primary-lighter/30 cl:border-primary-default cl:font-bold cl:hover:border-primary-darker": ((_a = _ctx.selectedQuickDate) == null ? void 0 : _a.name) === date.name,
3594
- "cl:border-grey-2 cl:hover:border-grey-3 cl:hover:opacity-95 cl:opacity-60": ((_b = _ctx.selectedQuickDate) == null ? void 0 : _b.name) !== date.name
3532
+ "cl:bg-primary-lighter/30 cl:border-primary-default cl:font-bold cl:hover:border-primary-darker": _ctx.selectedQuickDate?.name === date.name,
3533
+ "cl:border-grey-2 cl:hover:border-grey-3 cl:hover:opacity-95 cl:opacity-60": _ctx.selectedQuickDate?.name !== date.name
3595
3534
  }]),
3596
3535
  onClick: ($event) => emit("quick-date-selected", date)
3597
3536
  }, [
@@ -3831,14 +3770,8 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3831
3770
  }
3832
3771
  }
3833
3772
  __expose({
3834
- focus: () => {
3835
- var _a;
3836
- return (_a = inputRef.value) == null ? void 0 : _a.focus();
3837
- },
3838
- blur: () => {
3839
- var _a;
3840
- return (_a = inputRef.value) == null ? void 0 : _a.blur();
3841
- }
3773
+ focus: () => inputRef.value?.focus(),
3774
+ blur: () => inputRef.value?.blur()
3842
3775
  });
3843
3776
  return (_ctx, _cache) => {
3844
3777
  return openBlock(), createBlock(_sfc_main$19, {
@@ -3885,7 +3818,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3885
3818
  });
3886
3819
  const _hoisted_1$F = { class: "cl:gap-1 cl:grid cl:grid-cols-[auto_1fr_auto_auto] cl:pt-0.5 cl:w-full" };
3887
3820
  const _hoisted_2$u = ["disabled"];
3888
- const _hoisted_3$j = { class: "cl:max-w-max" };
3821
+ const _hoisted_3$k = { class: "cl:max-w-max" };
3889
3822
  const _hoisted_4$e = { class: "cl:flex cl:flex-col cl:gap-1 cl:w-full" };
3890
3823
  const _hoisted_5$9 = ["min", "disabled", "required", "step", "max"];
3891
3824
  const _hoisted_6$7 = { class: "cl:bg-white cl:border cl:border-grey-2 cl:leading-none cl:rounded-full cl:text-center cl:text-xs" };
@@ -3925,19 +3858,12 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3925
3858
  const showRegularInput = ref(false);
3926
3859
  const displayValue = useThrottle(value, 50);
3927
3860
  function setValueAndFocus(newValue) {
3928
- var _a;
3929
3861
  value.value = newValue;
3930
- (_a = sliderRef.value) == null ? void 0 : _a.focus();
3862
+ sliderRef.value?.focus();
3931
3863
  }
3932
3864
  __expose({
3933
- focus: () => {
3934
- var _a, _b;
3935
- return ((_a = sliderRef.value) == null ? void 0 : _a.focus()) || ((_b = inputRef.value) == null ? void 0 : _b.focus());
3936
- },
3937
- blur: () => {
3938
- var _a, _b;
3939
- return ((_a = sliderRef.value) == null ? void 0 : _a.blur()) || ((_b = inputRef.value) == null ? void 0 : _b.blur());
3940
- }
3865
+ focus: () => sliderRef.value?.focus() || inputRef.value?.focus(),
3866
+ blur: () => sliderRef.value?.blur() || inputRef.value?.blur()
3941
3867
  });
3942
3868
  return (_ctx, _cache) => {
3943
3869
  const _component_icon = resolveComponent("icon");
@@ -3952,7 +3878,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3952
3878
  class: "cl:active:bg-grey-0 cl:bg-white cl:border cl:border-grey-2 cl:disabled:bg-grey-1 cl:hover:bg-off-white cl:leading-none cl:min-w-[26px] cl:p-[5px] cl:rounded-full cl:shadow cl:text-xs cl:transition-colors",
3953
3879
  onClick: _cache[0] || (_cache[0] = ($event) => setValueAndFocus(_ctx.min))
3954
3880
  }, toDisplayString(unref(formatNumberAsDecimal)(_ctx.min, _ctx.precision)), 9, _hoisted_2$u),
3955
- createElementVNode("div", _hoisted_3$j, [
3881
+ createElementVNode("div", _hoisted_3$k, [
3956
3882
  withDirectives(createElementVNode("div", _hoisted_4$e, [
3957
3883
  withDirectives(createElementVNode("input", mergeProps({
3958
3884
  ref_key: "sliderRef",
@@ -4133,15 +4059,15 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4133
4059
  required: { type: Boolean },
4134
4060
  disabled: { type: Boolean },
4135
4061
  rangeSelected: { type: Boolean },
4136
- forceIconDisplay: { type: Boolean }
4062
+ forceIconDisplay: { type: Boolean },
4063
+ interactiveIcon: { type: Boolean }
4137
4064
  },
4138
4065
  emits: ["clear", "reset", "togglePopover", "focus", "blur"],
4139
4066
  setup(__props, { expose: __expose }) {
4140
4067
  const props = __props;
4141
4068
  const element = ref(null);
4142
4069
  function focus() {
4143
- var _a;
4144
- (_a = element.value) == null ? void 0 : _a.focus();
4070
+ element.value?.focus();
4145
4071
  }
4146
4072
  const { t: t2 } = useI18n();
4147
4073
  const currentPlaceholder = computed(() => {
@@ -4182,10 +4108,13 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4182
4108
  onBlur: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("blur"))
4183
4109
  }, toHandlers(_ctx.events, true)), null, 16, _hoisted_2$t),
4184
4110
  createVNode(unref(Icon), {
4185
- class: "cl:absolute cl:bg-transparent cl:cursor-text cl:left-2 cl:text-grey-4 cl:top-3.5 icon",
4111
+ class: normalizeClass(["cl:absolute cl:bg-transparent cl:cursor-pointer cl:hover:text-link-light cl:left-2 cl:text-grey-4 cl:top-3.5 icon", { "cl:pointer-events-none": !_ctx.interactiveIcon }]),
4186
4112
  icon: _ctx.type === "time" ? "ph-clock" : "ph:calendar",
4187
- onClick: focus
4188
- }, null, 8, ["icon"]),
4113
+ onClick: _cache[4] || (_cache[4] = ($event) => {
4114
+ focus();
4115
+ _ctx.$emit("togglePopover");
4116
+ })
4117
+ }, null, 8, ["class", "icon"]),
4189
4118
  !_ctx.disabled ? (openBlock(), createElementBlock("div", {
4190
4119
  key: 0,
4191
4120
  class: normalizeClass(["action-icon cl:absolute cl:bg-transparent cl:flex cl:right-2 cl:text-grey-4 cl:top-3.5", { "show-icons": _ctx.forceIconDisplay }])
@@ -4194,20 +4123,20 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4194
4123
  key: 0,
4195
4124
  class: "cl:cursor-pointer cl:hover:text-link-light",
4196
4125
  icon: "ph:arrow-counter-clockwise",
4197
- onClick: _cache[4] || (_cache[4] = withModifiers(($event) => _ctx.$emit("reset"), ["prevent"]))
4126
+ onClick: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.$emit("reset"), ["prevent"]))
4198
4127
  })) : createCommentVNode("", true),
4199
4128
  !_ctx.required && _ctx.date && (_ctx.type !== "time" || _ctx.date !== "00:00") ? (openBlock(), createBlock(unref(Icon), {
4200
4129
  key: 1,
4201
4130
  class: "cl:cursor-pointer cl:hover:text-link-light cl:md:ml-0.5 clear-icon",
4202
4131
  icon: "ph:x",
4203
- onClick: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.$emit("clear"), ["prevent"]))
4132
+ onClick: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.$emit("clear"), ["prevent"]))
4204
4133
  })) : createCommentVNode("", true)
4205
4134
  ], 2)) : createCommentVNode("", true)
4206
4135
  ]));
4207
4136
  };
4208
4137
  }
4209
4138
  });
4210
- const clUiCalendarInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-8d0a0dc4"]]);
4139
+ const clUiCalendarInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-c852f489"]]);
4211
4140
  const _hoisted_1$D = {
4212
4141
  key: 0,
4213
4142
  class: "cl:px-3 cl:py-3 cl:w-full"
@@ -4233,7 +4162,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4233
4162
  placeholder: { default: null },
4234
4163
  popoverPlacement: { default: "auto" },
4235
4164
  showPopover: { type: Boolean, default: void 0 },
4236
- forceIconDisplay: { type: Boolean, default: false }
4165
+ forceIconDisplay: { type: Boolean, default: false },
4166
+ showWeekNumbers: { type: Boolean, default: true }
4237
4167
  }, {
4238
4168
  "modelValue": { required: true },
4239
4169
  "modelModifiers": {}
@@ -4270,6 +4200,29 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4270
4200
  const { locale: locale2 } = useI18n();
4271
4201
  const internalLocale = computed(() => props.dateFormatLocale ?? locale2.value);
4272
4202
  const todayButtonVisible = ref(true);
4203
+ const internalPlaceholder = computed(() => {
4204
+ if (props.placeholder !== null) {
4205
+ return props.placeholder || null;
4206
+ } else {
4207
+ const formatPlaceholderDateOptions = {
4208
+ year: "numeric",
4209
+ month: "2-digit",
4210
+ day: "2-digit"
4211
+ };
4212
+ const formatPlaceholderTimeOptions = {
4213
+ hour: "2-digit",
4214
+ minute: "2-digit"
4215
+ };
4216
+ const meridiems = Info.meridiems().join(", ").toUpperCase();
4217
+ const displayString = DateTime.parseFormatForOpts({
4218
+ ...props.type === "time" ? void 0 : formatPlaceholderDateOptions,
4219
+ ...props.type === "date" ? void 0 : formatPlaceholderTimeOptions
4220
+ }, {
4221
+ locale: internalLocale.value
4222
+ });
4223
+ return displayString?.toUpperCase().replace("YYYYYY", "YYYY").replace("YYYYY", "YYYY").replace("A", `(${meridiems})`) ?? null;
4224
+ }
4225
+ });
4273
4226
  const showPopoverComputed = computed(() => {
4274
4227
  return props.showPopover !== void 0 ? props.showPopover : props.type !== "time";
4275
4228
  });
@@ -4319,8 +4272,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4319
4272
  });
4320
4273
  __expose({
4321
4274
  focus() {
4322
- var _a;
4323
- (_a = input.value) == null ? void 0 : _a.focus();
4275
+ input.value?.focus();
4324
4276
  }
4325
4277
  });
4326
4278
  return (_ctx, _cache) => {
@@ -4354,14 +4306,16 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4354
4306
  date: inputValue,
4355
4307
  events: inputEvents,
4356
4308
  type: _ctx.type,
4357
- placeholder: _ctx.placeholder,
4309
+ placeholder: internalPlaceholder.value,
4358
4310
  required: _ctx.required,
4359
4311
  "force-icon-display": _ctx.forceIconDisplay,
4360
4312
  disabled: _ctx.disabled,
4313
+ "interactive-icon": !props.showPopover,
4361
4314
  onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("focus")),
4362
4315
  onBlur: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("blur")),
4363
- onClear: _cache[2] || (_cache[2] = ($event) => internalCurrentDateTime.value = null)
4364
- }), null, 16, ["date", "events", "type", "placeholder", "required", "force-icon-display", "disabled"])
4316
+ onClear: _cache[2] || (_cache[2] = ($event) => internalCurrentDateTime.value = null),
4317
+ onTogglePopover: calendar.value?.showPopover
4318
+ }), null, 16, ["date", "events", "type", "placeholder", "required", "force-icon-display", "disabled", "interactive-icon", "onTogglePopover"])
4365
4319
  ]),
4366
4320
  footer: withCtx(() => [
4367
4321
  todayButtonVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$D, [
@@ -4391,6 +4345,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4391
4345
  color: "primary",
4392
4346
  "title-position": "left",
4393
4347
  "hide-time-header": "",
4348
+ "show-weeknumbers": _ctx.showWeekNumbers,
4394
4349
  popover: popover.value
4395
4350
  }, {
4396
4351
  default: withCtx(({ inputValue, inputEvents }) => [
@@ -4400,15 +4355,17 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4400
4355
  date: inputValue,
4401
4356
  events: inputEvents,
4402
4357
  type: _ctx.type,
4403
- placeholder: _ctx.placeholder,
4358
+ placeholder: internalPlaceholder.value,
4404
4359
  required: _ctx.required,
4405
4360
  disabled: _ctx.disabled,
4406
4361
  "force-icon-display": _ctx.forceIconDisplay,
4362
+ "interactive-icon": !props.showPopover,
4407
4363
  onFocus: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("focus")),
4408
4364
  onBlur: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("blur")),
4409
4365
  onClear: _cache[6] || (_cache[6] = ($event) => internalCurrentDateTime.value = null),
4410
- onReset: _cache[7] || (_cache[7] = ($event) => internalCurrentDateTime.value = unref(getDefaultDate)(_ctx.minDate, _ctx.maxDate, internalTimeZone.value, _ctx.type))
4411
- }), null, 16, ["date", "events", "type", "placeholder", "required", "disabled", "force-icon-display"])
4366
+ onReset: _cache[7] || (_cache[7] = ($event) => internalCurrentDateTime.value = unref(getDefaultDate)(_ctx.minDate, _ctx.maxDate, internalTimeZone.value, _ctx.type)),
4367
+ onTogglePopover: calendar.value?.showPopover
4368
+ }), null, 16, ["date", "events", "type", "placeholder", "required", "disabled", "force-icon-display", "interactive-icon", "onTogglePopover"])
4412
4369
  ]),
4413
4370
  footer: withCtx(() => [
4414
4371
  todayButtonVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$s, [
@@ -4419,7 +4376,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4419
4376
  ])) : createCommentVNode("", true)
4420
4377
  ]),
4421
4378
  _: 1
4422
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "popover"]))
4379
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "show-weeknumbers", "popover"]))
4423
4380
  ]),
4424
4381
  _: 2
4425
4382
  }, [
@@ -4439,7 +4396,7 @@ const _hoisted_1$C = {
4439
4396
  class: "cl:flex cl:gap-2 cl:p-2 cl:w-full"
4440
4397
  };
4441
4398
  const _hoisted_2$r = { class: "cl:w-full" };
4442
- const _hoisted_3$i = { class: "cl:w-full" };
4399
+ const _hoisted_3$j = { class: "cl:w-full" };
4443
4400
  const _sfc_main$L = /* @__PURE__ */ defineComponent({
4444
4401
  ...{
4445
4402
  inheritAttrs: false
@@ -4455,7 +4412,8 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4455
4412
  required: { type: Boolean, default: false },
4456
4413
  quickDateScope: { default: null },
4457
4414
  popoverPlacement: { default: "auto" },
4458
- manualDateSelection: { type: Boolean, default: true }
4415
+ manualDateSelection: { type: Boolean, default: true },
4416
+ showWeekNumbers: { type: Boolean, default: true }
4459
4417
  }, {
4460
4418
  "modelValue": { required: true },
4461
4419
  "modelModifiers": {}
@@ -4576,6 +4534,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4576
4534
  mode: "date",
4577
4535
  color: "primary",
4578
4536
  "title-position": "left",
4537
+ "show-weeknumbers": _ctx.showWeekNumbers,
4579
4538
  locale: internalLocale.value,
4580
4539
  timezone: internalTimeZone.value,
4581
4540
  columns: dateRangeColumnCount.value,
@@ -4635,7 +4594,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4635
4594
  _: 1
4636
4595
  }, 8, ["modelValue", "date-format-locale", "disabled", "time-zone", "min-date", "max-date", "popover-placement"])
4637
4596
  ]),
4638
- createElementVNode("div", _hoisted_3$i, [
4597
+ createElementVNode("div", _hoisted_3$j, [
4639
4598
  createVNode(_sfc_main$M, {
4640
4599
  id: "dateInputEnd",
4641
4600
  modelValue: internalEntrySelectEndDate.value,
@@ -4664,7 +4623,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4664
4623
  ])) : createCommentVNode("", true)
4665
4624
  ]),
4666
4625
  _: 1
4667
- }, 8, ["modelValue", "locale", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])
4626
+ }, 8, ["modelValue", "show-weeknumbers", "locale", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])
4668
4627
  ]),
4669
4628
  _: 2
4670
4629
  }, [
@@ -4699,9 +4658,41 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
4699
4658
  };
4700
4659
  }
4701
4660
  });
4661
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4662
+ __name: "cl-ui-select-option",
4663
+ props: {
4664
+ isSelected: { type: Boolean, default: false },
4665
+ isHighlighted: { type: Boolean, default: false },
4666
+ disabled: { type: Boolean, default: false },
4667
+ readonly: { type: Boolean, default: false }
4668
+ },
4669
+ emits: ["select"],
4670
+ setup(__props, { emit: __emit }) {
4671
+ const emit = __emit;
4672
+ return (_ctx, _cache) => {
4673
+ return openBlock(), createElementBlock("div", {
4674
+ class: normalizeClass(["cl:px-2 cl:py-0.5", _ctx.disabled ? "cl:bg-grey-1 cl:border-grey-2 cl:placeholder-grey-3" : {
4675
+ "cl:cursor-pointer": _ctx.readonly === false,
4676
+ "cl:bg-primary-lighter": _ctx.isSelected && _ctx.isHighlighted === false,
4677
+ "cl:hover:bg-primary-default": _ctx.readonly === false && _ctx.isSelected && _ctx.isHighlighted === false,
4678
+ "cl:bg-primary-default": _ctx.isSelected && _ctx.isHighlighted,
4679
+ "cl:hover:bg-link-lighter": _ctx.readonly === false && _ctx.isSelected === false && _ctx.isHighlighted === false,
4680
+ "cl:bg-link-lighter": _ctx.isSelected === false && _ctx.isHighlighted
4681
+ }]),
4682
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.readonly || _ctx.disabled ? null : emit("select"))
4683
+ }, [
4684
+ renderSlot(_ctx.$slots, "default")
4685
+ ], 2);
4686
+ };
4687
+ }
4688
+ });
4702
4689
  const _hoisted_1$B = ["value", "readonly", "placeholder", "disabled", "onKeydown"];
4703
4690
  const _hoisted_2$q = ["id", "tabindex", "inert", "onKeydown"];
4704
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
4691
+ const _hoisted_3$i = {
4692
+ key: 1,
4693
+ class: "cl:p-1 cl:select-none cl:text-grey-3"
4694
+ };
4695
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
4705
4696
  ...{
4706
4697
  inheritAttrs: false
4707
4698
  },
@@ -4717,7 +4708,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4717
4708
  isGridFilter: { type: Boolean, default: false },
4718
4709
  openDropDownOnFocus: { type: Boolean, default: true },
4719
4710
  allowFiltering: { type: Boolean, default: false },
4720
- useListView: { type: Boolean, default: (props) => Array.isArray(props.modelValue) }
4711
+ useListView: { type: Boolean, default: (props) => Array.isArray(props.modelValue) },
4712
+ readonly: { type: Boolean, default: false }
4721
4713
  },
4722
4714
  emits: ["update:model-value"],
4723
4715
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -4741,14 +4733,22 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4741
4733
  if (isSelectItem(item)) {
4742
4734
  return item.name;
4743
4735
  }
4744
- return item == null ? void 0 : item.toString();
4736
+ return item?.toString();
4745
4737
  }
4746
4738
  });
4747
4739
  const searchTerm = ref("");
4748
- const displayList = computed(() => props.list.filter((entry) => {
4749
- const term = isSelectItem(entry) ? entry.name : entry;
4750
- return term.toString().toLowerCase().includes(searchTerm.value.trim().toLowerCase());
4751
- }));
4740
+ const displayList = computed(() => {
4741
+ const itemsToFilterBasedOnSearchTerm = props.list.filter((d) => !isSelectItem(d) || isSelectItem(d) && d.id > -1);
4742
+ const filteredDisplayList = itemsToFilterBasedOnSearchTerm.filter((entry) => {
4743
+ const term = isSelectItem(entry) ? entry.name : entry;
4744
+ return term.toString().toLowerCase().includes(searchTerm.value.trim().toLowerCase());
4745
+ });
4746
+ const itemsToExcludeFromSearchTermFiltering = props.list.filter((d) => isSelectItem(d) && d.id < 0);
4747
+ return [
4748
+ ...searchTerm.value.trim() === "" ? itemsToExcludeFromSearchTermFiltering : [],
4749
+ ...filteredDisplayList
4750
+ ];
4751
+ });
4752
4752
  const isCurrentlySearchable = computed(() => selectModalVisible.value && props.allowFiltering);
4753
4753
  const highlightIndex = ref(-1);
4754
4754
  const outsideRef = ref();
@@ -4779,51 +4779,51 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4779
4779
  setSearchTerm("");
4780
4780
  }
4781
4781
  function select(value) {
4782
- if (Array.isArray(selectResult.value)) {
4783
- const isInArray = selectResult.value.indexOf(value);
4784
- if (isInArray > -1) {
4785
- if (selectResult.value.length > 1 || props.canClear) {
4786
- selectResult.value = selectResult.value.toSpliced(isInArray, 1);
4782
+ if (props.readonly === false && value !== null && value !== void 0) {
4783
+ if (Array.isArray(selectResult.value)) {
4784
+ const isInArray = selectResult.value.indexOf(value);
4785
+ if (isInArray > -1) {
4786
+ if (selectResult.value.length > 1 || props.canClear) {
4787
+ selectResult.value = selectResult.value.toSpliced(isInArray, 1);
4788
+ }
4789
+ } else {
4790
+ selectResult.value = [
4791
+ ...selectResult.value,
4792
+ value
4793
+ ];
4787
4794
  }
4788
4795
  } else {
4789
- selectResult.value = [
4790
- ...selectResult.value,
4791
- value
4792
- ];
4793
- }
4794
- } else {
4795
- if (props.canClear && selectResult.value === value) {
4796
- selectResult.value = null;
4797
- } else {
4798
- selectResult.value = value;
4796
+ if (props.canClear && selectResult.value === value) {
4797
+ selectResult.value = null;
4798
+ } else {
4799
+ selectResult.value = value;
4800
+ }
4801
+ toggleSelectModalState();
4799
4802
  }
4800
- toggleSelectModalState();
4801
4803
  }
4802
4804
  }
4803
4805
  function moveHighlightToStart(event) {
4804
- var _a;
4805
- if (selectModalVisible.value || props.useListView) {
4806
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4806
4807
  event.stopPropagation();
4807
4808
  highlightIndex.value = 0;
4808
- (_a = selectModalRef.value) == null ? void 0 : _a.scrollTo({
4809
+ selectModalRef.value?.scrollTo({
4809
4810
  top: 0,
4810
4811
  behavior: "instant"
4811
4812
  });
4812
4813
  }
4813
4814
  }
4814
4815
  function moveHighlightToEnd(event) {
4815
- var _a;
4816
- if (selectModalVisible.value || props.useListView) {
4816
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4817
4817
  event.stopPropagation();
4818
4818
  highlightIndex.value = displayList.value.length - 1;
4819
- (_a = selectModalRef.value) == null ? void 0 : _a.scrollTo({
4819
+ selectModalRef.value?.scrollTo({
4820
4820
  top: selectModalRef.value.scrollHeight,
4821
4821
  behavior: "instant"
4822
4822
  });
4823
4823
  }
4824
4824
  }
4825
4825
  function moveHighlightBackwards(event) {
4826
- if (selectModalVisible.value || props.useListView) {
4826
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4827
4827
  event.stopPropagation();
4828
4828
  if (highlightIndex.value === -1) {
4829
4829
  moveHighlightToStart(event);
@@ -4836,7 +4836,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4836
4836
  }
4837
4837
  }
4838
4838
  function moveHighlightForwards(event) {
4839
- if (selectModalVisible.value || props.useListView) {
4839
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4840
4840
  event.stopPropagation();
4841
4841
  if (highlightIndex.value < displayList.value.length - 1) {
4842
4842
  highlightIndex.value++;
@@ -4850,8 +4850,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4850
4850
  return !!value && typeof value === "object" && "name" in value && typeof value.name === "string" && "id" in value && typeof value.id === "number";
4851
4851
  }
4852
4852
  function scrollToHighlight() {
4853
- var _a;
4854
- const highlightedElement = (_a = selectModalRef.value) == null ? void 0 : _a.children.item(highlightIndex.value);
4853
+ const highlightedElement = selectModalRef.value?.children.item(highlightIndex.value);
4855
4854
  if (selectModalRef.value && highlightedElement) {
4856
4855
  selectModalRef.value.scrollTo({
4857
4856
  top: highlightedElement.offsetTop - 16,
@@ -4860,14 +4859,24 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4860
4859
  }
4861
4860
  }
4862
4861
  function handleEnterPress(event) {
4863
- if (selectModalVisible.value) {
4864
- select(displayList.value[highlightIndex.value]);
4862
+ const isMultiSelect = Array.isArray(selectResult.value);
4863
+ if (selectModalVisible.value && (!isMultiSelect || highlightIndex.value !== -1 && isMultiSelect)) {
4864
+ select(displayList.value[highlightIndex.value] ?? null);
4865
4865
  setSearchTerm("");
4866
4866
  event.target.focus();
4867
+ } else if (props.allowFiltering && isMultiSelect && searchTerm.value.trim() !== "") {
4868
+ const displayListExcludingDefaultValues = displayList.value.filter((d) => !isSelectItem(d) || isSelectItem(d) && d.id > -1);
4869
+ if (displayListExcludingDefaultValues.length > 0) {
4870
+ selectMultipleValues(displayListExcludingDefaultValues);
4871
+ toggleSelectModalState(false);
4872
+ }
4867
4873
  } else {
4868
4874
  toggleSelectModalState(true);
4869
4875
  }
4870
4876
  }
4877
+ function selectMultipleValues(values) {
4878
+ selectResult.value = values;
4879
+ }
4871
4880
  function handleEscapePress(event) {
4872
4881
  toggleSelectModalState(false);
4873
4882
  if (props.openDropDownOnFocus) {
@@ -4905,12 +4914,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4905
4914
  }));
4906
4915
  let ignoreFocus = false;
4907
4916
  function focus() {
4908
- var _a;
4909
4917
  if (!ignoreFocus && props.openDropDownOnFocus) {
4910
4918
  toggleSelectModalState(true);
4911
4919
  }
4912
4920
  ignoreFocus = false;
4913
- (_a = inputElement.value) == null ? void 0 : _a.focus();
4921
+ inputElement.value?.focus();
4914
4922
  }
4915
4923
  function disableKeyboardEventForSearching(fn) {
4916
4924
  return (...args) => {
@@ -4929,12 +4937,18 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4929
4937
  function ignoreFocusEvent() {
4930
4938
  ignoreFocus = true;
4931
4939
  }
4940
+ function handleMouseClick(option2) {
4941
+ select(option2);
4942
+ highlightIndex.value = -1;
4943
+ }
4944
+ watch(searchTerm, () => {
4945
+ highlightIndex.value = -1;
4946
+ });
4932
4947
  __expose({
4933
4948
  focus
4934
4949
  });
4935
4950
  return (_ctx, _cache) => {
4936
4951
  const _component_icon = resolveComponent("icon");
4937
- const _component_cl_ui_select_option = resolveComponent("cl-ui-select-option");
4938
4952
  return openBlock(), createElementBlock("div", {
4939
4953
  ref_key: "outsideRef",
4940
4954
  ref: outsideRef,
@@ -4983,7 +4997,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4983
4997
  withKeys(withModifiers(moveHighlightForwards, ["prevent"]), ["down"]),
4984
4998
  withKeys(withModifiers(moveHighlightToStart, ["prevent"]), ["home"]),
4985
4999
  withKeys(withModifiers(moveHighlightToEnd, ["prevent"]), ["end"]),
4986
- _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => disableKeyboardEventForSearching(handleEnterPress), ["stop", "prevent"]), ["space"])),
5000
+ _cache[4] || (_cache[4] = withKeys(($event) => disableKeyboardEventForSearching(handleEnterPress), ["space"])),
4987
5001
  withKeys(withModifiers(handleEnterPress, ["stop", "prevent"]), ["enter"])
4988
5002
  ],
4989
5003
  onInput: _cache[0] || (_cache[0] = ($event) => setSearchTerm($event.target.value)),
@@ -5014,7 +5028,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5014
5028
  "cl:absolute cl:border-t-0 cl:left-0 cl:rounded-t-none cl:top-8 cl:min-h-20 cl:max-h-56 cl:text-sm": !_ctx.isGridFilter && props.useListView === false,
5015
5029
  "cl:max-h-28": props.useListView,
5016
5030
  "cl:overflow-y-auto": _ctx.disabled === false,
5017
- "cl:overflow-hidden": _ctx.disabled
5031
+ "cl:overflow-hidden": _ctx.disabled,
5032
+ "cl:text-grey-3": _ctx.readonly
5018
5033
  }],
5019
5034
  inert: _ctx.disabled,
5020
5035
  onBlur: _cache[6] || (_cache[6] = ($event) => toggleSelectModalState(false)),
@@ -5032,25 +5047,26 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5032
5047
  _cache[8] || (_cache[8] = withKeys(withModifiers(($event) => select(displayList.value[highlightIndex.value]), ["stop", "prevent"]), ["enter"]))
5033
5048
  ]
5034
5049
  }), [
5035
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayList.value, (option2, index2) => {
5050
+ displayList.value.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(displayList.value, (option2, index2) => {
5036
5051
  return openBlock(), createElementBlock("div", { key: index2 }, [
5037
- renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, { option: option2, index: index2, select, highlightIndex: highlightIndex.value, isSelected }), () => [
5038
- (openBlock(), createBlock(_component_cl_ui_select_option, {
5052
+ renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, { option: option2, index: index2, select: handleMouseClick, highlightIndex: highlightIndex.value, isSelected }), () => [
5053
+ (openBlock(), createBlock(_sfc_main$J, {
5039
5054
  id: unref(id) + "-option-" + (isSelectItem(option2) ? option2.id : index2),
5040
5055
  key: index2,
5041
5056
  disabled: _ctx.disabled,
5042
5057
  "is-highlighted": highlightIndex.value === index2,
5043
5058
  "is-selected": isSelected(option2),
5044
- onSelect: ($event) => select(option2)
5059
+ readonly: _ctx.readonly,
5060
+ onSelect: ($event) => handleMouseClick(option2)
5045
5061
  }, {
5046
5062
  default: withCtx(() => [
5047
5063
  createTextVNode(toDisplayString(isSelectItem(option2) ? option2.name : option2), 1)
5048
5064
  ]),
5049
5065
  _: 2
5050
- }, 1032, ["id", "disabled", "is-highlighted", "is-selected", "onSelect"]))
5066
+ }, 1032, ["id", "disabled", "is-highlighted", "is-selected", "readonly", "onSelect"]))
5051
5067
  ])
5052
5068
  ]);
5053
- }), 128))
5069
+ }), 128)) : (openBlock(), createElementBlock("span", _hoisted_3$i, toDisplayString(unref(t2)("select.notFound")), 1))
5054
5070
  ], 16, _hoisted_2$q)) : createCommentVNode("", true)
5055
5071
  ], 2)
5056
5072
  ]),
@@ -5068,31 +5084,6 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5068
5084
  };
5069
5085
  }
5070
5086
  });
5071
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
5072
- __name: "cl-ui-select-option",
5073
- props: {
5074
- isSelected: { type: Boolean, default: false },
5075
- isHighlighted: { type: Boolean, default: false },
5076
- disabled: { type: Boolean, default: false }
5077
- },
5078
- emits: ["select"],
5079
- setup(__props, { emit: __emit }) {
5080
- const emit = __emit;
5081
- return (_ctx, _cache) => {
5082
- return openBlock(), createElementBlock("div", {
5083
- class: normalizeClass(["cl:px-2 cl:py-0.5", _ctx.disabled ? "cl:bg-grey-1 cl:border-grey-2 cl:placeholder-grey-3" : ["cl:cursor-pointer", {
5084
- "cl:bg-primary-lighter cl:hover:bg-primary-default": _ctx.isSelected && _ctx.isHighlighted === false,
5085
- "cl:bg-primary-default": _ctx.isSelected && _ctx.isHighlighted,
5086
- "cl:hover:bg-link-lighter": _ctx.isSelected === false && _ctx.isHighlighted === false,
5087
- "cl:bg-link-lighter": _ctx.isSelected === false && _ctx.isHighlighted
5088
- }]]),
5089
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.disabled ? null : emit("select"))
5090
- }, [
5091
- renderSlot(_ctx.$slots, "default")
5092
- ], 2);
5093
- };
5094
- }
5095
- });
5096
5087
  const defaultFilterMethod = {
5097
5088
  method: "equal",
5098
5089
  icon: "mdi:equal",
@@ -5260,15 +5251,11 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5260
5251
  return methods;
5261
5252
  });
5262
5253
  const currentFilterMethod = computed(() => {
5263
- var _a;
5264
- let filterMethod = (_a = props.filter) == null ? void 0 : _a.filterMethod;
5254
+ let filterMethod = props.filter?.filterMethod;
5265
5255
  if (typeof filterMethod === "undefined") {
5266
5256
  filterMethod = FilterOperation[props.defaultOperation].replace("_", "").toLowerCase();
5267
5257
  }
5268
- return allowedFilterMethods.value.find((m) => {
5269
- var _a2;
5270
- return m.method.toLowerCase() === ((_a2 = filterMethod == null ? void 0 : filterMethod.removeNonAlphanumeric()) == null ? void 0 : _a2.toLowerCase());
5271
- });
5258
+ return allowedFilterMethods.value.find((m) => m.method.toLowerCase() === filterMethod?.removeNonAlphanumeric()?.toLowerCase());
5272
5259
  });
5273
5260
  function setFilterMethod(filterMethod) {
5274
5261
  let filterOutput;
@@ -5315,11 +5302,10 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5315
5302
  }, [
5316
5303
  createElementVNode("strong", _hoisted_2$p, toDisplayString(unref(t2)("grid.availableMethods")), 1),
5317
5304
  (openBlock(true), createElementBlock(Fragment, null, renderList(allowedFilterMethods.value, (filterMethod, index2) => {
5318
- var _a;
5319
5305
  return openBlock(), createElementBlock("span", {
5320
5306
  key: index2,
5321
5307
  class: normalizeClass(["cl:cursor-pointer cl:hover:bg-grey-0 cl:px-4 cl:py-1 cl:transition-colors cl:w-full", {
5322
- "cl:bg-primary-default cl:opacity-80": filterMethod.method === ((_a = currentFilterMethod.value) == null ? void 0 : _a.method)
5308
+ "cl:bg-primary-default cl:opacity-80": filterMethod.method === currentFilterMethod.value?.method
5323
5309
  }]),
5324
5310
  onClick: withModifiers(($event) => setFilterMethod(filterMethod.method), ["prevent"])
5325
5311
  }, [
@@ -5340,11 +5326,16 @@ const defaultEmptyListValue = {
5340
5326
  name: "",
5341
5327
  value: ""
5342
5328
  };
5343
- const defaultSelectAllListValue = {
5329
+ const defaultSelectAllListValue = computed(() => ({
5344
5330
  id: -2,
5345
5331
  name: i18n.global.t("grid.selectAll"),
5346
5332
  value: ""
5347
- };
5333
+ }));
5334
+ const defaultClearAllListValue = computed(() => ({
5335
+ id: -3,
5336
+ name: i18n.global.t("grid.clearAll"),
5337
+ value: ""
5338
+ }));
5348
5339
  const booleanListEntries = computed(() => [
5349
5340
  defaultEmptyListValue,
5350
5341
  {
@@ -5403,31 +5394,38 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5403
5394
  const numericFormat = computed(() => props.column.format === NumberFormat.INTEGER ? NumberFormat.DECIMAL : props.column.format ?? NumberFormat.DECIMAL);
5404
5395
  const booleanValueAsSelectItem = computed(() => booleanListEntries.value.find((x) => x.value === currentFilterValue.value.toString()) ?? null);
5405
5396
  const listEntriesAsSelectItems = computed(() => {
5406
- var _a;
5397
+ const baseItems = [
5398
+ props.column.listMode === "multi" ? defaultSelectAllListValue.value : defaultEmptyListValue,
5399
+ ...props.column.listMode === "multi" && props.filter?.length && props.filter.length > 0 ? [defaultClearAllListValue.value] : []
5400
+ ];
5401
+ const selectedFilterValues = props.filter?.filter((f) => f.filterOperation === FilterOperation.OR_EQUAL).map((f) => f.filterValue) ?? [];
5402
+ const allListEntries = props.column.listEntries?.map((x, i) => ({
5403
+ id: i,
5404
+ name: t2(x.translationKey),
5405
+ value: x.value.toString()
5406
+ })) ?? [];
5407
+ const selectedListEntries = allListEntries.filter((entry) => selectedFilterValues.includes(entry.value));
5408
+ const unselectedListEntries = allListEntries.filter((entry) => !selectedFilterValues.includes(entry.value));
5407
5409
  return [
5408
- props.column.listMode === "multi" ? defaultSelectAllListValue : defaultEmptyListValue,
5409
- ...((_a = props.column.listEntries) == null ? void 0 : _a.map((x, i) => ({
5410
- id: i,
5411
- name: t2(x.translationKey),
5412
- value: x.value.toString()
5413
- }))) ?? []
5410
+ ...baseItems,
5411
+ ...selectedListEntries,
5412
+ ...unselectedListEntries
5414
5413
  ];
5415
5414
  });
5416
5415
  const currentFilterValueAsSelectItems = computed(() => {
5417
- var _a, _b;
5418
5416
  if (props.column.listMode !== "multi") {
5419
5417
  const item = listEntriesAsSelectItems.value.find((x) => x.value === currentFilterValue.value && x.id === selectedListEntryId.value) ?? listEntriesAsSelectItems.value.find((x) => x.value === currentFilterValue.value) ?? null;
5420
5418
  return item ? item : null;
5421
5419
  } else {
5422
- const filters = (_a = props.filter) == null ? void 0 : _a.filter((f) => f.filterOperation === FilterOperation.OR_EQUAL).map((f) => f.filterValue);
5423
- const filteredListEntries = listEntriesAsSelectItems.value.filter((x) => filters == null ? void 0 : filters.includes(x.value));
5424
- if (filteredListEntries.length === ((_b = props.column.listEntries) == null ? void 0 : _b.length)) {
5425
- filteredListEntries.push(defaultSelectAllListValue);
5420
+ const filters = props.filter?.filter((f) => f.filterOperation === FilterOperation.OR_EQUAL).map((f) => f.filterValue);
5421
+ const filteredListEntries = listEntriesAsSelectItems.value.filter((x) => filters?.includes(x.value));
5422
+ if (filteredListEntries.length === props.column.listEntries?.length) {
5423
+ filteredListEntries.push(defaultSelectAllListValue.value);
5426
5424
  }
5427
5425
  return filteredListEntries;
5428
5426
  }
5429
5427
  });
5430
- const selectAllCurrentlyHighlighted = computed(() => Array.isArray(currentFilterValueAsSelectItems.value) && currentFilterValueAsSelectItems.value.some((x) => x.id === defaultSelectAllListValue.id));
5428
+ const selectAllCurrentlyHighlighted = computed(() => Array.isArray(currentFilterValueAsSelectItems.value) && currentFilterValueAsSelectItems.value.some((x) => x.id === defaultSelectAllListValue.value.id));
5431
5429
  const selectedListEntryId = ref(defaultEmptyListValue.id);
5432
5430
  function updateListColumnSelectItems(value) {
5433
5431
  if (value && !Array.isArray(value)) {
@@ -5437,22 +5435,21 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5437
5435
  return;
5438
5436
  }
5439
5437
  if (isNumericListColumn.value) {
5440
- setNumberFilter(null, value == null ? void 0 : value.value);
5438
+ setNumberFilter(null, value?.value);
5441
5439
  } else {
5442
- setFilter(null, value == null ? void 0 : value.value);
5440
+ setFilter(null, value?.value);
5443
5441
  }
5444
5442
  }
5445
5443
  const immediateRequestOverride = ref(false);
5446
5444
  const performImmediateRequest = computed(() => immediateRequestOverride.value || isStringColumn.value === false);
5447
5445
  const internalFilter = computed({
5448
5446
  get() {
5449
- var _a, _b, _c, _d, _e, _f, _g;
5450
- let result = (_a = currentFilters.value) == null ? void 0 : _a[0];
5447
+ let result = currentFilters.value?.[0];
5451
5448
  if (result) {
5452
5449
  if (isDateColumn.value) {
5453
- if ((((_b = props.filter) == null ? void 0 : _b.length) ?? 0) > 1) {
5454
- const startFilter = (_c = currentFilters.value) == null ? void 0 : _c.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5455
- const endFilter = (_d = currentFilters.value) == null ? void 0 : _d.find((f) => f.filterOperation === FilterOperation.LESS_THAN);
5450
+ if ((props.filter?.length ?? 0) > 1) {
5451
+ const startFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5452
+ const endFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.LESS_THAN);
5456
5453
  if (startFilter && endFilter) {
5457
5454
  result = {
5458
5455
  filterOnColumn: props.column.field,
@@ -5477,9 +5474,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5477
5474
  filterValue: date.plus({ milliseconds: 1 }).toISO() ?? ""
5478
5475
  };
5479
5476
  }
5480
- } else if (isDateRangeColumn.value && (((_e = props.filter) == null ? void 0 : _e.length) ?? 0) > 1) {
5481
- const startFilter = (_f = currentFilters.value) == null ? void 0 : _f.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5482
- const endFilter = (_g = currentFilters.value) == null ? void 0 : _g.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_LESS_THAN);
5477
+ } else if (isDateRangeColumn.value && (props.filter?.length ?? 0) > 1) {
5478
+ const startFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5479
+ const endFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_LESS_THAN);
5483
5480
  if (startFilter && endFilter) {
5484
5481
  result = {
5485
5482
  filterOnColumn: props.column.field,
@@ -5499,9 +5496,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5499
5496
  let filters = null;
5500
5497
  if (isDateColumn.value) {
5501
5498
  const dateFilter = value;
5502
- const equalsFilter = (dateFilter == null ? void 0 : dateFilter.filterMethod) && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equal");
5503
- const lessThanOrEqualFilter = (dateFilter == null ? void 0 : dateFilter.filterMethod) && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equalorlessthan");
5504
- const greaterThanFilter = (dateFilter == null ? void 0 : dateFilter.filterMethod) && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "greaterthan");
5499
+ const equalsFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equal");
5500
+ const lessThanOrEqualFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equalorlessthan");
5501
+ const greaterThanFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "greaterthan");
5505
5502
  if (equalsFilter) {
5506
5503
  let date = DateTime.fromISO(dateFilter.filterValue, {
5507
5504
  zone: props.timeZone ?? "UTC"
@@ -5551,7 +5548,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5551
5548
  }
5552
5549
  ];
5553
5550
  }
5554
- } else if (isDateRangeColumn.value && (value == null ? void 0 : value.filterValue)) {
5551
+ } else if (isDateRangeColumn.value && value?.filterValue) {
5555
5552
  const dateRange = value.filterValue;
5556
5553
  const startDate = DateTime.fromISO(dateRange.start, {
5557
5554
  zone: props.timeZone ?? "UTC"
@@ -5587,7 +5584,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5587
5584
  }
5588
5585
  }
5589
5586
  }
5590
- if ((value == null ? void 0 : value.filterValue) === "" || performImmediateRequest.value) {
5587
+ if (value?.filterValue === "" || performImmediateRequest.value) {
5591
5588
  updateFilterDebounced(false);
5592
5589
  currentFilters.value = filters;
5593
5590
  immediateRequestOverride.value = false;
@@ -5600,7 +5597,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5600
5597
  if (filtersOrCancel !== false) {
5601
5598
  currentFilters.value = filtersOrCancel;
5602
5599
  }
5603
- }, 1e3);
5600
+ }, 3e3);
5604
5601
  const currentFilter = computed({
5605
5602
  get: () => internalFilter.value,
5606
5603
  set(value) {
@@ -5612,17 +5609,15 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5612
5609
  const isEqualFilter = operation === expectedOperation;
5613
5610
  return isValidValue && isEqualFilter && isDateColumn.value;
5614
5611
  }
5615
- const currentFilterValue = computed(() => {
5616
- var _a;
5617
- return ((_a = internalFilter.value) == null ? void 0 : _a.filterValue) ?? "";
5618
- });
5612
+ const currentFilterValue = computed(() => internalFilter.value?.filterValue ?? "");
5619
5613
  const currentDateFilterValue = computed(() => currentFilterValue.value === "" ? null : currentFilterValue.value);
5620
5614
  const currentDateRangeFilterValue = computed(() => currentFilterValue.value === "" ? null : currentFilterValue.value);
5621
5615
  const filterable = computed(() => isFilterable(props.column));
5622
5616
  function setOrEqualFilters(value) {
5623
- const selectAllCurrentlySelected = value.some((x) => x.id === defaultSelectAllListValue.id);
5624
- if (value.length === 0 || selectAllCurrentlySelected === false && selectAllCurrentlyHighlighted.value) {
5625
- setOrEqualFiltersImpl([defaultSelectAllListValue.value]);
5617
+ const selectAllCurrentlySelected = value.some((x) => x.id === defaultSelectAllListValue.value.id);
5618
+ const clearAllCurrentlySelected = value.some((x) => x.id === defaultClearAllListValue.value.id);
5619
+ if (value.length === 0 || selectAllCurrentlySelected === false && selectAllCurrentlyHighlighted.value || clearAllCurrentlySelected) {
5620
+ setOrEqualFiltersImpl([defaultSelectAllListValue.value.value]);
5626
5621
  } else if (selectAllCurrentlySelected && selectAllCurrentlyHighlighted.value === false) {
5627
5622
  setOrEqualFiltersImpl(listEntriesAsSelectItems.value.map((x) => x.value));
5628
5623
  } else {
@@ -5638,15 +5633,17 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5638
5633
  }
5639
5634
  }
5640
5635
  function setFilter(target, defaultValue) {
5641
- var _a;
5642
5636
  let filterOutput;
5643
5637
  let nextValue = defaultValue;
5644
- const previousValue = ((_a = internalFilter.value) == null ? void 0 : _a.filterValue.toString()) ?? "";
5638
+ const previousValue = internalFilter.value?.filterValue.toString() ?? "";
5645
5639
  const hasNextValue = !!nextValue.trim();
5646
5640
  const hasPreviousValue = !!previousValue.trim();
5647
5641
  if (hasNextValue === false && hasPreviousValue) {
5648
5642
  nextValue = "";
5649
5643
  }
5644
+ if (nextValue === previousValue) {
5645
+ return;
5646
+ }
5650
5647
  const updateFilter = hasNextValue || hasPreviousValue;
5651
5648
  if (updateFilter) {
5652
5649
  if (internalFilter.value) {
@@ -5679,11 +5676,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5679
5676
  setFilter(null, isNaN(inputValue) ? "" : inputValue.toString());
5680
5677
  }
5681
5678
  function setDateRangeFilter(value) {
5682
- var _a;
5683
5679
  let filterOutput;
5684
5680
  let preventEmit = false;
5685
5681
  if (internalFilter.value) {
5686
- preventEmit = ((_a = internalFilter.value) == null ? void 0 : _a.filterValue) === value;
5682
+ preventEmit = internalFilter.value?.filterValue === value;
5687
5683
  filterOutput = copy(internalFilter.value);
5688
5684
  filterOutput.filterValue = value ?? "";
5689
5685
  } else if (value !== null && typeof props.column.field !== "undefined") {
@@ -5709,6 +5705,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5709
5705
  setFilter(null, internalTextInputValue.value);
5710
5706
  }
5711
5707
  }
5708
+ function handleStringInputBlur(e) {
5709
+ const target = e.relatedTarget;
5710
+ if (target && target.closest("[clear-filters-button]")) {
5711
+ return;
5712
+ }
5713
+ immediateRequestOverride.value = true;
5714
+ setFilter(null, internalTextInputValue.value);
5715
+ }
5712
5716
  watch(() => currentFilterValue.value, () => {
5713
5717
  internalTextInputValue.value = currentFilterValue.value;
5714
5718
  }, {
@@ -5726,8 +5730,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5726
5730
  });
5727
5731
  const gridId = inject("cl-ui-grid-id") ?? "cl-ui-grid-filter";
5728
5732
  watch(() => props.filter, () => {
5729
- var _a;
5730
- if (((_a = props.filter) == null ? void 0 : _a.length) === 0) {
5733
+ if (props.filter?.length === 0) {
5731
5734
  selectedListEntryId.value = defaultEmptyListValue.id;
5732
5735
  }
5733
5736
  });
@@ -5738,7 +5741,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5738
5741
  _ctx.options.hideGridMobileView || isListColumn.value || _ctx.column.type === "boolean" || _ctx.column.type === "slot" && _ctx.column.slotType === "boolean" ? "cl:overflow-visible" : "cl:overflow-hidden cl:lg:overflow-visible!"
5739
5742
  ]])
5740
5743
  }, [
5741
- _ctx.column.type === "boolean" || _ctx.column.type === "slot" && _ctx.column.slotType === "boolean" ? (openBlock(), createBlock(_sfc_main$J, {
5744
+ _ctx.column.type === "boolean" || _ctx.column.type === "slot" && _ctx.column.slotType === "boolean" ? (openBlock(), createBlock(_sfc_main$I, {
5742
5745
  key: 0,
5743
5746
  id: `${unref(gridId)}-${_ctx.column.name}`,
5744
5747
  list: unref(booleanListEntries),
@@ -5746,10 +5749,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5746
5749
  class: "cl:bg-white cl:font-normal cl:min-h-0! cl:rounded-lg!",
5747
5750
  "model-value": booleanValueAsSelectItem.value,
5748
5751
  inert: _ctx.loading,
5749
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => setFilter(null, ($event == null ? void 0 : $event.value) ?? ""))
5752
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => setFilter(null, $event?.value ?? ""))
5750
5753
  }, {
5751
5754
  default: withCtx(({ select, option: option2, index: index2, highlightIndex, isSelected }) => [
5752
- createVNode(_sfc_main$I, {
5755
+ createVNode(_sfc_main$J, {
5753
5756
  class: "cl:py-0! cl:text-xs",
5754
5757
  "is-selected": isSelected(option2),
5755
5758
  "is-highlighted": index2 === highlightIndex,
@@ -5771,6 +5774,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5771
5774
  class: "cl:border-none cl:h-[2rem]! cl:lg:text-base! cl:mb-0 cl:pb-1 cl:text-xs cl:w-full readonly-filter",
5772
5775
  readonly: _ctx.loading,
5773
5776
  "popover-placement": "bottom-start",
5777
+ placeholder: "",
5774
5778
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => setFilter(null, $event ?? ""))
5775
5779
  }, null, 8, ["id", "model-value", "time-zone", "type", "readonly"])
5776
5780
  ])) : isDateRangeColumn.value ? (openBlock(), createElementBlock("div", {
@@ -5800,9 +5804,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5800
5804
  "allow-empty": true,
5801
5805
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $event !== null ? setNumberFilter(null, $event) : setFilter(null, ""))
5802
5806
  }, {
5803
- default: withCtx(() => _cache[9] || (_cache[9] = [
5807
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [
5804
5808
  createElementVNode("span", null, null, -1)
5805
- ])),
5809
+ ])]),
5806
5810
  _: 1
5807
5811
  }, 8, ["id", "model-value", "format", "precision", "readonly"])
5808
5812
  ])) : _ctx.column.type === "string" || _ctx.column.type === "slot" && _ctx.column.slotType === "string" ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
@@ -5815,14 +5819,15 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5815
5819
  ],
5816
5820
  class: "cl:border-none cl:font-normal cl:h-[2rem] cl:lg:text-base cl:px-3 cl:text-xs readonly-filter",
5817
5821
  readonly: _ctx.loading,
5818
- onKeySinglePress: handleKeySinglePress
5822
+ onKeySinglePress: handleKeySinglePress,
5823
+ onBlur: _cache[6] || (_cache[6] = ($event) => handleStringInputBlur($event))
5819
5824
  }, {
5820
- default: withCtx(() => _cache[10] || (_cache[10] = [
5825
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [
5821
5826
  createElementVNode("span", null, null, -1)
5822
- ])),
5827
+ ])]),
5823
5828
  _: 1
5824
5829
  }, 8, ["id", "modelValue", "readonly"])
5825
- ])) : isListColumn.value ? (openBlock(), createBlock(_sfc_main$J, {
5830
+ ])) : isListColumn.value ? (openBlock(), createBlock(_sfc_main$I, {
5826
5831
  key: 5,
5827
5832
  id: `${unref(gridId)}-${_ctx.column.name}`,
5828
5833
  list: listEntriesAsSelectItems.value,
@@ -5833,11 +5838,11 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5833
5838
  placeholder: selectAllCurrentlyHighlighted.value ? unref(t2)("grid.allEntriesSelected") : void 0,
5834
5839
  class: "cl:bg-white cl:font-normal! cl:max-h-52! cl:min-h-0! cl:placeholder:text-xs cl:rounded-lg! cl:text-xs",
5835
5840
  "is-grid-filter": true,
5836
- inert: _ctx.loading,
5837
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => updateListColumnSelectItems($event))
5841
+ readonly: _ctx.loading,
5842
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => updateListColumnSelectItems($event))
5838
5843
  }, {
5839
5844
  default: withCtx(({ select, option: option2, index: index2, highlightIndex, isSelected }) => [
5840
- createVNode(_sfc_main$I, {
5845
+ createVNode(_sfc_main$J, {
5841
5846
  "is-highlighted": index2 === highlightIndex,
5842
5847
  "is-selected": isSelected(option2),
5843
5848
  class: normalizeClass({
@@ -5853,22 +5858,22 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5853
5858
  }, 1032, ["is-highlighted", "is-selected", "class", "onSelect"])
5854
5859
  ]),
5855
5860
  _: 1
5856
- }, 8, ["id", "list", "model-value", "can-clear", "placeholder", "inert"])) : createCommentVNode("", true),
5861
+ }, 8, ["id", "list", "model-value", "can-clear", "placeholder", "readonly"])) : createCommentVNode("", true),
5857
5862
  !isDateRangeColumn.value ? (openBlock(), createBlock(_sfc_main$H, {
5858
5863
  key: 6,
5859
5864
  filter: currentFilter.value,
5860
- "onUpdate:filter": _cache[7] || (_cache[7] = ($event) => currentFilter.value = $event),
5865
+ "onUpdate:filter": _cache[8] || (_cache[8] = ($event) => currentFilter.value = $event),
5861
5866
  loading: _ctx.loading,
5862
5867
  column: _ctx.column,
5863
5868
  "default-operation": getDefaultFilterOperation(),
5864
5869
  "dropdown-position": _ctx.filterDropdownPosition,
5865
- onSelectionChanged: _cache[8] || (_cache[8] = ($event) => immediateRequestOverride.value = true)
5870
+ onSelectionChanged: _cache[9] || (_cache[9] = ($event) => immediateRequestOverride.value = true)
5866
5871
  }, null, 8, ["filter", "loading", "column", "default-operation", "dropdown-position"])) : createCommentVNode("", true)
5867
5872
  ], 2)) : createCommentVNode("", true);
5868
5873
  };
5869
5874
  }
5870
5875
  });
5871
- const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-4bb0f963"]]);
5876
+ const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-c5ef8bbf"]]);
5872
5877
  const _hoisted_1$y = { key: 1 };
5873
5878
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
5874
5879
  __name: "cl-ui-grid-filter",
@@ -5963,8 +5968,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
5963
5968
  }));
5964
5969
  });
5965
5970
  function isActiveSort(column, isAscending) {
5966
- var _a, _b;
5967
- return ((_a = currentRequest.value.sort) == null ? void 0 : _a.sortOnColumn) === column.field && ((_b = currentRequest.value.sort) == null ? void 0 : _b.sortByAscending) === isAscending;
5971
+ return currentRequest.value.sort?.sortOnColumn === column.field && currentRequest.value.sort?.sortByAscending === isAscending;
5968
5972
  }
5969
5973
  function setSort(field) {
5970
5974
  if (typeof field !== "undefined") {
@@ -6040,12 +6044,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6040
6044
  currentHandle = handle;
6041
6045
  const rect = currentHandle.getBoundingClientRect();
6042
6046
  const table = currentHandle.closest("table");
6043
- const tableRect = table == null ? void 0 : table.getBoundingClientRect();
6047
+ const tableRect = table?.getBoundingClientRect();
6044
6048
  const th = currentHandle.closest("th");
6045
- const thRect = th == null ? void 0 : th.getBoundingClientRect();
6046
- initialWidth = (thRect == null ? void 0 : thRect.width) ?? 0;
6049
+ const thRect = th?.getBoundingClientRect();
6050
+ initialWidth = thRect?.width ?? 0;
6047
6051
  rightResizeBarPosition.value = index2 === visibleColumns.value.length - 1 ? rect.right : rect.right - 5;
6048
- leftResizeBarPosition.value = (thRect == null ? void 0 : thRect.left) ?? 0;
6052
+ leftResizeBarPosition.value = thRect?.left ?? 0;
6049
6053
  if (tableRect) {
6050
6054
  resizeBarTop.value = tableRect.top;
6051
6055
  resizeBarHeight.value = tableRect.height;
@@ -6071,8 +6075,11 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6071
6075
  }
6072
6076
  });
6073
6077
  }
6078
+ const isFineTouchDevice = computed(() => {
6079
+ return window.matchMedia("(pointer: coarse)").matches === false;
6080
+ });
6074
6081
  const shouldEnableGlobalResizing = computed(() => {
6075
- return props.options.allowColumnResizing !== false && !isTouchDevice();
6082
+ return props.options.allowColumnResizing !== false && isFineTouchDevice.value;
6076
6083
  });
6077
6084
  const columnsWithResizing = computed(() => {
6078
6085
  return visibleColumns.value.map((column) => ({
@@ -6095,7 +6102,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6095
6102
  return (_ctx, _cache) => {
6096
6103
  return openBlock(), createElementBlock(Fragment, null, [
6097
6104
  createElementVNode("thead", {
6098
- class: normalizeClass(["cl:-top-1 cl:bg-white cl:z-20", [
6105
+ class: normalizeClass(["cl:-top-1 cl:bg-white cl:z-20 touch-none", [
6099
6106
  _ctx.options.hideGridMobileView ? "cl:relative" : "cl:shadow cl:sticky cl:lg:bg-transparent cl:lg:relative cl:lg:shadow-none"
6100
6107
  ]])
6101
6108
  }, [
@@ -6210,7 +6217,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6210
6217
  };
6211
6218
  })
6212
6219
  ]), 1032, ["loading", "initial-load", "bulk-edit-mode", "filter", "column", "time-zone", "quick-date-scope", "header-display-timezone", "options", "filter-dropdown-position"]),
6213
- !unref(isTouchDevice)() && _ctx.options.allowColumnResizing ? (openBlock(), createElementBlock("div", {
6220
+ _ctx.options.allowColumnResizing && isFineTouchDevice.value ? (openBlock(), createElementBlock("div", {
6214
6221
  key: 1,
6215
6222
  id: `resize-handle-${columnIndex}`,
6216
6223
  ref_for: true,
@@ -6282,20 +6289,18 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6282
6289
  ...currentRequest.value,
6283
6290
  filters
6284
6291
  };
6292
+ gridSearchInputRef.value?.focus();
6285
6293
  }
6286
6294
  watch(() => props.columns, () => performSearch(searchValue.value));
6287
6295
  const debouncedSearch = useDebounceFn((valueOrCancel) => {
6288
6296
  if (valueOrCancel !== false) {
6289
6297
  performSearch(valueOrCancel);
6290
6298
  }
6291
- }, 2e3);
6299
+ }, 3e3);
6292
6300
  const { t: t2 } = useI18n();
6293
6301
  const gridSearchInputRef = ref();
6294
6302
  __expose({
6295
- focusMegaSearch: () => {
6296
- var _a;
6297
- return (_a = gridSearchInputRef.value) == null ? void 0 : _a.focus();
6298
- }
6303
+ focusMegaSearch: () => gridSearchInputRef.value?.focus()
6299
6304
  });
6300
6305
  return (_ctx, _cache) => {
6301
6306
  const _component_icon = resolveComponent("icon");
@@ -6316,9 +6321,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6316
6321
  placeholder: _ctx.columns.length > 4 ? unref(t2)("grid.search") : unref(t2)("grid.searchSpecific", { columns: _ctx.columns.map((c) => unref(t2)(c.caption)).join(", ") }),
6317
6322
  onKeypress: _cache[2] || (_cache[2] = withKeys(($event) => performSearch(searchValue.value), ["enter"]))
6318
6323
  }, {
6319
- default: withCtx(() => _cache[4] || (_cache[4] = [
6324
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
6320
6325
  createElementVNode("span", null, null, -1)
6321
- ])),
6326
+ ])]),
6322
6327
  _: 1
6323
6328
  }, 8, ["modelValue", "readonly", "placeholder"])
6324
6329
  ]),
@@ -7033,7 +7038,7 @@ function _dispatchEvent(info) {
7033
7038
  }, info));
7034
7039
  }
7035
7040
  var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
7036
- var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
7041
+ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = (function() {
7037
7042
  if (!documentExists) return;
7038
7043
  if (IE11OrLess) {
7039
7044
  return false;
@@ -7041,7 +7046,7 @@ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely =
7041
7046
  var el = document.createElement("x");
7042
7047
  el.style.cssText = "pointer-events:auto";
7043
7048
  return el.style.pointerEvents === "auto";
7044
- }(), _detectDirection = function _detectDirection2(el, options) {
7049
+ })(), _detectDirection = function _detectDirection2(el, options) {
7045
7050
  var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
7046
7051
  if (elCSS.display === "flex") {
7047
7052
  return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
@@ -8715,7 +8720,6 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8715
8720
  }),
8716
8721
  emits: /* @__PURE__ */ mergeModels(["update:columns", "update:request", "data-request", "row-edit", "row-edit-cancelled", "edit-start", "edit-end", "row-select", "view-manager-visible", "clear-filters-clicked"], ["update:selectedRowIndex"]),
8717
8722
  setup(__props, { expose: __expose, emit: __emit }) {
8718
- var _a;
8719
8723
  const props = __props;
8720
8724
  const selectedRowIndex = useModel(__props, "selectedRowIndex");
8721
8725
  const emit = __emit;
@@ -8764,9 +8768,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8764
8768
  return width;
8765
8769
  }
8766
8770
  function setColumnStyles() {
8767
- var _a2;
8768
8771
  const result = {};
8769
- if (window.innerWidth >= 1024 || ((_a2 = props.options) == null ? void 0 : _a2.hideGridMobileView)) {
8772
+ if (window.innerWidth >= 1024 || props.options?.hideGridMobileView) {
8770
8773
  currentColumns.value.forEach((c) => {
8771
8774
  const value = c.customWidth ? `${c.customWidth}px` : c.width ? `${c.width}px` : "";
8772
8775
  result[`${c.name}`] = `width: ${value}; min-width: ${value};`;
@@ -8777,11 +8780,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8777
8780
  function getStyleForColumn(name) {
8778
8781
  return columnStyles.value[name] ?? "";
8779
8782
  }
8780
- function shouldSetBlankColumn() {
8783
+ const shouldSetBlankColumn = computed(() => {
8781
8784
  const columnWithNoWidthSet = visibleColumns.value.every((x) => x.width !== void 0 || x.customWidth !== void 0);
8782
8785
  const columnWidthDoesNotExceedGridWidth = visibleColumns.value.reduce((acc, x) => acc + (x.customWidth ?? x.width ?? 0), 0) < getGridWidth();
8783
8786
  return columnWithNoWidthSet && columnWidthDoesNotExceedGridWidth;
8784
- }
8787
+ });
8785
8788
  const currentRequest = computed({
8786
8789
  get: () => props.request,
8787
8790
  set: (value) => emit("update:request", value)
@@ -8795,12 +8798,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8795
8798
  emit("clear-filters-clicked");
8796
8799
  }
8797
8800
  function resetGrouping() {
8798
- var _a2;
8799
8801
  if (gridOptions.value.groupByField) {
8800
8802
  currentRequest.value = {
8801
8803
  ...currentRequest.value,
8802
8804
  sort: {
8803
- sortByAscending: ((_a2 = props.request.sort) == null ? void 0 : _a2.sortByAscending) ?? false,
8805
+ sortByAscending: props.request.sort?.sortByAscending ?? false,
8804
8806
  sortOnColumn: gridOptions.value.groupByField
8805
8807
  }
8806
8808
  };
@@ -8819,7 +8821,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8819
8821
  immediate: true
8820
8822
  });
8821
8823
  const gridData = computed(() => props.data);
8822
- const internalEditMode = ref(false);
8824
+ const internalEditMode = ref(props.options.forceEditMode ?? false);
8823
8825
  const editMode = computed({
8824
8826
  get: () => props.options.forceEditMode || internalEditMode.value,
8825
8827
  set(value) {
@@ -8851,7 +8853,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8851
8853
  };
8852
8854
  }
8853
8855
  });
8854
- const searchValue = ref(((_a = props.request.filters.find((f) => f.filterMethod === "andcontains" || f.filterOperation === FilterOperation.AND_CONTAINS)) == null ? void 0 : _a.filterValue) ?? "");
8856
+ const searchValue = ref(props.request.filters.find((f) => f.filterMethod === "andcontains" || f.filterOperation === FilterOperation.AND_CONTAINS)?.filterValue ?? "");
8855
8857
  const searchableColumns = computed(() => props.columns.filter((c) => (c.type === "string" || c.type === "slot" && c.slotType === "string") && c.searchable));
8856
8858
  watch(() => props.loading, () => {
8857
8859
  isInitialLoad.value = false;
@@ -8866,29 +8868,20 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8866
8868
  watch(() => props.data, () => {
8867
8869
  setPageNumberIfPageNumberExceedsAvailablePages();
8868
8870
  function setPageNumberIfPageNumberExceedsAvailablePages() {
8869
- var _a2;
8870
- if (((_a2 = props.data) == null ? void 0 : _a2.results.length) === 0 && currentRequest.value.pageNumber > 1) {
8871
+ if (props.data?.results.length === 0 && currentRequest.value.pageNumber > 1) {
8871
8872
  currentRequest.value.pageNumber = props.data.totalRecords > 0 ? Math.ceil(props.data.totalRecords / currentRequest.value.pageSize) : 1;
8872
8873
  }
8873
8874
  }
8874
8875
  });
8875
8876
  function changeColumnWidth(columnIndex, newWidth) {
8876
- if (visibleColumns.value[columnIndex].width && visibleColumns.value[columnIndex].width < newWidth) {
8877
- visibleColumns.value[columnIndex].customWidth = newWidth;
8878
- } else if (visibleColumns.value[columnIndex].width && visibleColumns.value[columnIndex].width > newWidth) {
8879
- visibleColumns.value[columnIndex].customWidth = void 0;
8880
- } else {
8881
- visibleColumns.value[columnIndex].customWidth = newWidth;
8882
- }
8877
+ visibleColumns.value[columnIndex].customWidth = newWidth;
8883
8878
  setColumnStyles();
8884
8879
  }
8885
8880
  watch(() => props.options.groupByField, resetGrouping, { immediate: true });
8881
+ watch(() => props.columns, setColumnStyles, { deep: true });
8886
8882
  const gridSearchRef = ref();
8887
8883
  __expose({
8888
- focusMegaSearch: () => {
8889
- var _a2;
8890
- return (_a2 = gridSearchRef.value) == null ? void 0 : _a2.focusMegaSearch();
8891
- }
8884
+ focusMegaSearch: () => gridSearchRef.value?.focusMegaSearch()
8892
8885
  });
8893
8886
  return (_ctx, _cache) => {
8894
8887
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
@@ -8964,7 +8957,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8964
8957
  span: 1
8965
8958
  }, null, 4);
8966
8959
  }), 128)),
8967
- shouldSetBlankColumn() ? (openBlock(), createElementBlock("col", _hoisted_4$a)) : createCommentVNode("", true)
8960
+ shouldSetBlankColumn.value ? (openBlock(), createElementBlock("col", _hoisted_4$a)) : createCommentVNode("", true)
8968
8961
  ], 2),
8969
8962
  createVNode(_sfc_main$E, {
8970
8963
  request: headerRequest.value,
@@ -9184,8 +9177,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
9184
9177
  const request = useModel(__props, "request");
9185
9178
  const { t: t2 } = useI18n();
9186
9179
  function isActiveSort(column, isAscending) {
9187
- var _a, _b;
9188
- return ((_a = request.value.sort) == null ? void 0 : _a.sortOnColumn) === column.field && ((_b = request.value.sort) == null ? void 0 : _b.sortByAscending) === isAscending;
9180
+ return request.value.sort?.sortOnColumn === column.field && request.value.sort?.sortByAscending === isAscending;
9189
9181
  }
9190
9182
  function setSort(field) {
9191
9183
  if (typeof field !== "undefined") {
@@ -9341,13 +9333,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
9341
9333
  const isSmallGrid = computed(() => props.options.smallGridText ?? false);
9342
9334
  const isAlternatingRows = computed(() => props.options.alternatingRows ?? false);
9343
9335
  return (_ctx, _cache) => {
9344
- var _a;
9345
9336
  return openBlock(), createElementBlock("div", _hoisted_1$q, [
9346
9337
  _ctx.initialLoad && _ctx.pageSize > 0 ? (openBlock(), createBlock(_sfc_main$y, {
9347
9338
  key: 0,
9348
9339
  "page-size": _ctx.pageSize,
9349
9340
  "column-count": _ctx.columns.length
9350
- }, null, 8, ["page-size", "column-count"])) : (((_a = _ctx.data) == null ? void 0 : _a.results.length) ?? 0) < 1 && _ctx.initialLoad === false ? (openBlock(), createElementBlock("div", {
9341
+ }, null, 8, ["page-size", "column-count"])) : (_ctx.data?.results.length ?? 0) < 1 && _ctx.initialLoad === false ? (openBlock(), createElementBlock("div", {
9351
9342
  key: 1,
9352
9343
  class: normalizeClass(["cl:col-[1_/_-1] cl:text-center cl:w-full", [
9353
9344
  isSmallGrid.value ? "cl:p-1" : "cl:p-2"
@@ -9414,11 +9405,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9414
9405
  let date;
9415
9406
  if (props.timeZone) {
9416
9407
  date = DateTime.fromISO(value, {
9417
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value
9408
+ locale: dateFormatLocaleOverride?.value ?? locale2.value
9418
9409
  }).setZone(props.timeZone);
9419
9410
  } else {
9420
9411
  date = DateTime.fromISO(value, {
9421
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value,
9412
+ locale: dateFormatLocaleOverride?.value ?? locale2.value,
9422
9413
  zone: "UTC"
9423
9414
  });
9424
9415
  }
@@ -9479,7 +9470,6 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9479
9470
  }
9480
9471
  }
9481
9472
  return (_ctx, _cache) => {
9482
- var _a;
9483
9473
  return openBlock(), createElementBlock("div", mergeProps({
9484
9474
  class: [
9485
9475
  _ctx.isSmallGrid ? "cl:px-1 cl:py-1.5 cl:text-xs" : "cl:p-2 cl:text-sm"
@@ -9506,7 +9496,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9506
9496
  key: 3,
9507
9497
  id: unref(id),
9508
9498
  class: "cl:inline-block cl:whitespace-nowrap"
9509
- }, toDisplayString(unref(t2)(((_a = _ctx.column.listEntries.find((entry) => entry.value === _ctx.data[_ctx.column.field])) == null ? void 0 : _a.translationKey) ?? "")), 9, _hoisted_2$h)) : _ctx.column.type === "number" && _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", {
9499
+ }, toDisplayString(unref(t2)(_ctx.column.listEntries.find((entry) => entry.value === _ctx.data[_ctx.column.field])?.translationKey ?? "")), 9, _hoisted_2$h)) : _ctx.column.type === "number" && _ctx.column.field !== void 0 ? (openBlock(), createElementBlock("span", {
9510
9500
  key: 4,
9511
9501
  id: unref(id),
9512
9502
  class: "cl:inline-block cl:whitespace-nowrap"
@@ -9523,13 +9513,13 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9523
9513
  const _sfc_main$u = {};
9524
9514
  const _hoisted_1$o = { class: "cl:border cl:border-off-white cl:border-t cl:flex cl:justify-between cl:p-2" };
9525
9515
  function _sfc_render$2(_ctx, _cache) {
9526
- return openBlock(), createElementBlock("div", _hoisted_1$o, _cache[0] || (_cache[0] = [
9516
+ return openBlock(), createElementBlock("div", _hoisted_1$o, [..._cache[0] || (_cache[0] = [
9527
9517
  createElementVNode("div", { class: "cl:flex cl:gap-2 cl:w-full" }, [
9528
9518
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-3/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   "),
9529
9519
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-1/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   ")
9530
9520
  ], -1),
9531
9521
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-1/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   ", -1)
9532
- ]));
9522
+ ])]);
9533
9523
  }
9534
9524
  const clUiGridLiteFooterSkeleton = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$2]]);
9535
9525
  const _hoisted_1$n = { class: "cl:flex cl:gap-4" };
@@ -9562,10 +9552,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9562
9552
  const props = __props;
9563
9553
  const request = useModel(__props, "request");
9564
9554
  const { t: t2 } = useI18n();
9565
- const totalPages = computed(() => {
9566
- var _a;
9567
- return props.data !== null ? Math.ceil((((_a = props.data) == null ? void 0 : _a.totalRecords) ?? 0) / request.value.pageSize) : 1;
9568
- });
9555
+ const totalPages = computed(() => props.data !== null ? Math.ceil((props.data?.totalRecords ?? 0) / request.value.pageSize) : 1);
9569
9556
  const pageNumbers = computed(() => {
9570
9557
  const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
9571
9558
  let results = [];
@@ -9579,7 +9566,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9579
9566
  });
9580
9567
  function setPage(pageNumber) {
9581
9568
  const filterRequest = copy(request.value);
9582
- pageNumber ?? (pageNumber = 1);
9569
+ pageNumber ??= 1;
9583
9570
  if (filterRequest.pageNumber !== pageNumber) {
9584
9571
  filterRequest.pageNumber = Math.max(Math.min(Math.trunc(pageNumber), totalPages.value), 1);
9585
9572
  request.value = filterRequest;
@@ -9592,10 +9579,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9592
9579
  50
9593
9580
  ];
9594
9581
  const availablePageSizes = computed(() => {
9595
- return pageSizes.filter((size) => {
9596
- var _a;
9597
- return size <= (((_a = props.data) == null ? void 0 : _a.totalRecords) ?? 0);
9598
- });
9582
+ return pageSizes.filter((size) => size <= (props.data?.totalRecords ?? 0));
9599
9583
  });
9600
9584
  function setPageSize(pageSize) {
9601
9585
  const filterRequest = copy(request.value);
@@ -9604,9 +9588,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9604
9588
  request.value = filterRequest;
9605
9589
  }
9606
9590
  return (_ctx, _cache) => {
9607
- var _a;
9608
9591
  const _component_icon = resolveComponent("icon");
9609
- return _ctx.initialLoad ? (openBlock(), createBlock(clUiGridLiteFooterSkeleton, { key: 0 })) : ((_a = _ctx.data) == null ? void 0 : _a.results.length) && request.value && totalPages.value > 1 ? (openBlock(), createElementBlock("div", {
9592
+ return _ctx.initialLoad ? (openBlock(), createBlock(clUiGridLiteFooterSkeleton, { key: 0 })) : _ctx.data?.results.length && request.value && totalPages.value > 1 ? (openBlock(), createElementBlock("div", {
9610
9593
  key: 1,
9611
9594
  class: normalizeClass(["cl:border-off-white cl:border-t cl:flex cl:flex-wrap cl:gap-y-2 cl:justify-between cl:p-2 cl:text-grey-4", [
9612
9595
  _ctx.options.smallGridText ? "cl:px-1 cl:py-1.5 cl:text-xs" : "cl:p-2 cl:text-sm"
@@ -9832,7 +9815,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9832
9815
  placeholder: { default: null },
9833
9816
  initialDate: { default: null },
9834
9817
  quickDateScope: { default: null },
9835
- dateFormatLocale: { default: null }
9818
+ dateFormatLocale: { default: null },
9819
+ showWeekNumbers: { type: Boolean, default: true }
9836
9820
  },
9837
9821
  emits: ["update:date"],
9838
9822
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -9905,8 +9889,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9905
9889
  const showQuickDates = useMediaQuery("(min-height: 800px)");
9906
9890
  __expose({
9907
9891
  focus() {
9908
- var _a;
9909
- (_a = input.value) == null ? void 0 : _a.focus();
9892
+ input.value?.focus();
9910
9893
  }
9911
9894
  });
9912
9895
  return (_ctx, _cache) => {
@@ -9958,6 +9941,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9958
9941
  "min-date": _ctx.min,
9959
9942
  "max-date": _ctx.max,
9960
9943
  "initial-page": currentInitialDate.value,
9944
+ "show-weeknumbers": _ctx.showWeekNumbers,
9961
9945
  onDayclick: _cache[4] || (_cache[4] = ($event) => currentQuickDate.value = null)
9962
9946
  }, {
9963
9947
  default: withCtx(({ togglePopover }) => [
@@ -9988,7 +9972,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9988
9972
  }, null, 8, ["scope", "selected-quick-date", "current-date-range"])) : createCommentVNode("", true)
9989
9973
  ]),
9990
9974
  _: 1
9991
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])) : (openBlock(), createBlock(unref(DatePicker), {
9975
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "columns", "popover", "min-date", "max-date", "initial-page", "show-weeknumbers"])) : (openBlock(), createBlock(unref(DatePicker), {
9992
9976
  key: 2,
9993
9977
  modelValue: currentDate.value,
9994
9978
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => currentDate.value = $event),
@@ -10003,6 +9987,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10003
9987
  "update-on-input": false,
10004
9988
  masks: { L: mask.value, inputDateTime: [mask.value], inputDateTime24hr: [mask.value] },
10005
9989
  color: "primary",
9990
+ "show-weeknumbers": _ctx.showWeekNumbers,
10006
9991
  "title-position": "left",
10007
9992
  "hide-time-header": "",
10008
9993
  popover: popover.value
@@ -10022,7 +10007,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10022
10007
  }), null, 16, ["date", "events", "type", "placeholder", "required", "disabled"])
10023
10008
  ]),
10024
10009
  _: 1
10025
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "popover"]));
10010
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "show-weeknumbers", "popover"]));
10026
10011
  };
10027
10012
  }
10028
10013
  });
@@ -10096,12 +10081,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
10096
10081
  );
10097
10082
  __expose({
10098
10083
  focus() {
10099
- var _a;
10100
- (_a = inputRef.value) == null ? void 0 : _a.focus();
10084
+ inputRef.value?.focus();
10101
10085
  },
10102
10086
  blur() {
10103
- var _a;
10104
- (_a = inputRef.value) == null ? void 0 : _a.blur();
10087
+ inputRef.value?.blur();
10105
10088
  }
10106
10089
  });
10107
10090
  return (_ctx, _cache) => {
@@ -10183,8 +10166,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10183
10166
  const showNumericInput = ref(false);
10184
10167
  __expose({
10185
10168
  focus() {
10186
- var _a;
10187
- (_a = sliderRef.value) == null ? void 0 : _a.focus();
10169
+ sliderRef.value?.focus();
10188
10170
  }
10189
10171
  });
10190
10172
  return (_ctx, _cache) => {
@@ -10213,9 +10195,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10213
10195
  disabled: _ctx.disabled,
10214
10196
  placeholder: _ctx.placeholder
10215
10197
  }, {
10216
- default: withCtx(() => _cache[5] || (_cache[5] = [
10198
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
10217
10199
  createElementVNode("span", null, null, -1)
10218
- ])),
10200
+ ])]),
10219
10201
  _: 1
10220
10202
  }, 8, ["modelValue", "format", "precision", "min", "max", "step", "disabled", "placeholder"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
10221
10203
  withDirectives(createElementVNode("input", {
@@ -10390,7 +10372,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10390
10372
  initialDate: { default: null },
10391
10373
  quickDateScope: { default: null },
10392
10374
  dateFormatLocale: { default: null },
10393
- currencyOptions: { default: void 0 }
10375
+ currencyOptions: { default: void 0 },
10376
+ showWeekNumbers: { type: Boolean, default: true }
10394
10377
  },
10395
10378
  emits: ["update:model-value", "click", "focus", "input", "change", "validated"],
10396
10379
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -10401,9 +10384,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10401
10384
  const focused = ref(false);
10402
10385
  const lostFocus = ref(false);
10403
10386
  const showRequiredAsterisk = computed(() => {
10404
- var _a;
10405
10387
  let showAsterisk = props.isRequired;
10406
- if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "" && props.requiredText.trim() !== "") {
10388
+ if (lostFocus.value && currentValue.value?.toString().trim() === "" && props.requiredText.trim() !== "") {
10407
10389
  showAsterisk = false;
10408
10390
  }
10409
10391
  return !props.hideRequiredAsterisk && showAsterisk;
@@ -10427,10 +10409,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10427
10409
  const displayValidationMessage = ref(true);
10428
10410
  const internalErrors = ref([]);
10429
10411
  const errors = computed(() => {
10430
- var _a, _b;
10431
10412
  return [
10432
- ...((_a = internalErrors.value) == null ? void 0 : _a.filter((e) => ((e == null ? void 0 : e.length) ?? 0) > 0)) ?? [],
10433
- ...((_b = props.externalErrors) == null ? void 0 : _b.filter((e) => ((e == null ? void 0 : e.length) ?? 0) > 0)) ?? []
10413
+ ...internalErrors.value?.filter((e) => (e?.length ?? 0) > 0) ?? [],
10414
+ ...props.externalErrors?.filter((e) => (e?.length ?? 0) > 0) ?? []
10434
10415
  ].join("\n");
10435
10416
  });
10436
10417
  const currencyInputOptions = computed(() => {
@@ -10591,19 +10572,17 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10591
10572
  );
10592
10573
  __expose({
10593
10574
  focus() {
10594
- var _a, _b;
10595
10575
  if (props.inputType === "currency") {
10596
- (_a = currencyInputRef == null ? void 0 : currencyInputRef.value) == null ? void 0 : _a.focus();
10576
+ currencyInputRef?.value?.focus();
10597
10577
  } else {
10598
- (_b = inputElement.value) == null ? void 0 : _b.focus();
10578
+ inputElement.value?.focus();
10599
10579
  }
10600
10580
  },
10601
10581
  blur() {
10602
- var _a, _b;
10603
10582
  if (props.inputType === "currency") {
10604
- (_a = currencyInputRef == null ? void 0 : currencyInputRef.value) == null ? void 0 : _a.blur();
10583
+ currencyInputRef?.value?.blur();
10605
10584
  } else {
10606
- (_b = inputElement.value) == null ? void 0 : _b.blur();
10585
+ inputElement.value?.blur();
10607
10586
  }
10608
10587
  }
10609
10588
  });
@@ -10728,9 +10707,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10728
10707
  "initial-date": _ctx.initialDate,
10729
10708
  "quick-date-scope": _ctx.quickDateScope,
10730
10709
  "date-format-locale": _ctx.dateFormatLocale,
10710
+ "show-week-numbers": _ctx.showWeekNumbers,
10731
10711
  onBlur: onLostFocus,
10732
10712
  onFocus: _cache[10] || (_cache[10] = ($event) => emit("focus"))
10733
- }), null, 16, ["date", "class", "disabled", "required", "type", "time-zone", "min", "max", "placeholder", "initial-date", "quick-date-scope", "date-format-locale"])) : _ctx.inputType === "range" && typeof currentValue.value === "number" ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
10713
+ }), null, 16, ["date", "class", "disabled", "required", "type", "time-zone", "min", "max", "placeholder", "initial-date", "quick-date-scope", "date-format-locale", "show-week-numbers"])) : _ctx.inputType === "range" && typeof currentValue.value === "number" ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
10734
10714
  createVNode(unref(clUiSlider), {
10735
10715
  ref_key: "inputElement",
10736
10716
  ref: inputElement,
@@ -10753,7 +10733,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10753
10733
  };
10754
10734
  }
10755
10735
  });
10756
- const clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-dec34b48"]]);
10736
+ const clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-833e892c"]]);
10757
10737
  const inputTypes = [
10758
10738
  "button",
10759
10739
  "checkbox",
@@ -10992,9 +10972,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
10992
10972
  placeholder: unref(t2)("login.email"),
10993
10973
  autocomplete: "username"
10994
10974
  }, {
10995
- default: withCtx(() => _cache[4] || (_cache[4] = [
10975
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
10996
10976
  createElementVNode("span", null, null, -1)
10997
- ])),
10977
+ ])]),
10998
10978
  _: 1
10999
10979
  }, 8, ["modelValue", "class", "errors", "placeholder"]),
11000
10980
  usernameValid.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(unref(t2)("login.validEmail")), 1)) : createCommentVNode("", true)
@@ -11035,9 +11015,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11035
11015
  placeholder: unref(t2)("login.password"),
11036
11016
  autocomplete: "current-password"
11037
11017
  }, {
11038
- default: withCtx(() => _cache[5] || (_cache[5] = [
11018
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
11039
11019
  createElementVNode("span", null, null, -1)
11040
- ])),
11020
+ ])]),
11041
11021
  _: 1
11042
11022
  }, 8, ["modelValue", "class", "type", "placeholder"])
11043
11023
  ])
@@ -11058,22 +11038,19 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11058
11038
  ])
11059
11039
  ], 2),
11060
11040
  createVNode(Transition, { name: "cl:grow-down" }, {
11061
- default: withCtx(() => {
11062
- var _a;
11063
- return [
11064
- withDirectives(createElementVNode("span", _hoisted_13, [
11065
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.errors, (error, index2) => {
11066
- return openBlock(), createElementBlock("div", {
11067
- id: "cl-ui-login-errors",
11068
- key: index2,
11069
- class: "cl:font-semibold"
11070
- }, toDisplayString(error), 1);
11071
- }), 128))
11072
- ], 512), [
11073
- [vShow, (_a = _ctx.errors) == null ? void 0 : _a.length]
11074
- ])
11075
- ];
11076
- }),
11041
+ default: withCtx(() => [
11042
+ withDirectives(createElementVNode("span", _hoisted_13, [
11043
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.errors, (error, index2) => {
11044
+ return openBlock(), createElementBlock("div", {
11045
+ id: "cl-ui-login-errors",
11046
+ key: index2,
11047
+ class: "cl:font-semibold"
11048
+ }, toDisplayString(error), 1);
11049
+ }), 128))
11050
+ ], 512), [
11051
+ [vShow, _ctx.errors?.length]
11052
+ ])
11053
+ ]),
11077
11054
  _: 1
11078
11055
  })
11079
11056
  ])
@@ -11132,7 +11109,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
11132
11109
  }
11133
11110
  });
11134
11111
  }
11135
- emit("open-state", !!(group == null ? void 0 : group.open), groupID);
11112
+ emit("open-state", !!group?.open, groupID);
11136
11113
  }
11137
11114
  const size = useWindowSize();
11138
11115
  watch(
@@ -11490,9 +11467,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
11490
11467
  }
11491
11468
  });
11492
11469
  function handleDrop(payload) {
11493
- var _a;
11494
11470
  if (props.disabled === false) {
11495
- const filesUploaded = [...(_a = payload == null ? void 0 : payload.dataTransfer) == null ? void 0 : _a.files];
11471
+ const filesUploaded = [...payload?.dataTransfer?.files];
11496
11472
  validateAndEmitFiles(filesUploaded);
11497
11473
  }
11498
11474
  }
@@ -11653,9 +11629,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11653
11629
  }
11654
11630
  }
11655
11631
  const canDeselect = computed(() => {
11656
- var _a;
11657
11632
  if (Array.isArray(currentSelection.value)) {
11658
- return props.required === false || (((_a = currentSelection.value) == null ? void 0 : _a.length) ?? 0) > 1;
11633
+ return props.required === false || (currentSelection.value?.length ?? 0) > 1;
11659
11634
  } else {
11660
11635
  return !props.required;
11661
11636
  }
@@ -12076,14 +12051,13 @@ function concatenatePath(...fragments) {
12076
12051
  return fragments.map((f) => f.replace(/ /g, "_")).join(" ");
12077
12052
  }
12078
12053
  function findNodeByPath(rootNodes, path) {
12079
- var _a;
12080
12054
  const pathFragments = path.split(" ");
12081
12055
  let currentNode = void 0;
12082
12056
  for (const fragment of pathFragments) {
12083
12057
  if (!currentNode) {
12084
12058
  currentNode = rootNodes.find((node) => node.id === fragment);
12085
12059
  } else {
12086
- currentNode = (_a = currentNode.children) == null ? void 0 : _a.find((node) => node.id === fragment);
12060
+ currentNode = currentNode.children?.find((node) => node.id === fragment);
12087
12061
  }
12088
12062
  if (!currentNode) {
12089
12063
  break;
@@ -12118,7 +12092,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12118
12092
  }),
12119
12093
  emits: /* @__PURE__ */ mergeModels(["recalculate-tree-path", "set-child-node-height"], ["update:selectedPath"]),
12120
12094
  setup(__props, { emit: __emit }) {
12121
- var _a;
12122
12095
  const props = __props;
12123
12096
  const selectedPath = useModel(__props, "selectedPath");
12124
12097
  const emit = __emit;
@@ -12130,7 +12103,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12130
12103
  const childSubtreeDivs = ref([]);
12131
12104
  const childSubtreeHeights = computed(() => childSubtreeDivs.value.map((el) => useElementSize(el)));
12132
12105
  const childSubtreeBoundingBoxes = computed(() => childSubtreeDivs.value.map((el) => useElementBounding(el)));
12133
- const childNodeContentHeights = ref(new Array(((_a = props.rootNode.children) == null ? void 0 : _a.length) ?? 0).fill(0));
12106
+ const childNodeContentHeights = ref(new Array(props.rootNode.children?.length ?? 0).fill(0));
12134
12107
  const treePathBranchesAt = ref([]);
12135
12108
  function recalculateTreePathBranches() {
12136
12109
  nodeContentBoundingBox.update();
@@ -12366,8 +12339,8 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
12366
12339
  clUiNotification: _sfc_main$1e,
12367
12340
  clUiRadio: _sfc_main$9,
12368
12341
  clUiRadioGroup: _sfc_main$8,
12369
- clUiSelect: _sfc_main$J,
12370
- clUiSelectOption: _sfc_main$I,
12342
+ clUiSelect: _sfc_main$I,
12343
+ clUiSelectOption: _sfc_main$J,
12371
12344
  clUiTab: _sfc_main$f,
12372
12345
  clUiTabContent: _sfc_main$d,
12373
12346
  clUiTabHeader: _sfc_main$e,
@@ -12465,8 +12438,8 @@ export {
12465
12438
  _sfc_main$1e as clUiNotification,
12466
12439
  _sfc_main$9 as clUiRadio,
12467
12440
  _sfc_main$8 as clUiRadioGroup,
12468
- _sfc_main$J as clUiSelect,
12469
- _sfc_main$I as clUiSelectOption,
12441
+ _sfc_main$I as clUiSelect,
12442
+ _sfc_main$J as clUiSelectOption,
12470
12443
  _sfc_main$f as clUiTab,
12471
12444
  _sfc_main$d as clUiTabContent,
12472
12445
  _sfc_main$e as clUiTabHeader,