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

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,19 +2952,12 @@ 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) => {
@@ -3061,7 +3003,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
3061
3003
  ]
3062
3004
  }, [
3063
3005
  createVNode(_component_icon, { icon: "ph:caret-up-bold" })
3064
- ], 40, _hoisted_3$l),
3006
+ ], 40, _hoisted_3$m),
3065
3007
  createElementVNode("button", {
3066
3008
  class: "cl:bg-secondary-light/30 cl:border cl:border-grey-3 cl:hover:bg-secondary-light/20 cl:px-1 cl:rounded",
3067
3009
  disabled: _ctx.disabled,
@@ -3103,7 +3045,7 @@ const _hoisted_1$I = {
3103
3045
  class: "cl:flex cl:flex-col cl:lg:flex-row cl:lg:gap-2"
3104
3046
  };
3105
3047
  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" };
3048
+ 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
3049
  const _hoisted_4$f = ["inert"];
3108
3050
  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
3051
  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 +3085,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3143
3085
  const props = __props;
3144
3086
  const emit = __emit;
3145
3087
  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
- });
3088
+ const totalPages = computed(() => props.data !== null ? Math.ceil((props.data?.totalRecords ?? 0) / props.request.pageSize) : 1);
3150
3089
  const pageNumbers = computed(() => {
3151
3090
  const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
3152
3091
  let results = [];
@@ -3161,7 +3100,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3161
3100
  function setPage(pageNumber) {
3162
3101
  if (props.showUnsavedChangesWarning === false || window.confirm(t2("grid.unsavedChangesWarningMessage"))) {
3163
3102
  const filterRequest = copy(props.request);
3164
- pageNumber ?? (pageNumber = 1);
3103
+ pageNumber ??= 1;
3165
3104
  if (filterRequest.pageNumber !== pageNumber) {
3166
3105
  filterRequest.pageNumber = Math.max(Math.min(Math.trunc(pageNumber), totalPages.value), 1);
3167
3106
  emit("update:request", filterRequest);
@@ -3185,7 +3124,6 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3185
3124
  }
3186
3125
  }
3187
3126
  return (_ctx, _cache) => {
3188
- var _a, _b, _c;
3189
3127
  return _ctx.initialLoad ? (openBlock(), createElementBlock("div", _hoisted_1$I, [
3190
3128
  createElementVNode("div", _hoisted_2$x, [
3191
3129
  createVNode(unref(_sfc_main$$), { words: 3 }),
@@ -3194,10 +3132,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3194
3132
  words: 2
3195
3133
  })
3196
3134
  ]),
3197
- createElementVNode("div", _hoisted_3$k, [
3135
+ createElementVNode("div", _hoisted_3$l, [
3198
3136
  createVNode(unref(clUiSkeletonInput), { class: "cl:w-64" })
3199
3137
  ])
3200
- ])) : _ctx.loading || ((_b = (_a = _ctx.data) == null ? void 0 : _a.results) == null ? void 0 : _b.length) && _ctx.request ? (openBlock(), createElementBlock("div", {
3138
+ ])) : _ctx.loading || _ctx.data?.results?.length && _ctx.request ? (openBlock(), createElementBlock("div", {
3201
3139
  key: 1,
3202
3140
  class: normalizeClass(["cl:flex cl:flex-wrap cl:lg:gap-2", {
3203
3141
  "cl:opacity-40": _ctx.loading
@@ -3213,7 +3151,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3213
3151
  ]),
3214
3152
  createElementVNode("div", _hoisted_10$3, [
3215
3153
  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)
3154
+ createElementVNode("span", null, toDisplayString(unref(formatNumberAsInteger)(_ctx.data?.totalRecords ?? 0)), 1)
3217
3155
  ]),
3218
3156
  _ctx.options.hidePageSizeOptions === false ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
3219
3157
  createElementVNode("span", _hoisted_13$1, toDisplayString(unref(t2)("grid.pageSize")), 1),
@@ -3311,9 +3249,9 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3311
3249
  autocomplete: "off",
3312
3250
  "onUpdate:modelValue": setPage
3313
3251
  }, {
3314
- default: withCtx(() => _cache[4] || (_cache[4] = [
3252
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
3315
3253
  createElementVNode("span", null, null, -1)
3316
- ])),
3254
+ ])]),
3317
3255
  _: 1
3318
3256
  }, 8, ["model-value", "max", "disabled"])
3319
3257
  ])
@@ -3418,9 +3356,12 @@ function convertDateToIsoString(dateToConvert, forcedTimeOfDay, includeOffset, s
3418
3356
  } else if (forcedTimeOfDay === "end") {
3419
3357
  returnValueDate = returnValueDate.endOf("day").set({ millisecond: 0 });
3420
3358
  }
3421
- let returnValue = returnValueDate.toISO({ includeOffset });
3359
+ let returnValue = returnValueDate.toISO({
3360
+ includeOffset,
3361
+ suppressMilliseconds: true
3362
+ });
3422
3363
  if (selectedTimeZone === null) {
3423
- returnValue = (returnValue == null ? void 0 : returnValue.replace("Z", "")) ?? null;
3364
+ returnValue = returnValue?.replace("Z", "") ?? null;
3424
3365
  }
3425
3366
  return returnValue;
3426
3367
  }
@@ -3586,12 +3527,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
3586
3527
  return (_ctx, _cache) => {
3587
3528
  return openBlock(), createElementBlock("div", _hoisted_1$H, [
3588
3529
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dates, (date, index2) => {
3589
- var _a, _b;
3590
3530
  return openBlock(), createElementBlock("button", {
3591
3531
  key: index2,
3592
3532
  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
3533
+ "cl:bg-primary-lighter/30 cl:border-primary-default cl:font-bold cl:hover:border-primary-darker": _ctx.selectedQuickDate?.name === date.name,
3534
+ "cl:border-grey-2 cl:hover:border-grey-3 cl:hover:opacity-95 cl:opacity-60": _ctx.selectedQuickDate?.name !== date.name
3595
3535
  }]),
3596
3536
  onClick: ($event) => emit("quick-date-selected", date)
3597
3537
  }, [
@@ -3831,14 +3771,8 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3831
3771
  }
3832
3772
  }
3833
3773
  __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
- }
3774
+ focus: () => inputRef.value?.focus(),
3775
+ blur: () => inputRef.value?.blur()
3842
3776
  });
3843
3777
  return (_ctx, _cache) => {
3844
3778
  return openBlock(), createBlock(_sfc_main$19, {
@@ -3885,7 +3819,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3885
3819
  });
3886
3820
  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
3821
  const _hoisted_2$u = ["disabled"];
3888
- const _hoisted_3$j = { class: "cl:max-w-max" };
3822
+ const _hoisted_3$k = { class: "cl:max-w-max" };
3889
3823
  const _hoisted_4$e = { class: "cl:flex cl:flex-col cl:gap-1 cl:w-full" };
3890
3824
  const _hoisted_5$9 = ["min", "disabled", "required", "step", "max"];
3891
3825
  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 +3859,12 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3925
3859
  const showRegularInput = ref(false);
3926
3860
  const displayValue = useThrottle(value, 50);
3927
3861
  function setValueAndFocus(newValue) {
3928
- var _a;
3929
3862
  value.value = newValue;
3930
- (_a = sliderRef.value) == null ? void 0 : _a.focus();
3863
+ sliderRef.value?.focus();
3931
3864
  }
3932
3865
  __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
- }
3866
+ focus: () => sliderRef.value?.focus() || inputRef.value?.focus(),
3867
+ blur: () => sliderRef.value?.blur() || inputRef.value?.blur()
3941
3868
  });
3942
3869
  return (_ctx, _cache) => {
3943
3870
  const _component_icon = resolveComponent("icon");
@@ -3952,7 +3879,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3952
3879
  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
3880
  onClick: _cache[0] || (_cache[0] = ($event) => setValueAndFocus(_ctx.min))
3954
3881
  }, toDisplayString(unref(formatNumberAsDecimal)(_ctx.min, _ctx.precision)), 9, _hoisted_2$u),
3955
- createElementVNode("div", _hoisted_3$j, [
3882
+ createElementVNode("div", _hoisted_3$k, [
3956
3883
  withDirectives(createElementVNode("div", _hoisted_4$e, [
3957
3884
  withDirectives(createElementVNode("input", mergeProps({
3958
3885
  ref_key: "sliderRef",
@@ -4133,15 +4060,15 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4133
4060
  required: { type: Boolean },
4134
4061
  disabled: { type: Boolean },
4135
4062
  rangeSelected: { type: Boolean },
4136
- forceIconDisplay: { type: Boolean }
4063
+ forceIconDisplay: { type: Boolean },
4064
+ interactiveIcon: { type: Boolean }
4137
4065
  },
4138
4066
  emits: ["clear", "reset", "togglePopover", "focus", "blur"],
4139
4067
  setup(__props, { expose: __expose }) {
4140
4068
  const props = __props;
4141
4069
  const element = ref(null);
4142
4070
  function focus() {
4143
- var _a;
4144
- (_a = element.value) == null ? void 0 : _a.focus();
4071
+ element.value?.focus();
4145
4072
  }
4146
4073
  const { t: t2 } = useI18n();
4147
4074
  const currentPlaceholder = computed(() => {
@@ -4182,10 +4109,13 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4182
4109
  onBlur: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("blur"))
4183
4110
  }, toHandlers(_ctx.events, true)), null, 16, _hoisted_2$t),
4184
4111
  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",
4112
+ 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
4113
  icon: _ctx.type === "time" ? "ph-clock" : "ph:calendar",
4187
- onClick: focus
4188
- }, null, 8, ["icon"]),
4114
+ onClick: _cache[4] || (_cache[4] = ($event) => {
4115
+ focus();
4116
+ _ctx.$emit("togglePopover");
4117
+ })
4118
+ }, null, 8, ["class", "icon"]),
4189
4119
  !_ctx.disabled ? (openBlock(), createElementBlock("div", {
4190
4120
  key: 0,
4191
4121
  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 +4124,20 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4194
4124
  key: 0,
4195
4125
  class: "cl:cursor-pointer cl:hover:text-link-light",
4196
4126
  icon: "ph:arrow-counter-clockwise",
4197
- onClick: _cache[4] || (_cache[4] = withModifiers(($event) => _ctx.$emit("reset"), ["prevent"]))
4127
+ onClick: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.$emit("reset"), ["prevent"]))
4198
4128
  })) : createCommentVNode("", true),
4199
4129
  !_ctx.required && _ctx.date && (_ctx.type !== "time" || _ctx.date !== "00:00") ? (openBlock(), createBlock(unref(Icon), {
4200
4130
  key: 1,
4201
4131
  class: "cl:cursor-pointer cl:hover:text-link-light cl:md:ml-0.5 clear-icon",
4202
4132
  icon: "ph:x",
4203
- onClick: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.$emit("clear"), ["prevent"]))
4133
+ onClick: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.$emit("clear"), ["prevent"]))
4204
4134
  })) : createCommentVNode("", true)
