fds-vue-core 2.1.50 → 2.1.52

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.
@@ -753,10 +753,10 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
753
753
  const _hoisted_1$m = ["id"];
754
754
  const _hoisted_2$h = {
755
755
  key: 0,
756
- class: "flex items-start justify-between gap-4"
756
+ class: "flex items-start justify-between gap-4 mb-4"
757
757
  };
758
758
  const _hoisted_3$a = { class: "flex items-center gap-3" };
759
- const _hoisted_4$9 = { class: "flex items-start gap-3" };
759
+ const _hoisted_4$9 = { class: "flex items-start gap-3 leading-8" };
760
760
  const _hoisted_5$8 = { class: "mb-0-last-child" };
761
761
  const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
762
762
  __name: "FdsBlockContent",
@@ -777,7 +777,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
777
777
  props.borderLeft && "border-l-4",
778
778
  hasSlot.value ? "pb-6" : "pb-4"
779
779
  ]);
780
- const headerClasses = vue.computed(() => ["mt-0 mb-4 text-lg font-bold tracking-wide", !hasSlot.value && "mb-0!"]);
780
+ const headerClasses = vue.computed(() => ["m-0 text-lg font-bold tracking-wide", !hasSlot.value && "mb-0!"]);
781
781
  const borderLeftStyle = vue.computed(() => {
782
782
  if (!props.borderLeft) return {};
783
783
  const colorMap = {
@@ -1019,8 +1019,8 @@ const _hoisted_8$2 = {
1019
1019
  const _hoisted_9$2 = { key: 1 };
1020
1020
  const _hoisted_10$1 = { class: "flex items-start justify-between gap-4" };
1021
1021
  const _hoisted_11$1 = { class: "flex items-center gap-3" };
1022
- const _hoisted_12$1 = { class: "m-0 text-base font-main font-bold tracking-wide" };
1023
- const _hoisted_13$1 = { class: "flex items-start gap-3" };
1022
+ const _hoisted_12 = { class: "m-0 text-base font-main font-bold tracking-wide" };
1023
+ const _hoisted_13 = { class: "flex items-start gap-3" };
1024
1024
  const _hoisted_14 = { class: "mb-0-last-child" };
1025
1025
  const smallIconSize = 24;
1026
1026
  const largeIconSize = 48;
@@ -1088,9 +1088,9 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
1088
1088
  size: smallIconSize,
1089
1089
  class: "fill-blue-500"
1090
1090
  }, null, 8, ["name"])) : vue.createCommentVNode("", true),
1091
- vue.createElementVNode("h3", _hoisted_12$1, vue.toDisplayString(__props.heading), 1)
1091
+ vue.createElementVNode("h3", _hoisted_12, vue.toDisplayString(__props.heading), 1)
1092
1092
  ]),
1093
- vue.createElementVNode("div", _hoisted_13$1, [
1093
+ vue.createElementVNode("div", _hoisted_13, [
1094
1094
  vue.renderSlot(_ctx.$slots, "headerInfo")
1095
1095
  ])
1096
1096
  ])
@@ -8362,22 +8362,14 @@ const _hoisted_6$2 = {
8362
8362
  key: 0,
8363
8363
  class: "flex justify-center p-4"
8364
8364
  };
