fds-vue-core 6.2.6 → 6.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1015,7 +1015,7 @@ const _hoisted_9$4 = { key: 1 };
1015
1015
  const _hoisted_10$3 = { class: "flex items-start justify-between gap-4" };
1016
1016
  const _hoisted_11$3 = { class: "flex items-center gap-3" };
1017
1017
  const _hoisted_12$2 = { class: "m-0 text-base font-main font-bold tracking-wide" };
1018
- const _hoisted_13$1 = { class: "flex items-start gap-3" };
1018
+ const _hoisted_13$2 = { class: "flex items-start gap-3" };
1019
1019
  const _hoisted_14$1 = { class: "mb-0-last-child" };
1020
1020
  const smallIconSize = 24;
1021
1021
  const largeIconSize = 48;
@@ -1085,7 +1085,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
1085
1085
  }, null, 8, ["name"])) : vue.createCommentVNode("", true),
1086
1086
  vue.createElementVNode("h3", _hoisted_12$2, vue.toDisplayString(__props.heading), 1)
1087
1087
  ]),
1088
- vue.createElementVNode("div", _hoisted_13$1, [
1088
+ vue.createElementVNode("div", _hoisted_13$2, [
1089
1089
  vue.renderSlot(_ctx.$slots, "headerInfo")
1090
1090
  ])
1091
1091
  ])
@@ -8982,7 +8982,7 @@ const _hoisted_12$1 = {
8982
8982
  key: 0,
8983
8983
  class: "text-sm text-gray-600"
8984
8984
  };
