m-eleplus-crud 0.0.13 → 0.0.15
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.full.js +3 -2
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3 -2
- package/es/components/crud/src/crud.d.ts +7 -0
- package/es/components/table/src/table.d.ts +7 -0
- package/es/index.mjs +5 -5
- package/es/packages/components/barcode/index.mjs +2 -2
- package/es/packages/components/barcode/src/barcode.mjs +18 -53
- package/es/packages/components/barcode/src/barcode.mjs.map +1 -1
- package/es/packages/components/barcode/src/barcode2.mjs +53 -18
- package/es/packages/components/barcode/src/barcode2.mjs.map +1 -1
- package/es/packages/components/crud/src/crud.mjs.map +1 -1
- package/es/packages/components/dialog/index.mjs +2 -2
- package/es/packages/components/dialog/src/dialog.mjs +75 -116
- package/es/packages/components/dialog/src/dialog.mjs.map +1 -1
- package/es/packages/components/dialog/src/dialog2.mjs +116 -75
- package/es/packages/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/packages/components/form/index.mjs +2 -2
- package/es/packages/components/form/src/form.mjs +25 -640
- package/es/packages/components/form/src/form.mjs.map +1 -1
- package/es/packages/components/form/src/form2.mjs +640 -25
- package/es/packages/components/form/src/form2.mjs.map +1 -1
- package/es/packages/components/index.mjs +5 -5
- package/es/packages/components/picture/index.mjs +2 -2
- package/es/packages/components/picture/src/picture.mjs +26 -19
- package/es/packages/components/picture/src/picture.mjs.map +1 -1
- package/es/packages/components/picture/src/picture2.mjs +19 -26
- package/es/packages/components/picture/src/picture2.mjs.map +1 -1
- package/es/packages/components/search/index.mjs +2 -2
- package/es/packages/components/search/src/search.mjs +25 -438
- package/es/packages/components/search/src/search.mjs.map +1 -1
- package/es/packages/components/search/src/search2.mjs +438 -25
- package/es/packages/components/search/src/search2.mjs.map +1 -1
- package/es/packages/components/table/src/table.mjs.map +1 -1
- package/es/packages/components/table/src/table2.mjs +3 -2
- package/es/packages/components/table/src/table2.mjs.map +1 -1
- package/lib/components/crud/src/crud.d.ts +7 -0
- package/lib/components/table/src/table.d.ts +7 -0
- package/lib/index.js +5 -5
- package/lib/packages/components/barcode/index.js +2 -2
- package/lib/packages/components/barcode/src/barcode.js +19 -57
- package/lib/packages/components/barcode/src/barcode.js.map +1 -1
- package/lib/packages/components/barcode/src/barcode2.js +57 -19
- package/lib/packages/components/barcode/src/barcode2.js.map +1 -1
- package/lib/packages/components/crud/src/crud.js.map +1 -1
- package/lib/packages/components/dialog/index.js +2 -2
- package/lib/packages/components/dialog/src/dialog.js +76 -116
- package/lib/packages/components/dialog/src/dialog.js.map +1 -1
- package/lib/packages/components/dialog/src/dialog2.js +116 -76
- package/lib/packages/components/dialog/src/dialog2.js.map +1 -1
- package/lib/packages/components/form/index.js +2 -2
- package/lib/packages/components/form/src/form.js +26 -640
- package/lib/packages/components/form/src/form.js.map +1 -1
- package/lib/packages/components/form/src/form2.js +640 -26
- package/lib/packages/components/form/src/form2.js.map +1 -1
- package/lib/packages/components/index.js +5 -5
- package/lib/packages/components/picture/index.js +2 -2
- package/lib/packages/components/picture/src/picture.js +26 -20
- package/lib/packages/components/picture/src/picture.js.map +1 -1
- package/lib/packages/components/picture/src/picture2.js +20 -26
- package/lib/packages/components/picture/src/picture2.js.map +1 -1
- package/lib/packages/components/search/index.js +2 -2
- package/lib/packages/components/search/src/search.js +26 -438
- package/lib/packages/components/search/src/search.js.map +1 -1
- package/lib/packages/components/search/src/search2.js +438 -26
- package/lib/packages/components/search/src/search2.js.map +1 -1
- package/lib/packages/components/table/src/table.js.map +1 -1
- package/lib/packages/components/table/src/table2.js +3 -2
- package/lib/packages/components/table/src/table2.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,80 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent, useSlots, ref, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, unref, createBlock, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
|
2
|
+
import { dialogProps, dialogEmits } from './dialog.mjs';
|
|
3
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
4
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
5
|
+
import { useGlobalConfig } from '../../config-provider/src/hooks/use-global-config.mjs';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
7
|
+
const COMPONENT_NAME = "MDialog";
|
|
8
|
+
const __default__ = defineComponent({
|
|
9
|
+
name: COMPONENT_NAME
|
|
10
|
+
});
|
|
11
|
+
const _sfc_main = defineComponent({
|
|
12
|
+
...__default__,
|
|
13
|
+
props: dialogProps,
|
|
14
|
+
emits: dialogEmits,
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const slots = useSlots();
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
const globalConfig = useGlobalConfig();
|
|
21
|
+
const dialogLoading = ref(false);
|
|
22
|
+
const closeDialog = () => {
|
|
23
|
+
emit("update:modelValue", false);
|
|
24
|
+
emit("close");
|
|
25
|
+
};
|
|
26
|
+
const enter = () => {
|
|
27
|
+
dialogLoading.value = true;
|
|
28
|
+
const done = () => {
|
|
29
|
+
emit("update:modelValue", false);
|
|
30
|
+
};
|
|
31
|
+
const loading = () => {
|
|
32
|
+
dialogLoading.value = false;
|
|
33
|
+
};
|
|
34
|
+
emit("enter", done, loading);
|
|
35
|
+
};
|
|
36
|
+
const close = () => {
|
|
37
|
+
emit("update:modelValue", false);
|
|
38
|
+
emit("cancel");
|
|
39
|
+
};
|
|
40
|
+
const onBeforeClose = (done) => {
|
|
41
|
+
if (dialogLoading.value) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (props.beforeClose) {
|
|
45
|
+
props.beforeClose(done);
|
|
46
|
+
} else {
|
|
47
|
+
done();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
const _component_el_button = resolveComponent("el-button");
|
|
52
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
53
|
+
return openBlock(), createElementBlock("div", { class: "m-dialog" }, [
|
|
54
|
+
createVNode(_component_el_dialog, {
|
|
55
|
+
class: "m-dialog",
|
|
56
|
+
"model-value": _ctx.modelValue,
|
|
57
|
+
title: _ctx.title,
|
|
58
|
+
width: _ctx.width,
|
|
59
|
+
top: _ctx.top,
|
|
60
|
+
"append-to-body": _ctx.appendToBody,
|
|
61
|
+
"close-on-click-modal": _ctx.closeOnClickModal,
|
|
62
|
+
"close-onn-press-escape": _ctx.closeOnnPressEscape,
|
|
63
|
+
"before-close": onBeforeClose,
|
|
64
|
+
draggable: _ctx.draggable,
|
|
65
|
+
"destroy-on-close": _ctx.destroyOnClose,
|
|
66
|
+
onClose: closeDialog
|
|
67
|
+
}, {
|
|
68
|
+
footer: withCtx(() => [
|
|
69
|
+
!unref(slots).btns ? (openBlock(), createElementBlock("div", {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "dialog-footer"
|
|
72
|
+
}, [
|
|
73
|
+
_ctx.cancelBtn ? (openBlock(), createBlock(_component_el_button, {
|
|
74
|
+
key: 0,
|
|
75
|
+
size: _ctx.size || unref(globalConfig).size,
|
|
76
|
+
icon: _ctx.cancelBtnIcon,
|
|
77
|
+
loading: dialogLoading.value,
|
|
78
|
+
onClick: close
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createTextVNode(
|
|
82
|
+
toDisplayString(_ctx.cancelBtnText || unref(t)("m.dialog.cancelText")),
|
|
83
|
+
1
|
|
84
|
+
)
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["size", "icon", "loading"])) : createCommentVNode("v-if", true),
|
|
88
|
+
_ctx.saveBtn ? (openBlock(), createBlock(_component_el_button, {
|
|
89
|
+
key: 1,
|
|
90
|
+
size: _ctx.size || unref(globalConfig).size,
|
|
91
|
+
icon: _ctx.saveBtnIcon,
|
|
92
|
+
loading: dialogLoading.value,
|
|
93
|
+
type: "primary",
|
|
94
|
+
onClick: enter
|
|
95
|
+
}, {
|
|
96
|
+
default: withCtx(() => [
|
|
97
|
+
createTextVNode(
|
|
98
|
+
toDisplayString(_ctx.saveBtnText || unref(t)("m.dialog.confirmText")),
|
|
99
|
+
1
|
|
100
|
+
)
|
|
101
|
+
]),
|
|
102
|
+
_: 1
|
|
103
|
+
}, 8, ["size", "icon", "loading"])) : createCommentVNode("v-if", true)
|
|
104
|
+
])) : renderSlot(_ctx.$slots, "btns", {
|
|
105
|
+
key: 1,
|
|
106
|
+
loading: dialogLoading.value
|
|
107
|
+
})
|
|
108
|
+
]),
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
renderSlot(_ctx.$slots, "default", { loading: dialogLoading.value })
|
|
111
|
+
]),
|
|
112
|
+
_: 3
|
|
113
|
+
}, 8, ["model-value", "title", "width", "top", "append-to-body", "close-on-click-modal", "close-onn-press-escape", "draggable", "destroy-on-close"])
|
|
114
|
+
]);
|
|
115
|
+
};
|
|
70
116
|
}
|
|
71
117
|
});
|
|
72
|
-
|
|
73
|
-
"update:modelValue": (value) => isBoolean(value),
|
|
74
|
-
close: () => true,
|
|
75
|
-
cancel: () => true,
|
|
76
|
-
enter: (done, loading) => isFunction(done) && isFunction(loading)
|
|
77
|
-
};
|
|
118
|
+
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "dialog.vue"]]);
|
|
78
119
|
|
|
79
|
-
export {
|
|
120
|
+
export { Dialog as default };
|
|
80
121
|
//# sourceMappingURL=dialog2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog2.mjs","sources":["../../../../../../../packages/components/dialog/src/dialog.
|
|
1
|
+
{"version":3,"file":"dialog2.mjs","sources":["../../../../../../../packages/components/dialog/src/dialog.vue"],"sourcesContent":["<template>\r\n <div class=\"m-dialog\">\r\n <el-dialog\r\n class=\"m-dialog\"\r\n :model-value=\"modelValue\"\r\n :title=\"title\"\r\n :width=\"width\"\r\n :top=\"top\"\r\n :append-to-body=\"appendToBody\"\r\n :close-on-click-modal=\"closeOnClickModal\"\r\n :close-onn-press-escape=\"closeOnnPressEscape\"\r\n :before-close=\"onBeforeClose\"\r\n :draggable=\"draggable\"\r\n :destroy-on-close=\"destroyOnClose\"\r\n @close=\"closeDialog\"\r\n >\r\n <slot :loading=\"dialogLoading\" />\r\n <template #footer>\r\n <div v-if=\"!slots.btns\" class=\"dialog-footer\">\r\n <el-button\r\n v-if=\"cancelBtn\"\r\n :size=\"size || globalConfig.size\"\r\n :icon=\"cancelBtnIcon\"\r\n :loading=\"dialogLoading\"\r\n @click=\"close\"\r\n >\r\n {{ cancelBtnText || t('m.dialog.cancelText') }}\r\n </el-button>\r\n <el-button\r\n v-if=\"saveBtn\"\r\n :size=\"size || globalConfig.size\"\r\n :icon=\"saveBtnIcon\"\r\n :loading=\"dialogLoading\"\r\n type=\"primary\"\r\n @click=\"enter\"\r\n >\r\n {{ saveBtnText || t('m.dialog.confirmText') }}\r\n </el-button>\r\n </div>\r\n <slot v-else :loading=\"dialogLoading\" name=\"btns\" />\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { ref, useSlots } from 'vue'\r\nimport { useGlobalConfig } from '@m-eleplus-crud/components'\r\nimport { useLocale } from '@m-eleplus-crud/hooks'\r\nimport { dialogEmits, dialogProps } from './dialog'\r\n\r\nconst COMPONENT_NAME = 'MDialog'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\n\r\nconst props = defineProps(dialogProps)\r\nconst emit = defineEmits(dialogEmits)\r\n\r\n// 插槽信息\r\nconst slots = useSlots()\r\n// 国际化\r\nconst { t } = useLocale()\r\n// 全局配置\r\nconst globalConfig = useGlobalConfig()\r\n\r\n// 弹窗内是否loading\r\nconst dialogLoading = ref(false)\r\n\r\n/**\r\n * @description 弹窗关闭\r\n */\r\nconst closeDialog = () => {\r\n emit('update:modelValue', false)\r\n emit('close')\r\n}\r\n\r\n/**\r\n * 确认\r\n */\r\nconst enter = () => {\r\n // 弹窗开始加载\r\n dialogLoading.value = true\r\n // 关闭表单\r\n const done = () => {\r\n emit('update:modelValue', false)\r\n }\r\n // 关闭加载\r\n const loading = () => {\r\n dialogLoading.value = false\r\n }\r\n\r\n emit('enter', done, loading)\r\n}\r\n\r\n/**\r\n * 关闭\r\n */\r\nconst close = () => {\r\n emit('update:modelValue', false)\r\n emit('cancel')\r\n}\r\n\r\n/**\r\n * 弹窗关闭前\r\n * @param done 完成回调\r\n */\r\nconst onBeforeClose = (done: () => void) => {\r\n if (dialogLoading.value) {\r\n return false\r\n }\r\n if (props.beforeClose) {\r\n props.beforeClose(done)\r\n } else {\r\n done()\r\n }\r\n}\r\n</script>\r\n"],"names":["DO_defineComponent"],"mappings":";;;;;;;AAoDc,MAAA,cAAAA,eAAA,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAGb,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEjB,IAAA,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAExB,IAAA,MAAM,eAAe,eAAgB,EAAA,CAAA;AAG/B,IAAA,MAAA,aAAA,GAAgB,IAAI,KAAK,CAAA,CAAA;AAK/B,IAAA,MAAM,cAAc,MAAM;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,KACd,CAAA;AAKA,IAAA,MAAM,QAAQ,MAAM;AAElB,MAAA,aAAA,CAAc,KAAQ,GAAA,IAAA,CAAA;AAEtB,MAAA,MAAM,OAAO,MAAM;AACjB,QAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAAA,OACjC,CAAA;AAEA,MAAA,MAAM,UAAU,MAAM;AACpB,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACxB,CAAA;AAEK,MAAA,IAAA,CAAA,OAAA,EAAS,MAAM,OAAO,CAAA,CAAA;AAAA,KAC7B,CAAA;AAKA,IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,QAAQ,CAAA,CAAA;AAAA,KACf,CAAA;AAMM,IAAA,MAAA,aAAA,GAAgB,CAAC,IAAqB,KAAA;AAC1C,MAAA,IAAI,cAAc,KAAO,EAAA;AAChB,QAAA,OAAA,KAAA,CAAA;AAAA,OACT;AACA,MAAA,IAAI,MAAM,WAAa,EAAA;AACrB,QAAA,KAAA,CAAM,YAAY,IAAI,CAAA,CAAA;AAAA,OACjB,MAAA;AACA,QAAA,IAAA,EAAA,CAAA;AAAA,OACP;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Form from './src/
|
|
2
|
-
export { formEmits, formProps } from './src/
|
|
1
|
+
import Form from './src/form2.mjs';
|
|
2
|
+
export { formEmits, formProps } from './src/form.mjs';
|
|
3
3
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
4
4
|
|
|
5
5
|
const MForm = withInstall(Form);
|