4205
4135
  ], 2)) : createCommentVNode("", true)
4206
4136
  ]));
4207
4137
  };
4208
4138
  }
4209
4139
  });
4210
- const clUiCalendarInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-8d0a0dc4"]]);
4140
+ const clUiCalendarInput = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-c852f489"]]);
4211
4141
  const _hoisted_1$D = {
4212
4142
  key: 0,
4213
4143
  class: "cl:px-3 cl:py-3 cl:w-full"
@@ -4233,7 +4163,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4233
4163
  placeholder: { default: null },
4234
4164
  popoverPlacement: { default: "auto" },
4235
4165
  showPopover: { type: Boolean, default: void 0 },
4236
- forceIconDisplay: { type: Boolean, default: false }
4166
+ forceIconDisplay: { type: Boolean, default: false },
4167
+ showWeekNumbers: { type: Boolean, default: true }
4237
4168
  }, {
4238
4169
  "modelValue": { required: true },
4239
4170
  "modelModifiers": {}
@@ -4270,6 +4201,29 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4270
4201
  const { locale: locale2 } = useI18n();
4271
4202
  const internalLocale = computed(() => props.dateFormatLocale ?? locale2.value);
4272
4203
  const todayButtonVisible = ref(true);
4204
+ const internalPlaceholder = computed(() => {
4205
+ if (props.placeholder !== null) {
4206
+ return props.placeholder || null;
4207
+ } else {
4208
+ const formatPlaceholderDateOptions = {
4209
+ year: "numeric",
4210
+ month: "2-digit",
4211
+ day: "2-digit"
4212
+ };
4213
+ const formatPlaceholderTimeOptions = {
4214
+ hour: "2-digit",
4215
+ minute: "2-digit"
4216
+ };
4217
+ const meridiems = Info.meridiems().join(", ").toUpperCase();
4218
+ const displayString = DateTime.parseFormatForOpts({
4219
+ ...props.type === "time" ? void 0 : formatPlaceholderDateOptions,
4220
+ ...props.type === "date" ? void 0 : formatPlaceholderTimeOptions
4221
+ }, {
4222
+ locale: internalLocale.value
4223
+ });
4224
+ return displayString?.toUpperCase().replace("YYYYYY", "YYYY").replace("YYYYY", "YYYY").replace("A", `(${meridiems})`) ?? null;
4225
+ }
4226
+ });
4273
4227
  const showPopoverComputed = computed(() => {
4274
4228
  return props.showPopover !== void 0 ? props.showPopover : props.type !== "time";
4275
4229
  });
@@ -4319,8 +4273,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4319
4273
  });
4320
4274
  __expose({
4321
4275
  focus() {
4322
- var _a;
4323
- (_a = input.value) == null ? void 0 : _a.focus();
4276
+ input.value?.focus();
4324
4277
  }
4325
4278
  });
4326
4279
  return (_ctx, _cache) => {
@@ -4354,14 +4307,16 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4354
4307
  date: inputValue,
4355
4308
  events: inputEvents,
4356
4309
  type: _ctx.type,
4357
- placeholder: _ctx.placeholder,
4310
+ placeholder: internalPlaceholder.value,
4358
4311
  required: _ctx.required,
4359
4312
  "force-icon-display": _ctx.forceIconDisplay,
4360
4313
  disabled: _ctx.disabled,
4314
+ "interactive-icon": !props.showPopover,
4361
4315
  onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("focus")),
4362
4316
  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"])
4317
+ onClear: _cache[2] || (_cache[2] = ($event) => internalCurrentDateTime.value = null),
4318
+ onTogglePopover: calendar.value?.showPopover
4319
+ }), null, 16, ["date", "events", "type", "placeholder", "required", "force-icon-display", "disabled", "interactive-icon", "onTogglePopover"])
4365
4320
  ]),
4366
4321
  footer: withCtx(() => [
4367
4322
  todayButtonVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$D, [
@@ -4391,6 +4346,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4391
4346
  color: "primary",
4392
4347
  "title-position": "left",
4393
4348
  "hide-time-header": "",
4349
+ "show-weeknumbers": _ctx.showWeekNumbers,
4394
4350
  popover: popover.value
4395
4351
  }, {
4396
4352
  default: withCtx(({ inputValue, inputEvents }) => [
@@ -4400,15 +4356,17 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4400
4356
  date: inputValue,
4401
4357
  events: inputEvents,
4402
4358
  type: _ctx.type,
4403
- placeholder: _ctx.placeholder,
4359
+ placeholder: internalPlaceholder.value,
4404
4360
  required: _ctx.required,
4405
4361
  disabled: _ctx.disabled,
4406
4362
  "force-icon-display": _ctx.forceIconDisplay,
4363
+ "interactive-icon": !props.showPopover,
4407
4364
  onFocus: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("focus")),
4408
4365
  onBlur: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("blur")),
4409
4366
  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"])
4367
+ onReset: _cache[7] || (_cache[7] = ($event) => internalCurrentDateTime.value = unref(getDefaultDate)(_ctx.minDate, _ctx.maxDate, internalTimeZone.value, _ctx.type)),
4368
+ onTogglePopover: calendar.value?.showPopover
4369
+ }), null, 16, ["date", "events", "type", "placeholder", "required", "disabled", "force-icon-display", "interactive-icon", "onTogglePopover"])
4412
4370
  ]),
4413
4371
  footer: withCtx(() => [
4414
4372
  todayButtonVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$s, [
@@ -4419,7 +4377,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4419
4377
  ])) : createCommentVNode("", true)
4420
4378
  ]),
4421
4379
  _: 1
4422
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "popover"]))
4380
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "show-weeknumbers", "popover"]))
4423
4381
  ]),
4424
4382
  _: 2
4425
4383
  }, [
@@ -4439,7 +4397,7 @@ const _hoisted_1$C = {
4439
4397
  class: "cl:flex cl:gap-2 cl:p-2 cl:w-full"
4440
4398
  };
4441
4399
  const _hoisted_2$r = { class: "cl:w-full" };
4442
- const _hoisted_3$i = { class: "cl:w-full" };
4400
+ const _hoisted_3$j = { class: "cl:w-full" };
4443
4401
  const _sfc_main$L = /* @__PURE__ */ defineComponent({
4444
4402
  ...{
4445
4403
  inheritAttrs: false
@@ -4455,7 +4413,8 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4455
4413
  required: { type: Boolean, default: false },
4456
4414
  quickDateScope: { default: null },
4457
4415
  popoverPlacement: { default: "auto" },
4458
- manualDateSelection: { type: Boolean, default: true }
4416
+ manualDateSelection: { type: Boolean, default: true },
4417
+ showWeekNumbers: { type: Boolean, default: true }
4459
4418
  }, {
4460
4419
  "modelValue": { required: true },
4461
4420
  "modelModifiers": {}
@@ -4576,6 +4535,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4576
4535
  mode: "date",
4577
4536
  color: "primary",
4578
4537
  "title-position": "left",
4538
+ "show-weeknumbers": _ctx.showWeekNumbers,
4579
4539
  locale: internalLocale.value,
4580
4540
  timezone: internalTimeZone.value,
4581
4541
  columns: dateRangeColumnCount.value,
@@ -4635,7 +4595,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4635
4595
  _: 1
4636
4596
  }, 8, ["modelValue", "date-format-locale", "disabled", "time-zone", "min-date", "max-date", "popover-placement"])
4637
4597
  ]),
4638
- createElementVNode("div", _hoisted_3$i, [
4598
+ createElementVNode("div", _hoisted_3$j, [
4639
4599
  createVNode(_sfc_main$M, {
4640
4600
  id: "dateInputEnd",
4641
4601
  modelValue: internalEntrySelectEndDate.value,
@@ -4664,7 +4624,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4664
4624
  ])) : createCommentVNode("", true)
4665
4625
  ]),
4666
4626
  _: 1
4667
- }, 8, ["modelValue", "locale", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])
4627
+ }, 8, ["modelValue", "show-weeknumbers", "locale", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])
4668
4628
  ]),
4669
4629
  _: 2
4670
4630
  }, [
@@ -4701,6 +4661,10 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
4701
4661
  });
4702
4662
  const _hoisted_1$B = ["value", "readonly", "placeholder", "disabled", "onKeydown"];
4703
4663
  const _hoisted_2$q = ["id", "tabindex", "inert", "onKeydown"];
4664
+ const _hoisted_3$i = {
4665
+ key: 1,
4666
+ class: "cl:p-1 cl:select-none cl:text-grey-3"
4667
+ };
4704
4668
  const _sfc_main$J = /* @__PURE__ */ defineComponent({
4705
4669
  ...{
4706
4670
  inheritAttrs: false
@@ -4717,7 +4681,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4717
4681
  isGridFilter: { type: Boolean, default: false },
4718
4682
  openDropDownOnFocus: { type: Boolean, default: true },
4719
4683
  allowFiltering: { type: Boolean, default: false },
4720
- useListView: { type: Boolean, default: (props) => Array.isArray(props.modelValue) }
4684
+ useListView: { type: Boolean, default: (props) => Array.isArray(props.modelValue) },
4685
+ readonly: { type: Boolean, default: false }
4721
4686
  },
4722
4687
  emits: ["update:model-value"],
4723
4688
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -4741,14 +4706,22 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4741
4706
  if (isSelectItem(item)) {
4742
4707
  return item.name;
4743
4708
  }
4744
- return item == null ? void 0 : item.toString();
4709
+ return item?.toString();
4745
4710
  }
4746
4711
  });
4747
4712
  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