8365
- const _hoisted_7$2 = {
8366
- key: 0,
8367
- class: "block m-0 font-light p-6 border-b border-gray-200 rounded-t-md"
8368
- };
8369
- const _hoisted_8$1 = {
8370
- key: 1,
8371
- class: "block m-0 font-light p-4 border-b border-gray-200 rounded-t-md"
8372
- };
8373
- const _hoisted_9$1 = ["id", "aria-selected", "tabindex", "onMouseup", "onMouseenter", "onKeydown"];
8374
- const _hoisted_10 = ["id", "checked"];
8375
- const _hoisted_11 = ["for", "innerHTML"];
8376
- const _hoisted_12 = {
8365
+ const _hoisted_7$2 = ["id", "onMouseup"];
8366
+ const _hoisted_8$1 = ["id", "onKeydown"];
8367
+ const _hoisted_9$1 = ["for", "innerHTML"];
8368
+ const _hoisted_10 = {
8377
8369
  key: 2,
8378
8370
  class: "block m-0 list-none p-0"
8379
8371
  };
8380
- const _hoisted_13 = { class: "p-4" };
8372
+ const _hoisted_11 = { class: "p-4" };
8381
8373
  const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8382
8374
  __name: "FdsSearchSelect",
8383
8375
  props: {
@@ -8423,7 +8415,6 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8423
8415
  const matchingItems = vue.ref([]);
8424
8416
  const displayedItems = vue.ref([]);
8425
8417
  const selectedItem = vue.ref(null);
8426
- const focusedIndex = vue.ref(-1);
8427
8418
  const valid = vue.ref(props.valid ?? null);
8428
8419
  const totalCount = vue.computed(() => {
8429
8420
  if (props.totalCount !== void 0) {
@@ -8438,7 +8429,38 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8438
8429
  }
8439
8430
  );
8440
8431
  const componentRef = vue.ref(null);
8432
+ const dropdownRef = vue.ref(null);
8433
+ const inputComponentRef = vue.ref(null);
8441
8434
  const inputId = `searchSelectInput-${Math.random().toString(36).slice(2, 9)}`;
8435
+ const listboxId = `select-dropdown-${Math.random().toString(36).slice(2, 9)}`;
8436
+ const getInputElement = () => {
8437
+ if (inputComponentRef.value?.$el) {
8438
+ const input = inputComponentRef.value.$el.querySelector("input");
8439
+ if (input) return input;
8440
+ }
8441
+ return document.getElementById(inputId);
8442
+ };
8443
+ const focusInput = () => {
8444
+ vue.nextTick(() => {
8445
+ const input = getInputElement();
8446
+ input?.focus();
8447
+ });
8448
+ };
8449
+ const uncheckAllRadios = () => {
8450
+ if (!dropdownRef.value) return;
8451
+ const checkedRadio = dropdownRef.value.querySelector('input[name="search-select-radio-group"]:checked');
8452
+ if (checkedRadio) {
8453
+ checkedRadio.checked = false;
8454
+ }
8455
+ };
8456
+ const focusFirstRadio = () => {
8457
+ vue.nextTick(() => {
8458
+ const firstRadioButton = document.getElementById(`search-select-radio-0`);
8459
+ if (firstRadioButton) {
8460
+ firstRadioButton.focus();
8461
+ }
8462
+ });
8463
+ };
8442
8464
  const hasInputValue = vue.computed(() => searchTerm.value.length > 0);
8443
8465
  const listWrapperClasses = vue.computed(() => [
8444
8466
  "rounded-md box-border overflow-hidden z-4 w-full bg-white mt-2",
@@ -8450,7 +8472,16 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8450
8472
  const listItemClasses = vue.computed(() => [
8451
8473
  "block m-0",
8452
8474
  "outline-none! hover:bg-blue_t-100 active:bg-blue_t-200",
8453
- props.borderless && "border-b border-blue_t-200"
8475
+ "border-b border-blue_t-200"
8476
+ ]);
8477
+ const listItemWrapperClasses = vue.computed(() => [
8478
+ "block m-0 hover:outline-none",
8479
+ "has-focus:outline-2 has-focus:outline-blue-500 has-focus:-outline-offset-2 has-focus:outline-dashed"
8480
+ ]);
8481
+ const labelClasses = vue.computed(() => "block p-4 text-gray-700 cursor-pointer no-underline");
8482
+ const headerClasses = vue.computed(() => [
8483
+ "block m-0 font-light border-b border-gray-200 rounded-t-md",
8484
+ searchTerm.value && searchTerm.value.length ? "p-6" : "p-4"
8454
8485
  ]);
8455
8486
  const listWrapperStyle = vue.computed(() => {
8456
8487
  if (!props.maxListHeight) return null;
@@ -8507,13 +8538,14 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8507
8538
  emit("searchSelected", null);
8508
8539
  emit("clearInput", new Event("clearInput"));
8509
8540
  filterAndPaginate();
8541
+ focusInput();
8510
8542
  };
8511
8543
  vue.watch(
8512
8544
  () => props.clearTrigger,
8513
8545
  (value) => value && handleClear()
8514
8546
  );
8515
8547
  vue.watch(
8516
- () => props.items,
8548
+ () => [props.items, props.page],
8517
8549
  () => {
8518
8550
  filterAndPaginate();
8519
8551
  },
@@ -8552,18 +8584,6 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8552
8584
  }
8553
8585
  }
8554
8586
  );
8555
- vue.watch(
8556
- () => props.page,
8557
- () => {
8558
- filterAndPaginate();
8559
- }
8560
- );
8561
- vue.watch(
8562
- () => displayedItems.value,
8563
- () => {
8564
- focusedIndex.value = -1;
8565
- }
8566
- );
8567
8587
  const onClickOutside = (e) => {
8568
8588
  const target = e.target;
8569
8589
  if (componentRef.value?.contains(target)) return;
@@ -8586,10 +8606,10 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8586
8606
  searchTerm.value = value;
8587
8607
  dropdownVisible.value = true;
8588
8608
  selectedItem.value = null;
8589
- focusedIndex.value = -1;
8590
8609
  valid.value = null;
8591
8610
  filterAndPaginate();
8592
8611
  debouncedEmitInput(e);
8612
+ uncheckAllRadios();
8593
8613
  };
8594
8614
  const { isPid } = useIsPid(searchTerm);
8595
8615
  const { boldQuery } = useBoldQuery(searchTerm);
@@ -8621,9 +8641,6 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8621
8641
  }
8622
8642
  if (searchTerm.value) {
8623
8643
  const formattedTerm = formatPidWithDash(searchTerm.value);
8624
- if (formattedTerm !== searchTerm.value) {
8625
- searchTerm.value = formattedTerm;
8626
- }
8627
8644
  const escaped = formattedTerm.replace(/[()]/g, "\\$&");
8628
8645
  if (new RegExp(escaped, "i").test(result)) {
8629
8646
  return boldQuery(result);
@@ -8631,9 +8648,8 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8631
8648
  }
8632
8649
  return result;
8633
8650
  };
8634
- const handlePagination = (payload) => {
8635
- const newPage = payload.detail;
8636
- emit("paginate", newPage);
8651
+ const handlePagination = (_payload) => {
8652
+ emit("paginate", _payload.detail);
8637
8653
  };
8638
8654
  const selectItem = (item) => {
8639
8655
  selectedItem.value = item;
@@ -8648,13 +8664,9 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8648
8664
  const firstField = searchFields.value[0];
8649
8665
  searchTerm.value = (firstField ? item[firstField] : "") || "";
8650
8666
  selectItem(item);
8651
- focusedIndex.value = -1;
8652
8667
  dropdownVisible.value = false;
8653
8668
  setTimeout(() => {
8654
- const input = document.getElementById(inputId);
8655
- if (input) {
8656
- input.focus();
8657
- }
8669
+ focusInput();
8658
8670
  }, 100);
8659
8671
  }
8660
8672
  };
@@ -8664,76 +8676,33 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8664
8676
  }
8665
8677
  };
8666
8678
  const handleListKeyDown = (e) => {
8667
- const target = e.target;
8668
- const isRadioButton = target.tagName === "INPUT" && target.type === "radio";
8669
- const isListItem = target.closest('li[role="option"]');
8670
- if (isRadioButton || isListItem) {
8671
- handleInputKeyDown(e);
8679
+ if (e.key === "Escape") {
8680
+ e.preventDefault();
8681
+ dropdownVisible.value = false;
8682
+ uncheckAllRadios();
8683
+ focusInput();
8672
8684
  }
8673
8685
  };
8674
8686
  const handleInputKeyDown = (e) => {
8675
- if (!dropdownVisible.value && displayedItems.value.length > 0) {
8676
- if (e.key === "ArrowDown" || e.key === "Enter") {
8677
- e.preventDefault();
8687
+ if (e.key === "ArrowDown" && displayedItems.value.length > 0) {
8688
+ e.preventDefault();
8689
+ if (!dropdownVisible.value) {
8678
8690
  dropdownVisible.value = true;
8679
- focusedIndex.value = 0;
8680
- setTimeout(() => {
8681
- const firstRadioButton = document.getElementById(`search-select-radio-0`);
8682
- if (firstRadioButton) {
8683
- firstRadioButton.focus();
8684
- firstRadioButton.setAttribute("checked", "true");
8685
- }
8686
- }, 0);
8687
- return;
8688
8691
  }
8692
+ focusFirstRadio();
8693
+ return;
8689
8694
  }
8690
- if (!dropdownVisible.value) return;
8691
- switch (e.key) {
8692
- case "ArrowDown":
8693
- e.preventDefault();
8694
- e.stopPropagation();
8695
- if (focusedIndex.value < displayedItems.value.length - 1) {
8696
- focusedIndex.value++;
8697
- } else {
8698
- focusedIndex.value = 0;
8699
- }
8700
- break;
8701
- case "ArrowUp":
8702
- e.preventDefault();
8703
- e.stopPropagation();
8704
- if (focusedIndex.value > 0) {
8705
- focusedIndex.value--;
8706
- } else {
8707
- focusedIndex.value = displayedItems.value.length - 1;
8708
- }
8709
- break;
8710
- case "Enter":
8711
- e.preventDefault();
8712
- if (focusedIndex.value >= 0 && focusedIndex.value < displayedItems.value.length) {
8713
- const focusedItem = displayedItems.value[focusedIndex.value];
8714
- if (focusedItem) {
8715
- handleClick(e, focusedItem);
8716
- }
8717
- } else if (displayedItems.value.length === 1) {
8718
- const onlyItem = displayedItems.value[0];
8719
- if (onlyItem) {
8720
- handleClick(e, onlyItem);
8721
- }
8722
- }
8723
- break;
8724
- case "Escape":
8725
- e.preventDefault();
8726
- dropdownVisible.value = false;
8727
- focusedIndex.value = -1;
8728
- const input = document.getElementById(inputId);
8729
- input?.focus();
8730
- break;
8731
- case "Tab":
8732
- if (!dropdownVisible.value) {
8733
- dropdownVisible.value = false;
8734
- focusedIndex.value = -1;
8735
- }
8736
- break;
8695
+ if (e.key === "Enter" && !dropdownVisible.value && displayedItems.value.length > 0) {
8696
+ e.preventDefault();
8697
+ dropdownVisible.value = true;
8698
+ focusFirstRadio();
8699
+ return;
8700
+ }
8701
+ if (e.key === "Escape" && dropdownVisible.value) {
8702
+ e.preventDefault();
8703
+ dropdownVisible.value = false;
8704
+ uncheckAllRadios();
8705
+ focusInput();
8737
8706
  }
8738
8707
  };
8739
8708
  vue.onMounted(() => {
@@ -8743,7 +8712,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8743
8712
  }
8744
8713
  window.addEventListener("mouseup", onClickOutside);
8745
8714
  vue.nextTick(() => {
8746
- const input = document.getElementById(inputId);
8715
+ const input = getInputElement();
8747
8716
  if (input) {
8748
8717
  input.addEventListener("keydown", handleInputKeyDown);
8749
8718
  input.addEventListener("focus", handleInputFocus);
@@ -8753,7 +8722,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8753
8722
  });
8754
8723
  vue.onBeforeUnmount(() => {
8755
8724
  window.removeEventListener("mouseup", onClickOutside);
8756
- const input = document.getElementById(inputId);
8725
+ const input = getInputElement();
8757
8726
  if (input) {
8758
8727
  input.removeEventListener("keydown", handleInputKeyDown);
8759
8728
  input.removeEventListener("focus", handleInputFocus);
@@ -8766,6 +8735,26 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8766
8735
  }
8767
8736
  return attrs;
8768
8737
  });
8738
+ const activeDescendantId = vue.computed(() => {
8739
+ if (!dropdownVisible.value || !dropdownRef.value) return null;
8740
+ const checkedRadio = dropdownRef.value.querySelector('input[name="search-select-radio-group"]:checked');
8741
+ return checkedRadio?.id || null;
8742
+ });
8743
+ const inputAriaAttrs = vue.computed(() => {
8744
+ const attrs = {
8745
+ role: "combobox",
8746
+ "aria-expanded": dropdownVisible.value,
8747
+ "aria-autocomplete": "list",
8748
+ "aria-haspopup": "listbox"
8749
+ };
8750
+ if (dropdownVisible.value && listboxId) {
8751
+ attrs["aria-controls"] = listboxId;
8752
+ }
8753
+ if (activeDescendantId.value) {
8754
+ attrs["aria-activedescendant"] = activeDescendantId.value;
8755
+ }
8756
+ return attrs;
8757
+ });
8769
8758
  return (_ctx, _cache) => {
8770
8759
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
8771
8760
  ref_key: "componentRef",
@@ -8775,7 +8764,9 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8775
8764
  vue.createElementVNode("div", _hoisted_1$9, [
8776
8765
  !singleItemName.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
8777
8766
  vue.createElementVNode("div", _hoisted_3$5, [
8778
- vue.createVNode(_sfc_main$h, {
8767
+ vue.createVNode(_sfc_main$h, vue.mergeProps({
8768
+ ref_key: "inputComponentRef",
8769
+ ref: inputComponentRef,
8779
8770
  label: __props.label,
8780
8771
  meta: __props.meta ?? void 0,
8781
8772
  labelLeft: __props.labelLeft,
@@ -8789,10 +8780,11 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8789
8780
  id: inputId,
8790
8781
  clearButton: !!searchTerm.value,
8791
8782
  mask: pidMask.value,
8792
- maskOptions: { lazy: true },
8783
+ maskOptions: { lazy: true }
8784
+ }, inputAriaAttrs.value, {
8793
8785
  onInput: handleInput,
8794
8786
  onClearInput: handleClear
8795
- }, null, 8, ["label", "meta", "labelLeft", "valid", "invalidMessage", "disabled", "locale", "value", "clearButton", "mask"]),
8787
+ }), null, 16, ["label", "meta", "labelLeft", "valid", "invalidMessage", "disabled", "locale", "value", "clearButton", "mask"]),
8796
8788
  !__props.disabled && !hasInputValue.value ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
8797
8789
  key: 0,
8798
8790
  name: "search",
@@ -8806,11 +8798,10 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8806
8798
  ])),
8807
8799
  dropdownVisible.value && !singleItemName.value.length && !__props.disabled ? (vue.openBlock(), vue.createElementBlock("div", {
8808
8800
  key: 2,
8801
+ ref_key: "dropdownRef",
8802
+ ref: dropdownRef,
8809
8803
  class: vue.normalizeClass(listWrapperClasses.value),
8810
- style: vue.normalizeStyle(listWrapperStyle.value),
8811
- "aria-haspopup": "listbox",
8812
- "aria-expanded": "false",
8813
- "aria-controls": "select-dropdown"
8804
+ style: vue.normalizeStyle(listWrapperStyle.value)
8814
8805
  }, [
8815
8806
  __props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
8816
8807
  vue.createVNode(_sfc_main$o, {
@@ -8818,43 +8809,43 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8818
8809
  size: "48px"
8819
8810
  })
8820
8811
  ])) : displayedItems.value && displayedItems.value.length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
8821
- searchTerm.value && searchTerm.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, vue.toDisplayString(displayedItems.value.length) + " " + vue.toDisplayString(__props.searchContext.linkWord) + " " + vue.toDisplayString(totalCount.value) + " " + vue.toDisplayString(__props.searchContext.context), 1)) : !searchTerm.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, vue.toDisplayString(totalCount.value) + " " + vue.toDisplayString(__props.searchContext.context), 1)) : vue.createCommentVNode("", true),
8812
+ searchTerm.value && searchTerm.value.length ? (vue.openBlock(), vue.createElementBlock("div", {
8813
+ key: 0,
8814
+ class: vue.normalizeClass(headerClasses.value)
8815
+ }, vue.toDisplayString(displayedItems.value.length) + " " + vue.toDisplayString(__props.searchContext.linkWord) + " " + vue.toDisplayString(totalCount.value) + " " + vue.toDisplayString(__props.searchContext.context), 3)) : !searchTerm.value.length ? (vue.openBlock(), vue.createElementBlock("div", {
8816
+ key: 1,
8817
+ class: vue.normalizeClass(headerClasses.value)
8818
+ }, vue.toDisplayString(totalCount.value) + " " + vue.toDisplayString(__props.searchContext.context), 3)) : vue.createCommentVNode("", true),
8822
8819
  vue.createElementVNode("ul", {
8823
8820
  class: "block m-0 list-none p-0",
8824
8821
  role: "listbox",
8825
- id: "select-dropdown",
8822
+ id: listboxId,
8826
8823
  onKeydown: handleListKeyDown
8827
8824
  }, [
8828
8825
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayedItems.value, (item, index) => {
8829
8826
  return vue.openBlock(), vue.createElementBlock("li", {
8830
8827
  key: index,
8831
8828
  id: `search-select-item-${index}`,
8832
- class: vue.normalizeClass(["block m-0 hover:outline-none focus:outline-2 focus:outline-blue-500 -outline-offset-2", [focusedIndex.value === index && "outline-dashed outline-2 outline-blue-500 -outline-offset-2 "]]),
8829
+ class: vue.normalizeClass(listItemWrapperClasses.value),
8833
8830
  role: "option",
8834
- "aria-selected": focusedIndex.value === index,
8835
- tabindex: dropdownVisible.value && focusedIndex.value === index ? 0 : -1,
8836
- onMouseup: (e) => handleClick(e, item),
8837
- onMouseenter: ($event) => focusedIndex.value = index,
8838
- onKeydown: [
8839
- vue.withKeys((e) => handleClick(e, item), ["enter"]),
8840
- vue.withKeys(vue.withModifiers((e) => handleClick(e, item), ["prevent"]), ["space"])
8841
- ]
8831
+ onMouseup: (e) => handleClick(e, item)
8842
8832
  }, [
8843
- (vue.openBlock(), vue.createElementBlock("input", {
8833
+ vue.createElementVNode("input", {
8844
8834
  type: "radio",
8845
8835
  id: `search-select-radio-${index}`,
8846
- name: "social-account",
8836
+ name: "search-select-radio-group",
8847
8837
  class: "absolute left-0 opacity-0",
8848
- checked: focusedIndex.value === index,
8849
- key: `radio-${index}-${focusedIndex.value}`,
8850
- tabindex: "-1"
8851
- }, null, 8, _hoisted_10)),
8838
+ onKeydown: [
8839
+ vue.withKeys((e) => handleClick(e, item), ["enter"]),
8840
+ vue.withKeys(vue.withModifiers((e) => handleClick(e, item), ["prevent"]), ["space"])
8841
+ ]
8842
+ }, null, 40, _hoisted_8$1),
8852
8843
  vue.createElementVNode("label", {
8853
8844
  for: `search-select-radio-${index}`,
8854
- class: vue.normalizeClass(["block p-4 text-gray-700 cursor-pointer no-underline", listItemClasses.value]),
8845
+ class: vue.normalizeClass([labelClasses.value, listItemClasses.value]),
8855
8846
  innerHTML: handleMatchingString(item)
8856
- }, null, 10, _hoisted_11)
8857
- ], 42, _hoisted_9$1);
8847
+ }, null, 10, _hoisted_9$1)
8848
+ ], 42, _hoisted_7$2);
8858
8849
  }), 128))
