@knime/kds-components 0.22.2 → 0.22.3
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/index.css +126 -44
- package/dist/index.js +1276 -874
- package/dist/index.js.map +1 -1
- package/dist/src/accessories/ColorSwatch/KdsColorSwatch.vue.d.ts.map +1 -1
- package/dist/src/forms/inputs/ColorInput/{ColorPicker.vue.d.ts → ColorPicker/ColorPicker.vue.d.ts} +0 -1
- package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPicker.vue.d.ts.map +1 -0
- package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPickerSlider.vue.d.ts +14 -0
- package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPickerSlider.vue.d.ts.map +1 -0
- package/dist/src/forms/inputs/ColorInput/ColorPicker/types.d.ts +12 -0
- package/dist/src/forms/inputs/ColorInput/ColorPicker/types.d.ts.map +1 -0
- package/dist/src/forms/inputs/ColorInput/KdsColorInput.vue.d.ts.map +1 -1
- package/dist/src/forms/inputs/ColorInput/colorUtils.d.ts +7 -0
- package/dist/src/forms/inputs/ColorInput/colorUtils.d.ts.map +1 -1
- package/dist/src/forms/inputs/ColorInput/useColorInputValidationOnFocusOut.d.ts.map +1 -1
- package/dist/src/forms/selects/MultiSelectListBox/KdsMultiSelectListBox.vue.d.ts.map +1 -1
- package/dist/src/forms/selects/MultiSelectListBox/types.d.ts +3 -1
- package/dist/src/forms/selects/MultiSelectListBox/types.d.ts.map +1 -1
- package/dist/src/forms/selects/SortableListBox/KdsSortableListBox.vue.d.ts +196 -0
- package/dist/src/forms/selects/SortableListBox/KdsSortableListBox.vue.d.ts.map +1 -0
- package/dist/src/forms/selects/SortableListBox/index.d.ts +3 -0
- package/dist/src/forms/selects/SortableListBox/index.d.ts.map +1 -0
- package/dist/src/forms/selects/SortableListBox/types.d.ts +10 -0
- package/dist/src/forms/selects/SortableListBox/types.d.ts.map +1 -0
- package/dist/src/forms/selects/SortableListBox/useSortableListBoxReorder.d.ts +16 -0
- package/dist/src/forms/selects/SortableListBox/useSortableListBoxReorder.d.ts.map +1 -0
- package/dist/src/forms/selects/TwinList/KdsTwinList.vue.d.ts.map +1 -1
- package/dist/src/forms/selects/TwinList/TwinListBody.vue.d.ts.map +1 -1
- package/dist/src/forms/selects/TwinList/types.d.ts +2 -0
- package/dist/src/forms/selects/TwinList/types.d.ts.map +1 -1
- package/dist/src/forms/selects/index.d.ts +2 -2
- package/dist/src/forms/selects/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src/forms/inputs/ColorInput/ColorPicker.vue.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, withKeys, defineAsyncComponent, onBeforeUpdate, withModifiers, reactive, onMounted, onUnmounted, toRefs, normalizeProps, inject, withDirectives, provide, guardReactiveProps, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers,
|
|
1
|
+
import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, withKeys, defineAsyncComponent, onBeforeUpdate, withModifiers, onBeforeUnmount, useCssVars, reactive, onMounted, onUnmounted, toRefs, normalizeProps, inject, withDirectives, provide, guardReactiveProps, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers, vModelText, createSlots } from 'vue';
|
|
2
2
|
import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useMutationObserver, useElementSize, useMousePressed, useVirtualList, useTemplateRefsList } from '@vueuse/core';
|
|
3
3
|
|
|
4
4
|
import './index.css';const kdsAvatarSize = {
|
|
@@ -9,14 +9,14 @@ import './index.css';const kdsAvatarSize = {
|
|
|
9
9
|
};
|
|
10
10
|
const kdsAvatarSizes = Object.values(kdsAvatarSize);
|
|
11
11
|
|
|
12
|
-
const _hoisted_1$
|
|
13
|
-
const _hoisted_2$
|
|
14
|
-
const _hoisted_3$
|
|
12
|
+
const _hoisted_1$M = ["role", "title", "aria-hidden", "aria-label"];
|
|
13
|
+
const _hoisted_2$t = ["src"];
|
|
14
|
+
const _hoisted_3$j = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "kds-avatar-initials",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
18
|
};
|
|
19
|
-
const _sfc_main$
|
|
19
|
+
const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
20
20
|
__name: "KdsAvatar",
|
|
21
21
|
props: {
|
|
22
22
|
initials: {},
|
|
@@ -59,10 +59,10 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
59
59
|
alt: "",
|
|
60
60
|
"aria-hidden": "true",
|
|
61
61
|
onError: onImageError
|
|
62
|
-
}, null, 40, _hoisted_2$
|
|
62
|
+
}, null, 40, _hoisted_2$t)) : (openBlock(), createElementBlock("div", _hoisted_3$j, [
|
|
63
63
|
createElementVNode("span", null, toDisplayString(displayedInitials.value), 1)
|
|
64
64
|
]))
|
|
65
|
-
], 10, _hoisted_1$
|
|
65
|
+
], 10, _hoisted_1$M);
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -75,7 +75,7 @@ const _export_sfc$1 = (sfc, props) => {
|
|
|
75
75
|
return target;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const KdsAvatar = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
78
|
+
const KdsAvatar = /* @__PURE__ */ _export_sfc$1(_sfc_main$1a, [["__scopeId", "data-v-c90668bf"]]);
|
|
79
79
|
|
|
80
80
|
const __variableDynamicImportRuntimeHelper = (glob$1, path$13, segs) => {
|
|
81
81
|
const v = glob$1[path$13];
|
|
@@ -117,7 +117,7 @@ function useIcon({
|
|
|
117
117
|
return iconComponent;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
const _sfc_main$
|
|
120
|
+
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
121
121
|
__name: "KdsIcon",
|
|
122
122
|
props: {
|
|
123
123
|
name: {},
|
|
@@ -146,7 +146,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
-
const KdsIcon = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
149
|
+
const KdsIcon = /* @__PURE__ */ _export_sfc$1(_sfc_main$19, [["__scopeId", "data-v-fb124eb6"]]);
|
|
150
150
|
|
|
151
151
|
const ID_TO_ICON_MAP = {
|
|
152
152
|
// Flow Variables
|
|
@@ -483,8 +483,8 @@ const kdsDataTypeSize = {
|
|
|
483
483
|
};
|
|
484
484
|
const kdsDataTypeSizes = Object.values(kdsDataTypeSize);
|
|
485
485
|
|
|
486
|
-
const _hoisted_1$
|
|
487
|
-
const _sfc_main$
|
|
486
|
+
const _hoisted_1$L = ["title"];
|
|
487
|
+
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
488
488
|
__name: "KdsDataType",
|
|
489
489
|
props: {
|
|
490
490
|
iconName: { default: "unknown-datatype" },
|
|
@@ -524,12 +524,12 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
524
524
|
"aria-hidden": "true",
|
|
525
525
|
focusable: "false"
|
|
526
526
|
}, null, 8, ["class"]))
|
|
527
|
-
], 10, _hoisted_1$
|
|
527
|
+
], 10, _hoisted_1$L);
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
});
|
|
531
531
|
|
|
532
|
-
const KdsDataType = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
532
|
+
const KdsDataType = /* @__PURE__ */ _export_sfc$1(_sfc_main$18, [["__scopeId", "data-v-3b8ebdbd"]]);
|
|
533
533
|
|
|
534
534
|
const kdsBadgeVariant = {
|
|
535
535
|
NEUTRAL: "neutral",
|
|
@@ -546,8 +546,8 @@ const kdsBadgeSize = {
|
|
|
546
546
|
};
|
|
547
547
|
const kdsBadgeSizes = Object.values(kdsBadgeSize);
|
|
548
548
|
|
|
549
|
-
const _hoisted_1$
|
|
550
|
-
const _sfc_main$
|
|
549
|
+
const _hoisted_1$K = { class: "label-wrapper" };
|
|
550
|
+
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
551
551
|
__name: "KdsBadge",
|
|
552
552
|
props: {
|
|
553
553
|
label: {},
|
|
@@ -569,13 +569,13 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
569
569
|
name: __props.leadingIcon,
|
|
570
570
|
size: sizeToIconSize[__props.size]
|
|
571
571
|
}, null, 8, ["name", "size"])) : createCommentVNode("", true),
|
|
572
|
-
createElementVNode("span", _hoisted_1$
|
|
572
|
+
createElementVNode("span", _hoisted_1$K, toDisplayString(__props.label), 1)
|
|
573
573
|
], 2);
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
});
|
|
577
577
|
|
|
578
|
-
const KdsBadge = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
578
|
+
const KdsBadge = /* @__PURE__ */ _export_sfc$1(_sfc_main$17, [["__scopeId", "data-v-df64f7cf"]]);
|
|
579
579
|
|
|
580
580
|
const kdsColorSwatchType = {
|
|
581
581
|
LEARNER: "learner",
|
|
@@ -594,8 +594,14 @@ const kdsColorSwatchSize = {
|
|
|
594
594
|
};
|
|
595
595
|
const kdsColorSwatchSizes = Object.values(kdsColorSwatchSize);
|
|
596
596
|
|
|
597
|
-
const _hoisted_1$
|
|
598
|
-
const
|
|
597
|
+
const _hoisted_1$J = ["role", "title", "aria-hidden", "aria-label"];
|
|
598
|
+
const RGBA_SHORT_HEX_LENGTH = 4;
|
|
599
|
+
const RGBA_LONG_HEX_LENGTH = 8;
|
|
600
|
+
const ALPHA_NIBBLE_INDEX = 3;
|
|
601
|
+
const ALPHA_BYTE_START = 6;
|
|
602
|
+
const RGB_SHORT_HEX_LENGTH = 3;
|
|
603
|
+
const RGB_LONG_HEX_LENGTH = 6;
|
|
604
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
599
605
|
__name: "KdsColorSwatch",
|
|
600
606
|
props: {
|
|
601
607
|
color: {},
|
|
@@ -614,12 +620,52 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
614
620
|
other: "var(--kds-color-nodes-and-variables-other)"
|
|
615
621
|
};
|
|
616
622
|
const isKdsColorSwatchType = (value) => Object.hasOwn(typeToTokenColor, value);
|
|
623
|
+
const isTransparentAlphaHexColor = (value) => {
|
|
624
|
+
const withoutHash = value.startsWith("#") ? value.slice(1) : value;
|
|
625
|
+
if (withoutHash.length === RGBA_SHORT_HEX_LENGTH) {
|
|
626
|
+
return withoutHash[ALPHA_NIBBLE_INDEX].toLowerCase() !== "f";
|
|
627
|
+
}
|
|
628
|
+
if (withoutHash.length === RGBA_LONG_HEX_LENGTH) {
|
|
629
|
+
return withoutHash.slice(ALPHA_BYTE_START).toLowerCase() !== "ff";
|
|
630
|
+
}
|
|
631
|
+
return false;
|
|
632
|
+
};
|
|
633
|
+
const toOpaqueHexColor = (value) => {
|
|
634
|
+
const withoutHash = value.startsWith("#") ? value.slice(1) : value;
|
|
635
|
+
if (withoutHash.length === RGBA_SHORT_HEX_LENGTH) {
|
|
636
|
+
return `#${withoutHash.slice(0, RGB_SHORT_HEX_LENGTH)}`;
|
|
637
|
+
}
|
|
638
|
+
if (withoutHash.length === RGBA_LONG_HEX_LENGTH) {
|
|
639
|
+
return `#${withoutHash.slice(0, RGB_LONG_HEX_LENGTH)}`;
|
|
640
|
+
}
|
|
641
|
+
return value;
|
|
642
|
+
};
|
|
617
643
|
const backgroundColor = computed(() => {
|
|
618
644
|
if (isKdsColorSwatchType(props.color)) {
|
|
619
645
|
return typeToTokenColor[props.color];
|
|
620
646
|
}
|
|
621
647
|
return props.color;
|
|
622
648
|
});
|
|
649
|
+
const showAlphaPreview = computed(
|
|
650
|
+
() => !isKdsColorSwatchType(props.color) && isTransparentAlphaHexColor(props.color)
|
|
651
|
+
);
|
|
652
|
+
const swatchStyle = computed(() => {
|
|
653
|
+
if (!showAlphaPreview.value) {
|
|
654
|
+
return { backgroundColor: backgroundColor.value };
|
|
655
|
+
}
|
|
656
|
+
const opaqueColor = toOpaqueHexColor(props.color);
|
|
657
|
+
return {
|
|
658
|
+
backgroundImage: `
|
|
659
|
+
linear-gradient(to right, ${backgroundColor.value} 0 50%, ${opaqueColor} 50% 100%),
|
|
660
|
+
repeating-conic-gradient(
|
|
661
|
+
var(--kds-color-background-neutral-active) 0 25%,
|
|
662
|
+
var(--kds-color-surface-default) 0 50%
|
|
663
|
+
)
|
|
664
|
+
`,
|
|
665
|
+
backgroundSize: "100% 100%, var(--kds-color-swatch-checker-size) var(--kds-color-swatch-checker-size)",
|
|
666
|
+
backgroundPosition: "0 0, 0 0"
|
|
667
|
+
};
|
|
668
|
+
});
|
|
623
669
|
const accessibleTitle = computed(() => props.title?.trim() ?? "");
|
|
624
670
|
const hasTitle = computed(() => accessibleTitle.value.length > 0);
|
|
625
671
|
return (_ctx, _cache) => {
|
|
@@ -627,15 +673,15 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
627
673
|
role: hasTitle.value ? "img" : "presentation",
|
|
628
674
|
class: normalizeClass(["kds-color-swatch", __props.size]),
|
|
629
675
|
title: hasTitle.value ? accessibleTitle.value : void 0,
|
|
630
|
-
style: normalizeStyle(
|
|
676
|
+
style: normalizeStyle(swatchStyle.value),
|
|
631
677
|
"aria-hidden": hasTitle.value ? void 0 : "true",
|
|
632
678
|
"aria-label": hasTitle.value ? accessibleTitle.value : void 0
|
|
633
|
-
}, null, 14, _hoisted_1$
|
|
679
|
+
}, null, 14, _hoisted_1$J);
|
|
634
680
|
};
|
|
635
681
|
}
|
|
636
682
|
});
|
|
637
683
|
|
|
638
|
-
const KdsColorSwatch = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
684
|
+
const KdsColorSwatch = /* @__PURE__ */ _export_sfc$1(_sfc_main$16, [["__scopeId", "data-v-91e0130d"]]);
|
|
639
685
|
|
|
640
686
|
const kdsDarkModeType = {
|
|
641
687
|
LIGHT: "light",
|
|
@@ -755,9 +801,9 @@ function useKdsIsTruncated(elementRef) {
|
|
|
755
801
|
return { isTruncated };
|
|
756
802
|
}
|
|
757
803
|
|
|
758
|
-
const _hoisted_1$
|
|
759
|
-
const _hoisted_2$
|
|
760
|
-
const _sfc_main$
|
|
804
|
+
const _hoisted_1$I = ["title", "aria-label"];
|
|
805
|
+
const _hoisted_2$s = ["title"];
|
|
806
|
+
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
761
807
|
__name: "KdsLiveStatus",
|
|
762
808
|
props: {
|
|
763
809
|
status: { default: "red" },
|
|
@@ -786,13 +832,13 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
786
832
|
ref: labelEl,
|
|
787
833
|
class: "label",
|
|
788
834
|
title: unref(isTruncated) ? __props.label : void 0
|
|
789
|
-
}, toDisplayString(__props.label), 9, _hoisted_2$
|
|
790
|
-
], 10, _hoisted_1$
|
|
835
|
+
}, toDisplayString(__props.label), 9, _hoisted_2$s)) : createCommentVNode("", true)
|
|
836
|
+
], 10, _hoisted_1$I);
|
|
791
837
|
};
|
|
792
838
|
}
|
|
793
839
|
});
|
|
794
840
|
|
|
795
|
-
const KdsLiveStatus = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
841
|
+
const KdsLiveStatus = /* @__PURE__ */ _export_sfc$1(_sfc_main$15, [["__scopeId", "data-v-01555495"]]);
|
|
796
842
|
|
|
797
843
|
const kdsLiveStatusStatus = {
|
|
798
844
|
RED: "red",
|
|
@@ -808,8 +854,8 @@ const kdsLiveStatusSize = {
|
|
|
808
854
|
};
|
|
809
855
|
const kdsLiveStatusSizes = Object.values(kdsLiveStatusSize);
|
|
810
856
|
|
|
811
|
-
const _hoisted_1$
|
|
812
|
-
const _sfc_main$
|
|
857
|
+
const _hoisted_1$H = ["data-style"];
|
|
858
|
+
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
813
859
|
__name: "KdsLoadingSpinner",
|
|
814
860
|
props: {
|
|
815
861
|
size: { default: "medium" },
|
|
@@ -834,12 +880,12 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
834
880
|
cy: "60",
|
|
835
881
|
r: "50"
|
|
836
882
|
}, null, -1)
|
|
837
|
-
])], 10, _hoisted_1$
|
|
883
|
+
])], 10, _hoisted_1$H);
|
|
838
884
|
};
|
|
839
885
|
}
|
|
840
886
|
});
|
|
841
887
|
|
|
842
|
-
const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
888
|
+
const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc$1(_sfc_main$14, [["__scopeId", "data-v-54835dc0"]]);
|
|
843
889
|
|
|
844
890
|
const kdsLoadingSpinnerVariant = {
|
|
845
891
|
ON_PRIMARY: "onPrimary",
|
|
@@ -849,14 +895,14 @@ const kdsLoadingSpinnerVariants = Object.values(
|
|
|
849
895
|
kdsLoadingSpinnerVariant
|
|
850
896
|
);
|
|
851
897
|
|
|
852
|
-
const _hoisted_1$
|
|
853
|
-
const _hoisted_2$
|
|
854
|
-
const _hoisted_3$
|
|
855
|
-
const _hoisted_4$
|
|
898
|
+
const _hoisted_1$G = ["role"];
|
|
899
|
+
const _hoisted_2$r = { class: "header" };
|
|
900
|
+
const _hoisted_3$i = { class: "headline" };
|
|
901
|
+
const _hoisted_4$e = {
|
|
856
902
|
key: 0,
|
|
857
903
|
class: "body"
|
|
858
904
|
};
|
|
859
|
-
const _sfc_main$
|
|
905
|
+
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
860
906
|
__name: "KdsInlineMessage",
|
|
861
907
|
props: {
|
|
862
908
|
headline: {},
|
|
@@ -887,21 +933,21 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
887
933
|
class: normalizeClass(classes.value),
|
|
888
934
|
role: role.value
|
|
889
935
|
}, [
|
|
890
|
-
createElementVNode("div", _hoisted_2$
|
|
936
|
+
createElementVNode("div", _hoisted_2$r, [
|
|
891
937
|
createVNode(KdsIcon, {
|
|
892
938
|
class: "icon",
|
|
893
939
|
name: iconName.value,
|
|
894
940
|
size: "small"
|
|
895
941
|
}, null, 8, ["name"]),
|
|
896
|
-
createElementVNode("div", _hoisted_3$
|
|
942
|
+
createElementVNode("div", _hoisted_3$i, toDisplayString(props.headline), 1)
|
|
897
943
|
]),
|
|
898
|
-
props.description ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
899
|
-
], 10, _hoisted_1$
|
|
944
|
+
props.description ? (openBlock(), createElementBlock("div", _hoisted_4$e, toDisplayString(props.description), 1)) : createCommentVNode("", true)
|
|
945
|
+
], 10, _hoisted_1$G);
|
|
900
946
|
};
|
|
901
947
|
}
|
|
902
948
|
});
|
|
903
949
|
|
|
904
|
-
const KdsInlineMessage = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
950
|
+
const KdsInlineMessage = /* @__PURE__ */ _export_sfc$1(_sfc_main$13, [["__scopeId", "data-v-af14056f"]]);
|
|
905
951
|
|
|
906
952
|
const kdsInlineMessageVariant = {
|
|
907
953
|
ERROR: "error",
|
|
@@ -911,11 +957,11 @@ const kdsInlineMessageVariant = {
|
|
|
911
957
|
};
|
|
912
958
|
const kdsInlineMessageVariants = Object.values(kdsInlineMessageVariant);
|
|
913
959
|
|
|
914
|
-
const _hoisted_1$
|
|
960
|
+
const _hoisted_1$F = {
|
|
915
961
|
key: 0,
|
|
916
962
|
class: "label"
|
|
917
963
|
};
|
|
918
|
-
const _sfc_main$
|
|
964
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
919
965
|
__name: "BaseButton",
|
|
920
966
|
props: {
|
|
921
967
|
size: { default: "medium" },
|
|
@@ -976,7 +1022,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
976
1022
|
size: iconSize.value
|
|
977
1023
|
}, null, 8, ["name", "size"])) : createCommentVNode("", true)
|
|
978
1024
|
], true),
|
|
979
|
-
props.label ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
1025
|
+
props.label ? (openBlock(), createElementBlock("span", _hoisted_1$F, toDisplayString(props.label), 1)) : createCommentVNode("", true),
|
|
980
1026
|
props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
|
|
981
1027
|
key: 1,
|
|
982
1028
|
name: props.trailingIcon,
|
|
@@ -989,9 +1035,9 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
989
1035
|
}
|
|
990
1036
|
});
|
|
991
1037
|
|
|
992
|
-
const BaseButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
1038
|
+
const BaseButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$12, [["__scopeId", "data-v-a696a1ec"]]);
|
|
993
1039
|
|
|
994
|
-
const _sfc_main
|
|
1040
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
995
1041
|
__name: "KdsButton",
|
|
996
1042
|
props: {
|
|
997
1043
|
size: {},
|
|
@@ -1045,7 +1091,7 @@ const resolveNuxtLinkComponent = () => {
|
|
|
1045
1091
|
return fallbackComponent;
|
|
1046
1092
|
};
|
|
1047
1093
|
|
|
1048
|
-
const _sfc_main$
|
|
1094
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
1049
1095
|
__name: "KdsLinkButton",
|
|
1050
1096
|
props: {
|
|
1051
1097
|
size: {},
|
|
@@ -1264,12 +1310,12 @@ function prettyBytes(number, options) {
|
|
|
1264
1310
|
return applyFixedWidth(result, options.fixedWidth);
|
|
1265
1311
|
}
|
|
1266
1312
|
|
|
1267
|
-
const _hoisted_1$
|
|
1268
|
-
const _hoisted_2$
|
|
1313
|
+
const _hoisted_1$E = { class: "label" };
|
|
1314
|
+
const _hoisted_2$q = {
|
|
1269
1315
|
key: 1,
|
|
1270
1316
|
class: "file-size"
|
|
1271
1317
|
};
|
|
1272
|
-
const _sfc_main
|
|
1318
|
+
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
1273
1319
|
__name: "KdsLink",
|
|
1274
1320
|
props: {
|
|
1275
1321
|
to: {},
|
|
@@ -1369,13 +1415,13 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
1369
1415
|
onClick
|
|
1370
1416
|
}, {
|
|
1371
1417
|
default: withCtx(() => [
|
|
1372
|
-
createElementVNode("span", _hoisted_1$
|
|
1418
|
+
createElementVNode("span", _hoisted_1$E, toDisplayString(__props.label), 1),
|
|
1373
1419
|
variant.value === "external" ? (openBlock(), createBlock(KdsIcon, {
|
|
1374
1420
|
key: 0,
|
|
1375
1421
|
name: "external-link",
|
|
1376
1422
|
size: "xsmall"
|
|
1377
1423
|
})) : createCommentVNode("", true),
|
|
1378
|
-
normalizedFileSize.value ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
1424
|
+
normalizedFileSize.value ? (openBlock(), createElementBlock("span", _hoisted_2$q, toDisplayString(normalizedFileSize.value), 1)) : createCommentVNode("", true)
|
|
1379
1425
|
]),
|
|
1380
1426
|
_: 1
|
|
1381
1427
|
}, 8, ["class", "to", "download", "target", "rel", "title", "aria-disabled"]);
|
|
@@ -1383,9 +1429,9 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
1383
1429
|
}
|
|
1384
1430
|
});
|
|
1385
1431
|
|
|
1386
|
-
const KdsLink = /* @__PURE__ */ _export_sfc$1(_sfc_main
|
|
1432
|
+
const KdsLink = /* @__PURE__ */ _export_sfc$1(_sfc_main$$, [["__scopeId", "data-v-65e776f1"]]);
|
|
1387
1433
|
|
|
1388
|
-
const _sfc_main$
|
|
1434
|
+
const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
1389
1435
|
__name: "KdsToggleButton",
|
|
1390
1436
|
props: /* @__PURE__ */ mergeModels({
|
|
1391
1437
|
size: {},
|
|
@@ -1421,9 +1467,9 @@ const kdsToggleButtonVariant = {
|
|
|
1421
1467
|
};
|
|
1422
1468
|
const kdsToggleButtonVariants = Object.values(kdsToggleButtonVariant);
|
|
1423
1469
|
|
|
1424
|
-
const _hoisted_1$
|
|
1425
|
-
const _hoisted_2$
|
|
1426
|
-
const _sfc_main$
|
|
1470
|
+
const _hoisted_1$D = ["data-visible"];
|
|
1471
|
+
const _hoisted_2$p = ["data-visible"];
|
|
1472
|
+
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
1427
1473
|
__name: "KdsProgressButton",
|
|
1428
1474
|
props: /* @__PURE__ */ mergeModels({
|
|
1429
1475
|
size: { default: "medium" },
|
|
@@ -1484,7 +1530,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
1484
1530
|
name: props.leadingIcon,
|
|
1485
1531
|
size: iconSize.value
|
|
1486
1532
|
}, null, 8, ["name", "size"])
|
|
1487
|
-
], 8, _hoisted_1$
|
|
1533
|
+
], 8, _hoisted_1$D),
|
|
1488
1534
|
createElementVNode("span", {
|
|
1489
1535
|
class: "spinner",
|
|
1490
1536
|
"data-visible": state.value === "progress"
|
|
@@ -1493,7 +1539,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
1493
1539
|
size: iconSize.value,
|
|
1494
1540
|
variant: __props.variant === "filled" ? "onPrimary" : "onSurface"
|
|
1495
1541
|
}, null, 8, ["size", "variant"])
|
|
1496
|
-
], 8, _hoisted_2$
|
|
1542
|
+
], 8, _hoisted_2$p)
|
|
1497
1543
|
], 2)
|
|
1498
1544
|
]),
|
|
1499
1545
|
_: 1
|
|
@@ -1502,7 +1548,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
1502
1548
|
}
|
|
1503
1549
|
});
|
|
1504
1550
|
|
|
1505
|
-
const KdsProgressButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
1551
|
+
const KdsProgressButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$Z, [["__scopeId", "data-v-d38d7ade"]]);
|
|
1506
1552
|
|
|
1507
1553
|
const kdsProgressButtonState = {
|
|
1508
1554
|
DEFAULT: "default",
|
|
@@ -1512,17 +1558,17 @@ const kdsProgressButtonState = {
|
|
|
1512
1558
|
};
|
|
1513
1559
|
const kdsProgressButtonStates = Object.values(kdsProgressButtonState);
|
|
1514
1560
|
|
|
1515
|
-
const _hoisted_1$
|
|
1516
|
-
const _hoisted_2$
|
|
1517
|
-
const _hoisted_3$
|
|
1561
|
+
const _hoisted_1$C = { class: "kds-empty-state" };
|
|
1562
|
+
const _hoisted_2$o = { class: "kds-empty-state-headline" };
|
|
1563
|
+
const _hoisted_3$h = {
|
|
1518
1564
|
key: 1,
|
|
1519
1565
|
class: "kds-empty-state-description"
|
|
1520
1566
|
};
|
|
1521
|
-
const _hoisted_4$
|
|
1567
|
+
const _hoisted_4$d = {
|
|
1522
1568
|
key: 2,
|
|
1523
1569
|
class: "kds-empty-state-action"
|
|
1524
1570
|
};
|
|
1525
|
-
const _sfc_main$
|
|
1571
|
+
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
1526
1572
|
__name: "KdsEmptyState",
|
|
1527
1573
|
props: {
|
|
1528
1574
|
headline: {},
|
|
@@ -1538,10 +1584,10 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
1538
1584
|
() => props.button && "to" in props.button && props.button.to !== void 0
|
|
1539
1585
|
);
|
|
1540
1586
|
const buttonComponent = computed(
|
|
1541
|
-
() => isLinkButton.value ? _sfc_main$
|
|
1587
|
+
() => isLinkButton.value ? _sfc_main$10 : _sfc_main$11
|
|
1542
1588
|
);
|
|
1543
1589
|
return (_ctx, _cache) => {
|
|
1544
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1590
|
+
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
1545
1591
|
props.loadingSpinner ? (openBlock(), createBlock(KdsLoadingSpinner, {
|
|
1546
1592
|
key: 0,
|
|
1547
1593
|
"data-testid": "loading-spinner",
|
|
@@ -1549,9 +1595,9 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
1549
1595
|
variant: "onSurface",
|
|
1550
1596
|
"aria-hidden": "true"
|
|
1551
1597
|
})) : createCommentVNode("", true),
|
|
1552
|
-
createElementVNode("p", _hoisted_2$
|
|
1553
|
-
props.description ? (openBlock(), createElementBlock("p", _hoisted_3$
|
|
1554
|
-
props.button ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
1598
|
+
createElementVNode("p", _hoisted_2$o, toDisplayString(props.headline), 1),
|
|
1599
|
+
props.description ? (openBlock(), createElementBlock("p", _hoisted_3$h, toDisplayString(props.description), 1)) : createCommentVNode("", true),
|
|
1600
|
+
props.button ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
|
|
1555
1601
|
(openBlock(), createBlock(resolveDynamicComponent(buttonComponent.value), mergeProps(props.button, {
|
|
1556
1602
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("buttonClick", $event))
|
|
1557
1603
|
}), null, 16))
|
|
@@ -1561,9 +1607,9 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
1561
1607
|
}
|
|
1562
1608
|
});
|
|
1563
1609
|
|
|
1564
|
-
const KdsEmptyState = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
1610
|
+
const KdsEmptyState = /* @__PURE__ */ _export_sfc$1(_sfc_main$Y, [["__scopeId", "data-v-5da4d570"]]);
|
|
1565
1611
|
|
|
1566
|
-
const _sfc_main$
|
|
1612
|
+
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
1567
1613
|
__name: "ListItemAccessory",
|
|
1568
1614
|
props: {
|
|
1569
1615
|
accessory: {},
|
|
@@ -1614,13 +1660,13 @@ const kdsListItemVariant = {
|
|
|
1614
1660
|
LARGE: "large"
|
|
1615
1661
|
};
|
|
1616
1662
|
|
|
1617
|
-
const _hoisted_1$
|
|
1618
|
-
const _hoisted_2$
|
|
1663
|
+
const _hoisted_1$B = ["id", "role", "aria-selected", "aria-disabled"];
|
|
1664
|
+
const _hoisted_2$n = {
|
|
1619
1665
|
key: 0,
|
|
1620
1666
|
class: "accessory"
|
|
1621
1667
|
};
|
|
1622
|
-
const _hoisted_3$
|
|
1623
|
-
const _hoisted_4$
|
|
1668
|
+
const _hoisted_3$g = { class: "content" };
|
|
1669
|
+
const _hoisted_4$c = ["title"];
|
|
1624
1670
|
const _hoisted_5$7 = {
|
|
1625
1671
|
key: 0,
|
|
1626
1672
|
class: "prefix"
|
|
@@ -1635,7 +1681,7 @@ const _hoisted_9$1 = {
|
|
|
1635
1681
|
key: 2,
|
|
1636
1682
|
class: "trailing-item-reserve-space"
|
|
1637
1683
|
};
|
|
1638
|
-
const _sfc_main$
|
|
1684
|
+
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
1639
1685
|
__name: "KdsListItem",
|
|
1640
1686
|
props: {
|
|
1641
1687
|
id: {},
|
|
@@ -1689,14 +1735,14 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
1689
1735
|
]),
|
|
1690
1736
|
onClick
|
|
1691
1737
|
}, [
|
|
1692
|
-
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
1693
|
-
createVNode(_sfc_main$
|
|
1738
|
+
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$n, [
|
|
1739
|
+
createVNode(_sfc_main$X, {
|
|
1694
1740
|
accessory: props.accessory,
|
|
1695
1741
|
size: accessorySize.value,
|
|
1696
1742
|
disabled: __props.disabled
|
|
1697
1743
|
}, null, 8, ["accessory", "size", "disabled"])
|
|
1698
1744
|
])) : createCommentVNode("", true),
|
|
1699
|
-
createElementVNode("span", _hoisted_3$
|
|
1745
|
+
createElementVNode("span", _hoisted_3$g, [
|
|
1700
1746
|
createElementVNode("span", {
|
|
1701
1747
|
ref_key: "labelEl",
|
|
1702
1748
|
ref: labelEl,
|
|
@@ -1707,7 +1753,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
1707
1753
|
createElementVNode("span", {
|
|
1708
1754
|
class: normalizeClass({ special: __props.special })
|
|
1709
1755
|
}, toDisplayString(props.label), 3)
|
|
1710
|
-
], 8, _hoisted_4$
|
|
1756
|
+
], 8, _hoisted_4$c),
|
|
1711
1757
|
props.subText ? (openBlock(), createElementBlock("span", {
|
|
1712
1758
|
key: 0,
|
|
1713
1759
|
ref_key: "subtextEl",
|
|
@@ -1724,29 +1770,29 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
1724
1770
|
size: "small"
|
|
1725
1771
|
}, null, 8, ["name"])) : (openBlock(), createElementBlock("span", _hoisted_9$1))
|
|
1726
1772
|
])
|
|
1727
|
-
], 10, _hoisted_1$
|
|
1773
|
+
], 10, _hoisted_1$B);
|
|
1728
1774
|
};
|
|
1729
1775
|
}
|
|
1730
1776
|
});
|
|
1731
1777
|
|
|
1732
|
-
const KdsListItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
1778
|
+
const KdsListItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$W, [["__scopeId", "data-v-822789ec"]]);
|
|
1733
1779
|
|
|
1734
|
-
const _sfc_main$
|
|
1780
|
+
const _sfc_main$V = { };
|
|
1735
1781
|
|
|
1736
|
-
const _hoisted_1$
|
|
1782
|
+
const _hoisted_1$A = { class: "kds-list-item-divider" };
|
|
1737
1783
|
|
|
1738
1784
|
function _sfc_render$8(_ctx, _cache) {
|
|
1739
|
-
return (openBlock(), createElementBlock("hr", _hoisted_1$
|
|
1785
|
+
return (openBlock(), createElementBlock("hr", _hoisted_1$A))
|
|
1740
1786
|
}
|
|
1741
|
-
const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$
|
|
1787
|
+
const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$V, [['render',_sfc_render$8],['__scopeId',"data-v-3ee92695"]]);
|
|
1742
1788
|
|
|
1743
|
-
const _hoisted_1$
|
|
1744
|
-
const _hoisted_2$
|
|
1789
|
+
const _hoisted_1$z = { class: "kds-list-item-section-title" };
|
|
1790
|
+
const _hoisted_2$m = {
|
|
1745
1791
|
key: 0,
|
|
1746
1792
|
class: "icon"
|
|
1747
1793
|
};
|
|
1748
|
-
const _hoisted_3$
|
|
1749
|
-
const _sfc_main$
|
|
1794
|
+
const _hoisted_3$f = ["title"];
|
|
1795
|
+
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
1750
1796
|
__name: "ListItemSectionTitle",
|
|
1751
1797
|
props: {
|
|
1752
1798
|
label: {},
|
|
@@ -1757,8 +1803,8 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
1757
1803
|
const labelEl = useTemplateRef("labelEl");
|
|
1758
1804
|
const { isTruncated } = useKdsIsTruncated(labelEl);
|
|
1759
1805
|
return (_ctx, _cache) => {
|
|
1760
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1761
|
-
props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
1806
|
+
return openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
1807
|
+
props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$m, [
|
|
1762
1808
|
createVNode(KdsIcon, {
|
|
1763
1809
|
name: props.leadingIcon,
|
|
1764
1810
|
size: "small"
|
|
@@ -1769,18 +1815,18 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
1769
1815
|
ref: labelEl,
|
|
1770
1816
|
class: "label",
|
|
1771
1817
|
title: unref(isTruncated) ? props.label : void 0
|
|
1772
|
-
}, toDisplayString(props.label), 9, _hoisted_3$
|
|
1818
|
+
}, toDisplayString(props.label), 9, _hoisted_3$f)
|
|
1773
1819
|
]);
|
|
1774
1820
|
};
|
|
1775
1821
|
}
|
|
1776
1822
|
});
|
|
1777
1823
|
|
|
1778
|
-
const ListItemSectionTitle = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
1824
|
+
const ListItemSectionTitle = /* @__PURE__ */ _export_sfc$1(_sfc_main$U, [["__scopeId", "data-v-53382531"]]);
|
|
1779
1825
|
|
|
1780
|
-
const _hoisted_1$
|
|
1781
|
-
const _hoisted_2$
|
|
1826
|
+
const _hoisted_1$y = ["role", "aria-busy", "aria-label", "aria-activedescendant", "tabindex"];
|
|
1827
|
+
const _hoisted_2$l = ["role"];
|
|
1782
1828
|
const loadingStateText = "Loading entries";
|
|
1783
|
-
const _sfc_main$
|
|
1829
|
+
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
1784
1830
|
__name: "KdsListContainer",
|
|
1785
1831
|
props: {
|
|
1786
1832
|
possibleValues: {},
|
|
@@ -2050,21 +2096,21 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
2050
2096
|
headline: __props.loading ? loadingStateText : __props.emptyText,
|
|
2051
2097
|
"loading-spinner": __props.loading
|
|
2052
2098
|
}, null, 8, ["headline", "loading-spinner"])
|
|
2053
|
-
], 8, _hoisted_2$
|
|
2054
|
-
], 16, _hoisted_1$
|
|
2099
|
+
], 8, _hoisted_2$l)) : createCommentVNode("", true)
|
|
2100
|
+
], 16, _hoisted_1$y);
|
|
2055
2101
|
};
|
|
2056
2102
|
}
|
|
2057
2103
|
});
|
|
2058
2104
|
|
|
2059
|
-
const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2105
|
+
const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$T, [["__scopeId", "data-v-d8750fc1"]]);
|
|
2060
2106
|
|
|
2061
2107
|
const KdsListContainer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
2062
2108
|
__proto__: null,
|
|
2063
2109
|
default: KdsListContainer
|
|
2064
2110
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
2065
2111
|
|
|
2066
|
-
const _hoisted_1$
|
|
2067
|
-
const _sfc_main$
|
|
2112
|
+
const _hoisted_1$x = { class: "kds-menu-container" };
|
|
2113
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
2068
2114
|
__name: "KdsMenuContainer",
|
|
2069
2115
|
props: {
|
|
2070
2116
|
id: {},
|
|
@@ -2088,7 +2134,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
2088
2134
|
}
|
|
2089
2135
|
});
|
|
2090
2136
|
return (_ctx, _cache) => {
|
|
2091
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2137
|
+
return openBlock(), createElementBlock("div", _hoisted_1$x, [
|
|
2092
2138
|
createVNode(KdsListContainer, {
|
|
2093
2139
|
id: props.id,
|
|
2094
2140
|
ref_key: "listContainerEl",
|
|
@@ -2105,14 +2151,14 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
2105
2151
|
}
|
|
2106
2152
|
});
|
|
2107
2153
|
|
|
2108
|
-
const KdsMenuContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2154
|
+
const KdsMenuContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$S, [["__scopeId", "data-v-d87656d8"]]);
|
|
2109
2155
|
|
|
2110
|
-
const _hoisted_1$
|
|
2111
|
-
const _hoisted_2$
|
|
2156
|
+
const _hoisted_1$w = ["id", "popover", "role"];
|
|
2157
|
+
const _hoisted_2$k = {
|
|
2112
2158
|
key: 0,
|
|
2113
2159
|
class: "kds-popover-default-content"
|
|
2114
2160
|
};
|
|
2115
|
-
const _sfc_main$
|
|
2161
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
2116
2162
|
__name: "KdsPopover",
|
|
2117
2163
|
props: /* @__PURE__ */ mergeModels({
|
|
2118
2164
|
placement: { default: "bottom-left" },
|
|
@@ -2156,21 +2202,21 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
2156
2202
|
onToggle
|
|
2157
2203
|
}, [
|
|
2158
2204
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2159
|
-
props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2205
|
+
props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$k, toDisplayString(props.content), 1)) : createCommentVNode("", true)
|
|
2160
2206
|
], true)
|
|
2161
|
-
], 46, _hoisted_1$
|
|
2207
|
+
], 46, _hoisted_1$w);
|
|
2162
2208
|
};
|
|
2163
2209
|
}
|
|
2164
2210
|
});
|
|
2165
2211
|
|
|
2166
|
-
const KdsPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2212
|
+
const KdsPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$R, [["__scopeId", "data-v-83c11cee"]]);
|
|
2167
2213
|
|
|
2168
2214
|
const KdsPopover$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
2169
2215
|
__proto__: null,
|
|
2170
2216
|
default: KdsPopover
|
|
2171
2217
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
2172
2218
|
|
|
2173
|
-
const _sfc_main$
|
|
2219
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
2174
2220
|
...{
|
|
2175
2221
|
inheritAttrs: false
|
|
2176
2222
|
},
|
|
@@ -2218,7 +2264,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2218
2264
|
};
|
|
2219
2265
|
return (_ctx, _cache) => {
|
|
2220
2266
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2221
|
-
createVNode(_sfc_main$
|
|
2267
|
+
createVNode(_sfc_main$_, mergeProps({
|
|
2222
2268
|
modelValue: isMenuOpen.value,
|
|
2223
2269
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event)
|
|
2224
2270
|
}, toggleButtonProps.value, {
|
|
@@ -2252,7 +2298,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2252
2298
|
}
|
|
2253
2299
|
});
|
|
2254
2300
|
|
|
2255
|
-
const _sfc_main$
|
|
2301
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
2256
2302
|
__name: "KdsSplitButton",
|
|
2257
2303
|
props: {
|
|
2258
2304
|
size: { default: "medium" },
|
|
@@ -2339,7 +2385,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
2339
2385
|
}
|
|
2340
2386
|
});
|
|
2341
2387
|
|
|
2342
|
-
const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2388
|
+
const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["__scopeId", "data-v-f9ca012e"]]);
|
|
2343
2389
|
|
|
2344
2390
|
const kdsButtonSize = {
|
|
2345
2391
|
XSMALL: "xsmall",
|
|
@@ -2355,9 +2401,9 @@ const kdsButtonVariant = {
|
|
|
2355
2401
|
};
|
|
2356
2402
|
const kdsButtonVariants = Object.values(kdsButtonVariant);
|
|
2357
2403
|
|
|
2358
|
-
const _hoisted_1$
|
|
2359
|
-
const _hoisted_2$
|
|
2360
|
-
const _sfc_main$
|
|
2404
|
+
const _hoisted_1$v = { class: "kds-label-wrapper" };
|
|
2405
|
+
const _hoisted_2$j = ["id", "for", "title"];
|
|
2406
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
2361
2407
|
__name: "KdsLabel",
|
|
2362
2408
|
props: {
|
|
2363
2409
|
label: {},
|
|
@@ -2374,7 +2420,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2374
2420
|
const labelEl = useTemplateRef("labelEl");
|
|
2375
2421
|
const { isTruncated } = useKdsIsTruncated(labelEl);
|
|
2376
2422
|
return (_ctx, _cache) => {
|
|
2377
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2423
|
+
return openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
2378
2424
|
createElementVNode("label", {
|
|
2379
2425
|
id: props.id,
|
|
2380
2426
|
ref_key: "labelEl",
|
|
@@ -2382,7 +2428,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2382
2428
|
for: props.for,
|
|
2383
2429
|
class: "label",
|
|
2384
2430
|
title: unref(isTruncated) ? props.label : void 0
|
|
2385
|
-
}, toDisplayString(props.label), 9, _hoisted_2$
|
|
2431
|
+
}, toDisplayString(props.label), 9, _hoisted_2$j),
|
|
2386
2432
|
props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
|
|
2387
2433
|
key: 0,
|
|
2388
2434
|
content: props.description,
|
|
@@ -2393,11 +2439,11 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2393
2439
|
}
|
|
2394
2440
|
});
|
|
2395
2441
|
|
|
2396
|
-
const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2442
|
+
const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$O, [["__scopeId", "data-v-13bea091"]]);
|
|
2397
2443
|
|
|
2398
|
-
const _hoisted_1$
|
|
2399
|
-
const _hoisted_2$
|
|
2400
|
-
const _sfc_main$
|
|
2444
|
+
const _hoisted_1$u = ["id"];
|
|
2445
|
+
const _hoisted_2$i = { class: "subtext-text" };
|
|
2446
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
2401
2447
|
__name: "KdsSubText",
|
|
2402
2448
|
props: {
|
|
2403
2449
|
id: {},
|
|
@@ -2428,27 +2474,27 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
2428
2474
|
variant: "onSurface",
|
|
2429
2475
|
"aria-hidden": "true"
|
|
2430
2476
|
})) : createCommentVNode("", true),
|
|
2431
|
-
createElementVNode("span", _hoisted_2$
|
|
2432
|
-
], 10, _hoisted_1$
|
|
2477
|
+
createElementVNode("span", _hoisted_2$i, toDisplayString(props.subText), 1)
|
|
2478
|
+
], 10, _hoisted_1$u)) : createCommentVNode("", true);
|
|
2433
2479
|
};
|
|
2434
2480
|
}
|
|
2435
2481
|
});
|
|
2436
2482
|
|
|
2437
|
-
const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2483
|
+
const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$N, [["__scopeId", "data-v-2e6ba10c"]]);
|
|
2438
2484
|
|
|
2439
|
-
const _hoisted_1$
|
|
2440
|
-
const _hoisted_2$
|
|
2441
|
-
const _hoisted_3$
|
|
2485
|
+
const _hoisted_1$t = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
|
|
2486
|
+
const _hoisted_2$h = { class: "control" };
|
|
2487
|
+
const _hoisted_3$e = {
|
|
2442
2488
|
key: 0,
|
|
2443
2489
|
class: "content"
|
|
2444
2490
|
};
|
|
2445
|
-
const _hoisted_4$
|
|
2491
|
+
const _hoisted_4$b = { class: "label" };
|
|
2446
2492
|
const _hoisted_5$6 = ["id"];
|
|
2447
2493
|
const _hoisted_6$4 = {
|
|
2448
2494
|
key: 0,
|
|
2449
2495
|
class: "subtext-wrapper"
|
|
2450
2496
|
};
|
|
2451
|
-
const _sfc_main$
|
|
2497
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
2452
2498
|
__name: "BaseCheckbox",
|
|
2453
2499
|
props: /* @__PURE__ */ mergeModels({
|
|
2454
2500
|
disabled: { type: Boolean, default: false },
|
|
@@ -2521,7 +2567,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2521
2567
|
role: "checkbox",
|
|
2522
2568
|
onClick: handleClick
|
|
2523
2569
|
}, [
|
|
2524
|
-
createElementVNode("div", _hoisted_2$
|
|
2570
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
2525
2571
|
icon.value ? (openBlock(), createBlock(KdsIcon, {
|
|
2526
2572
|
key: 0,
|
|
2527
2573
|
name: icon.value,
|
|
@@ -2529,15 +2575,15 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2529
2575
|
size: "xsmall"
|
|
2530
2576
|
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
2531
2577
|
]),
|
|
2532
|
-
props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2533
|
-
createElementVNode("div", _hoisted_4$
|
|
2578
|
+
props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$e, [
|
|
2579
|
+
createElementVNode("div", _hoisted_4$b, toDisplayString(props.label), 1),
|
|
2534
2580
|
props.helperText ? (openBlock(), createElementBlock("div", {
|
|
2535
2581
|
key: 0,
|
|
2536
2582
|
id: unref(helperId),
|
|
2537
2583
|
class: "helper-text"
|
|
2538
2584
|
}, toDisplayString(props.helperText), 9, _hoisted_5$6)) : createCommentVNode("", true)
|
|
2539
2585
|
])) : createCommentVNode("", true)
|
|
2540
|
-
], 10, _hoisted_1$
|
|
2586
|
+
], 10, _hoisted_1$t),
|
|
2541
2587
|
props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
|
|
2542
2588
|
createVNode(KdsSubText, {
|
|
2543
2589
|
id: unref(descriptionId),
|
|
@@ -2551,9 +2597,9 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2551
2597
|
}
|
|
2552
2598
|
});
|
|
2553
2599
|
|
|
2554
|
-
const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2600
|
+
const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$M, [["__scopeId", "data-v-7bfc5667"]]);
|
|
2555
2601
|
|
|
2556
|
-
const _sfc_main$
|
|
2602
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
2557
2603
|
__name: "KdsCheckbox",
|
|
2558
2604
|
props: /* @__PURE__ */ mergeModels({
|
|
2559
2605
|
disabled: { type: Boolean, default: false },
|
|
@@ -2583,11 +2629,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
2583
2629
|
}
|
|
2584
2630
|
});
|
|
2585
2631
|
|
|
2586
|
-
const _hoisted_1$
|
|
2587
|
-
const _hoisted_2$
|
|
2588
|
-
const _hoisted_3$
|
|
2589
|
-
const _hoisted_4$
|
|
2590
|
-
const _sfc_main$
|
|
2632
|
+
const _hoisted_1$s = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby"];
|
|
2633
|
+
const _hoisted_2$g = ["id"];
|
|
2634
|
+
const _hoisted_3$d = ["title"];
|
|
2635
|
+
const _hoisted_4$a = { class: "kds-fieldset-content" };
|
|
2636
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
2591
2637
|
__name: "BaseFieldsetWrapper",
|
|
2592
2638
|
props: {
|
|
2593
2639
|
id: {},
|
|
@@ -2633,14 +2679,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
2633
2679
|
ref: legendTextEl,
|
|
2634
2680
|
class: "legend-text",
|
|
2635
2681
|
title: unref(isTruncated) ? props.label : void 0
|
|
2636
|
-
}, toDisplayString(props.label), 9, _hoisted_3$
|
|
2682
|
+
}, toDisplayString(props.label), 9, _hoisted_3$d),
|
|
2637
2683
|
props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
|
|
2638
2684
|
key: 0,
|
|
2639
2685
|
content: props.description,
|
|
2640
2686
|
hidden: !isHovered.value
|
|
2641
2687
|
}, null, 8, ["content", "hidden"])) : createCommentVNode("", true)
|
|
2642
|
-
], 8, _hoisted_2$
|
|
2643
|
-
createElementVNode("div", _hoisted_4$
|
|
2688
|
+
], 8, _hoisted_2$g)) : createCommentVNode("", true),
|
|
2689
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
2644
2690
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2645
2691
|
]),
|
|
2646
2692
|
createVNode(KdsSubText, {
|
|
@@ -2650,14 +2696,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
2650
2696
|
validating: props.validating,
|
|
2651
2697
|
"preserve-sub-text-space": props.preserveSubTextSpace
|
|
2652
2698
|
}, null, 8, ["id", "sub-text", "error", "validating", "preserve-sub-text-space"])
|
|
2653
|
-
], 40, _hoisted_1$
|
|
2699
|
+
], 40, _hoisted_1$s);
|
|
2654
2700
|
};
|
|
2655
2701
|
}
|
|
2656
2702
|
});
|
|
2657
2703
|
|
|
2658
|
-
const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2704
|
+
const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$K, [["__scopeId", "data-v-a44731da"]]);
|
|
2659
2705
|
|
|
2660
|
-
const _sfc_main$
|
|
2706
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
2661
2707
|
__name: "KdsCheckboxGroup",
|
|
2662
2708
|
props: /* @__PURE__ */ mergeModels({
|
|
2663
2709
|
id: {},
|
|
@@ -2736,7 +2782,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
2736
2782
|
}
|
|
2737
2783
|
});
|
|
2738
2784
|
|
|
2739
|
-
const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2785
|
+
const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$J, [["__scopeId", "data-v-c6536296"]]);
|
|
2740
2786
|
|
|
2741
2787
|
const kdsCheckboxGroupAlignment = {
|
|
2742
2788
|
VERTICAL: "vertical",
|
|
@@ -2752,19 +2798,19 @@ const kdsCheckboxValue = {
|
|
|
2752
2798
|
};
|
|
2753
2799
|
const kdsCheckboxValues = Object.values(kdsCheckboxValue);
|
|
2754
2800
|
|
|
2755
|
-
const _hoisted_1$
|
|
2756
|
-
const _hoisted_2$
|
|
2757
|
-
const _hoisted_3$
|
|
2801
|
+
const _hoisted_1$r = ["aria-checked", "aria-describedby", "aria-invalid", "disabled"];
|
|
2802
|
+
const _hoisted_2$f = { class: "control" };
|
|
2803
|
+
const _hoisted_3$c = {
|
|
2758
2804
|
key: 0,
|
|
2759
2805
|
class: "dot",
|
|
2760
2806
|
viewBox: "0 0 2 2",
|
|
2761
2807
|
"aria-hidden": "true",
|
|
2762
2808
|
focusable: "false"
|
|
2763
2809
|
};
|
|
2764
|
-
const _hoisted_4$
|
|
2810
|
+
const _hoisted_4$9 = { class: "content" };
|
|
2765
2811
|
const _hoisted_5$5 = { class: "label" };
|
|
2766
2812
|
const _hoisted_6$3 = ["id"];
|
|
2767
|
-
const _sfc_main$
|
|
2813
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
2768
2814
|
__name: "KdsRadioButton",
|
|
2769
2815
|
props: /* @__PURE__ */ mergeModels({
|
|
2770
2816
|
text: {},
|
|
@@ -2804,8 +2850,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2804
2850
|
type: "button",
|
|
2805
2851
|
onClick: handleClick
|
|
2806
2852
|
}, [
|
|
2807
|
-
createElementVNode("div", _hoisted_2$
|
|
2808
|
-
modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$
|
|
2853
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
2854
|
+
modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$c, [..._cache[0] || (_cache[0] = [
|
|
2809
2855
|
createElementVNode("circle", {
|
|
2810
2856
|
cx: "1",
|
|
2811
2857
|
cy: "1",
|
|
@@ -2813,7 +2859,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2813
2859
|
}, null, -1)
|
|
2814
2860
|
])])) : createCommentVNode("", true)
|
|
2815
2861
|
]),
|
|
2816
|
-
createElementVNode("div", _hoisted_4$
|
|
2862
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
2817
2863
|
createElementVNode("div", _hoisted_5$5, toDisplayString(props.text), 1),
|
|
2818
2864
|
props.helperText ? (openBlock(), createElementBlock("div", {
|
|
2819
2865
|
key: 0,
|
|
@@ -2821,12 +2867,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2821
2867
|
class: "helper-text"
|
|
2822
2868
|
}, toDisplayString(props.helperText), 9, _hoisted_6$3)) : createCommentVNode("", true)
|
|
2823
2869
|
])
|
|
2824
|
-
], 10, _hoisted_1$
|
|
2870
|
+
], 10, _hoisted_1$r);
|
|
2825
2871
|
};
|
|
2826
2872
|
}
|
|
2827
2873
|
});
|
|
2828
2874
|
|
|
2829
|
-
const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2875
|
+
const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$I, [["__scopeId", "data-v-f4f6392a"]]);
|
|
2830
2876
|
|
|
2831
2877
|
const useRadioSelection = ({
|
|
2832
2878
|
selectedId,
|
|
@@ -2948,7 +2994,7 @@ const useRadioSelection = ({
|
|
|
2948
2994
|
};
|
|
2949
2995
|
};
|
|
2950
2996
|
|
|
2951
|
-
const _sfc_main$
|
|
2997
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
2952
2998
|
__name: "KdsRadioButtonGroup",
|
|
2953
2999
|
props: /* @__PURE__ */ mergeModels({
|
|
2954
3000
|
id: {},
|
|
@@ -3023,10 +3069,10 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
3023
3069
|
}
|
|
3024
3070
|
});
|
|
3025
3071
|
|
|
3026
|
-
const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3072
|
+
const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-d78ed4a2"]]);
|
|
3027
3073
|
|
|
3028
|
-
const _hoisted_1$
|
|
3029
|
-
const _sfc_main$
|
|
3074
|
+
const _hoisted_1$q = ["aria-checked", "aria-label", "disabled", "tabindex", "title"];
|
|
3075
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
3030
3076
|
__name: "ValueSwitchItem",
|
|
3031
3077
|
props: {
|
|
3032
3078
|
selected: { type: Boolean },
|
|
@@ -3076,12 +3122,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
3076
3122
|
name: props.trailingIcon,
|
|
3077
3123
|
size: __props.size
|
|
3078
3124
|
}, null, 8, ["name", "size"])) : createCommentVNode("", true)
|
|
3079
|
-
], 10, _hoisted_1$
|
|
3125
|
+
], 10, _hoisted_1$q);
|
|
3080
3126
|
};
|
|
3081
3127
|
}
|
|
3082
3128
|
});
|
|
3083
3129
|
|
|
3084
|
-
const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3130
|
+
const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__scopeId", "data-v-5c6f0f1f"]]);
|
|
3085
3131
|
|
|
3086
3132
|
const useValueSwitchIconHiding = ({
|
|
3087
3133
|
width,
|
|
@@ -3132,7 +3178,7 @@ const useValueSwitchIconHiding = ({
|
|
|
3132
3178
|
};
|
|
3133
3179
|
};
|
|
3134
3180
|
|
|
3135
|
-
const _sfc_main$
|
|
3181
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
3136
3182
|
__name: "KdsValueSwitch",
|
|
3137
3183
|
props: /* @__PURE__ */ mergeModels({
|
|
3138
3184
|
id: {},
|
|
@@ -3219,7 +3265,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
3219
3265
|
}
|
|
3220
3266
|
});
|
|
3221
3267
|
|
|
3222
|
-
const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3268
|
+
const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$F, [["__scopeId", "data-v-640271e0"]]);
|
|
3223
3269
|
|
|
3224
3270
|
const kdsRadioButtonGroupAlignment = {
|
|
3225
3271
|
VERTICAL: "vertical",
|
|
@@ -3239,7 +3285,7 @@ const kdsValueSwitchVariant = {
|
|
|
3239
3285
|
};
|
|
3240
3286
|
const kdsValueSwitchVariants = Object.values(kdsValueSwitchVariant);
|
|
3241
3287
|
|
|
3242
|
-
const _sfc_main$
|
|
3288
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
3243
3289
|
__name: "BaseFormFieldWrapper",
|
|
3244
3290
|
props: {
|
|
3245
3291
|
id: {},
|
|
@@ -3291,18 +3337,18 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3291
3337
|
}
|
|
3292
3338
|
});
|
|
3293
3339
|
|
|
3294
|
-
const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3340
|
+
const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$E, [["__scopeId", "data-v-5d99c134"]]);
|
|
3295
3341
|
|
|
3296
|
-
const _hoisted_1$
|
|
3342
|
+
const _hoisted_1$p = {
|
|
3297
3343
|
key: 0,
|
|
3298
3344
|
class: "icon-wrapper leading"
|
|
3299
3345
|
};
|
|
3300
|
-
const _hoisted_2$
|
|
3346
|
+
const _hoisted_2$e = {
|
|
3301
3347
|
key: 1,
|
|
3302
3348
|
class: "leading-slot"
|
|
3303
3349
|
};
|
|
3304
|
-
const _hoisted_3$
|
|
3305
|
-
const _hoisted_4$
|
|
3350
|
+
const _hoisted_3$b = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded", "aria-autocomplete"];
|
|
3351
|
+
const _hoisted_4$8 = ["aria-disabled"];
|
|
3306
3352
|
const _hoisted_5$4 = {
|
|
3307
3353
|
key: 4,
|
|
3308
3354
|
class: "trailing-slot"
|
|
@@ -3311,7 +3357,7 @@ const _hoisted_6$2 = {
|
|
|
3311
3357
|
key: 5,
|
|
3312
3358
|
class: "icon-wrapper trailing"
|
|
3313
3359
|
};
|
|
3314
|
-
const _sfc_main$
|
|
3360
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
3315
3361
|
__name: "BaseInput",
|
|
3316
3362
|
props: /* @__PURE__ */ mergeModels({
|
|
3317
3363
|
id: {},
|
|
@@ -3390,13 +3436,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3390
3436
|
}),
|
|
3391
3437
|
onClick: handleContainerClick
|
|
3392
3438
|
}, [
|
|
3393
|
-
props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3439
|
+
props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
3394
3440
|
props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
|
|
3395
3441
|
key: 0,
|
|
3396
3442
|
name: props.leadingIcon
|
|
3397
3443
|
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
3398
3444
|
])) : createCommentVNode("", true),
|
|
3399
|
-
_ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3445
|
+
_ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
|
|
3400
3446
|
renderSlot(_ctx.$slots, "leading", {}, void 0, true)
|
|
3401
3447
|
])) : createCommentVNode("", true),
|
|
3402
3448
|
createElementVNode("input", {
|
|
@@ -3432,7 +3478,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3432
3478
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event)),
|
|
3433
3479
|
onKeydown: _cache[2] || (_cache[2] = ($event) => emit("keydown", $event)),
|
|
3434
3480
|
onClick: _cache[3] || (_cache[3] = ($event) => emit("click", $event))
|
|
3435
|
-
}, null, 42, _hoisted_3$
|
|
3481
|
+
}, null, 42, _hoisted_3$b),
|
|
3436
3482
|
props.unit ? (openBlock(), createElementBlock("span", {
|
|
3437
3483
|
key: 2,
|
|
3438
3484
|
class: normalizeClass({
|
|
@@ -3441,8 +3487,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3441
3487
|
disabled: __props.disabled
|
|
3442
3488
|
}),
|
|
3443
3489
|
"aria-disabled": __props.disabled || void 0
|
|
3444
|
-
}, toDisplayString(props.unit), 11, _hoisted_4$
|
|
3445
|
-
__props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main
|
|
3490
|
+
}, toDisplayString(props.unit), 11, _hoisted_4$8)) : createCommentVNode("", true),
|
|
3491
|
+
__props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$11, {
|
|
3446
3492
|
key: 3,
|
|
3447
3493
|
class: "clear-button",
|
|
3448
3494
|
type: "button",
|
|
@@ -3466,7 +3512,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3466
3512
|
}
|
|
3467
3513
|
});
|
|
3468
3514
|
|
|
3469
|
-
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3515
|
+
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-92291903"]]);
|
|
3470
3516
|
|
|
3471
3517
|
const usePointerHandler = (updateFromEvent) => {
|
|
3472
3518
|
const activePointerId = ref(null);
|
|
@@ -3506,8 +3552,141 @@ const usePointerHandler = (updateFromEvent) => {
|
|
|
3506
3552
|
};
|
|
3507
3553
|
};
|
|
3508
3554
|
|
|
3509
|
-
const
|
|
3510
|
-
|
|
3555
|
+
const additionalGroupSeparators = [" ", " ", " "];
|
|
3556
|
+
const decimalSeparatorSample = 1.1;
|
|
3557
|
+
const groupSeparatorSample = 1000.1;
|
|
3558
|
+
const countFractionDigits = (value) => {
|
|
3559
|
+
if (!Number.isFinite(value)) {
|
|
3560
|
+
return 0;
|
|
3561
|
+
}
|
|
3562
|
+
const exp = value.toExponential();
|
|
3563
|
+
const match = /^[-+]?(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(exp);
|
|
3564
|
+
if (!match) {
|
|
3565
|
+
return 0;
|
|
3566
|
+
}
|
|
3567
|
+
const fractionDigitsInMantissa = match[2]?.length ?? 0;
|
|
3568
|
+
const exponent = Number.parseInt(match[3], 10);
|
|
3569
|
+
if (exponent >= 0) {
|
|
3570
|
+
return Math.max(0, fractionDigitsInMantissa - exponent);
|
|
3571
|
+
}
|
|
3572
|
+
return fractionDigitsInMantissa + Math.abs(exponent);
|
|
3573
|
+
};
|
|
3574
|
+
const createKdsNumberParser = (params) => {
|
|
3575
|
+
const formatter = new Intl.NumberFormat(params.locale);
|
|
3576
|
+
const decimalSeparator = formatter.formatToParts(decimalSeparatorSample).find((part) => part.type === "decimal")?.value ?? ".";
|
|
3577
|
+
const groupSeparator = formatter.formatToParts(groupSeparatorSample).find((part) => part.type === "group")?.value ?? ",";
|
|
3578
|
+
const removeGroupingSeparators = (input) => [groupSeparator, ...additionalGroupSeparators].reduce(
|
|
3579
|
+
(acc, groupSep) => groupSep.length > 0 ? acc.split(groupSep).join("") : acc,
|
|
3580
|
+
input
|
|
3581
|
+
);
|
|
3582
|
+
const formattersByMaxDecimals = /* @__PURE__ */ new Map();
|
|
3583
|
+
const getFormatterForMaxDecimals = (maxDecimals) => {
|
|
3584
|
+
const cached = formattersByMaxDecimals.get(maxDecimals);
|
|
3585
|
+
if (cached) {
|
|
3586
|
+
return cached;
|
|
3587
|
+
}
|
|
3588
|
+
const created = new Intl.NumberFormat(params.locale, {
|
|
3589
|
+
useGrouping: false,
|
|
3590
|
+
minimumFractionDigits: 0,
|
|
3591
|
+
maximumFractionDigits: maxDecimals
|
|
3592
|
+
});
|
|
3593
|
+
formattersByMaxDecimals.set(maxDecimals, created);
|
|
3594
|
+
return created;
|
|
3595
|
+
};
|
|
3596
|
+
const stepFractionDigits = countFractionDigits(params.step);
|
|
3597
|
+
const precisionFactor = Number(`1e${stepFractionDigits}`);
|
|
3598
|
+
const formatForDisplay = (value) => {
|
|
3599
|
+
if (!Number.isFinite(value)) {
|
|
3600
|
+
return "";
|
|
3601
|
+
}
|
|
3602
|
+
const valueDecimals = countFractionDigits(value);
|
|
3603
|
+
const maxDecimals = Math.max(stepFractionDigits, valueDecimals);
|
|
3604
|
+
return getFormatterForMaxDecimals(maxDecimals).format(value);
|
|
3605
|
+
};
|
|
3606
|
+
const roundToStep = (value) => {
|
|
3607
|
+
if (!Number.isFinite(value)) {
|
|
3608
|
+
return Number.NaN;
|
|
3609
|
+
}
|
|
3610
|
+
const step = params.step;
|
|
3611
|
+
if (!Number.isFinite(step) || step <= 0) {
|
|
3612
|
+
return value;
|
|
3613
|
+
}
|
|
3614
|
+
if (!Number.isFinite(precisionFactor) || precisionFactor <= 0) {
|
|
3615
|
+
return value;
|
|
3616
|
+
}
|
|
3617
|
+
const scaledNext = Math.round(value * precisionFactor);
|
|
3618
|
+
const scaledStep = Math.round(step * precisionFactor);
|
|
3619
|
+
if (scaledStep === 0) {
|
|
3620
|
+
return value;
|
|
3621
|
+
}
|
|
3622
|
+
const roundedScaled = Math.round(scaledNext / scaledStep) * scaledStep;
|
|
3623
|
+
return roundedScaled / precisionFactor;
|
|
3624
|
+
};
|
|
3625
|
+
const isValidNormalizedNumber = (normalized) => (
|
|
3626
|
+
// Accept plain decimals as well as scientific notation.
|
|
3627
|
+
// Note: whitespace is removed earlier; we don't accept grouping separators here.
|
|
3628
|
+
/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(normalized)
|
|
3629
|
+
);
|
|
3630
|
+
const parseWithLocaleDecimal = (input, localeDecimal) => {
|
|
3631
|
+
const withoutGrouping = removeGroupingSeparators(input);
|
|
3632
|
+
const normalized = withoutGrouping.split(localeDecimal).join(".");
|
|
3633
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3634
|
+
return Number.NaN;
|
|
3635
|
+
}
|
|
3636
|
+
const parsed = Number.parseFloat(normalized);
|
|
3637
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3638
|
+
};
|
|
3639
|
+
const parseWithFallbackDot = (input) => {
|
|
3640
|
+
const lastDotIndex = input.lastIndexOf(".");
|
|
3641
|
+
const digitsAfterDot = input.slice(lastDotIndex + 1);
|
|
3642
|
+
const looksLikeDecimal = digitsAfterDot.length > 0 && digitsAfterDot.length <= 2;
|
|
3643
|
+
const normalized = looksLikeDecimal ? `${removeGroupingSeparators(input.slice(0, lastDotIndex))}.${removeGroupingSeparators(
|
|
3644
|
+
digitsAfterDot
|
|
3645
|
+
)}` : removeGroupingSeparators(input);
|
|
3646
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3647
|
+
return Number.NaN;
|
|
3648
|
+
}
|
|
3649
|
+
const parsed = Number.parseFloat(normalized);
|
|
3650
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3651
|
+
};
|
|
3652
|
+
const parseWithoutLocaleDecimal = (input) => {
|
|
3653
|
+
const normalized = removeGroupingSeparators(input);
|
|
3654
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3655
|
+
return Number.NaN;
|
|
3656
|
+
}
|
|
3657
|
+
const parsed = Number.parseFloat(normalized);
|
|
3658
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3659
|
+
};
|
|
3660
|
+
function parseFromInput(value) {
|
|
3661
|
+
const trimmed = value.trim();
|
|
3662
|
+
if (trimmed.length === 0) {
|
|
3663
|
+
return Number.NaN;
|
|
3664
|
+
}
|
|
3665
|
+
const localeDecimal = decimalSeparator;
|
|
3666
|
+
const hasLocaleDecimal = localeDecimal.length > 0 && trimmed.includes(localeDecimal);
|
|
3667
|
+
if (hasLocaleDecimal) {
|
|
3668
|
+
return parseWithLocaleDecimal(trimmed, localeDecimal);
|
|
3669
|
+
}
|
|
3670
|
+
if (localeDecimal !== "." && trimmed.includes(".")) {
|
|
3671
|
+
return parseWithFallbackDot(trimmed);
|
|
3672
|
+
}
|
|
3673
|
+
return parseWithoutLocaleDecimal(trimmed);
|
|
3674
|
+
}
|
|
3675
|
+
return {
|
|
3676
|
+
locale: params.locale,
|
|
3677
|
+
decimalSeparator,
|
|
3678
|
+
groupSeparator,
|
|
3679
|
+
stepFractionDigits,
|
|
3680
|
+
formatForDisplay,
|
|
3681
|
+
parseFromInput,
|
|
3682
|
+
roundToStep
|
|
3683
|
+
};
|
|
3684
|
+
};
|
|
3685
|
+
|
|
3686
|
+
const REPEAT_INITIAL_DELAY_MS = 400;
|
|
3687
|
+
const REPEAT_INTERVAL_MS = 100;
|
|
3688
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
3689
|
+
__name: "KdsNumberInput",
|
|
3511
3690
|
props: /* @__PURE__ */ mergeModels({
|
|
3512
3691
|
description: {},
|
|
3513
3692
|
label: {},
|
|
@@ -3520,32 +3699,254 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3520
3699
|
placeholder: {},
|
|
3521
3700
|
disabled: { type: Boolean, default: false },
|
|
3522
3701
|
autocomplete: {},
|
|
3523
|
-
|
|
3524
|
-
|
|
3702
|
+
unit: { default: "" },
|
|
3703
|
+
min: {},
|
|
3704
|
+
max: {},
|
|
3705
|
+
step: { default: 1 }
|
|
3525
3706
|
}, {
|
|
3526
|
-
"modelValue": { default:
|
|
3707
|
+
"modelValue": { default: Number.NaN },
|
|
3527
3708
|
"modelModifiers": {}
|
|
3528
3709
|
}),
|
|
3529
3710
|
emits: ["update:modelValue"],
|
|
3530
3711
|
setup(__props, { expose: __expose }) {
|
|
3531
|
-
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
3712
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "unit", "step"]);
|
|
3532
3713
|
const modelValue = useModel(__props, "modelValue");
|
|
3533
|
-
const baseInput = useTemplateRef("baseInput");
|
|
3534
|
-
const popoverRef = useTemplateRef("popoverRef");
|
|
3535
|
-
const listContainerRef = useTemplateRef("listContainerRef");
|
|
3536
|
-
const popoverOpen = ref(false);
|
|
3537
3714
|
const isFocused = ref(false);
|
|
3538
|
-
const
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3715
|
+
const localValue = ref("");
|
|
3716
|
+
const numberParser = computed(
|
|
3717
|
+
() => createKdsNumberParser({ locale: "en-US", step: __props.step })
|
|
3718
|
+
);
|
|
3719
|
+
const ariaValuenow = computed(
|
|
3720
|
+
() => Number.isFinite(modelValue.value) ? modelValue.value : void 0
|
|
3721
|
+
);
|
|
3722
|
+
const ariaValuetext = computed(() => {
|
|
3723
|
+
if (!Number.isFinite(modelValue.value)) {
|
|
3724
|
+
return void 0;
|
|
3725
|
+
}
|
|
3726
|
+
return numberParser.value.formatForDisplay(modelValue.value);
|
|
3727
|
+
});
|
|
3728
|
+
const clamp = (value) => {
|
|
3729
|
+
if (!Number.isFinite(value)) {
|
|
3730
|
+
return Number.NaN;
|
|
3731
|
+
}
|
|
3732
|
+
let result = value;
|
|
3733
|
+
if (props.min !== void 0 && !Number.isNaN(props.min)) {
|
|
3734
|
+
result = Math.max(props.min, result);
|
|
3735
|
+
}
|
|
3736
|
+
if (props.max !== void 0 && !Number.isNaN(props.max)) {
|
|
3737
|
+
result = Math.min(props.max, result);
|
|
3738
|
+
}
|
|
3739
|
+
return result;
|
|
3740
|
+
};
|
|
3741
|
+
watch(
|
|
3742
|
+
() => modelValue.value,
|
|
3743
|
+
(next) => {
|
|
3744
|
+
if (isFocused.value) {
|
|
3745
|
+
return;
|
|
3746
|
+
}
|
|
3747
|
+
localValue.value = numberParser.value.formatForDisplay(next);
|
|
3748
|
+
},
|
|
3749
|
+
{ immediate: true }
|
|
3750
|
+
);
|
|
3751
|
+
const canDecrease = computed(() => {
|
|
3752
|
+
if (__props.disabled) {
|
|
3753
|
+
return false;
|
|
3754
|
+
}
|
|
3755
|
+
if (props.min === void 0 || Number.isNaN(props.min)) {
|
|
3756
|
+
return true;
|
|
3757
|
+
}
|
|
3758
|
+
if (Number.isNaN(modelValue.value)) {
|
|
3759
|
+
return true;
|
|
3760
|
+
}
|
|
3761
|
+
return modelValue.value > props.min;
|
|
3762
|
+
});
|
|
3763
|
+
const canIncrease = computed(() => {
|
|
3764
|
+
if (__props.disabled) {
|
|
3765
|
+
return false;
|
|
3766
|
+
}
|
|
3767
|
+
if (props.max === void 0 || Number.isNaN(props.max)) {
|
|
3768
|
+
return true;
|
|
3769
|
+
}
|
|
3770
|
+
if (Number.isNaN(modelValue.value)) {
|
|
3771
|
+
return true;
|
|
3772
|
+
}
|
|
3773
|
+
return modelValue.value < props.max;
|
|
3774
|
+
});
|
|
3775
|
+
const adjustByStep = (direction) => {
|
|
3776
|
+
if (__props.step <= 0) {
|
|
3777
|
+
return;
|
|
3778
|
+
}
|
|
3779
|
+
const base = Number.isFinite(modelValue.value) ? modelValue.value : numberParser.value.parseFromInput(localValue.value);
|
|
3780
|
+
const nextRaw = Number.isFinite(base) ? base + direction * __props.step : 0;
|
|
3781
|
+
const rounded = numberParser.value.roundToStep(nextRaw);
|
|
3782
|
+
const next = clamp(rounded);
|
|
3783
|
+
modelValue.value = next;
|
|
3784
|
+
localValue.value = numberParser.value.formatForDisplay(next);
|
|
3785
|
+
};
|
|
3786
|
+
const handleKeydown = (event) => {
|
|
3787
|
+
if (__props.disabled) {
|
|
3788
|
+
return;
|
|
3789
|
+
}
|
|
3790
|
+
if (event.key === "ArrowUp" && canIncrease.value) {
|
|
3791
|
+
event.preventDefault();
|
|
3792
|
+
adjustByStep(1);
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
if (event.key === "ArrowDown" && canDecrease.value) {
|
|
3796
|
+
event.preventDefault();
|
|
3797
|
+
adjustByStep(-1);
|
|
3798
|
+
}
|
|
3799
|
+
};
|
|
3800
|
+
const handleUpdateModelValue = (value) => {
|
|
3801
|
+
localValue.value = value;
|
|
3802
|
+
modelValue.value = numberParser.value.parseFromInput(value);
|
|
3803
|
+
};
|
|
3804
|
+
const baseInput = useTemplateRef("baseInput");
|
|
3805
|
+
let repeatTimer = null;
|
|
3806
|
+
let isStepping = false;
|
|
3807
|
+
const handleBlur = () => {
|
|
3808
|
+
if (isStepping) {
|
|
3809
|
+
baseInput.value?.focus();
|
|
3810
|
+
return;
|
|
3811
|
+
}
|
|
3812
|
+
isFocused.value = false;
|
|
3813
|
+
const parsed = numberParser.value.parseFromInput(localValue.value);
|
|
3814
|
+
const normalized = clamp(parsed);
|
|
3815
|
+
modelValue.value = normalized;
|
|
3816
|
+
localValue.value = numberParser.value.formatForDisplay(normalized);
|
|
3817
|
+
};
|
|
3818
|
+
const stopRepeating = () => {
|
|
3819
|
+
if (repeatTimer !== null) {
|
|
3820
|
+
clearTimeout(repeatTimer);
|
|
3821
|
+
repeatTimer = null;
|
|
3822
|
+
}
|
|
3823
|
+
isStepping = false;
|
|
3824
|
+
};
|
|
3825
|
+
const startRepeating = (direction) => {
|
|
3826
|
+
stopRepeating();
|
|
3827
|
+
isStepping = true;
|
|
3828
|
+
adjustByStep(direction);
|
|
3829
|
+
repeatTimer = setTimeout(function tick() {
|
|
3830
|
+
adjustByStep(direction);
|
|
3831
|
+
repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
|
|
3832
|
+
}, REPEAT_INITIAL_DELAY_MS);
|
|
3833
|
+
};
|
|
3834
|
+
onBeforeUnmount(stopRepeating);
|
|
3835
|
+
const handleButtonClick = (direction, event) => {
|
|
3836
|
+
if (event.detail !== 0) {
|
|
3837
|
+
return;
|
|
3838
|
+
}
|
|
3839
|
+
adjustByStep(direction);
|
|
3840
|
+
};
|
|
3841
|
+
__expose({
|
|
3842
|
+
focus: () => baseInput.value?.focus()
|
|
3843
|
+
});
|
|
3844
|
+
return (_ctx, _cache) => {
|
|
3845
|
+
return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
|
|
3846
|
+
error: __props.error,
|
|
3847
|
+
validating: __props.validating,
|
|
3848
|
+
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
3849
|
+
}), {
|
|
3850
|
+
default: withCtx((slotProps) => [
|
|
3851
|
+
createVNode(BaseInput, mergeProps({
|
|
3852
|
+
ref_key: "baseInput",
|
|
3853
|
+
ref: baseInput
|
|
3854
|
+
}, slotProps, {
|
|
3855
|
+
"model-value": localValue.value,
|
|
3856
|
+
type: "text",
|
|
3857
|
+
inputmode: Number.isInteger(__props.step) ? "numeric" : "decimal",
|
|
3858
|
+
placeholder: props.placeholder,
|
|
3859
|
+
disabled: __props.disabled,
|
|
3860
|
+
error: __props.error,
|
|
3861
|
+
autocomplete: props.autocomplete,
|
|
3862
|
+
unit: __props.unit,
|
|
3863
|
+
role: "spinbutton",
|
|
3864
|
+
"aria-valuenow": ariaValuenow.value,
|
|
3865
|
+
"aria-valuemin": props.min,
|
|
3866
|
+
"aria-valuemax": props.max,
|
|
3867
|
+
"aria-valuetext": ariaValuetext.value,
|
|
3868
|
+
"onUpdate:modelValue": handleUpdateModelValue,
|
|
3869
|
+
onKeydown: handleKeydown,
|
|
3870
|
+
onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
|
|
3871
|
+
onBlur: handleBlur
|
|
3872
|
+
}), {
|
|
3873
|
+
trailing: withCtx(() => [
|
|
3874
|
+
createVNode(_sfc_main$11, {
|
|
3875
|
+
type: "button",
|
|
3876
|
+
size: "xsmall",
|
|
3877
|
+
variant: "outlined",
|
|
3878
|
+
"leading-icon": "minus",
|
|
3879
|
+
ariaLabel: `Decrease ${props.label ?? props.ariaLabel}`,
|
|
3880
|
+
disabled: !canDecrease.value,
|
|
3881
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
|
|
3882
|
+
onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
|
|
3883
|
+
onPointerup: stopRepeating,
|
|
3884
|
+
onPointerleave: stopRepeating,
|
|
3885
|
+
onPointercancel: stopRepeating
|
|
3886
|
+
}, null, 8, ["ariaLabel", "disabled"]),
|
|
3887
|
+
createVNode(_sfc_main$11, {
|
|
3888
|
+
type: "button",
|
|
3889
|
+
size: "xsmall",
|
|
3890
|
+
variant: "outlined",
|
|
3891
|
+
"leading-icon": "plus",
|
|
3892
|
+
ariaLabel: `Increase ${props.label ?? props.ariaLabel}`,
|
|
3893
|
+
disabled: !canIncrease.value,
|
|
3894
|
+
onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
|
|
3895
|
+
onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
|
|
3896
|
+
onPointerup: stopRepeating,
|
|
3897
|
+
onPointerleave: stopRepeating,
|
|
3898
|
+
onPointercancel: stopRepeating
|
|
3899
|
+
}, null, 8, ["ariaLabel", "disabled"])
|
|
3900
|
+
]),
|
|
3901
|
+
_: 1
|
|
3902
|
+
}, 16, ["model-value", "inputmode", "placeholder", "disabled", "error", "autocomplete", "unit", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"])
|
|
3903
|
+
]),
|
|
3904
|
+
_: 1
|
|
3905
|
+
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
3906
|
+
};
|
|
3907
|
+
}
|
|
3908
|
+
});
|
|
3909
|
+
|
|
3910
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
3911
|
+
__name: "KdsTextInput",
|
|
3912
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3913
|
+
description: {},
|
|
3914
|
+
label: {},
|
|
3915
|
+
ariaLabel: {},
|
|
3916
|
+
id: {},
|
|
3917
|
+
subText: {},
|
|
3918
|
+
error: { type: Boolean, default: false },
|
|
3919
|
+
validating: { type: Boolean, default: false },
|
|
3920
|
+
preserveSubTextSpace: { type: Boolean, default: false },
|
|
3921
|
+
placeholder: {},
|
|
3922
|
+
disabled: { type: Boolean, default: false },
|
|
3923
|
+
autocomplete: {},
|
|
3924
|
+
suggestions: {},
|
|
3925
|
+
suggestionsHeadline: {}
|
|
3926
|
+
}, {
|
|
3927
|
+
"modelValue": { default: "" },
|
|
3928
|
+
"modelModifiers": {}
|
|
3929
|
+
}),
|
|
3930
|
+
emits: ["update:modelValue"],
|
|
3931
|
+
setup(__props, { expose: __expose }) {
|
|
3932
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
3933
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3934
|
+
const baseInput = useTemplateRef("baseInput");
|
|
3935
|
+
const popoverRef = useTemplateRef("popoverRef");
|
|
3936
|
+
const listContainerRef = useTemplateRef("listContainerRef");
|
|
3937
|
+
const popoverOpen = ref(false);
|
|
3938
|
+
const isFocused = ref(false);
|
|
3939
|
+
const hasSuggestions = computed(() => Boolean(props.suggestions?.length));
|
|
3940
|
+
const filteredSuggestions = computed(() => {
|
|
3941
|
+
if (!props.suggestions) {
|
|
3942
|
+
return [];
|
|
3943
|
+
}
|
|
3944
|
+
const query = modelValue.value.trim().toLowerCase();
|
|
3945
|
+
const suggestionOptions = props.suggestions.filter((s) => query.length === 0 || s.toLowerCase().includes(query)).map((s, index) => ({
|
|
3946
|
+
id: String(index),
|
|
3947
|
+
text: s
|
|
3948
|
+
}));
|
|
3949
|
+
if (props.suggestionsHeadline && suggestionOptions.length > 0) {
|
|
3549
3950
|
suggestionOptions.unshift({
|
|
3550
3951
|
id: "suggestion-headline-id",
|
|
3551
3952
|
text: props.suggestionsHeadline,
|
|
@@ -3676,7 +4077,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3676
4077
|
}
|
|
3677
4078
|
});
|
|
3678
4079
|
|
|
3679
|
-
const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
4080
|
+
const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__scopeId", "data-v-1740ce83"]]);
|
|
3680
4081
|
|
|
3681
4082
|
const HEX_RADIX = 16;
|
|
3682
4083
|
const RGB_MAX = 255;
|
|
@@ -3693,6 +4094,9 @@ const HEX_PAIR_LENGTH = 2;
|
|
|
3693
4094
|
const HEX_RED_START = 1;
|
|
3694
4095
|
const HEX_GREEN_START = HEX_RED_START + HEX_PAIR_LENGTH;
|
|
3695
4096
|
const HEX_BLUE_START = HEX_GREEN_START + HEX_PAIR_LENGTH;
|
|
4097
|
+
const HEX_ALPHA_START = HEX_BLUE_START + HEX_PAIR_LENGTH;
|
|
4098
|
+
const FULL_HEX_COLOR_LENGTH = 9;
|
|
4099
|
+
const HEX_WITH_HASH_LENGTH$1 = 7;
|
|
3696
4100
|
const clamp$1 = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
3697
4101
|
const round$1 = (value) => Math.round(value);
|
|
3698
4102
|
const padHex = (value) => value.toString(HEX_RADIX).padStart(2, "0");
|
|
@@ -3706,12 +4110,16 @@ const normalizeHexColor = (value) => {
|
|
|
3706
4110
|
const [r, g, b] = withoutHash.split("");
|
|
3707
4111
|
return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
|
|
3708
4112
|
}
|
|
3709
|
-
if (/^[0-9a-fA-F]{
|
|
4113
|
+
if (/^[0-9a-fA-F]{4}$/.test(withoutHash)) {
|
|
4114
|
+
const [r, g, b, a] = withoutHash.split("");
|
|
4115
|
+
return `#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase();
|
|
4116
|
+
}
|
|
4117
|
+
if (/^([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(withoutHash)) {
|
|
3710
4118
|
return `#${withoutHash}`.toUpperCase();
|
|
3711
4119
|
}
|
|
3712
4120
|
return null;
|
|
3713
4121
|
};
|
|
3714
|
-
const
|
|
4122
|
+
const hexToRgba = (hex) => {
|
|
3715
4123
|
const normalized = normalizeHexColor(hex);
|
|
3716
4124
|
if (!normalized) {
|
|
3717
4125
|
return null;
|
|
@@ -3728,7 +4136,12 @@ const hexToRgb = (hex) => {
|
|
|
3728
4136
|
normalized.slice(HEX_BLUE_START, HEX_BLUE_START + HEX_PAIR_LENGTH),
|
|
3729
4137
|
HEX_RADIX
|
|
3730
4138
|
);
|
|
3731
|
-
|
|
4139
|
+
const hasAlpha = normalized.length === FULL_HEX_COLOR_LENGTH;
|
|
4140
|
+
const a = hasAlpha ? Number.parseInt(
|
|
4141
|
+
normalized.slice(HEX_ALPHA_START, HEX_ALPHA_START + HEX_PAIR_LENGTH),
|
|
4142
|
+
HEX_RADIX
|
|
4143
|
+
) / RGB_MAX : 1;
|
|
4144
|
+
return { r, g, b, a };
|
|
3732
4145
|
};
|
|
3733
4146
|
const rgbToHex = ({ r, g, b }) => {
|
|
3734
4147
|
const rr = clamp$1(round$1(r), 0, RGB_MAX);
|
|
@@ -3736,6 +4149,10 @@ const rgbToHex = ({ r, g, b }) => {
|
|
|
3736
4149
|
const bb = clamp$1(round$1(b), 0, RGB_MAX);
|
|
3737
4150
|
return `#${padHex(rr)}${padHex(gg)}${padHex(bb)}`.toUpperCase();
|
|
3738
4151
|
};
|
|
4152
|
+
const rgbaToHex = ({ r, g, b, a }) => {
|
|
4153
|
+
const alpha = clamp$1(round$1(a * RGB_MAX), 0, RGB_MAX);
|
|
4154
|
+
return `${rgbToHex({ r, g, b })}${padHex(alpha)}`.toUpperCase();
|
|
4155
|
+
};
|
|
3739
4156
|
const rgbToHsv = ({ r, g, b }) => {
|
|
3740
4157
|
const rr = clamp$1(r / RGB_MAX, 0, 1);
|
|
3741
4158
|
const gg = clamp$1(g / RGB_MAX, 0, 1);
|
|
@@ -3796,46 +4213,153 @@ const hsvToRgb = ({ h, s, v }) => {
|
|
|
3796
4213
|
b: round$1((bPrime + m) * RGB_MAX)
|
|
3797
4214
|
};
|
|
3798
4215
|
};
|
|
3799
|
-
const
|
|
4216
|
+
const removeAlphaFromHexInput = (next) => {
|
|
4217
|
+
const trimmed = next.trim();
|
|
4218
|
+
const hasHash = trimmed.startsWith("#");
|
|
4219
|
+
const withoutHash = hasHash ? trimmed.slice(1) : trimmed;
|
|
4220
|
+
if (/^[0-9a-fA-F]{8}$/.test(withoutHash)) {
|
|
4221
|
+
const rgbWithoutAlpha = withoutHash.slice(0, HEX_WITH_HASH_LENGTH$1 - 1);
|
|
4222
|
+
return hasHash ? `#${rgbWithoutAlpha}` : rgbWithoutAlpha;
|
|
4223
|
+
}
|
|
4224
|
+
return next;
|
|
4225
|
+
};
|
|
3800
4226
|
|
|
3801
|
-
const _hoisted_1$
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
4227
|
+
const _hoisted_1$o = ["aria-label", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"];
|
|
4228
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
4229
|
+
__name: "ColorPickerSlider",
|
|
4230
|
+
props: /* @__PURE__ */ mergeModels({
|
|
4231
|
+
label: {},
|
|
4232
|
+
valueNow: {},
|
|
4233
|
+
valueMin: {},
|
|
4234
|
+
valueMax: {},
|
|
4235
|
+
valueText: {},
|
|
4236
|
+
min: {},
|
|
4237
|
+
max: {},
|
|
4238
|
+
step: {},
|
|
4239
|
+
largeStep: {}
|
|
4240
|
+
}, {
|
|
4241
|
+
"modelValue": { required: true },
|
|
4242
|
+
"modelModifiers": {}
|
|
4243
|
+
}),
|
|
4244
|
+
emits: ["update:modelValue"],
|
|
4245
|
+
setup(__props) {
|
|
4246
|
+
useCssVars((_ctx) => ({
|
|
4247
|
+
"v087094b8": handlePosition.value
|
|
4248
|
+
}));
|
|
4249
|
+
const props = __props;
|
|
4250
|
+
const modelValue = useModel(__props, "modelValue");
|
|
4251
|
+
const sliderEl = useTemplateRef("sliderEl");
|
|
4252
|
+
const setFromPointerEvent = (event) => {
|
|
4253
|
+
const el = sliderEl.value;
|
|
4254
|
+
if (!el) {
|
|
4255
|
+
return;
|
|
4256
|
+
}
|
|
4257
|
+
const rect = el.getBoundingClientRect();
|
|
4258
|
+
const x = (event.clientX - rect.left) / rect.width;
|
|
4259
|
+
const ratio = clamp$1(x, 0, 1);
|
|
4260
|
+
modelValue.value = props.min + ratio * (props.max - props.min);
|
|
4261
|
+
};
|
|
4262
|
+
const { onPointerDown, onPointerMove, onPointerUp } = usePointerHandler(setFromPointerEvent);
|
|
4263
|
+
const onKeyDown = (event) => {
|
|
4264
|
+
const delta = event.shiftKey ? props.largeStep : props.step;
|
|
4265
|
+
let handled = true;
|
|
4266
|
+
switch (event.key) {
|
|
4267
|
+
case "ArrowLeft":
|
|
4268
|
+
modelValue.value = clamp$1(modelValue.value - delta, props.min, props.max);
|
|
4269
|
+
break;
|
|
4270
|
+
case "ArrowRight":
|
|
4271
|
+
modelValue.value = clamp$1(modelValue.value + delta, props.min, props.max);
|
|
4272
|
+
break;
|
|
4273
|
+
default:
|
|
4274
|
+
handled = false;
|
|
4275
|
+
}
|
|
4276
|
+
if (handled) {
|
|
4277
|
+
event.preventDefault();
|
|
4278
|
+
}
|
|
4279
|
+
};
|
|
4280
|
+
const handlePosition = computed(() => {
|
|
4281
|
+
const ratio = (modelValue.value - props.min) / (props.max - props.min);
|
|
4282
|
+
return `${clamp$1(ratio, 0, 1) * 100}%`;
|
|
4283
|
+
});
|
|
4284
|
+
return (_ctx, _cache) => {
|
|
4285
|
+
return openBlock(), createElementBlock("div", {
|
|
4286
|
+
ref_key: "sliderEl",
|
|
4287
|
+
ref: sliderEl,
|
|
4288
|
+
class: "kds-color-picker-slider",
|
|
4289
|
+
role: "slider",
|
|
4290
|
+
"aria-label": __props.label,
|
|
4291
|
+
"aria-valuenow": __props.valueNow,
|
|
4292
|
+
"aria-valuemin": __props.valueMin,
|
|
4293
|
+
"aria-valuemax": __props.valueMax,
|
|
4294
|
+
"aria-valuetext": __props.valueText,
|
|
4295
|
+
tabindex: "0",
|
|
4296
|
+
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
4297
|
+
(...args) => unref(onPointerDown) && unref(onPointerDown)(...args)),
|
|
4298
|
+
onPointermove: _cache[1] || (_cache[1] = withModifiers(
|
|
4299
|
+
//@ts-ignore
|
|
4300
|
+
(...args) => unref(onPointerMove) && unref(onPointerMove)(...args),
|
|
4301
|
+
["prevent"]
|
|
4302
|
+
)),
|
|
4303
|
+
onPointerup: _cache[2] || (_cache[2] = //@ts-ignore
|
|
4304
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4305
|
+
onPointercancel: _cache[3] || (_cache[3] = //@ts-ignore
|
|
4306
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4307
|
+
onLostpointercapture: _cache[4] || (_cache[4] = //@ts-ignore
|
|
4308
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4309
|
+
onKeydown: onKeyDown
|
|
4310
|
+
}, [..._cache[5] || (_cache[5] = [
|
|
4311
|
+
createElementVNode("div", { class: "handle" }, null, -1)
|
|
4312
|
+
])], 40, _hoisted_1$o);
|
|
4313
|
+
};
|
|
4314
|
+
}
|
|
4315
|
+
});
|
|
4316
|
+
|
|
4317
|
+
const ColorPickerSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__scopeId", "data-v-f4be2bd4"]]);
|
|
4318
|
+
|
|
4319
|
+
const _hoisted_1$n = { class: "kds-color-picker" };
|
|
4320
|
+
const _hoisted_2$d = ["aria-valuetext"];
|
|
4321
|
+
const _hoisted_3$a = { class: "value-inputs" };
|
|
4322
|
+
const DEFAULT_HUE_DEG = 270;
|
|
4323
|
+
const DEFAULT_SATURATION = 0.8;
|
|
4324
|
+
const DEFAULT_VALUE = 0.9;
|
|
4325
|
+
const DEFAULT_ALPHA = 1;
|
|
4326
|
+
const HUE_MAX_DEG = 360;
|
|
4327
|
+
const HUE_MAX_EXCLUSIVE_DEG = 359.999;
|
|
4328
|
+
const PERCENT = 100;
|
|
4329
|
+
const HEX_WITH_HASH_LENGTH = 7;
|
|
4330
|
+
const KEYBOARD_STEP = 0.01;
|
|
4331
|
+
const KEYBOARD_LARGE_STEP = 0.1;
|
|
4332
|
+
const HUE_KEYBOARD_STEP_DEG = 1;
|
|
4333
|
+
const HUE_KEYBOARD_LARGE_STEP_DEG = 10;
|
|
4334
|
+
const TO_BOTTOM_GRADIENT = "linear-gradient(to bottom, transparent, black)";
|
|
4335
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
4336
|
+
__name: "ColorPicker",
|
|
4337
|
+
props: {
|
|
4338
|
+
"modelValue": { default: "" },
|
|
4339
|
+
"modelModifiers": {}
|
|
4340
|
+
},
|
|
4341
|
+
emits: ["update:modelValue"],
|
|
4342
|
+
setup(__props) {
|
|
4343
|
+
useCssVars((_ctx) => ({
|
|
4344
|
+
"v535b907d": alphaBackgroundImage.value
|
|
4345
|
+
}));
|
|
3823
4346
|
const modelValue = useModel(__props, "modelValue");
|
|
3824
4347
|
const colorspaceEl = ref(null);
|
|
3825
|
-
const hueEl = ref(null);
|
|
3826
4348
|
const hue = ref(DEFAULT_HUE_DEG);
|
|
3827
4349
|
const saturation = ref(DEFAULT_SATURATION);
|
|
3828
4350
|
const value = ref(DEFAULT_VALUE);
|
|
4351
|
+
const alpha = ref(DEFAULT_ALPHA);
|
|
3829
4352
|
const hasPendingInternalModelUpdate = ref(false);
|
|
3830
|
-
const
|
|
3831
|
-
const
|
|
3832
|
-
if (!
|
|
4353
|
+
const updateHsvFromHex = (hex) => {
|
|
4354
|
+
const rgba = hexToRgba(hex);
|
|
4355
|
+
if (!rgba) {
|
|
3833
4356
|
return;
|
|
3834
4357
|
}
|
|
3835
|
-
const hsv = rgbToHsv(
|
|
4358
|
+
const hsv = rgbToHsv(rgba);
|
|
3836
4359
|
hue.value = hsv.h;
|
|
3837
4360
|
saturation.value = hsv.s;
|
|
3838
4361
|
value.value = hsv.v;
|
|
4362
|
+
alpha.value = rgba.a;
|
|
3839
4363
|
};
|
|
3840
4364
|
watch(
|
|
3841
4365
|
() => modelValue.value,
|
|
@@ -3844,17 +4368,25 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3844
4368
|
hasPendingInternalModelUpdate.value = false;
|
|
3845
4369
|
return;
|
|
3846
4370
|
}
|
|
3847
|
-
|
|
4371
|
+
updateHsvFromHex(next);
|
|
3848
4372
|
},
|
|
3849
4373
|
{ immediate: true }
|
|
3850
4374
|
);
|
|
3851
|
-
const
|
|
3852
|
-
|
|
4375
|
+
const hexInputValue = computed(() => removeAlphaFromHexInput(modelValue.value));
|
|
4376
|
+
const currentRgb = computed(
|
|
4377
|
+
() => hsvToRgb({
|
|
3853
4378
|
h: hue.value,
|
|
3854
4379
|
s: saturation.value,
|
|
3855
4380
|
v: value.value
|
|
3856
4381
|
})
|
|
3857
4382
|
);
|
|
4383
|
+
const currentHex = computed(() => {
|
|
4384
|
+
const hex = rgbaToHex({
|
|
4385
|
+
...currentRgb.value,
|
|
4386
|
+
a: alpha.value
|
|
4387
|
+
});
|
|
4388
|
+
return alpha.value === DEFAULT_ALPHA ? hex.slice(0, HEX_WITH_HASH_LENGTH) : hex;
|
|
4389
|
+
});
|
|
3858
4390
|
const hueRgb = computed(() => hsvToRgb({ h: hue.value, s: 1, v: 1 }));
|
|
3859
4391
|
const colorspaceBackground = computed(() => {
|
|
3860
4392
|
const { r, g, b } = hueRgb.value;
|
|
@@ -3866,9 +4398,16 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3866
4398
|
left: `${saturation.value * 100}%`,
|
|
3867
4399
|
top: `${(1 - value.value) * 100}%`
|
|
3868
4400
|
}));
|
|
3869
|
-
const
|
|
3870
|
-
|
|
3871
|
-
|
|
4401
|
+
const alphaBackgroundImage = computed(() => {
|
|
4402
|
+
const { r, g, b } = currentRgb.value;
|
|
4403
|
+
return `
|
|
4404
|
+
linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0), rgb(${r}, ${g}, ${b})),
|
|
4405
|
+
repeating-conic-gradient(
|
|
4406
|
+
var(--kds-color-background-neutral-active) 0 25%,
|
|
4407
|
+
var(--kds-color-surface-default) 0 50%
|
|
4408
|
+
)
|
|
4409
|
+
`;
|
|
4410
|
+
});
|
|
3872
4411
|
const setModelValueFromHsv = () => {
|
|
3873
4412
|
hasPendingInternalModelUpdate.value = true;
|
|
3874
4413
|
modelValue.value = currentHex.value;
|
|
@@ -3881,18 +4420,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3881
4420
|
const rect = el.getBoundingClientRect();
|
|
3882
4421
|
const x = (event.clientX - rect.left) / rect.width;
|
|
3883
4422
|
const y = (event.clientY - rect.top) / rect.height;
|
|
3884
|
-
saturation.value =
|
|
3885
|
-
value.value = 1 -
|
|
3886
|
-
setModelValueFromHsv();
|
|
3887
|
-
};
|
|
3888
|
-
const updateFromHueEvent = (event) => {
|
|
3889
|
-
const el = hueEl.value;
|
|
3890
|
-
if (!el) {
|
|
3891
|
-
return;
|
|
3892
|
-
}
|
|
3893
|
-
const rect = el.getBoundingClientRect();
|
|
3894
|
-
const x = (event.clientX - rect.left) / rect.width;
|
|
3895
|
-
hue.value = Math.min(HUE_MAX_EXCLUSIVE_DEG, Math.max(0, x * HUE_MAX_DEG));
|
|
4423
|
+
saturation.value = clamp$1(x, 0, 1);
|
|
4424
|
+
value.value = 1 - clamp$1(y, 0, 1);
|
|
3896
4425
|
setModelValueFromHsv();
|
|
3897
4426
|
};
|
|
3898
4427
|
const {
|
|
@@ -3900,18 +4429,22 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3900
4429
|
onPointerMove: onColorspacePointerMove,
|
|
3901
4430
|
onPointerUp: onColorspacePointerUp
|
|
3902
4431
|
} = usePointerHandler(updateFromColorspaceEvent);
|
|
3903
|
-
const {
|
|
3904
|
-
onPointerDown: onHuePointerDown,
|
|
3905
|
-
onPointerMove: onHuePointerMove,
|
|
3906
|
-
onPointerUp: onHuePointerUp
|
|
3907
|
-
} = usePointerHandler(updateFromHueEvent);
|
|
3908
4432
|
const updateFromTextValue = (next) => {
|
|
3909
4433
|
modelValue.value = next;
|
|
3910
|
-
|
|
4434
|
+
};
|
|
4435
|
+
const onHexInputFocusOut = () => {
|
|
4436
|
+
const normalized = normalizeHexColor(modelValue.value);
|
|
3911
4437
|
if (normalized) {
|
|
3912
|
-
|
|
4438
|
+
modelValue.value = normalized;
|
|
3913
4439
|
}
|
|
3914
4440
|
};
|
|
4441
|
+
const updateFromAlphaNumberInput = (next) => {
|
|
4442
|
+
if (!Number.isFinite(next)) {
|
|
4443
|
+
return;
|
|
4444
|
+
}
|
|
4445
|
+
alpha.value = clamp$1(next / PERCENT, 0, 1);
|
|
4446
|
+
setModelValueFromHsv();
|
|
4447
|
+
};
|
|
3915
4448
|
const saturationPercent = computed(
|
|
3916
4449
|
() => Math.round(saturation.value * PERCENT)
|
|
3917
4450
|
);
|
|
@@ -3920,6 +4453,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3920
4453
|
() => `Saturation ${saturationPercent.value} percent, brightness ${valuePercent.value} percent`
|
|
3921
4454
|
);
|
|
3922
4455
|
const hueValueText = computed(() => `${Math.round(hue.value)} degrees`);
|
|
4456
|
+
const alphaPercent = computed(() => Math.round(alpha.value * PERCENT));
|
|
4457
|
+
const alphaValueText = computed(() => `${alphaPercent.value} percent`);
|
|
3923
4458
|
const onColorspaceKeyDown = (event) => {
|
|
3924
4459
|
const step = event.shiftKey ? KEYBOARD_LARGE_STEP : KEYBOARD_STEP;
|
|
3925
4460
|
let handled = true;
|
|
@@ -3944,26 +4479,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3944
4479
|
setModelValueFromHsv();
|
|
3945
4480
|
}
|
|
3946
4481
|
};
|
|
3947
|
-
const onHueKeyDown = (event) => {
|
|
3948
|
-
const step = event.shiftKey ? HUE_KEYBOARD_LARGE_STEP_DEG : HUE_KEYBOARD_STEP_DEG;
|
|
3949
|
-
let handled = true;
|
|
3950
|
-
switch (event.key) {
|
|
3951
|
-
case "ArrowLeft":
|
|
3952
|
-
hue.value = clamp$1(hue.value - step, 0, HUE_MAX_EXCLUSIVE_DEG);
|
|
3953
|
-
break;
|
|
3954
|
-
case "ArrowRight":
|
|
3955
|
-
hue.value = clamp$1(hue.value + step, 0, HUE_MAX_EXCLUSIVE_DEG);
|
|
3956
|
-
break;
|
|
3957
|
-
default:
|
|
3958
|
-
handled = false;
|
|
3959
|
-
}
|
|
3960
|
-
if (handled) {
|
|
3961
|
-
event.preventDefault();
|
|
3962
|
-
setModelValueFromHsv();
|
|
3963
|
-
}
|
|
3964
|
-
};
|
|
3965
4482
|
return (_ctx, _cache) => {
|
|
3966
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4483
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
3967
4484
|
createElementVNode("div", {
|
|
3968
4485
|
ref_key: "colorspaceEl",
|
|
3969
4486
|
ref: colorspaceEl,
|
|
@@ -3974,11 +4491,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3974
4491
|
"aria-valuetext": colorspaceValueText.value,
|
|
3975
4492
|
style: normalizeStyle(colorspaceBackground.value),
|
|
3976
4493
|
tabindex: "0",
|
|
3977
|
-
onPointerdown: _cache[0] || (_cache[0] =
|
|
3978
|
-
|
|
3979
|
-
(...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args),
|
|
3980
|
-
["prevent"]
|
|
3981
|
-
)),
|
|
4494
|
+
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
4495
|
+
(...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args)),
|
|
3982
4496
|
onPointermove: _cache[1] || (_cache[1] = withModifiers(
|
|
3983
4497
|
//@ts-ignore
|
|
3984
4498
|
(...args) => unref(onColorspacePointerMove) && unref(onColorspacePointerMove)(...args),
|
|
@@ -3994,57 +4508,74 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3994
4508
|
class: "handle",
|
|
3995
4509
|
style: normalizeStyle(colorspaceHandleStyle.value)
|
|
3996
4510
|
}, null, 4)
|
|
3997
|
-
], 44, _hoisted_2$
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4511
|
+
], 44, _hoisted_2$d),
|
|
4512
|
+
createVNode(ColorPickerSlider, {
|
|
4513
|
+
modelValue: hue.value,
|
|
4514
|
+
"onUpdate:modelValue": [
|
|
4515
|
+
_cache[4] || (_cache[4] = ($event) => hue.value = $event),
|
|
4516
|
+
setModelValueFromHsv
|
|
4517
|
+
],
|
|
4001
4518
|
class: "hue",
|
|
4002
|
-
|
|
4003
|
-
"
|
|
4004
|
-
"
|
|
4005
|
-
"
|
|
4006
|
-
"
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4519
|
+
label: "Hue",
|
|
4520
|
+
"value-now": Math.round(hue.value),
|
|
4521
|
+
"value-min": 0,
|
|
4522
|
+
"value-max": HUE_MAX_DEG,
|
|
4523
|
+
"value-text": hueValueText.value,
|
|
4524
|
+
min: 0,
|
|
4525
|
+
max: HUE_MAX_EXCLUSIVE_DEG,
|
|
4526
|
+
step: HUE_KEYBOARD_STEP_DEG,
|
|
4527
|
+
"large-step": HUE_KEYBOARD_LARGE_STEP_DEG
|
|
4528
|
+
}, null, 8, ["modelValue", "value-now", "value-text"]),
|
|
4529
|
+
createVNode(ColorPickerSlider, {
|
|
4530
|
+
modelValue: alpha.value,
|
|
4531
|
+
"onUpdate:modelValue": [
|
|
4532
|
+
_cache[5] || (_cache[5] = ($event) => alpha.value = $event),
|
|
4533
|
+
setModelValueFromHsv
|
|
4534
|
+
],
|
|
4535
|
+
class: "alpha",
|
|
4536
|
+
label: "Alpha",
|
|
4537
|
+
"value-now": alphaPercent.value,
|
|
4538
|
+
"value-min": 0,
|
|
4539
|
+
"value-max": PERCENT,
|
|
4540
|
+
"value-text": alphaValueText.value,
|
|
4541
|
+
min: 0,
|
|
4542
|
+
max: 1,
|
|
4543
|
+
step: KEYBOARD_STEP,
|
|
4544
|
+
"large-step": KEYBOARD_LARGE_STEP
|
|
4545
|
+
}, null, 8, ["modelValue", "value-now", "value-text"]),
|
|
4546
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
4547
|
+
createVNode(KdsTextInput, {
|
|
4548
|
+
"model-value": hexInputValue.value,
|
|
4549
|
+
ariaLabel: "Color hex value",
|
|
4550
|
+
placeholder: "#FFFFFF",
|
|
4551
|
+
"onUpdate:modelValue": updateFromTextValue,
|
|
4552
|
+
onFocusout: onHexInputFocusOut
|
|
4553
|
+
}, null, 8, ["model-value"]),
|
|
4554
|
+
createVNode(_sfc_main$C, {
|
|
4555
|
+
"model-value": alphaPercent.value,
|
|
4556
|
+
ariaLabel: "Alpha percentage",
|
|
4557
|
+
min: 0,
|
|
4558
|
+
max: PERCENT,
|
|
4559
|
+
step: 1,
|
|
4560
|
+
unit: "%",
|
|
4561
|
+
"onUpdate:modelValue": updateFromAlphaNumberInput
|
|
4562
|
+
}, null, 8, ["model-value"])
|
|
4563
|
+
])
|
|
4036
4564
|
]);
|
|
4037
4565
|
};
|
|
4038
4566
|
}
|
|
4039
4567
|
});
|
|
4040
4568
|
|
|
4041
|
-
const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-
|
|
4569
|
+
const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-2daeaa68"]]);
|
|
4042
4570
|
|
|
4043
4571
|
const HEX_LENGTH_1 = 1;
|
|
4044
4572
|
const HEX_LENGTH_2 = 2;
|
|
4045
4573
|
const HEX_LENGTH_3 = 3;
|
|
4046
4574
|
const HEX_LENGTH_4 = 4;
|
|
4047
4575
|
const HEX_LENGTH_6 = 6;
|
|
4576
|
+
const HEX_LENGTH_8 = 8;
|
|
4577
|
+
const FULLY_OPAQUE_ALPHA_SUFFIX = "FF";
|
|
4578
|
+
const normalizeOpaqueAlpha = (normalizedHexWithHash) => normalizedHexWithHash.length === HEX_LENGTH_8 + 1 && normalizedHexWithHash.endsWith(FULLY_OPAQUE_ALPHA_SUFFIX) ? normalizedHexWithHash.slice(0, HEX_LENGTH_6 + 1) : normalizedHexWithHash;
|
|
4048
4579
|
const normalize = (value, fallbackValue) => {
|
|
4049
4580
|
const trimmed = value.trim();
|
|
4050
4581
|
if (trimmed.length === 0) {
|
|
@@ -4060,13 +4591,22 @@ const normalize = (value, fallbackValue) => {
|
|
|
4060
4591
|
if (withoutHash.length === HEX_LENGTH_2) {
|
|
4061
4592
|
return `#${withoutHash.repeat(HEX_LENGTH_3)}`.toUpperCase();
|
|
4062
4593
|
}
|
|
4063
|
-
if (withoutHash.length === HEX_LENGTH_3
|
|
4594
|
+
if (withoutHash.length === HEX_LENGTH_3) {
|
|
4064
4595
|
const [r, g, b] = withoutHash;
|
|
4065
4596
|
return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
|
|
4066
4597
|
}
|
|
4598
|
+
if (withoutHash.length === HEX_LENGTH_4) {
|
|
4599
|
+
const [r, g, b, a] = withoutHash;
|
|
4600
|
+
return normalizeOpaqueAlpha(
|
|
4601
|
+
`#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase()
|
|
4602
|
+
);
|
|
4603
|
+
}
|
|
4067
4604
|
if (withoutHash.length === HEX_LENGTH_6) {
|
|
4068
4605
|
return `#${withoutHash}`.toUpperCase();
|
|
4069
4606
|
}
|
|
4607
|
+
if (withoutHash.length === HEX_LENGTH_8) {
|
|
4608
|
+
return normalizeOpaqueAlpha(`#${withoutHash}`.toUpperCase());
|
|
4609
|
+
}
|
|
4070
4610
|
return fallbackValue;
|
|
4071
4611
|
};
|
|
4072
4612
|
const useColorInputValidationOnFocusOut = (modelValue) => {
|
|
@@ -4075,8 +4615,10 @@ const useColorInputValidationOnFocusOut = (modelValue) => {
|
|
|
4075
4615
|
modelValue,
|
|
4076
4616
|
(value) => {
|
|
4077
4617
|
const withoutHash = value.startsWith("#") ? value.slice(1) : value;
|
|
4078
|
-
if (/^[0-9a-fA-F]
|
|
4079
|
-
lastValidHexColor.value =
|
|
4618
|
+
if ((withoutHash.length === HEX_LENGTH_6 || withoutHash.length === HEX_LENGTH_8) && /^[0-9a-fA-F]+$/.test(withoutHash)) {
|
|
4619
|
+
lastValidHexColor.value = normalizeOpaqueAlpha(
|
|
4620
|
+
`#${withoutHash.toUpperCase()}`
|
|
4621
|
+
);
|
|
4080
4622
|
}
|
|
4081
4623
|
},
|
|
4082
4624
|
{ immediate: true }
|
|
@@ -4161,7 +4703,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4161
4703
|
}, null, 8, ["color", "style"])
|
|
4162
4704
|
]),
|
|
4163
4705
|
trailing: withCtx(() => [
|
|
4164
|
-
createVNode(unref(_sfc_main$
|
|
4706
|
+
createVNode(unref(_sfc_main$_), {
|
|
4165
4707
|
modelValue: open.value,
|
|
4166
4708
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
4167
4709
|
size: "xsmall",
|
|
@@ -4262,7 +4804,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4262
4804
|
onBlur: handleBlur
|
|
4263
4805
|
}), {
|
|
4264
4806
|
trailing: withCtx(() => [
|
|
4265
|
-
__props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$
|
|
4807
|
+
__props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$_, {
|
|
4266
4808
|
key: 0,
|
|
4267
4809
|
modelValue: showValue.value,
|
|
4268
4810
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showValue.value = $event),
|
|
@@ -14143,13 +14685,13 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
|
|
|
14143
14685
|
};
|
|
14144
14686
|
}
|
|
14145
14687
|
});
|
|
14146
|
-
const _hoisted_1$
|
|
14688
|
+
const _hoisted_1$m = {
|
|
14147
14689
|
key: 0,
|
|
14148
14690
|
class: "vc-time-header"
|
|
14149
14691
|
};
|
|
14150
|
-
const _hoisted_2$
|
|
14151
|
-
const _hoisted_3$
|
|
14152
|
-
const _hoisted_4$
|
|
14692
|
+
const _hoisted_2$c = { class: "vc-time-weekday" };
|
|
14693
|
+
const _hoisted_3$9 = { class: "vc-time-month" };
|
|
14694
|
+
const _hoisted_4$7 = { class: "vc-time-day" };
|
|
14153
14695
|
const _hoisted_5$3 = { class: "vc-time-year" };
|
|
14154
14696
|
const _hoisted_6$1 = { class: "vc-time-select-group" };
|
|
14155
14697
|
const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -14184,10 +14726,10 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
|
14184
14726
|
}, [
|
|
14185
14727
|
createVNode(_sfc_main$i$1, { name: "time-header" }, {
|
|
14186
14728
|
default: withCtx(() => [
|
|
14187
|
-
unref(showHeader) && unref(date) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
14188
|
-
createElementVNode("span", _hoisted_2$
|
|
14189
|
-
createElementVNode("span", _hoisted_3$
|
|
14190
|
-
createElementVNode("span", _hoisted_4$
|
|
14729
|
+
unref(showHeader) && unref(date) ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
14730
|
+
createElementVNode("span", _hoisted_2$c, toDisplayString(unref(locale).formatDate(unref(date), "WWW")), 1),
|
|
14731
|
+
createElementVNode("span", _hoisted_3$9, toDisplayString(unref(locale).formatDate(unref(date), "MMM")), 1),
|
|
14732
|
+
createElementVNode("span", _hoisted_4$7, toDisplayString(unref(locale).formatDate(unref(date), "D")), 1),
|
|
14191
14733
|
createElementVNode("span", _hoisted_5$3, toDisplayString(unref(locale).formatDate(unref(date), "YYYY")), 1)
|
|
14192
14734
|
])) : createCommentVNode("", true)
|
|
14193
14735
|
]),
|
|
@@ -14485,7 +15027,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
14485
15027
|
onBlur: onTextInputBlur
|
|
14486
15028
|
}), {
|
|
14487
15029
|
trailing: withCtx(() => [
|
|
14488
|
-
createVNode(_sfc_main$
|
|
15030
|
+
createVNode(_sfc_main$_, {
|
|
14489
15031
|
modelValue: popoverIsVisible.value,
|
|
14490
15032
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => popoverIsVisible.value = $event),
|
|
14491
15033
|
type: "button",
|
|
@@ -14540,7 +15082,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
14540
15082
|
}
|
|
14541
15083
|
});
|
|
14542
15084
|
|
|
14543
|
-
const _hoisted_1$
|
|
15085
|
+
const _hoisted_1$l = { class: "kds-date-time-format-popover" };
|
|
14544
15086
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
14545
15087
|
__name: "DateTimeFormatPopover",
|
|
14546
15088
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -14679,7 +15221,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
14679
15221
|
}));
|
|
14680
15222
|
});
|
|
14681
15223
|
return (_ctx, _cache) => {
|
|
14682
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
15224
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
14683
15225
|
modeOptions.value.length > 1 ? (openBlock(), createBlock(KdsValueSwitch, {
|
|
14684
15226
|
key: 0,
|
|
14685
15227
|
"model-value": effectiveSelectedMode.value,
|
|
@@ -14725,390 +15267,20 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
14725
15267
|
validating: { type: Boolean, default: false },
|
|
14726
15268
|
preserveSubTextSpace: { type: Boolean, default: false },
|
|
14727
15269
|
placeholder: { default: "Format" },
|
|
14728
|
-
disabled: { type: Boolean, default: false },
|
|
14729
|
-
autocomplete: {},
|
|
14730
|
-
allowedFormats: {},
|
|
14731
|
-
allDefaultFormats: {}
|
|
14732
|
-
}, {
|
|
14733
|
-
"modelValue": { default: "" },
|
|
14734
|
-
"modelModifiers": {}
|
|
14735
|
-
}),
|
|
14736
|
-
emits: ["update:modelValue"],
|
|
14737
|
-
setup(__props) {
|
|
14738
|
-
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "placeholder"]);
|
|
14739
|
-
const modelValue = useModel(__props, "modelValue");
|
|
14740
|
-
const open = ref(false);
|
|
14741
|
-
const popoverEl = useTemplateRef("popoverEl");
|
|
14742
|
-
return (_ctx, _cache) => {
|
|
14743
|
-
return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
|
|
14744
|
-
error: __props.error,
|
|
14745
|
-
validating: __props.validating,
|
|
14746
|
-
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
14747
|
-
}), {
|
|
14748
|
-
default: withCtx((slotProps) => [
|
|
14749
|
-
createElementVNode("div", {
|
|
14750
|
-
style: normalizeStyle(popoverEl.value?.anchorStyle)
|
|
14751
|
-
}, [
|
|
14752
|
-
createVNode(BaseInput, mergeProps(slotProps, {
|
|
14753
|
-
modelValue: modelValue.value,
|
|
14754
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
|
|
14755
|
-
type: "text",
|
|
14756
|
-
placeholder: __props.placeholder,
|
|
14757
|
-
disabled: __props.disabled,
|
|
14758
|
-
error: __props.error,
|
|
14759
|
-
validating: __props.validating,
|
|
14760
|
-
autocomplete: props.autocomplete
|
|
14761
|
-
}), {
|
|
14762
|
-
trailing: withCtx(() => [
|
|
14763
|
-
createVNode(unref(_sfc_main$Y), {
|
|
14764
|
-
modelValue: open.value,
|
|
14765
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
14766
|
-
size: "xsmall",
|
|
14767
|
-
variant: "outlined",
|
|
14768
|
-
"leading-icon": "date-time",
|
|
14769
|
-
ariaLabel: "Open date/time format picker",
|
|
14770
|
-
"aria-controls": popoverEl.value?.popoverId,
|
|
14771
|
-
"aria-expanded": open.value,
|
|
14772
|
-
"aria-haspopup": "dialog",
|
|
14773
|
-
disabled: __props.disabled,
|
|
14774
|
-
title: open.value ? "Close date/time format picker" : "Open date/time format picker"
|
|
14775
|
-
}, null, 8, ["modelValue", "aria-controls", "aria-expanded", "disabled", "title"])
|
|
14776
|
-
]),
|
|
14777
|
-
_: 1
|
|
14778
|
-
}, 16, ["modelValue", "placeholder", "disabled", "error", "validating", "autocomplete"]),
|
|
14779
|
-
createVNode(KdsPopover, {
|
|
14780
|
-
ref_key: "popoverEl",
|
|
14781
|
-
ref: popoverEl,
|
|
14782
|
-
modelValue: open.value,
|
|
14783
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => open.value = $event),
|
|
14784
|
-
placement: "bottom-right",
|
|
14785
|
-
"aria-label": "Date time format selection dialog"
|
|
14786
|
-
}, {
|
|
14787
|
-
default: withCtx(() => [
|
|
14788
|
-
createVNode(DateTimeFormatPopover, {
|
|
14789
|
-
selection: modelValue.value,
|
|
14790
|
-
"all-default-formats": props.allDefaultFormats,
|
|
14791
|
-
"allowed-formats": props.allowedFormats,
|
|
14792
|
-
"onUpdate:selection": _cache[2] || (_cache[2] = ($event) => {
|
|
14793
|
-
modelValue.value = $event;
|
|
14794
|
-
open.value = false;
|
|
14795
|
-
})
|
|
14796
|
-
}, null, 8, ["selection", "all-default-formats", "allowed-formats"])
|
|
14797
|
-
]),
|
|
14798
|
-
_: 1
|
|
14799
|
-
}, 8, ["modelValue"])
|
|
14800
|
-
], 4)
|
|
14801
|
-
]),
|
|
14802
|
-
_: 1
|
|
14803
|
-
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
14804
|
-
};
|
|
14805
|
-
}
|
|
14806
|
-
});
|
|
14807
|
-
|
|
14808
|
-
const kdsTemporalType = {
|
|
14809
|
-
DATE: "DATE",
|
|
14810
|
-
TIME: "TIME",
|
|
14811
|
-
DATE_TIME: "DATE_TIME",
|
|
14812
|
-
ZONED_DATE_TIME: "ZONED_DATE_TIME"
|
|
14813
|
-
};
|
|
14814
|
-
const kdsTemporalTypes = Object.values(kdsTemporalType);
|
|
14815
|
-
const kdsDateFormatCategory = {
|
|
14816
|
-
RECENT: "RECENT",
|
|
14817
|
-
STANDARD: "STANDARD",
|
|
14818
|
-
EUROPEAN: "EUROPEAN",
|
|
14819
|
-
AMERICAN: "AMERICAN"
|
|
14820
|
-
};
|
|
14821
|
-
const kdsDateFormatCategories = Object.values(kdsDateFormatCategory);
|
|
14822
|
-
|
|
14823
|
-
const additionalGroupSeparators = [" ", " ", " "];
|
|
14824
|
-
const decimalSeparatorSample = 1.1;
|
|
14825
|
-
const groupSeparatorSample = 1000.1;
|
|
14826
|
-
const countFractionDigits = (value) => {
|
|
14827
|
-
if (!Number.isFinite(value)) {
|
|
14828
|
-
return 0;
|
|
14829
|
-
}
|
|
14830
|
-
const exp = value.toExponential();
|
|
14831
|
-
const match = /^[-+]?(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(exp);
|
|
14832
|
-
if (!match) {
|
|
14833
|
-
return 0;
|
|
14834
|
-
}
|
|
14835
|
-
const fractionDigitsInMantissa = match[2]?.length ?? 0;
|
|
14836
|
-
const exponent = Number.parseInt(match[3], 10);
|
|
14837
|
-
if (exponent >= 0) {
|
|
14838
|
-
return Math.max(0, fractionDigitsInMantissa - exponent);
|
|
14839
|
-
}
|
|
14840
|
-
return fractionDigitsInMantissa + Math.abs(exponent);
|
|
14841
|
-
};
|
|
14842
|
-
const createKdsNumberParser = (params) => {
|
|
14843
|
-
const formatter = new Intl.NumberFormat(params.locale);
|
|
14844
|
-
const decimalSeparator = formatter.formatToParts(decimalSeparatorSample).find((part) => part.type === "decimal")?.value ?? ".";
|
|
14845
|
-
const groupSeparator = formatter.formatToParts(groupSeparatorSample).find((part) => part.type === "group")?.value ?? ",";
|
|
14846
|
-
const removeGroupingSeparators = (input) => [groupSeparator, ...additionalGroupSeparators].reduce(
|
|
14847
|
-
(acc, groupSep) => groupSep.length > 0 ? acc.split(groupSep).join("") : acc,
|
|
14848
|
-
input
|
|
14849
|
-
);
|
|
14850
|
-
const formattersByMaxDecimals = /* @__PURE__ */ new Map();
|
|
14851
|
-
const getFormatterForMaxDecimals = (maxDecimals) => {
|
|
14852
|
-
const cached = formattersByMaxDecimals.get(maxDecimals);
|
|
14853
|
-
if (cached) {
|
|
14854
|
-
return cached;
|
|
14855
|
-
}
|
|
14856
|
-
const created = new Intl.NumberFormat(params.locale, {
|
|
14857
|
-
useGrouping: false,
|
|
14858
|
-
minimumFractionDigits: 0,
|
|
14859
|
-
maximumFractionDigits: maxDecimals
|
|
14860
|
-
});
|
|
14861
|
-
formattersByMaxDecimals.set(maxDecimals, created);
|
|
14862
|
-
return created;
|
|
14863
|
-
};
|
|
14864
|
-
const stepFractionDigits = countFractionDigits(params.step);
|
|
14865
|
-
const precisionFactor = Number(`1e${stepFractionDigits}`);
|
|
14866
|
-
const formatForDisplay = (value) => {
|
|
14867
|
-
if (!Number.isFinite(value)) {
|
|
14868
|
-
return "";
|
|
14869
|
-
}
|
|
14870
|
-
const valueDecimals = countFractionDigits(value);
|
|
14871
|
-
const maxDecimals = Math.max(stepFractionDigits, valueDecimals);
|
|
14872
|
-
return getFormatterForMaxDecimals(maxDecimals).format(value);
|
|
14873
|
-
};
|
|
14874
|
-
const roundToStep = (value) => {
|
|
14875
|
-
if (!Number.isFinite(value)) {
|
|
14876
|
-
return Number.NaN;
|
|
14877
|
-
}
|
|
14878
|
-
const step = params.step;
|
|
14879
|
-
if (!Number.isFinite(step) || step <= 0) {
|
|
14880
|
-
return value;
|
|
14881
|
-
}
|
|
14882
|
-
if (!Number.isFinite(precisionFactor) || precisionFactor <= 0) {
|
|
14883
|
-
return value;
|
|
14884
|
-
}
|
|
14885
|
-
const scaledNext = Math.round(value * precisionFactor);
|
|
14886
|
-
const scaledStep = Math.round(step * precisionFactor);
|
|
14887
|
-
if (scaledStep === 0) {
|
|
14888
|
-
return value;
|
|
14889
|
-
}
|
|
14890
|
-
const roundedScaled = Math.round(scaledNext / scaledStep) * scaledStep;
|
|
14891
|
-
return roundedScaled / precisionFactor;
|
|
14892
|
-
};
|
|
14893
|
-
const isValidNormalizedNumber = (normalized) => (
|
|
14894
|
-
// Accept plain decimals as well as scientific notation.
|
|
14895
|
-
// Note: whitespace is removed earlier; we don't accept grouping separators here.
|
|
14896
|
-
/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(normalized)
|
|
14897
|
-
);
|
|
14898
|
-
const parseWithLocaleDecimal = (input, localeDecimal) => {
|
|
14899
|
-
const withoutGrouping = removeGroupingSeparators(input);
|
|
14900
|
-
const normalized = withoutGrouping.split(localeDecimal).join(".");
|
|
14901
|
-
if (!isValidNormalizedNumber(normalized)) {
|
|
14902
|
-
return Number.NaN;
|
|
14903
|
-
}
|
|
14904
|
-
const parsed = Number.parseFloat(normalized);
|
|
14905
|
-
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
14906
|
-
};
|
|
14907
|
-
const parseWithFallbackDot = (input) => {
|
|
14908
|
-
const lastDotIndex = input.lastIndexOf(".");
|
|
14909
|
-
const digitsAfterDot = input.slice(lastDotIndex + 1);
|
|
14910
|
-
const looksLikeDecimal = digitsAfterDot.length > 0 && digitsAfterDot.length <= 2;
|
|
14911
|
-
const normalized = looksLikeDecimal ? `${removeGroupingSeparators(input.slice(0, lastDotIndex))}.${removeGroupingSeparators(
|
|
14912
|
-
digitsAfterDot
|
|
14913
|
-
)}` : removeGroupingSeparators(input);
|
|
14914
|
-
if (!isValidNormalizedNumber(normalized)) {
|
|
14915
|
-
return Number.NaN;
|
|
14916
|
-
}
|
|
14917
|
-
const parsed = Number.parseFloat(normalized);
|
|
14918
|
-
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
14919
|
-
};
|
|
14920
|
-
const parseWithoutLocaleDecimal = (input) => {
|
|
14921
|
-
const normalized = removeGroupingSeparators(input);
|
|
14922
|
-
if (!isValidNormalizedNumber(normalized)) {
|
|
14923
|
-
return Number.NaN;
|
|
14924
|
-
}
|
|
14925
|
-
const parsed = Number.parseFloat(normalized);
|
|
14926
|
-
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
14927
|
-
};
|
|
14928
|
-
function parseFromInput(value) {
|
|
14929
|
-
const trimmed = value.trim();
|
|
14930
|
-
if (trimmed.length === 0) {
|
|
14931
|
-
return Number.NaN;
|
|
14932
|
-
}
|
|
14933
|
-
const localeDecimal = decimalSeparator;
|
|
14934
|
-
const hasLocaleDecimal = localeDecimal.length > 0 && trimmed.includes(localeDecimal);
|
|
14935
|
-
if (hasLocaleDecimal) {
|
|
14936
|
-
return parseWithLocaleDecimal(trimmed, localeDecimal);
|
|
14937
|
-
}
|
|
14938
|
-
if (localeDecimal !== "." && trimmed.includes(".")) {
|
|
14939
|
-
return parseWithFallbackDot(trimmed);
|
|
14940
|
-
}
|
|
14941
|
-
return parseWithoutLocaleDecimal(trimmed);
|
|
14942
|
-
}
|
|
14943
|
-
return {
|
|
14944
|
-
locale: params.locale,
|
|
14945
|
-
decimalSeparator,
|
|
14946
|
-
groupSeparator,
|
|
14947
|
-
stepFractionDigits,
|
|
14948
|
-
formatForDisplay,
|
|
14949
|
-
parseFromInput,
|
|
14950
|
-
roundToStep
|
|
14951
|
-
};
|
|
14952
|
-
};
|
|
14953
|
-
|
|
14954
|
-
const REPEAT_INITIAL_DELAY_MS = 400;
|
|
14955
|
-
const REPEAT_INTERVAL_MS = 100;
|
|
14956
|
-
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
14957
|
-
__name: "KdsNumberInput",
|
|
14958
|
-
props: /* @__PURE__ */ mergeModels({
|
|
14959
|
-
description: {},
|
|
14960
|
-
label: {},
|
|
14961
|
-
ariaLabel: {},
|
|
14962
|
-
id: {},
|
|
14963
|
-
subText: {},
|
|
14964
|
-
error: { type: Boolean, default: false },
|
|
14965
|
-
validating: { type: Boolean, default: false },
|
|
14966
|
-
preserveSubTextSpace: { type: Boolean, default: false },
|
|
14967
|
-
placeholder: {},
|
|
14968
|
-
disabled: { type: Boolean, default: false },
|
|
14969
|
-
autocomplete: {},
|
|
14970
|
-
unit: { default: "" },
|
|
14971
|
-
min: {},
|
|
14972
|
-
max: {},
|
|
14973
|
-
step: { default: 1 }
|
|
14974
|
-
}, {
|
|
14975
|
-
"modelValue": { default: Number.NaN },
|
|
14976
|
-
"modelModifiers": {}
|
|
14977
|
-
}),
|
|
14978
|
-
emits: ["update:modelValue"],
|
|
14979
|
-
setup(__props, { expose: __expose }) {
|
|
14980
|
-
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "unit", "step"]);
|
|
14981
|
-
const modelValue = useModel(__props, "modelValue");
|
|
14982
|
-
const isFocused = ref(false);
|
|
14983
|
-
const localValue = ref("");
|
|
14984
|
-
const numberParser = computed(
|
|
14985
|
-
() => createKdsNumberParser({ locale: "en-US", step: __props.step })
|
|
14986
|
-
);
|
|
14987
|
-
const ariaValuenow = computed(
|
|
14988
|
-
() => Number.isFinite(modelValue.value) ? modelValue.value : void 0
|
|
14989
|
-
);
|
|
14990
|
-
const ariaValuetext = computed(() => {
|
|
14991
|
-
if (!Number.isFinite(modelValue.value)) {
|
|
14992
|
-
return void 0;
|
|
14993
|
-
}
|
|
14994
|
-
return numberParser.value.formatForDisplay(modelValue.value);
|
|
14995
|
-
});
|
|
14996
|
-
const clamp = (value) => {
|
|
14997
|
-
if (!Number.isFinite(value)) {
|
|
14998
|
-
return Number.NaN;
|
|
14999
|
-
}
|
|
15000
|
-
let result = value;
|
|
15001
|
-
if (props.min !== void 0 && !Number.isNaN(props.min)) {
|
|
15002
|
-
result = Math.max(props.min, result);
|
|
15003
|
-
}
|
|
15004
|
-
if (props.max !== void 0 && !Number.isNaN(props.max)) {
|
|
15005
|
-
result = Math.min(props.max, result);
|
|
15006
|
-
}
|
|
15007
|
-
return result;
|
|
15008
|
-
};
|
|
15009
|
-
watch(
|
|
15010
|
-
() => modelValue.value,
|
|
15011
|
-
(next) => {
|
|
15012
|
-
if (isFocused.value) {
|
|
15013
|
-
return;
|
|
15014
|
-
}
|
|
15015
|
-
localValue.value = numberParser.value.formatForDisplay(next);
|
|
15016
|
-
},
|
|
15017
|
-
{ immediate: true }
|
|
15018
|
-
);
|
|
15019
|
-
const canDecrease = computed(() => {
|
|
15020
|
-
if (__props.disabled) {
|
|
15021
|
-
return false;
|
|
15022
|
-
}
|
|
15023
|
-
if (props.min === void 0 || Number.isNaN(props.min)) {
|
|
15024
|
-
return true;
|
|
15025
|
-
}
|
|
15026
|
-
if (Number.isNaN(modelValue.value)) {
|
|
15027
|
-
return true;
|
|
15028
|
-
}
|
|
15029
|
-
return modelValue.value > props.min;
|
|
15030
|
-
});
|
|
15031
|
-
const canIncrease = computed(() => {
|
|
15032
|
-
if (__props.disabled) {
|
|
15033
|
-
return false;
|
|
15034
|
-
}
|
|
15035
|
-
if (props.max === void 0 || Number.isNaN(props.max)) {
|
|
15036
|
-
return true;
|
|
15037
|
-
}
|
|
15038
|
-
if (Number.isNaN(modelValue.value)) {
|
|
15039
|
-
return true;
|
|
15040
|
-
}
|
|
15041
|
-
return modelValue.value < props.max;
|
|
15042
|
-
});
|
|
15043
|
-
const adjustByStep = (direction) => {
|
|
15044
|
-
if (__props.step <= 0) {
|
|
15045
|
-
return;
|
|
15046
|
-
}
|
|
15047
|
-
const base = Number.isFinite(modelValue.value) ? modelValue.value : numberParser.value.parseFromInput(localValue.value);
|
|
15048
|
-
const nextRaw = Number.isFinite(base) ? base + direction * __props.step : 0;
|
|
15049
|
-
const rounded = numberParser.value.roundToStep(nextRaw);
|
|
15050
|
-
const next = clamp(rounded);
|
|
15051
|
-
modelValue.value = next;
|
|
15052
|
-
localValue.value = numberParser.value.formatForDisplay(next);
|
|
15053
|
-
};
|
|
15054
|
-
const handleKeydown = (event) => {
|
|
15055
|
-
if (__props.disabled) {
|
|
15056
|
-
return;
|
|
15057
|
-
}
|
|
15058
|
-
if (event.key === "ArrowUp" && canIncrease.value) {
|
|
15059
|
-
event.preventDefault();
|
|
15060
|
-
adjustByStep(1);
|
|
15061
|
-
return;
|
|
15062
|
-
}
|
|
15063
|
-
if (event.key === "ArrowDown" && canDecrease.value) {
|
|
15064
|
-
event.preventDefault();
|
|
15065
|
-
adjustByStep(-1);
|
|
15066
|
-
}
|
|
15067
|
-
};
|
|
15068
|
-
const handleUpdateModelValue = (value) => {
|
|
15069
|
-
localValue.value = value;
|
|
15070
|
-
modelValue.value = numberParser.value.parseFromInput(value);
|
|
15071
|
-
};
|
|
15072
|
-
const baseInput = useTemplateRef("baseInput");
|
|
15073
|
-
let repeatTimer = null;
|
|
15074
|
-
let isStepping = false;
|
|
15075
|
-
const handleBlur = () => {
|
|
15076
|
-
if (isStepping) {
|
|
15077
|
-
baseInput.value?.focus();
|
|
15078
|
-
return;
|
|
15079
|
-
}
|
|
15080
|
-
isFocused.value = false;
|
|
15081
|
-
const parsed = numberParser.value.parseFromInput(localValue.value);
|
|
15082
|
-
const normalized = clamp(parsed);
|
|
15083
|
-
modelValue.value = normalized;
|
|
15084
|
-
localValue.value = numberParser.value.formatForDisplay(normalized);
|
|
15085
|
-
};
|
|
15086
|
-
const stopRepeating = () => {
|
|
15087
|
-
if (repeatTimer !== null) {
|
|
15088
|
-
clearTimeout(repeatTimer);
|
|
15089
|
-
repeatTimer = null;
|
|
15090
|
-
}
|
|
15091
|
-
isStepping = false;
|
|
15092
|
-
};
|
|
15093
|
-
const startRepeating = (direction) => {
|
|
15094
|
-
stopRepeating();
|
|
15095
|
-
isStepping = true;
|
|
15096
|
-
adjustByStep(direction);
|
|
15097
|
-
repeatTimer = setTimeout(function tick() {
|
|
15098
|
-
adjustByStep(direction);
|
|
15099
|
-
repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
|
|
15100
|
-
}, REPEAT_INITIAL_DELAY_MS);
|
|
15101
|
-
};
|
|
15102
|
-
onBeforeUnmount(stopRepeating);
|
|
15103
|
-
const handleButtonClick = (direction, event) => {
|
|
15104
|
-
if (event.detail !== 0) {
|
|
15105
|
-
return;
|
|
15106
|
-
}
|
|
15107
|
-
adjustByStep(direction);
|
|
15108
|
-
};
|
|
15109
|
-
__expose({
|
|
15110
|
-
focus: () => baseInput.value?.focus()
|
|
15111
|
-
});
|
|
15270
|
+
disabled: { type: Boolean, default: false },
|
|
15271
|
+
autocomplete: {},
|
|
15272
|
+
allowedFormats: {},
|
|
15273
|
+
allDefaultFormats: {}
|
|
15274
|
+
}, {
|
|
15275
|
+
"modelValue": { default: "" },
|
|
15276
|
+
"modelModifiers": {}
|
|
15277
|
+
}),
|
|
15278
|
+
emits: ["update:modelValue"],
|
|
15279
|
+
setup(__props) {
|
|
15280
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "placeholder"]);
|
|
15281
|
+
const modelValue = useModel(__props, "modelValue");
|
|
15282
|
+
const open = ref(false);
|
|
15283
|
+
const popoverEl = useTemplateRef("popoverEl");
|
|
15112
15284
|
return (_ctx, _cache) => {
|
|
15113
15285
|
return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
|
|
15114
15286
|
error: __props.error,
|
|
@@ -15116,58 +15288,58 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
15116
15288
|
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
15117
15289
|
}), {
|
|
15118
15290
|
default: withCtx((slotProps) => [
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
|
|
15128
|
-
|
|
15129
|
-
|
|
15130
|
-
|
|
15131
|
-
|
|
15132
|
-
|
|
15133
|
-
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15137
|
-
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15144
|
-
|
|
15145
|
-
|
|
15146
|
-
|
|
15147
|
-
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
|
|
15152
|
-
|
|
15153
|
-
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15291
|
+
createElementVNode("div", {
|
|
15292
|
+
style: normalizeStyle(popoverEl.value?.anchorStyle)
|
|
15293
|
+
}, [
|
|
15294
|
+
createVNode(BaseInput, mergeProps(slotProps, {
|
|
15295
|
+
modelValue: modelValue.value,
|
|
15296
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
|
|
15297
|
+
type: "text",
|
|
15298
|
+
placeholder: __props.placeholder,
|
|
15299
|
+
disabled: __props.disabled,
|
|
15300
|
+
error: __props.error,
|
|
15301
|
+
validating: __props.validating,
|
|
15302
|
+
autocomplete: props.autocomplete
|
|
15303
|
+
}), {
|
|
15304
|
+
trailing: withCtx(() => [
|
|
15305
|
+
createVNode(unref(_sfc_main$_), {
|
|
15306
|
+
modelValue: open.value,
|
|
15307
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
15308
|
+
size: "xsmall",
|
|
15309
|
+
variant: "outlined",
|
|
15310
|
+
"leading-icon": "date-time",
|
|
15311
|
+
ariaLabel: "Open date/time format picker",
|
|
15312
|
+
"aria-controls": popoverEl.value?.popoverId,
|
|
15313
|
+
"aria-expanded": open.value,
|
|
15314
|
+
"aria-haspopup": "dialog",
|
|
15315
|
+
disabled: __props.disabled,
|
|
15316
|
+
title: open.value ? "Close date/time format picker" : "Open date/time format picker"
|
|
15317
|
+
}, null, 8, ["modelValue", "aria-controls", "aria-expanded", "disabled", "title"])
|
|
15318
|
+
]),
|
|
15319
|
+
_: 1
|
|
15320
|
+
}, 16, ["modelValue", "placeholder", "disabled", "error", "validating", "autocomplete"]),
|
|
15321
|
+
createVNode(KdsPopover, {
|
|
15322
|
+
ref_key: "popoverEl",
|
|
15323
|
+
ref: popoverEl,
|
|
15324
|
+
modelValue: open.value,
|
|
15325
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => open.value = $event),
|
|
15326
|
+
placement: "bottom-right",
|
|
15327
|
+
"aria-label": "Date time format selection dialog"
|
|
15328
|
+
}, {
|
|
15329
|
+
default: withCtx(() => [
|
|
15330
|
+
createVNode(DateTimeFormatPopover, {
|
|
15331
|
+
selection: modelValue.value,
|
|
15332
|
+
"all-default-formats": props.allDefaultFormats,
|
|
15333
|
+
"allowed-formats": props.allowedFormats,
|
|
15334
|
+
"onUpdate:selection": _cache[2] || (_cache[2] = ($event) => {
|
|
15335
|
+
modelValue.value = $event;
|
|
15336
|
+
open.value = false;
|
|
15337
|
+
})
|
|
15338
|
+
}, null, 8, ["selection", "all-default-formats", "allowed-formats"])
|
|
15339
|
+
]),
|
|
15340
|
+
_: 1
|
|
15341
|
+
}, 8, ["modelValue"])
|
|
15342
|
+
], 4)
|
|
15171
15343
|
]),
|
|
15172
15344
|
_: 1
|
|
15173
15345
|
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
@@ -15175,6 +15347,21 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
15175
15347
|
}
|
|
15176
15348
|
});
|
|
15177
15349
|
|
|
15350
|
+
const kdsTemporalType = {
|
|
15351
|
+
DATE: "DATE",
|
|
15352
|
+
TIME: "TIME",
|
|
15353
|
+
DATE_TIME: "DATE_TIME",
|
|
15354
|
+
ZONED_DATE_TIME: "ZONED_DATE_TIME"
|
|
15355
|
+
};
|
|
15356
|
+
const kdsTemporalTypes = Object.values(kdsTemporalType);
|
|
15357
|
+
const kdsDateFormatCategory = {
|
|
15358
|
+
RECENT: "RECENT",
|
|
15359
|
+
STANDARD: "STANDARD",
|
|
15360
|
+
EUROPEAN: "EUROPEAN",
|
|
15361
|
+
AMERICAN: "AMERICAN"
|
|
15362
|
+
};
|
|
15363
|
+
const kdsDateFormatCategories = Object.values(kdsDateFormatCategory);
|
|
15364
|
+
|
|
15178
15365
|
const escapeRegex = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
15179
15366
|
const wildcardToRegexBody = (pattern) => {
|
|
15180
15367
|
let body = "";
|
|
@@ -15201,7 +15388,7 @@ const buildRegexFromPatternInput = (input, options) => {
|
|
|
15201
15388
|
return `^(?!.*${withCase}).*$`;
|
|
15202
15389
|
};
|
|
15203
15390
|
|
|
15204
|
-
const _sfc_main$
|
|
15391
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
15205
15392
|
__name: "KdsPatternInput",
|
|
15206
15393
|
props: /* @__PURE__ */ mergeModels({
|
|
15207
15394
|
description: {},
|
|
@@ -15284,7 +15471,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15284
15471
|
clearable: ""
|
|
15285
15472
|
}), {
|
|
15286
15473
|
trailing: withCtx(() => [
|
|
15287
|
-
createVNode(_sfc_main$
|
|
15474
|
+
createVNode(_sfc_main$_, {
|
|
15288
15475
|
modelValue: caseSensitive.value,
|
|
15289
15476
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => caseSensitive.value = $event),
|
|
15290
15477
|
size: "xsmall",
|
|
@@ -15294,7 +15481,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15294
15481
|
ariaLabel: "Case sensitivity",
|
|
15295
15482
|
disabled: __props.disabled
|
|
15296
15483
|
}, null, 8, ["modelValue", "title", "disabled"]),
|
|
15297
|
-
createVNode(_sfc_main$
|
|
15484
|
+
createVNode(_sfc_main$_, {
|
|
15298
15485
|
modelValue: excludeMatches.value,
|
|
15299
15486
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => excludeMatches.value = $event),
|
|
15300
15487
|
size: "xsmall",
|
|
@@ -15304,7 +15491,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15304
15491
|
ariaLabel: "Exclude matches",
|
|
15305
15492
|
disabled: __props.disabled
|
|
15306
15493
|
}, null, 8, ["modelValue", "title", "disabled"]),
|
|
15307
|
-
createVNode(_sfc_main$
|
|
15494
|
+
createVNode(_sfc_main$_, {
|
|
15308
15495
|
modelValue: useRegex.value,
|
|
15309
15496
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => useRegex.value = $event),
|
|
15310
15497
|
size: "xsmall",
|
|
@@ -15324,7 +15511,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15324
15511
|
}
|
|
15325
15512
|
});
|
|
15326
15513
|
|
|
15327
|
-
const _sfc_main$
|
|
15514
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
15328
15515
|
__name: "KdsSearchInput",
|
|
15329
15516
|
props: /* @__PURE__ */ mergeModels({
|
|
15330
15517
|
description: {},
|
|
@@ -15476,11 +15663,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
15476
15663
|
}
|
|
15477
15664
|
});
|
|
15478
15665
|
|
|
15479
|
-
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15666
|
+
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__scopeId", "data-v-b1809b6d"]]);
|
|
15480
15667
|
|
|
15481
|
-
const _hoisted_1$
|
|
15668
|
+
const _hoisted_1$k = ["rows", "placeholder", "disabled", "autocomplete"];
|
|
15482
15669
|
const DEFAULT_ROWS = 3;
|
|
15483
|
-
const _sfc_main$
|
|
15670
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
15484
15671
|
__name: "KdsTextarea",
|
|
15485
15672
|
props: /* @__PURE__ */ mergeModels({
|
|
15486
15673
|
description: {},
|
|
@@ -15541,7 +15728,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
15541
15728
|
placeholder: __props.placeholder,
|
|
15542
15729
|
disabled: __props.disabled,
|
|
15543
15730
|
autocomplete: props.autocomplete
|
|
15544
|
-
}), null, 16, _hoisted_1$
|
|
15731
|
+
}), null, 16, _hoisted_1$k), [
|
|
15545
15732
|
[vModelText, modelValue.value]
|
|
15546
15733
|
])
|
|
15547
15734
|
]),
|
|
@@ -15551,20 +15738,20 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
15551
15738
|
}
|
|
15552
15739
|
});
|
|
15553
15740
|
|
|
15554
|
-
const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15741
|
+
const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-bdf12ef9"]]);
|
|
15555
15742
|
|
|
15556
|
-
const _hoisted_1$
|
|
15557
|
-
const _hoisted_2$
|
|
15743
|
+
const _hoisted_1$j = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
|
|
15744
|
+
const _hoisted_2$b = {
|
|
15558
15745
|
key: 0,
|
|
15559
15746
|
class: "leading",
|
|
15560
15747
|
"aria-hidden": "true"
|
|
15561
15748
|
};
|
|
15562
|
-
const _hoisted_3$
|
|
15563
|
-
const _hoisted_4$
|
|
15749
|
+
const _hoisted_3$8 = ["id"];
|
|
15750
|
+
const _hoisted_4$6 = {
|
|
15564
15751
|
class: "trailing",
|
|
15565
15752
|
"aria-hidden": "true"
|
|
15566
15753
|
};
|
|
15567
|
-
const _sfc_main$
|
|
15754
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
15568
15755
|
__name: "BaseDropdown",
|
|
15569
15756
|
props: /* @__PURE__ */ mergeModels({
|
|
15570
15757
|
text: {},
|
|
@@ -15636,8 +15823,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
15636
15823
|
onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && emit("click")),
|
|
15637
15824
|
onKeydown
|
|
15638
15825
|
}, [
|
|
15639
|
-
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
15640
|
-
createVNode(_sfc_main$
|
|
15826
|
+
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$b, [
|
|
15827
|
+
createVNode(_sfc_main$X, {
|
|
15641
15828
|
accessory: props.accessory,
|
|
15642
15829
|
size: "medium"
|
|
15643
15830
|
}, null, 8, ["accessory"])
|
|
@@ -15648,28 +15835,28 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
15648
15835
|
placeholder: !props.text && !__props.disabled,
|
|
15649
15836
|
missing: __props.missing
|
|
15650
15837
|
}])
|
|
15651
|
-
}, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$
|
|
15652
|
-
createElementVNode("span", _hoisted_4$
|
|
15838
|
+
}, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$8),
|
|
15839
|
+
createElementVNode("span", _hoisted_4$6, [
|
|
15653
15840
|
createVNode(KdsIcon, {
|
|
15654
15841
|
name: open.value ? "chevron-up" : "chevron-down",
|
|
15655
15842
|
size: "small"
|
|
15656
15843
|
}, null, 8, ["name"])
|
|
15657
15844
|
])
|
|
15658
|
-
], 42, _hoisted_1$
|
|
15845
|
+
], 42, _hoisted_1$j);
|
|
15659
15846
|
};
|
|
15660
15847
|
}
|
|
15661
15848
|
});
|
|
15662
15849
|
|
|
15663
|
-
const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15850
|
+
const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__scopeId", "data-v-cf3becf9"]]);
|
|
15664
15851
|
|
|
15665
15852
|
const DROPDOWN_SEARCH_THRESHOLD = 12;
|
|
15666
15853
|
|
|
15667
|
-
const _hoisted_1$
|
|
15668
|
-
const _hoisted_2$
|
|
15854
|
+
const _hoisted_1$i = { class: "kds-dropdown-container" };
|
|
15855
|
+
const _hoisted_2$a = {
|
|
15669
15856
|
key: 0,
|
|
15670
15857
|
class: "kds-dropdown-container-sticky-top"
|
|
15671
15858
|
};
|
|
15672
|
-
const _sfc_main$
|
|
15859
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
15673
15860
|
__name: "DropdownContainer",
|
|
15674
15861
|
props: /* @__PURE__ */ mergeModels({
|
|
15675
15862
|
emptyText: {},
|
|
@@ -15752,8 +15939,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
15752
15939
|
}
|
|
15753
15940
|
});
|
|
15754
15941
|
return (_ctx, _cache) => {
|
|
15755
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
15756
|
-
searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
15942
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
15943
|
+
searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
|
|
15757
15944
|
createVNode(BaseInput, {
|
|
15758
15945
|
ref_key: "searchEl",
|
|
15759
15946
|
ref: searchEl,
|
|
@@ -15785,9 +15972,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
15785
15972
|
}
|
|
15786
15973
|
});
|
|
15787
15974
|
|
|
15788
|
-
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15975
|
+
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-db105594"]]);
|
|
15789
15976
|
|
|
15790
|
-
const _sfc_main$
|
|
15977
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
15791
15978
|
__name: "KdsDropdown",
|
|
15792
15979
|
props: /* @__PURE__ */ mergeModels({
|
|
15793
15980
|
placeholder: { default: "Select" },
|
|
@@ -15880,9 +16067,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
15880
16067
|
}
|
|
15881
16068
|
});
|
|
15882
16069
|
|
|
15883
|
-
const _hoisted_1$
|
|
15884
|
-
const _hoisted_2$
|
|
15885
|
-
const _sfc_main$
|
|
16070
|
+
const _hoisted_1$h = ["disabled"];
|
|
16071
|
+
const _hoisted_2$9 = ["title"];
|
|
16072
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
15886
16073
|
__name: "KdsListItemButton",
|
|
15887
16074
|
props: {
|
|
15888
16075
|
label: {},
|
|
@@ -15912,21 +16099,21 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
15912
16099
|
ref: labelEl,
|
|
15913
16100
|
class: "label",
|
|
15914
16101
|
title: unref(isLabelTruncated) ? props.label : void 0
|
|
15915
|
-
}, toDisplayString(props.label), 9, _hoisted_2$
|
|
15916
|
-
], 8, _hoisted_1$
|
|
16102
|
+
}, toDisplayString(props.label), 9, _hoisted_2$9)
|
|
16103
|
+
], 8, _hoisted_1$h);
|
|
15917
16104
|
};
|
|
15918
16105
|
}
|
|
15919
16106
|
});
|
|
15920
16107
|
|
|
15921
|
-
const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16108
|
+
const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__scopeId", "data-v-13945d12"]]);
|
|
15922
16109
|
|
|
15923
|
-
const _hoisted_1$
|
|
15924
|
-
const _hoisted_2$
|
|
15925
|
-
const _hoisted_3$
|
|
16110
|
+
const _hoisted_1$g = { class: "kds-multi-select-dropdown-options" };
|
|
16111
|
+
const _hoisted_2$8 = { class: "kds-multi-select-dropdown-search" };
|
|
16112
|
+
const _hoisted_3$7 = {
|
|
15926
16113
|
key: 0,
|
|
15927
16114
|
class: "kds-multi-select-dropdown-footer"
|
|
15928
16115
|
};
|
|
15929
|
-
const _sfc_main$
|
|
16116
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
15930
16117
|
__name: "MultiSelectDropdownContainer",
|
|
15931
16118
|
props: /* @__PURE__ */ mergeModels({
|
|
15932
16119
|
emptyText: {},
|
|
@@ -16042,8 +16229,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16042
16229
|
}
|
|
16043
16230
|
});
|
|
16044
16231
|
return (_ctx, _cache) => {
|
|
16045
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
16046
|
-
createElementVNode("div", _hoisted_2$
|
|
16232
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
16233
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
16047
16234
|
createVNode(BaseInput, {
|
|
16048
16235
|
ref_key: "searchEl",
|
|
16049
16236
|
ref: searchEl,
|
|
@@ -16072,7 +16259,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16072
16259
|
"aria-label": "Dropdown options",
|
|
16073
16260
|
onItemClick: _cache[4] || (_cache[4] = ($event) => $event !== void 0 && onItemClick($event))
|
|
16074
16261
|
}, null, 8, ["class", "possible-values", "loading", "empty-text"]),
|
|
16075
|
-
!__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
16262
|
+
!__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
|
|
16076
16263
|
createVNode(unref(KdsListItemButton), {
|
|
16077
16264
|
label: anyVisibleSelected.value ? "Clear all" : "Select all",
|
|
16078
16265
|
"leading-icon": anyVisibleSelected.value ? "trash" : "checkmark",
|
|
@@ -16085,9 +16272,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16085
16272
|
}
|
|
16086
16273
|
});
|
|
16087
16274
|
|
|
16088
|
-
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16275
|
+
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-9b631765"]]);
|
|
16089
16276
|
|
|
16090
|
-
const _sfc_main$
|
|
16277
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
16091
16278
|
__name: "KdsMultiSelectDropdown",
|
|
16092
16279
|
props: /* @__PURE__ */ mergeModels({
|
|
16093
16280
|
placeholder: { default: "Select" },
|
|
@@ -16214,9 +16401,9 @@ const kdsDimensionComponentHeight20x = 320;
|
|
|
16214
16401
|
const kdsSpacingContainer0p10x = 1;
|
|
16215
16402
|
const kdsSpacingContainer0p25x = 4;
|
|
16216
16403
|
|
|
16217
|
-
const _hoisted_1$
|
|
16218
|
-
const _hoisted_2$
|
|
16219
|
-
const _sfc_main$
|
|
16404
|
+
const _hoisted_1$f = { class: "kds-resize-handle-area" };
|
|
16405
|
+
const _hoisted_2$7 = ["aria-label"];
|
|
16406
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
16220
16407
|
__name: "ResizeHandle",
|
|
16221
16408
|
props: {
|
|
16222
16409
|
numberOfHandles: { default: 1 },
|
|
@@ -16238,7 +16425,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16238
16425
|
return `calc((100% - ${n - 1} * ${gap}) / ${2 * n})`;
|
|
16239
16426
|
});
|
|
16240
16427
|
return (_ctx, _cache) => {
|
|
16241
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
16428
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
16242
16429
|
(openBlock(true), createElementBlock(Fragment, null, renderList(normalizedNumberOfHandles.value, (i) => {
|
|
16243
16430
|
return openBlock(), createElementBlock("button", {
|
|
16244
16431
|
key: i,
|
|
@@ -16247,22 +16434,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16247
16434
|
type: "button"
|
|
16248
16435
|
}, [..._cache[0] || (_cache[0] = [
|
|
16249
16436
|
createElementVNode("span", { class: "kds-resize-handle-line" }, null, -1)
|
|
16250
|
-
])], 8, _hoisted_2$
|
|
16437
|
+
])], 8, _hoisted_2$7);
|
|
16251
16438
|
}), 128))
|
|
16252
16439
|
]);
|
|
16253
16440
|
};
|
|
16254
16441
|
}
|
|
16255
16442
|
});
|
|
16256
16443
|
|
|
16257
|
-
const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16444
|
+
const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-df3803d4"]]);
|
|
16258
16445
|
|
|
16259
|
-
const _hoisted_1$
|
|
16446
|
+
const _hoisted_1$e = {
|
|
16260
16447
|
ref: "content",
|
|
16261
16448
|
class: "kds-resize-container-content"
|
|
16262
16449
|
};
|
|
16263
16450
|
const DEFAULT_INITIAL_HEIGHT = 200;
|
|
16264
16451
|
const KEYBOARD_RESIZE_STEP = 10;
|
|
16265
|
-
const _sfc_main$
|
|
16452
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
16266
16453
|
__name: "KdsResizeContainer",
|
|
16267
16454
|
props: {
|
|
16268
16455
|
height: { default: () => DEFAULT_INITIAL_HEIGHT },
|
|
@@ -16325,7 +16512,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
16325
16512
|
return openBlock(), createElementBlock("div", {
|
|
16326
16513
|
class: normalizeClass(["kds-resize-container", { dragging: unref(activePointerId) !== null }])
|
|
16327
16514
|
}, [
|
|
16328
|
-
createElementVNode("div", _hoisted_1$
|
|
16515
|
+
createElementVNode("div", _hoisted_1$e, [
|
|
16329
16516
|
renderSlot(_ctx.$slots, "default", { contentStyle: contentStyle.value }, void 0, true)
|
|
16330
16517
|
], 512),
|
|
16331
16518
|
createVNode(ResizeHandle, {
|
|
@@ -16343,7 +16530,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
16343
16530
|
}
|
|
16344
16531
|
});
|
|
16345
16532
|
|
|
16346
|
-
const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16533
|
+
const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-46b33b01"]]);
|
|
16347
16534
|
|
|
16348
16535
|
const CLICK_META_KEY_TIMEOUT = 250;
|
|
16349
16536
|
const useMultiSelectListBoxSelection = ({
|
|
@@ -16635,17 +16822,17 @@ const useMultiSelectListBoxSelection = ({
|
|
|
16635
16822
|
};
|
|
16636
16823
|
};
|
|
16637
16824
|
|
|
16638
|
-
const _hoisted_1$
|
|
16639
|
-
const _hoisted_2$
|
|
16640
|
-
const _hoisted_3$
|
|
16825
|
+
const _hoisted_1$d = ["id", "tabindex", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-activedescendant", "aria-disabled", "onKeydown"];
|
|
16826
|
+
const _hoisted_2$6 = { class: "kds-multiselect-list-box-content-grid" };
|
|
16827
|
+
const _hoisted_3$6 = {
|
|
16641
16828
|
key: 0,
|
|
16642
16829
|
class: "kds-multiselect-sticky-bottom"
|
|
16643
16830
|
};
|
|
16644
|
-
const _hoisted_4$
|
|
16831
|
+
const _hoisted_4$5 = {
|
|
16645
16832
|
key: 0,
|
|
16646
16833
|
class: "kds-multiselect-empty"
|
|
16647
16834
|
};
|
|
16648
|
-
const _sfc_main$
|
|
16835
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
16649
16836
|
__name: "KdsMultiSelectListBox",
|
|
16650
16837
|
props: /* @__PURE__ */ mergeModels({
|
|
16651
16838
|
description: {},
|
|
@@ -16816,7 +17003,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16816
17003
|
}, {
|
|
16817
17004
|
default: withCtx(({ contentStyle }) => [
|
|
16818
17005
|
createElementVNode("div", {
|
|
16819
|
-
class:
|
|
17006
|
+
class: normalizeClass([
|
|
17007
|
+
"kds-multiselect-list-box",
|
|
17008
|
+
{ error: __props.error, disabled: effectiveDisabled.value }
|
|
17009
|
+
]),
|
|
16820
17010
|
style: normalizeStyle(contentStyle)
|
|
16821
17011
|
}, [
|
|
16822
17012
|
createElementVNode("div", mergeProps(unref(containerProps), {
|
|
@@ -16895,7 +17085,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16895
17085
|
onBlur: _cache[17] || (_cache[17] = //@ts-ignore
|
|
16896
17086
|
(...args) => unref(onBlur) && unref(onBlur)(...args))
|
|
16897
17087
|
}), [
|
|
16898
|
-
createElementVNode("div", _hoisted_2$
|
|
17088
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
16899
17089
|
createElementVNode("div", mergeProps({ class: "kds-multiselect-list-box-content" }, unref(wrapperProps)), [
|
|
16900
17090
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(virtualList), ({ data: item, index }) => {
|
|
16901
17091
|
return openBlock(), createBlock(unref(KdsListItem), {
|
|
@@ -16908,20 +17098,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16908
17098
|
label: item.text,
|
|
16909
17099
|
accessory: item.accessory,
|
|
16910
17100
|
missing: item.missing,
|
|
17101
|
+
special: item.special,
|
|
16911
17102
|
"data-option-index": index,
|
|
16912
17103
|
selected: unref(isCurrentValue)(item.id),
|
|
16913
17104
|
disabled: effectiveDisabled.value,
|
|
16914
17105
|
active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === index,
|
|
16915
|
-
"trailing-icon":
|
|
17106
|
+
"trailing-icon": unref(isCurrentValue)(item.id) ? "checkmark" : void 0,
|
|
16916
17107
|
onDblclick: [
|
|
16917
17108
|
withModifiers(($event) => handleDblClick(item.id, index), ["exact"]),
|
|
16918
17109
|
_cache[0] || (_cache[0] = withModifiers(($event) => handleShiftDblClick(), ["shift"]))
|
|
16919
17110
|
],
|
|
16920
17111
|
onClick: ($event) => unref(handleClick)($event, item.id, index)
|
|
16921
|
-
}, null, 8, ["id", "class", "label", "accessory", "missing", "data-option-index", "selected", "disabled", "active", "trailing-icon", "onDblclick", "onClick"]);
|
|
17112
|
+
}, null, 8, ["id", "class", "label", "accessory", "missing", "special", "data-option-index", "selected", "disabled", "active", "trailing-icon", "onDblclick", "onClick"]);
|
|
16922
17113
|
}), 128))
|
|
16923
17114
|
], 16),
|
|
16924
|
-
visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
17115
|
+
visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
|
|
16925
17116
|
createVNode(unref(KdsListItem), {
|
|
16926
17117
|
id: generateOptionId(visibleBottomValue.value.id),
|
|
16927
17118
|
label: visibleBottomValue.value.text,
|
|
@@ -16932,7 +17123,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16932
17123
|
disabled: effectiveDisabled.value,
|
|
16933
17124
|
active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === bottomIndex.value,
|
|
16934
17125
|
special: "",
|
|
16935
|
-
"trailing-icon":
|
|
17126
|
+
"trailing-icon": unref(isCurrentValue)(visibleBottomValue.value.id) ? "checkmark" : void 0,
|
|
16936
17127
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(handleClick)($event, visibleBottomValue.value.id, bottomIndex.value)),
|
|
16937
17128
|
onDblclick: [
|
|
16938
17129
|
_cache[2] || (_cache[2] = withModifiers(($event) => handleShiftDblClick(), ["shift"])),
|
|
@@ -16941,14 +17132,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16941
17132
|
}, null, 8, ["id", "label", "accessory", "missing", "data-option-index", "selected", "disabled", "active", "trailing-icon"])
|
|
16942
17133
|
])) : createCommentVNode("", true)
|
|
16943
17134
|
])
|
|
16944
|
-
], 16, _hoisted_1$
|
|
16945
|
-
visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
17135
|
+
], 16, _hoisted_1$d),
|
|
17136
|
+
visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
|
|
16946
17137
|
createVNode(KdsEmptyState, {
|
|
16947
17138
|
headline: __props.loading ? "Loading data…" : __props.emptyStateLabel,
|
|
16948
17139
|
"loading-spinner": __props.loading
|
|
16949
17140
|
}, null, 8, ["headline", "loading-spinner"])
|
|
16950
17141
|
])) : createCommentVNode("", true)
|
|
16951
|
-
],
|
|
17142
|
+
], 6)
|
|
16952
17143
|
]),
|
|
16953
17144
|
_: 2
|
|
16954
17145
|
}, 1032, ["height", "min-height"]))
|
|
@@ -16959,12 +17150,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16959
17150
|
}
|
|
16960
17151
|
});
|
|
16961
17152
|
|
|
16962
|
-
const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17153
|
+
const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-24af1af0"]]);
|
|
16963
17154
|
|
|
16964
|
-
const _hoisted_1$
|
|
16965
|
-
const _hoisted_2$
|
|
16966
|
-
const _hoisted_3$
|
|
16967
|
-
const _hoisted_4$
|
|
17155
|
+
const _hoisted_1$c = { class: "kds-list-column" };
|
|
17156
|
+
const _hoisted_2$5 = { class: "kds-list-header" };
|
|
17157
|
+
const _hoisted_3$5 = { class: "kds-list-label" };
|
|
17158
|
+
const _hoisted_4$4 = {
|
|
16968
17159
|
key: 0,
|
|
16969
17160
|
class: "kds-list-count"
|
|
16970
17161
|
};
|
|
@@ -16977,10 +17168,11 @@ const _hoisted_9 = {
|
|
|
16977
17168
|
class: "kds-list-count"
|
|
16978
17169
|
};
|
|
16979
17170
|
const UNKNOWN_VALUE_ID = "__unknown-value-option__";
|
|
16980
|
-
const _sfc_main$
|
|
17171
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
16981
17172
|
__name: "TwinListBody",
|
|
16982
17173
|
props: /* @__PURE__ */ mergeModels({
|
|
16983
17174
|
disabled: { type: Boolean, default: false },
|
|
17175
|
+
error: { type: Boolean, default: false },
|
|
16984
17176
|
possibleValues: {},
|
|
16985
17177
|
searchTerm: { default: "" },
|
|
16986
17178
|
excludeLabel: { default: "Exclude" },
|
|
@@ -16994,7 +17186,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
16994
17186
|
}),
|
|
16995
17187
|
emits: ["update:modelValue"],
|
|
16996
17188
|
setup(__props) {
|
|
16997
|
-
const props = createPropsRestProxy(__props, ["disabled", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
|
|
17189
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
|
|
16998
17190
|
const modelValue = useModel(__props, "modelValue");
|
|
16999
17191
|
const effectiveDisabled = computed(() => __props.disabled || __props.loading);
|
|
17000
17192
|
const leftSelected = ref([]);
|
|
@@ -17150,10 +17342,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17150
17342
|
class: "kds-twin-list-body",
|
|
17151
17343
|
style: normalizeStyle(contentStyle)
|
|
17152
17344
|
}, [
|
|
17153
|
-
createElementVNode("div", _hoisted_1$
|
|
17154
|
-
createElementVNode("div", _hoisted_2$
|
|
17155
|
-
createElementVNode("span", _hoisted_3$
|
|
17156
|
-
!__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
17345
|
+
createElementVNode("div", _hoisted_1$c, [
|
|
17346
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
17347
|
+
createElementVNode("span", _hoisted_3$5, toDisplayString(__props.excludeLabel), 1),
|
|
17348
|
+
!__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(leftOptions.value.length) + " of " + toDisplayString(excludedItems.value.length), 1)) : createCommentVNode("", true)
|
|
17157
17349
|
]),
|
|
17158
17350
|
createVNode(unref(KdsMultiSelectListBox), {
|
|
17159
17351
|
modelValue: leftSelected.value,
|
|
@@ -17162,6 +17354,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17162
17354
|
"possible-values": leftOptions.value,
|
|
17163
17355
|
ariaLabel: __props.excludeLabel,
|
|
17164
17356
|
disabled: effectiveDisabled.value,
|
|
17357
|
+
error: __props.error,
|
|
17165
17358
|
loading: __props.loading,
|
|
17166
17359
|
"empty-state-label": props.emptyStateLabel,
|
|
17167
17360
|
"bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === false ? unknownValueOption.value : void 0,
|
|
@@ -17169,10 +17362,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17169
17362
|
onDoubleClickShift: moveRight,
|
|
17170
17363
|
onKeyArrowRight: moveRight,
|
|
17171
17364
|
onKeyEnter: moveRight
|
|
17172
|
-
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
|
|
17365
|
+
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
|
|
17173
17366
|
]),
|
|
17174
17367
|
createElementVNode("div", _hoisted_5$1, [
|
|
17175
|
-
createVNode(unref(_sfc_main
|
|
17368
|
+
createVNode(unref(_sfc_main$11), {
|
|
17176
17369
|
"leading-icon": "chevron-right",
|
|
17177
17370
|
ariaLabel: "Move selected values right",
|
|
17178
17371
|
title: "Move selected values right",
|
|
@@ -17181,7 +17374,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17181
17374
|
disabled: effectiveDisabled.value || leftSelected.value.length === 0,
|
|
17182
17375
|
onClick: _cache[2] || (_cache[2] = ($event) => moveRight(leftSelected.value))
|
|
17183
17376
|
}, null, 8, ["disabled"]),
|
|
17184
|
-
createVNode(unref(_sfc_main
|
|
17377
|
+
createVNode(unref(_sfc_main$11), {
|
|
17185
17378
|
"leading-icon": "chevron-right-double",
|
|
17186
17379
|
ariaLabel: "Move all values right",
|
|
17187
17380
|
title: "Move all values right",
|
|
@@ -17193,7 +17386,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17193
17386
|
...showUnknownValues.value && !modelValue.value.includeUnknownValues ? [UNKNOWN_VALUE_ID] : []
|
|
17194
17387
|
]))
|
|
17195
17388
|
}, null, 8, ["disabled"]),
|
|
17196
|
-
createVNode(unref(_sfc_main
|
|
17389
|
+
createVNode(unref(_sfc_main$11), {
|
|
17197
17390
|
"leading-icon": "chevron-left",
|
|
17198
17391
|
ariaLabel: "Move selected values left",
|
|
17199
17392
|
title: "Move selected values left",
|
|
@@ -17202,7 +17395,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17202
17395
|
disabled: effectiveDisabled.value || rightSelected.value.length === 0,
|
|
17203
17396
|
onClick: _cache[4] || (_cache[4] = ($event) => moveLeft(rightSelected.value))
|
|
17204
17397
|
}, null, 8, ["disabled"]),
|
|
17205
|
-
createVNode(unref(_sfc_main
|
|
17398
|
+
createVNode(unref(_sfc_main$11), {
|
|
17206
17399
|
"leading-icon": "chevron-left-double",
|
|
17207
17400
|
ariaLabel: "Move all values left",
|
|
17208
17401
|
title: "Move all values left",
|
|
@@ -17227,6 +17420,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17227
17420
|
"possible-values": rightOptions.value,
|
|
17228
17421
|
ariaLabel: __props.includeLabel,
|
|
17229
17422
|
disabled: effectiveDisabled.value,
|
|
17423
|
+
error: __props.error,
|
|
17230
17424
|
loading: __props.loading,
|
|
17231
17425
|
"empty-state-label": props.emptyStateLabel,
|
|
17232
17426
|
"bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === true ? unknownValueOption.value : void 0,
|
|
@@ -17234,7 +17428,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17234
17428
|
onDoubleClickShift: moveLeft,
|
|
17235
17429
|
onKeyArrowLeft: moveLeft,
|
|
17236
17430
|
onKeyEnter: moveLeft
|
|
17237
|
-
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
|
|
17431
|
+
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
|
|
17238
17432
|
])
|
|
17239
17433
|
], 4)
|
|
17240
17434
|
]),
|
|
@@ -17244,7 +17438,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17244
17438
|
}
|
|
17245
17439
|
});
|
|
17246
17440
|
|
|
17247
|
-
const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17441
|
+
const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-8a9e1b15"]]);
|
|
17248
17442
|
|
|
17249
17443
|
const kdsTwinListSearchMode = {
|
|
17250
17444
|
MANUAL: "manual",
|
|
@@ -17253,7 +17447,7 @@ const kdsTwinListSearchMode = {
|
|
|
17253
17447
|
};
|
|
17254
17448
|
const kdsTwinListSearchModes = Object.values(kdsTwinListSearchMode);
|
|
17255
17449
|
|
|
17256
|
-
const _sfc_main$
|
|
17450
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
17257
17451
|
__name: "TwinListHeader",
|
|
17258
17452
|
props: /* @__PURE__ */ mergeModels({
|
|
17259
17453
|
filterTypes: { default: () => void 0 },
|
|
@@ -17329,7 +17523,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17329
17523
|
ariaLabel: "Search values",
|
|
17330
17524
|
placeholder: "Search",
|
|
17331
17525
|
disabled: __props.disabled
|
|
17332
|
-
}, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$
|
|
17526
|
+
}, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$r), {
|
|
17333
17527
|
key: 2,
|
|
17334
17528
|
modelValue: pattern.value,
|
|
17335
17529
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pattern.value = $event),
|
|
@@ -17343,7 +17537,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17343
17537
|
placeholder: "Pattern",
|
|
17344
17538
|
disabled: __props.disabled,
|
|
17345
17539
|
"onUpdate:regex": _cache[6] || (_cache[6] = ($event) => emit("update:regex", $event))
|
|
17346
|
-
}, null, 8, ["modelValue", "case-sensitive", "exclude-matches", "use-regex", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$
|
|
17540
|
+
}, null, 8, ["modelValue", "case-sensitive", "exclude-matches", "use-regex", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$j), {
|
|
17347
17541
|
key: 3,
|
|
17348
17542
|
modelValue: selectedTypes.value,
|
|
17349
17543
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => selectedTypes.value = $event),
|
|
@@ -17357,8 +17551,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17357
17551
|
}
|
|
17358
17552
|
});
|
|
17359
17553
|
|
|
17360
|
-
const _hoisted_1$
|
|
17361
|
-
const _sfc_main$
|
|
17554
|
+
const _hoisted_1$b = { class: "kds-twin-list" };
|
|
17555
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
17362
17556
|
__name: "KdsTwinList",
|
|
17363
17557
|
props: /* @__PURE__ */ mergeModels({
|
|
17364
17558
|
description: {},
|
|
@@ -17489,8 +17683,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17489
17683
|
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
17490
17684
|
}, {
|
|
17491
17685
|
default: withCtx(() => [
|
|
17492
|
-
createElementVNode("div", _hoisted_1$
|
|
17493
|
-
createVNode(_sfc_main$
|
|
17686
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
17687
|
+
createVNode(_sfc_main$e, {
|
|
17494
17688
|
mode: mode.value,
|
|
17495
17689
|
"onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
|
|
17496
17690
|
pattern: pattern.value,
|
|
@@ -17514,6 +17708,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17514
17708
|
modelValue: effectiveBodyModel.value,
|
|
17515
17709
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => effectiveBodyModel.value = $event),
|
|
17516
17710
|
disabled: __props.disabled || mode.value !== unref(kdsTwinListSearchMode).MANUAL,
|
|
17711
|
+
error: __props.error,
|
|
17517
17712
|
"possible-values": __props.possibleValues,
|
|
17518
17713
|
"search-term": searchTerm.value,
|
|
17519
17714
|
"exclude-label": props.excludeLabel,
|
|
@@ -17521,7 +17716,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17521
17716
|
"unknown-values-text": props.unknownValuesText,
|
|
17522
17717
|
"empty-state-label": props.emptyStateLabel,
|
|
17523
17718
|
loading: __props.loading
|
|
17524
|
-
}, null, 8, ["modelValue", "disabled", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
|
|
17719
|
+
}, null, 8, ["modelValue", "disabled", "error", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
|
|
17525
17720
|
])
|
|
17526
17721
|
]),
|
|
17527
17722
|
_: 1
|
|
@@ -17530,7 +17725,214 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17530
17725
|
}
|
|
17531
17726
|
});
|
|
17532
17727
|
|
|
17533
|
-
const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17728
|
+
const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-1a9327b5"]]);
|
|
17729
|
+
|
|
17730
|
+
const useSortableListBoxReorder = ({
|
|
17731
|
+
orderedIds,
|
|
17732
|
+
selection,
|
|
17733
|
+
disabled
|
|
17734
|
+
}) => {
|
|
17735
|
+
const selectedIndices = computed(() => {
|
|
17736
|
+
const selected = new Set(selection.value);
|
|
17737
|
+
return orderedIds.value.map((id, i) => ({ id, index: i })).filter((v) => selected.has(v.id)).map((v) => v.index);
|
|
17738
|
+
});
|
|
17739
|
+
const canMoveUp = computed(
|
|
17740
|
+
() => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[0] > 0
|
|
17741
|
+
);
|
|
17742
|
+
const canMoveDown = computed(
|
|
17743
|
+
() => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[selectedIndices.value.length - 1] < orderedIds.value.length - 1
|
|
17744
|
+
);
|
|
17745
|
+
const reorder = (direction) => {
|
|
17746
|
+
const ids = [...orderedIds.value];
|
|
17747
|
+
const indices = selectedIndices.value;
|
|
17748
|
+
if (indices.length === 0) {
|
|
17749
|
+
return ids;
|
|
17750
|
+
}
|
|
17751
|
+
const movingIds = indices.map((i) => ids[i]);
|
|
17752
|
+
const indexSet = new Set(indices);
|
|
17753
|
+
const remaining = ids.filter((_, i) => !indexSet.has(i));
|
|
17754
|
+
let insertAt;
|
|
17755
|
+
if (direction === "top") {
|
|
17756
|
+
insertAt = 0;
|
|
17757
|
+
} else if (direction === "bottom") {
|
|
17758
|
+
insertAt = remaining.length;
|
|
17759
|
+
} else if (direction === "up") {
|
|
17760
|
+
insertAt = Math.max(0, indices[0] - 1);
|
|
17761
|
+
} else {
|
|
17762
|
+
insertAt = Math.min(
|
|
17763
|
+
remaining.length,
|
|
17764
|
+
indices[indices.length - 1] - indices.length + 2
|
|
17765
|
+
);
|
|
17766
|
+
}
|
|
17767
|
+
remaining.splice(insertAt, 0, ...movingIds);
|
|
17768
|
+
return remaining;
|
|
17769
|
+
};
|
|
17770
|
+
const sortByText = (ascending, optionLookup) => {
|
|
17771
|
+
const sorted = [...orderedIds.value].sort((a, b) => {
|
|
17772
|
+
const textA = optionLookup.get(a)?.text ?? a;
|
|
17773
|
+
const textB = optionLookup.get(b)?.text ?? b;
|
|
17774
|
+
return ascending ? textA.localeCompare(textB) : textB.localeCompare(textA);
|
|
17775
|
+
});
|
|
17776
|
+
return sorted;
|
|
17777
|
+
};
|
|
17778
|
+
return {
|
|
17779
|
+
selectedIndices,
|
|
17780
|
+
canMoveUp,
|
|
17781
|
+
canMoveDown,
|
|
17782
|
+
reorder,
|
|
17783
|
+
sortByText
|
|
17784
|
+
};
|
|
17785
|
+
};
|
|
17786
|
+
|
|
17787
|
+
const _hoisted_1$a = { class: "kds-sortable-list-box-wrapper" };
|
|
17788
|
+
const _hoisted_2$4 = { class: "kds-sortable-top-buttons" };
|
|
17789
|
+
const _hoisted_3$4 = { class: "kds-sortable-top-buttons-left" };
|
|
17790
|
+
const _hoisted_4$3 = { class: "kds-sortable-footer-buttons" };
|
|
17791
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
17792
|
+
__name: "KdsSortableListBox",
|
|
17793
|
+
props: /* @__PURE__ */ mergeModels({
|
|
17794
|
+
possibleValues: {},
|
|
17795
|
+
disabled: { type: Boolean, default: false },
|
|
17796
|
+
description: {},
|
|
17797
|
+
label: {},
|
|
17798
|
+
ariaLabel: {},
|
|
17799
|
+
id: {},
|
|
17800
|
+
subText: {},
|
|
17801
|
+
error: { type: Boolean, default: false },
|
|
17802
|
+
validating: { type: Boolean, default: false },
|
|
17803
|
+
preserveSubTextSpace: { type: Boolean, default: false }
|
|
17804
|
+
}, {
|
|
17805
|
+
"modelValue": { required: true },
|
|
17806
|
+
"modelModifiers": {}
|
|
17807
|
+
}),
|
|
17808
|
+
emits: ["update:modelValue"],
|
|
17809
|
+
setup(__props, { expose: __expose }) {
|
|
17810
|
+
const formFieldProps = createPropsRestProxy(__props, ["possibleValues", "disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
17811
|
+
const modelValue = useModel(__props, "modelValue");
|
|
17812
|
+
const selection = ref([]);
|
|
17813
|
+
const optionLookup = computed(() => {
|
|
17814
|
+
const map = /* @__PURE__ */ new Map();
|
|
17815
|
+
for (const option of __props.possibleValues) {
|
|
17816
|
+
map.set(option.id, option);
|
|
17817
|
+
}
|
|
17818
|
+
return map;
|
|
17819
|
+
});
|
|
17820
|
+
const orderedOptions = computed(
|
|
17821
|
+
() => modelValue.value.map(
|
|
17822
|
+
(id) => optionLookup.value.get(id) ?? { id, text: id, missing: true }
|
|
17823
|
+
)
|
|
17824
|
+
);
|
|
17825
|
+
const listBoxRef = useTemplateRef("listBoxRef");
|
|
17826
|
+
const { canMoveUp, canMoveDown, reorder, sortByText } = useSortableListBoxReorder({
|
|
17827
|
+
orderedIds: modelValue,
|
|
17828
|
+
selection,
|
|
17829
|
+
disabled: toRef(() => __props.disabled)
|
|
17830
|
+
});
|
|
17831
|
+
const applyReorder = (newOrder) => {
|
|
17832
|
+
modelValue.value = newOrder;
|
|
17833
|
+
};
|
|
17834
|
+
const moveUp = () => canMoveUp.value && applyReorder(reorder("up"));
|
|
17835
|
+
const moveDown = () => canMoveDown.value && applyReorder(reorder("down"));
|
|
17836
|
+
const moveToTop = () => canMoveUp.value && applyReorder(reorder("top"));
|
|
17837
|
+
const moveToBottom = () => canMoveDown.value && applyReorder(reorder("bottom"));
|
|
17838
|
+
const resetOrder = () => applyReorder(__props.possibleValues.map((option) => option.id));
|
|
17839
|
+
const focus = () => listBoxRef.value?.focus();
|
|
17840
|
+
__expose({ focus });
|
|
17841
|
+
return (_ctx, _cache) => {
|
|
17842
|
+
return openBlock(), createBlock(BaseFieldsetWrapper, mergeProps(formFieldProps, {
|
|
17843
|
+
error: __props.error,
|
|
17844
|
+
validating: __props.validating,
|
|
17845
|
+
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
17846
|
+
}), {
|
|
17847
|
+
default: withCtx(() => [
|
|
17848
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
17849
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
17850
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
17851
|
+
createVNode(_sfc_main$11, {
|
|
17852
|
+
size: "small",
|
|
17853
|
+
variant: "transparent",
|
|
17854
|
+
"leading-icon": "sort-descending",
|
|
17855
|
+
label: "A – Z",
|
|
17856
|
+
disabled: __props.disabled,
|
|
17857
|
+
onClick: _cache[0] || (_cache[0] = ($event) => applyReorder(unref(sortByText)(true, optionLookup.value)))
|
|
17858
|
+
}, null, 8, ["disabled"]),
|
|
17859
|
+
createVNode(_sfc_main$11, {
|
|
17860
|
+
size: "small",
|
|
17861
|
+
variant: "transparent",
|
|
17862
|
+
"leading-icon": "sort-ascending",
|
|
17863
|
+
label: "Z – A",
|
|
17864
|
+
disabled: __props.disabled,
|
|
17865
|
+
onClick: _cache[1] || (_cache[1] = ($event) => applyReorder(unref(sortByText)(false, optionLookup.value)))
|
|
17866
|
+
}, null, 8, ["disabled"])
|
|
17867
|
+
]),
|
|
17868
|
+
createVNode(_sfc_main$11, {
|
|
17869
|
+
size: "small",
|
|
17870
|
+
variant: "transparent",
|
|
17871
|
+
destructive: "",
|
|
17872
|
+
label: "Reset all",
|
|
17873
|
+
disabled: __props.disabled,
|
|
17874
|
+
onClick: resetOrder
|
|
17875
|
+
}, null, 8, ["disabled"])
|
|
17876
|
+
]),
|
|
17877
|
+
createVNode(KdsMultiSelectListBox, {
|
|
17878
|
+
ref_key: "listBoxRef",
|
|
17879
|
+
ref: listBoxRef,
|
|
17880
|
+
modelValue: selection.value,
|
|
17881
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selection.value = $event),
|
|
17882
|
+
"possible-values": orderedOptions.value,
|
|
17883
|
+
disabled: __props.disabled,
|
|
17884
|
+
error: __props.error,
|
|
17885
|
+
"use-resize-handle": true,
|
|
17886
|
+
ariaLabel: formFieldProps.label ?? formFieldProps.ariaLabel ?? ""
|
|
17887
|
+
/* fallback only for TS */
|
|
17888
|
+
}, null, 8, ["modelValue", "possible-values", "disabled", "error", "ariaLabel"]),
|
|
17889
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
17890
|
+
createVNode(_sfc_main$11, {
|
|
17891
|
+
size: "small",
|
|
17892
|
+
variant: "transparent",
|
|
17893
|
+
"leading-icon": "to-top",
|
|
17894
|
+
label: "Top",
|
|
17895
|
+
title: "Move to top",
|
|
17896
|
+
disabled: __props.disabled || !unref(canMoveUp),
|
|
17897
|
+
onClick: moveToTop
|
|
17898
|
+
}, null, 8, ["disabled"]),
|
|
17899
|
+
createVNode(_sfc_main$11, {
|
|
17900
|
+
size: "small",
|
|
17901
|
+
variant: "transparent",
|
|
17902
|
+
"leading-icon": "to-bottom",
|
|
17903
|
+
label: "Bottom",
|
|
17904
|
+
title: "Move to bottom",
|
|
17905
|
+
disabled: __props.disabled || !unref(canMoveDown),
|
|
17906
|
+
onClick: moveToBottom
|
|
17907
|
+
}, null, 8, ["disabled"]),
|
|
17908
|
+
createVNode(_sfc_main$11, {
|
|
17909
|
+
size: "small",
|
|
17910
|
+
variant: "transparent",
|
|
17911
|
+
"leading-icon": "arrow-up",
|
|
17912
|
+
label: "Up",
|
|
17913
|
+
title: "Move up",
|
|
17914
|
+
disabled: __props.disabled || !unref(canMoveUp),
|
|
17915
|
+
onClick: moveUp
|
|
17916
|
+
}, null, 8, ["disabled"]),
|
|
17917
|
+
createVNode(_sfc_main$11, {
|
|
17918
|
+
size: "small",
|
|
17919
|
+
variant: "transparent",
|
|
17920
|
+
"leading-icon": "arrow-down",
|
|
17921
|
+
label: "Down",
|
|
17922
|
+
title: "Move down",
|
|
17923
|
+
disabled: __props.disabled || !unref(canMoveDown),
|
|
17924
|
+
onClick: moveDown
|
|
17925
|
+
}, null, 8, ["disabled"])
|
|
17926
|
+
])
|
|
17927
|
+
])
|
|
17928
|
+
]),
|
|
17929
|
+
_: 1
|
|
17930
|
+
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
17931
|
+
};
|
|
17932
|
+
}
|
|
17933
|
+
});
|
|
17934
|
+
|
|
17935
|
+
const KdsSortableListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-ee7b63e2"]]);
|
|
17534
17936
|
|
|
17535
17937
|
const _hoisted_1$9 = { class: "kds-info-popover-content" };
|
|
17536
17938
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
@@ -18344,7 +18746,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18344
18746
|
size: "medium"
|
|
18345
18747
|
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
18346
18748
|
createElementVNode("div", _hoisted_2$1, toDisplayString(__props.headline), 1),
|
|
18347
|
-
createVNode(_sfc_main
|
|
18749
|
+
createVNode(_sfc_main$11, {
|
|
18348
18750
|
"leading-icon": "x-close",
|
|
18349
18751
|
variant: "transparent",
|
|
18350
18752
|
size: "medium",
|
|
@@ -18617,7 +19019,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18617
19019
|
unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
18618
19020
|
createElementVNode("div", _hoisted_2, toDisplayString(unref(config).value.message), 1),
|
|
18619
19021
|
unref(config).value.doNotAskAgain ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
18620
|
-
createVNode(_sfc_main$
|
|
19022
|
+
createVNode(_sfc_main$L, {
|
|
18621
19023
|
modelValue: askAgain.value,
|
|
18622
19024
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => askAgain.value = $event),
|
|
18623
19025
|
label: unref(config).value.doNotAskAgain.label,
|
|
@@ -18632,7 +19034,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18632
19034
|
name: "footer",
|
|
18633
19035
|
fn: withCtx(() => [
|
|
18634
19036
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).value.buttons, (button, index) => {
|
|
18635
|
-
return openBlock(), createBlock(_sfc_main
|
|
19037
|
+
return openBlock(), createBlock(_sfc_main$11, {
|
|
18636
19038
|
key: index,
|
|
18637
19039
|
destructive: button.destructive,
|
|
18638
19040
|
autofocus: button.autofocus,
|
|
@@ -18664,5 +19066,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18664
19066
|
|
|
18665
19067
|
const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-41fc8d84"]]);
|
|
18666
19068
|
|
|
18667
|
-
export { KdsAvatar, KdsBadge, _sfc_main
|
|
19069
|
+
export { KdsAvatar, KdsBadge, _sfc_main$11 as KdsButton, KdsCardClickable, _sfc_main$L as KdsCheckbox, KdsCheckboxGroup, _sfc_main$y as KdsColorInput, KdsColorSwatch, KdsDataType, _sfc_main$u as KdsDateInput, _sfc_main$s as KdsDateTimeFormatInput, _sfc_main$m as KdsDropdown, KdsDynamicModalProvider, KdsEmptyState, KdsIcon, KdsInfoToggleButton, KdsInlineMessage, KdsLabel, KdsLink, _sfc_main$10 as KdsLinkButton, KdsLiveStatus, KdsLoadingSkeleton, KdsLoadingSpinner, _sfc_main$Q as KdsMenuButton, KdsModal, KdsModalLayout, _sfc_main$j as KdsMultiSelectDropdown, _sfc_main$C as KdsNumberInput, _sfc_main$x as KdsPasswordInput, _sfc_main$r as KdsPatternInput, KdsProgressButton, KdsRadioButton, KdsRadioButtonGroup, KdsSearchInput, KdsSortableListBox, KdsSplitButton, KdsSubText, KdsTabBar, KdsTextInput, KdsTextarea, _sfc_main$_ as KdsToggleButton, KdsTwinList, _sfc_main$w as KdsUsernameInput, KdsValueSwitch, KdsVariableToggleButton, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsInlineMessageVariant, kdsInlineMessageVariants, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
|
|
18668
19070
|
//# sourceMappingURL=index.js.map
|