- }));
4713
+ const displayList = computed(() => {
4714
+ const itemsToFilterBasedOnSearchTerm = props.list.filter((d) => !isSelectItem(d) || isSelectItem(d) && d.id > -1);
4715
+ const filteredDisplayList = itemsToFilterBasedOnSearchTerm.filter((entry) => {
4716
+ const term = isSelectItem(entry) ? entry.name : entry;
4717
+ return term.toString().toLowerCase().includes(searchTerm.value.trim().toLowerCase());
4718
+ });
4719
+ const itemsToExcludeFromSearchTermFiltering = props.list.filter((d) => isSelectItem(d) && d.id < 0);
4720
+ return [
4721
+ ...searchTerm.value.trim() === "" ? itemsToExcludeFromSearchTermFiltering : [],
4722
+ ...filteredDisplayList
4723
+ ];
4724
+ });
4752
4725
  const isCurrentlySearchable = computed(() => selectModalVisible.value && props.allowFiltering);
4753
4726
  const highlightIndex = ref(-1);
4754
4727
  const outsideRef = ref();
@@ -4779,51 +4752,51 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4779
4752
  setSearchTerm("");
4780
4753
  }
4781
4754
  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);
4755
+ if (props.readonly === false && value !== null && value !== void 0) {
4756
+ if (Array.isArray(selectResult.value)) {
4757
+ const isInArray = selectResult.value.indexOf(value);
4758
+ if (isInArray > -1) {
4759
+ if (selectResult.value.length > 1 || props.canClear) {
4760
+ selectResult.value = selectResult.value.toSpliced(isInArray, 1);
4761
+ }
4762
+ } else {
4763
+ selectResult.value = [
4764
+ ...selectResult.value,
4765
+ value
4766
+ ];
4787
4767
  }
4788
4768
  } 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;
4769
+ if (props.canClear && selectResult.value === value) {
4770
+ selectResult.value = null;
4771
+ } else {
4772
+ selectResult.value = value;
4773
+ }
4774
+ toggleSelectModalState();
4799
4775
  }
4800
- toggleSelectModalState();
4801
4776
  }
4802
4777
  }
4803
4778
  function moveHighlightToStart(event) {
4804
- var _a;
4805
- if (selectModalVisible.value || props.useListView) {
4779
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4806
4780
  event.stopPropagation();
4807
4781
  highlightIndex.value = 0;
4808
- (_a = selectModalRef.value) == null ? void 0 : _a.scrollTo({
4782
+ selectModalRef.value?.scrollTo({
4809
4783
  top: 0,
4810
4784
  behavior: "instant"
4811
4785
  });
4812
4786
  }
4813
4787
  }
4814
4788
  function moveHighlightToEnd(event) {
4815
- var _a;
4816
- if (selectModalVisible.value || props.useListView) {
4789
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4817
4790
  event.stopPropagation();
4818
4791
  highlightIndex.value = displayList.value.length - 1;
4819
- (_a = selectModalRef.value) == null ? void 0 : _a.scrollTo({
4792
+ selectModalRef.value?.scrollTo({
4820
4793
  top: selectModalRef.value.scrollHeight,
4821
4794
  behavior: "instant"
4822
4795
  });
4823
4796
  }
4824
4797
  }
4825
4798
  function moveHighlightBackwards(event) {
4826
- if (selectModalVisible.value || props.useListView) {
4799
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4827
4800
  event.stopPropagation();
4828
4801
  if (highlightIndex.value === -1) {
4829
4802
  moveHighlightToStart(event);
@@ -4836,7 +4809,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4836
4809
  }
4837
4810
  }
4838
4811
  function moveHighlightForwards(event) {
4839
- if (selectModalVisible.value || props.useListView) {
4812
+ if (props.readonly === false && (selectModalVisible.value || props.useListView)) {
4840
4813
  event.stopPropagation();
4841
4814
  if (highlightIndex.value < displayList.value.length - 1) {
4842
4815
  highlightIndex.value++;
@@ -4850,8 +4823,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4850
4823
  return !!value && typeof value === "object" && "name" in value && typeof value.name === "string" && "id" in value && typeof value.id === "number";
4851
4824
  }
4852
4825
  function scrollToHighlight() {
4853
- var _a;
4854
- const highlightedElement = (_a = selectModalRef.value) == null ? void 0 : _a.children.item(highlightIndex.value);
4826
+ const highlightedElement = selectModalRef.value?.children.item(highlightIndex.value);
4855
4827
  if (selectModalRef.value && highlightedElement) {
4856
4828
  selectModalRef.value.scrollTo({
4857
4829
  top: highlightedElement.offsetTop - 16,
@@ -4860,14 +4832,24 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4860
4832
  }
4861
4833
  }
4862
4834
  function handleEnterPress(event) {
4863
- if (selectModalVisible.value) {
4864
- select(displayList.value[highlightIndex.value]);
4835
+ const isMultiSelect = Array.isArray(selectResult.value);
4836
+ if (selectModalVisible.value && (!isMultiSelect || highlightIndex.value !== -1 && isMultiSelect)) {
4837
+ select(displayList.value[highlightIndex.value] ?? null);
4865
4838
  setSearchTerm("");
4866
4839
  event.target.focus();
4840
+ } else if (props.allowFiltering && isMultiSelect && searchTerm.value.trim() !== "") {
4841
+ const displayListExcludingDefaultValues = displayList.value.filter((d) => !isSelectItem(d) || isSelectItem(d) && d.id > -1);
4842
+ if (displayListExcludingDefaultValues.length > 0) {
4843
+ selectMultipleValues(displayListExcludingDefaultValues);
4844
+ toggleSelectModalState(false);
4845
+ }
4867
4846
  } else {
4868
4847
  toggleSelectModalState(true);
4869
4848
  }
4870
4849
  }
4850
+ function selectMultipleValues(values) {
4851
+ selectResult.value = values;
4852
+ }
4871
4853
  function handleEscapePress(event) {
4872
4854
  toggleSelectModalState(false);
4873
4855
  if (props.openDropDownOnFocus) {
@@ -4905,12 +4887,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4905
4887
  }));
4906
4888
  let ignoreFocus = false;
4907
4889
  function focus() {
4908
- var _a;
4909
4890
  if (!ignoreFocus && props.openDropDownOnFocus) {
4910
4891
  toggleSelectModalState(true);
4911
4892
  }
4912
4893
  ignoreFocus = false;
4913
- (_a = inputElement.value) == null ? void 0 : _a.focus();
4894
+ inputElement.value?.focus();
4914
4895
  }
4915
4896
  function disableKeyboardEventForSearching(fn) {
4916
4897
  return (...args) => {
@@ -4929,6 +4910,13 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4929
4910
  function ignoreFocusEvent() {
4930
4911
  ignoreFocus = true;
4931
4912
  }
4913
+ function handleMouseClick(option2) {
4914
+ select(option2);
4915
+ highlightIndex.value = -1;
4916
+ }
4917
+ watch(searchTerm, () => {
4918
+ highlightIndex.value = -1;
4919
+ });
4932
4920
  __expose({
4933
4921
  focus
4934
4922
  });
@@ -4983,7 +4971,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
4983
4971
  withKeys(withModifiers(moveHighlightForwards, ["prevent"]), ["down"]),
4984
4972
  withKeys(withModifiers(moveHighlightToStart, ["prevent"]), ["home"]),
4985
4973
  withKeys(withModifiers(moveHighlightToEnd, ["prevent"]), ["end"]),
4986
- _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => disableKeyboardEventForSearching(handleEnterPress), ["stop", "prevent"]), ["space"])),
4974
+ _cache[4] || (_cache[4] = withKeys(($event) => disableKeyboardEventForSearching(handleEnterPress), ["space"])),
4987
4975
  withKeys(withModifiers(handleEnterPress, ["stop", "prevent"]), ["enter"])
4988
4976
  ],
4989
4977
  onInput: _cache[0] || (_cache[0] = ($event) => setSearchTerm($event.target.value)),
@@ -5014,7 +5002,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5014
5002
  "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
5003
  "cl:max-h-28": props.useListView,
5016
5004
  "cl:overflow-y-auto": _ctx.disabled === false,
5017
- "cl:overflow-hidden": _ctx.disabled
5005
+ "cl:overflow-hidden": _ctx.disabled,
5006
+ "cl:text-grey-3": _ctx.readonly
5018
5007
  }],
5019
5008
  inert: _ctx.disabled,
5020
5009
  onBlur: _cache[6] || (_cache[6] = ($event) => toggleSelectModalState(false)),
@@ -5032,25 +5021,26 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5032
5021
  _cache[8] || (_cache[8] = withKeys(withModifiers(($event) => select(displayList.value[highlightIndex.value]), ["stop", "prevent"]), ["enter"]))
5033
5022
  ]
5034
5023
  }), [
5035
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayList.value, (option2, index2) => {
5024
+ displayList.value.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(displayList.value, (option2, index2) => {
5036
5025
  return openBlock(), createElementBlock("div", { key: index2 }, [
5037
- renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, { option: option2, index: index2, select, highlightIndex: highlightIndex.value, isSelected }), () => [
5026
+ renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, { option: option2, index: index2, select: handleMouseClick, highlightIndex: highlightIndex.value, isSelected }), () => [
5038
5027
  (openBlock(), createBlock(_component_cl_ui_select_option, {
5039
5028
  id: unref(id) + "-option-" + (isSelectItem(option2) ? option2.id : index2),
5040
5029
  key: index2,
5041
5030
  disabled: _ctx.disabled,
5042
5031
  "is-highlighted": highlightIndex.value === index2,
5043
5032
  "is-selected": isSelected(option2),
5044
- onSelect: ($event) => select(option2)
5033
+ readonly: _ctx.readonly,
5034
+ onSelect: ($event) => handleMouseClick(option2)
5045
5035
  }, {
5046
5036
  default: withCtx(() => [
5047
5037
  createTextVNode(toDisplayString(isSelectItem(option2) ? option2.name : option2), 1)
5048
5038
  ]),
5049
5039
  _: 2
5050
- }, 1032, ["id", "disabled", "is-highlighted", "is-selected", "onSelect"]))
5040
+ }, 1032, ["id", "disabled", "is-highlighted", "is-selected", "readonly", "onSelect"]))
5051
5041
  ])
5052
5042
  ]);
5053
- }), 128))
5043
+ }), 128)) : (openBlock(), createElementBlock("span", _hoisted_3$i, toDisplayString(unref(t2)("select.notFound")), 1))
5054
5044
  ], 16, _hoisted_2$q)) : createCommentVNode("", true)