8985
- const _hoisted_13 = {
8985
+ const _hoisted_13$1 = {
8986
8986
  key: 1,
8987
8987
  class: "max-h-72 overflow-auto border border-gray-200 rounded-md"
8988
8988
  };
@@ -9327,7 +9327,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
9327
9327
  iconSize: "small"
9328
9328
  }, {
9329
9329
  default: vue.withCtx(() => [
9330
- !sessionStorageEntries.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, "Inga värden i sessionStorage.")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
9330
+ !sessionStorageEntries.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, "Inga värden i sessionStorage.")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, [
9331
9331
  vue.createElementVNode("table", _hoisted_14, [
9332
9332
  _cache[15] || (_cache[15] = vue.createElementVNode("thead", { class: "bg-gray-50" }, [
9333
9333
  vue.createElementVNode("tr", null, [
@@ -10624,7 +10624,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
10624
10624
  name: {},
10625
10625
  dataTestid: { default: void 0 },
10626
10626
  inputClass: { default: void 0 },
10627
- disableFocusOutline: { type: Boolean, default: false },
10627
+ disablePseudoStates: { type: Boolean, default: false },
10628
10628
  onInput: {},
10629
10629
  onChange: {},
10630
10630
  onFocus: {},
@@ -10675,13 +10675,14 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
10675
10675
  const wrapperClasses = vue.computed(() => ["block relative flex items-center mb-2 last:mb-0"]);
10676
10676
  const innerWrapperClasses = vue.computed(() => [
10677
10677
  "flex p-0.5 items-start rounded-md",
10678
- "hover:bg-blue_t-100 active:bg-blue_t-200",
10679
- !props.disableFocusOutline && "[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
10678
+ !props.disablePseudoStates && "hover:bg-blue_t-100 active:bg-blue_t-200",
10679
+ props.disablePseudoStates ? "[&:has(:focus)]:outline-none [&:has(:focus-visible)]:outline-none" : "[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
10680
10680
  props.disabled && "hover:bg-transparent active:bg-transparent"
10681
10681
  ]);
10682
10682
  const inputClasses = vue.computed(() => [
10683
10683
  "rounded-md transition-colors duration-200 accent-blue-500 m-[3px]",
10684
- "peer z-2 bg-white min-w-[18px] min-h-[18px] focus-visible:outline-none",
10684
+ "peer z-2 bg-white min-w-[18px] min-h-[18px]",
10685
+ props.disablePseudoStates ? "focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0" : "focus-visible:outline-none",
10685
10686
  props.disabled && "cursor-not-allowed",
10686
10687
  props.inputClass
10687
10688
  ]);
@@ -10800,7 +10801,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
10800
10801
  tabindex: {},
10801
10802
  autofocus: { type: Boolean },
10802
10803
  inputClass: { default: void 0 },
10803
- disableFocusOutline: { type: Boolean, default: false },
10804
+ disablePseudoStates: { type: Boolean, default: false },
10804
10805
  onInput: {},
10805
10806
  onChange: {},
10806
10807
  onFocus: {},
@@ -10876,12 +10877,13 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
10876
10877
  const wrapperClasses = vue.computed(() => ["block relative flex items-center mb-2 last:mb-0"]);
10877
10878
  const innerWrapperClasses = vue.computed(() => [
10878
10879
  "flex p-0.5 items-start rounded-l-xl rounded-r-md",
10879
- "hover:bg-blue_t-100 active:bg-blue_t-200",
10880
- !props.disableFocusOutline && "[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
10880
+ !props.disablePseudoStates && "hover:bg-blue_t-100 active:bg-blue_t-200",
10881
+ props.disablePseudoStates ? "[&:has(:focus)]:outline-none [&:has(:focus-visible)]:outline-none" : "[&:has(:focus-visible)]:outline-2 [&:has(:focus-visible)]:outline-dashed [&:has(:focus-visible)]:-outline-offset-2 [&:has(:focus-visible)]:outline-blue-500",
10881
10882
  props.disabled && "hover:bg-transparent active:bg-transparent"
10882
10883
  ]);
10883
10884
  const inputClasses = vue.computed(() => [
10884
- "peer z-2 bg-white min-w-[20px] min-h-[20px] focus-visible:outline-none rounded-full accent-blue-500",
10885
+ "peer z-2 bg-white min-w-[20px] min-h-[20px] rounded-full accent-blue-500",
10886
+ props.disablePseudoStates ? "focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0" : "focus-visible:outline-none",
10885
10887
  props.disabled && "cursor-not-allowed",
10886
10888
  props.inputClass
10887
10889
  ]);
@@ -10919,6 +10921,7 @@ const useSearchSelectProItems = ({
10919
10921
  props,
10920
10922
  searchFields,
10921
10923
  searchTerm,
10924
+ bypassSearchFilter,
10922
10925
  showSelectedOnly,
10923
10926
  selectedItems,
10924
10927
  isMultiple,
@@ -11114,6 +11117,7 @@ const useSearchSelectProItems = ({
11114
11117
  });
11115
11118
  };
11116
11119
  const matchesSearchTerm = (item) => {
11120
+ if (bypassSearchFilter.value) return true;
11117
11121
  if (!searchTerm.value) return true;
11118
11122
  const searchValue = isPid.value ? searchTerm.value.replace(/\D/g, "") : searchTerm.value;
11119
11123
  const searchLower = searchValue.toLowerCase();
@@ -11129,6 +11133,7 @@ const useSearchSelectProItems = ({
11129
11133
  });
11130
11134
  };
11131
11135
  const matchesDividerSearchTerm = (item) => {
11136
+ if (bypassSearchFilter.value) return false;
11132
11137
  if (!isDividerItem(item) || !searchTerm.value) return false;
11133
11138
  const searchValue = isPid.value ? searchTerm.value.replace(/\D/g, "") : searchTerm.value;
11134
11139
  const searchLower = searchValue.toLowerCase();
@@ -11140,7 +11145,7 @@ const useSearchSelectProItems = ({
11140
11145
  });
11141
11146
  };
11142
11147
  const filterWithDividerGroups = (sourceData) => {
11143
- if (!searchTerm.value) return sourceData;
11148
+ if (bypassSearchFilter.value || !searchTerm.value) return sourceData;
11144
11149
  const matched = [];
11145
11150
  let currentDivider = null;
11146
11151
  let currentChildren = [];
@@ -11196,7 +11201,10 @@ const useSearchSelectProItems = ({
11196
11201
  } else {
11197
11202
  displayedItems.value = effectiveLimit !== null ? matchedArray.slice(0, effectiveLimit) : matchedArray;
11198
11203
  }
11199
- onTotal(matchingItems.value.length);
11204
+ const totalMatchingCount = matchingItems.value.filter(
11205
+ (item) => props.dividerSelectable || !isDividerItem(item)
11206
+ ).length;
11207
+ onTotal(totalMatchingCount);
11200
11208
  };
11201
11209
  const resetVisibleItemsLimit = () => {
11202
11210
  visibleItemsLimit.value = props.maxItems && props.maxItems > 0 ? props.maxItems : null;
@@ -11248,18 +11256,19 @@ const _hoisted_4$6 = {
11248
11256
  };
11249
11257
  const _hoisted_5$6 = ["id", "role", "onMouseup"];
11250
11258
  const _hoisted_6$4 = ["innerHTML"];
11251
- const _hoisted_7$4 = ["innerHTML"];
11259
+ const _hoisted_7$4 = ["onClick"];
11252
11260
  const _hoisted_8$3 = ["innerHTML"];
11253
- const _hoisted_9$1 = {
11261
+ const _hoisted_9$1 = ["innerHTML"];
11262
+ const _hoisted_10 = {
11254
11263
  key: 0,
11255
11264
  class: "border-b border-blue_t-200 p-3"
11256
11265
  };
11257
- const _hoisted_10 = ["aria-disabled"];
11258
- const _hoisted_11 = {
11266
+ const _hoisted_11 = ["aria-disabled"];
11267
+ const _hoisted_12 = {
11259
11268
  key: 2,
11260
11269
  class: "block m-0 list-none p-0"
11261
11270
  };
11262
- const _hoisted_12 = { class: "p-3" };
11271
+ const _hoisted_13 = { class: "p-3" };
11263
11272
  const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11264
11273
  __name: "FdsSearchSelectPro",
11265
11274
  props: {
@@ -11321,6 +11330,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11321
11330
  const emit = __emit;
11322
11331
  const dropdownVisible = vue.ref(false);
11323
11332
  const searchTerm = vue.ref("");
11333
+ const bypassSearchFilter = vue.ref(false);
11324
11334
  const selectedItem = vue.ref(null);
11325
11335
  const selectedItems = vue.ref([...props.initialSelectedItems ?? []]);
11326
11336
  const showSelectedOnly = vue.ref(false);
@@ -11351,6 +11361,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11351
11361
  props,
11352
11362
  searchFields,
11353
11363
  searchTerm,
11364
+ bypassSearchFilter,
11354
11365
  showSelectedOnly,
11355
11366
  selectedItems,
11356
11367
  isMultiple,
@@ -11458,6 +11469,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11458
11469
  return { maxHeight: `${maxHeight}px` };
11459
11470
  });
11460
11471
  const handleClear = () => {
11472
+ bypassSearchFilter.value = false;
11461
11473
  searchTerm.value = "";
11462
11474
  selectedItem.value = null;
11463
11475
  selectedItems.value = [];
@@ -11548,6 +11560,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11548
11560
  const handleInput = (e) => {
11549
11561
  const target = e.target;
11550
11562
  const { value } = target;
11563
+ bypassSearchFilter.value = false;
11551
11564
  searchTerm.value = value;
11552
11565
  dropdownVisible.value = true;
11553
11566
  if (!isMultiple.value) {
@@ -11696,7 +11709,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11696
11709
  selectItem(item);
11697
11710
  dropdownVisible.value = false;
11698
11711
  setTimeout(() => {
11699
- focusInput();
11712
+ handleBlurInput();
11700
11713
  }, 100);
11701
11714
  };
11702
11715
  const handleClick = (e, item) => {
@@ -11742,12 +11755,17 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11742
11755
  };
11743
11756
  const handleInputFocus = () => {
11744
11757
  inputHasFocus.value = true;
11745
- if ((isMultiple.value || !selectedItem.value) && displayedItems.value.length > 0) {
11758
+ if (!isMultiple.value && !!selectedItem.value) {
11759
+ bypassSearchFilter.value = true;
11760
+ filterAndPaginate();
11761
+ }
11762
+ if (displayedItems.value.length > 0) {
11746
11763
  dropdownVisible.value = true;
11747
11764
  }
11748
11765
  };
11749
11766
  const handleInputBlur = () => {
11750
11767
  inputHasFocus.value = false;
11768
+ bypassSearchFilter.value = false;
11751
11769
  };
11752
11770
  const handleListKeyDown = (e) => {
11753
11771
  const target = e.target;
@@ -11943,7 +11961,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11943
11961
  key: 0,
11944
11962
  label: `${__props.selectedToggleLabel} (${selectedItems.value.length})`,
11945
11963
  checked: showSelectedOnly.value,
11946
- disableFocusOutline: true,
11964
+ disablePseudoStates: true,
11947
11965
  onChange: handleToggleSelectedOnly
11948
11966
  }, null, 8, ["label", "checked"])) : vue.createCommentVNode("", true)
11949
11967
  ], 2),
@@ -11971,6 +11989,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11971
11989
  innerHTML: handleMatchingString(item)
11972
11990
  }, null, 14, _hoisted_6$4)) : (vue.openBlock(), vue.createElementBlock("div", {
11973
11991
  key: 1,
11992
+ onClick: () => handleMultipleSelectionChange(item),
11974
11993
  class: vue.normalizeClass([labelClasses.value, listItemClasses.value]),
11975
11994
  style: vue.normalizeStyle(vue.unref(optionPaddingStyle)(item))
11976
11995
  }, [
@@ -11980,7 +11999,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11980
11999
  name: `search-select-checkbox-group-${inputId}`,
11981
12000
  checked: vue.unref(isItemSelected)(item),
11982
12001
  tabindex: -1,
11983
- disableFocusOutline: true,
12002
+ disablePseudoStates: true,
11984
12003
  class: "mb-0!",
11985
12004
  onChange: () => handleMultipleSelectionChange(item)
11986
12005
  }, {
@@ -11988,7 +12007,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11988
12007
  vue.createElementVNode("span", {
11989
12008
  class: "min-w-0 flex-1",
11990
12009
  innerHTML: handleMatchingString(item)
11991
- }, null, 8, _hoisted_7$4)
12010
+ }, null, 8, _hoisted_8$3)
11992
12011
  ]),
11993
12012
  _: 2
11994
12013
  }, 1032, ["id", "name", "checked", "onChange"])) : (vue.openBlock(), vue.createBlock(_sfc_main$i, {
@@ -11998,7 +12017,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11998
12017
  value: index,
11999
12018
  checked: !!selectedItem.value && vue.unref(getItemIdentifier)(selectedItem.value) === vue.unref(getItemIdentifier)(item),
12000
12019
  tabindex: -1,
12001
- disableFocusOutline: true,
12020
+ disablePseudoStates: true,
12002
12021
  class: "mb-0!",
12003
12022
  onChange: () => handleSingleSelection(item),
12004
12023
  onKeydown: vue.withKeys((e) => handleClick(e, item), ["enter"])
@@ -12007,14 +12026,14 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
12007
12026
  vue.createElementVNode("span", {
12008
12027
  class: "min-w-0 flex-1",
12009
12028
  innerHTML: handleMatchingString(item)
12010
- }, null, 8, _hoisted_8$3)
12029
+ }, null, 8, _hoisted_9$1)
12011
12030
  ]),
12012
12031
  _: 2
12013
12032
  }, 1032, ["id", "value", "checked", "onChange", "onKeydown"]))
12014
- ], 6))
12033
+ ], 14, _hoisted_7$4))
12015
12034
  ], 42, _hoisted_5$6);
