fds-vue-core 2.1.22 → 2.1.25
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.
- package/dist/fds-vue-core.cjs.js +346 -265
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +347 -266
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Blocks/FdsBlockAlert/FdsBlockAlert.vue +4 -2
- package/src/components/Blocks/FdsBlockAlert/types.ts +3 -2
- package/src/components/Blocks/FdsBlockContent/FdsBlockContent.vue +5 -3
- package/src/components/Blocks/FdsBlockContent/types.ts +4 -2
- package/src/components/Blocks/FdsBlockExpander/FdsBlockExpander.vue +15 -10
- package/src/components/Blocks/FdsBlockExpander/types.ts +4 -3
- package/src/components/Blocks/FdsBlockInfo/types.ts +3 -2
- package/src/components/Blocks/FdsBlockLink/FdsBlockLink.vue +11 -16
- package/src/components/Blocks/FdsBlockLink/types.ts +6 -4
- package/src/components/Buttons/ButtonBaseProps.ts +4 -5
- package/src/components/Buttons/FdsButtonCopy/types.ts +4 -2
- package/src/components/Buttons/FdsButtonDownload/FdsButtonDownload.stories.ts +1 -7
- package/src/components/Buttons/FdsButtonDownload/FdsButtonDownload.vue +8 -5
- package/src/components/Buttons/FdsButtonDownload/types.ts +4 -3
- package/src/components/Buttons/FdsButtonIcon/FdsButtonIcon.stories.ts +1 -1
- package/src/components/Buttons/FdsButtonIcon/FdsButtonIcon.vue +8 -9
- package/src/components/Buttons/FdsButtonIcon/types.ts +3 -5
- package/src/components/Buttons/FdsButtonMinor/FdsButtonMinor.vue +12 -25
- package/src/components/Buttons/FdsButtonMinor/types.ts +5 -0
- package/src/components/Buttons/FdsButtonPrimary/FdsButtonPrimary.stories.ts +1 -1
- package/src/components/Buttons/FdsButtonPrimary/FdsButtonPrimary.vue +20 -13
- package/src/components/Buttons/FdsButtonSecondary/FdsButtonSecondary.stories.ts +1 -1
- package/src/components/Buttons/FdsButtonSecondary/FdsButtonSecondary.vue +20 -13
- package/src/components/FdsIcon/types.ts +3 -1
- package/src/components/FdsModal/types.ts +4 -1
- package/src/components/FdsPagination/FdsPagination.vue +4 -2
- package/src/components/FdsPagination/types.ts +4 -2
- package/src/components/FdsSearchSelect/types.ts +4 -1
- package/src/components/FdsSpinner/types.ts +4 -1
- package/src/components/FdsSticker/FdsSticker.vue +1 -2
- package/src/components/FdsSticker/types.ts +4 -2
- package/src/components/FdsTreeView/types.ts +4 -1
- package/src/components/FdsTruncatedText/types.ts +4 -1
- package/src/components/Form/FdsCheckbox/FdsCheckbox.stories.ts +1 -1
- package/src/components/Form/FdsCheckbox/FdsCheckbox.vue +21 -13
- package/src/components/Form/FdsCheckbox/types.ts +3 -1
- package/src/components/Form/FdsInput/FdsInput.stories.ts +5 -5
- package/src/components/Form/FdsInput/FdsInput.vue +43 -36
- package/src/components/Form/FdsInput/types.ts +2 -2
- package/src/components/Form/FdsRadio/FdsRadio.vue +21 -19
- package/src/components/Form/FdsRadio/types.ts +2 -1
- package/src/components/Form/FdsSelect/FdsSelect.vue +22 -12
- package/src/components/Form/FdsSelect/types.ts +2 -1
- package/src/components/Form/FdsTextarea/FdsTextarea.vue +4 -5
- package/src/components/Form/FdsTextarea/types.ts +2 -1
- package/src/components/Table/FdsTable/types.ts +4 -1
- package/src/components/Table/FdsTableHead/types.ts +4 -2
- package/src/components/Tabs/FdsTabs/types.ts +4 -1
- package/src/components/Tabs/FdsTabsItem/FdsTabsItem.vue +14 -21
- package/src/components/Tabs/FdsTabsItem/types.ts +4 -7
- package/src/components/Typography/FdsHeading/types.ts +4 -1
- package/src/components/Typography/FdsListHeading/types.ts +4 -1
- package/src/components/Typography/FdsText/FdsText.vue +0 -1
- package/src/components/Typography/FdsText/types.ts +4 -2
- package/src/composables/useAttrsWithDefaults.ts +38 -0
- package/src/types.ts +6 -0
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
+
function useAttrsWithDefaults(props) {
|
|
5
|
+
const attrs = vue.useAttrs();
|
|
6
|
+
return {
|
|
7
|
+
// Common boolean attributes
|
|
8
|
+
disabled: vue.computed(
|
|
9
|
+
() => attrs.disabled ?? props.disabled ?? false
|
|
10
|
+
),
|
|
11
|
+
required: vue.computed(
|
|
12
|
+
() => attrs.required ?? props.required ?? false
|
|
13
|
+
),
|
|
14
|
+
// Common string attributes
|
|
15
|
+
id: vue.computed(() => attrs.id ?? props.id),
|
|
16
|
+
name: vue.computed(() => attrs.name ?? props.name),
|
|
17
|
+
type: vue.computed(() => attrs.type ?? props.type),
|
|
18
|
+
href: vue.computed(() => attrs.href ?? props.href),
|
|
19
|
+
target: vue.computed(() => attrs.target ?? props.target),
|
|
20
|
+
rel: vue.computed(() => attrs.rel ?? props.rel),
|
|
21
|
+
download: vue.computed(() => attrs.download ?? props.download),
|
|
22
|
+
placeholder: vue.computed(() => attrs.placeholder ?? props.placeholder),
|
|
23
|
+
// Common number attributes
|
|
24
|
+
rows: vue.computed(() => attrs.rows ?? props.rows),
|
|
25
|
+
maxlength: vue.computed(() => attrs.maxlength ?? props.maxlength),
|
|
26
|
+
// Raw attrs for spreading
|
|
27
|
+
attrs
|
|
28
|
+
};
|
|
29
|
+
}
|
|
4
30
|
function useHasSlot(name = "default") {
|
|
5
31
|
const slots = vue.useSlots();
|
|
6
32
|
return vue.computed(() => {
|
|
@@ -522,13 +548,15 @@ const icons = {
|
|
|
522
548
|
</defs>
|
|
523
549
|
</svg>`
|
|
524
550
|
};
|
|
525
|
-
const _hoisted_1$
|
|
551
|
+
const _hoisted_1$p = ["innerHTML"];
|
|
526
552
|
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
527
553
|
__name: "FdsIcon",
|
|
528
554
|
props: {
|
|
529
555
|
name: {},
|
|
530
556
|
size: { default: 24 },
|
|
531
|
-
title: { default: void 0 }
|
|
557
|
+
title: { default: void 0 },
|
|
558
|
+
"data-testid": {},
|
|
559
|
+
dataTestid: {}
|
|
532
560
|
},
|
|
533
561
|
setup(__props) {
|
|
534
562
|
const props = __props;
|
|
@@ -549,7 +577,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
|
549
577
|
class: "inline-flex items-center justify-center align-middle",
|
|
550
578
|
style: vue.normalizeStyle({ width: pixelSize.value, height: pixelSize.value }),
|
|
551
579
|
innerHTML: svgHtml.value
|
|
552
|
-
}, null, 12, _hoisted_1$
|
|
580
|
+
}, null, 12, _hoisted_1$p);
|
|
553
581
|
};
|
|
554
582
|
}
|
|
555
583
|
});
|
|
@@ -558,31 +586,28 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
|
558
586
|
props: {
|
|
559
587
|
icon: {},
|
|
560
588
|
size: { default: 24 },
|
|
561
|
-
disabled: { type: Boolean, default: false },
|
|
562
589
|
loading: { type: Boolean, default: false },
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
onClick: {}
|
|
590
|
+
"data-testid": {},
|
|
591
|
+
dataTestid: {}
|
|
566
592
|
},
|
|
567
593
|
emits: ["click"],
|
|
568
594
|
setup(__props, { emit: __emit }) {
|
|
569
|
-
const attrs = vue.useAttrs();
|
|
570
595
|
const props = __props;
|
|
596
|
+
const { disabled, attrs } = useAttrsWithDefaults(props);
|
|
571
597
|
const buttonAttrs = vue.computed(() => ({
|
|
572
598
|
...attrs,
|
|
573
|
-
id: props.id,
|
|
574
599
|
type: props.type,
|
|
575
|
-
disabled:
|
|
576
|
-
"aria-disabled":
|
|
600
|
+
disabled: disabled.value,
|
|
601
|
+
"aria-disabled": disabled.value || props.loading ? true : void 0
|
|
577
602
|
}));
|
|
578
603
|
const iconSize = vue.computed(() => props.size - 4);
|
|
579
604
|
const emit = __emit;
|
|
580
605
|
const buttonClasses = vue.computed(() => [
|
|
581
606
|
"inline-flex items-center justify-center rounded-md p-[2px] max-w-[48px] max-h-[48px] transition-colors duration-200 fill-blue-500 hover:bg-blue_t-100 active:bg-blue_t-200 focus-visible:outline-dashed focus-visible:outline-2 outline-blue-500",
|
|
582
|
-
|
|
607
|
+
disabled.value ? "opacity-20 cursor-not-allowed" : "cursor-pointer"
|
|
583
608
|
]);
|
|
584
609
|
const onClick = (ev) => {
|
|
585
|
-
if (
|
|
610
|
+
if (disabled.value || props.loading) {
|
|
586
611
|
ev.preventDefault();
|
|
587
612
|
return;
|
|
588
613
|
}
|
|
@@ -607,7 +632,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
|
607
632
|
};
|
|
608
633
|
}
|
|
609
634
|
});
|
|
610
|
-
const _hoisted_1$
|
|
635
|
+
const _hoisted_1$o = ["id"];
|
|
611
636
|
const _hoisted_2$j = { class: "flex items-center gap-2" };
|
|
612
637
|
const _hoisted_3$b = { class: "relative" };
|
|
613
638
|
const _hoisted_4$a = {
|
|
@@ -617,18 +642,20 @@ const _hoisted_4$a = {
|
|
|
617
642
|
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
618
643
|
__name: "FdsBlockAlert",
|
|
619
644
|
props: {
|
|
620
|
-
id: { default: void 0 },
|
|
621
645
|
visible: { type: Boolean, default: true },
|
|
622
646
|
closeable: { type: Boolean, default: false },
|
|
623
647
|
collapsable: { type: Boolean, default: false },
|
|
624
648
|
expanded: { type: Boolean, default: false },
|
|
625
649
|
label: { default: "" },
|
|
626
650
|
locale: { default: "sv" },
|
|
627
|
-
icon: {}
|
|
651
|
+
icon: {},
|
|
652
|
+
"data-testid": {},
|
|
653
|
+
dataTestid: {}
|
|
628
654
|
},
|
|
629
655
|
emits: ["close", "toggle", "update:visible"],
|
|
630
656
|
setup(__props, { emit: __emit }) {
|
|
631
657
|
const props = __props;
|
|
658
|
+
const { id } = useAttrsWithDefaults(props);
|
|
632
659
|
const emit = __emit;
|
|
633
660
|
const isExpanded = vue.ref(props.expanded);
|
|
634
661
|
const isVisible = vue.ref(props.visible);
|
|
@@ -647,7 +674,7 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
647
674
|
props.collapsable && !isExpanded.value || !hasSlot.value ? "pb-4" : "pb-6"
|
|
648
675
|
]);
|
|
649
676
|
const autoId = `fds-alert-${Math.random().toString(36).slice(2, 9)}`;
|
|
650
|
-
const alertId = vue.computed(() =>
|
|
677
|
+
const alertId = vue.computed(() => id.value ?? autoId);
|
|
651
678
|
function handleClose() {
|
|
652
679
|
isVisible.value = false;
|
|
653
680
|
emit("update:visible", false);
|
|
@@ -703,11 +730,11 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
|
703
730
|
])) : vue.createCommentVNode("", true)
|
|
704
731
|
])
|
|
705
732
|
])
|
|
706
|
-
], 10, _hoisted_1$
|
|
733
|
+
], 10, _hoisted_1$o)) : vue.createCommentVNode("", true);
|
|
707
734
|
};
|
|
708
735
|
}
|
|
709
736
|
});
|
|
710
|
-
const _hoisted_1$
|
|
737
|
+
const _hoisted_1$n = ["id"];
|
|
711
738
|
const _hoisted_2$i = {
|
|
712
739
|
key: 0,
|
|
713
740
|
class: "flex items-start justify-between gap-4"
|
|
@@ -721,11 +748,13 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
721
748
|
heading: { default: void 0 },
|
|
722
749
|
borderLeft: { default: void 0 },
|
|
723
750
|
tight: { type: Boolean, default: false },
|
|
724
|
-
|
|
751
|
+
"data-testid": {},
|
|
752
|
+
dataTestid: {}
|
|
725
753
|
},
|
|
726
754
|
setup(__props) {
|
|
727
|
-
const hasSlot = useHasSlot();
|
|
728
755
|
const props = __props;
|
|
756
|
+
const { id } = useAttrsWithDefaults(props);
|
|
757
|
+
const hasSlot = useHasSlot();
|
|
729
758
|
const contentClasses = vue.computed(() => [
|
|
730
759
|
"rounded-md p-4 bg-white mb-4",
|
|
731
760
|
props.tight && "pb-2",
|
|
@@ -744,7 +773,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
744
773
|
return { "border-left-color": colorMap[props.borderLeft] || props.borderLeft };
|
|
745
774
|
});
|
|
746
775
|
const autoId = `fds-content-block-${Math.random().toString(36).slice(2, 9)}`;
|
|
747
|
-
const contentBlockId = vue.computed(() =>
|
|
776
|
+
const contentBlockId = vue.computed(() => id.value ?? autoId);
|
|
748
777
|
return (_ctx, _cache) => {
|
|
749
778
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
750
779
|
id: contentBlockId.value,
|
|
@@ -764,17 +793,17 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
764
793
|
vue.createElementVNode("div", _hoisted_5$8, [
|
|
765
794
|
vue.renderSlot(_ctx.$slots, "default")
|
|
766
795
|
])
|
|
767
|
-
], 14, _hoisted_1$
|
|
796
|
+
], 14, _hoisted_1$n);
|
|
768
797
|
};
|
|
769
798
|
}
|
|
770
799
|
});
|
|
771
|
-
const _hoisted_1$n = ["aria-live"];
|
|
772
800
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
773
801
|
__name: "FdsSticker",
|
|
774
802
|
props: {
|
|
775
803
|
variant: { default: "blue" },
|
|
776
804
|
bullet: { type: Boolean, default: false },
|
|
777
|
-
|
|
805
|
+
"data-testid": {},
|
|
806
|
+
dataTestid: {}
|
|
778
807
|
},
|
|
779
808
|
setup(__props) {
|
|
780
809
|
const props = __props;
|
|
@@ -801,15 +830,14 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
801
830
|
]);
|
|
802
831
|
return (_ctx, _cache) => {
|
|
803
832
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
804
|
-
class: vue.normalizeClass(stickerClasses.value)
|
|
805
|
-
"aria-live": __props.ariaLive
|
|
833
|
+
class: vue.normalizeClass(stickerClasses.value)
|
|
806
834
|
}, [
|
|
807
835
|
__props.bullet ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
808
836
|
key: 0,
|
|
809
837
|
class: vue.normalizeClass(bulletDotClasses.value)
|
|
810
838
|
}, null, 2)) : vue.createCommentVNode("", true),
|
|
811
839
|
vue.renderSlot(_ctx.$slots, "default")
|
|
812
|
-
],
|
|
840
|
+
], 2);
|
|
813
841
|
};
|
|
814
842
|
}
|
|
815
843
|
});
|
|
@@ -835,23 +863,28 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
835
863
|
label: { default: "" },
|
|
836
864
|
open: { type: Boolean, default: false },
|
|
837
865
|
preIcon: { default: void 0 },
|
|
838
|
-
id: { default: void 0 },
|
|
839
866
|
stickerColor: { default: void 0 },
|
|
840
|
-
stickerText: { default: void 0 }
|
|
867
|
+
stickerText: { default: void 0 },
|
|
868
|
+
"data-testid": {},
|
|
869
|
+
dataTestid: {}
|
|
841
870
|
},
|
|
842
871
|
emits: ["toggle"],
|
|
843
872
|
setup(__props, { emit: __emit }) {
|
|
844
|
-
const attrs = vue.useAttrs();
|
|
845
873
|
const props = __props;
|
|
874
|
+
const { id, attrs } = useAttrsWithDefaults(props);
|
|
846
875
|
const hasExtraRowSlot = useHasSlot("extra-row");
|
|
847
876
|
const emit = __emit;
|
|
848
877
|
const isOpen = vue.ref(props.open);
|
|
849
878
|
const autoId = `fds-block-expander-${Math.random().toString(36).slice(2, 9)}`;
|
|
850
|
-
const blockExpanderId = vue.computed(() =>
|
|
851
|
-
const buttonAttrs = vue.computed(() =>
|
|
852
|
-
...attrs
|
|
853
|
-
|
|
854
|
-
|
|
879
|
+
const blockExpanderId = vue.computed(() => id.value ?? autoId);
|
|
880
|
+
const buttonAttrs = vue.computed(() => {
|
|
881
|
+
const { class: _, id: __, ...rest } = attrs;
|
|
882
|
+
return {
|
|
883
|
+
...rest,
|
|
884
|
+
id: blockExpanderId.value
|
|
885
|
+
};
|
|
886
|
+
});
|
|
887
|
+
const wrapperClass = vue.computed(() => attrs.class);
|
|
855
888
|
vue.watch(
|
|
856
889
|
() => props.open,
|
|
857
890
|
(newValue) => {
|
|
@@ -875,7 +908,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
875
908
|
}
|
|
876
909
|
return (_ctx, _cache) => {
|
|
877
910
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
878
|
-
class: vue.normalizeClass(expanderClasses.value)
|
|
911
|
+
class: vue.normalizeClass([expanderClasses.value, wrapperClass.value])
|
|
879
912
|
}, [
|
|
880
913
|
vue.createElementVNode("button", vue.mergeProps(buttonAttrs.value, {
|
|
881
914
|
type: "button",
|
|
@@ -951,7 +984,7 @@ const _hoisted_8$3 = {
|
|
|
951
984
|
key: 1,
|
|
952
985
|
class: "mb-0-last-child"
|
|
953
986
|
};
|
|
954
|
-
const _hoisted_9$
|
|
987
|
+
const _hoisted_9$2 = { key: 1 };
|
|
955
988
|
const _hoisted_10$1 = { class: "flex items-start justify-between gap-4" };
|
|
956
989
|
const _hoisted_11$1 = { class: "flex items-center gap-3" };
|
|
957
990
|
const _hoisted_12$1 = { class: "m-0 text-base font-main font-bold tracking-wide" };
|
|
@@ -965,7 +998,8 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
965
998
|
heading: { default: void 0 },
|
|
966
999
|
icon: { default: void 0 },
|
|
967
1000
|
size: { default: "small" },
|
|
968
|
-
|
|
1001
|
+
"data-testid": {},
|
|
1002
|
+
dataTestid: {}
|
|
969
1003
|
},
|
|
970
1004
|
setup(__props) {
|
|
971
1005
|
const props = __props;
|
|
@@ -1003,7 +1037,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
1003
1037
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1004
1038
|
])) : vue.createCommentVNode("", true)
|
|
1005
1039
|
])
|
|
1006
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$
|
|
1040
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [
|
|
1007
1041
|
__props.heading ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1008
1042
|
key: 0,
|
|
1009
1043
|
class: vue.normalizeClass({ "mb-4": vue.unref(hasSlot) })
|
|
@@ -1043,27 +1077,25 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
1043
1077
|
__name: "FdsBlockLink",
|
|
1044
1078
|
props: {
|
|
1045
1079
|
label: {},
|
|
1046
|
-
id: { default: void 0 },
|
|
1047
1080
|
arrow: { type: Boolean, default: false },
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
rel: { default: void 0 },
|
|
1081
|
+
download: {},
|
|
1082
|
+
href: {},
|
|
1083
|
+
target: {},
|
|
1084
|
+
rel: {},
|
|
1053
1085
|
icon: { default: void 0 },
|
|
1054
1086
|
interactive: { type: Boolean, default: true },
|
|
1055
1087
|
as: { default: "router-link" },
|
|
1056
|
-
|
|
1088
|
+
disabled: { type: Boolean, default: false }
|
|
1057
1089
|
},
|
|
1058
1090
|
emits: ["click"],
|
|
1059
1091
|
setup(__props, { emit: __emit }) {
|
|
1060
|
-
const attrs = vue.useAttrs();
|
|
1061
1092
|
const props = __props;
|
|
1093
|
+
const { id, href, target, rel, download, attrs } = useAttrsWithDefaults(props);
|
|
1062
1094
|
const hasSlot = useHasSlot();
|
|
1063
1095
|
const hasStickerSlot = useHasSlot("sticker");
|
|
1064
1096
|
const emit = __emit;
|
|
1065
1097
|
const autoId = `fds-block-link-${Math.random().toString(36).slice(2, 9)}`;
|
|
1066
|
-
const blockLinkId = vue.computed(() =>
|
|
1098
|
+
const blockLinkId = vue.computed(() => id.value ?? autoId);
|
|
1067
1099
|
const innerClasses = vue.computed(() => [
|
|
1068
1100
|
props.disabled ? "cursor-not-allowed shadow-none hover:border-transparent active:bg-transparent" : "cursor-pointer",
|
|
1069
1101
|
!props.interactive && "cursor-auto"
|
|
@@ -1096,9 +1128,9 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
1096
1128
|
}
|
|
1097
1129
|
}
|
|
1098
1130
|
const linkAttrs = vue.computed(() => {
|
|
1099
|
-
if (props.as === "a") return { href:
|
|
1100
|
-
if (props.as === "router-link") return { to:
|
|
1101
|
-
if (
|
|
1131
|
+
if (props.as === "a") return { href: href.value };
|
|
1132
|
+
if (props.as === "router-link") return { to: href.value };
|
|
1133
|
+
if (href.value && !props.as) return { href: href.value };
|
|
1102
1134
|
return {};
|
|
1103
1135
|
});
|
|
1104
1136
|
const componentAttrs = vue.computed(() => ({
|
|
@@ -1107,17 +1139,17 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
1107
1139
|
}));
|
|
1108
1140
|
const componentType = vue.computed(() => {
|
|
1109
1141
|
if (props.as) return props.as;
|
|
1110
|
-
return
|
|
1142
|
+
return href.value ? "a" : "button";
|
|
1111
1143
|
});
|
|
1112
1144
|
return (_ctx, _cache) => {
|
|
1113
1145
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(componentType.value), vue.mergeProps(componentAttrs.value, {
|
|
1114
1146
|
id: blockLinkId.value,
|
|
1115
1147
|
class: ["box-border appearance-none text-left w-full flex items-start bg-white p-[calc(1rem-2px)] mb-3 text-blue-600 shadow-lg shadow-blue-200 rounded-2xl no-underline border-2 border-transparent transition-all duration-200 hover:border-blue-600 hover:border-2 active:border-transparent active:shadow-none active:bg-blue_t-100 focus-visible:border-blue-500 focus-visible:border-dashed focus-visible:outline-0", innerClasses.value],
|
|
1116
|
-
target: componentType.value === "a" ?
|
|
1117
|
-
rel: componentType.value === "a" ?
|
|
1118
|
-
download: componentType.value === "a" ?
|
|
1119
|
-
disabled: componentType.value === "button" ?
|
|
1120
|
-
"aria-disabled":
|
|
1148
|
+
target: componentType.value === "a" ? vue.unref(target) : void 0,
|
|
1149
|
+
rel: componentType.value === "a" ? vue.unref(rel) : void 0,
|
|
1150
|
+
download: componentType.value === "a" ? vue.unref(download) : void 0,
|
|
1151
|
+
disabled: componentType.value === "button" ? props.disabled : void 0,
|
|
1152
|
+
"aria-disabled": props.disabled,
|
|
1121
1153
|
onClick: handleClick,
|
|
1122
1154
|
onKeydown: handleKeydown
|
|
1123
1155
|
}), {
|
|
@@ -1244,7 +1276,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
|
1244
1276
|
});
|
|
1245
1277
|
const _hoisted_1$i = ["aria-disabled"];
|
|
1246
1278
|
const _hoisted_2$e = { class: "pt-0.5" };
|
|
1247
|
-
const elBase$2 = "box-border appearance-none inline-flex items-start justify-center w-fit
|
|
1279
|
+
const elBase$2 = "box-border appearance-none inline-flex items-start justify-center w-fit shadow-none p-0.5 text-base select-none m-0 rounded-md text-left align-start no-underline transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1248
1280
|
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
1249
1281
|
...{
|
|
1250
1282
|
inheritAttrs: false
|
|
@@ -1254,7 +1286,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
1254
1286
|
invert: { type: Boolean, default: false },
|
|
1255
1287
|
text: {},
|
|
1256
1288
|
loading: { type: Boolean, default: false },
|
|
1257
|
-
disabled: { type: Boolean
|
|
1289
|
+
disabled: { type: Boolean },
|
|
1258
1290
|
block: { type: Boolean, default: false },
|
|
1259
1291
|
state: { default: void 0 },
|
|
1260
1292
|
icon: { default: void 0 },
|
|
@@ -1262,25 +1294,19 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
1262
1294
|
size: {},
|
|
1263
1295
|
textSelection: { type: Boolean, default: false },
|
|
1264
1296
|
as: { default: "button" },
|
|
1265
|
-
href: {
|
|
1266
|
-
target: {
|
|
1267
|
-
rel: {
|
|
1297
|
+
href: {},
|
|
1298
|
+
target: {},
|
|
1299
|
+
rel: {},
|
|
1268
1300
|
type: { default: "button" },
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
ariaExpanded: { type: Boolean, default: void 0 },
|
|
1272
|
-
onClick: {}
|
|
1301
|
+
"data-testid": {},
|
|
1302
|
+
dataTestid: {}
|
|
1273
1303
|
},
|
|
1274
1304
|
emits: ["click"],
|
|
1275
1305
|
setup(__props, { emit: __emit }) {
|
|
1276
|
-
const attrs = vue.useAttrs();
|
|
1277
1306
|
const props = __props;
|
|
1278
1307
|
const emit = __emit;
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
props.disabled && "opacity-20 pointer-events-none",
|
|
1282
|
-
props.block && "block w-full"
|
|
1283
|
-
]);
|
|
1308
|
+
const { disabled, href, target, rel, attrs } = useAttrsWithDefaults(props);
|
|
1309
|
+
const rootClasses = vue.computed(() => ["inline-block transition-opacity duration-200", props.block && "block w-full"]);
|
|
1284
1310
|
const variantClasses2 = vue.computed(
|
|
1285
1311
|
() => props.invert ? "border-0 font-normal text-white bg-transparent focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white hover:bg-white-100 active:bg-white-200" : "border-0 font-normal text-blue-600 bg-transparent focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500 hover:bg-blue_t-100 active:bg-blue_t-200"
|
|
1286
1312
|
);
|
|
@@ -1292,19 +1318,20 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
1292
1318
|
elBase$2,
|
|
1293
1319
|
variantClasses2.value,
|
|
1294
1320
|
blockElClasses.value,
|
|
1295
|
-
props.textSelection && "select-text"
|
|
1321
|
+
props.textSelection && "select-text",
|
|
1322
|
+
disabled.value ? "opacity-20 cursor-not-allowed" : "cursor-pointer"
|
|
1296
1323
|
]);
|
|
1297
1324
|
const iconFillClass2 = vue.computed(() => props.invert ? "fill-white" : "fill-blue-500");
|
|
1298
1325
|
const onClick = (ev) => {
|
|
1299
|
-
if (
|
|
1326
|
+
if (disabled.value || props.loading) {
|
|
1300
1327
|
ev.preventDefault();
|
|
1301
1328
|
return;
|
|
1302
1329
|
}
|
|
1303
1330
|
emit("click", ev);
|
|
1304
1331
|
};
|
|
1305
1332
|
const linkAttrs = vue.computed(() => {
|
|
1306
|
-
if (props.as === "a") return { href:
|
|
1307
|
-
if (props.as === "router-link") return { to:
|
|
1333
|
+
if (props.as === "a") return { href: href.value };
|
|
1334
|
+
if (props.as === "router-link") return { to: href.value };
|
|
1308
1335
|
return {};
|
|
1309
1336
|
});
|
|
1310
1337
|
const componentAttrs = vue.computed(() => ({
|
|
@@ -1314,13 +1341,13 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
|
1314
1341
|
return (_ctx, _cache) => {
|
|
1315
1342
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1316
1343
|
class: vue.normalizeClass(rootClasses.value),
|
|
1317
|
-
"aria-disabled":
|
|
1344
|
+
"aria-disabled": vue.unref(disabled) ? "true" : void 0
|
|
1318
1345
|
}, [
|
|
1319
1346
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(componentAttrs.value, {
|
|
1320
|
-
type: __props.as === "button" ?
|
|
1321
|
-
disabled: __props.as === "button" ?
|
|
1322
|
-
target: __props.as === "a" ?
|
|
1323
|
-
rel: __props.as === "a" ?
|
|
1347
|
+
type: __props.as === "button" ? props.type : void 0,
|
|
1348
|
+
disabled: __props.as === "button" ? vue.unref(disabled) : void 0,
|
|
1349
|
+
target: __props.as === "a" ? vue.unref(target) : void 0,
|
|
1350
|
+
rel: __props.as === "a" ? vue.unref(rel) : void 0,
|
|
1324
1351
|
class: buttonClasses.value,
|
|
1325
1352
|
onClick
|
|
1326
1353
|
}), {
|
|
@@ -1362,7 +1389,8 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1362
1389
|
copiedLabel: { default: "Kopierat!" },
|
|
1363
1390
|
timeoutMs: { default: 800 },
|
|
1364
1391
|
disabled: { type: Boolean, default: false },
|
|
1365
|
-
|
|
1392
|
+
"data-testid": {},
|
|
1393
|
+
dataTestid: {}
|
|
1366
1394
|
},
|
|
1367
1395
|
emits: ["click"],
|
|
1368
1396
|
setup(__props) {
|
|
@@ -4058,16 +4086,17 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4058
4086
|
__name: "FdsButtonDownload",
|
|
4059
4087
|
props: {
|
|
4060
4088
|
loading: { type: Boolean, default: false },
|
|
4061
|
-
disabled: { type: Boolean, default: false },
|
|
4062
4089
|
iconPos: { default: "left" },
|
|
4063
4090
|
href: { default: void 0 },
|
|
4064
4091
|
downloadOptions: { default: void 0 },
|
|
4065
4092
|
text: { default: "" },
|
|
4066
|
-
|
|
4093
|
+
"data-testid": {},
|
|
4094
|
+
dataTestid: {}
|
|
4067
4095
|
},
|
|
4068
4096
|
emits: ["click"],
|
|
4069
4097
|
setup(__props, { emit: __emit }) {
|
|
4070
4098
|
const props = __props;
|
|
4099
|
+
const { disabled, attrs } = useAttrsWithDefaults(props);
|
|
4071
4100
|
const emit = __emit;
|
|
4072
4101
|
const { downloadFile, isDownloading } = useDownload();
|
|
4073
4102
|
const elBase2 = vue.computed(() => [
|
|
@@ -4076,7 +4105,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4076
4105
|
"select-none m-0 rounded-md align-middle whitespace-nowrap no-underline",
|
|
4077
4106
|
"transition-[box-shadow,border-color,background-color] duration-200 font-main text-base",
|
|
4078
4107
|
"leading-5 tracking-normal",
|
|
4079
|
-
|
|
4108
|
+
disabled.value && "text-gray-500 cursor-not-allowed!"
|
|
4080
4109
|
]);
|
|
4081
4110
|
const stateClasses = vue.computed(() => [
|
|
4082
4111
|
"focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4",
|
|
@@ -4089,9 +4118,9 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4089
4118
|
"border-0 font-normal bg-transparent",
|
|
4090
4119
|
isDownloading.value ? "cursor-not-allowed text-gray-500" : "cursor-pointer text-blue-600"
|
|
4091
4120
|
]);
|
|
4092
|
-
const iconFillClass2 = vue.computed(() => isDownloading.value ||
|
|
4121
|
+
const iconFillClass2 = vue.computed(() => isDownloading.value || disabled.value ? "fill-gray-500" : "fill-blue-500");
|
|
4093
4122
|
const handleDownload = async (ev) => {
|
|
4094
|
-
if (
|
|
4123
|
+
if (disabled.value || props.loading || isDownloading.value) {
|
|
4095
4124
|
ev.preventDefault();
|
|
4096
4125
|
return;
|
|
4097
4126
|
}
|
|
@@ -4126,7 +4155,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4126
4155
|
if (props.downloadOptions) {
|
|
4127
4156
|
handleDownload(ev);
|
|
4128
4157
|
} else {
|
|
4129
|
-
if (
|
|
4158
|
+
if (disabled.value || props.loading) {
|
|
4130
4159
|
ev.preventDefault();
|
|
4131
4160
|
return;
|
|
4132
4161
|
}
|
|
@@ -4134,13 +4163,13 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4134
4163
|
}
|
|
4135
4164
|
};
|
|
4136
4165
|
return (_ctx, _cache) => {
|
|
4137
|
-
return vue.openBlock(), vue.createElementBlock("button", {
|
|
4138
|
-
class:
|
|
4139
|
-
disabled:
|
|
4166
|
+
return vue.openBlock(), vue.createElementBlock("button", vue.mergeProps(vue.unref(attrs), {
|
|
4167
|
+
class: buttonClasses.value,
|
|
4168
|
+
disabled: vue.unref(disabled) || __props.loading || vue.unref(isDownloading),
|
|
4140
4169
|
type: "button",
|
|
4141
4170
|
onClick,
|
|
4142
|
-
"aria-disabled":
|
|
4143
|
-
}, [
|
|
4171
|
+
"aria-disabled": vue.unref(disabled) ? "true" : void 0
|
|
4172
|
+
}), [
|
|
4144
4173
|
vue.createElementVNode("span", {
|
|
4145
4174
|
class: vue.normalizeClass(iconOrderClasses.value),
|
|
4146
4175
|
"aria-hidden": "true"
|
|
@@ -4152,21 +4181,24 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
4152
4181
|
}, null, 8, ["class"])
|
|
4153
4182
|
], 2),
|
|
4154
4183
|
vue.createTextVNode(" " + vue.toDisplayString(__props.text), 1)
|
|
4155
|
-
],
|
|
4184
|
+
], 16, _hoisted_1$g);
|
|
4156
4185
|
};
|
|
4157
4186
|
}
|
|
4158
4187
|
});
|
|
4159
4188
|
const _hoisted_1$f = ["aria-disabled"];
|
|
4160
4189
|
const _hoisted_2$d = { key: 2 };
|
|
4161
|
-
const elBase$1 = "box-border appearance-none inline-flex items-center justify-center
|
|
4190
|
+
const elBase$1 = "box-border appearance-none inline-flex items-center justify-center select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
4162
4191
|
const variantClasses$1 = "bg-red-600 border border-red-700 text-white hover:bg-red-700 active:bg-red-800 active:border-red-800";
|
|
4163
4192
|
const iconFillClass$1 = "fill-white";
|
|
4164
4193
|
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
4194
|
+
...{
|
|
4195
|
+
inheritAttrs: false
|
|
4196
|
+
},
|
|
4165
4197
|
__name: "FdsButtonPrimary",
|
|
4166
4198
|
props: {
|
|
4167
4199
|
text: {},
|
|
4168
4200
|
loading: { type: Boolean, default: false },
|
|
4169
|
-
disabled: { type: Boolean
|
|
4201
|
+
disabled: { type: Boolean },
|
|
4170
4202
|
block: { type: Boolean, default: false },
|
|
4171
4203
|
state: { default: void 0 },
|
|
4172
4204
|
icon: { default: void 0 },
|
|
@@ -4174,25 +4206,20 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
4174
4206
|
size: { default: "md" },
|
|
4175
4207
|
textSelection: { type: Boolean, default: false },
|
|
4176
4208
|
as: { default: "button" },
|
|
4177
|
-
href: {
|
|
4209
|
+
href: {},
|
|
4178
4210
|
target: {},
|
|
4179
4211
|
rel: {},
|
|
4180
4212
|
type: { default: "button" },
|
|
4181
4213
|
invert: { type: Boolean },
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
ariaExpanded: { type: Boolean },
|
|
4185
|
-
onClick: {}
|
|
4214
|
+
"data-testid": {},
|
|
4215
|
+
dataTestid: {}
|
|
4186
4216
|
},
|
|
4187
4217
|
emits: ["click"],
|
|
4188
4218
|
setup(__props, { emit: __emit }) {
|
|
4189
4219
|
const props = __props;
|
|
4190
4220
|
const emit = __emit;
|
|
4191
|
-
const
|
|
4192
|
-
|
|
4193
|
-
props.disabled && "opacity-20 pointer-events-none",
|
|
4194
|
-
props.block && "block w-full"
|
|
4195
|
-
]);
|
|
4221
|
+
const { disabled, href, attrs } = useAttrsWithDefaults(props);
|
|
4222
|
+
const rootClasses = vue.computed(() => ["inline-block transition-opacity duration-200", props.block && "block w-full"]);
|
|
4196
4223
|
const sizeClasses = {
|
|
4197
4224
|
sm: "text-sm h-7 px-3",
|
|
4198
4225
|
md: "text-base h-12 px-4",
|
|
@@ -4206,28 +4233,33 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
4206
4233
|
variantClasses$1,
|
|
4207
4234
|
blockElClasses.value,
|
|
4208
4235
|
props.textSelection && "select-text",
|
|
4209
|
-
(props.icon || props.text) && "gap-2"
|
|
4236
|
+
(props.icon || props.text) && "gap-2",
|
|
4237
|
+
disabled.value ? "opacity-20 cursor-not-allowed" : "cursor-pointer"
|
|
4210
4238
|
]);
|
|
4211
4239
|
function onClick(ev) {
|
|
4212
|
-
if (
|
|
4240
|
+
if (disabled.value || props.loading) {
|
|
4213
4241
|
ev.preventDefault();
|
|
4214
4242
|
return;
|
|
4215
4243
|
}
|
|
4216
4244
|
emit("click", ev);
|
|
4217
4245
|
}
|
|
4218
4246
|
const linkAttrs = vue.computed(() => {
|
|
4219
|
-
if (props.as === "a") return { href:
|
|
4220
|
-
if (props.as === "router-link") return { to:
|
|
4247
|
+
if (props.as === "a") return { href: href.value };
|
|
4248
|
+
if (props.as === "router-link") return { to: href.value };
|
|
4221
4249
|
return {};
|
|
4222
4250
|
});
|
|
4251
|
+
const componentAttrs = vue.computed(() => ({
|
|
4252
|
+
...linkAttrs.value,
|
|
4253
|
+
...attrs
|
|
4254
|
+
}));
|
|
4223
4255
|
return (_ctx, _cache) => {
|
|
4224
4256
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4225
4257
|
class: vue.normalizeClass(rootClasses.value),
|
|
4226
|
-
"aria-disabled":
|
|
4258
|
+
"aria-disabled": vue.unref(disabled) ? "true" : void 0
|
|
4227
4259
|
}, [
|
|
4228
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(
|
|
4229
|
-
type: __props.as === "button" ?
|
|
4230
|
-
disabled: __props.as === "button" ?
|
|
4260
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(componentAttrs.value, {
|
|
4261
|
+
type: __props.as === "button" ? props.type : void 0,
|
|
4262
|
+
disabled: __props.as === "button" ? vue.unref(disabled) : void 0,
|
|
4231
4263
|
class: buttonClasses.value,
|
|
4232
4264
|
onClick
|
|
4233
4265
|
}), {
|
|
@@ -4257,15 +4289,18 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
4257
4289
|
});
|
|
4258
4290
|
const _hoisted_1$e = ["aria-disabled"];
|
|
4259
4291
|
const _hoisted_2$c = { key: 2 };
|
|
4260
|
-
const elBase = "box-border appearance-none inline-flex items-center justify-center
|
|
4292
|
+
const elBase = "box-border appearance-none inline-flex items-center justify-center select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
4261
4293
|
const variantClasses = "bg-white border-2 border-blue-500 text-blue-600 hover:border-blue-600 active:bg-blue-600 active:border-blue-600 active:text-white";
|
|
4262
4294
|
const iconFillClass = "fill-blue-500";
|
|
4263
4295
|
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
4296
|
+
...{
|
|
4297
|
+
inheritAttrs: false
|
|
4298
|
+
},
|
|
4264
4299
|
__name: "FdsButtonSecondary",
|
|
4265
4300
|
props: {
|
|
4266
4301
|
text: {},
|
|
4267
4302
|
loading: { type: Boolean, default: false },
|
|
4268
|
-
disabled: { type: Boolean
|
|
4303
|
+
disabled: { type: Boolean },
|
|
4269
4304
|
block: { type: Boolean, default: false },
|
|
4270
4305
|
state: { default: void 0 },
|
|
4271
4306
|
icon: { default: void 0 },
|
|
@@ -4273,25 +4308,20 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
4273
4308
|
size: { default: "md" },
|
|
4274
4309
|
textSelection: { type: Boolean, default: false },
|
|
4275
4310
|
as: { default: "button" },
|
|
4276
|
-
href: {
|
|
4311
|
+
href: {},
|
|
4277
4312
|
target: {},
|
|
4278
4313
|
rel: {},
|
|
4279
4314
|
type: { default: "button" },
|
|
4280
4315
|
invert: { type: Boolean },
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
ariaExpanded: { type: Boolean },
|
|
4284
|
-
onClick: {}
|
|
4316
|
+
"data-testid": {},
|
|
4317
|
+
dataTestid: {}
|
|
4285
4318
|
},
|
|
4286
4319
|
emits: ["click"],
|
|
4287
4320
|
setup(__props, { emit: __emit }) {
|
|
4288
4321
|
const props = __props;
|
|
4289
4322
|
const emit = __emit;
|
|
4290
|
-
const
|
|
4291
|
-
|
|
4292
|
-
props.disabled && "opacity-20 pointer-events-none",
|
|
4293
|
-
props.block && "block w-full"
|
|
4294
|
-
]);
|
|
4323
|
+
const { disabled, href, attrs } = useAttrsWithDefaults(props);
|
|
4324
|
+
const rootClasses = vue.computed(() => ["inline-block transition-opacity duration-200", props.block && "block w-full"]);
|
|
4295
4325
|
const sizeClasses = {
|
|
4296
4326
|
sm: "text-sm h-7 px-3",
|
|
4297
4327
|
md: "text-base h-12 px-4",
|
|
@@ -4305,28 +4335,33 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
4305
4335
|
variantClasses,
|
|
4306
4336
|
blockElClasses.value,
|
|
4307
4337
|
props.textSelection && "select-text",
|
|
4308
|
-
(props.icon || props.text) && "gap-2"
|
|
4338
|
+
(props.icon || props.text) && "gap-2",
|
|
4339
|
+
disabled.value ? "opacity-20 cursor-not-allowed" : "cursor-pointer"
|
|
4309
4340
|
]);
|
|
4310
4341
|
const onClick = (ev) => {
|
|
4311
|
-
if (
|
|
4342
|
+
if (disabled.value || props.loading) {
|
|
4312
4343
|
ev.preventDefault();
|
|
4313
4344
|
return;
|
|
4314
4345
|
}
|
|
4315
4346
|
emit("click", ev);
|
|
4316
4347
|
};
|
|
4317
4348
|
const linkAttrs = vue.computed(() => {
|
|
4318
|
-
if (props.as === "a") return { href:
|
|
4319
|
-
if (props.as === "router-link") return { to:
|
|
4349
|
+
if (props.as === "a") return { href: href.value };
|
|
4350
|
+
if (props.as === "router-link") return { to: href.value };
|
|
4320
4351
|
return {};
|
|
4321
4352
|
});
|
|
4353
|
+
const componentAttrs = vue.computed(() => ({
|
|
4354
|
+
...linkAttrs.value,
|
|
4355
|
+
...attrs
|
|
4356
|
+
}));
|
|
4322
4357
|
return (_ctx, _cache) => {
|
|
4323
4358
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4324
4359
|
class: vue.normalizeClass(rootClasses.value),
|
|
4325
|
-
"aria-disabled":
|
|
4360
|
+
"aria-disabled": vue.unref(disabled) ? "true" : void 0
|
|
4326
4361
|
}, [
|
|
4327
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(
|
|
4328
|
-
type: __props.as === "button" ?
|
|
4329
|
-
disabled: __props.as === "button" ?
|
|
4362
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(componentAttrs.value, {
|
|
4363
|
+
type: __props.as === "button" ? props.type : void 0,
|
|
4364
|
+
disabled: __props.as === "button" ? vue.unref(disabled) : void 0,
|
|
4330
4365
|
class: buttonClasses.value,
|
|
4331
4366
|
onClick
|
|
4332
4367
|
}), {
|
|
@@ -4369,7 +4404,9 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
4369
4404
|
lockScroll: { type: Boolean, default: false },
|
|
4370
4405
|
info: { default: void 0 },
|
|
4371
4406
|
locale: { default: "sv" },
|
|
4372
|
-
onClose: {}
|
|
4407
|
+
onClose: {},
|
|
4408
|
+
"data-testid": {},
|
|
4409
|
+
dataTestid: {}
|
|
4373
4410
|
},
|
|
4374
4411
|
emits: ["close", "update:open"],
|
|
4375
4412
|
setup(__props, { emit: __emit }) {
|
|
@@ -7743,7 +7780,7 @@ try {
|
|
|
7743
7780
|
}
|
|
7744
7781
|
const _hoisted_1$c = ["for"];
|
|
7745
7782
|
const _hoisted_2$a = { class: "relative" };
|
|
7746
|
-
const _hoisted_3$7 = ["
|
|
7783
|
+
const _hoisted_3$7 = ["type", "required", "value", "aria-invalid"];
|
|
7747
7784
|
const _hoisted_4$6 = {
|
|
7748
7785
|
key: 0,
|
|
7749
7786
|
class: "text-red-600 font-bold mt-1"
|
|
@@ -7761,14 +7798,15 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7761
7798
|
invalidMessage: {},
|
|
7762
7799
|
labelLeft: { type: Boolean, default: false },
|
|
7763
7800
|
clearButton: { type: Boolean, default: false },
|
|
7764
|
-
|
|
7765
|
-
locale: {},
|
|
7801
|
+
locale: { default: "sv" },
|
|
7766
7802
|
mask: { default: void 0 },
|
|
7767
7803
|
modelValue: {},
|
|
7768
7804
|
onClearInput: {},
|
|
7769
7805
|
maskOptions: { default: void 0 },
|
|
7770
7806
|
modelModifiers: { default: () => ({}) },
|
|
7771
|
-
value: { default: void 0 }
|
|
7807
|
+
value: { default: void 0 },
|
|
7808
|
+
"data-testid": {},
|
|
7809
|
+
dataTestid: {}
|
|
7772
7810
|
}, {
|
|
7773
7811
|
"modelValue": { default: void 0, required: false },
|
|
7774
7812
|
"modelModifiers": {}
|
|
@@ -7778,30 +7816,38 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7778
7816
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
7779
7817
|
const props = __props;
|
|
7780
7818
|
const emit = __emit;
|
|
7781
|
-
const attrs =
|
|
7819
|
+
const { id, type, disabled, maxlength, attrs } = useAttrsWithDefaults(props);
|
|
7820
|
+
const inputType = vue.computed(() => type.value ?? props.type ?? "text");
|
|
7821
|
+
const autoId = `fds-input-${Math.random().toString(36).slice(2, 9)}`;
|
|
7822
|
+
const inputId = vue.computed(() => id.value ?? autoId);
|
|
7782
7823
|
const inputAttrs = vue.computed(() => {
|
|
7783
|
-
const { class: _, ...rest } = attrs;
|
|
7784
|
-
return
|
|
7824
|
+
const { class: _, type: _type, id: _id, ...rest } = attrs;
|
|
7825
|
+
return {
|
|
7826
|
+
...rest,
|
|
7827
|
+
id: inputId.value
|
|
7828
|
+
};
|
|
7785
7829
|
});
|
|
7786
|
-
const autoId = `fds-input-${Math.random().toString(36).slice(2, 9)}`;
|
|
7787
|
-
const inputId = vue.computed(() => props.id ?? autoId);
|
|
7788
7830
|
const clearButtonLabel = vue.computed(() => props.locale === "sv" ? "Rensa input" : "Clear input");
|
|
7831
|
+
const passwordButtonShowLabel = vue.computed(() => props.locale === "sv" ? "Visa lösenord" : "Show password");
|
|
7832
|
+
const passwordButtonHideLabel = vue.computed(() => props.locale === "sv" ? "Dölj lösenord" : "Hide password");
|
|
7789
7833
|
const showInvalidMessage = vue.computed(() => props.valid === false && !props.optional && props.invalidMessage);
|
|
7790
|
-
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !
|
|
7834
|
+
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !disabled.value);
|
|
7791
7835
|
const isValid = vue.computed(() => props.valid === true);
|
|
7792
|
-
const showPasswordToggle = vue.computed(
|
|
7836
|
+
const showPasswordToggle = vue.computed(
|
|
7837
|
+
() => inputType.value === "password" && internalValue.value !== void 0 && internalValue.value !== null && String(internalValue.value).length > 0
|
|
7838
|
+
);
|
|
7793
7839
|
const wrapperClass = vue.computed(() => attrs.class);
|
|
7794
7840
|
const inputClasses = vue.computed(() => [
|
|
7795
7841
|
"block rounded-md border border-gray-500 px-3 py-[calc(0.75rem-1px)]",
|
|
7796
|
-
|
|
7842
|
+
maxlength.value ? "" : "w-full",
|
|
7797
7843
|
"focus:outline-2 focus:outline-blue-500 -outline-offset-2 focus:border-transparent",
|
|
7798
|
-
|
|
7844
|
+
disabled.value ? "outline-dashed outline-2 outline-gray-400 cursor-not-allowed border-transparent" : "bg-white",
|
|
7799
7845
|
isInvalid.value && "outline-2 outline-red-600"
|
|
7800
7846
|
]);
|
|
7801
7847
|
const inputStyle = vue.computed(() => {
|
|
7802
|
-
if (
|
|
7848
|
+
if (maxlength.value) {
|
|
7803
7849
|
return {
|
|
7804
|
-
width: `calc(${
|
|
7850
|
+
width: `calc(${maxlength.value}ch + 1.5rem + 0.25rem)`,
|
|
7805
7851
|
maxWidth: "100%"
|
|
7806
7852
|
};
|
|
7807
7853
|
}
|
|
@@ -7824,7 +7870,6 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7824
7870
|
emit("clearInput");
|
|
7825
7871
|
}
|
|
7826
7872
|
const showPassword = vue.ref(false);
|
|
7827
|
-
const isPasswordType = vue.computed(() => props.type === "password");
|
|
7828
7873
|
const isLazy = vue.computed(() => props.modelModifiers?.lazy === true);
|
|
7829
7874
|
function toggleShowPassword() {
|
|
7830
7875
|
showPassword.value = !showPassword.value;
|
|
@@ -7905,36 +7950,33 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7905
7950
|
class: vue.normalizeClass(["w-full mb-4", wrapperClass.value])
|
|
7906
7951
|
}, [
|
|
7907
7952
|
vue.createElementVNode("div", {
|
|
7908
|
-
class: vue.normalizeClass({ "flex flex-row gap-4":
|
|
7953
|
+
class: vue.normalizeClass({ "flex flex-row gap-4": props.labelLeft })
|
|
7909
7954
|
}, [
|
|
7910
7955
|
vue.createElementVNode("div", null, [
|
|
7911
|
-
|
|
7956
|
+
props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
7912
7957
|
key: 0,
|
|
7913
7958
|
for: inputId.value,
|
|
7914
|
-
class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0":
|
|
7915
|
-
}, vue.toDisplayString(
|
|
7916
|
-
|
|
7959
|
+
class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": props.meta, "mb-1": !props.meta }])
|
|
7960
|
+
}, vue.toDisplayString(props.label), 11, _hoisted_1$c)) : vue.createCommentVNode("", true),
|
|
7961
|
+
props.meta ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
7917
7962
|
key: 1,
|
|
7918
|
-
class: vue.normalizeClass(["font-thin", { "mb-1": !
|
|
7919
|
-
}, vue.toDisplayString(
|
|
7963
|
+
class: vue.normalizeClass(["font-thin", { "mb-1": !props.labelLeft }])
|
|
7964
|
+
}, vue.toDisplayString(props.meta), 3)) : vue.createCommentVNode("", true)
|
|
7920
7965
|
]),
|
|
7921
7966
|
vue.createElementVNode("div", {
|
|
7922
|
-
class: vue.normalizeClass({ "flex-1":
|
|
7967
|
+
class: vue.normalizeClass({ "flex-1": props.labelLeft })
|
|
7923
7968
|
}, [
|
|
7924
7969
|
vue.createElementVNode("div", _hoisted_2$a, [
|
|
7925
7970
|
vue.createElementVNode("input", vue.mergeProps({
|
|
7926
7971
|
ref_key: "inputRef",
|
|
7927
7972
|
ref: inputRef,
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
disabled: _ctx.disabled,
|
|
7931
|
-
required: _ctx.required,
|
|
7973
|
+
type: inputType.value === "password" ? showPassword.value ? "text" : "password" : inputType.value,
|
|
7974
|
+
required: props.required,
|
|
7932
7975
|
value: internalValue.value,
|
|
7933
|
-
"aria-invalid":
|
|
7976
|
+
"aria-invalid": props.valid === false ? "true" : void 0,
|
|
7934
7977
|
class: inputClasses.value,
|
|
7935
7978
|
style: inputStyle.value
|
|
7936
7979
|
}, inputAttrs.value, {
|
|
7937
|
-
maxlength: _ctx.maxlength,
|
|
7938
7980
|
onInput: handleInputChange,
|
|
7939
7981
|
onChange: handleInputChange,
|
|
7940
7982
|
onBlur: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("blur", $event)),
|
|
@@ -7955,21 +7997,21 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
7955
7997
|
key: 1,
|
|
7956
7998
|
name: "bigSuccess"
|
|
7957
7999
|
})) : vue.createCommentVNode("", true),
|
|
7958
|
-
|
|
8000
|
+
props.clearButton && !!internalValue.value && !props.disabled ? (vue.openBlock(), vue.createBlock(_sfc_main$v, vue.mergeProps({
|
|
7959
8001
|
key: 2,
|
|
7960
8002
|
icon: "cross"
|
|
7961
8003
|
}, { "aria-label": clearButtonLabel.value }, { onClick: onClear }), null, 16)) : vue.createCommentVNode("", true),
|
|
7962
8004
|
showPasswordToggle.value ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
7963
8005
|
key: 3,
|
|
7964
8006
|
icon: showPassword.value ? "viewOff" : "viewOn",
|
|
7965
|
-
text:
|
|
8007
|
+
text: showPassword.value ? passwordButtonHideLabel.value : passwordButtonShowLabel.value,
|
|
7966
8008
|
onClick: toggleShowPassword
|
|
7967
|
-
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
8009
|
+
}, null, 8, ["icon", "text"])) : vue.createCommentVNode("", true)
|
|
7968
8010
|
], 2)
|
|
7969
8011
|
])
|
|
7970
8012
|
], 2)
|
|
7971
8013
|
], 2),
|
|
7972
|
-
showInvalidMessage.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$6, vue.toDisplayString(
|
|
8014
|
+
showInvalidMessage.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$6, vue.toDisplayString(props.invalidMessage), 1)) : vue.createCommentVNode("", true)
|
|
7973
8015
|
], 2);
|
|
7974
8016
|
};
|
|
7975
8017
|
}
|
|
@@ -7982,20 +8024,22 @@ const _hoisted_5$5 = { class: "flex items-center justify-end gap-1 order-2 sm:or
|
|
|
7982
8024
|
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
7983
8025
|
__name: "FdsPagination",
|
|
7984
8026
|
props: {
|
|
7985
|
-
id: { default: void 0 },
|
|
7986
8027
|
current: {},
|
|
7987
8028
|
max: {},
|
|
7988
8029
|
loading: { type: Boolean, default: false },
|
|
7989
|
-
onPaginate: {}
|
|
8030
|
+
onPaginate: {},
|
|
8031
|
+
"data-testid": {},
|
|
8032
|
+
dataTestid: {}
|
|
7990
8033
|
},
|
|
7991
8034
|
emits: ["paginate"],
|
|
7992
8035
|
setup(__props, { emit: __emit }) {
|
|
7993
8036
|
const props = __props;
|
|
8037
|
+
const { id } = useAttrsWithDefaults(props);
|
|
7994
8038
|
const emit = __emit;
|
|
7995
8039
|
const loadingIndicator = vue.ref("");
|
|
7996
8040
|
const internalValue = vue.ref(props.current);
|
|
7997
8041
|
const autoId = `fds-pagination-${Math.random().toString(36).slice(2, 9)}`;
|
|
7998
|
-
const inputId = vue.computed(() =>
|
|
8042
|
+
const inputId = vue.computed(() => id.value ?? autoId);
|
|
7999
8043
|
const inputValue = vue.computed(() => String(internalValue.value));
|
|
8000
8044
|
vue.watch(
|
|
8001
8045
|
() => props.current,
|
|
@@ -8196,7 +8240,7 @@ const _hoisted_8$2 = {
|
|
|
8196
8240
|
key: 1,
|
|
8197
8241
|
class: "block m-0 font-light p-4 border-b border-gray-200 rounded-t-md"
|
|
8198
8242
|
};
|
|
8199
|
-
const _hoisted_9$
|
|
8243
|
+
const _hoisted_9$1 = ["id", "aria-selected", "tabindex", "onMouseup", "onMouseenter", "onKeydown"];
|
|
8200
8244
|
const _hoisted_10 = ["id", "checked"];
|
|
8201
8245
|
const _hoisted_11 = ["for", "innerHTML"];
|
|
8202
8246
|
const _hoisted_12 = {
|
|
@@ -8233,7 +8277,9 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
8233
8277
|
onChange: {},
|
|
8234
8278
|
onSearchSelected: {},
|
|
8235
8279
|
onPaginate: {},
|
|
8236
|
-
onTotal: {}
|
|
8280
|
+
onTotal: {},
|
|
8281
|
+
"data-testid": {},
|
|
8282
|
+
dataTestid: {}
|
|
8237
8283
|
},
|
|
8238
8284
|
emits: ["searchSelected", "paginate", "total", "change"],
|
|
8239
8285
|
setup(__props, { emit: __emit }) {
|
|
@@ -8663,7 +8709,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
8663
8709
|
class: vue.normalizeClass(["block p-4 text-gray-700 cursor-pointer no-underline", listItemClasses.value]),
|
|
8664
8710
|
innerHTML: handleMatchingString(item)
|
|
8665
8711
|
}, null, 10, _hoisted_11)
|
|
8666
|
-
], 42, _hoisted_9$
|
|
8712
|
+
], 42, _hoisted_9$1);
|
|
8667
8713
|
}), 128))
|
|
8668
8714
|
], 32),
|
|
8669
8715
|
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
@@ -9086,7 +9132,7 @@ const useTreeState = (options = {}) => {
|
|
|
9086
9132
|
};
|
|
9087
9133
|
};
|
|
9088
9134
|
const _hoisted_1$9 = ["for"];
|
|
9089
|
-
const _hoisted_2$7 = ["
|
|
9135
|
+
const _hoisted_2$7 = ["value", "disabled", "required"];
|
|
9090
9136
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
9091
9137
|
__name: "FdsCheckbox",
|
|
9092
9138
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
@@ -9094,7 +9140,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9094
9140
|
indeterminate: { type: Boolean, default: false },
|
|
9095
9141
|
modelValue: { type: [Boolean, Array] },
|
|
9096
9142
|
checked: { type: Boolean, default: false },
|
|
9097
|
-
value: { default: void 0 }
|
|
9143
|
+
value: { default: void 0 },
|
|
9144
|
+
"data-testid": {},
|
|
9145
|
+
dataTestid: {}
|
|
9098
9146
|
}, {
|
|
9099
9147
|
"modelValue": { type: [Boolean, Array], ...{
|
|
9100
9148
|
default: void 0,
|
|
@@ -9107,6 +9155,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9107
9155
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
9108
9156
|
const props = __props;
|
|
9109
9157
|
const emit = __emit;
|
|
9158
|
+
const { id, attrs } = useAttrsWithDefaults(props);
|
|
9110
9159
|
const wrapperClasses = vue.computed(() => ["block relative flex items-center mb-2 last:mb-0"]);
|
|
9111
9160
|
const innerWrapperClasses = vue.computed(() => [
|
|
9112
9161
|
"flex p-0.5 items-start rounded-md",
|
|
@@ -9120,7 +9169,14 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9120
9169
|
props.disabled && "cursor-not-allowed"
|
|
9121
9170
|
]);
|
|
9122
9171
|
const autoId = `fds-checkbox-${Math.random().toString(36).slice(2, 9)}`;
|
|
9123
|
-
const inputId = vue.computed(() =>
|
|
9172
|
+
const inputId = vue.computed(() => id.value ?? autoId);
|
|
9173
|
+
const inputAttrs = vue.computed(() => {
|
|
9174
|
+
const { id: _, ...rest } = attrs;
|
|
9175
|
+
return {
|
|
9176
|
+
...rest,
|
|
9177
|
+
id: inputId.value
|
|
9178
|
+
};
|
|
9179
|
+
});
|
|
9124
9180
|
const hasLabelSlot = useHasSlot();
|
|
9125
9181
|
const internalChecked = vue.computed({
|
|
9126
9182
|
get: () => {
|
|
@@ -9188,37 +9244,35 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
9188
9244
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
9189
9245
|
class: vue.normalizeClass(wrapperClasses.value)
|
|
9190
9246
|
}, [
|
|
9191
|
-
vue.createElementVNode("label",
|
|
9247
|
+
vue.createElementVNode("label", {
|
|
9192
9248
|
for: inputId.value,
|
|
9193
|
-
class: [innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9194
|
-
},
|
|
9195
|
-
vue.withDirectives(vue.createElementVNode("input", {
|
|
9196
|
-
|
|
9197
|
-
name: _ctx.name,
|
|
9198
|
-
value: __props.value,
|
|
9249
|
+
class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }])
|
|
9250
|
+
}, [
|
|
9251
|
+
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
|
|
9252
|
+
value: props.value,
|
|
9199
9253
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalChecked.value = $event),
|
|
9200
|
-
disabled:
|
|
9201
|
-
required:
|
|
9254
|
+
disabled: props.disabled,
|
|
9255
|
+
required: props.required,
|
|
9202
9256
|
type: "checkbox",
|
|
9203
|
-
class:
|
|
9204
|
-
}, null,
|
|
9257
|
+
class: [checkboxClasses.value]
|
|
9258
|
+
}, inputAttrs.value), null, 16, _hoisted_2$7), [
|
|
9205
9259
|
[vue.vModelCheckbox, internalChecked.value]
|
|
9206
9260
|
]),
|
|
9207
|
-
vue.unref(hasLabelSlot) ||
|
|
9261
|
+
vue.unref(hasLabelSlot) || props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
9208
9262
|
key: 0,
|
|
9209
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9263
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": props.disabled }])
|
|
9210
9264
|
}, [
|
|
9211
|
-
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) :
|
|
9212
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
9265
|
+
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
9266
|
+
vue.createTextVNode(vue.toDisplayString(props.label), 1)
|
|
9213
9267
|
], 64)) : vue.createCommentVNode("", true)
|
|
9214
9268
|
], 2)) : vue.createCommentVNode("", true)
|
|
9215
|
-
],
|
|
9269
|
+
], 10, _hoisted_1$9)
|
|
9216
9270
|
], 2);
|
|
9217
9271
|
};
|
|
9218
9272
|
}
|
|
9219
9273
|
});
|
|
9220
9274
|
const _hoisted_1$8 = ["for"];
|
|
9221
|
-
const _hoisted_2$6 = ["
|
|
9275
|
+
const _hoisted_2$6 = ["name", "value", "disabled", "required"];
|
|
9222
9276
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
9223
9277
|
...{
|
|
9224
9278
|
inheritAttrs: false
|
|
@@ -9228,22 +9282,28 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9228
9282
|
label: { default: void 0 },
|
|
9229
9283
|
modelValue: {},
|
|
9230
9284
|
checked: { type: Boolean, default: false },
|
|
9231
|
-
value: { default: void 0 }
|
|
9285
|
+
value: { default: void 0 },
|
|
9286
|
+
"data-testid": {},
|
|
9287
|
+
dataTestid: {}
|
|
9232
9288
|
}, {
|
|
9233
9289
|
"modelValue": { default: void 0, required: false },
|
|
9234
9290
|
"modelModifiers": {}
|
|
9235
9291
|
}),
|
|
9236
9292
|
emits: /* @__PURE__ */ vue.mergeModels(["update:modelValue", "change", "input"], ["update:modelValue"]),
|
|
9237
9293
|
setup(__props, { emit: __emit }) {
|
|
9238
|
-
const attrs = vue.useAttrs();
|
|
9239
|
-
const inputAttrs = vue.computed(() => ({
|
|
9240
|
-
...attrs
|
|
9241
|
-
}));
|
|
9242
9294
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
9243
9295
|
const props = __props;
|
|
9244
9296
|
const emit = __emit;
|
|
9297
|
+
const { id, name, attrs } = useAttrsWithDefaults(props);
|
|
9245
9298
|
const autoId = `fds-radio-${Math.random().toString(36).slice(2, 9)}`;
|
|
9246
|
-
const inputId = vue.computed(() =>
|
|
9299
|
+
const inputId = vue.computed(() => id.value ?? autoId);
|
|
9300
|
+
const inputAttrs = vue.computed(() => {
|
|
9301
|
+
const { id: _, ...rest } = attrs;
|
|
9302
|
+
return {
|
|
9303
|
+
...rest,
|
|
9304
|
+
id: inputId.value
|
|
9305
|
+
};
|
|
9306
|
+
});
|
|
9247
9307
|
const hasLabelSlot = useHasSlot();
|
|
9248
9308
|
const radioModel = vue.computed({
|
|
9249
9309
|
get() {
|
|
@@ -9272,26 +9332,25 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
9272
9332
|
}, [
|
|
9273
9333
|
vue.createElementVNode("label", {
|
|
9274
9334
|
for: inputId.value,
|
|
9275
|
-
class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9335
|
+
class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": props.disabled }])
|
|
9276
9336
|
}, [
|
|
9277
9337
|
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps(inputAttrs.value, {
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
value: __props.value,
|
|
9338
|
+
name: vue.unref(name),
|
|
9339
|
+
value: props.value,
|
|
9281
9340
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => radioModel.value = $event),
|
|
9282
|
-
disabled:
|
|
9283
|
-
required:
|
|
9341
|
+
disabled: props.disabled,
|
|
9342
|
+
required: props.required,
|
|
9284
9343
|
type: "radio",
|
|
9285
9344
|
class: [inputClasses.value, "m-[2px]"]
|
|
9286
9345
|
}), null, 16, _hoisted_2$6), [
|
|
9287
9346
|
[vue.vModelRadio, radioModel.value]
|
|
9288
9347
|
]),
|
|
9289
|
-
vue.unref(hasLabelSlot) ||
|
|
9348
|
+
vue.unref(hasLabelSlot) || props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
9290
9349
|
key: 0,
|
|
9291
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9350
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": props.disabled }])
|
|
9292
9351
|
}, [
|
|
9293
|
-
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) :
|
|
9294
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
9352
|
+
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
9353
|
+
vue.createTextVNode(vue.toDisplayString(props.label), 1)
|
|
9295
9354
|
], 64)) : vue.createCommentVNode("", true)
|
|
9296
9355
|
], 2)) : vue.createCommentVNode("", true)
|
|
9297
9356
|
], 10, _hoisted_1$8)
|
|
@@ -9310,7 +9369,7 @@ const _hoisted_6$1 = {
|
|
|
9310
9369
|
};
|
|
9311
9370
|
const _hoisted_7$1 = { class: "flex flex-col gap-2" };
|
|
9312
9371
|
const _hoisted_8$1 = ["onClick"];
|
|
9313
|
-
const _hoisted_9
|
|
9372
|
+
const _hoisted_9 = { key: 0 };
|
|
9314
9373
|
const popoverWidth = 327;
|
|
9315
9374
|
const popoverHeight = 80;
|
|
9316
9375
|
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -9349,7 +9408,9 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
9349
9408
|
searchCountTemplateUnfiltered: {},
|
|
9350
9409
|
titleTemplate: {},
|
|
9351
9410
|
onGetSearchContainerHeight: {},
|
|
9352
|
-
selectedNodes: {}
|
|
9411
|
+
selectedNodes: {},
|
|
9412
|
+
"data-testid": {},
|
|
9413
|
+
dataTestid: {}
|
|
9353
9414
|
},
|
|
9354
9415
|
setup(__props) {
|
|
9355
9416
|
const props = __props;
|
|
@@ -9622,7 +9683,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
9622
9683
|
])) : vue.createCommentVNode("", true)
|
|
9623
9684
|
])
|
|
9624
9685
|
], 4),
|
|
9625
|
-
vue.unref(expandedNodes).has(props.nodeId) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9
|
|
9686
|
+
vue.unref(expandedNodes).has(props.nodeId) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
|
|
9626
9687
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(filteredNodes.value, (child) => {
|
|
9627
9688
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
9628
9689
|
key: child.nodeId,
|
|
@@ -9673,7 +9734,8 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
9673
9734
|
__name: "FdsText",
|
|
9674
9735
|
props: {
|
|
9675
9736
|
type: { default: "default" },
|
|
9676
|
-
|
|
9737
|
+
"data-testid": {},
|
|
9738
|
+
dataTestid: {}
|
|
9677
9739
|
},
|
|
9678
9740
|
setup(__props) {
|
|
9679
9741
|
const props = __props;
|
|
@@ -9734,6 +9796,8 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
9734
9796
|
titleTemplate: { default: "[[title]]" },
|
|
9735
9797
|
onGetSearchContainerHeight: {},
|
|
9736
9798
|
selectedNodes: {},
|
|
9799
|
+
"data-testid": {},
|
|
9800
|
+
dataTestid: {},
|
|
9737
9801
|
data: {}
|
|
9738
9802
|
},
|
|
9739
9803
|
emits: ["update:selectedNodes", "getSearchContainerHeight"],
|
|
@@ -9859,7 +9923,9 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
9859
9923
|
open: { type: Boolean, default: false },
|
|
9860
9924
|
content: {},
|
|
9861
9925
|
btnExpand: { default: "Visa mer" },
|
|
9862
|
-
btnCollapse: { default: "Visa mindre" }
|
|
9926
|
+
btnCollapse: { default: "Visa mindre" },
|
|
9927
|
+
"data-testid": {},
|
|
9928
|
+
dataTestid: {}
|
|
9863
9929
|
},
|
|
9864
9930
|
emits: ["toggleHandler"],
|
|
9865
9931
|
setup(__props, { emit: __emit }) {
|
|
@@ -9939,19 +10005,21 @@ const _hoisted_3$2 = {
|
|
|
9939
10005
|
class: "font-thin mb-1"
|
|
9940
10006
|
};
|
|
9941
10007
|
const _hoisted_4$2 = { class: "relative" };
|
|
9942
|
-
const _hoisted_5$2 =
|
|
9943
|
-
const _hoisted_6 = {
|
|
10008
|
+
const _hoisted_5$2 = {
|
|
9944
10009
|
key: 0,
|
|
9945
10010
|
value: "",
|
|
9946
10011
|
disabled: ""
|
|
9947
10012
|
};
|
|
9948
|
-
const
|
|
9949
|
-
const
|
|
9950
|
-
const
|
|
10013
|
+
const _hoisted_6 = ["value", "disabled"];
|
|
10014
|
+
const _hoisted_7 = { class: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none" };
|
|
10015
|
+
const _hoisted_8 = {
|
|
9951
10016
|
key: 2,
|
|
9952
10017
|
class: "text-red-600 font-bold mt-1"
|
|
9953
10018
|
};
|
|
9954
10019
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
10020
|
+
...{
|
|
10021
|
+
inheritAttrs: false
|
|
10022
|
+
},
|
|
9955
10023
|
__name: "FdsSelect",
|
|
9956
10024
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
9957
10025
|
label: { default: void 0 },
|
|
@@ -9961,7 +10029,9 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
9961
10029
|
invalidMessage: { default: void 0 },
|
|
9962
10030
|
options: { default: void 0 },
|
|
9963
10031
|
modelValue: {},
|
|
9964
|
-
value: { default: void 0 }
|
|
10032
|
+
value: { default: void 0 },
|
|
10033
|
+
"data-testid": {},
|
|
10034
|
+
dataTestid: {}
|
|
9965
10035
|
}, {
|
|
9966
10036
|
"modelValue": { default: void 0, required: false },
|
|
9967
10037
|
"modelModifiers": {}
|
|
@@ -9971,8 +10041,18 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
9971
10041
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
9972
10042
|
const props = __props;
|
|
9973
10043
|
const emit = __emit;
|
|
10044
|
+
const { id, placeholder, attrs } = useAttrsWithDefaults(props);
|
|
9974
10045
|
const autoId = `fds-select-${Math.random().toString(36).slice(2, 9)}`;
|
|
9975
|
-
const selectId = vue.computed(() =>
|
|
10046
|
+
const selectId = vue.computed(() => id.value ?? autoId);
|
|
10047
|
+
const selectAttrs = vue.computed(() => {
|
|
10048
|
+
const { class: _class, ...rest } = attrs;
|
|
10049
|
+
return {
|
|
10050
|
+
...rest,
|
|
10051
|
+
id: selectId.value,
|
|
10052
|
+
disabled: props.disabled,
|
|
10053
|
+
"aria-invalid": props.valid === false ? "true" : void 0
|
|
10054
|
+
};
|
|
10055
|
+
});
|
|
9976
10056
|
const slots = vue.useSlots();
|
|
9977
10057
|
const hasDefaultSlot = vue.computed(() => !!slots.default);
|
|
9978
10058
|
const showInvalidMessage = vue.computed(
|
|
@@ -10009,40 +10089,36 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10009
10089
|
__props.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, vue.toDisplayString(__props.meta), 1)) : vue.createCommentVNode("", true),
|
|
10010
10090
|
vue.createElementVNode("div", _hoisted_4$2, [
|
|
10011
10091
|
vue.withDirectives(vue.createElementVNode("select", vue.mergeProps({
|
|
10012
|
-
id: selectId.value,
|
|
10013
|
-
name: _ctx.name || void 0,
|
|
10014
|
-
disabled: _ctx.disabled,
|
|
10015
10092
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalValue.value = $event),
|
|
10016
|
-
"aria-invalid": __props.valid === false ? "true" : void 0,
|
|
10017
10093
|
class: selectClasses.value
|
|
10018
|
-
},
|
|
10094
|
+
}, selectAttrs.value, {
|
|
10019
10095
|
onChange: handleChange,
|
|
10020
10096
|
onInput: _cache[1] || (_cache[1] = (e) => emit("input", e))
|
|
10021
10097
|
}), [
|
|
10022
|
-
|
|
10098
|
+
vue.unref(placeholder) && !hasDefaultSlot.value ? (vue.openBlock(), vue.createElementBlock("option", _hoisted_5$2, vue.toDisplayString(vue.unref(placeholder)), 1)) : vue.createCommentVNode("", true),
|
|
10023
10099
|
!hasDefaultSlot.value && __props.options ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(__props.options, (option) => {
|
|
10024
10100
|
return vue.openBlock(), vue.createElementBlock("option", {
|
|
10025
10101
|
key: option.value,
|
|
10026
10102
|
value: option.value,
|
|
10027
10103
|
disabled: option.disabled
|
|
10028
|
-
}, vue.toDisplayString(option.label), 9,
|
|
10104
|
+
}, vue.toDisplayString(option.label), 9, _hoisted_6);
|
|
10029
10105
|
}), 128)) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
10030
|
-
], 16
|
|
10106
|
+
], 16), [
|
|
10031
10107
|
[vue.vModelSelect, internalValue.value]
|
|
10032
10108
|
]),
|
|
10033
|
-
vue.createElementVNode("div",
|
|
10109
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
10034
10110
|
vue.createVNode(_sfc_main$w, {
|
|
10035
10111
|
name: "arrowDown",
|
|
10036
10112
|
size: 24,
|
|
10037
10113
|
class: vue.normalizeClass({
|
|
10038
|
-
"fill-gray-500":
|
|
10039
|
-
"fill-red-500": isInvalid.value && !
|
|
10040
|
-
"fill-blue-500": !
|
|
10114
|
+
"fill-gray-500": props.disabled,
|
|
10115
|
+
"fill-red-500": isInvalid.value && !props.disabled,
|
|
10116
|
+
"fill-blue-500": !props.disabled && !isInvalid.value
|
|
10041
10117
|
})
|
|
10042
10118
|
}, null, 8, ["class"])
|
|
10043
10119
|
])
|
|
10044
10120
|
]),
|
|
10045
|
-
showInvalidMessage.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
10121
|
+
showInvalidMessage.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, vue.toDisplayString(__props.invalidMessage), 1)) : vue.createCommentVNode("", true)
|
|
10046
10122
|
]);
|
|
10047
10123
|
};
|
|
10048
10124
|
}
|
|
@@ -10071,7 +10147,9 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10071
10147
|
invalidMessage: {},
|
|
10072
10148
|
modelValue: {},
|
|
10073
10149
|
modelModifiers: { default: () => ({}) },
|
|
10074
|
-
value: { default: void 0 }
|
|
10150
|
+
value: { default: void 0 },
|
|
10151
|
+
"data-testid": {},
|
|
10152
|
+
dataTestid: {}
|
|
10075
10153
|
}, {
|
|
10076
10154
|
"modelValue": { default: void 0, required: false },
|
|
10077
10155
|
"modelModifiers": {}
|
|
@@ -10081,7 +10159,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10081
10159
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
10082
10160
|
const props = __props;
|
|
10083
10161
|
const emit = __emit;
|
|
10084
|
-
const attrs =
|
|
10162
|
+
const { id, attrs } = useAttrsWithDefaults(props);
|
|
10085
10163
|
const wrapperClass = vue.computed(() => attrs.class);
|
|
10086
10164
|
const textareaAttrs = vue.computed(() => {
|
|
10087
10165
|
const { class: _, ...rest } = attrs;
|
|
@@ -10090,12 +10168,11 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10090
10168
|
id: textareaId.value,
|
|
10091
10169
|
disabled: props.disabled,
|
|
10092
10170
|
rows: props.rows,
|
|
10093
|
-
name: props.name,
|
|
10094
10171
|
"aria-invalid": props.valid === false ? true : void 0
|
|
10095
10172
|
};
|
|
10096
10173
|
});
|
|
10097
10174
|
const autoId = `fds-textarea-${Math.random().toString(36).slice(2, 9)}`;
|
|
10098
|
-
const textareaId = vue.computed(() =>
|
|
10175
|
+
const textareaId = vue.computed(() => id.value ?? autoId);
|
|
10099
10176
|
const isLazy = vue.computed(() => props.modelModifiers?.lazy === true);
|
|
10100
10177
|
const showInvalidMessage = vue.computed(() => props.valid === false && !props.optional && props.invalidMessage);
|
|
10101
10178
|
const isInvalid = vue.computed(() => props.valid === false && !props.optional && !props.disabled);
|
|
@@ -10171,7 +10248,9 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10171
10248
|
__name: "FdsTable",
|
|
10172
10249
|
props: {
|
|
10173
10250
|
bordered: { type: Boolean, default: false },
|
|
10174
|
-
compact: { type: Boolean, default: false }
|
|
10251
|
+
compact: { type: Boolean, default: false },
|
|
10252
|
+
"data-testid": {},
|
|
10253
|
+
dataTestid: {}
|
|
10175
10254
|
},
|
|
10176
10255
|
setup(__props) {
|
|
10177
10256
|
const props = __props;
|
|
@@ -10200,7 +10279,8 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10200
10279
|
heading: { default: void 0 },
|
|
10201
10280
|
align: { default: "left" },
|
|
10202
10281
|
icon: { default: void 0 },
|
|
10203
|
-
|
|
10282
|
+
"data-testid": {},
|
|
10283
|
+
dataTestid: {}
|
|
10204
10284
|
},
|
|
10205
10285
|
emits: ["sort", "click"],
|
|
10206
10286
|
setup(__props) {
|
|
@@ -10244,7 +10324,9 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10244
10324
|
__name: "FdsTabs",
|
|
10245
10325
|
props: {
|
|
10246
10326
|
block: { type: Boolean, default: false },
|
|
10247
|
-
variant: { default: "primary" }
|
|
10327
|
+
variant: { default: "primary" },
|
|
10328
|
+
"data-testid": {},
|
|
10329
|
+
dataTestid: {}
|
|
10248
10330
|
},
|
|
10249
10331
|
setup(__props) {
|
|
10250
10332
|
const props = __props;
|
|
@@ -10274,30 +10356,23 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10274
10356
|
__name: "FdsTabsItem",
|
|
10275
10357
|
props: {
|
|
10276
10358
|
to: { default: void 0 },
|
|
10277
|
-
href: { default: void 0 },
|
|
10278
10359
|
as: { default: void 0 },
|
|
10279
10360
|
active: { type: Boolean, default: void 0 },
|
|
10280
10361
|
exact: { type: Boolean, default: false },
|
|
10281
|
-
disabled: { type: Boolean, default: false },
|
|
10282
10362
|
label: { default: void 0 },
|
|
10283
|
-
|
|
10363
|
+
"data-testid": {},
|
|
10364
|
+
dataTestid: {}
|
|
10284
10365
|
},
|
|
10285
10366
|
emits: ["click"],
|
|
10286
10367
|
setup(__props, { emit: __emit }) {
|
|
10287
|
-
const attrs = vue.useAttrs();
|
|
10288
10368
|
const emit = __emit;
|
|
10289
|
-
const
|
|
10290
|
-
if (
|
|
10369
|
+
const handleClick = (ev) => {
|
|
10370
|
+
if (disabled.value) {
|
|
10291
10371
|
ev.preventDefault();
|
|
10292
10372
|
return;
|
|
10293
10373
|
}
|
|
10294
10374
|
emit("click", ev);
|
|
10295
10375
|
};
|
|
10296
|
-
const handleClick = (ev) => {
|
|
10297
|
-
if (componentType.value === "button" && !props.disabled) {
|
|
10298
|
-
onClick(ev);
|
|
10299
|
-
}
|
|
10300
|
-
};
|
|
10301
10376
|
const instance = vue.getCurrentInstance();
|
|
10302
10377
|
const route = vue.computed(() => {
|
|
10303
10378
|
try {
|
|
@@ -10310,6 +10385,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10310
10385
|
return null;
|
|
10311
10386
|
});
|
|
10312
10387
|
const props = __props;
|
|
10388
|
+
const { disabled, href, attrs } = useAttrsWithDefaults(props);
|
|
10313
10389
|
const variant = vue.inject("tabsVariant", "primary");
|
|
10314
10390
|
const block = vue.inject("tabsBlock", false);
|
|
10315
10391
|
const isActive = vue.computed(() => {
|
|
@@ -10317,25 +10393,26 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10317
10393
|
const currentRoute = route.value;
|
|
10318
10394
|
if (!currentRoute) return false;
|
|
10319
10395
|
const currentPath = currentRoute.path;
|
|
10396
|
+
const hrefValue = href.value;
|
|
10320
10397
|
if (props.exact) {
|
|
10321
10398
|
if (props.to && currentPath === props.to) return true;
|
|
10322
|
-
if (
|
|
10399
|
+
if (hrefValue && currentPath === hrefValue) return true;
|
|
10323
10400
|
} else {
|
|
10324
10401
|
if (props.to && currentPath.includes(props.to)) return true;
|
|
10325
|
-
if (
|
|
10402
|
+
if (hrefValue && currentPath.includes(hrefValue)) return true;
|
|
10326
10403
|
}
|
|
10327
10404
|
return false;
|
|
10328
10405
|
});
|
|
10329
10406
|
const componentType = vue.computed(() => {
|
|
10330
10407
|
if (props.as) return props.as;
|
|
10331
|
-
if (
|
|
10408
|
+
if (href.value) return "a";
|
|
10332
10409
|
if (props.to) return "router-link";
|
|
10333
10410
|
return "router-link";
|
|
10334
10411
|
});
|
|
10335
10412
|
const linkAttrs = vue.computed(() => {
|
|
10336
|
-
if (componentType.value === "a") return { href:
|
|
10413
|
+
if (componentType.value === "a") return { href: href.value || props.to };
|
|
10337
10414
|
if (componentType.value === "router-link") {
|
|
10338
|
-
return { to: props.to ||
|
|
10415
|
+
return { to: props.to || href.value || route.value?.path || "#" };
|
|
10339
10416
|
}
|
|
10340
10417
|
return {};
|
|
10341
10418
|
});
|
|
@@ -10367,13 +10444,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10367
10444
|
];
|
|
10368
10445
|
}
|
|
10369
10446
|
});
|
|
10370
|
-
const disabledClasses = vue.computed(() =>
|
|
10447
|
+
const disabledClasses = vue.computed(() => disabled.value ? "cursor-not-allowed pointer-events-none opacity-35" : "");
|
|
10371
10448
|
const buttonClasses = vue.computed(() => [...baseClasses.value, ...variantClasses2.value, disabledClasses.value]);
|
|
10372
10449
|
return (_ctx, _cache) => {
|
|
10373
10450
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(componentType.value), vue.mergeProps(componentAttrs.value, {
|
|
10374
10451
|
class: buttonClasses.value,
|
|
10375
|
-
disabled: componentType.value === "button" ?
|
|
10376
|
-
"aria-disabled":
|
|
10452
|
+
disabled: componentType.value === "button" ? vue.unref(disabled) : void 0,
|
|
10453
|
+
"aria-disabled": vue.unref(disabled) ? "true" : void 0,
|
|
10377
10454
|
"aria-current": isActive.value ? "page" : void 0,
|
|
10378
10455
|
onClick: handleClick
|
|
10379
10456
|
}), {
|
|
@@ -10391,7 +10468,9 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10391
10468
|
props: {
|
|
10392
10469
|
type: {},
|
|
10393
10470
|
size: { default: "responsive" },
|
|
10394
|
-
text: {}
|
|
10471
|
+
text: {},
|
|
10472
|
+
"data-testid": {},
|
|
10473
|
+
dataTestid: {}
|
|
10395
10474
|
},
|
|
10396
10475
|
setup(__props) {
|
|
10397
10476
|
const props = __props;
|
|
@@ -10449,7 +10528,9 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
10449
10528
|
total: {},
|
|
10450
10529
|
unfiltered: {},
|
|
10451
10530
|
text: {},
|
|
10452
|
-
language: { default: "sv" }
|
|
10531
|
+
language: { default: "sv" },
|
|
10532
|
+
"data-testid": {},
|
|
10533
|
+
dataTestid: {}
|
|
10453
10534
|
},
|
|
10454
10535
|
setup(__props) {
|
|
10455
10536
|
const props = __props;
|