5055
5045
  ], 2)
5056
5046
  ]),
@@ -5073,20 +5063,23 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5073
5063
  props: {
5074
5064
  isSelected: { type: Boolean, default: false },
5075
5065
  isHighlighted: { type: Boolean, default: false },
5076
- disabled: { type: Boolean, default: false }
5066
+ disabled: { type: Boolean, default: false },
5067
+ readonly: { type: Boolean, default: false }
5077
5068
  },
5078
5069
  emits: ["select"],
5079
5070
  setup(__props, { emit: __emit }) {
5080
5071
  const emit = __emit;
5081
5072
  return (_ctx, _cache) => {
5082
5073
  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,
5074
+ class: normalizeClass(["cl:px-2 cl:py-0.5", _ctx.disabled ? "cl:bg-grey-1 cl:border-grey-2 cl:placeholder-grey-3" : {
5075
+ "cl:cursor-pointer": _ctx.readonly === false,
5076
+ "cl:bg-primary-lighter": _ctx.isSelected && _ctx.isHighlighted === false,
5077
+ "cl:hover:bg-primary-default": _ctx.readonly === false && _ctx.isSelected && _ctx.isHighlighted === false,
5085
5078
  "cl:bg-primary-default": _ctx.isSelected && _ctx.isHighlighted,
5086
- "cl:hover:bg-link-lighter": _ctx.isSelected === false && _ctx.isHighlighted === false,
5079
+ "cl:hover:bg-link-lighter": _ctx.readonly === false && _ctx.isSelected === false && _ctx.isHighlighted === false,
5087
5080
  "cl:bg-link-lighter": _ctx.isSelected === false && _ctx.isHighlighted
5088
- }]]),
5089
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.disabled ? null : emit("select"))
5081
+ }]),
5082
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.readonly || _ctx.disabled ? null : emit("select"))
5090
5083
  }, [
5091
5084
  renderSlot(_ctx.$slots, "default")
5092
5085
  ], 2);
@@ -5260,15 +5253,11 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5260
5253
  return methods;
5261
5254
  });
5262
5255
  const currentFilterMethod = computed(() => {
5263
- var _a;
5264
- let filterMethod = (_a = props.filter) == null ? void 0 : _a.filterMethod;
5256
+ let filterMethod = props.filter?.filterMethod;
5265
5257
  if (typeof filterMethod === "undefined") {
5266
5258
  filterMethod = FilterOperation[props.defaultOperation].replace("_", "").toLowerCase();
5267
5259
  }
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
- });
5260
+ return allowedFilterMethods.value.find((m) => m.method.toLowerCase() === filterMethod?.removeNonAlphanumeric()?.toLowerCase());
5272
5261
  });
5273
5262
  function setFilterMethod(filterMethod) {
5274
5263
  let filterOutput;
@@ -5315,11 +5304,10 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5315
5304
  }, [
5316
5305
  createElementVNode("strong", _hoisted_2$p, toDisplayString(unref(t2)("grid.availableMethods")), 1),
5317
5306
  (openBlock(true), createElementBlock(Fragment, null, renderList(allowedFilterMethods.value, (filterMethod, index2) => {
5318
- var _a;
5319
5307
  return openBlock(), createElementBlock("span", {
5320
5308
  key: index2,
5321
5309
  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)
5310
+ "cl:bg-primary-default cl:opacity-80": filterMethod.method === currentFilterMethod.value?.method
5323
5311
  }]),
5324
5312
  onClick: withModifiers(($event) => setFilterMethod(filterMethod.method), ["prevent"])
5325
5313
  }, [
@@ -5340,11 +5328,16 @@ const defaultEmptyListValue = {
5340
5328
  name: "",
5341
5329
  value: ""
5342
5330
  };
5343
- const defaultSelectAllListValue = {
5331
+ const defaultSelectAllListValue = computed(() => ({
5344
5332
  id: -2,
5345
5333
  name: i18n.global.t("grid.selectAll"),
5346
5334
  value: ""
5347
- };
5335
+ }));
5336
+ const defaultClearAllListValue = computed(() => ({
5337
+ id: -3,
5338
+ name: i18n.global.t("grid.clearAll"),
5339
+ value: ""
5340
+ }));
5348
5341
  const booleanListEntries = computed(() => [
5349
5342
  defaultEmptyListValue,
5350
5343
  {
@@ -5403,31 +5396,38 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5403
5396
  const numericFormat = computed(() => props.column.format === NumberFormat.INTEGER ? NumberFormat.DECIMAL : props.column.format ?? NumberFormat.DECIMAL);
5404
5397
  const booleanValueAsSelectItem = computed(() => booleanListEntries.value.find((x) => x.value === currentFilterValue.value.toString()) ?? null);
5405
5398
  const listEntriesAsSelectItems = computed(() => {
5406
- var _a;
5399
+ const baseItems = [
5400
+ props.column.listMode === "multi" ? defaultSelectAllListValue.value : defaultEmptyListValue,
5401
+ ...props.column.listMode === "multi" && props.filter?.length && props.filter.length > 0 ? [defaultClearAllListValue.value] : []
5402
+ ];
5403
+ const selectedFilterValues = props.filter?.filter((f) => f.filterOperation === FilterOperation.OR_EQUAL).map((f) => f.filterValue) ?? [];
5404
+ const allListEntries = props.column.listEntries?.map((x, i) => ({
5405
+ id: i,
5406
+ name: t2(x.translationKey),
5407
+ value: x.value.toString()
5408
+ })) ?? [];
5409
+ const selectedListEntries = allListEntries.filter((entry) => selectedFilterValues.includes(entry.value));
5410
+ const unselectedListEntries = allListEntries.filter((entry) => !selectedFilterValues.includes(entry.value));
5407
5411
  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
- }))) ?? []
5412
+ ...baseItems,
5413
+ ...selectedListEntries,
5414
+ ...unselectedListEntries
5414
5415
  ];
5415
5416
  });
5416
5417
  const currentFilterValueAsSelectItems = computed(() => {
5417
- var _a, _b;
5418
5418
  if (props.column.listMode !== "multi") {
5419
5419
  const item = listEntriesAsSelectItems.value.find((x) => x.value === currentFilterValue.value && x.id === selectedListEntryId.value) ?? listEntriesAsSelectItems.value.find((x) => x.value === currentFilterValue.value) ?? null;
5420
5420
  return item ? item : null;
5421
5421
  } 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);
5422
+ const filters = props.filter?.filter((f) => f.filterOperation === FilterOperation.OR_EQUAL).map((f) => f.filterValue);
5423
+ const filteredListEntries = listEntriesAsSelectItems.value.filter((x) => filters?.includes(x.value));
5424
+ if (filteredListEntries.length === props.column.listEntries?.length) {
5425
+ filteredListEntries.push(defaultSelectAllListValue.value);
5426
5426
  }
5427
5427
  return filteredListEntries;
5428
5428
  }
5429
5429
  });
5430
- const selectAllCurrentlyHighlighted = computed(() => Array.isArray(currentFilterValueAsSelectItems.value) && currentFilterValueAsSelectItems.value.some((x) => x.id === defaultSelectAllListValue.id));
5430
+ const selectAllCurrentlyHighlighted = computed(() => Array.isArray(currentFilterValueAsSelectItems.value) && currentFilterValueAsSelectItems.value.some((x) => x.id === defaultSelectAllListValue.value.id));
5431
5431
  const selectedListEntryId = ref(defaultEmptyListValue.id);
5432
5432
  function updateListColumnSelectItems(value) {
5433
5433
  if (value && !Array.isArray(value)) {
@@ -5437,22 +5437,21 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5437
5437
  return;
5438
5438
  }
5439
5439
  if (isNumericListColumn.value) {
5440
- setNumberFilter(null, value == null ? void 0 : value.value);
5440
+ setNumberFilter(null, value?.value);
5441
5441
  } else {
5442
- setFilter(null, value == null ? void 0 : value.value);
5442
+ setFilter(null, value?.value);
5443
5443
  }
5444
5444
  }
5445
5445
  const immediateRequestOverride = ref(false);
5446
5446
  const performImmediateRequest = computed(() => immediateRequestOverride.value || isStringColumn.value === false);
5447
5447
  const internalFilter = computed({
5448
5448
  get() {
5449
- var _a, _b, _c, _d, _e, _f, _g;
5450
- let result = (_a = currentFilters.value) == null ? void 0 : _a[0];
5449
+ let result = currentFilters.value?.[0];
5451
5450
  if (result) {
5452
5451
  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);
5452
+ if ((props.filter?.length ?? 0) > 1) {
5453
+ const startFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5454
+ const endFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.LESS_THAN);
5456
5455
  if (startFilter && endFilter) {
5457
5456
  result = {
5458
5457
  filterOnColumn: props.column.field,
@@ -5477,9 +5476,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5477
5476
  filterValue: date.plus({ milliseconds: 1 }).toISO() ?? ""
5478
5477
  };
5479
5478
  }
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);
5479
+ } else if (isDateRangeColumn.value && (props.filter?.length ?? 0) > 1) {
5480
+ const startFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_GREATER_THAN);
5481
+ const endFilter = currentFilters.value?.find((f) => f.filterOperation === FilterOperation.EQUAL_OR_LESS_THAN);
5483
5482
  if (startFilter && endFilter) {
5484
5483
  result = {
5485
5484
  filterOnColumn: props.column.field,
@@ -5499,9 +5498,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5499
5498
  let filters = null;
5500
5499
  if (isDateColumn.value) {
5501
5500
  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");
5501
+ const equalsFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equal");
5502
+ const lessThanOrEqualFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "equalorlessthan");
5503
+ const greaterThanFilter = dateFilter?.filterMethod && checkDateFilter(dateFilter.filterMethod, dateFilter.filterValue, "greaterthan");
5505
5504
  if (equalsFilter) {
5506
5505
  let date = DateTime.fromISO(dateFilter.filterValue, {
5507
5506
  zone: props.timeZone ?? "UTC"
@@ -5551,7 +5550,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5551
5550
  }
5552
5551
  ];
5553
5552
  }
5554
- } else if (isDateRangeColumn.value && (value == null ? void 0 : value.filterValue)) {
5553
+ } else if (isDateRangeColumn.value && value?.filterValue) {
5555
5554
  const dateRange = value.filterValue;
5556
5555
  const startDate = DateTime.fromISO(dateRange.start, {
5557
5556
  zone: props.timeZone ?? "UTC"
@@ -5587,7 +5586,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5587
5586
  }
5588
5587
  }
5589
5588
  }
5590
- if ((value == null ? void 0 : value.filterValue) === "" || performImmediateRequest.value) {
5589
+ if (value?.filterValue === "" || performImmediateRequest.value) {
5591
5590
  updateFilterDebounced(false);
5592
5591
  currentFilters.value = filters;
5593
5592
  immediateRequestOverride.value = false;
@@ -5600,7 +5599,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5600
5599
  if (filtersOrCancel !== false) {
5601
5600
  currentFilters.value = filtersOrCancel;
5602
5601
  }
5603
- }, 1e3);
5602
+ }, 3e3);
5604
5603
  const currentFilter = computed({
5605
5604
  get: () => internalFilter.value,
5606
5605
  set(value) {
@@ -5612,17 +5611,15 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5612
5611
  const isEqualFilter = operation === expectedOperation;
5613
5612
  return isValidValue && isEqualFilter && isDateColumn.value;
5614
5613
  }
5615
- const currentFilterValue = computed(() => {
5616
- var _a;
5617
- return ((_a = internalFilter.value) == null ? void 0 : _a.filterValue) ?? "";
5618
- });
5614
+ const currentFilterValue = computed(() => internalFilter.value?.filterValue ?? "");
5619
5615
  const currentDateFilterValue = computed(() => currentFilterValue.value === "" ? null : currentFilterValue.value);
5620
5616
  const currentDateRangeFilterValue = computed(() => currentFilterValue.value === "" ? null : currentFilterValue.value);
5621
5617
  const filterable = computed(() => isFilterable(props.column));
5622
5618
  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]);