12016
12035
  }), 128)),
12017
- vue.unref(shouldShowLoadMore) ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_9$1, [
12036
+ vue.unref(shouldShowLoadMore) ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_10, [
12018
12037
  vue.createElementVNode("div", {
12019
12038
  class: vue.normalizeClass(["flex items-center gap-2 text-blue-600", { "cursor-pointer": !__props.loadingMore, "cursor-not-allowed opacity-70": __props.loadingMore }]),
12020
12039
  role: "button",
@@ -12034,11 +12053,11 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
12034
12053
  class: "w-6 h-6 pointer-events-none"
12035
12054
  }, null, 8, ["loading", "aria-label"]),
12036
12055
  vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMore ? resolvedLoadingMoreLabel.value : resolvedLoadMoreLabel.value), 1)
12037
- ], 42, _hoisted_10)
12056
+ ], 42, _hoisted_11)
12038
12057
  ])) : vue.createCommentVNode("", true)
12039
12058
  ], 32)
12040
- ], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_11, [
12041
- vue.createElementVNode("li", _hoisted_12, vue.toDisplayString(__props.noResultPrompt), 1)
12059
+ ], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_12, [
12060
+ vue.createElementVNode("li", _hoisted_13, vue.toDisplayString(__props.noResultPrompt), 1)
12042
12061
  ])) : vue.createCommentVNode("", true)
