m-eleplus-crud 0.0.2 → 0.0.4
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 +28 -17
- package/dist/index.full.min.js +15 -15
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +29 -18
- package/es/components/form/src/form.d.ts +5 -1
- package/es/index.mjs +3 -3
- 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/src/form.mjs.map +1 -1
- package/es/packages/components/form/src/form2.mjs +28 -17
- package/es/packages/components/form/src/form2.mjs.map +1 -1
- package/es/packages/components/index.mjs +3 -3
- package/es/packages/components/picture/index.mjs +2 -2
- package/es/packages/components/picture/src/picture.mjs +19 -26
- package/es/packages/components/picture/src/picture.mjs.map +1 -1
- package/es/packages/components/picture/src/picture2.mjs +26 -19
- 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 +423 -25
- package/es/packages/components/search/src/search.mjs.map +1 -1
- package/es/packages/components/search/src/search2.mjs +25 -423
- package/es/packages/components/search/src/search2.mjs.map +1 -1
- package/es/packages/components/table/src/table2.mjs +1 -1
- package/es/packages/components/table/src/table2.mjs.map +1 -1
- package/lib/components/form/src/form.d.ts +5 -1
- package/lib/index.js +3 -3
- 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/src/form.js.map +1 -1
- package/lib/packages/components/form/src/form2.js +27 -16
- package/lib/packages/components/form/src/form2.js.map +1 -1
- package/lib/packages/components/index.js +3 -3
- package/lib/packages/components/picture/index.js +2 -2
- package/lib/packages/components/picture/src/picture.js +20 -26
- package/lib/packages/components/picture/src/picture.js.map +1 -1
- package/lib/packages/components/picture/src/picture2.js +26 -20
- 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 +423 -26
- package/lib/packages/components/search/src/search.js.map +1 -1
- package/lib/packages/components/search/src/search2.js +26 -423
- package/lib/packages/components/search/src/search2.js.map +1 -1
- package/lib/packages/components/table/src/table2.js +1 -1
- package/lib/packages/components/table/src/table2.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! M ElePlus Crud v0.0.1 */
|
|
2
2
|
|
|
3
|
-
import { shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, inject, computed, isRef, provide, renderSlot, useSlots, resolveComponent, createVNode, withModifiers, withCtx, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withKeys, createTextVNode, toDisplayString, normalizeStyle, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, resolveDynamicComponent, onBeforeUnmount, Text, reactive, h, markRaw, toRefs, Transition, withDirectives, vShow, isVNode, render as render$1, createSlots, normalizeProps, guardReactiveProps, resolveDirective } from 'vue';
|
|
3
|
+
import { shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, inject, computed, isRef, provide, renderSlot, useSlots, resolveComponent, createVNode, withModifiers, withCtx, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withKeys, createTextVNode, toDisplayString, normalizeStyle, toHandlers, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, resolveDynamicComponent, onBeforeUnmount, Text, reactive, h, markRaw, toRefs, Transition, withDirectives, vShow, isVNode, render as render$1, createSlots, normalizeProps, guardReactiveProps, resolveDirective } from 'vue';
|
|
4
4
|
|
|
5
5
|
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
6
6
|
|
|
@@ -12804,6 +12804,17 @@ const _sfc_main$9 = defineComponent({
|
|
|
12804
12804
|
}
|
|
12805
12805
|
}
|
|
12806
12806
|
};
|
|
12807
|
+
const getFormItemEventBind = (column) => {
|
|
12808
|
+
const result = {};
|
|
12809
|
+
for (const key in column) {
|
|
12810
|
+
if (key.startsWith("event")) {
|
|
12811
|
+
let funName = key.replace("event", "");
|
|
12812
|
+
funName = funName.charAt(0).toLowerCase() + funName.slice(1);
|
|
12813
|
+
result[funName] = column[key];
|
|
12814
|
+
}
|
|
12815
|
+
}
|
|
12816
|
+
return result;
|
|
12817
|
+
};
|
|
12807
12818
|
const formatDicValue = (row, column) => {
|
|
12808
12819
|
let dictLabel = "";
|
|
12809
12820
|
const findLabelByValue = (dicData, value) => {
|
|
@@ -12955,7 +12966,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
12955
12966
|
[
|
|
12956
12967
|
createCommentVNode(""),
|
|
12957
12968
|
createCommentVNode("\u8F93\u5165\u6846"),
|
|
12958
|
-
createVNode(_component_el_input, {
|
|
12969
|
+
createVNode(_component_el_input, mergeProps({
|
|
12959
12970
|
modelValue: unref(proxys)[column.prop || ""],
|
|
12960
12971
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
12961
12972
|
modelModifiers: { trim: true },
|
|
@@ -12965,7 +12976,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
12965
12976
|
"show-word-limit": column.showWordLimit,
|
|
12966
12977
|
"show-password": column.showPassword,
|
|
12967
12978
|
type: !column.type || column.type === "input" ? "text" : column.type
|
|
12968
|
-
}, null,
|
|
12979
|
+
}, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "show-password", "type"])
|
|
12969
12980
|
],
|
|
12970
12981
|
2112
|
|
12971
12982
|
)) : column.type === "select" ? (openBlock(), createElementBlock(
|
|
@@ -12974,7 +12985,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
12974
12985
|
[
|
|
12975
12986
|
createCommentVNode(""),
|
|
12976
12987
|
createCommentVNode("\u4E0B\u62C9\u6846"),
|
|
12977
|
-
createVNode(_component_el_select, {
|
|
12988
|
+
createVNode(_component_el_select, mergeProps({
|
|
12978
12989
|
modelValue: unref(proxys)[column.prop || ""],
|
|
12979
12990
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
12980
12991
|
modelModifiers: { trim: true },
|
|
@@ -12987,7 +12998,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
12987
12998
|
remote: column.remote,
|
|
12988
12999
|
"remote-method": column.remoteMethod,
|
|
12989
13000
|
loading: column.loading
|
|
12990
|
-
}, {
|
|
13001
|
+
}, toHandlers(getFormItemEventBind(column))), {
|
|
12991
13002
|
default: withCtx(() => [
|
|
12992
13003
|
(openBlock(true), createElementBlock(
|
|
12993
13004
|
Fragment,
|
|
@@ -13003,7 +13014,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13003
13014
|
))
|
|
13004
13015
|
]),
|
|
13005
13016
|
_: 2
|
|
13006
|
-
},
|
|
13017
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "clearable", "filterable", "filter-method", "remote", "remote-method", "loading"])
|
|
13007
13018
|
],
|
|
13008
13019
|
2112
|
|
13009
13020
|
)) : column.type === "radio" ? (openBlock(), createElementBlock(
|
|
@@ -13012,11 +13023,11 @@ const _sfc_main$9 = defineComponent({
|
|
|
13012
13023
|
[
|
|
13013
13024
|
createCommentVNode(""),
|
|
13014
13025
|
createCommentVNode("radio"),
|
|
13015
|
-
createVNode(_component_el_radio_group, {
|
|
13026
|
+
createVNode(_component_el_radio_group, mergeProps({
|
|
13016
13027
|
modelValue: unref(proxys)[column.prop || ""],
|
|
13017
13028
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
13018
13029
|
style: { "width": "100%" }
|
|
13019
|
-
}, {
|
|
13030
|
+
}, toHandlers(getFormItemEventBind(column))), {
|
|
13020
13031
|
default: withCtx(() => [
|
|
13021
13032
|
(openBlock(true), createElementBlock(
|
|
13022
13033
|
Fragment,
|
|
@@ -13040,7 +13051,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13040
13051
|
))
|
|
13041
13052
|
]),
|
|
13042
13053
|
_: 2
|
|
13043
|
-
},
|
|
13054
|
+
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
13044
13055
|
],
|
|
13045
13056
|
2112
|
|
13046
13057
|
)) : column.type === "checkbox" ? (openBlock(), createElementBlock(
|
|
@@ -13049,11 +13060,11 @@ const _sfc_main$9 = defineComponent({
|
|
|
13049
13060
|
[
|
|
13050
13061
|
createCommentVNode(""),
|
|
13051
13062
|
createCommentVNode("checkbox"),
|
|
13052
|
-
createVNode(_component_el_checkbox_group, {
|
|
13063
|
+
createVNode(_component_el_checkbox_group, mergeProps({
|
|
13053
13064
|
modelValue: unref(proxys)[column.prop || ""],
|
|
13054
13065
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
13055
13066
|
style: { "width": "100%" }
|
|
13056
|
-
}, {
|
|
13067
|
+
}, toHandlers(getFormItemEventBind(column))), {
|
|
13057
13068
|
default: withCtx(() => [
|
|
13058
13069
|
(openBlock(true), createElementBlock(
|
|
13059
13070
|
Fragment,
|
|
@@ -13069,7 +13080,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13069
13080
|
))
|
|
13070
13081
|
]),
|
|
13071
13082
|
_: 2
|
|
13072
|
-
},
|
|
13083
|
+
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
13073
13084
|
],
|
|
13074
13085
|
2112
|
|
13075
13086
|
)) : column.type === "switch" ? (openBlock(), createElementBlock(
|
|
@@ -13085,12 +13096,12 @@ const _sfc_main$9 = defineComponent({
|
|
|
13085
13096
|
Fragment,
|
|
13086
13097
|
{ key: 1 },
|
|
13087
13098
|
[
|
|
13088
|
-
createVNode(_component_el_switch, {
|
|
13099
|
+
createVNode(_component_el_switch, mergeProps({
|
|
13089
13100
|
modelValue: unref(proxys)[column.prop || ""],
|
|
13090
13101
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
13091
13102
|
"active-value": column.dicData[0].value,
|
|
13092
13103
|
"inactive-value": column.dicData[1].value
|
|
13093
|
-
}, null,
|
|
13104
|
+
}, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"]),
|
|
13094
13105
|
createElementVNode(
|
|
13095
13106
|
"span",
|
|
13096
13107
|
{ style: { "font-size": "var(--el-font-size-base)", "color": "var(--el-text-color-regular)", "margin-left": "6px" } },
|
|
@@ -13108,7 +13119,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13108
13119
|
[
|
|
13109
13120
|
createCommentVNode(""),
|
|
13110
13121
|
createCommentVNode("\u65F6\u95F4"),
|
|
13111
|
-
column.type !== "time" && column.type !== "timerange" ? (openBlock(), createBlock(_component_el_date_picker, {
|
|
13122
|
+
column.type !== "time" && column.type !== "timerange" ? (openBlock(), createBlock(_component_el_date_picker, mergeProps({
|
|
13112
13123
|
key: 0,
|
|
13113
13124
|
modelValue: unref(proxys)[column.prop || ""],
|
|
13114
13125
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
@@ -13118,7 +13129,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13118
13129
|
"end-placeholder": column.endPlaceholder,
|
|
13119
13130
|
format: column.format,
|
|
13120
13131
|
"value-format": column.valueFormat || getValueFormatByType(column.type)
|
|
13121
|
-
}, null,
|
|
13132
|
+
}, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "type", "clearable", "start-placeholder", "end-placeholder", "format", "value-format"])) : (openBlock(), createBlock(_component_el_time_picker, mergeProps({
|
|
13122
13133
|
key: 1,
|
|
13123
13134
|
modelValue: unref(proxys)[column.prop || ""],
|
|
13124
13135
|
"onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
|
|
@@ -13127,7 +13138,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13127
13138
|
"start-placeholder": column.startPlaceholder,
|
|
13128
13139
|
"end-placeholder": column.endPlaceholder,
|
|
13129
13140
|
"value-format": column.valueFormat || getValueFormatByType(column.type)
|
|
13130
|
-
}, null,
|
|
13141
|
+
}, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
|
|
13131
13142
|
],
|
|
13132
13143
|
64
|
|
13133
13144
|
)) : column.type === "picture" ? (openBlock(), createElementBlock(
|
|
@@ -18275,7 +18286,7 @@ const _sfc_main = defineComponent({
|
|
|
18275
18286
|
renderList(tableOption.value.column, (column, columnIndex) => {
|
|
18276
18287
|
return openBlock(), createBlock(_component_el_table_column, {
|
|
18277
18288
|
key: columnIndex,
|
|
18278
|
-
type: ["index", "selection"].includes(column.type) ? column.type :
|
|
18289
|
+
type: ["index", "selection"].includes(column.type) ? column.type : "default",
|
|
18279
18290
|
width: column.width,
|
|
18280
18291
|
label: column.label,
|
|
18281
18292
|
prop: column.prop,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ColumnType, ICommonColumn } from '../../common';
|
|
2
2
|
import type { FormItemRule } from 'element-plus';
|
|
3
3
|
import type { ExtractPropTypes } from 'vue';
|
|
4
|
+
type EventHandlers = {
|
|
5
|
+
[K in `event${string}`]?: (...args: any[]) => any;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* @description 公开的form column配置
|
|
6
9
|
*/
|
|
7
|
-
export interface IFormCommonColumn {
|
|
10
|
+
export interface IFormCommonColumn extends EventHandlers {
|
|
8
11
|
/**
|
|
9
12
|
* 表单校验规则
|
|
10
13
|
*/
|
|
@@ -89,3 +92,4 @@ export declare const formProps: {
|
|
|
89
92
|
export type FormProps = ExtractPropTypes<typeof formProps>;
|
|
90
93
|
export declare const formEmits: {};
|
|
91
94
|
export type FormEmits = typeof formEmits;
|
|
95
|
+
export {};
|
package/es/index.mjs
CHANGED
|
@@ -7,11 +7,11 @@ export { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from
|
|
|
7
7
|
export { MConfigProvider } from './packages/components/config-provider/index.mjs';
|
|
8
8
|
export { tableEmits, tableProps } from './packages/components/table/src/table.mjs';
|
|
9
9
|
export { MTable } from './packages/components/table/index.mjs';
|
|
10
|
-
export { searchEmits, searchProps } from './packages/components/search/src/
|
|
10
|
+
export { searchEmits, searchProps } from './packages/components/search/src/search2.mjs';
|
|
11
11
|
export { MSearch } from './packages/components/search/index.mjs';
|
|
12
|
-
export { pictureEmits, pictureProps } from './packages/components/picture/src/
|
|
12
|
+
export { pictureEmits, pictureProps } from './packages/components/picture/src/picture.mjs';
|
|
13
13
|
export { MPicture } from './packages/components/picture/index.mjs';
|
|
14
|
-
export { dialogEmits, dialogProps } from './packages/components/dialog/src/
|
|
14
|
+
export { dialogEmits, dialogProps } from './packages/components/dialog/src/dialog.mjs';
|
|
15
15
|
export { MDialog } from './packages/components/dialog/index.mjs';
|
|
16
16
|
export { qrcodeEmits, qrcodeProps } from './packages/components/qrcode/src/qrcode.mjs';
|
|
17
17
|
export { MQrcode } from './packages/components/qrcode/index.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Dialog from './src/
|
|
2
|
-
export { dialogEmits, dialogProps } from './src/
|
|
1
|
+
import Dialog from './src/dialog2.mjs';
|
|
2
|
+
export { dialogEmits, dialogProps } from './src/dialog.mjs';
|
|
3
3
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
4
4
|
|
|
5
5
|
const MDialog = withInstall(Dialog);
|
|
@@ -1,121 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { useGlobalConfig } from '../../config-provider/src/hooks/use-global-config.mjs';
|
|
1
|
+
import { isBoolean } from '../../../utils/types.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
4
|
+
import { isFunction } from '@vue/shared';
|
|
6
5
|
|
|
7
|
-
const
|
|
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
|
-
|
|
70
|
-
|
|
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
|
-
};
|
|
6
|
+
const dialogProps = buildProps({
|
|
7
|
+
size: useSizeProp,
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "600px"
|
|
19
|
+
},
|
|
20
|
+
top: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "2vh"
|
|
23
|
+
},
|
|
24
|
+
appendToBody: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
closeOnClickModal: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
closeOnnPressEscape: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
beforeClose: {
|
|
37
|
+
type: Function
|
|
38
|
+
},
|
|
39
|
+
draggable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
destroyOnClose: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
saveBtn: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
cancelBtn: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
saveBtnText: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
saveBtnIcon: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "CircleCheck"
|
|
62
|
+
},
|
|
63
|
+
cancelBtnIcon: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "CircleClose"
|
|
66
|
+
},
|
|
67
|
+
cancelBtnText: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ""
|
|
116
70
|
}
|
|
117
71
|
});
|
|
118
|
-
|
|
72
|
+
const dialogEmits = {
|
|
73
|
+
"update:modelValue": (value) => isBoolean(value),
|
|
74
|
+
close: () => true,
|
|
75
|
+
cancel: () => true,
|
|
76
|
+
enter: (done, loading) => isFunction(done) && isFunction(loading)
|
|
77
|
+
};
|
|
119
78
|
|
|
120
|
-
export {
|
|
79
|
+
export { dialogEmits, dialogProps };
|
|
121
80
|
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","sources":["../../../../../../../packages/components/dialog/src/dialog.
|
|
1
|
+
{"version":3,"file":"dialog.mjs","sources":["../../../../../../../packages/components/dialog/src/dialog.ts"],"sourcesContent":["import { buildProps, isBoolean, isFunction } from '@m-eleplus-crud/utils'\r\nimport { useSizeProp } from '@m-eleplus-crud/hooks'\r\n\r\nimport type { ExtractPropTypes } from 'vue'\r\n\r\nexport const dialogProps = buildProps({\r\n /**\r\n * @description 弹窗尺寸\r\n */\r\n size: useSizeProp,\r\n /**\r\n * @description 弹窗显示状态\r\n */\r\n modelValue: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n /**\r\n * @description 弹窗标题\r\n */\r\n title: {\r\n type: String,\r\n default: '',\r\n },\r\n /**\r\n * @description 弹窗宽度\r\n */\r\n width: {\r\n type: String,\r\n default: '600px',\r\n },\r\n /**\r\n * @description 顶部距离\r\n */\r\n top: {\r\n type: String,\r\n default: '2vh',\r\n },\r\n /**\r\n * @description 插入body\r\n */\r\n appendToBody: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * @description 是否可以通过点击modal关闭Dialog\r\n */\r\n closeOnClickModal: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n /**\r\n * @description 是否可以通过按下ESC关闭Dialog\r\n */\r\n closeOnnPressEscape: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n /**\r\n * @description 弹窗关闭前回调\r\n */\r\n beforeClose: {\r\n type: Function,\r\n },\r\n /**\r\n * @description 为dialog开启拖拽功能\r\n */\r\n draggable: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * @description 当关闭Dialog时,销毁其中的元素\r\n */\r\n destroyOnClose: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * @description 保存按钮是否展示\r\n */\r\n saveBtn: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * @description 取消按钮是否展示\r\n */\r\n cancelBtn: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n /**\r\n * @description 保存按钮文字\r\n */\r\n saveBtnText: {\r\n type: String,\r\n default: '',\r\n },\r\n /**\r\n * @description 保存按钮图标\r\n */\r\n saveBtnIcon: {\r\n type: String,\r\n default: 'CircleCheck',\r\n },\r\n /**\r\n * @description 取消按钮图标\r\n */\r\n cancelBtnIcon: {\r\n type: String,\r\n default: 'CircleClose',\r\n },\r\n /**\r\n * @description 取消按钮文字\r\n */\r\n cancelBtnText: {\r\n type: String,\r\n default: '',\r\n },\r\n} as const)\r\nexport type DialogProps = ExtractPropTypes<typeof dialogProps>\r\n\r\nexport const dialogEmits = {\r\n /**\r\n * @description 更新弹窗状态\r\n * @param value 弹窗显示状态\r\n * @returns\r\n */\r\n 'update:modelValue': (value: boolean) => isBoolean(value),\r\n /**\r\n * @description 弹窗关闭\r\n * @returns\r\n */\r\n close: () => true,\r\n /**\r\n * @description 弹窗取消\r\n * @returns\r\n */\r\n cancel: () => true,\r\n /**\r\n * @description 弹窗确认\r\n * @param done 完成\r\n * @param loading 加载完毕\r\n * @returns\r\n */\r\n enter: (done: () => void, loading: () => void) =>\r\n isFunction(done) && isFunction(loading),\r\n}\r\nexport type DialogEmits = typeof dialogEmits\r\n"],"names":[],"mappings":";;;;;AAKO,MAAM,cAAc,UAAW,CAAA;AAAA,EAIpC,IAAM,EAAA,WAAA;AAAA,EAIN,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,QAAU,EAAA,IAAA;AAAA,GACZ;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,OAAA;AAAA,GACX;AAAA,EAIA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,iBAAmB,EAAA;AAAA,IACjB,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EAIA,mBAAqB,EAAA;AAAA,IACnB,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,QAAA;AAAA,GACR;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,cAAgB,EAAA;AAAA,IACd,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,aAAA;AAAA,GACX;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,aAAA;AAAA,GACX;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AACF,CAAU,EAAA;AAGH,MAAM,WAAc,GAAA;AAAA,EAMzB,mBAAqB,EAAA,CAAC,KAAmB,KAAA,SAAA,CAAU,KAAK,CAAA;AAAA,EAKxD,OAAO,MAAM,IAAA;AAAA,EAKb,QAAQ,MAAM,IAAA;AAAA,EAOd,KAAA,EAAO,CAAC,IAAkB,EAAA,OAAA,KACxB,WAAW,IAAI,CAAA,IAAK,WAAW,OAAO,CAAA;AAC1C;;;;"}
|