5619
+ const selectAllCurrentlySelected = value.some((x) => x.id === defaultSelectAllListValue.value.id);
5620
+ const clearAllCurrentlySelected = value.some((x) => x.id === defaultClearAllListValue.value.id);
5621
+ if (value.length === 0 || selectAllCurrentlySelected === false && selectAllCurrentlyHighlighted.value || clearAllCurrentlySelected) {
5622
+ setOrEqualFiltersImpl([defaultSelectAllListValue.value.value]);
5626
5623
  } else if (selectAllCurrentlySelected && selectAllCurrentlyHighlighted.value === false) {
5627
5624
  setOrEqualFiltersImpl(listEntriesAsSelectItems.value.map((x) => x.value));
5628
5625
  } else {
@@ -5638,15 +5635,17 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5638
5635
  }
5639
5636
  }
5640
5637
  function setFilter(target, defaultValue) {
5641
- var _a;
5642
5638
  let filterOutput;
5643
5639
  let nextValue = defaultValue;
5644
- const previousValue = ((_a = internalFilter.value) == null ? void 0 : _a.filterValue.toString()) ?? "";
5640
+ const previousValue = internalFilter.value?.filterValue.toString() ?? "";
5645
5641
  const hasNextValue = !!nextValue.trim();
5646
5642
  const hasPreviousValue = !!previousValue.trim();
5647
5643
  if (hasNextValue === false && hasPreviousValue) {
5648
5644
  nextValue = "";
5649
5645
  }
5646
+ if (nextValue === previousValue) {
5647
+ return;
5648
+ }
5650
5649
  const updateFilter = hasNextValue || hasPreviousValue;
5651
5650
  if (updateFilter) {
5652
5651
  if (internalFilter.value) {
@@ -5679,11 +5678,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5679
5678
  setFilter(null, isNaN(inputValue) ? "" : inputValue.toString());
5680
5679
  }
5681
5680
  function setDateRangeFilter(value) {
5682
- var _a;
5683
5681
  let filterOutput;
5684
5682
  let preventEmit = false;
5685
5683
  if (internalFilter.value) {
5686
- preventEmit = ((_a = internalFilter.value) == null ? void 0 : _a.filterValue) === value;
5684
+ preventEmit = internalFilter.value?.filterValue === value;
5687
5685
  filterOutput = copy(internalFilter.value);
5688
5686
  filterOutput.filterValue = value ?? "";
5689
5687
  } else if (value !== null && typeof props.column.field !== "undefined") {
@@ -5709,6 +5707,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5709
5707
  setFilter(null, internalTextInputValue.value);
5710
5708
  }
5711
5709
  }
5710
+ function handleStringInputBlur(e) {
5711
+ const target = e.relatedTarget;
5712
+ if (target && target.closest("[clear-filters-button]")) {
5713
+ return;
5714
+ }
5715
+ immediateRequestOverride.value = true;
5716
+ setFilter(null, internalTextInputValue.value);
5717
+ }
5712
5718
  watch(() => currentFilterValue.value, () => {
5713
5719
  internalTextInputValue.value = currentFilterValue.value;
5714
5720
  }, {
@@ -5726,8 +5732,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5726
5732
  });
5727
5733
  const gridId = inject("cl-ui-grid-id") ?? "cl-ui-grid-filter";
5728
5734
  watch(() => props.filter, () => {
5729
- var _a;
5730
- if (((_a = props.filter) == null ? void 0 : _a.length) === 0) {
5735
+ if (props.filter?.length === 0) {
5731
5736
  selectedListEntryId.value = defaultEmptyListValue.id;
5732
5737
  }
5733
5738
  });
@@ -5746,7 +5751,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5746
5751
  class: "cl:bg-white cl:font-normal cl:min-h-0! cl:rounded-lg!",
5747
5752
  "model-value": booleanValueAsSelectItem.value,
5748
5753
  inert: _ctx.loading,
5749
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => setFilter(null, ($event == null ? void 0 : $event.value) ?? ""))
5754
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => setFilter(null, $event?.value ?? ""))
5750
5755
  }, {
5751
5756
  default: withCtx(({ select, option: option2, index: index2, highlightIndex, isSelected }) => [
5752
5757
  createVNode(_sfc_main$I, {
@@ -5771,6 +5776,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5771
5776
  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
5777
  readonly: _ctx.loading,
5773
5778
  "popover-placement": "bottom-start",
5779
+ placeholder: "",
5774
5780
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => setFilter(null, $event ?? ""))
5775
5781
  }, null, 8, ["id", "model-value", "time-zone", "type", "readonly"])
5776
5782
  ])) : isDateRangeColumn.value ? (openBlock(), createElementBlock("div", {
@@ -5800,9 +5806,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5800
5806
  "allow-empty": true,
5801
5807
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $event !== null ? setNumberFilter(null, $event) : setFilter(null, ""))
5802
5808
  }, {
5803
- default: withCtx(() => _cache[9] || (_cache[9] = [
5809
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [
5804
5810
  createElementVNode("span", null, null, -1)
5805
- ])),
5811
+ ])]),
5806
5812
  _: 1
5807
5813
  }, 8, ["id", "model-value", "format", "precision", "readonly"])
5808
5814
  ])) : _ctx.column.type === "string" || _ctx.column.type === "slot" && _ctx.column.slotType === "string" ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
@@ -5815,11 +5821,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5815
5821
  ],
5816
5822
  class: "cl:border-none cl:font-normal cl:h-[2rem] cl:lg:text-base cl:px-3 cl:text-xs readonly-filter",
5817
5823
  readonly: _ctx.loading,
5818
- onKeySinglePress: handleKeySinglePress
5824
+ onKeySinglePress: handleKeySinglePress,
5825
+ onBlur: _cache[6] || (_cache[6] = ($event) => handleStringInputBlur($event))
5819
5826
  }, {
5820
- default: withCtx(() => _cache[10] || (_cache[10] = [
5827
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [
5821
5828
  createElementVNode("span", null, null, -1)
5822
- ])),
5829
+ ])]),
5823
5830
  _: 1
5824
5831
  }, 8, ["id", "modelValue", "readonly"])
5825
5832
  ])) : isListColumn.value ? (openBlock(), createBlock(_sfc_main$J, {
@@ -5833,8 +5840,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5833
5840
  placeholder: selectAllCurrentlyHighlighted.value ? unref(t2)("grid.allEntriesSelected") : void 0,
5834
5841
  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
5842
  "is-grid-filter": true,
5836
- inert: _ctx.loading,
5837
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => updateListColumnSelectItems($event))
5843
+ readonly: _ctx.loading,
5844
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => updateListColumnSelectItems($event))
5838
5845
  }, {
5839
5846
  default: withCtx(({ select, option: option2, index: index2, highlightIndex, isSelected }) => [
5840
5847
  createVNode(_sfc_main$I, {
@@ -5853,22 +5860,22 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5853
5860
  }, 1032, ["is-highlighted", "is-selected", "class", "onSelect"])
5854
5861
  ]),
5855
5862
  _: 1
5856
- }, 8, ["id", "list", "model-value", "can-clear", "placeholder", "inert"])) : createCommentVNode("", true),
5863
+ }, 8, ["id", "list", "model-value", "can-clear", "placeholder", "readonly"])) : createCommentVNode("", true),
5857
5864
  !isDateRangeColumn.value ? (openBlock(), createBlock(_sfc_main$H, {
5858
5865
  key: 6,
5859
5866
  filter: currentFilter.value,
5860
- "onUpdate:filter": _cache[7] || (_cache[7] = ($event) => currentFilter.value = $event),
5867
+ "onUpdate:filter": _cache[8] || (_cache[8] = ($event) => currentFilter.value = $event),
5861
5868
  loading: _ctx.loading,
5862
5869
  column: _ctx.column,
5863
5870
  "default-operation": getDefaultFilterOperation(),
5864
5871
  "dropdown-position": _ctx.filterDropdownPosition,
5865
- onSelectionChanged: _cache[8] || (_cache[8] = ($event) => immediateRequestOverride.value = true)
5872
+ onSelectionChanged: _cache[9] || (_cache[9] = ($event) => immediateRequestOverride.value = true)
5866
5873
  }, null, 8, ["filter", "loading", "column", "default-operation", "dropdown-position"])) : createCommentVNode("", true)
5867
5874
  ], 2)) : createCommentVNode("", true);
5868
5875
  };
5869
5876
  }
5870
5877
  });
