@bagelink/vue 0.0.262 → 0.0.264
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/components/Card.vue.d.ts +2 -2
- package/dist/components/ModalForm.vue.d.ts +4 -1
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/JSONInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/JSONInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts +1 -1
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts +1 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts.map +1 -1
- package/dist/index.cjs +15 -7
- package/dist/index.mjs +15 -7
- package/dist/plugins/modal.d.ts +16 -6
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
- package/src/components/ModalForm.vue +12 -3
- package/src/components/form/BglForm.vue +1 -1
- package/src/plugins/modal.ts +19 -12
|
@@ -2,12 +2,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
2
2
|
thin?: boolean | undefined;
|
|
3
3
|
border?: boolean | undefined;
|
|
4
4
|
h100?: boolean | undefined;
|
|
5
|
-
bg?: "
|
|
5
|
+
bg?: "info" | "light" | "warning" | "gray" | "primary" | "dark" | "secondary" | "success" | "danger" | "white" | "transparent" | undefined;
|
|
6
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
7
|
thin?: boolean | undefined;
|
|
8
8
|
border?: boolean | undefined;
|
|
9
9
|
h100?: boolean | undefined;
|
|
10
|
-
bg?: "
|
|
10
|
+
bg?: "info" | "light" | "warning" | "gray" | "primary" | "dark" | "secondary" | "success" | "danger" | "white" | "transparent" | undefined;
|
|
11
11
|
}>>>, {}, {}>, {
|
|
12
12
|
default?(_: {}): any;
|
|
13
13
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BglFormSchemaT, type BtnOptions } from '..';
|
|
2
|
+
declare function setFormValues(values: Record<string, any>): void;
|
|
2
3
|
declare const _default: import("vue").DefineComponent<{
|
|
3
4
|
modelValue: import("vue").PropType<Record<string, any>>;
|
|
4
5
|
side: {
|
|
@@ -29,7 +30,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
30
|
onError: {
|
|
30
31
|
type: import("vue").PropType<(err: any) => void>;
|
|
31
32
|
};
|
|
32
|
-
}, {
|
|
33
|
+
}, {
|
|
34
|
+
setFormValues: typeof setFormValues;
|
|
35
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
36
|
modelValue: import("vue").PropType<Record<string, any>>;
|
|
34
37
|
side: {
|
|
35
38
|
type: import("vue").PropType<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/ModalForm.vue"],"names":[],"mappings":"AAyCA;AAEA,OAAO,EACiB,KAAK,cAAc,EAAE,KAAK,UAAU,EAC3D,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ModalForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/ModalForm.vue"],"names":[],"mappings":"AAyCA;AAEA,OAAO,EACiB,KAAK,cAAc,EAAE,KAAK,UAAU,EAC3D,MAAM,eAAe,CAAC;AAoDvB,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAEjD;;;;;;;;;;;;;;;;;;;;gDA4LuB,GAAG,KAAK,QAAQ,IAAI,CAAC;;;0CAE3B,MAAM,KAAK,IAAI;;;+CAEO,OAAO,KAAK,IAAI;;;2CAEtC,GAAG,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;gDANN,GAAG,KAAK,QAAQ,IAAI,CAAC;;;0CAE3B,MAAM,KAAK,IAAI;;;+CAEO,OAAO,KAAK,IAAI;;;2CAEtC,GAAG,KAAK,IAAI;;;AApB9B,wBA2BG"}
|
|
@@ -27,9 +27,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
27
27
|
}>>> & {
|
|
28
28
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
29
29
|
}, {
|
|
30
|
-
description: string;
|
|
31
30
|
label: string;
|
|
32
31
|
placeholder: string;
|
|
32
|
+
description: string;
|
|
33
33
|
editMode: boolean;
|
|
34
34
|
}, {}>;
|
|
35
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/JSONInput.vue"],"names":[],"mappings":"AAiBA;;;;gBA2Ic,GAAG;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"JSONInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/JSONInput.vue"],"names":[],"mappings":"AAiBA;;;;gBA2Ic,GAAG;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;WADP,MAAM;iBAEA,MAAM;iBAHN,MAAM;cAIT,OAAO;;AAVpB,wBAcG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -27,9 +27,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
27
27
|
}>>> & {
|
|
28
28
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
29
29
|
}, {
|
|
30
|
-
description: string;
|
|
31
30
|
label: string;
|
|
32
31
|
placeholder: string;
|
|
32
|
+
description: string;
|
|
33
33
|
editMode: boolean;
|
|
34
34
|
}, {}>;
|
|
35
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RichTextEditor.vue"],"names":[],"mappings":"AAiBA;;;;gBA0Ic,GAAG;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RichTextEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RichTextEditor.vue"],"names":[],"mappings":"AAiBA;;;;gBA0Ic,GAAG;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;WADP,MAAM;iBAEA,MAAM;iBAHN,MAAM;cAIT,OAAO;;AAVpB,wBAcG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -33,9 +33,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
33
33
|
}>>> & {
|
|
34
34
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
35
35
|
}, {
|
|
36
|
-
description: string;
|
|
37
36
|
label: string;
|
|
38
37
|
placeholder: string;
|
|
38
|
+
description: string;
|
|
39
39
|
editMode: boolean;
|
|
40
40
|
}, {}>;
|
|
41
41
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TextArea.vue"],"names":[],"mappings":"AAyBA;;;;gBAsKc,GAAG;;;;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TextArea.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TextArea.vue"],"names":[],"mappings":"AAyBA;;;;gBAsKc,GAAG;;;;;;;;;;;;;;;;;gBAAH,GAAG;;;;;;;;;;;;;;;WADP,MAAM;iBAEA,MAAM;iBAHN,MAAM;cAIT,OAAO;;AAVpB,wBAiBG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -2308,6 +2308,9 @@ const ModalPlugin = {
|
|
|
2308
2308
|
modalType,
|
|
2309
2309
|
componentSlots: slots
|
|
2310
2310
|
});
|
|
2311
|
+
if (modalType === "modalForm")
|
|
2312
|
+
return modalStack.value.at(-1);
|
|
2313
|
+
return modalStack.value.at(-1);
|
|
2311
2314
|
};
|
|
2312
2315
|
app.provide(ModalSymbol, {
|
|
2313
2316
|
showModal: (options, slots) => showModal("modal", options, slots),
|
|
@@ -14912,13 +14915,14 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
14912
14915
|
onSubmit: { type: Function },
|
|
14913
14916
|
onDelete: { type: Function },
|
|
14914
14917
|
"onUpdate:isModalVisible": { type: Function },
|
|
14915
|
-
onError: { type: Function }
|
|
14918
|
+
onError: { type: Function },
|
|
14919
|
+
modelValue: {}
|
|
14916
14920
|
}, {
|
|
14917
14921
|
"modelValue": { default: {} },
|
|
14918
14922
|
"modelModifiers": {}
|
|
14919
14923
|
}),
|
|
14920
14924
|
emits: ["update:modelValue"],
|
|
14921
|
-
setup(__props) {
|
|
14925
|
+
setup(__props, { expose: __expose }) {
|
|
14922
14926
|
const bagel = useBagel();
|
|
14923
14927
|
const props2 = __props;
|
|
14924
14928
|
const modal = vue.ref();
|
|
@@ -14952,6 +14956,10 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
14952
14956
|
(_b = props2.onDelete) == null ? void 0 : _b.call(props2, (_a2 = formData.value) == null ? void 0 : _a2.id);
|
|
14953
14957
|
closeModal();
|
|
14954
14958
|
};
|
|
14959
|
+
function setFormValues(values3) {
|
|
14960
|
+
Object.assign(formData, values3);
|
|
14961
|
+
}
|
|
14962
|
+
__expose({ setFormValues });
|
|
14955
14963
|
return (_ctx, _cache) => {
|
|
14956
14964
|
return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$y), {
|
|
14957
14965
|
"onOnUpdate:isModalVisible": props2["onUpdate:isModalVisible"],
|
|
@@ -14980,7 +14988,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
14980
14988
|
thin: "",
|
|
14981
14989
|
flat: "",
|
|
14982
14990
|
value: "Cancel",
|
|
14983
|
-
onClick:
|
|
14991
|
+
onClick: closeModal
|
|
14984
14992
|
}),
|
|
14985
14993
|
_ctx.onDelete ? (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
|
|
14986
14994
|
key: 0,
|
|
@@ -14988,13 +14996,13 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
14988
14996
|
icon: "delete",
|
|
14989
14997
|
flat: "",
|
|
14990
14998
|
value: "Delete",
|
|
14991
|
-
onClick:
|
|
14999
|
+
onClick: runDelete,
|
|
14992
15000
|
color: "red"
|
|
14993
15001
|
})) : vue.createCommentVNode("", true)
|
|
14994
15002
|
]),
|
|
14995
15003
|
vue.createVNode(vue.unref(Btn), {
|
|
14996
15004
|
value: "Submit",
|
|
14997
|
-
onClick:
|
|
15005
|
+
onClick: runSubmit
|
|
14998
15006
|
})
|
|
14999
15007
|
]),
|
|
15000
15008
|
key: "0"
|
|
@@ -15003,7 +15011,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
|
15003
15011
|
};
|
|
15004
15012
|
}
|
|
15005
15013
|
});
|
|
15006
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
15014
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-5c602c4d"]]);
|
|
15007
15015
|
const _hoisted_1$C = { class: "accordion-item" };
|
|
15008
15016
|
const _hoisted_2$w = {
|
|
15009
15017
|
key: 0,
|
|
@@ -15747,9 +15755,9 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
15747
15755
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
15748
15756
|
const { showModal } = useModal();
|
|
15749
15757
|
const props2 = __props;
|
|
15758
|
+
const instAt = /* @__PURE__ */ new Date();
|
|
15750
15759
|
const timeSinceInst = () => (/* @__PURE__ */ new Date()).getTime() - instAt.getTime();
|
|
15751
15760
|
const emit2 = __emit;
|
|
15752
|
-
const instAt = /* @__PURE__ */ new Date();
|
|
15753
15761
|
let isDirty = vue.ref(false);
|
|
15754
15762
|
const data2 = vue.computed({
|
|
15755
15763
|
set: (val) => {
|
package/dist/index.mjs
CHANGED
|
@@ -2306,6 +2306,9 @@ const ModalPlugin = {
|
|
|
2306
2306
|
modalType,
|
|
2307
2307
|
componentSlots: slots
|
|
2308
2308
|
});
|
|
2309
|
+
if (modalType === "modalForm")
|
|
2310
|
+
return modalStack.value.at(-1);
|
|
2311
|
+
return modalStack.value.at(-1);
|
|
2309
2312
|
};
|
|
2310
2313
|
app.provide(ModalSymbol, {
|
|
2311
2314
|
showModal: (options, slots) => showModal("modal", options, slots),
|
|
@@ -14910,13 +14913,14 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
14910
14913
|
onSubmit: { type: Function },
|
|
14911
14914
|
onDelete: { type: Function },
|
|
14912
14915
|
"onUpdate:isModalVisible": { type: Function },
|
|
14913
|
-
onError: { type: Function }
|
|
14916
|
+
onError: { type: Function },
|
|
14917
|
+
modelValue: {}
|
|
14914
14918
|
}, {
|
|
14915
14919
|
"modelValue": { default: {} },
|
|
14916
14920
|
"modelModifiers": {}
|
|
14917
14921
|
}),
|
|
14918
14922
|
emits: ["update:modelValue"],
|
|
14919
|
-
setup(__props) {
|
|
14923
|
+
setup(__props, { expose: __expose }) {
|
|
14920
14924
|
const bagel = useBagel();
|
|
14921
14925
|
const props2 = __props;
|
|
14922
14926
|
const modal = ref();
|
|
@@ -14950,6 +14954,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
14950
14954
|
(_b = props2.onDelete) == null ? void 0 : _b.call(props2, (_a2 = formData.value) == null ? void 0 : _a2.id);
|
|
14951
14955
|
closeModal();
|
|
14952
14956
|
};
|
|
14957
|
+
function setFormValues(values3) {
|
|
14958
|
+
Object.assign(formData, values3);
|
|
14959
|
+
}
|
|
14960
|
+
__expose({ setFormValues });
|
|
14953
14961
|
return (_ctx, _cache) => {
|
|
14954
14962
|
return openBlock(), createBlock(unref(_sfc_main$y), {
|
|
14955
14963
|
"onOnUpdate:isModalVisible": props2["onUpdate:isModalVisible"],
|
|
@@ -14978,7 +14986,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
14978
14986
|
thin: "",
|
|
14979
14987
|
flat: "",
|
|
14980
14988
|
value: "Cancel",
|
|
14981
|
-
onClick:
|
|
14989
|
+
onClick: closeModal
|
|
14982
14990
|
}),
|
|
14983
14991
|
_ctx.onDelete ? (openBlock(), createBlock(unref(Btn), {
|
|
14984
14992
|
key: 0,
|
|
@@ -14986,13 +14994,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
14986
14994
|
icon: "delete",
|
|
14987
14995
|
flat: "",
|
|
14988
14996
|
value: "Delete",
|
|
14989
|
-
onClick:
|
|
14997
|
+
onClick: runDelete,
|
|
14990
14998
|
color: "red"
|
|
14991
14999
|
})) : createCommentVNode("", true)
|
|
14992
15000
|
]),
|
|
14993
15001
|
createVNode(unref(Btn), {
|
|
14994
15002
|
value: "Submit",
|
|
14995
|
-
onClick:
|
|
15003
|
+
onClick: runSubmit
|
|
14996
15004
|
})
|
|
14997
15005
|
]),
|
|
14998
15006
|
key: "0"
|
|
@@ -15001,7 +15009,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
15001
15009
|
};
|
|
15002
15010
|
}
|
|
15003
15011
|
});
|
|
15004
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
15012
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-5c602c4d"]]);
|
|
15005
15013
|
const _hoisted_1$C = { class: "accordion-item" };
|
|
15006
15014
|
const _hoisted_2$w = {
|
|
15007
15015
|
key: 0,
|
|
@@ -15745,9 +15753,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
15745
15753
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
15746
15754
|
const { showModal } = useModal();
|
|
15747
15755
|
const props2 = __props;
|
|
15756
|
+
const instAt = /* @__PURE__ */ new Date();
|
|
15748
15757
|
const timeSinceInst = () => (/* @__PURE__ */ new Date()).getTime() - instAt.getTime();
|
|
15749
15758
|
const emit2 = __emit;
|
|
15750
|
-
const instAt = /* @__PURE__ */ new Date();
|
|
15751
15759
|
let isDirty = ref(false);
|
|
15752
15760
|
const data2 = computed({
|
|
15753
15761
|
set: (val) => {
|
package/dist/plugins/modal.d.ts
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
2
|
import type { Plugin } from 'vue';
|
|
3
3
|
import type { BglFormSchemaT, BtnOptions } from '..';
|
|
4
|
-
interface ModalOptions {
|
|
4
|
+
export interface ModalOptions {
|
|
5
5
|
title?: string;
|
|
6
6
|
dismissable?: boolean;
|
|
7
7
|
side?: boolean;
|
|
8
8
|
actions?: BtnOptions[];
|
|
9
9
|
class?: string;
|
|
10
10
|
}
|
|
11
|
-
interface ModalFormOptions {
|
|
11
|
+
export interface ModalFormOptions {
|
|
12
12
|
side?: boolean;
|
|
13
13
|
title?: string;
|
|
14
14
|
dismissable?: boolean;
|
|
15
15
|
schema: BglFormSchemaT<any> | (() => BglFormSchemaT);
|
|
16
|
-
modelValue?: Record<string, any>;
|
|
17
16
|
onSubmit?: (formData: any) => Promise<any>;
|
|
18
17
|
onDelete?: (id: string) => Promise<void>;
|
|
19
18
|
onError?: ((err: any) => void);
|
|
19
|
+
modelValue?: Record<string, any>;
|
|
20
|
+
'onUpdate:modelValue'?: (val: any) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface ModalComponentProps {
|
|
23
|
+
componentSlots: Record<string, any>;
|
|
24
|
+
modalType: 'modal' | 'modalForm';
|
|
25
|
+
modalOptions: ModalOptions | ModalFormOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface ModalFormComponentProps {
|
|
28
|
+
componentSlots: Record<string, any>;
|
|
29
|
+
modalType: 'modalForm';
|
|
30
|
+
modalOptions: ModalFormOptions;
|
|
20
31
|
}
|
|
21
|
-
interface ModalApi {
|
|
32
|
+
export interface ModalApi {
|
|
22
33
|
showModal: (options: ModalOptions, slots?: Record<string, any>) => void;
|
|
23
|
-
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) =>
|
|
34
|
+
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => ModalFormComponentProps | undefined;
|
|
24
35
|
hideModal: (index?: number) => void;
|
|
25
36
|
}
|
|
26
37
|
export declare const ModalSymbol: InjectionKey<ModalApi>;
|
|
27
38
|
export declare const useModal: () => ModalApi;
|
|
28
39
|
export declare const ModalPlugin: Plugin;
|
|
29
|
-
export {};
|
|
30
40
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACf,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhE,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACf,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhE,MAAM,WAAW,YAAY;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,SAAS,EAAE,OAAO,GAAG,WAAW,CAAC;IACjC,YAAY,EAAE,YAAY,GAAG,gBAAgB,CAAA;CAC7C;AACD,MAAM,WAAW,uBAAuB;IACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,SAAS,EAAE,WAAW,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAA;CAC9B;AACD,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACxE,aAAa,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,uBAAuB,GAAG,SAAS,CAAC;IAC/G,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAmB,CAAC;AAEnE,eAAO,MAAM,QAAQ,QAAO,QAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAyCzB,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -546,11 +546,11 @@
|
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
|
|
549
|
-
.modal-title[data-v-
|
|
549
|
+
.modal-title[data-v-5c602c4d] {
|
|
550
550
|
margin-top: 0.5rem;
|
|
551
551
|
}
|
|
552
552
|
@media screen and (max-width: 910px) {
|
|
553
|
-
.modal-title[data-v-
|
|
553
|
+
.modal-title[data-v-5c602c4d] {
|
|
554
554
|
margin-top: 1rem;
|
|
555
555
|
}
|
|
556
556
|
}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
thin
|
|
21
21
|
flat
|
|
22
22
|
value="Cancel"
|
|
23
|
-
@click="closeModal
|
|
23
|
+
@click="closeModal"
|
|
24
24
|
/>
|
|
25
25
|
<Btn
|
|
26
26
|
thin
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
v-if="onDelete"
|
|
29
29
|
flat
|
|
30
30
|
value="Delete"
|
|
31
|
-
@click="runDelete
|
|
31
|
+
@click="runDelete"
|
|
32
32
|
color="red"
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
35
35
|
<Btn
|
|
36
36
|
value="Submit"
|
|
37
|
-
@click="runSubmit
|
|
37
|
+
@click="runSubmit"
|
|
38
38
|
/>
|
|
39
39
|
</template>
|
|
40
40
|
</Modal>
|
|
@@ -61,6 +61,9 @@ const props = defineProps<{
|
|
|
61
61
|
'onUpdate:isModalVisible'?: ((visible: boolean) => void);
|
|
62
62
|
// eslint-disable-next-line no-unused-vars
|
|
63
63
|
onError?: ((err: any) => void);
|
|
64
|
+
|
|
65
|
+
modelValue?: Record<string, any>;
|
|
66
|
+
|
|
64
67
|
}>();
|
|
65
68
|
|
|
66
69
|
const modal = $ref<InstanceType<typeof Modal>>();
|
|
@@ -89,6 +92,12 @@ const runDelete = () => {
|
|
|
89
92
|
props.onDelete?.(formData.value?.id);
|
|
90
93
|
closeModal();
|
|
91
94
|
};
|
|
95
|
+
|
|
96
|
+
function setFormValues(values: Record<string, any>) {
|
|
97
|
+
Object.assign(formData, values);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
defineExpose({ setFormValues });
|
|
92
101
|
</script>
|
|
93
102
|
|
|
94
103
|
<style scoped>
|
|
@@ -50,10 +50,10 @@ const props = withDefaults(
|
|
|
50
50
|
},
|
|
51
51
|
);
|
|
52
52
|
|
|
53
|
+
const instAt = new Date();
|
|
53
54
|
const timeSinceInst = () => new Date().getTime() - instAt.getTime();
|
|
54
55
|
|
|
55
56
|
const emit = defineEmits(['update:modelValue', 'submit', 'dirty']);
|
|
56
|
-
const instAt = new Date();
|
|
57
57
|
let isDirty = $ref(false);
|
|
58
58
|
const data = $computed({
|
|
59
59
|
set: (val: any) => {
|
package/src/plugins/modal.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Plugin } from 'vue';
|
|
|
5
5
|
import type { BglFormSchemaT, BtnOptions } from '@bagelink/vue';
|
|
6
6
|
import { Modal, ModalForm } from '@bagelink/vue';
|
|
7
7
|
|
|
8
|
-
interface ModalOptions {
|
|
8
|
+
export interface ModalOptions {
|
|
9
9
|
title?: string;
|
|
10
10
|
dismissable?: boolean;
|
|
11
11
|
side?: boolean;
|
|
@@ -13,20 +13,31 @@ interface ModalOptions {
|
|
|
13
13
|
class?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface ModalFormOptions {
|
|
16
|
+
export interface ModalFormOptions {
|
|
17
17
|
side?: boolean;
|
|
18
18
|
title?: string;
|
|
19
19
|
dismissable?: boolean;
|
|
20
20
|
schema: BglFormSchemaT<any> | (() => BglFormSchemaT);
|
|
21
|
-
modelValue?: Record<string, any>;
|
|
22
21
|
onSubmit?: (formData: any) => Promise<any>;
|
|
23
22
|
onDelete?: (id: string) => Promise<void>;
|
|
24
23
|
onError?: ((err: any) => void);
|
|
24
|
+
modelValue?: Record<string, any>;
|
|
25
|
+
'onUpdate:modelValue'?: (val: any) => void;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
interface
|
|
28
|
+
export interface ModalComponentProps {
|
|
29
|
+
componentSlots: Record<string, any>,
|
|
30
|
+
modalType: 'modal' | 'modalForm',
|
|
31
|
+
modalOptions: ModalOptions | ModalFormOptions
|
|
32
|
+
}
|
|
33
|
+
export interface ModalFormComponentProps {
|
|
34
|
+
componentSlots: Record<string, any>,
|
|
35
|
+
modalType: 'modalForm',
|
|
36
|
+
modalOptions: ModalFormOptions
|
|
37
|
+
}
|
|
38
|
+
export interface ModalApi {
|
|
28
39
|
showModal: (options: ModalOptions, slots?: Record<string, any>) => void;
|
|
29
|
-
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) =>
|
|
40
|
+
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => ModalFormComponentProps | undefined;
|
|
30
41
|
hideModal: (index?: number) => void;
|
|
31
42
|
}
|
|
32
43
|
|
|
@@ -38,12 +49,6 @@ export const useModal = (): ModalApi => {
|
|
|
38
49
|
return modalApi;
|
|
39
50
|
};
|
|
40
51
|
|
|
41
|
-
interface ModalComponentProps {
|
|
42
|
-
componentSlots: Record<string, any>,
|
|
43
|
-
modalType: 'modal' | 'modalForm',
|
|
44
|
-
modalOptions: ModalOptions | ModalFormOptions
|
|
45
|
-
}
|
|
46
|
-
|
|
47
52
|
export const ModalPlugin: Plugin = {
|
|
48
53
|
install: (app) => {
|
|
49
54
|
const modalStack = $ref<ModalComponentProps[]>([]);
|
|
@@ -62,11 +67,13 @@ export const ModalPlugin: Plugin = {
|
|
|
62
67
|
modalType,
|
|
63
68
|
componentSlots: slots,
|
|
64
69
|
});
|
|
70
|
+
if (modalType === 'modalForm') return modalStack.at(-1) as ModalFormComponentProps | undefined;
|
|
71
|
+
return modalStack.at(-1);
|
|
65
72
|
};
|
|
66
73
|
|
|
67
74
|
app.provide(ModalSymbol, {
|
|
68
75
|
showModal: (options: ModalOptions, slots?: Record<string, any>) => showModal('modal', options, slots),
|
|
69
|
-
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => showModal('modalForm', options, slots),
|
|
76
|
+
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => showModal('modalForm', options, slots) as ModalFormComponentProps,
|
|
70
77
|
hideModal: (index = modalStack.length - 1) => hideModal(index),
|
|
71
78
|
// modalOptions,
|
|
72
79
|
});
|