8859
8850
  ], 32),
8860
8851
  __props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$g, {
@@ -8864,8 +8855,8 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
8864
8855
  onPaginate: handlePagination,
8865
8856
  class: "my-4! px-2"
8866
8857
  }, null, 8, ["current", "max"])) : vue.createCommentVNode("", true)
8867
- ], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_12, [
8868
- vue.createElementVNode("li", _hoisted_13, vue.toDisplayString(__props.noResultPrompt), 1)
8858
+ ], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_10, [
8859
+ vue.createElementVNode("li", _hoisted_11, vue.toDisplayString(__props.noResultPrompt), 1)
8869
8860
  ])) : vue.createCommentVNode("", true)
8870
8861
  ], 6)) : vue.createCommentVNode("", true)
8871
8862
  ])
@@ -10887,6 +10878,53 @@ function _sfc_render(_ctx, _cache) {
10887
10878
  return vue.openBlock(), vue.createElementBlock("hr", _hoisted_1);
10888
10879
  }
10889
10880
  const FdsSeparator = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
10881
+ function useFileValidation(options = {}) {
10882
+ const defaultOptions = {
10883
+ allowedExtensions: [],
10884
+ allowedMimeTypes: []
10885
+ };
10886
+ const config = { ...defaultOptions, ...options };
10887
+ const validateFile = (file) => {
10888
+ if (!file) {
10889
+ return { isValid: false, error: "No file provided" };
10890
+ }
10891
+ const fileName = file.name.toLowerCase();
10892
+ const fileExtension = fileName.substring(fileName.lastIndexOf("."));
10893
+ const fileMimeType = file.type;
10894
+ const isValidExtension = config.allowedExtensions.length === 0 || config.allowedExtensions.some((ext) => ext.toLowerCase() === fileExtension);
10895
+ const isValidMimeType = config.allowedMimeTypes.length === 0 || config.allowedMimeTypes.includes(fileMimeType);
10896
+ const isValid = isValidExtension || isValidMimeType;
10897
+ if (!isValid) {
10898
+ return {
10899
+ isValid: false,
10900
+ error: `File type not allowed. Allowed types: ${config.allowedExtensions.join(", ")}`
10901
+ };
10902
+ }
10903
+ return { isValid: true };
10904
+ };
10905
+ return {
10906
+ validateFile
10907
+ };
10908
+ }
10909
+ function useFileSizeValidation(maxFileSize) {
10910
+ const validateFileSize = (file) => {
10911
+ if (!file) {
10912
+ return { isValid: false, error: "No file provided" };
10913
+ }
10914
+ if (file.size > maxFileSize) {
10915
+ const maxSizeMB = (maxFileSize / (1024 * 1024)).toFixed(2);
10916
+ const fileSizeMB = (file.size / (1024 * 1024)).toFixed(2);
10917
+ return {
10918
+ isValid: false,
10919
+ error: `File size (${fileSizeMB} MB) exceeds maximum allowed size of ${maxSizeMB} MB`
10920
+ };
10921
+ }
10922
+ return { isValid: true };
10923
+ };
10924
+ return {
10925
+ validateFileSize
10926
+ };
10927
+ }
10890
10928
  const logoFeelgoodColored = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='83'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%230c4899'%20d='M39.389%2011.947L36.139%2026h.001%208.038v3H35.55l-2.575%2012.093c-.813%203.982-1.716%207.964-2.711%2011.857-1.625%206.336-5.781%2017.378-9.576%2022.628C16.804%2081.009%2013.641%2083%206.866%2083%203.433%2083%200%2080.375%200%2076.845c0-2.353%201.806-4.344%204.246-4.344%202.078%200%204.246%201.266%204.246%203.62%200%201.086-.361%201.72-.723%202.172s-.722.724-.722%201.267c0%201.177%201.535%201.177%202.348%201.177%202.982%200%205.692-2.263%207.77-9.052%201.445-4.706%202.259-9.684%203.162-14.481L25.948%2029h-8.421l-.001-3h9.258s-.076.268%200%200c2.628-9.359%206.73-20.689%2016.038-24.824C44.268.543%2045.984%200%2048.514%200%2052.85%200%2058%202.262%2058%207.241c0%203.077-1.897%204.706-4.879%204.706-2.62%200-3.975-1.629-4.246-4.163-.18-1.448.813-2.897%201.626-3.62%201.988-1.72-1.626-1.902-2.529-1.902-4.427%200-7.318%204.254-8.583%209.685zm9.227%2028.868h8.559v-4.608c0-5.186-2.222-5.432-4.279-5.432-2.881%200-4.28%201.727-4.28%205.679v4.361zm17.53%201.976h-17.53v7.571c0%205.926%202.222%208.807%205.926%208.807%204.938%200%208.888-2.634%209.958-8.231h1.975c-1.317%206.337-5.843%2010.452-12.427%2010.452-9.547%200-14.978-7.242-14.978-16.295%200-8.148%205.596-16.049%2014.319-16.049%207.654%200%2012.757%206.584%2012.757%2013.745zm12.403-1.976h8.559v-4.608c0-5.186-2.222-5.432-4.279-5.432-2.881%200-4.28%201.727-4.28%205.679v4.361zm17.53%201.976h-17.53v7.571c0%205.926%202.222%208.807%205.926%208.807%204.938%200%208.888-2.634%209.958-8.231h1.975c-1.317%206.337-5.843%2010.452-12.427%2010.452-9.547%200-14.979-7.242-14.979-16.295%200-8.148%205.597-16.049%2014.32-16.049%207.654%200%2012.757%206.584%2012.757%2013.745zM101.159%209h-3.457V7h12.181v52h3.456v2H98v-2h3.159V9z'/%3e%3cpath%20fill='%23e31c0d'%20d='M126.892%2050.691h-2.469c-4.115%200-5.679%201.646-5.679%203.539%200%201.482.905%202.716%204.773%202.716l9.547-.164c6.749-.165%209.959%203.209%209.959%208.394%200%206.584-4.527%2014.156-15.308%2014.156-10.287%200-12.098-5.761-12.098-7.655%200-3.867%201.811-5.348%206.007-7.653-4.032-1.152-6.089-3.703-6.089-7.983%200-3.704%203.456-6.172%206.584-6.749v-.164c-3.869-1.4-6.502-5.103-6.502-9.547%200-2.716%202.387-10.535%2012.344-10.535%202.799%200%205.515%201.071%207.82%202.634.822-1.728%202.632-3.704%204.69-3.704%201.811%200%203.374.905%203.374%202.881%200%201.563-.987%202.469-2.551%202.469-1.316%200-2.221-.493-2.798-1.728a5.2%205.2%200%200%200-1.81%201.152c2.14%201.81%203.127%204.526%203.127%207.325%200%204.937-2.881%2010.616-12.921%2010.616zm-3.292-9.958c0%206.502.823%208.23%204.279%208.23%203.21%200%203.704-1.399%203.704-10.699%200-6.749-1.07-7.489-3.622-7.489-3.949%200-4.361%201.893-4.361%209.958zm10.369%2023.62h-11.11c-.988%201.729-1.564%202.634-1.564%204.774%200%205.267%203.128%207.9%208.231%207.9%205.513%200%2010.863-3.868%2010.863-8.888%200-2.386-.658-3.786-6.42-3.786zm19.418-26.912v14.814c0%205.349%201.234%207.572%204.773%207.572%203.951%200%204.774-2.223%204.774-7.49V37.441c0-6.09-2.305-6.831-4.774-6.831s-4.773.741-4.773%206.831zm4.773%2023.949c-9.628%200-14.237-8.065-14.237-16.131%200-8.147%204.609-16.213%2014.237-16.213s14.239%208.066%2014.239%2016.213c0%208.066-4.61%2016.131-14.239%2016.131zm27.217-23.949v14.814c0%205.349%201.234%207.572%204.773%207.572%203.951%200%204.774-2.223%204.774-7.49V37.441c0-6.09-2.305-6.831-4.774-6.831s-4.773.741-4.773%206.831zm4.773%2023.949c-9.628%200-14.238-8.065-14.238-16.131%200-8.147%204.61-16.213%2014.238-16.213s14.239%208.066%2014.239%2016.213c0%208.066-4.61%2016.131-14.239%2016.131zm37.505-12.592v-5.103c0-5.678-1.234-12.674-7.078-12.674-3.539%200-3.621%205.349-3.621%208.724v12.839c0%202.963.247%206.83%203.786%206.83%203.292%200%206.831-2.88%206.913-10.616zM236.379%2059H240v2h-12.263v-4.301h-.164c-1.317%202.881-4.444%204.692-7.819%204.692-8.806%200-12.098-8.23-12.098-15.802%200-10.287%204.855-16.542%2012.427-16.542%203.292%200%206.009%202.222%207.407%204.773h.165V8.883h-3.95V7h12.674v52z'/%3e%3c/svg%3e";