5871
- const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-4bb0f963"]]);
5878
+ const clUiGridFilterInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-c5ef8bbf"]]);
5872
5879
  const _hoisted_1$y = { key: 1 };
5873
5880
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
5874
5881
  __name: "cl-ui-grid-filter",
@@ -5963,8 +5970,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
5963
5970
  }));
5964
5971
  });
5965
5972
  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;
5973
+ return currentRequest.value.sort?.sortOnColumn === column.field && currentRequest.value.sort?.sortByAscending === isAscending;
5968
5974
  }
5969
5975
  function setSort(field) {
5970
5976
  if (typeof field !== "undefined") {
@@ -6040,12 +6046,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6040
6046
  currentHandle = handle;
6041
6047
  const rect = currentHandle.getBoundingClientRect();
6042
6048
  const table = currentHandle.closest("table");
6043
- const tableRect = table == null ? void 0 : table.getBoundingClientRect();
6049
+ const tableRect = table?.getBoundingClientRect();
6044
6050
  const th = currentHandle.closest("th");
6045
- const thRect = th == null ? void 0 : th.getBoundingClientRect();
6046
- initialWidth = (thRect == null ? void 0 : thRect.width) ?? 0;
6051
+ const thRect = th?.getBoundingClientRect();
6052
+ initialWidth = thRect?.width ?? 0;
6047
6053
  rightResizeBarPosition.value = index2 === visibleColumns.value.length - 1 ? rect.right : rect.right - 5;
6048
- leftResizeBarPosition.value = (thRect == null ? void 0 : thRect.left) ?? 0;
6054
+ leftResizeBarPosition.value = thRect?.left ?? 0;
6049
6055
  if (tableRect) {
6050
6056
  resizeBarTop.value = tableRect.top;
6051
6057
  resizeBarHeight.value = tableRect.height;
@@ -6071,8 +6077,11 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6071
6077
  }
6072
6078
  });
6073
6079
  }
6080
+ const isFineTouchDevice = computed(() => {
6081
+ return window.matchMedia("(pointer: coarse)").matches === false;
6082
+ });
6074
6083
  const shouldEnableGlobalResizing = computed(() => {
6075
- return props.options.allowColumnResizing !== false && !isTouchDevice();
6084
+ return props.options.allowColumnResizing !== false && isFineTouchDevice.value;
6076
6085
  });
6077
6086
  const columnsWithResizing = computed(() => {
6078
6087
  return visibleColumns.value.map((column) => ({
@@ -6095,7 +6104,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6095
6104
  return (_ctx, _cache) => {
6096
6105
  return openBlock(), createElementBlock(Fragment, null, [
6097
6106
  createElementVNode("thead", {
6098
- class: normalizeClass(["cl:-top-1 cl:bg-white cl:z-20", [
6107
+ class: normalizeClass(["cl:-top-1 cl:bg-white cl:z-20 touch-none", [
6099
6108
  _ctx.options.hideGridMobileView ? "cl:relative" : "cl:shadow cl:sticky cl:lg:bg-transparent cl:lg:relative cl:lg:shadow-none"
6100
6109
  ]])
6101
6110
  }, [
@@ -6210,7 +6219,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6210
6219
  };
6211
6220
  })
6212
6221
  ]), 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", {
6222
+ _ctx.options.allowColumnResizing && isFineTouchDevice.value ? (openBlock(), createElementBlock("div", {
6214
6223
  key: 1,
6215
6224
  id: `resize-handle-${columnIndex}`,
6216
6225
  ref_for: true,
@@ -6282,20 +6291,18 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6282
6291
  ...currentRequest.value,
6283
6292
  filters
6284
6293
  };
6294
+ gridSearchInputRef.value?.focus();
6285
6295
  }
6286
6296
  watch(() => props.columns, () => performSearch(searchValue.value));
6287
6297
  const debouncedSearch = useDebounceFn((valueOrCancel) => {
6288
6298
  if (valueOrCancel !== false) {
6289
6299
  performSearch(valueOrCancel);
6290
6300
  }
6291
- }, 2e3);
6301
+ }, 3e3);
6292
6302
  const { t: t2 } = useI18n();
6293
6303
  const gridSearchInputRef = ref();
6294
6304
  __expose({
6295
- focusMegaSearch: () => {
6296
- var _a;
6297
- return (_a = gridSearchInputRef.value) == null ? void 0 : _a.focus();
6298
- }
6305
+ focusMegaSearch: () => gridSearchInputRef.value?.focus()
6299
6306
  });
6300
6307
  return (_ctx, _cache) => {
6301
6308
  const _component_icon = resolveComponent("icon");
@@ -6316,9 +6323,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6316
6323
  placeholder: _ctx.columns.length > 4 ? unref(t2)("grid.search") : unref(t2)("grid.searchSpecific", { columns: _ctx.columns.map((c) => unref(t2)(c.caption)).join(", ") }),
6317
6324
  onKeypress: _cache[2] || (_cache[2] = withKeys(($event) => performSearch(searchValue.value), ["enter"]))
6318
6325
  }, {
6319
- default: withCtx(() => _cache[4] || (_cache[4] = [
6326
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
6320
6327
  createElementVNode("span", null, null, -1)
6321
- ])),
6328
+ ])]),
6322
6329
  _: 1
6323
6330
  }, 8, ["modelValue", "readonly", "placeholder"])
6324
6331
  ]),
@@ -7033,7 +7040,7 @@ function _dispatchEvent(info) {
7033
7040
  }, info));
7034
7041
  }
