@knime/kds-components 0.22.2 → 0.23.0
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 +189 -50
- package/dist/index.js +1495 -876
- package/dist/index.js.map +1 -1
- package/dist/src/accessories/ColorSwatch/KdsColorSwatch.vue.d.ts.map +1 -1
- package/dist/src/buttons/KdsMenuButton/KdsMenuButton.vue.d.ts +87 -2
- package/dist/src/buttons/KdsMenuButton/KdsMenuButton.vue.d.ts.map +1 -1
- package/dist/src/buttons/KdsMenuButton/types.d.ts +7 -0
- package/dist/src/buttons/KdsMenuButton/types.d.ts.map +1 -1
- package/dist/src/buttons/KdsSplitButton/KdsSplitButton.vue.d.ts +6 -6
- package/dist/src/buttons/KdsSplitButton/KdsSplitButton.vue.d.ts.map +1 -1
- package/dist/src/buttons/KdsSplitButton/types.d.ts +4 -4
- package/dist/src/buttons/KdsSplitButton/types.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/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/PanelButtonBar/KdsPanelButtonBar.vue.d.ts +10 -0
- package/dist/src/layouts/PanelButtonBar/KdsPanelButtonBar.vue.d.ts.map +1 -0
- package/dist/src/layouts/PanelButtonBar/index.d.ts +3 -0
- package/dist/src/layouts/PanelButtonBar/index.d.ts.map +1 -0
- package/dist/src/layouts/PanelButtonBar/types.d.ts +15 -0
- package/dist/src/layouts/PanelButtonBar/types.d.ts.map +1 -0
- package/dist/src/layouts/PanelHeader/KdsPanelHeader.vue.d.ts +8 -0
- package/dist/src/layouts/PanelHeader/KdsPanelHeader.vue.d.ts.map +1 -0
- package/dist/src/layouts/PanelHeader/index.d.ts +3 -0
- package/dist/src/layouts/PanelHeader/index.d.ts.map +1 -0
- package/dist/src/layouts/PanelHeader/types.d.ts +7 -0
- package/dist/src/layouts/PanelHeader/types.d.ts.map +1 -0
- package/dist/src/layouts/index.d.ts +4 -0
- package/dist/src/layouts/index.d.ts.map +1 -1
- package/dist/src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue.d.ts +336 -0
- package/dist/src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue.d.ts.map +1 -0
- package/dist/src/patterns/ResponsiveButtonGroup/enums.d.ts +7 -0
- package/dist/src/patterns/ResponsiveButtonGroup/enums.d.ts.map +1 -0
- package/dist/src/patterns/ResponsiveButtonGroup/index.d.ts +4 -0
- package/dist/src/patterns/ResponsiveButtonGroup/index.d.ts.map +1 -0
- package/dist/src/patterns/ResponsiveButtonGroup/types.d.ts +23 -0
- package/dist/src/patterns/ResponsiveButtonGroup/types.d.ts.map +1 -0
- package/dist/src/patterns/index.d.ts +3 -0
- package/dist/src/patterns/index.d.ts.map +1 -0
- 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$P = ["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$1d = /* @__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$P);
|
|
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$1d, [["__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$1c = /* @__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$1c, [["__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$O = ["title"];
|
|
487
|
+
const _sfc_main$1b = /* @__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$O);
|
|
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$1b, [["__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$N = { class: "label-wrapper" };
|
|
550
|
+
const _sfc_main$1a = /* @__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$N, 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$1a, [["__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$M = ["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$19 = /* @__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$M);
|
|
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$19, [["__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$L = ["title", "aria-label"];
|
|
805
|
+
const _hoisted_2$s = ["title"];
|
|
806
|
+
const _sfc_main$18 = /* @__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$L);
|
|
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$18, [["__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$K = ["data-style"];
|
|
858
|
+
const _sfc_main$17 = /* @__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$K);
|
|
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$17, [["__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$J = ["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$16 = /* @__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$J);
|
|
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$16, [["__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$I = {
|
|
915
961
|
key: 0,
|
|
916
962
|
class: "label"
|
|
917
963
|
};
|
|
918
|
-
const _sfc_main$
|
|
964
|
+
const _sfc_main$15 = /* @__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$I, 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$15, [["__scopeId", "data-v-a696a1ec"]]);
|
|
993
1039
|
|
|
994
|
-
const _sfc_main
|
|
1040
|
+
const _sfc_main$14 = /* @__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$13 = /* @__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$H = { 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$12 = /* @__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$H, 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$12, [["__scopeId", "data-v-65e776f1"]]);
|
|
1387
1433
|
|
|
1388
|
-
const _sfc_main$
|
|
1434
|
+
const _sfc_main$11 = /* @__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$G = ["data-visible"];
|
|
1471
|
+
const _hoisted_2$p = ["data-visible"];
|
|
1472
|
+
const _sfc_main$10 = /* @__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$G),
|
|
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$10, [["__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$F = { 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$$ = /* @__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$13 : _sfc_main$14
|
|
1542
1588
|
);
|
|
1543
1589
|
return (_ctx, _cache) => {
|
|
1544
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1590
|
+
return openBlock(), createElementBlock("div", _hoisted_1$F, [
|
|
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$$, [["__scopeId", "data-v-5da4d570"]]);
|
|
1565
1611
|
|
|
1566
|
-
const _sfc_main$
|
|
1612
|
+
const _sfc_main$_ = /* @__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$E = ["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$Z = /* @__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$_, {
|
|
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$E);
|
|
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$Z, [["__scopeId", "data-v-822789ec"]]);
|
|
1733
1779
|
|
|
1734
|
-
const _sfc_main$
|
|
1780
|
+
const _sfc_main$Y = { };
|
|
1735
1781
|
|
|
1736
|
-
const _hoisted_1$
|
|
1782
|
+
const _hoisted_1$D = { 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$D))
|
|
1740
1786
|
}
|
|
1741
|
-
const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$
|
|
1787
|
+
const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$Y, [['render',_sfc_render$8],['__scopeId',"data-v-3ee92695"]]);
|
|
1742
1788
|
|
|
1743
|
-
const _hoisted_1$
|
|
1744
|
-
const _hoisted_2$
|
|
1789
|
+
const _hoisted_1$C = { 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$X = /* @__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$C, [
|
|
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$X, [["__scopeId", "data-v-53382531"]]);
|
|
1779
1825
|
|
|
1780
|
-
const _hoisted_1$
|
|
1781
|
-
const _hoisted_2$
|
|
1826
|
+
const _hoisted_1$B = ["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$W = /* @__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$B);
|
|
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$W, [["__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$A = { class: "kds-menu-container" };
|
|
2113
|
+
const _sfc_main$V = /* @__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$A, [
|
|
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$V, [["__scopeId", "data-v-d87656d8"]]);
|
|
2109
2155
|
|
|
2110
|
-
const _hoisted_1$
|
|
2111
|
-
const _hoisted_2$
|
|
2156
|
+
const _hoisted_1$z = ["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$U = /* @__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$z);
|
|
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$U, [["__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$T = /* @__PURE__ */ defineComponent({
|
|
2174
2220
|
...{
|
|
2175
2221
|
inheritAttrs: false
|
|
2176
2222
|
},
|
|
@@ -2188,7 +2234,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2188
2234
|
menuMaxHeight: {}
|
|
2189
2235
|
},
|
|
2190
2236
|
emits: ["itemClick"],
|
|
2191
|
-
setup(__props, { emit: __emit }) {
|
|
2237
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2192
2238
|
const props = createPropsRestProxy(__props, ["variant", "menuMaxHeight"]);
|
|
2193
2239
|
const attrs = useAttrs();
|
|
2194
2240
|
const emit = __emit;
|
|
@@ -2202,23 +2248,26 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2202
2248
|
return { ...safeAttrs, ...rest, variant: __props.variant };
|
|
2203
2249
|
});
|
|
2204
2250
|
const isMenuOpen = ref(false);
|
|
2205
|
-
const popoverEl = useTemplateRef("
|
|
2206
|
-
const
|
|
2251
|
+
const popoverEl = useTemplateRef("popover");
|
|
2252
|
+
const menuContainerEl = useTemplateRef("menuContainer");
|
|
2253
|
+
const menuButtonEl = useTemplateRef("menuButton");
|
|
2207
2254
|
const menuId = useId();
|
|
2208
2255
|
watch(isMenuOpen, async (menuOpen) => {
|
|
2209
2256
|
if (!menuOpen) {
|
|
2210
2257
|
return;
|
|
2211
2258
|
}
|
|
2212
2259
|
await nextTick();
|
|
2213
|
-
|
|
2260
|
+
menuContainerEl.value?.focus();
|
|
2214
2261
|
});
|
|
2215
2262
|
const onItemClick = (itemId) => {
|
|
2216
2263
|
isMenuOpen.value = false;
|
|
2217
2264
|
emit("itemClick", itemId);
|
|
2218
2265
|
};
|
|
2266
|
+
__expose({ menuButtonEl });
|
|
2219
2267
|
return (_ctx, _cache) => {
|
|
2220
2268
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2221
|
-
createVNode(_sfc_main$
|
|
2269
|
+
createVNode(_sfc_main$11, mergeProps({
|
|
2270
|
+
ref: "menuButton",
|
|
2222
2271
|
modelValue: isMenuOpen.value,
|
|
2223
2272
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event)
|
|
2224
2273
|
}, toggleButtonProps.value, {
|
|
@@ -2228,8 +2277,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2228
2277
|
style: popoverEl.value?.anchorStyle
|
|
2229
2278
|
}), null, 16, ["modelValue", "aria-expanded", "aria-controls", "style"]),
|
|
2230
2279
|
createVNode(KdsPopover, {
|
|
2231
|
-
|
|
2232
|
-
ref: popoverEl,
|
|
2280
|
+
ref: "popover",
|
|
2233
2281
|
modelValue: isMenuOpen.value,
|
|
2234
2282
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isMenuOpen.value = $event),
|
|
2235
2283
|
placement: "bottom-left",
|
|
@@ -2238,8 +2286,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2238
2286
|
default: withCtx(() => [
|
|
2239
2287
|
createVNode(KdsMenuContainer, {
|
|
2240
2288
|
id: unref(menuId),
|
|
2241
|
-
|
|
2242
|
-
ref: menuContainer,
|
|
2289
|
+
ref: "menuContainer",
|
|
2243
2290
|
items: props.items,
|
|
2244
2291
|
"menu-max-height": __props.menuMaxHeight,
|
|
2245
2292
|
onItemClick
|
|
@@ -2252,7 +2299,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2252
2299
|
}
|
|
2253
2300
|
});
|
|
2254
2301
|
|
|
2255
|
-
const _sfc_main$
|
|
2302
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
2256
2303
|
__name: "KdsSplitButton",
|
|
2257
2304
|
props: {
|
|
2258
2305
|
size: { default: "medium" },
|
|
@@ -2263,12 +2310,12 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
2263
2310
|
leadingIcon: {},
|
|
2264
2311
|
trailingIcon: {},
|
|
2265
2312
|
ariaLabel: {},
|
|
2266
|
-
|
|
2313
|
+
items: {},
|
|
2267
2314
|
menuMaxHeight: {}
|
|
2268
2315
|
},
|
|
2269
|
-
emits: ["click", "
|
|
2316
|
+
emits: ["click", "itemClick"],
|
|
2270
2317
|
setup(__props, { emit: __emit }) {
|
|
2271
|
-
const props = createPropsRestProxy(__props, ["variant", "size", "
|
|
2318
|
+
const props = createPropsRestProxy(__props, ["variant", "size", "items", "menuMaxHeight"]);
|
|
2272
2319
|
const emit = __emit;
|
|
2273
2320
|
const isMenuOpen = ref(false);
|
|
2274
2321
|
const popoverEl = useTemplateRef("popoverEl");
|
|
@@ -2276,7 +2323,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
2276
2323
|
const menuId = useId();
|
|
2277
2324
|
function onItemClick(itemId) {
|
|
2278
2325
|
isMenuOpen.value = false;
|
|
2279
|
-
emit("
|
|
2326
|
+
emit("itemClick", itemId);
|
|
2280
2327
|
}
|
|
2281
2328
|
watch(isMenuOpen, (open) => {
|
|
2282
2329
|
if (open) {
|
|
@@ -2325,7 +2372,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
2325
2372
|
id: unref(menuId),
|
|
2326
2373
|
ref_key: "menuContainer",
|
|
2327
2374
|
ref: menuContainer,
|
|
2328
|
-
items: __props.
|
|
2375
|
+
items: __props.items,
|
|
2329
2376
|
"menu-max-height": __props.menuMaxHeight,
|
|
2330
2377
|
"aria-label": "Actions",
|
|
2331
2378
|
onItemClick,
|
|
@@ -2339,7 +2386,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
2339
2386
|
}
|
|
2340
2387
|
});
|
|
2341
2388
|
|
|
2342
|
-
const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2389
|
+
const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$S, [["__scopeId", "data-v-f72917bd"]]);
|
|
2343
2390
|
|
|
2344
2391
|
const kdsButtonSize = {
|
|
2345
2392
|
XSMALL: "xsmall",
|
|
@@ -2355,9 +2402,9 @@ const kdsButtonVariant = {
|
|
|
2355
2402
|
};
|
|
2356
2403
|
const kdsButtonVariants = Object.values(kdsButtonVariant);
|
|
2357
2404
|
|
|
2358
|
-
const _hoisted_1$
|
|
2359
|
-
const _hoisted_2$
|
|
2360
|
-
const _sfc_main$
|
|
2405
|
+
const _hoisted_1$y = { class: "kds-label-wrapper" };
|
|
2406
|
+
const _hoisted_2$j = ["id", "for", "title"];
|
|
2407
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
2361
2408
|
__name: "KdsLabel",
|
|
2362
2409
|
props: {
|
|
2363
2410
|
label: {},
|
|
@@ -2374,7 +2421,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2374
2421
|
const labelEl = useTemplateRef("labelEl");
|
|
2375
2422
|
const { isTruncated } = useKdsIsTruncated(labelEl);
|
|
2376
2423
|
return (_ctx, _cache) => {
|
|
2377
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2424
|
+
return openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
2378
2425
|
createElementVNode("label", {
|
|
2379
2426
|
id: props.id,
|
|
2380
2427
|
ref_key: "labelEl",
|
|
@@ -2382,7 +2429,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2382
2429
|
for: props.for,
|
|
2383
2430
|
class: "label",
|
|
2384
2431
|
title: unref(isTruncated) ? props.label : void 0
|
|
2385
|
-
}, toDisplayString(props.label), 9, _hoisted_2$
|
|
2432
|
+
}, toDisplayString(props.label), 9, _hoisted_2$j),
|
|
2386
2433
|
props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
|
|
2387
2434
|
key: 0,
|
|
2388
2435
|
content: props.description,
|
|
@@ -2393,11 +2440,11 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2393
2440
|
}
|
|
2394
2441
|
});
|
|
2395
2442
|
|
|
2396
|
-
const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2443
|
+
const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$R, [["__scopeId", "data-v-13bea091"]]);
|
|
2397
2444
|
|
|
2398
|
-
const _hoisted_1$
|
|
2399
|
-
const _hoisted_2$
|
|
2400
|
-
const _sfc_main$
|
|
2445
|
+
const _hoisted_1$x = ["id"];
|
|
2446
|
+
const _hoisted_2$i = { class: "subtext-text" };
|
|
2447
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
2401
2448
|
__name: "KdsSubText",
|
|
2402
2449
|
props: {
|
|
2403
2450
|
id: {},
|
|
@@ -2428,27 +2475,27 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
2428
2475
|
variant: "onSurface",
|
|
2429
2476
|
"aria-hidden": "true"
|
|
2430
2477
|
})) : createCommentVNode("", true),
|
|
2431
|
-
createElementVNode("span", _hoisted_2$
|
|
2432
|
-
], 10, _hoisted_1$
|
|
2478
|
+
createElementVNode("span", _hoisted_2$i, toDisplayString(props.subText), 1)
|
|
2479
|
+
], 10, _hoisted_1$x)) : createCommentVNode("", true);
|
|
2433
2480
|
};
|
|
2434
2481
|
}
|
|
2435
2482
|
});
|
|
2436
2483
|
|
|
2437
|
-
const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2484
|
+
const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$Q, [["__scopeId", "data-v-2e6ba10c"]]);
|
|
2438
2485
|
|
|
2439
|
-
const _hoisted_1$
|
|
2440
|
-
const _hoisted_2$
|
|
2441
|
-
const _hoisted_3$
|
|
2486
|
+
const _hoisted_1$w = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
|
|
2487
|
+
const _hoisted_2$h = { class: "control" };
|
|
2488
|
+
const _hoisted_3$e = {
|
|
2442
2489
|
key: 0,
|
|
2443
2490
|
class: "content"
|
|
2444
2491
|
};
|
|
2445
|
-
const _hoisted_4$
|
|
2492
|
+
const _hoisted_4$b = { class: "label" };
|
|
2446
2493
|
const _hoisted_5$6 = ["id"];
|
|
2447
2494
|
const _hoisted_6$4 = {
|
|
2448
2495
|
key: 0,
|
|
2449
2496
|
class: "subtext-wrapper"
|
|
2450
2497
|
};
|
|
2451
|
-
const _sfc_main$
|
|
2498
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
2452
2499
|
__name: "BaseCheckbox",
|
|
2453
2500
|
props: /* @__PURE__ */ mergeModels({
|
|
2454
2501
|
disabled: { type: Boolean, default: false },
|
|
@@ -2521,7 +2568,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2521
2568
|
role: "checkbox",
|
|
2522
2569
|
onClick: handleClick
|
|
2523
2570
|
}, [
|
|
2524
|
-
createElementVNode("div", _hoisted_2$
|
|
2571
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
2525
2572
|
icon.value ? (openBlock(), createBlock(KdsIcon, {
|
|
2526
2573
|
key: 0,
|
|
2527
2574
|
name: icon.value,
|
|
@@ -2529,15 +2576,15 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2529
2576
|
size: "xsmall"
|
|
2530
2577
|
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
2531
2578
|
]),
|
|
2532
|
-
props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2533
|
-
createElementVNode("div", _hoisted_4$
|
|
2579
|
+
props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$e, [
|
|
2580
|
+
createElementVNode("div", _hoisted_4$b, toDisplayString(props.label), 1),
|
|
2534
2581
|
props.helperText ? (openBlock(), createElementBlock("div", {
|
|
2535
2582
|
key: 0,
|
|
2536
2583
|
id: unref(helperId),
|
|
2537
2584
|
class: "helper-text"
|
|
2538
2585
|
}, toDisplayString(props.helperText), 9, _hoisted_5$6)) : createCommentVNode("", true)
|
|
2539
2586
|
])) : createCommentVNode("", true)
|
|
2540
|
-
], 10, _hoisted_1$
|
|
2587
|
+
], 10, _hoisted_1$w),
|
|
2541
2588
|
props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
|
|
2542
2589
|
createVNode(KdsSubText, {
|
|
2543
2590
|
id: unref(descriptionId),
|
|
@@ -2551,9 +2598,9 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
2551
2598
|
}
|
|
2552
2599
|
});
|
|
2553
2600
|
|
|
2554
|
-
const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2601
|
+
const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["__scopeId", "data-v-7bfc5667"]]);
|
|
2555
2602
|
|
|
2556
|
-
const _sfc_main$
|
|
2603
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
2557
2604
|
__name: "KdsCheckbox",
|
|
2558
2605
|
props: /* @__PURE__ */ mergeModels({
|
|
2559
2606
|
disabled: { type: Boolean, default: false },
|
|
@@ -2583,11 +2630,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
2583
2630
|
}
|
|
2584
2631
|
});
|
|
2585
2632
|
|
|
2586
|
-
const _hoisted_1$
|
|
2587
|
-
const _hoisted_2$
|
|
2588
|
-
const _hoisted_3$
|
|
2589
|
-
const _hoisted_4$
|
|
2590
|
-
const _sfc_main$
|
|
2633
|
+
const _hoisted_1$v = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby"];
|
|
2634
|
+
const _hoisted_2$g = ["id"];
|
|
2635
|
+
const _hoisted_3$d = ["title"];
|
|
2636
|
+
const _hoisted_4$a = { class: "kds-fieldset-content" };
|
|
2637
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
2591
2638
|
__name: "BaseFieldsetWrapper",
|
|
2592
2639
|
props: {
|
|
2593
2640
|
id: {},
|
|
@@ -2633,14 +2680,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
2633
2680
|
ref: legendTextEl,
|
|
2634
2681
|
class: "legend-text",
|
|
2635
2682
|
title: unref(isTruncated) ? props.label : void 0
|
|
2636
|
-
}, toDisplayString(props.label), 9, _hoisted_3$
|
|
2683
|
+
}, toDisplayString(props.label), 9, _hoisted_3$d),
|
|
2637
2684
|
props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
|
|
2638
2685
|
key: 0,
|
|
2639
2686
|
content: props.description,
|
|
2640
2687
|
hidden: !isHovered.value
|
|
2641
2688
|
}, null, 8, ["content", "hidden"])) : createCommentVNode("", true)
|
|
2642
|
-
], 8, _hoisted_2$
|
|
2643
|
-
createElementVNode("div", _hoisted_4$
|
|
2689
|
+
], 8, _hoisted_2$g)) : createCommentVNode("", true),
|
|
2690
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
2644
2691
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2645
2692
|
]),
|
|
2646
2693
|
createVNode(KdsSubText, {
|
|
@@ -2650,14 +2697,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
2650
2697
|
validating: props.validating,
|
|
2651
2698
|
"preserve-sub-text-space": props.preserveSubTextSpace
|
|
2652
2699
|
}, null, 8, ["id", "sub-text", "error", "validating", "preserve-sub-text-space"])
|
|
2653
|
-
], 40, _hoisted_1$
|
|
2700
|
+
], 40, _hoisted_1$v);
|
|
2654
2701
|
};
|
|
2655
2702
|
}
|
|
2656
2703
|
});
|
|
2657
2704
|
|
|
2658
|
-
const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2705
|
+
const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$N, [["__scopeId", "data-v-a44731da"]]);
|
|
2659
2706
|
|
|
2660
|
-
const _sfc_main$
|
|
2707
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
2661
2708
|
__name: "KdsCheckboxGroup",
|
|
2662
2709
|
props: /* @__PURE__ */ mergeModels({
|
|
2663
2710
|
id: {},
|
|
@@ -2736,7 +2783,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
2736
2783
|
}
|
|
2737
2784
|
});
|
|
2738
2785
|
|
|
2739
|
-
const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2786
|
+
const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$M, [["__scopeId", "data-v-c6536296"]]);
|
|
2740
2787
|
|
|
2741
2788
|
const kdsCheckboxGroupAlignment = {
|
|
2742
2789
|
VERTICAL: "vertical",
|
|
@@ -2752,19 +2799,19 @@ const kdsCheckboxValue = {
|
|
|
2752
2799
|
};
|
|
2753
2800
|
const kdsCheckboxValues = Object.values(kdsCheckboxValue);
|
|
2754
2801
|
|
|
2755
|
-
const _hoisted_1$
|
|
2756
|
-
const _hoisted_2$
|
|
2757
|
-
const _hoisted_3$
|
|
2802
|
+
const _hoisted_1$u = ["aria-checked", "aria-describedby", "aria-invalid", "disabled"];
|
|
2803
|
+
const _hoisted_2$f = { class: "control" };
|
|
2804
|
+
const _hoisted_3$c = {
|
|
2758
2805
|
key: 0,
|
|
2759
2806
|
class: "dot",
|
|
2760
2807
|
viewBox: "0 0 2 2",
|
|
2761
2808
|
"aria-hidden": "true",
|
|
2762
2809
|
focusable: "false"
|
|
2763
2810
|
};
|
|
2764
|
-
const _hoisted_4$
|
|
2811
|
+
const _hoisted_4$9 = { class: "content" };
|
|
2765
2812
|
const _hoisted_5$5 = { class: "label" };
|
|
2766
2813
|
const _hoisted_6$3 = ["id"];
|
|
2767
|
-
const _sfc_main$
|
|
2814
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
2768
2815
|
__name: "KdsRadioButton",
|
|
2769
2816
|
props: /* @__PURE__ */ mergeModels({
|
|
2770
2817
|
text: {},
|
|
@@ -2804,8 +2851,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2804
2851
|
type: "button",
|
|
2805
2852
|
onClick: handleClick
|
|
2806
2853
|
}, [
|
|
2807
|
-
createElementVNode("div", _hoisted_2$
|
|
2808
|
-
modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$
|
|
2854
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
2855
|
+
modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$c, [..._cache[0] || (_cache[0] = [
|
|
2809
2856
|
createElementVNode("circle", {
|
|
2810
2857
|
cx: "1",
|
|
2811
2858
|
cy: "1",
|
|
@@ -2813,7 +2860,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2813
2860
|
}, null, -1)
|
|
2814
2861
|
])])) : createCommentVNode("", true)
|
|
2815
2862
|
]),
|
|
2816
|
-
createElementVNode("div", _hoisted_4$
|
|
2863
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
2817
2864
|
createElementVNode("div", _hoisted_5$5, toDisplayString(props.text), 1),
|
|
2818
2865
|
props.helperText ? (openBlock(), createElementBlock("div", {
|
|
2819
2866
|
key: 0,
|
|
@@ -2821,12 +2868,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2821
2868
|
class: "helper-text"
|
|
2822
2869
|
}, toDisplayString(props.helperText), 9, _hoisted_6$3)) : createCommentVNode("", true)
|
|
2823
2870
|
])
|
|
2824
|
-
], 10, _hoisted_1$
|
|
2871
|
+
], 10, _hoisted_1$u);
|
|
2825
2872
|
};
|
|
2826
2873
|
}
|
|
2827
2874
|
});
|
|
2828
2875
|
|
|
2829
|
-
const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2876
|
+
const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$L, [["__scopeId", "data-v-f4f6392a"]]);
|
|
2830
2877
|
|
|
2831
2878
|
const useRadioSelection = ({
|
|
2832
2879
|
selectedId,
|
|
@@ -2948,7 +2995,7 @@ const useRadioSelection = ({
|
|
|
2948
2995
|
};
|
|
2949
2996
|
};
|
|
2950
2997
|
|
|
2951
|
-
const _sfc_main$
|
|
2998
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
2952
2999
|
__name: "KdsRadioButtonGroup",
|
|
2953
3000
|
props: /* @__PURE__ */ mergeModels({
|
|
2954
3001
|
id: {},
|
|
@@ -3023,10 +3070,10 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
3023
3070
|
}
|
|
3024
3071
|
});
|
|
3025
3072
|
|
|
3026
|
-
const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3073
|
+
const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$K, [["__scopeId", "data-v-d78ed4a2"]]);
|
|
3027
3074
|
|
|
3028
|
-
const _hoisted_1$
|
|
3029
|
-
const _sfc_main$
|
|
3075
|
+
const _hoisted_1$t = ["aria-checked", "aria-label", "disabled", "tabindex", "title"];
|
|
3076
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
3030
3077
|
__name: "ValueSwitchItem",
|
|
3031
3078
|
props: {
|
|
3032
3079
|
selected: { type: Boolean },
|
|
@@ -3076,12 +3123,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
3076
3123
|
name: props.trailingIcon,
|
|
3077
3124
|
size: __props.size
|
|
3078
3125
|
}, null, 8, ["name", "size"])) : createCommentVNode("", true)
|
|
3079
|
-
], 10, _hoisted_1$
|
|
3126
|
+
], 10, _hoisted_1$t);
|
|
3080
3127
|
};
|
|
3081
3128
|
}
|
|
3082
3129
|
});
|
|
3083
3130
|
|
|
3084
|
-
const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3131
|
+
const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$J, [["__scopeId", "data-v-5c6f0f1f"]]);
|
|
3085
3132
|
|
|
3086
3133
|
const useValueSwitchIconHiding = ({
|
|
3087
3134
|
width,
|
|
@@ -3132,7 +3179,7 @@ const useValueSwitchIconHiding = ({
|
|
|
3132
3179
|
};
|
|
3133
3180
|
};
|
|
3134
3181
|
|
|
3135
|
-
const _sfc_main$
|
|
3182
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
3136
3183
|
__name: "KdsValueSwitch",
|
|
3137
3184
|
props: /* @__PURE__ */ mergeModels({
|
|
3138
3185
|
id: {},
|
|
@@ -3219,7 +3266,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
3219
3266
|
}
|
|
3220
3267
|
});
|
|
3221
3268
|
|
|
3222
|
-
const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3269
|
+
const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$I, [["__scopeId", "data-v-640271e0"]]);
|
|
3223
3270
|
|
|
3224
3271
|
const kdsRadioButtonGroupAlignment = {
|
|
3225
3272
|
VERTICAL: "vertical",
|
|
@@ -3239,7 +3286,7 @@ const kdsValueSwitchVariant = {
|
|
|
3239
3286
|
};
|
|
3240
3287
|
const kdsValueSwitchVariants = Object.values(kdsValueSwitchVariant);
|
|
3241
3288
|
|
|
3242
|
-
const _sfc_main$
|
|
3289
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
3243
3290
|
__name: "BaseFormFieldWrapper",
|
|
3244
3291
|
props: {
|
|
3245
3292
|
id: {},
|
|
@@ -3291,18 +3338,18 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3291
3338
|
}
|
|
3292
3339
|
});
|
|
3293
3340
|
|
|
3294
|
-
const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3341
|
+
const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-5d99c134"]]);
|
|
3295
3342
|
|
|
3296
|
-
const _hoisted_1$
|
|
3343
|
+
const _hoisted_1$s = {
|
|
3297
3344
|
key: 0,
|
|
3298
3345
|
class: "icon-wrapper leading"
|
|
3299
3346
|
};
|
|
3300
|
-
const _hoisted_2$
|
|
3347
|
+
const _hoisted_2$e = {
|
|
3301
3348
|
key: 1,
|
|
3302
3349
|
class: "leading-slot"
|
|
3303
3350
|
};
|
|
3304
|
-
const _hoisted_3$
|
|
3305
|
-
const _hoisted_4$
|
|
3351
|
+
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"];
|
|
3352
|
+
const _hoisted_4$8 = ["aria-disabled"];
|
|
3306
3353
|
const _hoisted_5$4 = {
|
|
3307
3354
|
key: 4,
|
|
3308
3355
|
class: "trailing-slot"
|
|
@@ -3311,7 +3358,7 @@ const _hoisted_6$2 = {
|
|
|
3311
3358
|
key: 5,
|
|
3312
3359
|
class: "icon-wrapper trailing"
|
|
3313
3360
|
};
|
|
3314
|
-
const _sfc_main$
|
|
3361
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
3315
3362
|
__name: "BaseInput",
|
|
3316
3363
|
props: /* @__PURE__ */ mergeModels({
|
|
3317
3364
|
id: {},
|
|
@@ -3390,13 +3437,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3390
3437
|
}),
|
|
3391
3438
|
onClick: handleContainerClick
|
|
3392
3439
|
}, [
|
|
3393
|
-
props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3440
|
+
props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
3394
3441
|
props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
|
|
3395
3442
|
key: 0,
|
|
3396
3443
|
name: props.leadingIcon
|
|
3397
3444
|
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
3398
3445
|
])) : createCommentVNode("", true),
|
|
3399
|
-
_ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3446
|
+
_ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
|
|
3400
3447
|
renderSlot(_ctx.$slots, "leading", {}, void 0, true)
|
|
3401
3448
|
])) : createCommentVNode("", true),
|
|
3402
3449
|
createElementVNode("input", {
|
|
@@ -3432,7 +3479,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3432
3479
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event)),
|
|
3433
3480
|
onKeydown: _cache[2] || (_cache[2] = ($event) => emit("keydown", $event)),
|
|
3434
3481
|
onClick: _cache[3] || (_cache[3] = ($event) => emit("click", $event))
|
|
3435
|
-
}, null, 42, _hoisted_3$
|
|
3482
|
+
}, null, 42, _hoisted_3$b),
|
|
3436
3483
|
props.unit ? (openBlock(), createElementBlock("span", {
|
|
3437
3484
|
key: 2,
|
|
3438
3485
|
class: normalizeClass({
|
|
@@ -3441,8 +3488,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3441
3488
|
disabled: __props.disabled
|
|
3442
3489
|
}),
|
|
3443
3490
|
"aria-disabled": __props.disabled || void 0
|
|
3444
|
-
}, toDisplayString(props.unit), 11, _hoisted_4$
|
|
3445
|
-
__props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main
|
|
3491
|
+
}, toDisplayString(props.unit), 11, _hoisted_4$8)) : createCommentVNode("", true),
|
|
3492
|
+
__props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$14, {
|
|
3446
3493
|
key: 3,
|
|
3447
3494
|
class: "clear-button",
|
|
3448
3495
|
type: "button",
|
|
@@ -3466,7 +3513,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3466
3513
|
}
|
|
3467
3514
|
});
|
|
3468
3515
|
|
|
3469
|
-
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3516
|
+
const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__scopeId", "data-v-92291903"]]);
|
|
3470
3517
|
|
|
3471
3518
|
const usePointerHandler = (updateFromEvent) => {
|
|
3472
3519
|
const activePointerId = ref(null);
|
|
@@ -3506,8 +3553,141 @@ const usePointerHandler = (updateFromEvent) => {
|
|
|
3506
3553
|
};
|
|
3507
3554
|
};
|
|
3508
3555
|
|
|
3509
|
-
const
|
|
3510
|
-
|
|
3556
|
+
const additionalGroupSeparators = [" ", " ", " "];
|
|
3557
|
+
const decimalSeparatorSample = 1.1;
|
|
3558
|
+
const groupSeparatorSample = 1000.1;
|
|
3559
|
+
const countFractionDigits = (value) => {
|
|
3560
|
+
if (!Number.isFinite(value)) {
|
|
3561
|
+
return 0;
|
|
3562
|
+
}
|
|
3563
|
+
const exp = value.toExponential();
|
|
3564
|
+
const match = /^[-+]?(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(exp);
|
|
3565
|
+
if (!match) {
|
|
3566
|
+
return 0;
|
|
3567
|
+
}
|
|
3568
|
+
const fractionDigitsInMantissa = match[2]?.length ?? 0;
|
|
3569
|
+
const exponent = Number.parseInt(match[3], 10);
|
|
3570
|
+
if (exponent >= 0) {
|
|
3571
|
+
return Math.max(0, fractionDigitsInMantissa - exponent);
|
|
3572
|
+
}
|
|
3573
|
+
return fractionDigitsInMantissa + Math.abs(exponent);
|
|
3574
|
+
};
|
|
3575
|
+
const createKdsNumberParser = (params) => {
|
|
3576
|
+
const formatter = new Intl.NumberFormat(params.locale);
|
|
3577
|
+
const decimalSeparator = formatter.formatToParts(decimalSeparatorSample).find((part) => part.type === "decimal")?.value ?? ".";
|
|
3578
|
+
const groupSeparator = formatter.formatToParts(groupSeparatorSample).find((part) => part.type === "group")?.value ?? ",";
|
|
3579
|
+
const removeGroupingSeparators = (input) => [groupSeparator, ...additionalGroupSeparators].reduce(
|
|
3580
|
+
(acc, groupSep) => groupSep.length > 0 ? acc.split(groupSep).join("") : acc,
|
|
3581
|
+
input
|
|
3582
|
+
);
|
|
3583
|
+
const formattersByMaxDecimals = /* @__PURE__ */ new Map();
|
|
3584
|
+
const getFormatterForMaxDecimals = (maxDecimals) => {
|
|
3585
|
+
const cached = formattersByMaxDecimals.get(maxDecimals);
|
|
3586
|
+
if (cached) {
|
|
3587
|
+
return cached;
|
|
3588
|
+
}
|
|
3589
|
+
const created = new Intl.NumberFormat(params.locale, {
|
|
3590
|
+
useGrouping: false,
|
|
3591
|
+
minimumFractionDigits: 0,
|
|
3592
|
+
maximumFractionDigits: maxDecimals
|
|
3593
|
+
});
|
|
3594
|
+
formattersByMaxDecimals.set(maxDecimals, created);
|
|
3595
|
+
return created;
|
|
3596
|
+
};
|
|
3597
|
+
const stepFractionDigits = countFractionDigits(params.step);
|
|
3598
|
+
const precisionFactor = Number(`1e${stepFractionDigits}`);
|
|
3599
|
+
const formatForDisplay = (value) => {
|
|
3600
|
+
if (!Number.isFinite(value)) {
|
|
3601
|
+
return "";
|
|
3602
|
+
}
|
|
3603
|
+
const valueDecimals = countFractionDigits(value);
|
|
3604
|
+
const maxDecimals = Math.max(stepFractionDigits, valueDecimals);
|
|
3605
|
+
return getFormatterForMaxDecimals(maxDecimals).format(value);
|
|
3606
|
+
};
|
|
3607
|
+
const roundToStep = (value) => {
|
|
3608
|
+
if (!Number.isFinite(value)) {
|
|
3609
|
+
return Number.NaN;
|
|
3610
|
+
}
|
|
3611
|
+
const step = params.step;
|
|
3612
|
+
if (!Number.isFinite(step) || step <= 0) {
|
|
3613
|
+
return value;
|
|
3614
|
+
}
|
|
3615
|
+
if (!Number.isFinite(precisionFactor) || precisionFactor <= 0) {
|
|
3616
|
+
return value;
|
|
3617
|
+
}
|
|
3618
|
+
const scaledNext = Math.round(value * precisionFactor);
|
|
3619
|
+
const scaledStep = Math.round(step * precisionFactor);
|
|
3620
|
+
if (scaledStep === 0) {
|
|
3621
|
+
return value;
|
|
3622
|
+
}
|
|
3623
|
+
const roundedScaled = Math.round(scaledNext / scaledStep) * scaledStep;
|
|
3624
|
+
return roundedScaled / precisionFactor;
|
|
3625
|
+
};
|
|
3626
|
+
const isValidNormalizedNumber = (normalized) => (
|
|
3627
|
+
// Accept plain decimals as well as scientific notation.
|
|
3628
|
+
// Note: whitespace is removed earlier; we don't accept grouping separators here.
|
|
3629
|
+
/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(normalized)
|
|
3630
|
+
);
|
|
3631
|
+
const parseWithLocaleDecimal = (input, localeDecimal) => {
|
|
3632
|
+
const withoutGrouping = removeGroupingSeparators(input);
|
|
3633
|
+
const normalized = withoutGrouping.split(localeDecimal).join(".");
|
|
3634
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3635
|
+
return Number.NaN;
|
|
3636
|
+
}
|
|
3637
|
+
const parsed = Number.parseFloat(normalized);
|
|
3638
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3639
|
+
};
|
|
3640
|
+
const parseWithFallbackDot = (input) => {
|
|
3641
|
+
const lastDotIndex = input.lastIndexOf(".");
|
|
3642
|
+
const digitsAfterDot = input.slice(lastDotIndex + 1);
|
|
3643
|
+
const looksLikeDecimal = digitsAfterDot.length > 0 && digitsAfterDot.length <= 2;
|
|
3644
|
+
const normalized = looksLikeDecimal ? `${removeGroupingSeparators(input.slice(0, lastDotIndex))}.${removeGroupingSeparators(
|
|
3645
|
+
digitsAfterDot
|
|
3646
|
+
)}` : removeGroupingSeparators(input);
|
|
3647
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3648
|
+
return Number.NaN;
|
|
3649
|
+
}
|
|
3650
|
+
const parsed = Number.parseFloat(normalized);
|
|
3651
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3652
|
+
};
|
|
3653
|
+
const parseWithoutLocaleDecimal = (input) => {
|
|
3654
|
+
const normalized = removeGroupingSeparators(input);
|
|
3655
|
+
if (!isValidNormalizedNumber(normalized)) {
|
|
3656
|
+
return Number.NaN;
|
|
3657
|
+
}
|
|
3658
|
+
const parsed = Number.parseFloat(normalized);
|
|
3659
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
3660
|
+
};
|
|
3661
|
+
function parseFromInput(value) {
|
|
3662
|
+
const trimmed = value.trim();
|
|
3663
|
+
if (trimmed.length === 0) {
|
|
3664
|
+
return Number.NaN;
|
|
3665
|
+
}
|
|
3666
|
+
const localeDecimal = decimalSeparator;
|
|
3667
|
+
const hasLocaleDecimal = localeDecimal.length > 0 && trimmed.includes(localeDecimal);
|
|
3668
|
+
if (hasLocaleDecimal) {
|
|
3669
|
+
return parseWithLocaleDecimal(trimmed, localeDecimal);
|
|
3670
|
+
}
|
|
3671
|
+
if (localeDecimal !== "." && trimmed.includes(".")) {
|
|
3672
|
+
return parseWithFallbackDot(trimmed);
|
|
3673
|
+
}
|
|
3674
|
+
return parseWithoutLocaleDecimal(trimmed);
|
|
3675
|
+
}
|
|
3676
|
+
return {
|
|
3677
|
+
locale: params.locale,
|
|
3678
|
+
decimalSeparator,
|
|
3679
|
+
groupSeparator,
|
|
3680
|
+
stepFractionDigits,
|
|
3681
|
+
formatForDisplay,
|
|
3682
|
+
parseFromInput,
|
|
3683
|
+
roundToStep
|
|
3684
|
+
};
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
const REPEAT_INITIAL_DELAY_MS = 400;
|
|
3688
|
+
const REPEAT_INTERVAL_MS = 100;
|
|
3689
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
3690
|
+
__name: "KdsNumberInput",
|
|
3511
3691
|
props: /* @__PURE__ */ mergeModels({
|
|
3512
3692
|
description: {},
|
|
3513
3693
|
label: {},
|
|
@@ -3520,24 +3700,246 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3520
3700
|
placeholder: {},
|
|
3521
3701
|
disabled: { type: Boolean, default: false },
|
|
3522
3702
|
autocomplete: {},
|
|
3523
|
-
|
|
3524
|
-
|
|
3703
|
+
unit: { default: "" },
|
|
3704
|
+
min: {},
|
|
3705
|
+
max: {},
|
|
3706
|
+
step: { default: 1 }
|
|
3525
3707
|
}, {
|
|
3526
|
-
"modelValue": { default:
|
|
3708
|
+
"modelValue": { default: Number.NaN },
|
|
3527
3709
|
"modelModifiers": {}
|
|
3528
3710
|
}),
|
|
3529
3711
|
emits: ["update:modelValue"],
|
|
3530
3712
|
setup(__props, { expose: __expose }) {
|
|
3531
|
-
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
3713
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "unit", "step"]);
|
|
3532
3714
|
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
3715
|
const isFocused = ref(false);
|
|
3538
|
-
const
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3716
|
+
const localValue = ref("");
|
|
3717
|
+
const numberParser = computed(
|
|
3718
|
+
() => createKdsNumberParser({ locale: "en-US", step: __props.step })
|
|
3719
|
+
);
|
|
3720
|
+
const ariaValuenow = computed(
|
|
3721
|
+
() => Number.isFinite(modelValue.value) ? modelValue.value : void 0
|
|
3722
|
+
);
|
|
3723
|
+
const ariaValuetext = computed(() => {
|
|
3724
|
+
if (!Number.isFinite(modelValue.value)) {
|
|
3725
|
+
return void 0;
|
|
3726
|
+
}
|
|
3727
|
+
return numberParser.value.formatForDisplay(modelValue.value);
|
|
3728
|
+
});
|
|
3729
|
+
const clamp = (value) => {
|
|
3730
|
+
if (!Number.isFinite(value)) {
|
|
3731
|
+
return Number.NaN;
|
|
3732
|
+
}
|
|
3733
|
+
let result = value;
|
|
3734
|
+
if (props.min !== void 0 && !Number.isNaN(props.min)) {
|
|
3735
|
+
result = Math.max(props.min, result);
|
|
3736
|
+
}
|
|
3737
|
+
if (props.max !== void 0 && !Number.isNaN(props.max)) {
|
|
3738
|
+
result = Math.min(props.max, result);
|
|
3739
|
+
}
|
|
3740
|
+
return result;
|
|
3741
|
+
};
|
|
3742
|
+
watch(
|
|
3743
|
+
() => modelValue.value,
|
|
3744
|
+
(next) => {
|
|
3745
|
+
if (isFocused.value) {
|
|
3746
|
+
return;
|
|
3747
|
+
}
|
|
3748
|
+
localValue.value = numberParser.value.formatForDisplay(next);
|
|
3749
|
+
},
|
|
3750
|
+
{ immediate: true }
|
|
3751
|
+
);
|
|
3752
|
+
const canDecrease = computed(() => {
|
|
3753
|
+
if (__props.disabled) {
|
|
3754
|
+
return false;
|
|
3755
|
+
}
|
|
3756
|
+
if (props.min === void 0 || Number.isNaN(props.min)) {
|
|
3757
|
+
return true;
|
|
3758
|
+
}
|
|
3759
|
+
if (Number.isNaN(modelValue.value)) {
|
|
3760
|
+
return true;
|
|
3761
|
+
}
|
|
3762
|
+
return modelValue.value > props.min;
|
|
3763
|
+
});
|
|
3764
|
+
const canIncrease = computed(() => {
|
|
3765
|
+
if (__props.disabled) {
|
|
3766
|
+
return false;
|
|
3767
|
+
}
|
|
3768
|
+
if (props.max === void 0 || Number.isNaN(props.max)) {
|
|
3769
|
+
return true;
|
|
3770
|
+
}
|
|
3771
|
+
if (Number.isNaN(modelValue.value)) {
|
|
3772
|
+
return true;
|
|
3773
|
+
}
|
|
3774
|
+
return modelValue.value < props.max;
|
|
3775
|
+
});
|
|
3776
|
+
const adjustByStep = (direction) => {
|
|
3777
|
+
if (__props.step <= 0) {
|
|
3778
|
+
return;
|
|
3779
|
+
}
|
|
3780
|
+
const base = Number.isFinite(modelValue.value) ? modelValue.value : numberParser.value.parseFromInput(localValue.value);
|
|
3781
|
+
const nextRaw = Number.isFinite(base) ? base + direction * __props.step : 0;
|
|
3782
|
+
const rounded = numberParser.value.roundToStep(nextRaw);
|
|
3783
|
+
const next = clamp(rounded);
|
|
3784
|
+
modelValue.value = next;
|
|
3785
|
+
localValue.value = numberParser.value.formatForDisplay(next);
|
|
3786
|
+
};
|
|
3787
|
+
const handleKeydown = (event) => {
|
|
3788
|
+
if (__props.disabled) {
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
if (event.key === "ArrowUp" && canIncrease.value) {
|
|
3792
|
+
event.preventDefault();
|
|
3793
|
+
adjustByStep(1);
|
|
3794
|
+
return;
|
|
3795
|
+
}
|
|
3796
|
+
if (event.key === "ArrowDown" && canDecrease.value) {
|
|
3797
|
+
event.preventDefault();
|
|
3798
|
+
adjustByStep(-1);
|
|
3799
|
+
}
|
|
3800
|
+
};
|
|
3801
|
+
const handleUpdateModelValue = (value) => {
|
|
3802
|
+
localValue.value = value;
|
|
3803
|
+
modelValue.value = numberParser.value.parseFromInput(value);
|
|
3804
|
+
};
|
|
3805
|
+
const baseInput = useTemplateRef("baseInput");
|
|
3806
|
+
let repeatTimer = null;
|
|
3807
|
+
let isStepping = false;
|
|
3808
|
+
const handleBlur = () => {
|
|
3809
|
+
if (isStepping) {
|
|
3810
|
+
baseInput.value?.focus();
|
|
3811
|
+
return;
|
|
3812
|
+
}
|
|
3813
|
+
isFocused.value = false;
|
|
3814
|
+
const parsed = numberParser.value.parseFromInput(localValue.value);
|
|
3815
|
+
const normalized = clamp(parsed);
|
|
3816
|
+
modelValue.value = normalized;
|
|
3817
|
+
localValue.value = numberParser.value.formatForDisplay(normalized);
|
|
3818
|
+
};
|
|
3819
|
+
const stopRepeating = () => {
|
|
3820
|
+
if (repeatTimer !== null) {
|
|
3821
|
+
clearTimeout(repeatTimer);
|
|
3822
|
+
repeatTimer = null;
|
|
3823
|
+
}
|
|
3824
|
+
isStepping = false;
|
|
3825
|
+
};
|
|
3826
|
+
const startRepeating = (direction) => {
|
|
3827
|
+
stopRepeating();
|
|
3828
|
+
isStepping = true;
|
|
3829
|
+
adjustByStep(direction);
|
|
3830
|
+
repeatTimer = setTimeout(function tick() {
|
|
3831
|
+
adjustByStep(direction);
|
|
3832
|
+
repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
|
|
3833
|
+
}, REPEAT_INITIAL_DELAY_MS);
|
|
3834
|
+
};
|
|
3835
|
+
onBeforeUnmount(stopRepeating);
|
|
3836
|
+
const handleButtonClick = (direction, event) => {
|
|
3837
|
+
if (event.detail !== 0) {
|
|
3838
|
+
return;
|
|
3839
|
+
}
|
|
3840
|
+
adjustByStep(direction);
|
|
3841
|
+
};
|
|
3842
|
+
__expose({
|
|
3843
|
+
focus: () => baseInput.value?.focus()
|
|
3844
|
+
});
|
|
3845
|
+
return (_ctx, _cache) => {
|
|
3846
|
+
return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
|
|
3847
|
+
error: __props.error,
|
|
3848
|
+
validating: __props.validating,
|
|
3849
|
+
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
3850
|
+
}), {
|
|
3851
|
+
default: withCtx((slotProps) => [
|
|
3852
|
+
createVNode(BaseInput, mergeProps({
|
|
3853
|
+
ref_key: "baseInput",
|
|
3854
|
+
ref: baseInput
|
|
3855
|
+
}, slotProps, {
|
|
3856
|
+
"model-value": localValue.value,
|
|
3857
|
+
type: "text",
|
|
3858
|
+
inputmode: Number.isInteger(__props.step) ? "numeric" : "decimal",
|
|
3859
|
+
placeholder: props.placeholder,
|
|
3860
|
+
disabled: __props.disabled,
|
|
3861
|
+
error: __props.error,
|
|
3862
|
+
autocomplete: props.autocomplete,
|
|
3863
|
+
unit: __props.unit,
|
|
3864
|
+
role: "spinbutton",
|
|
3865
|
+
"aria-valuenow": ariaValuenow.value,
|
|
3866
|
+
"aria-valuemin": props.min,
|
|
3867
|
+
"aria-valuemax": props.max,
|
|
3868
|
+
"aria-valuetext": ariaValuetext.value,
|
|
3869
|
+
"onUpdate:modelValue": handleUpdateModelValue,
|
|
3870
|
+
onKeydown: handleKeydown,
|
|
3871
|
+
onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
|
|
3872
|
+
onBlur: handleBlur
|
|
3873
|
+
}), {
|
|
3874
|
+
trailing: withCtx(() => [
|
|
3875
|
+
createVNode(_sfc_main$14, {
|
|
3876
|
+
type: "button",
|
|
3877
|
+
size: "xsmall",
|
|
3878
|
+
variant: "outlined",
|
|
3879
|
+
"leading-icon": "minus",
|
|
3880
|
+
ariaLabel: `Decrease ${props.label ?? props.ariaLabel}`,
|
|
3881
|
+
disabled: !canDecrease.value,
|
|
3882
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
|
|
3883
|
+
onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
|
|
3884
|
+
onPointerup: stopRepeating,
|
|
3885
|
+
onPointerleave: stopRepeating,
|
|
3886
|
+
onPointercancel: stopRepeating
|
|
3887
|
+
}, null, 8, ["ariaLabel", "disabled"]),
|
|
3888
|
+
createVNode(_sfc_main$14, {
|
|
3889
|
+
type: "button",
|
|
3890
|
+
size: "xsmall",
|
|
3891
|
+
variant: "outlined",
|
|
3892
|
+
"leading-icon": "plus",
|
|
3893
|
+
ariaLabel: `Increase ${props.label ?? props.ariaLabel}`,
|
|
3894
|
+
disabled: !canIncrease.value,
|
|
3895
|
+
onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
|
|
3896
|
+
onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
|
|
3897
|
+
onPointerup: stopRepeating,
|
|
3898
|
+
onPointerleave: stopRepeating,
|
|
3899
|
+
onPointercancel: stopRepeating
|
|
3900
|
+
}, null, 8, ["ariaLabel", "disabled"])
|
|
3901
|
+
]),
|
|
3902
|
+
_: 1
|
|
3903
|
+
}, 16, ["model-value", "inputmode", "placeholder", "disabled", "error", "autocomplete", "unit", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"])
|
|
3904
|
+
]),
|
|
3905
|
+
_: 1
|
|
3906
|
+
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
3907
|
+
};
|
|
3908
|
+
}
|
|
3909
|
+
});
|
|
3910
|
+
|
|
3911
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
3912
|
+
__name: "KdsTextInput",
|
|
3913
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3914
|
+
description: {},
|
|
3915
|
+
label: {},
|
|
3916
|
+
ariaLabel: {},
|
|
3917
|
+
id: {},
|
|
3918
|
+
subText: {},
|
|
3919
|
+
error: { type: Boolean, default: false },
|
|
3920
|
+
validating: { type: Boolean, default: false },
|
|
3921
|
+
preserveSubTextSpace: { type: Boolean, default: false },
|
|
3922
|
+
placeholder: {},
|
|
3923
|
+
disabled: { type: Boolean, default: false },
|
|
3924
|
+
autocomplete: {},
|
|
3925
|
+
suggestions: {},
|
|
3926
|
+
suggestionsHeadline: {}
|
|
3927
|
+
}, {
|
|
3928
|
+
"modelValue": { default: "" },
|
|
3929
|
+
"modelModifiers": {}
|
|
3930
|
+
}),
|
|
3931
|
+
emits: ["update:modelValue"],
|
|
3932
|
+
setup(__props, { expose: __expose }) {
|
|
3933
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
3934
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3935
|
+
const baseInput = useTemplateRef("baseInput");
|
|
3936
|
+
const popoverRef = useTemplateRef("popoverRef");
|
|
3937
|
+
const listContainerRef = useTemplateRef("listContainerRef");
|
|
3938
|
+
const popoverOpen = ref(false);
|
|
3939
|
+
const isFocused = ref(false);
|
|
3940
|
+
const hasSuggestions = computed(() => Boolean(props.suggestions?.length));
|
|
3941
|
+
const filteredSuggestions = computed(() => {
|
|
3942
|
+
if (!props.suggestions) {
|
|
3541
3943
|
return [];
|
|
3542
3944
|
}
|
|
3543
3945
|
const query = modelValue.value.trim().toLowerCase();
|
|
@@ -3676,7 +4078,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3676
4078
|
}
|
|
3677
4079
|
});
|
|
3678
4080
|
|
|
3679
|
-
const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
4081
|
+
const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$E, [["__scopeId", "data-v-1740ce83"]]);
|
|
3680
4082
|
|
|
3681
4083
|
const HEX_RADIX = 16;
|
|
3682
4084
|
const RGB_MAX = 255;
|
|
@@ -3693,6 +4095,9 @@ const HEX_PAIR_LENGTH = 2;
|
|
|
3693
4095
|
const HEX_RED_START = 1;
|
|
3694
4096
|
const HEX_GREEN_START = HEX_RED_START + HEX_PAIR_LENGTH;
|
|
3695
4097
|
const HEX_BLUE_START = HEX_GREEN_START + HEX_PAIR_LENGTH;
|
|
4098
|
+
const HEX_ALPHA_START = HEX_BLUE_START + HEX_PAIR_LENGTH;
|
|
4099
|
+
const FULL_HEX_COLOR_LENGTH = 9;
|
|
4100
|
+
const HEX_WITH_HASH_LENGTH$1 = 7;
|
|
3696
4101
|
const clamp$1 = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
3697
4102
|
const round$1 = (value) => Math.round(value);
|
|
3698
4103
|
const padHex = (value) => value.toString(HEX_RADIX).padStart(2, "0");
|
|
@@ -3706,12 +4111,16 @@ const normalizeHexColor = (value) => {
|
|
|
3706
4111
|
const [r, g, b] = withoutHash.split("");
|
|
3707
4112
|
return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
|
|
3708
4113
|
}
|
|
3709
|
-
if (/^[0-9a-fA-F]{
|
|
4114
|
+
if (/^[0-9a-fA-F]{4}$/.test(withoutHash)) {
|
|
4115
|
+
const [r, g, b, a] = withoutHash.split("");
|
|
4116
|
+
return `#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase();
|
|
4117
|
+
}
|
|
4118
|
+
if (/^([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(withoutHash)) {
|
|
3710
4119
|
return `#${withoutHash}`.toUpperCase();
|
|
3711
4120
|
}
|
|
3712
4121
|
return null;
|
|
3713
4122
|
};
|
|
3714
|
-
const
|
|
4123
|
+
const hexToRgba = (hex) => {
|
|
3715
4124
|
const normalized = normalizeHexColor(hex);
|
|
3716
4125
|
if (!normalized) {
|
|
3717
4126
|
return null;
|
|
@@ -3728,7 +4137,12 @@ const hexToRgb = (hex) => {
|
|
|
3728
4137
|
normalized.slice(HEX_BLUE_START, HEX_BLUE_START + HEX_PAIR_LENGTH),
|
|
3729
4138
|
HEX_RADIX
|
|
3730
4139
|
);
|
|
3731
|
-
|
|
4140
|
+
const hasAlpha = normalized.length === FULL_HEX_COLOR_LENGTH;
|
|
4141
|
+
const a = hasAlpha ? Number.parseInt(
|
|
4142
|
+
normalized.slice(HEX_ALPHA_START, HEX_ALPHA_START + HEX_PAIR_LENGTH),
|
|
4143
|
+
HEX_RADIX
|
|
4144
|
+
) / RGB_MAX : 1;
|
|
4145
|
+
return { r, g, b, a };
|
|
3732
4146
|
};
|
|
3733
4147
|
const rgbToHex = ({ r, g, b }) => {
|
|
3734
4148
|
const rr = clamp$1(round$1(r), 0, RGB_MAX);
|
|
@@ -3736,6 +4150,10 @@ const rgbToHex = ({ r, g, b }) => {
|
|
|
3736
4150
|
const bb = clamp$1(round$1(b), 0, RGB_MAX);
|
|
3737
4151
|
return `#${padHex(rr)}${padHex(gg)}${padHex(bb)}`.toUpperCase();
|
|
3738
4152
|
};
|
|
4153
|
+
const rgbaToHex = ({ r, g, b, a }) => {
|
|
4154
|
+
const alpha = clamp$1(round$1(a * RGB_MAX), 0, RGB_MAX);
|
|
4155
|
+
return `${rgbToHex({ r, g, b })}${padHex(alpha)}`.toUpperCase();
|
|
4156
|
+
};
|
|
3739
4157
|
const rgbToHsv = ({ r, g, b }) => {
|
|
3740
4158
|
const rr = clamp$1(r / RGB_MAX, 0, 1);
|
|
3741
4159
|
const gg = clamp$1(g / RGB_MAX, 0, 1);
|
|
@@ -3796,46 +4214,153 @@ const hsvToRgb = ({ h, s, v }) => {
|
|
|
3796
4214
|
b: round$1((bPrime + m) * RGB_MAX)
|
|
3797
4215
|
};
|
|
3798
4216
|
};
|
|
3799
|
-
const
|
|
4217
|
+
const removeAlphaFromHexInput = (next) => {
|
|
4218
|
+
const trimmed = next.trim();
|
|
4219
|
+
const hasHash = trimmed.startsWith("#");
|
|
4220
|
+
const withoutHash = hasHash ? trimmed.slice(1) : trimmed;
|
|
4221
|
+
if (/^[0-9a-fA-F]{8}$/.test(withoutHash)) {
|
|
4222
|
+
const rgbWithoutAlpha = withoutHash.slice(0, HEX_WITH_HASH_LENGTH$1 - 1);
|
|
4223
|
+
return hasHash ? `#${rgbWithoutAlpha}` : rgbWithoutAlpha;
|
|
4224
|
+
}
|
|
4225
|
+
return next;
|
|
4226
|
+
};
|
|
3800
4227
|
|
|
3801
|
-
const _hoisted_1$
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
__name: "ColorPicker",
|
|
3817
|
-
props: {
|
|
3818
|
-
"modelValue": { default: "" },
|
|
4228
|
+
const _hoisted_1$r = ["aria-label", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"];
|
|
4229
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
4230
|
+
__name: "ColorPickerSlider",
|
|
4231
|
+
props: /* @__PURE__ */ mergeModels({
|
|
4232
|
+
label: {},
|
|
4233
|
+
valueNow: {},
|
|
4234
|
+
valueMin: {},
|
|
4235
|
+
valueMax: {},
|
|
4236
|
+
valueText: {},
|
|
4237
|
+
min: {},
|
|
4238
|
+
max: {},
|
|
4239
|
+
step: {},
|
|
4240
|
+
largeStep: {}
|
|
4241
|
+
}, {
|
|
4242
|
+
"modelValue": { required: true },
|
|
3819
4243
|
"modelModifiers": {}
|
|
3820
|
-
},
|
|
4244
|
+
}),
|
|
3821
4245
|
emits: ["update:modelValue"],
|
|
3822
4246
|
setup(__props) {
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
4247
|
+
useCssVars((_ctx) => ({
|
|
4248
|
+
"v087094b8": handlePosition.value
|
|
4249
|
+
}));
|
|
4250
|
+
const props = __props;
|
|
4251
|
+
const modelValue = useModel(__props, "modelValue");
|
|
4252
|
+
const sliderEl = useTemplateRef("sliderEl");
|
|
4253
|
+
const setFromPointerEvent = (event) => {
|
|
4254
|
+
const el = sliderEl.value;
|
|
4255
|
+
if (!el) {
|
|
4256
|
+
return;
|
|
4257
|
+
}
|
|
4258
|
+
const rect = el.getBoundingClientRect();
|
|
4259
|
+
const x = (event.clientX - rect.left) / rect.width;
|
|
4260
|
+
const ratio = clamp$1(x, 0, 1);
|
|
4261
|
+
modelValue.value = props.min + ratio * (props.max - props.min);
|
|
4262
|
+
};
|
|
4263
|
+
const { onPointerDown, onPointerMove, onPointerUp } = usePointerHandler(setFromPointerEvent);
|
|
4264
|
+
const onKeyDown = (event) => {
|
|
4265
|
+
const delta = event.shiftKey ? props.largeStep : props.step;
|
|
4266
|
+
let handled = true;
|
|
4267
|
+
switch (event.key) {
|
|
4268
|
+
case "ArrowLeft":
|
|
4269
|
+
modelValue.value = clamp$1(modelValue.value - delta, props.min, props.max);
|
|
4270
|
+
break;
|
|
4271
|
+
case "ArrowRight":
|
|
4272
|
+
modelValue.value = clamp$1(modelValue.value + delta, props.min, props.max);
|
|
4273
|
+
break;
|
|
4274
|
+
default:
|
|
4275
|
+
handled = false;
|
|
4276
|
+
}
|
|
4277
|
+
if (handled) {
|
|
4278
|
+
event.preventDefault();
|
|
4279
|
+
}
|
|
4280
|
+
};
|
|
4281
|
+
const handlePosition = computed(() => {
|
|
4282
|
+
const ratio = (modelValue.value - props.min) / (props.max - props.min);
|
|
4283
|
+
return `${clamp$1(ratio, 0, 1) * 100}%`;
|
|
4284
|
+
});
|
|
4285
|
+
return (_ctx, _cache) => {
|
|
4286
|
+
return openBlock(), createElementBlock("div", {
|
|
4287
|
+
ref_key: "sliderEl",
|
|
4288
|
+
ref: sliderEl,
|
|
4289
|
+
class: "kds-color-picker-slider",
|
|
4290
|
+
role: "slider",
|
|
4291
|
+
"aria-label": __props.label,
|
|
4292
|
+
"aria-valuenow": __props.valueNow,
|
|
4293
|
+
"aria-valuemin": __props.valueMin,
|
|
4294
|
+
"aria-valuemax": __props.valueMax,
|
|
4295
|
+
"aria-valuetext": __props.valueText,
|
|
4296
|
+
tabindex: "0",
|
|
4297
|
+
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
4298
|
+
(...args) => unref(onPointerDown) && unref(onPointerDown)(...args)),
|
|
4299
|
+
onPointermove: _cache[1] || (_cache[1] = withModifiers(
|
|
4300
|
+
//@ts-ignore
|
|
4301
|
+
(...args) => unref(onPointerMove) && unref(onPointerMove)(...args),
|
|
4302
|
+
["prevent"]
|
|
4303
|
+
)),
|
|
4304
|
+
onPointerup: _cache[2] || (_cache[2] = //@ts-ignore
|
|
4305
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4306
|
+
onPointercancel: _cache[3] || (_cache[3] = //@ts-ignore
|
|
4307
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4308
|
+
onLostpointercapture: _cache[4] || (_cache[4] = //@ts-ignore
|
|
4309
|
+
(...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
|
|
4310
|
+
onKeydown: onKeyDown
|
|
4311
|
+
}, [..._cache[5] || (_cache[5] = [
|
|
4312
|
+
createElementVNode("div", { class: "handle" }, null, -1)
|
|
4313
|
+
])], 40, _hoisted_1$r);
|
|
4314
|
+
};
|
|
4315
|
+
}
|
|
4316
|
+
});
|
|
4317
|
+
|
|
4318
|
+
const ColorPickerSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-f4be2bd4"]]);
|
|
4319
|
+
|
|
4320
|
+
const _hoisted_1$q = { class: "kds-color-picker" };
|
|
4321
|
+
const _hoisted_2$d = ["aria-valuetext"];
|
|
4322
|
+
const _hoisted_3$a = { class: "value-inputs" };
|
|
4323
|
+
const DEFAULT_HUE_DEG = 270;
|
|
4324
|
+
const DEFAULT_SATURATION = 0.8;
|
|
4325
|
+
const DEFAULT_VALUE = 0.9;
|
|
4326
|
+
const DEFAULT_ALPHA = 1;
|
|
4327
|
+
const HUE_MAX_DEG = 360;
|
|
4328
|
+
const HUE_MAX_EXCLUSIVE_DEG = 359.999;
|
|
4329
|
+
const PERCENT = 100;
|
|
4330
|
+
const HEX_WITH_HASH_LENGTH = 7;
|
|
4331
|
+
const KEYBOARD_STEP = 0.01;
|
|
4332
|
+
const KEYBOARD_LARGE_STEP = 0.1;
|
|
4333
|
+
const HUE_KEYBOARD_STEP_DEG = 1;
|
|
4334
|
+
const HUE_KEYBOARD_LARGE_STEP_DEG = 10;
|
|
4335
|
+
const TO_BOTTOM_GRADIENT = "linear-gradient(to bottom, transparent, black)";
|
|
4336
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
4337
|
+
__name: "ColorPicker",
|
|
4338
|
+
props: {
|
|
4339
|
+
"modelValue": { default: "" },
|
|
4340
|
+
"modelModifiers": {}
|
|
4341
|
+
},
|
|
4342
|
+
emits: ["update:modelValue"],
|
|
4343
|
+
setup(__props) {
|
|
4344
|
+
useCssVars((_ctx) => ({
|
|
4345
|
+
"v535b907d": alphaBackgroundImage.value
|
|
4346
|
+
}));
|
|
4347
|
+
const modelValue = useModel(__props, "modelValue");
|
|
4348
|
+
const colorspaceEl = ref(null);
|
|
3826
4349
|
const hue = ref(DEFAULT_HUE_DEG);
|
|
3827
4350
|
const saturation = ref(DEFAULT_SATURATION);
|
|
3828
4351
|
const value = ref(DEFAULT_VALUE);
|
|
4352
|
+
const alpha = ref(DEFAULT_ALPHA);
|
|
3829
4353
|
const hasPendingInternalModelUpdate = ref(false);
|
|
3830
|
-
const
|
|
3831
|
-
const
|
|
3832
|
-
if (!
|
|
4354
|
+
const updateHsvFromHex = (hex) => {
|
|
4355
|
+
const rgba = hexToRgba(hex);
|
|
4356
|
+
if (!rgba) {
|
|
3833
4357
|
return;
|
|
3834
4358
|
}
|
|
3835
|
-
const hsv = rgbToHsv(
|
|
4359
|
+
const hsv = rgbToHsv(rgba);
|
|
3836
4360
|
hue.value = hsv.h;
|
|
3837
4361
|
saturation.value = hsv.s;
|
|
3838
4362
|
value.value = hsv.v;
|
|
4363
|
+
alpha.value = rgba.a;
|
|
3839
4364
|
};
|
|
3840
4365
|
watch(
|
|
3841
4366
|
() => modelValue.value,
|
|
@@ -3844,17 +4369,25 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3844
4369
|
hasPendingInternalModelUpdate.value = false;
|
|
3845
4370
|
return;
|
|
3846
4371
|
}
|
|
3847
|
-
|
|
4372
|
+
updateHsvFromHex(next);
|
|
3848
4373
|
},
|
|
3849
4374
|
{ immediate: true }
|
|
3850
4375
|
);
|
|
3851
|
-
const
|
|
3852
|
-
|
|
4376
|
+
const hexInputValue = computed(() => removeAlphaFromHexInput(modelValue.value));
|
|
4377
|
+
const currentRgb = computed(
|
|
4378
|
+
() => hsvToRgb({
|
|
3853
4379
|
h: hue.value,
|
|
3854
4380
|
s: saturation.value,
|
|
3855
4381
|
v: value.value
|
|
3856
4382
|
})
|
|
3857
4383
|
);
|
|
4384
|
+
const currentHex = computed(() => {
|
|
4385
|
+
const hex = rgbaToHex({
|
|
4386
|
+
...currentRgb.value,
|
|
4387
|
+
a: alpha.value
|
|
4388
|
+
});
|
|
4389
|
+
return alpha.value === DEFAULT_ALPHA ? hex.slice(0, HEX_WITH_HASH_LENGTH) : hex;
|
|
4390
|
+
});
|
|
3858
4391
|
const hueRgb = computed(() => hsvToRgb({ h: hue.value, s: 1, v: 1 }));
|
|
3859
4392
|
const colorspaceBackground = computed(() => {
|
|
3860
4393
|
const { r, g, b } = hueRgb.value;
|
|
@@ -3866,9 +4399,16 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3866
4399
|
left: `${saturation.value * 100}%`,
|
|
3867
4400
|
top: `${(1 - value.value) * 100}%`
|
|
3868
4401
|
}));
|
|
3869
|
-
const
|
|
3870
|
-
|
|
3871
|
-
|
|
4402
|
+
const alphaBackgroundImage = computed(() => {
|
|
4403
|
+
const { r, g, b } = currentRgb.value;
|
|
4404
|
+
return `
|
|
4405
|
+
linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0), rgb(${r}, ${g}, ${b})),
|
|
4406
|
+
repeating-conic-gradient(
|
|
4407
|
+
var(--kds-color-background-neutral-active) 0 25%,
|
|
4408
|
+
var(--kds-color-surface-default) 0 50%
|
|
4409
|
+
)
|
|
4410
|
+
`;
|
|
4411
|
+
});
|
|
3872
4412
|
const setModelValueFromHsv = () => {
|
|
3873
4413
|
hasPendingInternalModelUpdate.value = true;
|
|
3874
4414
|
modelValue.value = currentHex.value;
|
|
@@ -3881,18 +4421,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3881
4421
|
const rect = el.getBoundingClientRect();
|
|
3882
4422
|
const x = (event.clientX - rect.left) / rect.width;
|
|
3883
4423
|
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));
|
|
4424
|
+
saturation.value = clamp$1(x, 0, 1);
|
|
4425
|
+
value.value = 1 - clamp$1(y, 0, 1);
|
|
3896
4426
|
setModelValueFromHsv();
|
|
3897
4427
|
};
|
|
3898
4428
|
const {
|
|
@@ -3900,17 +4430,21 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3900
4430
|
onPointerMove: onColorspacePointerMove,
|
|
3901
4431
|
onPointerUp: onColorspacePointerUp
|
|
3902
4432
|
} = usePointerHandler(updateFromColorspaceEvent);
|
|
3903
|
-
const {
|
|
3904
|
-
onPointerDown: onHuePointerDown,
|
|
3905
|
-
onPointerMove: onHuePointerMove,
|
|
3906
|
-
onPointerUp: onHuePointerUp
|
|
3907
|
-
} = usePointerHandler(updateFromHueEvent);
|
|
3908
4433
|
const updateFromTextValue = (next) => {
|
|
3909
4434
|
modelValue.value = next;
|
|
3910
|
-
|
|
4435
|
+
};
|
|
4436
|
+
const onHexInputFocusOut = () => {
|
|
4437
|
+
const normalized = normalizeHexColor(modelValue.value);
|
|
3911
4438
|
if (normalized) {
|
|
3912
|
-
|
|
4439
|
+
modelValue.value = normalized;
|
|
4440
|
+
}
|
|
4441
|
+
};
|
|
4442
|
+
const updateFromAlphaNumberInput = (next) => {
|
|
4443
|
+
if (!Number.isFinite(next)) {
|
|
4444
|
+
return;
|
|
3913
4445
|
}
|
|
4446
|
+
alpha.value = clamp$1(next / PERCENT, 0, 1);
|
|
4447
|
+
setModelValueFromHsv();
|
|
3914
4448
|
};
|
|
3915
4449
|
const saturationPercent = computed(
|
|
3916
4450
|
() => Math.round(saturation.value * PERCENT)
|
|
@@ -3920,6 +4454,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3920
4454
|
() => `Saturation ${saturationPercent.value} percent, brightness ${valuePercent.value} percent`
|
|
3921
4455
|
);
|
|
3922
4456
|
const hueValueText = computed(() => `${Math.round(hue.value)} degrees`);
|
|
4457
|
+
const alphaPercent = computed(() => Math.round(alpha.value * PERCENT));
|
|
4458
|
+
const alphaValueText = computed(() => `${alphaPercent.value} percent`);
|
|
3923
4459
|
const onColorspaceKeyDown = (event) => {
|
|
3924
4460
|
const step = event.shiftKey ? KEYBOARD_LARGE_STEP : KEYBOARD_STEP;
|
|
3925
4461
|
let handled = true;
|
|
@@ -3944,26 +4480,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3944
4480
|
setModelValueFromHsv();
|
|
3945
4481
|
}
|
|
3946
4482
|
};
|
|
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
4483
|
return (_ctx, _cache) => {
|
|
3966
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4484
|
+
return openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
3967
4485
|
createElementVNode("div", {
|
|
3968
4486
|
ref_key: "colorspaceEl",
|
|
3969
4487
|
ref: colorspaceEl,
|
|
@@ -3974,11 +4492,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3974
4492
|
"aria-valuetext": colorspaceValueText.value,
|
|
3975
4493
|
style: normalizeStyle(colorspaceBackground.value),
|
|
3976
4494
|
tabindex: "0",
|
|
3977
|
-
onPointerdown: _cache[0] || (_cache[0] =
|
|
3978
|
-
|
|
3979
|
-
(...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args),
|
|
3980
|
-
["prevent"]
|
|
3981
|
-
)),
|
|
4495
|
+
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
4496
|
+
(...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args)),
|
|
3982
4497
|
onPointermove: _cache[1] || (_cache[1] = withModifiers(
|
|
3983
4498
|
//@ts-ignore
|
|
3984
4499
|
(...args) => unref(onColorspacePointerMove) && unref(onColorspacePointerMove)(...args),
|
|
@@ -3994,57 +4509,74 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3994
4509
|
class: "handle",
|
|
3995
4510
|
style: normalizeStyle(colorspaceHandleStyle.value)
|
|
3996
4511
|
}, null, 4)
|
|
3997
|
-
], 44, _hoisted_2$
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4512
|
+
], 44, _hoisted_2$d),
|
|
4513
|
+
createVNode(ColorPickerSlider, {
|
|
4514
|
+
modelValue: hue.value,
|
|
4515
|
+
"onUpdate:modelValue": [
|
|
4516
|
+
_cache[4] || (_cache[4] = ($event) => hue.value = $event),
|
|
4517
|
+
setModelValueFromHsv
|
|
4518
|
+
],
|
|
4001
4519
|
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
|
-
|
|
4520
|
+
label: "Hue",
|
|
4521
|
+
"value-now": Math.round(hue.value),
|
|
4522
|
+
"value-min": 0,
|
|
4523
|
+
"value-max": HUE_MAX_DEG,
|
|
4524
|
+
"value-text": hueValueText.value,
|
|
4525
|
+
min: 0,
|
|
4526
|
+
max: HUE_MAX_EXCLUSIVE_DEG,
|
|
4527
|
+
step: HUE_KEYBOARD_STEP_DEG,
|
|
4528
|
+
"large-step": HUE_KEYBOARD_LARGE_STEP_DEG
|
|
4529
|
+
}, null, 8, ["modelValue", "value-now", "value-text"]),
|
|
4530
|
+
createVNode(ColorPickerSlider, {
|
|
4531
|
+
modelValue: alpha.value,
|
|
4532
|
+
"onUpdate:modelValue": [
|
|
4533
|
+
_cache[5] || (_cache[5] = ($event) => alpha.value = $event),
|
|
4534
|
+
setModelValueFromHsv
|
|
4535
|
+
],
|
|
4536
|
+
class: "alpha",
|
|
4537
|
+
label: "Alpha",
|
|
4538
|
+
"value-now": alphaPercent.value,
|
|
4539
|
+
"value-min": 0,
|
|
4540
|
+
"value-max": PERCENT,
|
|
4541
|
+
"value-text": alphaValueText.value,
|
|
4542
|
+
min: 0,
|
|
4543
|
+
max: 1,
|
|
4544
|
+
step: KEYBOARD_STEP,
|
|
4545
|
+
"large-step": KEYBOARD_LARGE_STEP
|
|
4546
|
+
}, null, 8, ["modelValue", "value-now", "value-text"]),
|
|
4547
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
4548
|
+
createVNode(KdsTextInput, {
|
|
4549
|
+
"model-value": hexInputValue.value,
|
|
4550
|
+
ariaLabel: "Color hex value",
|
|
4551
|
+
placeholder: "#FFFFFF",
|
|
4552
|
+
"onUpdate:modelValue": updateFromTextValue,
|
|
4553
|
+
onFocusout: onHexInputFocusOut
|
|
4554
|
+
}, null, 8, ["model-value"]),
|
|
4555
|
+
createVNode(_sfc_main$F, {
|
|
4556
|
+
"model-value": alphaPercent.value,
|
|
4557
|
+
ariaLabel: "Alpha percentage",
|
|
4558
|
+
min: 0,
|
|
4559
|
+
max: PERCENT,
|
|
4560
|
+
step: 1,
|
|
4561
|
+
unit: "%",
|
|
4562
|
+
"onUpdate:modelValue": updateFromAlphaNumberInput
|
|
4563
|
+
}, null, 8, ["model-value"])
|
|
4564
|
+
])
|
|
4036
4565
|
]);
|
|
4037
4566
|
};
|
|
4038
4567
|
}
|
|
4039
4568
|
});
|
|
4040
4569
|
|
|
4041
|
-
const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
4570
|
+
const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-2daeaa68"]]);
|
|
4042
4571
|
|
|
4043
4572
|
const HEX_LENGTH_1 = 1;
|
|
4044
4573
|
const HEX_LENGTH_2 = 2;
|
|
4045
4574
|
const HEX_LENGTH_3 = 3;
|
|
4046
4575
|
const HEX_LENGTH_4 = 4;
|
|
4047
4576
|
const HEX_LENGTH_6 = 6;
|
|
4577
|
+
const HEX_LENGTH_8 = 8;
|
|
4578
|
+
const FULLY_OPAQUE_ALPHA_SUFFIX = "FF";
|
|
4579
|
+
const normalizeOpaqueAlpha = (normalizedHexWithHash) => normalizedHexWithHash.length === HEX_LENGTH_8 + 1 && normalizedHexWithHash.endsWith(FULLY_OPAQUE_ALPHA_SUFFIX) ? normalizedHexWithHash.slice(0, HEX_LENGTH_6 + 1) : normalizedHexWithHash;
|
|
4048
4580
|
const normalize = (value, fallbackValue) => {
|
|
4049
4581
|
const trimmed = value.trim();
|
|
4050
4582
|
if (trimmed.length === 0) {
|
|
@@ -4060,13 +4592,22 @@ const normalize = (value, fallbackValue) => {
|
|
|
4060
4592
|
if (withoutHash.length === HEX_LENGTH_2) {
|
|
4061
4593
|
return `#${withoutHash.repeat(HEX_LENGTH_3)}`.toUpperCase();
|
|
4062
4594
|
}
|
|
4063
|
-
if (withoutHash.length === HEX_LENGTH_3
|
|
4595
|
+
if (withoutHash.length === HEX_LENGTH_3) {
|
|
4064
4596
|
const [r, g, b] = withoutHash;
|
|
4065
4597
|
return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
|
|
4066
4598
|
}
|
|
4599
|
+
if (withoutHash.length === HEX_LENGTH_4) {
|
|
4600
|
+
const [r, g, b, a] = withoutHash;
|
|
4601
|
+
return normalizeOpaqueAlpha(
|
|
4602
|
+
`#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase()
|
|
4603
|
+
);
|
|
4604
|
+
}
|
|
4067
4605
|
if (withoutHash.length === HEX_LENGTH_6) {
|
|
4068
4606
|
return `#${withoutHash}`.toUpperCase();
|
|
4069
4607
|
}
|
|
4608
|
+
if (withoutHash.length === HEX_LENGTH_8) {
|
|
4609
|
+
return normalizeOpaqueAlpha(`#${withoutHash}`.toUpperCase());
|
|
4610
|
+
}
|
|
4070
4611
|
return fallbackValue;
|
|
4071
4612
|
};
|
|
4072
4613
|
const useColorInputValidationOnFocusOut = (modelValue) => {
|
|
@@ -4075,8 +4616,10 @@ const useColorInputValidationOnFocusOut = (modelValue) => {
|
|
|
4075
4616
|
modelValue,
|
|
4076
4617
|
(value) => {
|
|
4077
4618
|
const withoutHash = value.startsWith("#") ? value.slice(1) : value;
|
|
4078
|
-
if (/^[0-9a-fA-F]
|
|
4079
|
-
lastValidHexColor.value =
|
|
4619
|
+
if ((withoutHash.length === HEX_LENGTH_6 || withoutHash.length === HEX_LENGTH_8) && /^[0-9a-fA-F]+$/.test(withoutHash)) {
|
|
4620
|
+
lastValidHexColor.value = normalizeOpaqueAlpha(
|
|
4621
|
+
`#${withoutHash.toUpperCase()}`
|
|
4622
|
+
);
|
|
4080
4623
|
}
|
|
4081
4624
|
},
|
|
4082
4625
|
{ immediate: true }
|
|
@@ -4098,7 +4641,7 @@ const useColorInputValidationOnFocusOut = (modelValue) => {
|
|
|
4098
4641
|
return { handleFocusOut };
|
|
4099
4642
|
};
|
|
4100
4643
|
|
|
4101
|
-
const _sfc_main$
|
|
4644
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
4102
4645
|
__name: "KdsColorInput",
|
|
4103
4646
|
props: /* @__PURE__ */ mergeModels({
|
|
4104
4647
|
description: {},
|
|
@@ -4161,7 +4704,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4161
4704
|
}, null, 8, ["color", "style"])
|
|
4162
4705
|
]),
|
|
4163
4706
|
trailing: withCtx(() => [
|
|
4164
|
-
createVNode(unref(_sfc_main$
|
|
4707
|
+
createVNode(unref(_sfc_main$11), {
|
|
4165
4708
|
modelValue: open.value,
|
|
4166
4709
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
4167
4710
|
size: "xsmall",
|
|
@@ -4201,7 +4744,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4201
4744
|
}
|
|
4202
4745
|
});
|
|
4203
4746
|
|
|
4204
|
-
const _sfc_main$
|
|
4747
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
4205
4748
|
__name: "KdsPasswordInput",
|
|
4206
4749
|
props: /* @__PURE__ */ mergeModels({
|
|
4207
4750
|
description: {},
|
|
@@ -4262,7 +4805,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4262
4805
|
onBlur: handleBlur
|
|
4263
4806
|
}), {
|
|
4264
4807
|
trailing: withCtx(() => [
|
|
4265
|
-
__props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$
|
|
4808
|
+
__props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$11, {
|
|
4266
4809
|
key: 0,
|
|
4267
4810
|
modelValue: showValue.value,
|
|
4268
4811
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showValue.value = $event),
|
|
@@ -4303,7 +4846,7 @@ const kdsPasswordInputAutocompletes = Object.values(
|
|
|
4303
4846
|
kdsPasswordInputAutocomplete
|
|
4304
4847
|
);
|
|
4305
4848
|
|
|
4306
|
-
const _sfc_main$
|
|
4849
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
4307
4850
|
__name: "KdsUsernameInput",
|
|
4308
4851
|
props: /* @__PURE__ */ mergeModels({
|
|
4309
4852
|
description: {},
|
|
@@ -14143,13 +14686,13 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
|
|
|
14143
14686
|
};
|
|
14144
14687
|
}
|
|
14145
14688
|
});
|
|
14146
|
-
const _hoisted_1$
|
|
14689
|
+
const _hoisted_1$p = {
|
|
14147
14690
|
key: 0,
|
|
14148
14691
|
class: "vc-time-header"
|
|
14149
14692
|
};
|
|
14150
|
-
const _hoisted_2$
|
|
14151
|
-
const _hoisted_3$
|
|
14152
|
-
const _hoisted_4$
|
|
14693
|
+
const _hoisted_2$c = { class: "vc-time-weekday" };
|
|
14694
|
+
const _hoisted_3$9 = { class: "vc-time-month" };
|
|
14695
|
+
const _hoisted_4$7 = { class: "vc-time-day" };
|
|
14153
14696
|
const _hoisted_5$3 = { class: "vc-time-year" };
|
|
14154
14697
|
const _hoisted_6$1 = { class: "vc-time-select-group" };
|
|
14155
14698
|
const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -14184,10 +14727,10 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
|
|
|
14184
14727
|
}, [
|
|
14185
14728
|
createVNode(_sfc_main$i$1, { name: "time-header" }, {
|
|
14186
14729
|
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$
|
|
14730
|
+
unref(showHeader) && unref(date) ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
14731
|
+
createElementVNode("span", _hoisted_2$c, toDisplayString(unref(locale).formatDate(unref(date), "WWW")), 1),
|
|
14732
|
+
createElementVNode("span", _hoisted_3$9, toDisplayString(unref(locale).formatDate(unref(date), "MMM")), 1),
|
|
14733
|
+
createElementVNode("span", _hoisted_4$7, toDisplayString(unref(locale).formatDate(unref(date), "D")), 1),
|
|
14191
14734
|
createElementVNode("span", _hoisted_5$3, toDisplayString(unref(locale).formatDate(unref(date), "YYYY")), 1)
|
|
14192
14735
|
])) : createCommentVNode("", true)
|
|
14193
14736
|
]),
|
|
@@ -14337,7 +14880,7 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
|
|
|
14337
14880
|
};
|
|
14338
14881
|
}
|
|
14339
14882
|
});
|
|
14340
|
-
const _sfc_main$
|
|
14883
|
+
const _sfc_main$y = defineComponent({
|
|
14341
14884
|
inheritAttrs: false,
|
|
14342
14885
|
emits,
|
|
14343
14886
|
props: propsDef,
|
|
@@ -14356,7 +14899,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14356
14899
|
createVNode(_component_DatePickerPopover, normalizeProps(guardReactiveProps(_ctx.$attrs)), null, 16)
|
|
14357
14900
|
], 64)) : (openBlock(), createBlock(_component_DatePickerBase, normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)), null, 16));
|
|
14358
14901
|
}
|
|
14359
|
-
const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14902
|
+
const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render]]);
|
|
14360
14903
|
|
|
14361
14904
|
const tryParseAnyDate = (value) => {
|
|
14362
14905
|
if (!value) {
|
|
@@ -14404,7 +14947,7 @@ const formatDateToString = (date) => {
|
|
|
14404
14947
|
|
|
14405
14948
|
const legacyDateFormat = "yyyy-MM-dd";
|
|
14406
14949
|
const invalidDateFormatMessage = "Invalid date format. The expected date format is yyyy-MM-dd (e.g. 2026-03-11).";
|
|
14407
|
-
const _sfc_main$
|
|
14950
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
14408
14951
|
__name: "KdsDateInput",
|
|
14409
14952
|
props: /* @__PURE__ */ mergeModels({
|
|
14410
14953
|
description: {},
|
|
@@ -14485,7 +15028,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
14485
15028
|
onBlur: onTextInputBlur
|
|
14486
15029
|
}), {
|
|
14487
15030
|
trailing: withCtx(() => [
|
|
14488
|
-
createVNode(_sfc_main$
|
|
15031
|
+
createVNode(_sfc_main$11, {
|
|
14489
15032
|
modelValue: popoverIsVisible.value,
|
|
14490
15033
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => popoverIsVisible.value = $event),
|
|
14491
15034
|
type: "button",
|
|
@@ -14540,8 +15083,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
14540
15083
|
}
|
|
14541
15084
|
});
|
|
14542
15085
|
|
|
14543
|
-
const _hoisted_1$
|
|
14544
|
-
const _sfc_main$
|
|
15086
|
+
const _hoisted_1$o = { class: "kds-date-time-format-popover" };
|
|
15087
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
14545
15088
|
__name: "DateTimeFormatPopover",
|
|
14546
15089
|
props: /* @__PURE__ */ mergeModels({
|
|
14547
15090
|
allDefaultFormats: {},
|
|
@@ -14679,7 +15222,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
14679
15222
|
}));
|
|
14680
15223
|
});
|
|
14681
15224
|
return (_ctx, _cache) => {
|
|
14682
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
15225
|
+
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
14683
15226
|
modeOptions.value.length > 1 ? (openBlock(), createBlock(KdsValueSwitch, {
|
|
14684
15227
|
key: 0,
|
|
14685
15228
|
"model-value": effectiveSelectedMode.value,
|
|
@@ -14711,9 +15254,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
14711
15254
|
}
|
|
14712
15255
|
});
|
|
14713
15256
|
|
|
14714
|
-
const DateTimeFormatPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15257
|
+
const DateTimeFormatPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["__scopeId", "data-v-f75ebe1b"]]);
|
|
14715
15258
|
|
|
14716
|
-
const _sfc_main$
|
|
15259
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
14717
15260
|
__name: "KdsDateTimeFormatInput",
|
|
14718
15261
|
props: /* @__PURE__ */ mergeModels({
|
|
14719
15262
|
description: {},
|
|
@@ -14760,7 +15303,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
14760
15303
|
autocomplete: props.autocomplete
|
|
14761
15304
|
}), {
|
|
14762
15305
|
trailing: withCtx(() => [
|
|
14763
|
-
createVNode(unref(_sfc_main$
|
|
15306
|
+
createVNode(unref(_sfc_main$11), {
|
|
14764
15307
|
modelValue: open.value,
|
|
14765
15308
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
14766
15309
|
size: "xsmall",
|
|
@@ -14788,386 +15331,16 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
14788
15331
|
createVNode(DateTimeFormatPopover, {
|
|
14789
15332
|
selection: modelValue.value,
|
|
14790
15333
|
"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
|
-
});
|
|
15112
|
-
return (_ctx, _cache) => {
|
|
15113
|
-
return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
|
|
15114
|
-
error: __props.error,
|
|
15115
|
-
validating: __props.validating,
|
|
15116
|
-
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
15117
|
-
}), {
|
|
15118
|
-
default: withCtx((slotProps) => [
|
|
15119
|
-
createVNode(BaseInput, mergeProps({
|
|
15120
|
-
ref_key: "baseInput",
|
|
15121
|
-
ref: baseInput
|
|
15122
|
-
}, slotProps, {
|
|
15123
|
-
"model-value": localValue.value,
|
|
15124
|
-
type: "text",
|
|
15125
|
-
inputmode: Number.isInteger(__props.step) ? "numeric" : "decimal",
|
|
15126
|
-
placeholder: props.placeholder,
|
|
15127
|
-
disabled: __props.disabled,
|
|
15128
|
-
error: __props.error,
|
|
15129
|
-
autocomplete: props.autocomplete,
|
|
15130
|
-
unit: __props.unit,
|
|
15131
|
-
role: "spinbutton",
|
|
15132
|
-
"aria-valuenow": ariaValuenow.value,
|
|
15133
|
-
"aria-valuemin": props.min,
|
|
15134
|
-
"aria-valuemax": props.max,
|
|
15135
|
-
"aria-valuetext": ariaValuetext.value,
|
|
15136
|
-
"onUpdate:modelValue": handleUpdateModelValue,
|
|
15137
|
-
onKeydown: handleKeydown,
|
|
15138
|
-
onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
|
|
15139
|
-
onBlur: handleBlur
|
|
15140
|
-
}), {
|
|
15141
|
-
trailing: withCtx(() => [
|
|
15142
|
-
createVNode(_sfc_main$$, {
|
|
15143
|
-
type: "button",
|
|
15144
|
-
size: "xsmall",
|
|
15145
|
-
variant: "outlined",
|
|
15146
|
-
"leading-icon": "minus",
|
|
15147
|
-
ariaLabel: `Decrease ${props.label ?? props.ariaLabel}`,
|
|
15148
|
-
disabled: !canDecrease.value,
|
|
15149
|
-
onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
|
|
15150
|
-
onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
|
|
15151
|
-
onPointerup: stopRepeating,
|
|
15152
|
-
onPointerleave: stopRepeating,
|
|
15153
|
-
onPointercancel: stopRepeating
|
|
15154
|
-
}, null, 8, ["ariaLabel", "disabled"]),
|
|
15155
|
-
createVNode(_sfc_main$$, {
|
|
15156
|
-
type: "button",
|
|
15157
|
-
size: "xsmall",
|
|
15158
|
-
variant: "outlined",
|
|
15159
|
-
"leading-icon": "plus",
|
|
15160
|
-
ariaLabel: `Increase ${props.label ?? props.ariaLabel}`,
|
|
15161
|
-
disabled: !canIncrease.value,
|
|
15162
|
-
onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
|
|
15163
|
-
onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
|
|
15164
|
-
onPointerup: stopRepeating,
|
|
15165
|
-
onPointerleave: stopRepeating,
|
|
15166
|
-
onPointercancel: stopRepeating
|
|
15167
|
-
}, null, 8, ["ariaLabel", "disabled"])
|
|
15168
|
-
]),
|
|
15169
|
-
_: 1
|
|
15170
|
-
}, 16, ["model-value", "inputmode", "placeholder", "disabled", "error", "autocomplete", "unit", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"])
|
|
15334
|
+
"allowed-formats": props.allowedFormats,
|
|
15335
|
+
"onUpdate:selection": _cache[2] || (_cache[2] = ($event) => {
|
|
15336
|
+
modelValue.value = $event;
|
|
15337
|
+
open.value = false;
|
|
15338
|
+
})
|
|
15339
|
+
}, null, 8, ["selection", "all-default-formats", "allowed-formats"])
|
|
15340
|
+
]),
|
|
15341
|
+
_: 1
|
|
15342
|
+
}, 8, ["modelValue"])
|
|
15343
|
+
], 4)
|
|
15171
15344
|
]),
|
|
15172
15345
|
_: 1
|
|
15173
15346
|
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
@@ -15175,6 +15348,21 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
15175
15348
|
}
|
|
15176
15349
|
});
|
|
15177
15350
|
|
|
15351
|
+
const kdsTemporalType = {
|
|
15352
|
+
DATE: "DATE",
|
|
15353
|
+
TIME: "TIME",
|
|
15354
|
+
DATE_TIME: "DATE_TIME",
|
|
15355
|
+
ZONED_DATE_TIME: "ZONED_DATE_TIME"
|
|
15356
|
+
};
|
|
15357
|
+
const kdsTemporalTypes = Object.values(kdsTemporalType);
|
|
15358
|
+
const kdsDateFormatCategory = {
|
|
15359
|
+
RECENT: "RECENT",
|
|
15360
|
+
STANDARD: "STANDARD",
|
|
15361
|
+
EUROPEAN: "EUROPEAN",
|
|
15362
|
+
AMERICAN: "AMERICAN"
|
|
15363
|
+
};
|
|
15364
|
+
const kdsDateFormatCategories = Object.values(kdsDateFormatCategory);
|
|
15365
|
+
|
|
15178
15366
|
const escapeRegex = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
15179
15367
|
const wildcardToRegexBody = (pattern) => {
|
|
15180
15368
|
let body = "";
|
|
@@ -15201,7 +15389,7 @@ const buildRegexFromPatternInput = (input, options) => {
|
|
|
15201
15389
|
return `^(?!.*${withCase}).*$`;
|
|
15202
15390
|
};
|
|
15203
15391
|
|
|
15204
|
-
const _sfc_main$
|
|
15392
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
15205
15393
|
__name: "KdsPatternInput",
|
|
15206
15394
|
props: /* @__PURE__ */ mergeModels({
|
|
15207
15395
|
description: {},
|
|
@@ -15284,7 +15472,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15284
15472
|
clearable: ""
|
|
15285
15473
|
}), {
|
|
15286
15474
|
trailing: withCtx(() => [
|
|
15287
|
-
createVNode(_sfc_main$
|
|
15475
|
+
createVNode(_sfc_main$11, {
|
|
15288
15476
|
modelValue: caseSensitive.value,
|
|
15289
15477
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => caseSensitive.value = $event),
|
|
15290
15478
|
size: "xsmall",
|
|
@@ -15294,7 +15482,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15294
15482
|
ariaLabel: "Case sensitivity",
|
|
15295
15483
|
disabled: __props.disabled
|
|
15296
15484
|
}, null, 8, ["modelValue", "title", "disabled"]),
|
|
15297
|
-
createVNode(_sfc_main$
|
|
15485
|
+
createVNode(_sfc_main$11, {
|
|
15298
15486
|
modelValue: excludeMatches.value,
|
|
15299
15487
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => excludeMatches.value = $event),
|
|
15300
15488
|
size: "xsmall",
|
|
@@ -15304,7 +15492,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15304
15492
|
ariaLabel: "Exclude matches",
|
|
15305
15493
|
disabled: __props.disabled
|
|
15306
15494
|
}, null, 8, ["modelValue", "title", "disabled"]),
|
|
15307
|
-
createVNode(_sfc_main$
|
|
15495
|
+
createVNode(_sfc_main$11, {
|
|
15308
15496
|
modelValue: useRegex.value,
|
|
15309
15497
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => useRegex.value = $event),
|
|
15310
15498
|
size: "xsmall",
|
|
@@ -15324,7 +15512,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
15324
15512
|
}
|
|
15325
15513
|
});
|
|
15326
15514
|
|
|
15327
|
-
const _sfc_main$
|
|
15515
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
15328
15516
|
__name: "KdsSearchInput",
|
|
15329
15517
|
props: /* @__PURE__ */ mergeModels({
|
|
15330
15518
|
description: {},
|
|
@@ -15476,11 +15664,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
15476
15664
|
}
|
|
15477
15665
|
});
|
|
15478
15666
|
|
|
15479
|
-
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15667
|
+
const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["__scopeId", "data-v-b1809b6d"]]);
|
|
15480
15668
|
|
|
15481
|
-
const _hoisted_1$
|
|
15669
|
+
const _hoisted_1$n = ["rows", "placeholder", "disabled", "autocomplete"];
|
|
15482
15670
|
const DEFAULT_ROWS = 3;
|
|
15483
|
-
const _sfc_main$
|
|
15671
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
15484
15672
|
__name: "KdsTextarea",
|
|
15485
15673
|
props: /* @__PURE__ */ mergeModels({
|
|
15486
15674
|
description: {},
|
|
@@ -15541,7 +15729,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
15541
15729
|
placeholder: __props.placeholder,
|
|
15542
15730
|
disabled: __props.disabled,
|
|
15543
15731
|
autocomplete: props.autocomplete
|
|
15544
|
-
}), null, 16, _hoisted_1$
|
|
15732
|
+
}), null, 16, _hoisted_1$n), [
|
|
15545
15733
|
[vModelText, modelValue.value]
|
|
15546
15734
|
])
|
|
15547
15735
|
]),
|
|
@@ -15551,20 +15739,20 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
15551
15739
|
}
|
|
15552
15740
|
});
|
|
15553
15741
|
|
|
15554
|
-
const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15742
|
+
const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["__scopeId", "data-v-bdf12ef9"]]);
|
|
15555
15743
|
|
|
15556
|
-
const _hoisted_1$
|
|
15557
|
-
const _hoisted_2$
|
|
15744
|
+
const _hoisted_1$m = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
|
|
15745
|
+
const _hoisted_2$b = {
|
|
15558
15746
|
key: 0,
|
|
15559
15747
|
class: "leading",
|
|
15560
15748
|
"aria-hidden": "true"
|
|
15561
15749
|
};
|
|
15562
|
-
const _hoisted_3$
|
|
15563
|
-
const _hoisted_4$
|
|
15750
|
+
const _hoisted_3$8 = ["id"];
|
|
15751
|
+
const _hoisted_4$6 = {
|
|
15564
15752
|
class: "trailing",
|
|
15565
15753
|
"aria-hidden": "true"
|
|
15566
15754
|
};
|
|
15567
|
-
const _sfc_main$
|
|
15755
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
15568
15756
|
__name: "BaseDropdown",
|
|
15569
15757
|
props: /* @__PURE__ */ mergeModels({
|
|
15570
15758
|
text: {},
|
|
@@ -15636,8 +15824,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
15636
15824
|
onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && emit("click")),
|
|
15637
15825
|
onKeydown
|
|
15638
15826
|
}, [
|
|
15639
|
-
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
15640
|
-
createVNode(_sfc_main$
|
|
15827
|
+
props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$b, [
|
|
15828
|
+
createVNode(_sfc_main$_, {
|
|
15641
15829
|
accessory: props.accessory,
|
|
15642
15830
|
size: "medium"
|
|
15643
15831
|
}, null, 8, ["accessory"])
|
|
@@ -15648,28 +15836,28 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
15648
15836
|
placeholder: !props.text && !__props.disabled,
|
|
15649
15837
|
missing: __props.missing
|
|
15650
15838
|
}])
|
|
15651
|
-
}, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$
|
|
15652
|
-
createElementVNode("span", _hoisted_4$
|
|
15839
|
+
}, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$8),
|
|
15840
|
+
createElementVNode("span", _hoisted_4$6, [
|
|
15653
15841
|
createVNode(KdsIcon, {
|
|
15654
15842
|
name: open.value ? "chevron-up" : "chevron-down",
|
|
15655
15843
|
size: "small"
|
|
15656
15844
|
}, null, 8, ["name"])
|
|
15657
15845
|
])
|
|
15658
|
-
], 42, _hoisted_1$
|
|
15846
|
+
], 42, _hoisted_1$m);
|
|
15659
15847
|
};
|
|
15660
15848
|
}
|
|
15661
15849
|
});
|
|
15662
15850
|
|
|
15663
|
-
const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15851
|
+
const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["__scopeId", "data-v-cf3becf9"]]);
|
|
15664
15852
|
|
|
15665
15853
|
const DROPDOWN_SEARCH_THRESHOLD = 12;
|
|
15666
15854
|
|
|
15667
|
-
const _hoisted_1$
|
|
15668
|
-
const _hoisted_2$
|
|
15855
|
+
const _hoisted_1$l = { class: "kds-dropdown-container" };
|
|
15856
|
+
const _hoisted_2$a = {
|
|
15669
15857
|
key: 0,
|
|
15670
15858
|
class: "kds-dropdown-container-sticky-top"
|
|
15671
15859
|
};
|
|
15672
|
-
const _sfc_main$
|
|
15860
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
15673
15861
|
__name: "DropdownContainer",
|
|
15674
15862
|
props: /* @__PURE__ */ mergeModels({
|
|
15675
15863
|
emptyText: {},
|
|
@@ -15752,8 +15940,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
15752
15940
|
}
|
|
15753
15941
|
});
|
|
15754
15942
|
return (_ctx, _cache) => {
|
|
15755
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
15756
|
-
searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
15943
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
15944
|
+
searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
|
|
15757
15945
|
createVNode(BaseInput, {
|
|
15758
15946
|
ref_key: "searchEl",
|
|
15759
15947
|
ref: searchEl,
|
|
@@ -15785,9 +15973,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
15785
15973
|
}
|
|
15786
15974
|
});
|
|
15787
15975
|
|
|
15788
|
-
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
15976
|
+
const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__scopeId", "data-v-db105594"]]);
|
|
15789
15977
|
|
|
15790
|
-
const _sfc_main$
|
|
15978
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
15791
15979
|
__name: "KdsDropdown",
|
|
15792
15980
|
props: /* @__PURE__ */ mergeModels({
|
|
15793
15981
|
placeholder: { default: "Select" },
|
|
@@ -15880,9 +16068,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
15880
16068
|
}
|
|
15881
16069
|
});
|
|
15882
16070
|
|
|
15883
|
-
const _hoisted_1$
|
|
15884
|
-
const _hoisted_2$
|
|
15885
|
-
const _sfc_main$
|
|
16071
|
+
const _hoisted_1$k = ["disabled"];
|
|
16072
|
+
const _hoisted_2$9 = ["title"];
|
|
16073
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
15886
16074
|
__name: "KdsListItemButton",
|
|
15887
16075
|
props: {
|
|
15888
16076
|
label: {},
|
|
@@ -15912,21 +16100,21 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
15912
16100
|
ref: labelEl,
|
|
15913
16101
|
class: "label",
|
|
15914
16102
|
title: unref(isLabelTruncated) ? props.label : void 0
|
|
15915
|
-
}, toDisplayString(props.label), 9, _hoisted_2$
|
|
15916
|
-
], 8, _hoisted_1$
|
|
16103
|
+
}, toDisplayString(props.label), 9, _hoisted_2$9)
|
|
16104
|
+
], 8, _hoisted_1$k);
|
|
15917
16105
|
};
|
|
15918
16106
|
}
|
|
15919
16107
|
});
|
|
15920
16108
|
|
|
15921
|
-
const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16109
|
+
const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__scopeId", "data-v-13945d12"]]);
|
|
15922
16110
|
|
|
15923
|
-
const _hoisted_1$
|
|
15924
|
-
const _hoisted_2$
|
|
15925
|
-
const _hoisted_3$
|
|
16111
|
+
const _hoisted_1$j = { class: "kds-multi-select-dropdown-options" };
|
|
16112
|
+
const _hoisted_2$8 = { class: "kds-multi-select-dropdown-search" };
|
|
16113
|
+
const _hoisted_3$7 = {
|
|
15926
16114
|
key: 0,
|
|
15927
16115
|
class: "kds-multi-select-dropdown-footer"
|
|
15928
16116
|
};
|
|
15929
|
-
const _sfc_main$
|
|
16117
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
15930
16118
|
__name: "MultiSelectDropdownContainer",
|
|
15931
16119
|
props: /* @__PURE__ */ mergeModels({
|
|
15932
16120
|
emptyText: {},
|
|
@@ -16042,8 +16230,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16042
16230
|
}
|
|
16043
16231
|
});
|
|
16044
16232
|
return (_ctx, _cache) => {
|
|
16045
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
16046
|
-
createElementVNode("div", _hoisted_2$
|
|
16233
|
+
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
16234
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
16047
16235
|
createVNode(BaseInput, {
|
|
16048
16236
|
ref_key: "searchEl",
|
|
16049
16237
|
ref: searchEl,
|
|
@@ -16072,7 +16260,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16072
16260
|
"aria-label": "Dropdown options",
|
|
16073
16261
|
onItemClick: _cache[4] || (_cache[4] = ($event) => $event !== void 0 && onItemClick($event))
|
|
16074
16262
|
}, null, 8, ["class", "possible-values", "loading", "empty-text"]),
|
|
16075
|
-
!__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
16263
|
+
!__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
|
|
16076
16264
|
createVNode(unref(KdsListItemButton), {
|
|
16077
16265
|
label: anyVisibleSelected.value ? "Clear all" : "Select all",
|
|
16078
16266
|
"leading-icon": anyVisibleSelected.value ? "trash" : "checkmark",
|
|
@@ -16085,9 +16273,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
16085
16273
|
}
|
|
16086
16274
|
});
|
|
16087
16275
|
|
|
16088
|
-
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16276
|
+
const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-9b631765"]]);
|
|
16089
16277
|
|
|
16090
|
-
const _sfc_main$
|
|
16278
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
16091
16279
|
__name: "KdsMultiSelectDropdown",
|
|
16092
16280
|
props: /* @__PURE__ */ mergeModels({
|
|
16093
16281
|
placeholder: { default: "Select" },
|
|
@@ -16214,9 +16402,9 @@ const kdsDimensionComponentHeight20x = 320;
|
|
|
16214
16402
|
const kdsSpacingContainer0p10x = 1;
|
|
16215
16403
|
const kdsSpacingContainer0p25x = 4;
|
|
16216
16404
|
|
|
16217
|
-
const _hoisted_1$
|
|
16218
|
-
const _hoisted_2$
|
|
16219
|
-
const _sfc_main$
|
|
16405
|
+
const _hoisted_1$i = { class: "kds-resize-handle-area" };
|
|
16406
|
+
const _hoisted_2$7 = ["aria-label"];
|
|
16407
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
16220
16408
|
__name: "ResizeHandle",
|
|
16221
16409
|
props: {
|
|
16222
16410
|
numberOfHandles: { default: 1 },
|
|
@@ -16238,7 +16426,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16238
16426
|
return `calc((100% - ${n - 1} * ${gap}) / ${2 * n})`;
|
|
16239
16427
|
});
|
|
16240
16428
|
return (_ctx, _cache) => {
|
|
16241
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
16429
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
16242
16430
|
(openBlock(true), createElementBlock(Fragment, null, renderList(normalizedNumberOfHandles.value, (i) => {
|
|
16243
16431
|
return openBlock(), createElementBlock("button", {
|
|
16244
16432
|
key: i,
|
|
@@ -16247,22 +16435,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16247
16435
|
type: "button"
|
|
16248
16436
|
}, [..._cache[0] || (_cache[0] = [
|
|
16249
16437
|
createElementVNode("span", { class: "kds-resize-handle-line" }, null, -1)
|
|
16250
|
-
])], 8, _hoisted_2$
|
|
16438
|
+
])], 8, _hoisted_2$7);
|
|
16251
16439
|
}), 128))
|
|
16252
16440
|
]);
|
|
16253
16441
|
};
|
|
16254
16442
|
}
|
|
16255
16443
|
});
|
|
16256
16444
|
|
|
16257
|
-
const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16445
|
+
const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__scopeId", "data-v-df3803d4"]]);
|
|
16258
16446
|
|
|
16259
|
-
const _hoisted_1$
|
|
16447
|
+
const _hoisted_1$h = {
|
|
16260
16448
|
ref: "content",
|
|
16261
16449
|
class: "kds-resize-container-content"
|
|
16262
16450
|
};
|
|
16263
16451
|
const DEFAULT_INITIAL_HEIGHT = 200;
|
|
16264
16452
|
const KEYBOARD_RESIZE_STEP = 10;
|
|
16265
|
-
const _sfc_main$
|
|
16453
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
16266
16454
|
__name: "KdsResizeContainer",
|
|
16267
16455
|
props: {
|
|
16268
16456
|
height: { default: () => DEFAULT_INITIAL_HEIGHT },
|
|
@@ -16325,7 +16513,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
16325
16513
|
return openBlock(), createElementBlock("div", {
|
|
16326
16514
|
class: normalizeClass(["kds-resize-container", { dragging: unref(activePointerId) !== null }])
|
|
16327
16515
|
}, [
|
|
16328
|
-
createElementVNode("div", _hoisted_1$
|
|
16516
|
+
createElementVNode("div", _hoisted_1$h, [
|
|
16329
16517
|
renderSlot(_ctx.$slots, "default", { contentStyle: contentStyle.value }, void 0, true)
|
|
16330
16518
|
], 512),
|
|
16331
16519
|
createVNode(ResizeHandle, {
|
|
@@ -16343,7 +16531,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
16343
16531
|
}
|
|
16344
16532
|
});
|
|
16345
16533
|
|
|
16346
|
-
const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
16534
|
+
const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-46b33b01"]]);
|
|
16347
16535
|
|
|
16348
16536
|
const CLICK_META_KEY_TIMEOUT = 250;
|
|
16349
16537
|
const useMultiSelectListBoxSelection = ({
|
|
@@ -16635,17 +16823,17 @@ const useMultiSelectListBoxSelection = ({
|
|
|
16635
16823
|
};
|
|
16636
16824
|
};
|
|
16637
16825
|
|
|
16638
|
-
const _hoisted_1$
|
|
16639
|
-
const _hoisted_2$
|
|
16640
|
-
const _hoisted_3$
|
|
16826
|
+
const _hoisted_1$g = ["id", "tabindex", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-activedescendant", "aria-disabled", "onKeydown"];
|
|
16827
|
+
const _hoisted_2$6 = { class: "kds-multiselect-list-box-content-grid" };
|
|
16828
|
+
const _hoisted_3$6 = {
|
|
16641
16829
|
key: 0,
|
|
16642
16830
|
class: "kds-multiselect-sticky-bottom"
|
|
16643
16831
|
};
|
|
16644
|
-
const _hoisted_4$
|
|
16832
|
+
const _hoisted_4$5 = {
|
|
16645
16833
|
key: 0,
|
|
16646
16834
|
class: "kds-multiselect-empty"
|
|
16647
16835
|
};
|
|
16648
|
-
const _sfc_main$
|
|
16836
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
16649
16837
|
__name: "KdsMultiSelectListBox",
|
|
16650
16838
|
props: /* @__PURE__ */ mergeModels({
|
|
16651
16839
|
description: {},
|
|
@@ -16816,7 +17004,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16816
17004
|
}, {
|
|
16817
17005
|
default: withCtx(({ contentStyle }) => [
|
|
16818
17006
|
createElementVNode("div", {
|
|
16819
|
-
class:
|
|
17007
|
+
class: normalizeClass([
|
|
17008
|
+
"kds-multiselect-list-box",
|
|
17009
|
+
{ error: __props.error, disabled: effectiveDisabled.value }
|
|
17010
|
+
]),
|
|
16820
17011
|
style: normalizeStyle(contentStyle)
|
|
16821
17012
|
}, [
|
|
16822
17013
|
createElementVNode("div", mergeProps(unref(containerProps), {
|
|
@@ -16895,7 +17086,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16895
17086
|
onBlur: _cache[17] || (_cache[17] = //@ts-ignore
|
|
16896
17087
|
(...args) => unref(onBlur) && unref(onBlur)(...args))
|
|
16897
17088
|
}), [
|
|
16898
|
-
createElementVNode("div", _hoisted_2$
|
|
17089
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
16899
17090
|
createElementVNode("div", mergeProps({ class: "kds-multiselect-list-box-content" }, unref(wrapperProps)), [
|
|
16900
17091
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(virtualList), ({ data: item, index }) => {
|
|
16901
17092
|
return openBlock(), createBlock(unref(KdsListItem), {
|
|
@@ -16908,20 +17099,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16908
17099
|
label: item.text,
|
|
16909
17100
|
accessory: item.accessory,
|
|
16910
17101
|
missing: item.missing,
|
|
17102
|
+
special: item.special,
|
|
16911
17103
|
"data-option-index": index,
|
|
16912
17104
|
selected: unref(isCurrentValue)(item.id),
|
|
16913
17105
|
disabled: effectiveDisabled.value,
|
|
16914
17106
|
active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === index,
|
|
16915
|
-
"trailing-icon":
|
|
17107
|
+
"trailing-icon": unref(isCurrentValue)(item.id) ? "checkmark" : void 0,
|
|
16916
17108
|
onDblclick: [
|
|
16917
17109
|
withModifiers(($event) => handleDblClick(item.id, index), ["exact"]),
|
|
16918
17110
|
_cache[0] || (_cache[0] = withModifiers(($event) => handleShiftDblClick(), ["shift"]))
|
|
16919
17111
|
],
|
|
16920
17112
|
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"]);
|
|
17113
|
+
}, null, 8, ["id", "class", "label", "accessory", "missing", "special", "data-option-index", "selected", "disabled", "active", "trailing-icon", "onDblclick", "onClick"]);
|
|
16922
17114
|
}), 128))
|
|
16923
17115
|
], 16),
|
|
16924
|
-
visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
17116
|
+
visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
|
|
16925
17117
|
createVNode(unref(KdsListItem), {
|
|
16926
17118
|
id: generateOptionId(visibleBottomValue.value.id),
|
|
16927
17119
|
label: visibleBottomValue.value.text,
|
|
@@ -16932,7 +17124,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16932
17124
|
disabled: effectiveDisabled.value,
|
|
16933
17125
|
active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === bottomIndex.value,
|
|
16934
17126
|
special: "",
|
|
16935
|
-
"trailing-icon":
|
|
17127
|
+
"trailing-icon": unref(isCurrentValue)(visibleBottomValue.value.id) ? "checkmark" : void 0,
|
|
16936
17128
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(handleClick)($event, visibleBottomValue.value.id, bottomIndex.value)),
|
|
16937
17129
|
onDblclick: [
|
|
16938
17130
|
_cache[2] || (_cache[2] = withModifiers(($event) => handleShiftDblClick(), ["shift"])),
|
|
@@ -16941,14 +17133,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16941
17133
|
}, null, 8, ["id", "label", "accessory", "missing", "data-option-index", "selected", "disabled", "active", "trailing-icon"])
|
|
16942
17134
|
])) : createCommentVNode("", true)
|
|
16943
17135
|
])
|
|
16944
|
-
], 16, _hoisted_1$
|
|
16945
|
-
visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
17136
|
+
], 16, _hoisted_1$g),
|
|
17137
|
+
visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
|
|
16946
17138
|
createVNode(KdsEmptyState, {
|
|
16947
17139
|
headline: __props.loading ? "Loading data…" : __props.emptyStateLabel,
|
|
16948
17140
|
"loading-spinner": __props.loading
|
|
16949
17141
|
}, null, 8, ["headline", "loading-spinner"])
|
|
16950
17142
|
])) : createCommentVNode("", true)
|
|
16951
|
-
],
|
|
17143
|
+
], 6)
|
|
16952
17144
|
]),
|
|
16953
17145
|
_: 2
|
|
16954
17146
|
}, 1032, ["height", "min-height"]))
|
|
@@ -16959,12 +17151,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16959
17151
|
}
|
|
16960
17152
|
});
|
|
16961
17153
|
|
|
16962
|
-
const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17154
|
+
const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-24af1af0"]]);
|
|
16963
17155
|
|
|
16964
|
-
const _hoisted_1$
|
|
16965
|
-
const _hoisted_2$
|
|
16966
|
-
const _hoisted_3$
|
|
16967
|
-
const _hoisted_4$
|
|
17156
|
+
const _hoisted_1$f = { class: "kds-list-column" };
|
|
17157
|
+
const _hoisted_2$5 = { class: "kds-list-header" };
|
|
17158
|
+
const _hoisted_3$5 = { class: "kds-list-label" };
|
|
17159
|
+
const _hoisted_4$4 = {
|
|
16968
17160
|
key: 0,
|
|
16969
17161
|
class: "kds-list-count"
|
|
16970
17162
|
};
|
|
@@ -16977,10 +17169,11 @@ const _hoisted_9 = {
|
|
|
16977
17169
|
class: "kds-list-count"
|
|
16978
17170
|
};
|
|
16979
17171
|
const UNKNOWN_VALUE_ID = "__unknown-value-option__";
|
|
16980
|
-
const _sfc_main$
|
|
17172
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
16981
17173
|
__name: "TwinListBody",
|
|
16982
17174
|
props: /* @__PURE__ */ mergeModels({
|
|
16983
17175
|
disabled: { type: Boolean, default: false },
|
|
17176
|
+
error: { type: Boolean, default: false },
|
|
16984
17177
|
possibleValues: {},
|
|
16985
17178
|
searchTerm: { default: "" },
|
|
16986
17179
|
excludeLabel: { default: "Exclude" },
|
|
@@ -16994,7 +17187,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
16994
17187
|
}),
|
|
16995
17188
|
emits: ["update:modelValue"],
|
|
16996
17189
|
setup(__props) {
|
|
16997
|
-
const props = createPropsRestProxy(__props, ["disabled", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
|
|
17190
|
+
const props = createPropsRestProxy(__props, ["disabled", "error", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
|
|
16998
17191
|
const modelValue = useModel(__props, "modelValue");
|
|
16999
17192
|
const effectiveDisabled = computed(() => __props.disabled || __props.loading);
|
|
17000
17193
|
const leftSelected = ref([]);
|
|
@@ -17150,10 +17343,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17150
17343
|
class: "kds-twin-list-body",
|
|
17151
17344
|
style: normalizeStyle(contentStyle)
|
|
17152
17345
|
}, [
|
|
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$
|
|
17346
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
17347
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
17348
|
+
createElementVNode("span", _hoisted_3$5, toDisplayString(__props.excludeLabel), 1),
|
|
17349
|
+
!__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(leftOptions.value.length) + " of " + toDisplayString(excludedItems.value.length), 1)) : createCommentVNode("", true)
|
|
17157
17350
|
]),
|
|
17158
17351
|
createVNode(unref(KdsMultiSelectListBox), {
|
|
17159
17352
|
modelValue: leftSelected.value,
|
|
@@ -17162,6 +17355,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17162
17355
|
"possible-values": leftOptions.value,
|
|
17163
17356
|
ariaLabel: __props.excludeLabel,
|
|
17164
17357
|
disabled: effectiveDisabled.value,
|
|
17358
|
+
error: __props.error,
|
|
17165
17359
|
loading: __props.loading,
|
|
17166
17360
|
"empty-state-label": props.emptyStateLabel,
|
|
17167
17361
|
"bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === false ? unknownValueOption.value : void 0,
|
|
@@ -17169,10 +17363,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17169
17363
|
onDoubleClickShift: moveRight,
|
|
17170
17364
|
onKeyArrowRight: moveRight,
|
|
17171
17365
|
onKeyEnter: moveRight
|
|
17172
|
-
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
|
|
17366
|
+
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
|
|
17173
17367
|
]),
|
|
17174
17368
|
createElementVNode("div", _hoisted_5$1, [
|
|
17175
|
-
createVNode(unref(_sfc_main
|
|
17369
|
+
createVNode(unref(_sfc_main$14), {
|
|
17176
17370
|
"leading-icon": "chevron-right",
|
|
17177
17371
|
ariaLabel: "Move selected values right",
|
|
17178
17372
|
title: "Move selected values right",
|
|
@@ -17181,7 +17375,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17181
17375
|
disabled: effectiveDisabled.value || leftSelected.value.length === 0,
|
|
17182
17376
|
onClick: _cache[2] || (_cache[2] = ($event) => moveRight(leftSelected.value))
|
|
17183
17377
|
}, null, 8, ["disabled"]),
|
|
17184
|
-
createVNode(unref(_sfc_main
|
|
17378
|
+
createVNode(unref(_sfc_main$14), {
|
|
17185
17379
|
"leading-icon": "chevron-right-double",
|
|
17186
17380
|
ariaLabel: "Move all values right",
|
|
17187
17381
|
title: "Move all values right",
|
|
@@ -17193,7 +17387,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17193
17387
|
...showUnknownValues.value && !modelValue.value.includeUnknownValues ? [UNKNOWN_VALUE_ID] : []
|
|
17194
17388
|
]))
|
|
17195
17389
|
}, null, 8, ["disabled"]),
|
|
17196
|
-
createVNode(unref(_sfc_main
|
|
17390
|
+
createVNode(unref(_sfc_main$14), {
|
|
17197
17391
|
"leading-icon": "chevron-left",
|
|
17198
17392
|
ariaLabel: "Move selected values left",
|
|
17199
17393
|
title: "Move selected values left",
|
|
@@ -17202,7 +17396,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17202
17396
|
disabled: effectiveDisabled.value || rightSelected.value.length === 0,
|
|
17203
17397
|
onClick: _cache[4] || (_cache[4] = ($event) => moveLeft(rightSelected.value))
|
|
17204
17398
|
}, null, 8, ["disabled"]),
|
|
17205
|
-
createVNode(unref(_sfc_main
|
|
17399
|
+
createVNode(unref(_sfc_main$14), {
|
|
17206
17400
|
"leading-icon": "chevron-left-double",
|
|
17207
17401
|
ariaLabel: "Move all values left",
|
|
17208
17402
|
title: "Move all values left",
|
|
@@ -17227,6 +17421,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17227
17421
|
"possible-values": rightOptions.value,
|
|
17228
17422
|
ariaLabel: __props.includeLabel,
|
|
17229
17423
|
disabled: effectiveDisabled.value,
|
|
17424
|
+
error: __props.error,
|
|
17230
17425
|
loading: __props.loading,
|
|
17231
17426
|
"empty-state-label": props.emptyStateLabel,
|
|
17232
17427
|
"bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === true ? unknownValueOption.value : void 0,
|
|
@@ -17234,7 +17429,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17234
17429
|
onDoubleClickShift: moveLeft,
|
|
17235
17430
|
onKeyArrowLeft: moveLeft,
|
|
17236
17431
|
onKeyEnter: moveLeft
|
|
17237
|
-
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
|
|
17432
|
+
}, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
|
|
17238
17433
|
])
|
|
17239
17434
|
], 4)
|
|
17240
17435
|
]),
|
|
@@ -17244,7 +17439,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
17244
17439
|
}
|
|
17245
17440
|
});
|
|
17246
17441
|
|
|
17247
|
-
const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17442
|
+
const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-8a9e1b15"]]);
|
|
17248
17443
|
|
|
17249
17444
|
const kdsTwinListSearchMode = {
|
|
17250
17445
|
MANUAL: "manual",
|
|
@@ -17253,7 +17448,7 @@ const kdsTwinListSearchMode = {
|
|
|
17253
17448
|
};
|
|
17254
17449
|
const kdsTwinListSearchModes = Object.values(kdsTwinListSearchMode);
|
|
17255
17450
|
|
|
17256
|
-
const _sfc_main$
|
|
17451
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
17257
17452
|
__name: "TwinListHeader",
|
|
17258
17453
|
props: /* @__PURE__ */ mergeModels({
|
|
17259
17454
|
filterTypes: { default: () => void 0 },
|
|
@@ -17329,7 +17524,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17329
17524
|
ariaLabel: "Search values",
|
|
17330
17525
|
placeholder: "Search",
|
|
17331
17526
|
disabled: __props.disabled
|
|
17332
|
-
}, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$
|
|
17527
|
+
}, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$u), {
|
|
17333
17528
|
key: 2,
|
|
17334
17529
|
modelValue: pattern.value,
|
|
17335
17530
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pattern.value = $event),
|
|
@@ -17343,7 +17538,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17343
17538
|
placeholder: "Pattern",
|
|
17344
17539
|
disabled: __props.disabled,
|
|
17345
17540
|
"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$
|
|
17541
|
+
}, null, 8, ["modelValue", "case-sensitive", "exclude-matches", "use-regex", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$m), {
|
|
17347
17542
|
key: 3,
|
|
17348
17543
|
modelValue: selectedTypes.value,
|
|
17349
17544
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => selectedTypes.value = $event),
|
|
@@ -17357,8 +17552,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
17357
17552
|
}
|
|
17358
17553
|
});
|
|
17359
17554
|
|
|
17360
|
-
const _hoisted_1$
|
|
17361
|
-
const _sfc_main$
|
|
17555
|
+
const _hoisted_1$e = { class: "kds-twin-list" };
|
|
17556
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
17362
17557
|
__name: "KdsTwinList",
|
|
17363
17558
|
props: /* @__PURE__ */ mergeModels({
|
|
17364
17559
|
description: {},
|
|
@@ -17489,8 +17684,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17489
17684
|
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
17490
17685
|
}, {
|
|
17491
17686
|
default: withCtx(() => [
|
|
17492
|
-
createElementVNode("div", _hoisted_1$
|
|
17493
|
-
createVNode(_sfc_main$
|
|
17687
|
+
createElementVNode("div", _hoisted_1$e, [
|
|
17688
|
+
createVNode(_sfc_main$h, {
|
|
17494
17689
|
mode: mode.value,
|
|
17495
17690
|
"onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
|
|
17496
17691
|
pattern: pattern.value,
|
|
@@ -17514,6 +17709,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17514
17709
|
modelValue: effectiveBodyModel.value,
|
|
17515
17710
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => effectiveBodyModel.value = $event),
|
|
17516
17711
|
disabled: __props.disabled || mode.value !== unref(kdsTwinListSearchMode).MANUAL,
|
|
17712
|
+
error: __props.error,
|
|
17517
17713
|
"possible-values": __props.possibleValues,
|
|
17518
17714
|
"search-term": searchTerm.value,
|
|
17519
17715
|
"exclude-label": props.excludeLabel,
|
|
@@ -17521,7 +17717,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17521
17717
|
"unknown-values-text": props.unknownValuesText,
|
|
17522
17718
|
"empty-state-label": props.emptyStateLabel,
|
|
17523
17719
|
loading: __props.loading
|
|
17524
|
-
}, null, 8, ["modelValue", "disabled", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
|
|
17720
|
+
}, null, 8, ["modelValue", "disabled", "error", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
|
|
17525
17721
|
])
|
|
17526
17722
|
]),
|
|
17527
17723
|
_: 1
|
|
@@ -17530,10 +17726,217 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
17530
17726
|
}
|
|
17531
17727
|
});
|
|
17532
17728
|
|
|
17533
|
-
const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17729
|
+
const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-1a9327b5"]]);
|
|
17534
17730
|
|
|
17535
|
-
const
|
|
17536
|
-
|
|
17731
|
+
const useSortableListBoxReorder = ({
|
|
17732
|
+
orderedIds,
|
|
17733
|
+
selection,
|
|
17734
|
+
disabled
|
|
17735
|
+
}) => {
|
|
17736
|
+
const selectedIndices = computed(() => {
|
|
17737
|
+
const selected = new Set(selection.value);
|
|
17738
|
+
return orderedIds.value.map((id, i) => ({ id, index: i })).filter((v) => selected.has(v.id)).map((v) => v.index);
|
|
17739
|
+
});
|
|
17740
|
+
const canMoveUp = computed(
|
|
17741
|
+
() => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[0] > 0
|
|
17742
|
+
);
|
|
17743
|
+
const canMoveDown = computed(
|
|
17744
|
+
() => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[selectedIndices.value.length - 1] < orderedIds.value.length - 1
|
|
17745
|
+
);
|
|
17746
|
+
const reorder = (direction) => {
|
|
17747
|
+
const ids = [...orderedIds.value];
|
|
17748
|
+
const indices = selectedIndices.value;
|
|
17749
|
+
if (indices.length === 0) {
|
|
17750
|
+
return ids;
|
|
17751
|
+
}
|
|
17752
|
+
const movingIds = indices.map((i) => ids[i]);
|
|
17753
|
+
const indexSet = new Set(indices);
|
|
17754
|
+
const remaining = ids.filter((_, i) => !indexSet.has(i));
|
|
17755
|
+
let insertAt;
|
|
17756
|
+
if (direction === "top") {
|
|
17757
|
+
insertAt = 0;
|
|
17758
|
+
} else if (direction === "bottom") {
|
|
17759
|
+
insertAt = remaining.length;
|
|
17760
|
+
} else if (direction === "up") {
|
|
17761
|
+
insertAt = Math.max(0, indices[0] - 1);
|
|
17762
|
+
} else {
|
|
17763
|
+
insertAt = Math.min(
|
|
17764
|
+
remaining.length,
|
|
17765
|
+
indices[indices.length - 1] - indices.length + 2
|
|
17766
|
+
);
|
|
17767
|
+
}
|
|
17768
|
+
remaining.splice(insertAt, 0, ...movingIds);
|
|
17769
|
+
return remaining;
|
|
17770
|
+
};
|
|
17771
|
+
const sortByText = (ascending, optionLookup) => {
|
|
17772
|
+
const sorted = [...orderedIds.value].sort((a, b) => {
|
|
17773
|
+
const textA = optionLookup.get(a)?.text ?? a;
|
|
17774
|
+
const textB = optionLookup.get(b)?.text ?? b;
|
|
17775
|
+
return ascending ? textA.localeCompare(textB) : textB.localeCompare(textA);
|
|
17776
|
+
});
|
|
17777
|
+
return sorted;
|
|
17778
|
+
};
|
|
17779
|
+
return {
|
|
17780
|
+
selectedIndices,
|
|
17781
|
+
canMoveUp,
|
|
17782
|
+
canMoveDown,
|
|
17783
|
+
reorder,
|
|
17784
|
+
sortByText
|
|
17785
|
+
};
|
|
17786
|
+
};
|
|
17787
|
+
|
|
17788
|
+
const _hoisted_1$d = { class: "kds-sortable-list-box-wrapper" };
|
|
17789
|
+
const _hoisted_2$4 = { class: "kds-sortable-top-buttons" };
|
|
17790
|
+
const _hoisted_3$4 = { class: "kds-sortable-top-buttons-left" };
|
|
17791
|
+
const _hoisted_4$3 = { class: "kds-sortable-footer-buttons" };
|
|
17792
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
17793
|
+
__name: "KdsSortableListBox",
|
|
17794
|
+
props: /* @__PURE__ */ mergeModels({
|
|
17795
|
+
possibleValues: {},
|
|
17796
|
+
disabled: { type: Boolean, default: false },
|
|
17797
|
+
description: {},
|
|
17798
|
+
label: {},
|
|
17799
|
+
ariaLabel: {},
|
|
17800
|
+
id: {},
|
|
17801
|
+
subText: {},
|
|
17802
|
+
error: { type: Boolean, default: false },
|
|
17803
|
+
validating: { type: Boolean, default: false },
|
|
17804
|
+
preserveSubTextSpace: { type: Boolean, default: false }
|
|
17805
|
+
}, {
|
|
17806
|
+
"modelValue": { required: true },
|
|
17807
|
+
"modelModifiers": {}
|
|
17808
|
+
}),
|
|
17809
|
+
emits: ["update:modelValue"],
|
|
17810
|
+
setup(__props, { expose: __expose }) {
|
|
17811
|
+
const formFieldProps = createPropsRestProxy(__props, ["possibleValues", "disabled", "error", "validating", "preserveSubTextSpace"]);
|
|
17812
|
+
const modelValue = useModel(__props, "modelValue");
|
|
17813
|
+
const selection = ref([]);
|
|
17814
|
+
const optionLookup = computed(() => {
|
|
17815
|
+
const map = /* @__PURE__ */ new Map();
|
|
17816
|
+
for (const option of __props.possibleValues) {
|
|
17817
|
+
map.set(option.id, option);
|
|
17818
|
+
}
|
|
17819
|
+
return map;
|
|
17820
|
+
});
|
|
17821
|
+
const orderedOptions = computed(
|
|
17822
|
+
() => modelValue.value.map(
|
|
17823
|
+
(id) => optionLookup.value.get(id) ?? { id, text: id, missing: true }
|
|
17824
|
+
)
|
|
17825
|
+
);
|
|
17826
|
+
const listBoxRef = useTemplateRef("listBoxRef");
|
|
17827
|
+
const { canMoveUp, canMoveDown, reorder, sortByText } = useSortableListBoxReorder({
|
|
17828
|
+
orderedIds: modelValue,
|
|
17829
|
+
selection,
|
|
17830
|
+
disabled: toRef(() => __props.disabled)
|
|
17831
|
+
});
|
|
17832
|
+
const applyReorder = (newOrder) => {
|
|
17833
|
+
modelValue.value = newOrder;
|
|
17834
|
+
};
|
|
17835
|
+
const moveUp = () => canMoveUp.value && applyReorder(reorder("up"));
|
|
17836
|
+
const moveDown = () => canMoveDown.value && applyReorder(reorder("down"));
|
|
17837
|
+
const moveToTop = () => canMoveUp.value && applyReorder(reorder("top"));
|
|
17838
|
+
const moveToBottom = () => canMoveDown.value && applyReorder(reorder("bottom"));
|
|
17839
|
+
const resetOrder = () => applyReorder(__props.possibleValues.map((option) => option.id));
|
|
17840
|
+
const focus = () => listBoxRef.value?.focus();
|
|
17841
|
+
__expose({ focus });
|
|
17842
|
+
return (_ctx, _cache) => {
|
|
17843
|
+
return openBlock(), createBlock(BaseFieldsetWrapper, mergeProps(formFieldProps, {
|
|
17844
|
+
error: __props.error,
|
|
17845
|
+
validating: __props.validating,
|
|
17846
|
+
"preserve-sub-text-space": __props.preserveSubTextSpace
|
|
17847
|
+
}), {
|
|
17848
|
+
default: withCtx(() => [
|
|
17849
|
+
createElementVNode("div", _hoisted_1$d, [
|
|
17850
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
17851
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
17852
|
+
createVNode(_sfc_main$14, {
|
|
17853
|
+
size: "small",
|
|
17854
|
+
variant: "transparent",
|
|
17855
|
+
"leading-icon": "sort-descending",
|
|
17856
|
+
label: "A – Z",
|
|
17857
|
+
disabled: __props.disabled,
|
|
17858
|
+
onClick: _cache[0] || (_cache[0] = ($event) => applyReorder(unref(sortByText)(true, optionLookup.value)))
|
|
17859
|
+
}, null, 8, ["disabled"]),
|
|
17860
|
+
createVNode(_sfc_main$14, {
|
|
17861
|
+
size: "small",
|
|
17862
|
+
variant: "transparent",
|
|
17863
|
+
"leading-icon": "sort-ascending",
|
|
17864
|
+
label: "Z – A",
|
|
17865
|
+
disabled: __props.disabled,
|
|
17866
|
+
onClick: _cache[1] || (_cache[1] = ($event) => applyReorder(unref(sortByText)(false, optionLookup.value)))
|
|
17867
|
+
}, null, 8, ["disabled"])
|
|
17868
|
+
]),
|
|
17869
|
+
createVNode(_sfc_main$14, {
|
|
17870
|
+
size: "small",
|
|
17871
|
+
variant: "transparent",
|
|
17872
|
+
destructive: "",
|
|
17873
|
+
label: "Reset all",
|
|
17874
|
+
disabled: __props.disabled,
|
|
17875
|
+
onClick: resetOrder
|
|
17876
|
+
}, null, 8, ["disabled"])
|
|
17877
|
+
]),
|
|
17878
|
+
createVNode(KdsMultiSelectListBox, {
|
|
17879
|
+
ref_key: "listBoxRef",
|
|
17880
|
+
ref: listBoxRef,
|
|
17881
|
+
modelValue: selection.value,
|
|
17882
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selection.value = $event),
|
|
17883
|
+
"possible-values": orderedOptions.value,
|
|
17884
|
+
disabled: __props.disabled,
|
|
17885
|
+
error: __props.error,
|
|
17886
|
+
"use-resize-handle": true,
|
|
17887
|
+
ariaLabel: formFieldProps.label ?? formFieldProps.ariaLabel ?? ""
|
|
17888
|
+
/* fallback only for TS */
|
|
17889
|
+
}, null, 8, ["modelValue", "possible-values", "disabled", "error", "ariaLabel"]),
|
|
17890
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
17891
|
+
createVNode(_sfc_main$14, {
|
|
17892
|
+
size: "small",
|
|
17893
|
+
variant: "transparent",
|
|
17894
|
+
"leading-icon": "to-top",
|
|
17895
|
+
label: "Top",
|
|
17896
|
+
title: "Move to top",
|
|
17897
|
+
disabled: __props.disabled || !unref(canMoveUp),
|
|
17898
|
+
onClick: moveToTop
|
|
17899
|
+
}, null, 8, ["disabled"]),
|
|
17900
|
+
createVNode(_sfc_main$14, {
|
|
17901
|
+
size: "small",
|
|
17902
|
+
variant: "transparent",
|
|
17903
|
+
"leading-icon": "to-bottom",
|
|
17904
|
+
label: "Bottom",
|
|
17905
|
+
title: "Move to bottom",
|
|
17906
|
+
disabled: __props.disabled || !unref(canMoveDown),
|
|
17907
|
+
onClick: moveToBottom
|
|
17908
|
+
}, null, 8, ["disabled"]),
|
|
17909
|
+
createVNode(_sfc_main$14, {
|
|
17910
|
+
size: "small",
|
|
17911
|
+
variant: "transparent",
|
|
17912
|
+
"leading-icon": "arrow-up",
|
|
17913
|
+
label: "Up",
|
|
17914
|
+
title: "Move up",
|
|
17915
|
+
disabled: __props.disabled || !unref(canMoveUp),
|
|
17916
|
+
onClick: moveUp
|
|
17917
|
+
}, null, 8, ["disabled"]),
|
|
17918
|
+
createVNode(_sfc_main$14, {
|
|
17919
|
+
size: "small",
|
|
17920
|
+
variant: "transparent",
|
|
17921
|
+
"leading-icon": "arrow-down",
|
|
17922
|
+
label: "Down",
|
|
17923
|
+
title: "Move down",
|
|
17924
|
+
disabled: __props.disabled || !unref(canMoveDown),
|
|
17925
|
+
onClick: moveDown
|
|
17926
|
+
}, null, 8, ["disabled"])
|
|
17927
|
+
])
|
|
17928
|
+
])
|
|
17929
|
+
]),
|
|
17930
|
+
_: 1
|
|
17931
|
+
}, 16, ["error", "validating", "preserve-sub-text-space"]);
|
|
17932
|
+
};
|
|
17933
|
+
}
|
|
17934
|
+
});
|
|
17935
|
+
|
|
17936
|
+
const KdsSortableListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-ee7b63e2"]]);
|
|
17937
|
+
|
|
17938
|
+
const _hoisted_1$c = { class: "kds-info-popover-content" };
|
|
17939
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
17537
17940
|
__name: "InfoPopover",
|
|
17538
17941
|
props: {
|
|
17539
17942
|
content: {}
|
|
@@ -17541,7 +17944,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
17541
17944
|
setup(__props) {
|
|
17542
17945
|
const props = __props;
|
|
17543
17946
|
return (_ctx, _cache) => {
|
|
17544
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
17947
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
17545
17948
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
17546
17949
|
createTextVNode(toDisplayString(props.content), 1)
|
|
17547
17950
|
], true)
|
|
@@ -17550,11 +17953,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
17550
17953
|
}
|
|
17551
17954
|
});
|
|
17552
17955
|
|
|
17553
|
-
const InfoPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
17956
|
+
const InfoPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__scopeId", "data-v-951f2a2b"]]);
|
|
17554
17957
|
|
|
17555
|
-
const _hoisted_1$
|
|
17958
|
+
const _hoisted_1$b = ["aria-pressed", "aria-expanded", "aria-controls"];
|
|
17556
17959
|
const TITLE = "Click for more information";
|
|
17557
|
-
const _sfc_main$
|
|
17960
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
17558
17961
|
__name: "KdsInfoToggleButton",
|
|
17559
17962
|
props: /* @__PURE__ */ mergeModels({
|
|
17560
17963
|
content: {},
|
|
@@ -17596,7 +17999,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
17596
17999
|
name: "circle-question",
|
|
17597
18000
|
size: "small"
|
|
17598
18001
|
})
|
|
17599
|
-
], 16, _hoisted_1$
|
|
18002
|
+
], 16, _hoisted_1$b),
|
|
17600
18003
|
createVNode(KdsPopover, {
|
|
17601
18004
|
ref_key: "popoverEl",
|
|
17602
18005
|
ref: popoverEl,
|
|
@@ -17623,18 +18026,18 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
17623
18026
|
}
|
|
17624
18027
|
});
|
|
17625
18028
|
|
|
17626
|
-
const KdsInfoToggleButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18029
|
+
const KdsInfoToggleButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-2e9ef96a"]]);
|
|
17627
18030
|
|
|
17628
18031
|
const KdsInfoToggleButton$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
17629
18032
|
__proto__: null,
|
|
17630
18033
|
default: KdsInfoToggleButton
|
|
17631
18034
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
17632
18035
|
|
|
17633
|
-
const _hoisted_1$
|
|
18036
|
+
const _hoisted_1$a = {
|
|
17634
18037
|
class: "kds-variable-popover",
|
|
17635
18038
|
tabindex: "0"
|
|
17636
18039
|
};
|
|
17637
|
-
const _sfc_main$
|
|
18040
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
17638
18041
|
__name: "VariablePopover",
|
|
17639
18042
|
props: {
|
|
17640
18043
|
content: {}
|
|
@@ -17642,7 +18045,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
17642
18045
|
setup(__props) {
|
|
17643
18046
|
const props = __props;
|
|
17644
18047
|
return (_ctx, _cache) => {
|
|
17645
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
18048
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
17646
18049
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
17647
18050
|
createTextVNode(toDisplayString(props.content), 1)
|
|
17648
18051
|
], true)
|
|
@@ -17651,10 +18054,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
17651
18054
|
}
|
|
17652
18055
|
});
|
|
17653
18056
|
|
|
17654
|
-
const VariablePopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18057
|
+
const VariablePopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-8a0c56d0"]]);
|
|
17655
18058
|
|
|
17656
|
-
const _hoisted_1$
|
|
17657
|
-
const _sfc_main$
|
|
18059
|
+
const _hoisted_1$9 = ["title", "aria-label", "aria-pressed", "aria-expanded", "aria-controls"];
|
|
18060
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
17658
18061
|
__name: "KdsVariableToggleButton",
|
|
17659
18062
|
props: /* @__PURE__ */ mergeModels({
|
|
17660
18063
|
content: {},
|
|
@@ -17743,7 +18146,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
17743
18146
|
name: iconName.value,
|
|
17744
18147
|
size: "small"
|
|
17745
18148
|
}, null, 8, ["name"])
|
|
17746
|
-
], 16, _hoisted_1$
|
|
18149
|
+
], 16, _hoisted_1$9),
|
|
17747
18150
|
createVNode(KdsPopover, {
|
|
17748
18151
|
ref_key: "popoverEl",
|
|
17749
18152
|
ref: popoverEl,
|
|
@@ -17771,10 +18174,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
17771
18174
|
}
|
|
17772
18175
|
});
|
|
17773
18176
|
|
|
17774
|
-
const KdsVariableToggleButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18177
|
+
const KdsVariableToggleButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__scopeId", "data-v-b6d29842"]]);
|
|
17775
18178
|
|
|
17776
|
-
const _hoisted_1$
|
|
17777
|
-
const _sfc_main$
|
|
18179
|
+
const _hoisted_1$8 = ["aria-label", "aria-labelledby", "aria-pressed", "disabled"];
|
|
18180
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
17778
18181
|
__name: "KdsCardClickable",
|
|
17779
18182
|
props: /* @__PURE__ */ mergeModels({
|
|
17780
18183
|
variant: { default: "filled" },
|
|
@@ -17809,12 +18212,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
17809
18212
|
onClick: handleClick
|
|
17810
18213
|
}, [
|
|
17811
18214
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
17812
|
-
], 10, _hoisted_1$
|
|
18215
|
+
], 10, _hoisted_1$8);
|
|
17813
18216
|
};
|
|
17814
18217
|
}
|
|
17815
18218
|
});
|
|
17816
18219
|
|
|
17817
|
-
const KdsCardClickable = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18220
|
+
const KdsCardClickable = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__scopeId", "data-v-4607badd"]]);
|
|
17818
18221
|
|
|
17819
18222
|
const kdsCardVariant = {
|
|
17820
18223
|
FILLED: "filled",
|
|
@@ -17823,7 +18226,36 @@ const kdsCardVariant = {
|
|
|
17823
18226
|
};
|
|
17824
18227
|
const kdsCardVariants = Object.values(kdsCardVariant);
|
|
17825
18228
|
|
|
17826
|
-
const
|
|
18229
|
+
const _hoisted_1$7 = { class: "kds-panel-header" };
|
|
18230
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
18231
|
+
__name: "KdsPanelHeader",
|
|
18232
|
+
props: {
|
|
18233
|
+
headline: {}
|
|
18234
|
+
},
|
|
18235
|
+
emits: ["close"],
|
|
18236
|
+
setup(__props, { emit: __emit }) {
|
|
18237
|
+
const emit = __emit;
|
|
18238
|
+
const handleClick = (event) => emit("close", event);
|
|
18239
|
+
return (_ctx, _cache) => {
|
|
18240
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
18241
|
+
createElementVNode("h6", null, toDisplayString(__props.headline), 1),
|
|
18242
|
+
createVNode(_sfc_main$14, {
|
|
18243
|
+
class: "kds-close-button",
|
|
18244
|
+
type: "button",
|
|
18245
|
+
"leading-icon": "x-close",
|
|
18246
|
+
size: "small",
|
|
18247
|
+
ariaLabel: "Close panel",
|
|
18248
|
+
variant: "transparent",
|
|
18249
|
+
onClick: handleClick
|
|
18250
|
+
})
|
|
18251
|
+
]);
|
|
18252
|
+
};
|
|
18253
|
+
}
|
|
18254
|
+
});
|
|
18255
|
+
|
|
18256
|
+
const KdsPanelHeader = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-be5bccc5"]]);
|
|
18257
|
+
|
|
18258
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
17827
18259
|
__name: "TabBarItemAccessory",
|
|
17828
18260
|
props: {
|
|
17829
18261
|
accessory: {},
|
|
@@ -17953,7 +18385,7 @@ const useTabBarAdaptiveLayout = ({
|
|
|
17953
18385
|
};
|
|
17954
18386
|
};
|
|
17955
18387
|
|
|
17956
|
-
const _hoisted_1$
|
|
18388
|
+
const _hoisted_1$6 = { class: "kds-tab-bar-wrapper" };
|
|
17957
18389
|
const _hoisted_2$3 = ["id", "title", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick", "onKeydown"];
|
|
17958
18390
|
const _hoisted_3$3 = { class: "kds-tab-label" };
|
|
17959
18391
|
const _hoisted_4$2 = {
|
|
@@ -17961,7 +18393,7 @@ const _hoisted_4$2 = {
|
|
|
17961
18393
|
class: "kds-tab-indicator"
|
|
17962
18394
|
};
|
|
17963
18395
|
const MIN_TAB_WIDTH_TOKEN = "--kds-dimension-component-width-4x";
|
|
17964
|
-
const _sfc_main$
|
|
18396
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
17965
18397
|
__name: "KdsTabBar",
|
|
17966
18398
|
props: /* @__PURE__ */ mergeModels({
|
|
17967
18399
|
tabs: {},
|
|
@@ -18085,7 +18517,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
18085
18517
|
{ immediate: true }
|
|
18086
18518
|
);
|
|
18087
18519
|
return (_ctx, _cache) => {
|
|
18088
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
18520
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
18089
18521
|
createElementVNode("div", {
|
|
18090
18522
|
ref_key: "availableWidthContainer",
|
|
18091
18523
|
ref: availableWidthContainer,
|
|
@@ -18115,7 +18547,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
18115
18547
|
onClick: ($event) => selectTab(tab),
|
|
18116
18548
|
onKeydown: ($event) => handleKeydown($event, tab)
|
|
18117
18549
|
}, [
|
|
18118
|
-
tab.accessory && !(tab.accessory.type === "icon" && unref(shouldHideIcons)) ? (openBlock(), createBlock(_sfc_main$
|
|
18550
|
+
tab.accessory && !(tab.accessory.type === "icon" && unref(shouldHideIcons)) ? (openBlock(), createBlock(_sfc_main$8, {
|
|
18119
18551
|
key: 0,
|
|
18120
18552
|
accessory: tab.accessory,
|
|
18121
18553
|
"icon-size": __props.size === "large" ? "large" : "medium",
|
|
@@ -18131,7 +18563,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
18131
18563
|
}
|
|
18132
18564
|
});
|
|
18133
18565
|
|
|
18134
|
-
const KdsTabBar = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18566
|
+
const KdsTabBar = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__scopeId", "data-v-d5737ccf"]]);
|
|
18135
18567
|
|
|
18136
18568
|
const kdsTabBarSize = {
|
|
18137
18569
|
SMALL: "small",
|
|
@@ -18139,7 +18571,7 @@ const kdsTabBarSize = {
|
|
|
18139
18571
|
};
|
|
18140
18572
|
const kdsTabBarSizes = Object.values(kdsTabBarSize);
|
|
18141
18573
|
|
|
18142
|
-
const _sfc_main$
|
|
18574
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
18143
18575
|
__name: "LoadingSkeletonItem",
|
|
18144
18576
|
props: {
|
|
18145
18577
|
shape: { default: "text" }
|
|
@@ -18154,9 +18586,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
18154
18586
|
}
|
|
18155
18587
|
});
|
|
18156
18588
|
|
|
18157
|
-
const LoadingSkeletonItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18589
|
+
const LoadingSkeletonItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__scopeId", "data-v-86829b28"]]);
|
|
18158
18590
|
|
|
18159
|
-
const _hoisted_1$
|
|
18591
|
+
const _hoisted_1$5 = {
|
|
18160
18592
|
key: 0,
|
|
18161
18593
|
class: "kds-loading-skeleton",
|
|
18162
18594
|
"aria-busy": "true"
|
|
@@ -18171,7 +18603,7 @@ const _hoisted_4$1 = {
|
|
|
18171
18603
|
class: "kds-loading-skeleton-input-with-label"
|
|
18172
18604
|
};
|
|
18173
18605
|
const _hoisted_5 = { class: "kds-loading-skeleton-list-item-text" };
|
|
18174
|
-
const _sfc_main$
|
|
18606
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
18175
18607
|
__name: "KdsLoadingSkeleton",
|
|
18176
18608
|
props: {
|
|
18177
18609
|
variant: { default: "text" },
|
|
@@ -18184,7 +18616,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
18184
18616
|
"v59c08829": _ctx.repeatGap
|
|
18185
18617
|
}));
|
|
18186
18618
|
return (_ctx, _cache) => {
|
|
18187
|
-
return __props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
18619
|
+
return __props.loading ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
18188
18620
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.repeat, (index) => {
|
|
18189
18621
|
return openBlock(), createElementBlock(Fragment, {
|
|
18190
18622
|
key: `skeleton-${index}`
|
|
@@ -18239,7 +18671,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
18239
18671
|
}
|
|
18240
18672
|
});
|
|
18241
18673
|
|
|
18242
|
-
const KdsLoadingSkeleton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18674
|
+
const KdsLoadingSkeleton = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__scopeId", "data-v-e6597718"]]);
|
|
18243
18675
|
|
|
18244
18676
|
const loadingSkeletonItemShape = {
|
|
18245
18677
|
TEXT: "text",
|
|
@@ -18266,6 +18698,42 @@ const kdsLoadingSkeletonVariants = Object.values(
|
|
|
18266
18698
|
kdsLoadingSkeletonVariant
|
|
18267
18699
|
);
|
|
18268
18700
|
|
|
18701
|
+
const _hoisted_1$4 = { class: "kds-panel-button-bar" };
|
|
18702
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
18703
|
+
__name: "KdsPanelButtonBar",
|
|
18704
|
+
props: {
|
|
18705
|
+
applyLabel: { default: "Apply" },
|
|
18706
|
+
cancelLabel: { default: "Cancel" },
|
|
18707
|
+
disabled: { type: Boolean, default: false }
|
|
18708
|
+
},
|
|
18709
|
+
emits: ["cancel", "apply"],
|
|
18710
|
+
setup(__props, { emit: __emit }) {
|
|
18711
|
+
const emit = __emit;
|
|
18712
|
+
const handleCancel = (event) => emit("cancel", event);
|
|
18713
|
+
const handleApply = (event) => emit("apply", event);
|
|
18714
|
+
return (_ctx, _cache) => {
|
|
18715
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
18716
|
+
createVNode(_sfc_main$14, {
|
|
18717
|
+
disabled: __props.disabled,
|
|
18718
|
+
label: __props.cancelLabel,
|
|
18719
|
+
size: "small",
|
|
18720
|
+
variant: "transparent",
|
|
18721
|
+
onClick: handleCancel
|
|
18722
|
+
}, null, 8, ["disabled", "label"]),
|
|
18723
|
+
createVNode(_sfc_main$14, {
|
|
18724
|
+
disabled: __props.disabled,
|
|
18725
|
+
label: __props.applyLabel,
|
|
18726
|
+
size: "small",
|
|
18727
|
+
variant: "filled",
|
|
18728
|
+
onClick: handleApply
|
|
18729
|
+
}, null, 8, ["disabled", "label"])
|
|
18730
|
+
]);
|
|
18731
|
+
};
|
|
18732
|
+
}
|
|
18733
|
+
});
|
|
18734
|
+
|
|
18735
|
+
const KdsPanelButtonBar = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["__scopeId", "data-v-aeb00620"]]);
|
|
18736
|
+
|
|
18269
18737
|
const createUnwrappedPromise = () => {
|
|
18270
18738
|
let resolve = () => {
|
|
18271
18739
|
};
|
|
@@ -18313,14 +18781,14 @@ const kdsModalVariants = Object.values(kdsModalVariant);
|
|
|
18313
18781
|
width: kdsModalWidth.MEDIUM,
|
|
18314
18782
|
closedby: kdsModalClosedBy.CLOSEREQUEST});
|
|
18315
18783
|
|
|
18316
|
-
const _hoisted_1$
|
|
18784
|
+
const _hoisted_1$3 = { class: "modal-header" };
|
|
18317
18785
|
const _hoisted_2$1 = { class: "modal-header-headline" };
|
|
18318
18786
|
const _hoisted_3$1 = ["data-variant"];
|
|
18319
18787
|
const _hoisted_4 = {
|
|
18320
18788
|
key: 0,
|
|
18321
18789
|
class: "modal-footer"
|
|
18322
18790
|
};
|
|
18323
|
-
const _sfc_main$
|
|
18791
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
18324
18792
|
...{ inheritAttrs: false },
|
|
18325
18793
|
__name: "KdsModalLayout",
|
|
18326
18794
|
props: {
|
|
@@ -18337,14 +18805,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18337
18805
|
const props = createPropsRestProxy(__props, ["headline", "variant", "overflow"]);
|
|
18338
18806
|
return (_ctx, _cache) => {
|
|
18339
18807
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
18340
|
-
createElementVNode("header", _hoisted_1$
|
|
18808
|
+
createElementVNode("header", _hoisted_1$3, [
|
|
18341
18809
|
props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
|
|
18342
18810
|
key: 0,
|
|
18343
18811
|
name: props.leadingIcon,
|
|
18344
18812
|
size: "medium"
|
|
18345
18813
|
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
18346
18814
|
createElementVNode("div", _hoisted_2$1, toDisplayString(__props.headline), 1),
|
|
18347
|
-
createVNode(_sfc_main
|
|
18815
|
+
createVNode(_sfc_main$14, {
|
|
18348
18816
|
"leading-icon": "x-close",
|
|
18349
18817
|
variant: "transparent",
|
|
18350
18818
|
size: "medium",
|
|
@@ -18367,10 +18835,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18367
18835
|
}
|
|
18368
18836
|
});
|
|
18369
18837
|
|
|
18370
|
-
const KdsModalLayout = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18838
|
+
const KdsModalLayout = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__scopeId", "data-v-62740dc9"]]);
|
|
18371
18839
|
|
|
18372
|
-
const _hoisted_1$
|
|
18373
|
-
const _sfc_main$
|
|
18840
|
+
const _hoisted_1$2 = ["closedby"];
|
|
18841
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
18374
18842
|
__name: "KdsModal",
|
|
18375
18843
|
props: {
|
|
18376
18844
|
leadingIcon: {},
|
|
@@ -18466,12 +18934,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
18466
18934
|
_: 3
|
|
18467
18935
|
}, 8, ["headline", "leading-icon", "variant", "overflow"])
|
|
18468
18936
|
], true)
|
|
18469
|
-
], 42, _hoisted_1$
|
|
18937
|
+
], 42, _hoisted_1$2)) : createCommentVNode("", true);
|
|
18470
18938
|
};
|
|
18471
18939
|
}
|
|
18472
18940
|
});
|
|
18473
18941
|
|
|
18474
|
-
const KdsModal = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
18942
|
+
const KdsModal = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-f4a6776f"]]);
|
|
18475
18943
|
|
|
18476
18944
|
const defaultCancelButton = {
|
|
18477
18945
|
type: "cancel",
|
|
@@ -18552,7 +19020,7 @@ const useKdsDynamicModal = () => {
|
|
|
18552
19020
|
};
|
|
18553
19021
|
};
|
|
18554
19022
|
|
|
18555
|
-
const _hoisted_1 = {
|
|
19023
|
+
const _hoisted_1$1 = {
|
|
18556
19024
|
key: 1,
|
|
18557
19025
|
class: "confirmation"
|
|
18558
19026
|
};
|
|
@@ -18561,7 +19029,7 @@ const _hoisted_3 = {
|
|
|
18561
19029
|
key: 0,
|
|
18562
19030
|
class: "ask-again"
|
|
18563
19031
|
};
|
|
18564
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19032
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
18565
19033
|
__name: "KdsDynamicModalProvider",
|
|
18566
19034
|
setup(__props) {
|
|
18567
19035
|
const askAgain = ref(false);
|
|
@@ -18614,10 +19082,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18614
19082
|
unref(config)?.type === "confirm" ? {
|
|
18615
19083
|
name: "body",
|
|
18616
19084
|
fn: withCtx(() => [
|
|
18617
|
-
unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19085
|
+
unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
18618
19086
|
createElementVNode("div", _hoisted_2, toDisplayString(unref(config).value.message), 1),
|
|
18619
19087
|
unref(config).value.doNotAskAgain ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
18620
|
-
createVNode(_sfc_main$
|
|
19088
|
+
createVNode(_sfc_main$O, {
|
|
18621
19089
|
modelValue: askAgain.value,
|
|
18622
19090
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => askAgain.value = $event),
|
|
18623
19091
|
label: unref(config).value.doNotAskAgain.label,
|
|
@@ -18632,7 +19100,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18632
19100
|
name: "footer",
|
|
18633
19101
|
fn: withCtx(() => [
|
|
18634
19102
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).value.buttons, (button, index) => {
|
|
18635
|
-
return openBlock(), createBlock(_sfc_main
|
|
19103
|
+
return openBlock(), createBlock(_sfc_main$14, {
|
|
18636
19104
|
key: index,
|
|
18637
19105
|
destructive: button.destructive,
|
|
18638
19106
|
autofocus: button.autofocus,
|
|
@@ -18662,7 +19130,158 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18662
19130
|
}
|
|
18663
19131
|
});
|
|
18664
19132
|
|
|
18665
|
-
const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-41fc8d84"]]);
|
|
19133
|
+
const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__scopeId", "data-v-41fc8d84"]]);
|
|
19134
|
+
|
|
19135
|
+
const _hoisted_1 = {
|
|
19136
|
+
ref: "measureContainer",
|
|
19137
|
+
class: "kds-button-group-measure",
|
|
19138
|
+
"aria-hidden": "true",
|
|
19139
|
+
inert: ""
|
|
19140
|
+
};
|
|
19141
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19142
|
+
...{ inheritAttrs: false },
|
|
19143
|
+
__name: "KdsResponsiveButtonGroup",
|
|
19144
|
+
props: {
|
|
19145
|
+
buttons: {},
|
|
19146
|
+
alignment: { default: "left" }
|
|
19147
|
+
},
|
|
19148
|
+
emits: ["buttonClick"],
|
|
19149
|
+
setup(__props, { emit: __emit }) {
|
|
19150
|
+
const emit = __emit;
|
|
19151
|
+
const measureContainerEl = useTemplateRef("measureContainer");
|
|
19152
|
+
const measureButtonEls = useTemplateRef("measureButton");
|
|
19153
|
+
const measureMenuButtonEl = useTemplateRef("measureMenuButton");
|
|
19154
|
+
const buttonsContainerEl = useTemplateRef("buttonsContainer");
|
|
19155
|
+
const { width: containerWidth } = useElementSize(buttonsContainerEl);
|
|
19156
|
+
const gap = ref(0);
|
|
19157
|
+
const buttonWidths = ref([]);
|
|
19158
|
+
const menuButtonWidth = ref(0);
|
|
19159
|
+
const splitIndex = computed(() => {
|
|
19160
|
+
const availableSpace = containerWidth.value;
|
|
19161
|
+
const widths = buttonWidths.value;
|
|
19162
|
+
const buttonsCount = __props.buttons.length;
|
|
19163
|
+
if (!availableSpace || buttonsCount === 0) {
|
|
19164
|
+
return 0;
|
|
19165
|
+
}
|
|
19166
|
+
let buttonsWidth = 0;
|
|
19167
|
+
for (let i = 0; i < buttonsCount; i++) {
|
|
19168
|
+
if (i > 0) {
|
|
19169
|
+
buttonsWidth += gap.value;
|
|
19170
|
+
}
|
|
19171
|
+
buttonsWidth += widths[i] ?? 0;
|
|
19172
|
+
}
|
|
19173
|
+
if (buttonsWidth <= availableSpace) {
|
|
19174
|
+
return buttonsCount;
|
|
19175
|
+
}
|
|
19176
|
+
let usedWidth = menuButtonWidth.value;
|
|
19177
|
+
let count = 0;
|
|
19178
|
+
for (let i = 0; i < buttonsCount; i++) {
|
|
19179
|
+
const buttonWidth = widths[i] ?? 0;
|
|
19180
|
+
const gapBefore = count > 0 ? gap.value : 0;
|
|
19181
|
+
const gapAfterForMenu = gap.value;
|
|
19182
|
+
const totalWidth = usedWidth + gapBefore + buttonWidth + gapAfterForMenu;
|
|
19183
|
+
if (totalWidth > availableSpace) {
|
|
19184
|
+
break;
|
|
19185
|
+
}
|
|
19186
|
+
usedWidth += gapBefore + buttonWidth;
|
|
19187
|
+
count++;
|
|
19188
|
+
}
|
|
19189
|
+
return count;
|
|
19190
|
+
});
|
|
19191
|
+
const visibleButtons = computed(() => {
|
|
19192
|
+
return __props.buttons.slice(0, splitIndex.value);
|
|
19193
|
+
});
|
|
19194
|
+
const overflowButtons = computed(() => {
|
|
19195
|
+
return __props.buttons.slice(splitIndex.value);
|
|
19196
|
+
});
|
|
19197
|
+
const overflowMenuItems = computed(() => {
|
|
19198
|
+
return overflowButtons.value.map((a) => ({
|
|
19199
|
+
id: a.id,
|
|
19200
|
+
text: a.label,
|
|
19201
|
+
disabled: a.disabled,
|
|
19202
|
+
accessory: a.leadingIcon ? { type: "icon", name: a.leadingIcon } : void 0
|
|
19203
|
+
}));
|
|
19204
|
+
});
|
|
19205
|
+
const onMenuItemClick = (id) => {
|
|
19206
|
+
if (id) {
|
|
19207
|
+
emit("buttonClick", id);
|
|
19208
|
+
}
|
|
19209
|
+
};
|
|
19210
|
+
const measureButtons = async () => {
|
|
19211
|
+
await nextTick();
|
|
19212
|
+
if (!measureContainerEl.value) {
|
|
19213
|
+
return;
|
|
19214
|
+
}
|
|
19215
|
+
buttonWidths.value = Array.from(measureButtonEls.value ?? []).map(
|
|
19216
|
+
(button) => button?.$el.offsetWidth
|
|
19217
|
+
);
|
|
19218
|
+
menuButtonWidth.value = measureMenuButtonEl.value?.menuButtonEl?.$el.offsetWidth ?? 0;
|
|
19219
|
+
};
|
|
19220
|
+
watch(() => __props.buttons, measureButtons, { deep: true });
|
|
19221
|
+
onMounted(() => {
|
|
19222
|
+
if (buttonsContainerEl.value) {
|
|
19223
|
+
gap.value = Number.parseFloat(getComputedStyle(buttonsContainerEl.value).gap) || 0;
|
|
19224
|
+
}
|
|
19225
|
+
measureButtons();
|
|
19226
|
+
});
|
|
19227
|
+
return (_ctx, _cache) => {
|
|
19228
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
19229
|
+
createElementVNode("div", _hoisted_1, [
|
|
19230
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttons, (button) => {
|
|
19231
|
+
return openBlock(), createBlock(_sfc_main$14, {
|
|
19232
|
+
ref_for: true,
|
|
19233
|
+
ref: "measureButton",
|
|
19234
|
+
key: button.id,
|
|
19235
|
+
label: button.label,
|
|
19236
|
+
variant: button.variant ?? "outlined",
|
|
19237
|
+
"leading-icon": button.leadingIcon
|
|
19238
|
+
}, null, 8, ["label", "variant", "leading-icon"]);
|
|
19239
|
+
}), 128)),
|
|
19240
|
+
createVNode(_sfc_main$T, {
|
|
19241
|
+
ref: "measureMenuButton",
|
|
19242
|
+
"leading-icon": "more-actions",
|
|
19243
|
+
ariaLabel: "More actions",
|
|
19244
|
+
items: [{ id: "_", text: "_" }]
|
|
19245
|
+
}, null, 512)
|
|
19246
|
+
], 512),
|
|
19247
|
+
createElementVNode("div", mergeProps({ ref: "buttonsContainer" }, _ctx.$attrs, {
|
|
19248
|
+
class: ["kds-button-group", __props.alignment]
|
|
19249
|
+
}), [
|
|
19250
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleButtons.value, (button) => {
|
|
19251
|
+
return openBlock(), createBlock(_sfc_main$14, {
|
|
19252
|
+
key: button.id,
|
|
19253
|
+
label: button.label,
|
|
19254
|
+
variant: button.variant ?? "outlined",
|
|
19255
|
+
disabled: button.disabled,
|
|
19256
|
+
"leading-icon": button.leadingIcon,
|
|
19257
|
+
destructive: button.destructive,
|
|
19258
|
+
title: button.title,
|
|
19259
|
+
onClick: ($event) => emit("buttonClick", button.id)
|
|
19260
|
+
}, null, 8, ["label", "variant", "disabled", "leading-icon", "destructive", "title", "onClick"]);
|
|
19261
|
+
}), 128)),
|
|
19262
|
+
overflowButtons.value.length ? (openBlock(), createBlock(_sfc_main$T, {
|
|
19263
|
+
key: 0,
|
|
19264
|
+
"leading-icon": "more-actions",
|
|
19265
|
+
ariaLabel: "More actions",
|
|
19266
|
+
items: overflowMenuItems.value,
|
|
19267
|
+
onItemClick: onMenuItemClick
|
|
19268
|
+
}, null, 8, ["items"])) : createCommentVNode("", true)
|
|
19269
|
+
], 16)
|
|
19270
|
+
], 64);
|
|
19271
|
+
};
|
|
19272
|
+
}
|
|
19273
|
+
});
|
|
19274
|
+
|
|
19275
|
+
const KdsResponsiveButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-a945c295"]]);
|
|
19276
|
+
|
|
19277
|
+
const kdsResponsiveButtonGroupAlignment = {
|
|
19278
|
+
LEFT: "left",
|
|
19279
|
+
RIGHT: "right",
|
|
19280
|
+
MIDDLE: "middle"
|
|
19281
|
+
};
|
|
19282
|
+
const kdsResponsiveButtonGroupAlignments = Object.values(
|
|
19283
|
+
kdsResponsiveButtonGroupAlignment
|
|
19284
|
+
);
|
|
18666
19285
|
|
|
18667
|
-
export { KdsAvatar, KdsBadge, _sfc_main
|
|
19286
|
+
export { KdsAvatar, KdsBadge, _sfc_main$14 as KdsButton, KdsCardClickable, _sfc_main$O as KdsCheckbox, KdsCheckboxGroup, _sfc_main$B as KdsColorInput, KdsColorSwatch, KdsDataType, _sfc_main$x as KdsDateInput, _sfc_main$v as KdsDateTimeFormatInput, _sfc_main$p as KdsDropdown, KdsDynamicModalProvider, KdsEmptyState, KdsIcon, KdsInfoToggleButton, KdsInlineMessage, KdsLabel, KdsLink, _sfc_main$13 as KdsLinkButton, KdsLiveStatus, KdsLoadingSkeleton, KdsLoadingSpinner, _sfc_main$T as KdsMenuButton, KdsModal, KdsModalLayout, _sfc_main$m as KdsMultiSelectDropdown, _sfc_main$F as KdsNumberInput, KdsPanelButtonBar, KdsPanelHeader, _sfc_main$A as KdsPasswordInput, _sfc_main$u as KdsPatternInput, KdsProgressButton, KdsRadioButton, KdsRadioButtonGroup, KdsResponsiveButtonGroup, KdsSearchInput, KdsSortableListBox, KdsSplitButton, KdsSubText, KdsTabBar, KdsTextInput, KdsTextarea, _sfc_main$11 as KdsToggleButton, KdsTwinList, _sfc_main$z 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, kdsResponsiveButtonGroupAlignment, kdsResponsiveButtonGroupAlignments, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
|
|
18668
19287
|
//# sourceMappingURL=index.js.map
|