@skeletonlabs/skeleton 2.6.1-dev.1ca9731b → 2.6.1-dev.21f83326
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.
|
@@ -47,16 +47,17 @@ let modalElement;
|
|
|
47
47
|
let windowHeight;
|
|
48
48
|
let backdropOverflow = "overflow-y-hidden";
|
|
49
49
|
const modalStore = getModalStore();
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
|
|
50
|
+
$:
|
|
51
|
+
if ($modalStore.length)
|
|
52
|
+
handleModals($modalStore);
|
|
53
|
+
function handleModals(modals) {
|
|
53
54
|
if (modals[0].type === "prompt")
|
|
54
55
|
promptValue = modals[0].value;
|
|
55
56
|
buttonTextCancel = modals[0].buttonTextCancel || buttonTextDefaults.buttonTextCancel;
|
|
56
57
|
buttonTextConfirm = modals[0].buttonTextConfirm || buttonTextDefaults.buttonTextConfirm;
|
|
57
58
|
buttonTextSubmit = modals[0].buttonTextSubmit || buttonTextDefaults.buttonTextSubmit;
|
|
58
59
|
currentComponent = typeof modals[0].component === "string" ? components[modals[0].component] : modals[0].component;
|
|
59
|
-
}
|
|
60
|
+
}
|
|
60
61
|
function onModalHeightChange(modal) {
|
|
61
62
|
let modalHeight = modal?.clientHeight;
|
|
62
63
|
if (!modalHeight)
|
|
@@ -103,8 +104,12 @@ function onConfirm() {
|
|
|
103
104
|
}
|
|
104
105
|
function onPromptSubmit(event) {
|
|
105
106
|
event.preventDefault();
|
|
106
|
-
if ($modalStore[0].response)
|
|
107
|
-
$modalStore[0].
|
|
107
|
+
if ($modalStore[0].response) {
|
|
108
|
+
if ($modalStore[0].valueAttr !== void 0 && "type" in $modalStore[0].valueAttr && $modalStore[0].valueAttr.type === "number")
|
|
109
|
+
$modalStore[0].response(parseInt(promptValue));
|
|
110
|
+
else
|
|
111
|
+
$modalStore[0].response(promptValue);
|
|
112
|
+
}
|
|
108
113
|
modalStore.close();
|
|
109
114
|
}
|
|
110
115
|
function onKeyDown(event) {
|