10891
10929
  const logoFeelgoodLight = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='83'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20fill='%23fff'%20d='M39.389%2011.947L36.139%2026h.001%208.038v3H35.55l-2.575%2012.093c-.813%203.982-1.716%207.964-2.711%2011.857-1.625%206.336-5.781%2017.378-9.576%2022.628C16.804%2081.009%2013.641%2083%206.866%2083%203.433%2083%200%2080.375%200%2076.845c0-2.353%201.806-4.344%204.246-4.344%202.078%200%204.246%201.266%204.246%203.62%200%201.086-.361%201.72-.723%202.172s-.722.724-.722%201.267c0%201.177%201.535%201.177%202.348%201.177%202.982%200%205.692-2.263%207.77-9.052%201.445-4.706%202.259-9.684%203.162-14.481L25.948%2029h-8.421l-.001-3h9.258s-.076.268%200%200c2.628-9.359%206.73-20.689%2016.038-24.824C44.268.543%2045.984%200%2048.514%200%2052.85%200%2058%202.262%2058%207.241c0%203.077-1.897%204.706-4.879%204.706-2.62%200-3.975-1.629-4.246-4.163-.18-1.448.813-2.897%201.626-3.62%201.988-1.72-1.626-1.902-2.529-1.902-4.427%200-7.318%204.254-8.583%209.685zm9.227%2028.868h8.559v-4.608c0-5.186-2.222-5.432-4.279-5.432-2.881%200-4.28%201.727-4.28%205.679v4.361zm17.53%201.976h-17.53v7.571c0%205.926%202.222%208.807%205.926%208.807%204.938%200%208.888-2.634%209.958-8.231h1.975c-1.317%206.337-5.843%2010.452-12.427%2010.452-9.547%200-14.978-7.242-14.978-16.295%200-8.148%205.596-16.049%2014.319-16.049%207.654%200%2012.757%206.584%2012.757%2013.745zm12.403-1.976h8.559v-4.608c0-5.186-2.222-5.432-4.279-5.432-2.881%200-4.28%201.727-4.28%205.679v4.361zm17.53%201.976h-17.53v7.571c0%205.926%202.222%208.807%205.926%208.807%204.938%200%208.888-2.634%209.958-8.231h1.975c-1.317%206.337-5.843%2010.452-12.427%2010.452-9.547%200-14.979-7.242-14.979-16.295%200-8.148%205.597-16.049%2014.32-16.049%207.654%200%2012.757%206.584%2012.757%2013.745zM101.159%209h-3.457V7h12.181v52h3.456v2H98v-2h3.159V9zm25.733%2041.691h-2.469c-4.115%200-5.679%201.646-5.679%203.539%200%201.482.905%202.716%204.773%202.716%203.21%200%206.42-.082%209.547-.164%206.749-.165%209.959%203.209%209.959%208.394%200%206.584-4.527%2014.156-15.308%2014.156-10.287%200-12.098-5.761-12.098-7.655%200-3.867%201.811-5.348%206.007-7.653-4.032-1.152-6.089-3.703-6.089-7.983%200-3.704%203.456-6.172%206.584-6.749v-.164c-3.869-1.4-6.502-5.103-6.502-9.547%200-2.716%202.387-10.535%2012.344-10.535%202.799%200%205.515%201.071%207.82%202.634.822-1.728%202.632-3.704%204.69-3.704%201.811%200%203.374.905%203.374%202.881%200%201.563-.987%202.469-2.551%202.469-1.316%200-2.221-.493-2.798-1.728a5.2%205.2%200%200%200-1.81%201.152c2.14%201.81%203.127%204.526%203.127%207.325%200%204.937-2.881%2010.616-12.921%2010.616zm-3.292-9.958c0%206.502.823%208.23%204.279%208.23%203.21%200%203.704-1.399%203.704-10.699%200-6.749-1.07-7.489-3.622-7.489-3.949%200-4.361%201.893-4.361%209.958zm10.369%2023.62h-11.11c-.988%201.729-1.564%202.634-1.564%204.774%200%205.267%203.128%207.9%208.231%207.9%205.513%200%2010.863-3.868%2010.863-8.888%200-2.386-.658-3.786-6.42-3.786zm19.418-26.912v14.814c0%205.349%201.234%207.572%204.773%207.572%203.951%200%204.774-2.223%204.774-7.49V37.441c0-6.09-2.305-6.831-4.774-6.831s-4.773.741-4.773%206.831zm4.773%2023.949c-9.628%200-14.237-8.065-14.237-16.131%200-8.147%204.609-16.213%2014.237-16.213s14.239%208.066%2014.239%2016.213c0%208.066-4.61%2016.131-14.239%2016.131zm27.217-23.949v14.814c0%205.349%201.234%207.572%204.773%207.572%203.951%200%204.774-2.223%204.774-7.49V37.441c0-6.09-2.305-6.831-4.774-6.831s-4.773.741-4.773%206.831zm4.773%2023.949c-9.628%200-14.238-8.065-14.238-16.131%200-8.147%204.61-16.213%2014.238-16.213s14.239%208.066%2014.239%2016.213c0%208.066-4.61%2016.131-14.239%2016.131zm37.505-12.592v-5.103c0-5.678-1.234-12.674-7.078-12.674-3.539%200-3.621%205.349-3.621%208.724v12.839c0%202.963.247%206.83%203.786%206.83%203.292%200%206.831-2.88%206.913-10.616zM236.379%2059H240v2h-12.263v-4.301h-.164c-1.317%202.881-4.444%204.692-7.819%204.692-8.806%200-12.098-8.23-12.098-15.802%200-10.287%204.855-16.542%2012.427-16.542%203.292%200%206.009%202.222%207.407%204.773h.165V8.883h-3.95V7h12.674v52z'/%3e%3c/svg%3e";