12043
12062
  ], 38)) : vue.createCommentVNode("", true)
12044
12063
  ])
@@ -15131,6 +15150,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
15131
15150
  disableNextWeek: { type: Boolean, default: false },
15132
15151
  enableHorizontalAnimation: { type: Boolean, default: true },
15133
15152
  minWeek: { default: void 0 },
15153
+ goToWeek: {},
15134
15154
  maxDate: { default: void 0 },
15135
15155
  previewOtherDays: { type: Boolean, default: false },
15136
15156
  selected: { default: null },
@@ -15210,6 +15230,17 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
15210
15230
  emit("select-date", newSelected ?? null);
15211
15231
  }
15212
15232
  );
15233
+ vue.watch(
15234
+ () => props.goToWeek?.getTime(),
15235
+ (newTimestamp) => {
15236
+ if (!newTimestamp) return;
15237
+ const normalizedWeek = startOfISOWeek(new Date(newTimestamp));
15238
+ if (isSameWeek(normalizedWeek, currentWeek.value, { weekStartsOn: 1 })) return;
15239
+ slideDirection.value = normalizedWeek.getTime() > currentWeek.value.getTime() ? "left" : "right";
15240
+ onHandleSetCurrentWeek(normalizedWeek);
15241
+ },
15242
+ { immediate: true }
15243
+ );
15213
15244
  const onHandleSelectedDay = (weekDay) => {
15214
15245
  selectedDay.value = weekDay;
15215
15246
  emit("select-date", weekDay);
@@ -15220,17 +15251,22 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
15220
15251
  }
