m-eleplus-crud 0.0.12 → 0.0.14
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 +4 -3
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -3
- package/es/components/table/src/table.d.ts +7 -0
- package/es/index.mjs +3 -3
- 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/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 +1 -1
- package/es/packages/components/form/src/form.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/table/src/table.mjs +3 -2
- package/es/packages/components/table/src/table.mjs.map +1 -1
- package/es/packages/components/table/src/table2.mjs.map +1 -1
- package/lib/components/table/src/table.d.ts +7 -0
- package/lib/index.js +3 -3
- 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/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 +1 -1
- package/lib/packages/components/form/src/form.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/table/src/table.js +3 -2
- package/lib/packages/components/table/src/table.js.map +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
|
@@ -13225,7 +13225,7 @@ const _sfc_main$9 = defineComponent({
|
|
|
13225
13225
|
column.type === "picture" ? (openBlock(), createBlock(_component_MPicture, {
|
|
13226
13226
|
key: 0,
|
|
13227
13227
|
src: getDetailPic(unref(proxys), column)[0],
|
|
13228
|
-
"preview-src-list": getDetailPic(unref(proxys), column)
|
|
13228
|
+
"preview-src-list": getDetailPic(unref(proxys), column),
|
|
13229
13229
|
"img-width": "100px",
|
|
13230
13230
|
"img-height": "100px"
|
|
13231
13231
|
}, null, 8, ["src", "preview-src-list"])) : NEED_DIC_TYPE.includes(column.type || "") ? (openBlock(), createElementBlock(
|
|
@@ -18336,7 +18336,8 @@ const _sfc_main = defineComponent({
|
|
|
18336
18336
|
prop: column.prop,
|
|
18337
18337
|
align: column.align || "center",
|
|
18338
18338
|
"show-overflow-tooltip": column.overHidden,
|
|
18339
|
-
formatter: column.formatter ? (row, col, cellValue, index) => column.formatter(row, column, index) : null
|
|
18339
|
+
formatter: column.formatter ? (row, col, cellValue, index) => column.formatter(row, column, index) : null,
|
|
18340
|
+
selectable: column.selectable
|
|
18340
18341
|
}, createSlots({
|
|
18341
18342
|
_: 2
|
|
18342
18343
|
}, [
|
|
@@ -18440,7 +18441,7 @@ const _sfc_main = defineComponent({
|
|
|
18440
18441
|
]),
|
|
18441
18442
|
key: "2"
|
|
18442
18443
|
} : void 0
|
|
18443
|
-
]), 1032, ["type", "width", "label", "prop", "align", "show-overflow-tooltip", "formatter"]);
|
|
18444
|
+
]), 1032, ["type", "width", "label", "prop", "align", "show-overflow-tooltip", "formatter", "selectable"]);
|
|
18444
18445
|
}),
|
|
18445
18446
|
128
|
|
18446
18447
|
)),
|
|
@@ -50,6 +50,13 @@ export interface ITableColumn extends ICommonColumn, ITableCommonColumn {
|
|
|
50
50
|
* @description 类型
|
|
51
51
|
*/
|
|
52
52
|
type?: ColumnType | 'index' | 'single' | 'selection';
|
|
53
|
+
/**
|
|
54
|
+
* @description 仅对 type=selection 的列有效,类型为 Function,Function 的返回值用来决定这一行的 CheckBox 是否可以勾选
|
|
55
|
+
* @param row 行数据
|
|
56
|
+
* @param index 索引
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
selectable?: (row: any, index: number) => boolean;
|
|
53
60
|
}
|
|
54
61
|
/**
|
|
55
62
|
* @description 公开的table配置
|
package/es/index.mjs
CHANGED
|
@@ -9,13 +9,13 @@ export { tableEmits, tableProps } from './packages/components/table/src/table2.m
|
|
|
9
9
|
export { MTable } from './packages/components/table/index.mjs';
|
|
10
10
|
export { searchEmits, searchProps } from './packages/components/search/src/search.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';
|
|
18
|
-
export { barcodeEmits, barcodeProps } from './packages/components/barcode/src/
|
|
18
|
+
export { barcodeEmits, barcodeProps } from './packages/components/barcode/src/barcode.mjs';
|
|
19
19
|
export { MBarcode } from './packages/components/barcode/index.mjs';
|
|
20
20
|
export { formEmits, formProps } from './packages/components/form/src/form2.mjs';
|
|
21
21
|
export { MForm } from './packages/components/form/index.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Barcode from './src/
|
|
2
|
-
export { barcodeEmits, barcodeProps } from './src/
|
|
1
|
+
import Barcode from './src/barcode2.mjs';
|
|
2
|
+
export { barcodeEmits, barcodeProps } from './src/barcode.mjs';
|
|
3
3
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
4
4
|
|
|
5
5
|
const MBarcode = withInstall(Barcode);
|
|
@@ -1,58 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { barcodeProps, barcodeEmits } from './barcode2.mjs';
|
|
4
|
-
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
1
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
2
|
+
import { isString } from '@vue/shared';
|
|
5
3
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
watch(
|
|
19
|
-
() => props.text,
|
|
20
|
-
(newVal) => {
|
|
21
|
-
if (!newVal)
|
|
22
|
-
return;
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
barcodeRef.value.innerHTML = "";
|
|
25
|
-
JsBarcode(barcodeRef.value, newVal, {
|
|
26
|
-
format: "CODE128",
|
|
27
|
-
lineColor: "#000",
|
|
28
|
-
width: props.barcodeWidth,
|
|
29
|
-
height: props.barcodeHeight,
|
|
30
|
-
displayValue: false
|
|
31
|
-
});
|
|
32
|
-
barcodeRef.value.onclick = () => {
|
|
33
|
-
emit("click", newVal);
|
|
34
|
-
};
|
|
35
|
-
}, 0);
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
immediate: true
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
return (_ctx, _cache) => {
|
|
42
|
-
return openBlock(), createElementBlock(
|
|
43
|
-
"img",
|
|
44
|
-
{
|
|
45
|
-
ref_key: "barcodeRef",
|
|
46
|
-
ref: barcodeRef,
|
|
47
|
-
class: "m-barcode-box"
|
|
48
|
-
},
|
|
49
|
-
null,
|
|
50
|
-
512
|
|
51
|
-
);
|
|
52
|
-
};
|
|
4
|
+
const barcodeProps = buildProps({
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
barcodeWidth: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 2
|
|
12
|
+
},
|
|
13
|
+
barcodeHeight: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 50
|
|
53
16
|
}
|
|
54
17
|
});
|
|
55
|
-
|
|
18
|
+
const barcodeEmits = {
|
|
19
|
+
click: (val) => isString(val)
|
|
20
|
+
};
|
|
56
21
|
|
|
57
|
-
export {
|
|
22
|
+
export { barcodeEmits, barcodeProps };
|
|
58
23
|
//# sourceMappingURL=barcode.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barcode.mjs","sources":["../../../../../../../packages/components/barcode/src/barcode.
|
|
1
|
+
{"version":3,"file":"barcode.mjs","sources":["../../../../../../../packages/components/barcode/src/barcode.ts"],"sourcesContent":["import { buildProps, isString } from '@m-eleplus-crud/utils'\r\n\r\nimport type { ExtractPropTypes } from 'vue'\r\n\r\nexport const barcodeProps = buildProps({\r\n /**\r\n * @description 一维码内容\r\n */\r\n text: {\r\n type: String,\r\n required: true,\r\n },\r\n /**\r\n * @description 宽度\r\n */\r\n barcodeWidth: {\r\n type: Number,\r\n default: 2,\r\n },\r\n /**\r\n * @description 高度\r\n */\r\n barcodeHeight: {\r\n type: Number,\r\n default: 50,\r\n },\r\n} as const)\r\nexport type BarcodeProps = ExtractPropTypes<typeof barcodeProps>\r\n\r\nexport const barcodeEmits = {\r\n click: (val: string) => isString(val),\r\n}\r\nexport type BarcodeEmits = typeof barcodeEmits\r\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,UAAW,CAAA;AAAA,EAIrC,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA,IAAA;AAAA,GACZ;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AACF,CAAU,EAAA;AAGH,MAAM,YAAe,GAAA;AAAA,EAC1B,KAAO,EAAA,CAAC,GAAgB,KAAA,QAAA,CAAS,GAAG,CAAA;AACtC;;;;"}
|
|
@@ -1,23 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, ref, watch, openBlock, createElementBlock } from 'vue';
|
|
2
|
+
import JsBarcode from 'jsbarcode';
|
|
3
|
+
import { barcodeProps, barcodeEmits } from './barcode.mjs';
|
|
4
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
5
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const COMPONENT_NAME = "MBarcode";
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: COMPONENT_NAME
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = defineComponent({
|
|
11
|
+
...__default__,
|
|
12
|
+
props: barcodeProps,
|
|
13
|
+
emits: barcodeEmits,
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const emit = __emit;
|
|
17
|
+
const barcodeRef = ref();
|
|
18
|
+
watch(
|
|
19
|
+
() => props.text,
|
|
20
|
+
(newVal) => {
|
|
21
|
+
if (!newVal)
|
|
22
|
+
return;
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
barcodeRef.value.innerHTML = "";
|
|
25
|
+
JsBarcode(barcodeRef.value, newVal, {
|
|
26
|
+
format: "CODE128",
|
|
27
|
+
lineColor: "#000",
|
|
28
|
+
width: props.barcodeWidth,
|
|
29
|
+
height: props.barcodeHeight,
|
|
30
|
+
displayValue: false
|
|
31
|
+
});
|
|
32
|
+
barcodeRef.value.onclick = () => {
|
|
33
|
+
emit("click", newVal);
|
|
34
|
+
};
|
|
35
|
+
}, 0);
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
immediate: true
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return openBlock(), createElementBlock(
|
|
43
|
+
"img",
|
|
44
|
+
{
|
|
45
|
+
ref_key: "barcodeRef",
|
|
46
|
+
ref: barcodeRef,
|
|
47
|
+
class: "m-barcode-box"
|
|
48
|
+
},
|
|
49
|
+
null,
|
|
50
|
+
512
|
|
51
|
+
);
|
|
52
|
+
};
|
|
16
53
|
}
|
|
17
54
|
});
|
|
18
|
-
|
|
19
|
-
click: (val) => isString(val)
|
|
20
|
-
};
|
|
55
|
+
var Barcode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "barcode.vue"]]);
|
|
21
56
|
|
|
22
|
-
export {
|
|
57
|
+
export { Barcode as default };
|
|
23
58
|
//# sourceMappingURL=barcode2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barcode2.mjs","sources":["../../../../../../../packages/components/barcode/src/barcode.
|
|
1
|
+
{"version":3,"file":"barcode2.mjs","sources":["../../../../../../../packages/components/barcode/src/barcode.vue"],"sourcesContent":["<template>\r\n <img ref=\"barcodeRef\" class=\"m-barcode-box\" />\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { ref, watch } from 'vue'\r\nimport JsBarcode from 'jsbarcode'\r\nimport { barcodeEmits, barcodeProps } from './barcode'\r\n\r\nconst COMPONENT_NAME = 'MBarcode'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\n\r\nconst props = defineProps(barcodeProps)\r\nconst emit = defineEmits(barcodeEmits)\r\n\r\nconst barcodeRef = ref<any>()\r\n\r\nwatch(\r\n () => props.text as string,\r\n (newVal: string) => {\r\n if (!newVal) return\r\n setTimeout(() => {\r\n barcodeRef.value.innerHTML = ''\r\n JsBarcode(barcodeRef.value, newVal, {\r\n format: 'CODE128',\r\n lineColor: '#000',\r\n width: props.barcodeWidth,\r\n height: props.barcodeHeight,\r\n displayValue: false,\r\n })\r\n barcodeRef.value.onclick = () => {\r\n emit('click', newVal)\r\n }\r\n }, 0)\r\n },\r\n {\r\n immediate: true,\r\n }\r\n)\r\n</script>\r\n"],"names":["DO_defineComponent"],"mappings":";;;;;;AAUc,MAAA,cAAAA,eAAA,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,aAAa,GAAS,EAAA,CAAA;AAE5B,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,IAAA;AAAA,MACZ,CAAC,MAAmB,KAAA;AAClB,QAAA,IAAI,CAAC,MAAA;AAAQ,UAAA,OAAA;AACb,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,UAAA,CAAW,MAAM,SAAY,GAAA,EAAA,CAAA;AACnB,UAAA,SAAA,CAAA,UAAA,CAAW,OAAO,MAAQ,EAAA;AAAA,YAClC,MAAQ,EAAA,SAAA;AAAA,YACR,SAAW,EAAA,MAAA;AAAA,YACX,OAAO,KAAM,CAAA,YAAA;AAAA,YACb,QAAQ,KAAM,CAAA,aAAA;AAAA,YACd,YAAc,EAAA,KAAA;AAAA,WACf,CAAA,CAAA;AACU,UAAA,UAAA,CAAA,KAAA,CAAM,UAAU,MAAM;AAC/B,YAAA,IAAA,CAAK,SAAS,MAAM,CAAA,CAAA;AAAA,WACtB,CAAA;AAAA,WACC,CAAC,CAAA,CAAA;AAAA,OACN;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,OACb;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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;;;;"}
|