10892
10930
  const bankid = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='85'%20height='80'%20fill='%23193e4f'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M26.693%2041.74l3.534-22.276h-3.775c-1.767%200-4.043-.991-4.712-2.811-.214-.616-.723-2.731%202.195-4.793%201.044-.723%201.714-1.526%201.847-2.142.134-.643-.027-1.205-.482-1.633-.643-.616-1.901-.964-3.507-.964-2.704%200-4.605%201.553-4.792%202.677-.134.83.509%201.499%201.071%201.928%201.687%201.258%202.088%203.079%201.044%204.793-1.071%201.767-3.4%202.918-5.89%202.945H9.371L3.4%2057.51h20.83l2.463-15.77zM2.276%2065.221h8.541c3.641%200%204.525%201.847%204.257%203.534-.214%201.366-1.151%202.383-2.758%203.052%202.035.776%202.838%201.981%202.544%203.882-.375%202.383-2.436%204.15-5.141%204.15H0l2.276-14.618zm5.649%206.051c1.66%200%202.436-.884%202.597-1.928.161-1.124-.348-1.901-2.008-1.901H7.042l-.589%203.829h1.473zm-.91%206.292c1.714%200%202.704-.696%202.945-2.115.187-1.232-.509-1.954-2.169-1.954h-1.66l-.643%204.096h1.526v-.027zm19.812%202.383c-2.222.161-3.293-.08-3.829-1.044-1.178.723-2.49%201.098-3.882%201.098-2.517%200-3.4-1.312-3.159-2.758.107-.696.509-1.365%201.151-1.928%201.392-1.205%204.819-1.365%206.158-2.276.107-1.017-.294-1.392-1.553-1.392-1.473%200-2.704.482-4.819%201.928l.509-3.32c1.821-1.312%203.588-1.928%205.623-1.928%202.597%200%204.9%201.071%204.471%203.909l-.509%203.213c-.187%201.124-.134%201.473%201.125%201.499l-1.285%202.999zm-3.855-5.06c-1.178.75-3.373.616-3.615%202.169-.107.723.348%201.258%201.071%201.258.696%200%201.553-.294%202.249-.776-.054-.268-.027-.535.053-1.044l.241-1.606zm8.005-6.373h4.445l-.241%201.472c1.419-1.205%202.49-1.66%203.882-1.66%202.49%200%203.641%201.526%203.24%204.016l-1.151%207.47h-4.444l.964-6.185c.187-1.124-.161-1.66-1.017-1.66-.696%200-1.339.375-1.955%201.205l-1.017%206.613h-4.444l1.74-11.272zm14.806-3.293h4.445l-1.125%207.175%204.257-3.882h5.489l-5.462%204.819%204.391%206.479h-5.596l-3.373-5.248h-.054l-.803%205.221h-4.444l2.276-14.565zm15.716%200h5.114l-2.249%2014.592H59.25l2.249-14.592zm7.604%200h7.309c5.649%200%207.282%204.096%206.747%207.497-.509%203.32-3.133%207.095-8.086%207.095h-8.246l2.276-14.592zm4.739%2011.111c2.49%200%203.855-1.232%204.257-3.829.294-1.928-.295-3.829-3.052-3.829h-1.365l-1.178%207.657h1.339zM54.699%200H33.414l-2.838%2018.019h3.614c1.981%200%203.855-.91%204.659-2.222.268-.428.375-.803.375-1.151%200-.75-.509-1.312-1.017-1.687-1.392-1.044-1.687-2.142-1.687-2.918%200-.161%200-.295.027-.428.294-1.901%202.865-3.963%206.265-3.963%202.035%200%203.588.482%204.525%201.365.83.776%201.151%201.874.91%203.025-.294%201.365-1.66%202.49-2.436%203.052-2.062%201.446-1.794%202.704-1.66%203.079.428%201.124%202.062%201.847%203.32%201.847h5.515v.027c7.497.054%2011.513%203.507%2010.254%2011.54-1.178%207.47-6.908%2010.683-13.735%2010.736l-2.704%2017.242h3.989c16.841%200%2030.602-10.817%2033.307-27.898C87.443%208.461%2073.976%200%2054.699%200z'/%3e%3c/svg%3e";
@@ -10965,6 +11003,8 @@ exports.logoFeelgoodColored = logoFeelgoodColored;
10965
11003
  exports.logoFeelgoodLight = logoFeelgoodLight;
10966
11004
  exports.useBoldQuery = useBoldQuery;
10967
11005
  exports.useDownload = useDownload;
11006
+ exports.useFileSizeValidation = useFileSizeValidation;
11007
+ exports.useFileValidation = useFileValidation;
10968
11008
  exports.useIsPid = useIsPid;
10969
11009
  exports.useTreeState = useTreeState;
10970
11010
  //# sourceMappingURL=fds-vue-core.cjs.js.map