7035
7042
  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() {
7043
+ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = (function() {
7037
7044
  if (!documentExists) return;
7038
7045
  if (IE11OrLess) {
7039
7046
  return false;
@@ -7041,7 +7048,7 @@ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely =
7041
7048
  var el = document.createElement("x");
7042
7049
  el.style.cssText = "pointer-events:auto";
7043
7050
  return el.style.pointerEvents === "auto";
7044
- }(), _detectDirection = function _detectDirection2(el, options) {
7051
+ })(), _detectDirection = function _detectDirection2(el, options) {
7045
7052
  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
7053
  if (elCSS.display === "flex") {
7047
7054
  return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
@@ -8715,7 +8722,6 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8715
8722
  }),
8716
8723
  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
8724
  setup(__props, { expose: __expose, emit: __emit }) {
8718
- var _a;
8719
8725
  const props = __props;
8720
8726
  const selectedRowIndex = useModel(__props, "selectedRowIndex");
8721
8727
  const emit = __emit;
@@ -8764,9 +8770,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8764
8770
  return width;
8765
8771
  }
8766
8772
  function setColumnStyles() {
8767
- var _a2;
8768
8773
  const result = {};
8769
- if (window.innerWidth >= 1024 || ((_a2 = props.options) == null ? void 0 : _a2.hideGridMobileView)) {
8774
+ if (window.innerWidth >= 1024 || props.options?.hideGridMobileView) {
8770
8775
  currentColumns.value.forEach((c) => {
8771
8776
  const value = c.customWidth ? `${c.customWidth}px` : c.width ? `${c.width}px` : "";
8772
8777
  result[`${c.name}`] = `width: ${value}; min-width: ${value};`;
@@ -8777,11 +8782,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8777
8782
  function getStyleForColumn(name) {
8778
8783
  return columnStyles.value[name] ?? "";
8779
8784
  }
8780
- function shouldSetBlankColumn() {
8785
+ const shouldSetBlankColumn = computed(() => {
8781
8786
  const columnWithNoWidthSet = visibleColumns.value.every((x) => x.width !== void 0 || x.customWidth !== void 0);
8782
8787
  const columnWidthDoesNotExceedGridWidth = visibleColumns.value.reduce((acc, x) => acc + (x.customWidth ?? x.width ?? 0), 0) < getGridWidth();
8783
8788
  return columnWithNoWidthSet && columnWidthDoesNotExceedGridWidth;
8784
- }
8789
+ });
8785
8790
  const currentRequest = computed({
8786
8791
  get: () => props.request,
8787
8792
  set: (value) => emit("update:request", value)
@@ -8795,12 +8800,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8795
8800
  emit("clear-filters-clicked");
8796
8801
  }
8797
8802
  function resetGrouping() {
8798
- var _a2;
8799
8803
  if (gridOptions.value.groupByField) {
8800
8804
  currentRequest.value = {
8801
8805
  ...currentRequest.value,
8802
8806
  sort: {
8803
- sortByAscending: ((_a2 = props.request.sort) == null ? void 0 : _a2.sortByAscending) ?? false,
8807
+ sortByAscending: props.request.sort?.sortByAscending ?? false,
8804
8808
  sortOnColumn: gridOptions.value.groupByField
8805
8809
  }
8806
8810
  };
@@ -8819,7 +8823,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8819
8823
  immediate: true
8820
8824
  });
8821
8825
  const gridData = computed(() => props.data);
8822
- const internalEditMode = ref(false);
8826
+ const internalEditMode = ref(props.options.forceEditMode ?? false);
8823
8827
  const editMode = computed({
8824
8828
  get: () => props.options.forceEditMode || internalEditMode.value,
8825
8829
  set(value) {
@@ -8851,7 +8855,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8851
8855
  };
8852
8856
  }
8853
8857
  });
8854
- const searchValue = ref(((_a = props.request.filters.find((f) => f.filterMethod === "andcontains" || f.filterOperation === FilterOperation.AND_CONTAINS)) == null ? void 0 : _a.filterValue) ?? "");
8858
+ const searchValue = ref(props.request.filters.find((f) => f.filterMethod === "andcontains" || f.filterOperation === FilterOperation.AND_CONTAINS)?.filterValue ?? "");
8855
8859
  const searchableColumns = computed(() => props.columns.filter((c) => (c.type === "string" || c.type === "slot" && c.slotType === "string") && c.searchable));
8856
8860
  watch(() => props.loading, () => {
8857
8861
  isInitialLoad.value = false;
@@ -8866,29 +8870,20 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8866
8870
  watch(() => props.data, () => {
8867
8871
  setPageNumberIfPageNumberExceedsAvailablePages();
8868
8872
  function setPageNumberIfPageNumberExceedsAvailablePages() {
8869
- var _a2;
8870
- if (((_a2 = props.data) == null ? void 0 : _a2.results.length) === 0 && currentRequest.value.pageNumber > 1) {
8873
+ if (props.data?.results.length === 0 && currentRequest.value.pageNumber > 1) {
8871
8874
  currentRequest.value.pageNumber = props.data.totalRecords > 0 ? Math.ceil(props.data.totalRecords / currentRequest.value.pageSize) : 1;
8872
8875
  }
8873
8876
  }
8874
8877
  });
8875
8878
  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
- }
8879
+ visibleColumns.value[columnIndex].customWidth = newWidth;
8883
8880
  setColumnStyles();
8884
8881
  }
8885
8882
  watch(() => props.options.groupByField, resetGrouping, { immediate: true });
8883
+ watch(() => props.columns, setColumnStyles, { deep: true });
8886
8884
  const gridSearchRef = ref();
8887
8885
  __expose({
8888
- focusMegaSearch: () => {
8889
- var _a2;
8890
- return (_a2 = gridSearchRef.value) == null ? void 0 : _a2.focusMegaSearch();
8891
- }
8886
+ focusMegaSearch: () => gridSearchRef.value?.focusMegaSearch()
8892
8887
  });
8893
8888
  return (_ctx, _cache) => {
8894
8889
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
@@ -8964,7 +8959,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
8964
8959
  span: 1
8965
8960
  }, null, 4);
8966
8961
  }), 128)),
8967
- shouldSetBlankColumn() ? (openBlock(), createElementBlock("col", _hoisted_4$a)) : createCommentVNode("", true)
8962
+ shouldSetBlankColumn.value ? (openBlock(), createElementBlock("col", _hoisted_4$a)) : createCommentVNode("", true)
8968
8963
  ], 2),
8969
8964
  createVNode(_sfc_main$E, {
8970
8965
  request: headerRequest.value,
@@ -9184,8 +9179,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
9184
9179
  const request = useModel(__props, "request");
9185
9180
  const { t: t2 } = useI18n();
9186
9181
  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;
9182
+ return request.value.sort?.sortOnColumn === column.field && request.value.sort?.sortByAscending === isAscending;
9189
9183
  }
9190
9184
  function setSort(field) {
9191
9185
  if (typeof field !== "undefined") {
@@ -9341,13 +9335,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
9341
9335
  const isSmallGrid = computed(() => props.options.smallGridText ?? false);
9342
9336
  const isAlternatingRows = computed(() => props.options.alternatingRows ?? false);
9343
9337
  return (_ctx, _cache) => {
9344
- var _a;
9345
9338
  return openBlock(), createElementBlock("div", _hoisted_1$q, [
9346
9339
  _ctx.initialLoad && _ctx.pageSize > 0 ? (openBlock(), createBlock(_sfc_main$y, {
9347
9340
  key: 0,
9348
9341
  "page-size": _ctx.pageSize,
9349
9342
  "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", {
9343
+ }, null, 8, ["page-size", "column-count"])) : (_ctx.data?.results.length ?? 0) < 1 && _ctx.initialLoad === false ? (openBlock(), createElementBlock("div", {
9351
9344
  key: 1,
9352
9345
  class: normalizeClass(["cl:col-[1_/_-1] cl:text-center cl:w-full", [
9353
9346
  isSmallGrid.value ? "cl:p-1" : "cl:p-2"
@@ -9414,11 +9407,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9414
9407
  let date;
9415
9408
  if (props.timeZone) {
9416
9409
  date = DateTime.fromISO(value, {
9417
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value
9410
+ locale: dateFormatLocaleOverride?.value ?? locale2.value
9418
9411
  }).setZone(props.timeZone);
9419
9412
  } else {
9420
9413
  date = DateTime.fromISO(value, {
9421
- locale: (dateFormatLocaleOverride == null ? void 0 : dateFormatLocaleOverride.value) ?? locale2.value,
9414
+ locale: dateFormatLocaleOverride?.value ?? locale2.value,
9422
9415
  zone: "UTC"
9423
9416
  });
9424
9417
  }
@@ -9479,7 +9472,6 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9479
9472
  }
9480
9473
  }
9481
9474
  return (_ctx, _cache) => {
9482
- var _a;
9483
9475
  return openBlock(), createElementBlock("div", mergeProps({
9484
9476
  class: [
9485
9477
  _ctx.isSmallGrid ? "cl:px-1 cl:py-1.5 cl:text-xs" : "cl:p-2 cl:text-sm"
@@ -9506,7 +9498,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9506
9498
  key: 3,
9507
9499
  id: unref(id),
9508
9500
  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", {
9501
+ }, 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
9502
  key: 4,
9511
9503
  id: unref(id),
9512
9504
  class: "cl:inline-block cl:whitespace-nowrap"
@@ -9523,13 +9515,13 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
9523
9515
  const _sfc_main$u = {};
9524
9516
  const _hoisted_1$o = { class: "cl:border cl:border-off-white cl:border-t cl:flex cl:justify-between cl:p-2" };
9525
9517
  function _sfc_render$2(_ctx, _cache) {
9526
- return openBlock(), createElementBlock("div", _hoisted_1$o, _cache[0] || (_cache[0] = [
9518
+ return openBlock(), createElementBlock("div", _hoisted_1$o, [..._cache[0] || (_cache[0] = [
9527
9519
  createElementVNode("div", { class: "cl:flex cl:gap-2 cl:w-full" }, [
9528
9520
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-3/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   "),
9529
9521
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-1/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   ")
9530
9522
  ], -1),
9531
9523
  createElementVNode("p", { class: "cl:animate-pulse cl:basis-1/12 cl:bg-grey-1 cl:leading-none cl:rounded-full" }, "   ", -1)
9532
- ]));
9524
+ ])]);
9533
9525
  }
9534
9526
  const clUiGridLiteFooterSkeleton = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$2]]);
9535
9527
  const _hoisted_1$n = { class: "cl:flex cl:gap-4" };
@@ -9562,10 +9554,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9562
9554
  const props = __props;
9563
9555
  const request = useModel(__props, "request");
9564
9556
  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
- });
9557
+ const totalPages = computed(() => props.data !== null ? Math.ceil((props.data?.totalRecords ?? 0) / request.value.pageSize) : 1);
9569
9558
  const pageNumbers = computed(() => {
9570
9559
  const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
9571
9560
  let results = [];
@@ -9579,7 +9568,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9579
9568
  });
9580
9569
  function setPage(pageNumber) {
9581
9570
  const filterRequest = copy(request.value);
9582
- pageNumber ?? (pageNumber = 1);
9571
+ pageNumber ??= 1;
9583
9572
  if (filterRequest.pageNumber !== pageNumber) {
9584
9573
  filterRequest.pageNumber = Math.max(Math.min(Math.trunc(pageNumber), totalPages.value), 1);
9585
9574
  request.value = filterRequest;
@@ -9592,10 +9581,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9592
9581
  50
9593
9582
  ];
9594
9583
  const availablePageSizes = computed(() => {
9595
- return pageSizes.filter((size) => {
9596
- var _a;
9597
- return size <= (((_a = props.data) == null ? void 0 : _a.totalRecords) ?? 0);
9598
- });
9584
+ return pageSizes.filter((size) => size <= (props.data?.totalRecords ?? 0));
9599
9585
  });
9600
9586
  function setPageSize(pageSize) {
9601
9587
  const filterRequest = copy(request.value);
@@ -9604,9 +9590,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
9604
9590
  request.value = filterRequest;
9605
9591
  }
9606
9592
  return (_ctx, _cache) => {
9607
- var _a;
9608
9593
  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", {
9594
+ return _ctx.initialLoad ? (openBlock(), createBlock(clUiGridLiteFooterSkeleton, { key: 0 })) : _ctx.data?.results.length && request.value && totalPages.value > 1 ? (openBlock(), createElementBlock("div", {
9610
9595
  key: 1,
9611
9596
  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
9597
  _ctx.options.smallGridText ? "cl:px-1 cl:py-1.5 cl:text-xs" : "cl:p-2 cl:text-sm"
@@ -9832,7 +9817,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9832
9817
  placeholder: { default: null },
9833
9818
  initialDate: { default: null },
9834
9819
  quickDateScope: { default: null },
9835
- dateFormatLocale: { default: null }
9820
+ dateFormatLocale: { default: null },
9821
+ showWeekNumbers: { type: Boolean, default: true }
9836
9822
  },
9837
9823
  emits: ["update:date"],
9838
9824
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -9905,8 +9891,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9905
9891
  const showQuickDates = useMediaQuery("(min-height: 800px)");
9906
9892
  __expose({
9907
9893
  focus() {
9908
- var _a;
9909
- (_a = input.value) == null ? void 0 : _a.focus();
9894
+ input.value?.focus();
9910
9895
  }
9911
9896
  });
9912
9897
  return (_ctx, _cache) => {
@@ -9958,6 +9943,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9958
9943
  "min-date": _ctx.min,
9959
9944
  "max-date": _ctx.max,
9960
9945
  "initial-page": currentInitialDate.value,
9946
+ "show-weeknumbers": _ctx.showWeekNumbers,
9961
9947
  onDayclick: _cache[4] || (_cache[4] = ($event) => currentQuickDate.value = null)
9962
9948
  }, {
9963
9949
  default: withCtx(({ togglePopover }) => [
@@ -9988,7 +9974,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
9988
9974
  }, null, 8, ["scope", "selected-quick-date", "current-date-range"])) : createCommentVNode("", true)
9989
9975
  ]),
9990
9976
  _: 1
9991
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "columns", "popover", "min-date", "max-date", "initial-page"])) : (openBlock(), createBlock(unref(DatePicker), {
9977
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "columns", "popover", "min-date", "max-date", "initial-page", "show-weeknumbers"])) : (openBlock(), createBlock(unref(DatePicker), {
9992
9978
  key: 2,
9993
9979
  modelValue: currentDate.value,
9994
9980
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => currentDate.value = $event),
@@ -10003,6 +9989,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10003
9989
  "update-on-input": false,
10004
9990
  masks: { L: mask.value, inputDateTime: [mask.value], inputDateTime24hr: [mask.value] },
10005
9991
  color: "primary",
9992
+ "show-weeknumbers": _ctx.showWeekNumbers,
10006
9993
  "title-position": "left",
10007
9994
  "hide-time-header": "",
10008
9995
  popover: popover.value
@@ -10022,7 +10009,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
10022
10009
  }), null, 16, ["date", "events", "type", "placeholder", "required", "disabled"])
10023
10010
  ]),
10024
10011
  _: 1
10025
- }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "popover"]));
10012
+ }, 8, ["modelValue", "locale", "is24hr", "timezone", "mode", "min-date", "max-date", "initial-page", "is-required", "masks", "show-weeknumbers", "popover"]));
10026
10013
  };