15221
15252
  currentWeek.value = week;
15222
15253
  };
15254
+ const navigateToWeek = (week) => {
15255
+ const normalizedWeek = startOfISOWeek(week);
15256
+ if (isSameWeek(normalizedWeek, currentWeek.value, { weekStartsOn: 1 })) return;
15257
+ const isForward = normalizedWeek.getTime() > currentWeek.value.getTime();
15258
+ if (isForward && disableNextWeekInteraction.value) return;
15259
+ if (!isForward && disableLastWeekInteraction.value) return;
15260
+ slideDirection.value = isForward ? "left" : "right";
15261
+ onHandleSetCurrentWeek(normalizedWeek);
15262
+ };
15223
15263
  const incrementWeek = () => {
15224
- if (disableNextWeekInteraction.value) return;
15225
- slideDirection.value = "left";
15226
15264
  emit("increment-week");
15227
- onHandleSetCurrentWeek(addWeeks(currentWeek.value, 1));
15265
+ navigateToWeek(addWeeks(currentWeek.value, 1));
15228
15266
  };
15229
15267
  const decrementWeek = () => {
15230
- if (disableLastWeekInteraction.value) return;
15231
- slideDirection.value = "right";
15232
15268
  emit("decrement-week");
15233
- onHandleSetCurrentWeek(subWeeks(currentWeek.value));
15269
+ navigateToWeek(subWeeks(currentWeek.value));
15234
15270
  };
15235
15271
  const isWeekDayDisabled = (weekDay) => checkIfDateIsBeforeToday(weekDay) || !checkIfDateIsEnabled(weekDay, props.enabledDates);
15236
15272
  const isTodayDate = (weekDay) => isSameDay(weekDay, /* @__PURE__ */ new Date());