@knime/kds-components 0.2.0 → 0.3.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/Modal/{KdsConfirmDialog.vue.d.ts → KdsDynamicModalProvider.vue.d.ts} +1 -1
- package/dist/Modal/KdsDynamicModalProvider.vue.d.ts.map +1 -0
- package/dist/Modal/KdsModal.vue.d.ts +7 -1
- package/dist/Modal/KdsModal.vue.d.ts.map +1 -1
- package/dist/Modal/KdsModalLayout.vue.d.ts +20 -0
- package/dist/Modal/KdsModalLayout.vue.d.ts.map +1 -0
- package/dist/Modal/types.d.ts +14 -5
- package/dist/Modal/types.d.ts.map +1 -1
- package/dist/index.css +52 -50
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +187 -131
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/Modal/KdsConfirmDialog.vue.d.ts.map +0 -1
- package/dist/Modal/useKdsConfirmDialog.d.ts +0 -150
- package/dist/Modal/useKdsConfirmDialog.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowRef, watch, defineComponent, toRef, createBlock, createElementBlock, unref, openBlock, resolveDynamicComponent, normalizeClass, computed, withCtx, createCommentVNode, toDisplayString, mergeProps, h, useSlots, getCurrentInstance, useId, createElementVNode,
|
|
1
|
+
import { shallowRef, watch, defineComponent, toRef, createBlock, createElementBlock, unref, openBlock, resolveDynamicComponent, normalizeClass, computed, withCtx, createCommentVNode, toDisplayString, mergeProps, h, useSlots, getCurrentInstance, useId, createElementVNode, Fragment, createVNode, renderSlot, useCssVars, useTemplateRef, nextTick, withModifiers, ref, createSlots, renderList, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { useLocalStorage, useDark, usePreferredDark } from '@vueuse/core';
|
|
3
3
|
|
|
4
4
|
import './index.css';const __variableDynamicImportRuntimeHelper = (glob$1, path$13, segs) => {
|
|
@@ -35,7 +35,7 @@ const useIcon = ({
|
|
|
35
35
|
return iconComponent;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const _sfc_main$
|
|
38
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
39
39
|
__name: "KdsIcon",
|
|
40
40
|
props: {
|
|
41
41
|
name: {},
|
|
@@ -68,13 +68,13 @@ const _export_sfc = (sfc, props) => {
|
|
|
68
68
|
return target;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
71
|
+
const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-d965b88c"]]);
|
|
72
72
|
|
|
73
|
-
const _hoisted_1$
|
|
73
|
+
const _hoisted_1$5 = {
|
|
74
74
|
key: 1,
|
|
75
75
|
class: "label"
|
|
76
76
|
};
|
|
77
|
-
const _sfc_main$
|
|
77
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
78
78
|
__name: "BaseButton",
|
|
79
79
|
props: {
|
|
80
80
|
variant: { default: "filled" },
|
|
@@ -121,7 +121,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
121
121
|
name: props.leadingIcon,
|
|
122
122
|
size: iconSize.value
|
|
123
123
|
}, null, 8, ["name", "size"])) : createCommentVNode("", true),
|
|
124
|
-
props.label ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
124
|
+
props.label ? (openBlock(), createElementBlock("span", _hoisted_1$5, toDisplayString(props.label), 1)) : createCommentVNode("", true),
|
|
125
125
|
props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
|
|
126
126
|
key: 2,
|
|
127
127
|
name: props.trailingIcon,
|
|
@@ -134,9 +134,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
137
|
+
const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f82890d7"]]);
|
|
138
138
|
|
|
139
|
-
const _sfc_main$
|
|
139
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
140
140
|
__name: "KdsButton",
|
|
141
141
|
props: {
|
|
142
142
|
variant: {},
|
|
@@ -187,7 +187,7 @@ const resolveNuxtLinkComponent = () => {
|
|
|
187
187
|
return fallbackComponent;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
const _sfc_main$
|
|
190
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
191
191
|
__name: "KdsLinkButton",
|
|
192
192
|
props: {
|
|
193
193
|
variant: {},
|
|
@@ -221,15 +221,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
|
|
224
|
-
const _hoisted_1$
|
|
224
|
+
const _hoisted_1$4 = ["disabled", "aria-checked", "aria-describedby", "aria-invalid", "title"];
|
|
225
225
|
const _hoisted_2$2 = { class: "control" };
|
|
226
226
|
const _hoisted_3$2 = {
|
|
227
227
|
key: 0,
|
|
228
228
|
class: "content"
|
|
229
229
|
};
|
|
230
|
-
const _hoisted_4
|
|
230
|
+
const _hoisted_4 = { class: "label" };
|
|
231
231
|
const _hoisted_5 = ["id"];
|
|
232
|
-
const _sfc_main$
|
|
232
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
233
233
|
__name: "KdsCheckbox",
|
|
234
234
|
props: {
|
|
235
235
|
modelValue: { type: [Boolean, String], default: false },
|
|
@@ -295,19 +295,19 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
295
295
|
}, null, 8, ["name"])) : createCommentVNode("", true)
|
|
296
296
|
]),
|
|
297
297
|
props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
298
|
-
createElementVNode("div", _hoisted_4
|
|
298
|
+
createElementVNode("div", _hoisted_4, toDisplayString(props.label), 1),
|
|
299
299
|
props.helperText ? (openBlock(), createElementBlock("div", {
|
|
300
300
|
key: 0,
|
|
301
301
|
id: `${unref(id)}-helper`,
|
|
302
302
|
class: "helper-text"
|
|
303
303
|
}, toDisplayString(props.helperText), 9, _hoisted_5)) : createCommentVNode("", true)
|
|
304
304
|
])) : createCommentVNode("", true)
|
|
305
|
-
], 10, _hoisted_1$
|
|
305
|
+
], 10, _hoisted_1$4);
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
const KdsCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
310
|
+
const KdsCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9fc2815a"]]);
|
|
311
311
|
|
|
312
312
|
const ID_TO_ICON_MAP = {
|
|
313
313
|
// Flow Variables
|
|
@@ -453,8 +453,8 @@ const typeIconNames = [
|
|
|
453
453
|
"xml-datatype"
|
|
454
454
|
];
|
|
455
455
|
|
|
456
|
-
const _hoisted_1$
|
|
457
|
-
const _sfc_main$
|
|
456
|
+
const _hoisted_1$3 = ["title"];
|
|
457
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
458
458
|
__name: "KdsDataType",
|
|
459
459
|
props: {
|
|
460
460
|
iconName: { default: "unknown-datatype" },
|
|
@@ -494,17 +494,63 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
494
494
|
"aria-hidden": "true",
|
|
495
495
|
focusable: "false"
|
|
496
496
|
}, null, 8, ["class"]))
|
|
497
|
-
], 10, _hoisted_1$
|
|
497
|
+
], 10, _hoisted_1$3);
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
const KdsDataType = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f7d93fdf"]]);
|
|
503
|
+
|
|
504
|
+
const _hoisted_1$2 = { class: "modal-header" };
|
|
505
|
+
const _hoisted_2$1 = { class: "modal-header-title" };
|
|
506
|
+
const _hoisted_3$1 = {
|
|
507
|
+
key: 0,
|
|
508
|
+
class: "modal-footer"
|
|
509
|
+
};
|
|
510
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
511
|
+
...{ inheritAttrs: false },
|
|
512
|
+
__name: "KdsModalLayout",
|
|
513
|
+
props: {
|
|
514
|
+
title: {},
|
|
515
|
+
variant: {},
|
|
516
|
+
icon: {},
|
|
517
|
+
onClose: { type: Function }
|
|
518
|
+
},
|
|
519
|
+
setup(__props) {
|
|
520
|
+
const props = __props;
|
|
521
|
+
return (_ctx, _cache) => {
|
|
522
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
523
|
+
createElementVNode("header", _hoisted_1$2, [
|
|
524
|
+
props.icon ? (openBlock(), createBlock(KdsIcon, {
|
|
525
|
+
key: 0,
|
|
526
|
+
name: props.icon,
|
|
527
|
+
size: "medium"
|
|
528
|
+
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
529
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(props.title), 1),
|
|
530
|
+
createVNode(_sfc_main$6, {
|
|
531
|
+
"leading-icon": "x-close",
|
|
532
|
+
variant: "transparent",
|
|
533
|
+
size: "medium",
|
|
534
|
+
title: "Close",
|
|
535
|
+
onClick: props.onClose
|
|
536
|
+
}, null, 8, ["onClick"])
|
|
537
|
+
]),
|
|
538
|
+
createElementVNode("div", {
|
|
539
|
+
class: normalizeClass(["modal-body", `modal-body-variant-${__props.variant}`])
|
|
540
|
+
}, [
|
|
541
|
+
renderSlot(_ctx.$slots, "body", {}, void 0, true)
|
|
542
|
+
], 2),
|
|
543
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3$1, [
|
|
544
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
545
|
+
])) : createCommentVNode("", true)
|
|
546
|
+
], 64);
|
|
498
547
|
};
|
|
499
548
|
}
|
|
500
549
|
});
|
|
501
550
|
|
|
502
|
-
const
|
|
551
|
+
const KdsModalLayout = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-5a49b1d8"]]);
|
|
503
552
|
|
|
504
553
|
const _hoisted_1$1 = ["closedby"];
|
|
505
|
-
const _hoisted_2$1 = { class: "modal-header" };
|
|
506
|
-
const _hoisted_3$1 = { class: "modal-header-title" };
|
|
507
|
-
const _hoisted_4 = { class: "modal-footer" };
|
|
508
554
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
509
555
|
__name: "KdsModal",
|
|
510
556
|
props: {
|
|
@@ -519,14 +565,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
519
565
|
emits: ["close"],
|
|
520
566
|
setup(__props, { emit: __emit }) {
|
|
521
567
|
useCssVars((_ctx) => ({
|
|
522
|
-
"
|
|
523
|
-
"
|
|
568
|
+
"v002a6132": cssModalWidth.value,
|
|
569
|
+
"v38bfb8b4": cssModalHeight.value
|
|
524
570
|
}));
|
|
525
571
|
const props = __props;
|
|
526
572
|
const emit = __emit;
|
|
527
573
|
const dialog = useTemplateRef("dialogElement");
|
|
528
|
-
const onClose = (
|
|
529
|
-
emit("close",
|
|
574
|
+
const onClose = (event) => {
|
|
575
|
+
emit("close", event);
|
|
530
576
|
};
|
|
531
577
|
watch(
|
|
532
578
|
() => props.active,
|
|
@@ -563,40 +609,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
563
609
|
ref: "dialogElement",
|
|
564
610
|
class: "base-modal",
|
|
565
611
|
closedby: __props.closedby,
|
|
566
|
-
onClose,
|
|
567
612
|
onCancel: withModifiers(onClose, ["prevent"])
|
|
568
613
|
}, [
|
|
569
|
-
__props.active ? (
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
592
|
-
])
|
|
593
|
-
], 64)) : createCommentVNode("", true)
|
|
614
|
+
__props.active ? renderSlot(_ctx.$slots, "default", {
|
|
615
|
+
key: 0,
|
|
616
|
+
title: __props.title,
|
|
617
|
+
icon: __props.icon,
|
|
618
|
+
variant: __props.variant,
|
|
619
|
+
onClose
|
|
620
|
+
}, () => [
|
|
621
|
+
createVNode(KdsModalLayout, {
|
|
622
|
+
title: __props.title,
|
|
623
|
+
icon: __props.icon,
|
|
624
|
+
variant: __props.variant,
|
|
625
|
+
onClose
|
|
626
|
+
}, {
|
|
627
|
+
body: withCtx(() => [
|
|
628
|
+
renderSlot(_ctx.$slots, "body", {}, void 0, true)
|
|
629
|
+
]),
|
|
630
|
+
footer: withCtx(() => [
|
|
631
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
632
|
+
]),
|
|
633
|
+
_: 3
|
|
634
|
+
}, 8, ["title", "icon", "variant"])
|
|
635
|
+
], true) : createCommentVNode("", true)
|
|
594
636
|
], 40, _hoisted_1$1);
|
|
595
637
|
};
|
|
596
638
|
}
|
|
597
639
|
});
|
|
598
640
|
|
|
599
|
-
const KdsModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
641
|
+
const KdsModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8984a5b0"]]);
|
|
600
642
|
|
|
601
643
|
const createUnwrappedPromise = () => {
|
|
602
644
|
let resolve = () => {
|
|
@@ -620,45 +662,58 @@ const defaultConfirmButton = {
|
|
|
620
662
|
};
|
|
621
663
|
const isActive = ref(false);
|
|
622
664
|
const activeModalConfig = ref(null);
|
|
623
|
-
const unwrappedPromise = ref(
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
665
|
+
const unwrappedPromise = ref(createUnwrappedPromise());
|
|
666
|
+
const resetInternalState = () => {
|
|
667
|
+
isActive.value = false;
|
|
668
|
+
activeModalConfig.value = null;
|
|
669
|
+
unwrappedPromise.value = createUnwrappedPromise();
|
|
670
|
+
};
|
|
671
|
+
const confirm = (doNotAskAgain = false) => {
|
|
672
|
+
unwrappedPromise.value.resolve({
|
|
673
|
+
confirmed: true,
|
|
674
|
+
doNotAskAgain
|
|
675
|
+
});
|
|
676
|
+
resetInternalState();
|
|
677
|
+
};
|
|
678
|
+
const close = () => {
|
|
679
|
+
const isConfirm = activeModalConfig.value?.type === "confirm";
|
|
680
|
+
unwrappedPromise.value.resolve(isConfirm ? { confirmed: false } : void 0);
|
|
681
|
+
resetInternalState();
|
|
682
|
+
};
|
|
683
|
+
const isTemplateBasedConfirm = (config) => {
|
|
627
684
|
return "component" in config;
|
|
628
685
|
};
|
|
629
|
-
const
|
|
630
|
-
|
|
686
|
+
const internal = {
|
|
687
|
+
confirm,
|
|
688
|
+
close,
|
|
689
|
+
isTemplateBasedConfirm
|
|
690
|
+
};
|
|
691
|
+
const useKdsDynamicModal = () => {
|
|
692
|
+
function askConfirmation(config) {
|
|
631
693
|
activeModalConfig.value = {
|
|
632
|
-
|
|
633
|
-
|
|
694
|
+
type: "confirm",
|
|
695
|
+
value: {
|
|
696
|
+
buttons: [defaultCancelButton, defaultConfirmButton],
|
|
697
|
+
...config
|
|
698
|
+
}
|
|
634
699
|
};
|
|
635
700
|
isActive.value = true;
|
|
636
701
|
return unwrappedPromise.value.promise;
|
|
637
702
|
}
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
unwrappedPromise.value.
|
|
645
|
-
confirmed: true,
|
|
646
|
-
doNotAskAgain
|
|
647
|
-
});
|
|
648
|
-
close();
|
|
649
|
-
};
|
|
650
|
-
const cancel = () => {
|
|
651
|
-
unwrappedPromise.value.resolve({ confirmed: false });
|
|
652
|
-
close();
|
|
703
|
+
const showByTemplate = (config) => {
|
|
704
|
+
activeModalConfig.value = {
|
|
705
|
+
type: "dynamic",
|
|
706
|
+
value: config
|
|
707
|
+
};
|
|
708
|
+
isActive.value = true;
|
|
709
|
+
return unwrappedPromise.value.promise;
|
|
653
710
|
};
|
|
654
711
|
return {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
cancel,
|
|
712
|
+
askConfirmation,
|
|
713
|
+
showByTemplate,
|
|
658
714
|
config: computed(() => activeModalConfig.value),
|
|
659
715
|
isActive: computed(() => isActive.value),
|
|
660
|
-
|
|
661
|
-
isComponentBasedConfig
|
|
716
|
+
close: () => internal.close()
|
|
662
717
|
};
|
|
663
718
|
};
|
|
664
719
|
|
|
@@ -672,73 +727,67 @@ const _hoisted_3 = {
|
|
|
672
727
|
class: "ask-again"
|
|
673
728
|
};
|
|
674
729
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
675
|
-
__name: "
|
|
730
|
+
__name: "KdsDynamicModalProvider",
|
|
676
731
|
setup(__props) {
|
|
677
732
|
const askAgain = ref(false);
|
|
678
|
-
const { config, isActive
|
|
733
|
+
const { config, isActive } = useKdsDynamicModal();
|
|
679
734
|
const reset = () => {
|
|
680
735
|
askAgain.value = false;
|
|
681
736
|
};
|
|
682
737
|
const onConfirm = () => {
|
|
683
|
-
confirm(askAgain.value);
|
|
738
|
+
internal.confirm(askAgain.value);
|
|
684
739
|
reset();
|
|
685
740
|
};
|
|
686
|
-
const
|
|
687
|
-
|
|
741
|
+
const onClose = () => {
|
|
742
|
+
internal.close();
|
|
688
743
|
reset();
|
|
689
744
|
};
|
|
690
|
-
const
|
|
691
|
-
if (button.customHandler) {
|
|
692
|
-
button.
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
onConfirm();
|
|
696
|
-
};
|
|
697
|
-
const handleCancelButtonClick = (button) => {
|
|
698
|
-
if (button.customHandler) {
|
|
699
|
-
button.customHandler({ cancel: onCancel });
|
|
745
|
+
const handleConfirmButton = (button) => {
|
|
746
|
+
if (!button.customHandler) {
|
|
747
|
+
const handler = button.type === "cancel" ? onClose : onConfirm;
|
|
748
|
+
handler();
|
|
700
749
|
return;
|
|
701
750
|
}
|
|
702
|
-
onCancel();
|
|
703
|
-
};
|
|
704
|
-
const handleButtonClick = (button) => {
|
|
705
751
|
if (button.type === "cancel") {
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
|
|
752
|
+
button.customHandler({ cancel: onClose });
|
|
753
|
+
}
|
|
754
|
+
if (button.type === "confirm") {
|
|
755
|
+
button.customHandler({ confirm: onConfirm });
|
|
709
756
|
}
|
|
710
757
|
};
|
|
711
758
|
const defaultVariant = (type) => type === "cancel" ? "transparent" : "filled";
|
|
712
759
|
return (_ctx, _cache) => {
|
|
713
760
|
return openBlock(), createBlock(KdsModal, {
|
|
714
|
-
class: "confirm-
|
|
761
|
+
class: "confirm-modal",
|
|
715
762
|
active: unref(isActive),
|
|
716
|
-
title: unref(config)?.title,
|
|
717
|
-
closedby: unref(config)?.closedby,
|
|
718
|
-
icon: unref(config)?.icon,
|
|
719
|
-
onClose
|
|
720
|
-
}, createSlots({
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
unref(config)
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
763
|
+
title: unref(config)?.value.title,
|
|
764
|
+
closedby: unref(config)?.value.closedby,
|
|
765
|
+
icon: unref(config)?.value.icon,
|
|
766
|
+
onClose
|
|
767
|
+
}, createSlots({ _: 2 }, [
|
|
768
|
+
unref(config)?.type === "confirm" ? {
|
|
769
|
+
name: "body",
|
|
770
|
+
fn: withCtx(() => [
|
|
771
|
+
unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
772
|
+
createElementVNode("div", _hoisted_2, toDisplayString(unref(config).value.message), 1),
|
|
773
|
+
unref(config).value.doNotAskAgain ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
774
|
+
createVNode(KdsCheckbox, {
|
|
775
|
+
modelValue: askAgain.value,
|
|
776
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => askAgain.value = $event),
|
|
777
|
+
label: unref(config).value.doNotAskAgain.label,
|
|
778
|
+
title: unref(config).value.doNotAskAgain.title,
|
|
779
|
+
"helper-text": unref(config).value.doNotAskAgain.helperText
|
|
780
|
+
}, null, 8, ["modelValue", "label", "title", "helper-text"])
|
|
781
|
+
])) : createCommentVNode("", true)
|
|
782
|
+
]))
|
|
783
|
+
]),
|
|
784
|
+
key: "0"
|
|
785
|
+
} : void 0,
|
|
786
|
+
unref(config)?.type === "confirm" ? {
|
|
738
787
|
name: "footer",
|
|
739
788
|
fn: withCtx(() => [
|
|
740
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).buttons, (button, index) => {
|
|
741
|
-
return openBlock(), createBlock(_sfc_main$
|
|
789
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).value.buttons, (button, index) => {
|
|
790
|
+
return openBlock(), createBlock(_sfc_main$6, {
|
|
742
791
|
key: index,
|
|
743
792
|
destructive: button.destructive,
|
|
744
793
|
autofocus: button.autofocus,
|
|
@@ -746,18 +795,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
746
795
|
variant: button.variant ?? defaultVariant(button.type),
|
|
747
796
|
class: normalizeClass({ "flush-left": button.flushLeft }),
|
|
748
797
|
"data-test-id": `${button.type}-button`,
|
|
749
|
-
onClick: ($event) =>
|
|
798
|
+
onClick: ($event) => handleConfirmButton(button)
|
|
750
799
|
}, null, 8, ["destructive", "autofocus", "label", "variant", "class", "data-test-id", "onClick"]);
|
|
751
800
|
}), 128))
|
|
752
801
|
]),
|
|
753
|
-
key: "
|
|
802
|
+
key: "1"
|
|
803
|
+
} : void 0,
|
|
804
|
+
unref(config)?.type === "dynamic" ? {
|
|
805
|
+
name: "default",
|
|
806
|
+
fn: withCtx((slotProps) => [
|
|
807
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), normalizeProps(guardReactiveProps(slotProps)), null, 16))
|
|
808
|
+
]),
|
|
809
|
+
key: "2"
|
|
754
810
|
} : void 0
|
|
755
811
|
]), 1032, ["active", "title", "closedby", "icon"]);
|
|
756
812
|
};
|
|
757
813
|
}
|
|
758
814
|
});
|
|
759
815
|
|
|
760
|
-
const
|
|
816
|
+
const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d1529fac"]]);
|
|
761
817
|
|
|
762
818
|
const KDS_DARK_MODE_STORAGE_KEY = "KNIME_DARK_MODE";
|
|
763
819
|
const defaultMode = "light";
|
|
@@ -838,5 +894,5 @@ const useKdsLegacyMode = (initialValue = false) => {
|
|
|
838
894
|
};
|
|
839
895
|
};
|
|
840
896
|
|
|
841
|
-
export { _sfc_main$
|
|
897
|
+
export { _sfc_main$6 as KdsButton, KdsCheckbox, KdsDataType, KdsDynamicModalProvider, KdsIcon, _sfc_main$5 as KdsLinkButton, KdsModal, KdsModalLayout, useKdsDarkMode, useKdsDynamicModal, useKdsLegacyMode };
|
|
842
898
|
//# sourceMappingURL=index.js.map
|