10027
10014
  }
10028
10015
  });
@@ -10096,12 +10083,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
10096
10083
  );
10097
10084
  __expose({
10098
10085
  focus() {
10099
- var _a;
10100
- (_a = inputRef.value) == null ? void 0 : _a.focus();
10086
+ inputRef.value?.focus();
10101
10087
  },
10102
10088
  blur() {
10103
- var _a;
10104
- (_a = inputRef.value) == null ? void 0 : _a.blur();
10089
+ inputRef.value?.blur();
10105
10090
  }
10106
10091
  });
10107
10092
  return (_ctx, _cache) => {
@@ -10183,8 +10168,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10183
10168
  const showNumericInput = ref(false);
10184
10169
  __expose({
10185
10170
  focus() {
10186
- var _a;
10187
- (_a = sliderRef.value) == null ? void 0 : _a.focus();
10171
+ sliderRef.value?.focus();
10188
10172
  }
10189
10173
  });
10190
10174
  return (_ctx, _cache) => {
@@ -10213,9 +10197,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
10213
10197
  disabled: _ctx.disabled,
10214
10198
  placeholder: _ctx.placeholder
10215
10199
  }, {
10216
- default: withCtx(() => _cache[5] || (_cache[5] = [
10200
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
10217
10201
  createElementVNode("span", null, null, -1)
10218
- ])),
10202
+ ])]),
10219
10203
  _: 1
10220
10204
  }, 8, ["modelValue", "format", "precision", "min", "max", "step", "disabled", "placeholder"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
10221
10205
  withDirectives(createElementVNode("input", {
@@ -10390,7 +10374,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10390
10374
  initialDate: { default: null },
10391
10375
  quickDateScope: { default: null },
10392
10376
  dateFormatLocale: { default: null },
10393
- currencyOptions: { default: void 0 }
10377
+ currencyOptions: { default: void 0 },
10378
+ showWeekNumbers: { type: Boolean, default: true }
10394
10379
  },
10395
10380
  emits: ["update:model-value", "click", "focus", "input", "change", "validated"],
10396
10381
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -10401,9 +10386,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10401
10386
  const focused = ref(false);
10402
10387
  const lostFocus = ref(false);
10403
10388
  const showRequiredAsterisk = computed(() => {
10404
- var _a;
10405
10389
  let showAsterisk = props.isRequired;
10406
- if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "" && props.requiredText.trim() !== "") {
10390
+ if (lostFocus.value && currentValue.value?.toString().trim() === "" && props.requiredText.trim() !== "") {
10407
10391
  showAsterisk = false;
10408
10392
  }
10409
10393
  return !props.hideRequiredAsterisk && showAsterisk;
@@ -10427,10 +10411,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10427
10411
  const displayValidationMessage = ref(true);
10428
10412
  const internalErrors = ref([]);
10429
10413
  const errors = computed(() => {
10430
- var _a, _b;
10431
10414
  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)) ?? []
10415
+ ...internalErrors.value?.filter((e) => (e?.length ?? 0) > 0) ?? [],
10416
+ ...props.externalErrors?.filter((e) => (e?.length ?? 0) > 0) ?? []
10434
10417
  ].join("\n");
10435
10418
  });
10436
10419
  const currencyInputOptions = computed(() => {
@@ -10591,19 +10574,17 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10591
10574
  );
10592
10575
  __expose({
10593
10576
  focus() {
10594
- var _a, _b;
10595
10577
  if (props.inputType === "currency") {
10596
- (_a = currencyInputRef == null ? void 0 : currencyInputRef.value) == null ? void 0 : _a.focus();
10578
+ currencyInputRef?.value?.focus();
10597
10579
  } else {
10598
- (_b = inputElement.value) == null ? void 0 : _b.focus();
10580
+ inputElement.value?.focus();
10599
10581
  }
10600
10582
  },
10601
10583
  blur() {
10602
- var _a, _b;
10603
10584
  if (props.inputType === "currency") {
10604
- (_a = currencyInputRef == null ? void 0 : currencyInputRef.value) == null ? void 0 : _a.blur();
10585
+ currencyInputRef?.value?.blur();
10605
10586
  } else {
10606
- (_b = inputElement.value) == null ? void 0 : _b.blur();
10587
+ inputElement.value?.blur();
10607
10588
  }
10608
10589
  }
10609
10590
  });
@@ -10728,9 +10709,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10728
10709
  "initial-date": _ctx.initialDate,
10729
10710
  "quick-date-scope": _ctx.quickDateScope,
10730
10711
  "date-format-locale": _ctx.dateFormatLocale,
10712
+ "show-week-numbers": _ctx.showWeekNumbers,
10731
10713
  onBlur: onLostFocus,
10732
10714
  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, [
10715
+ }), 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
10716
  createVNode(unref(clUiSlider), {
10735
10717
  ref_key: "inputElement",
10736
10718
  ref: inputElement,
@@ -10753,7 +10735,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
10753
10735
  };
10754
10736
  }
10755
10737
  });
10756
- const clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-dec34b48"]]);
10738
+ const clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-833e892c"]]);
10757
10739
  const inputTypes = [
10758
10740
  "button",
10759
10741
  "checkbox",
@@ -10992,9 +10974,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
10992
10974
  placeholder: unref(t2)("login.email"),
10993
10975
  autocomplete: "username"
10994
10976
  }, {
10995
- default: withCtx(() => _cache[4] || (_cache[4] = [
10977
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
10996
10978
  createElementVNode("span", null, null, -1)
10997
- ])),
10979
+ ])]),
10998
10980
  _: 1
10999
10981
  }, 8, ["modelValue", "class", "errors", "placeholder"]),
11000
10982
  usernameValid.value ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(unref(t2)("login.validEmail")), 1)) : createCommentVNode("", true)
@@ -11035,9 +11017,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11035
11017
  placeholder: unref(t2)("login.password"),
11036
11018
  autocomplete: "current-password"
11037
11019
  }, {
11038
- default: withCtx(() => _cache[5] || (_cache[5] = [
11020
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
11039
11021
  createElementVNode("span", null, null, -1)
11040
- ])),
11022
+ ])]),
11041
11023
  _: 1
11042
11024
  }, 8, ["modelValue", "class", "type", "placeholder"])
11043
11025
  ])
@@ -11058,22 +11040,19 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11058
11040
  ])
11059
11041
  ], 2),
11060
11042
  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
- }),
11043
+ default: withCtx(() => [
11044
+ withDirectives(createElementVNode("span", _hoisted_13, [
11045
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.errors, (error, index2) => {
11046
+ return openBlock(), createElementBlock("div", {
11047
+ id: "cl-ui-login-errors",
11048
+ key: index2,
11049
+ class: "cl:font-semibold"
11050
+ }, toDisplayString(error), 1);
11051
+ }), 128))
11052
+ ], 512), [
11053
+ [vShow, _ctx.errors?.length]
11054
+ ])
11055
+ ]),
11077
11056
  _: 1
11078
11057
  })
11079
11058
  ])
@@ -11132,7 +11111,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
11132
11111
  }
11133
11112
  });
11134
11113
  }
11135
- emit("open-state", !!(group == null ? void 0 : group.open), groupID);
11114
+ emit("open-state", !!group?.open, groupID);
11136
11115
  }
11137
11116
  const size = useWindowSize();
11138
11117
  watch(
@@ -11490,9 +11469,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
11490
11469
  }
11491
11470
  });
11492
11471
  function handleDrop(payload) {
11493
- var _a;
11494
11472
  if (props.disabled === false) {
11495
- const filesUploaded = [...(_a = payload == null ? void 0 : payload.dataTransfer) == null ? void 0 : _a.files];
11473
+ const filesUploaded = [...payload?.dataTransfer?.files];
11496
11474
  validateAndEmitFiles(filesUploaded);
11497
11475
  }
11498
11476
  }
@@ -11653,9 +11631,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11653
11631
  }
11654
11632
  }
11655
11633
  const canDeselect = computed(() => {
11656
- var _a;
11657
11634
  if (Array.isArray(currentSelection.value)) {
11658
- return props.required === false || (((_a = currentSelection.value) == null ? void 0 : _a.length) ?? 0) > 1;
11635
+ return props.required === false || (currentSelection.value?.length ?? 0) > 1;
11659
11636
  } else {
11660
11637
  return !props.required;
11661
11638
  }
@@ -12076,14 +12053,13 @@ function concatenatePath(...fragments) {
12076
12053
  return fragments.map((f) => f.replace(/ /g, "_")).join(" ");
12077
12054
  }
12078
12055
  function findNodeByPath(rootNodes, path) {
12079
- var _a;
12080
12056
  const pathFragments = path.split(" ");
12081
12057
  let currentNode = void 0;
12082
12058
  for (const fragment of pathFragments) {
12083
12059
  if (!currentNode) {
12084
12060
  currentNode = rootNodes.find((node) => node.id === fragment);
12085
12061
  } else {
12086
- currentNode = (_a = currentNode.children) == null ? void 0 : _a.find((node) => node.id === fragment);
12062
+ currentNode = currentNode.children?.find((node) => node.id === fragment);
12087
12063
  }
12088
12064
  if (!currentNode) {
12089
12065
  break;
@@ -12118,7 +12094,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12118
12094
  }),
12119
12095
  emits: /* @__PURE__ */ mergeModels(["recalculate-tree-path", "set-child-node-height"], ["update:selectedPath"]),
12120
12096
  setup(__props, { emit: __emit }) {
12121
- var _a;
12122
12097
  const props = __props;
12123
12098
  const selectedPath = useModel(__props, "selectedPath");
12124
12099
  const emit = __emit;
@@ -12130,7 +12105,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12130
12105
  const childSubtreeDivs = ref([]);
12131
12106
  const childSubtreeHeights = computed(() => childSubtreeDivs.value.map((el) => useElementSize(el)));
12132
12107
  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));
12108
+ const childNodeContentHeights = ref(new Array(props.rootNode.children?.length ?? 0).fill(0));
12134
12109
  const treePathBranchesAt = ref([]);
12135
12110
  function recalculateTreePathBranches() {
12136
12111
  nodeContentBoundingBox.update();