el-plus 0.0.51 → 0.0.53

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +107 -54
  4. package/dist/index.full.min.js +1 -1
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +1 -1
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +107 -55
  9. package/es/components/attachment/src/attachment.d.ts +4 -3
  10. package/es/components/attachment/src/attachment.mjs +1 -2
  11. package/es/components/attachment/src/attachment.mjs.map +1 -1
  12. package/es/components/attachment/src/attachment.vue2.mjs +2 -2
  13. package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
  14. package/es/components/attachment/src/use-attachment.mjs +2 -0
  15. package/es/components/attachment/src/use-attachment.mjs.map +1 -1
  16. package/es/components/header/index.d.ts +90 -0
  17. package/es/components/header/src/header.d.ts +9 -0
  18. package/es/components/header/src/header.mjs +10 -0
  19. package/es/components/header/src/header.mjs.map +1 -1
  20. package/es/components/header/src/header.vue.d.ts +38 -0
  21. package/es/components/header/src/header.vue2.mjs +4 -3
  22. package/es/components/header/src/header.vue2.mjs.map +1 -1
  23. package/es/hooks/dialog/use-confirm-dialog.d.ts +12 -0
  24. package/es/hooks/dialog/use-confirm-dialog.mjs +47 -0
  25. package/es/hooks/dialog/use-confirm-dialog.mjs.map +1 -0
  26. package/es/hooks/dialog/use-dialog.d.ts +2 -0
  27. package/es/hooks/dialog/use-dialog.mjs +28 -32
  28. package/es/hooks/dialog/use-dialog.mjs.map +1 -1
  29. package/es/hooks/dialog/use-form-dialog.d.ts +1 -0
  30. package/es/hooks/dialog/use-form-dialog.mjs +4 -3
  31. package/es/hooks/dialog/use-form-dialog.mjs.map +1 -1
  32. package/es/hooks/index.d.ts +1 -0
  33. package/es/hooks/index.mjs +1 -0
  34. package/es/hooks/index.mjs.map +1 -1
  35. package/es/index.mjs +1 -0
  36. package/es/index.mjs.map +1 -1
  37. package/es/package.json.mjs +1 -1
  38. package/lib/components/attachment/src/attachment.d.ts +4 -3
  39. package/lib/components/attachment/src/attachment.js +1 -2
  40. package/lib/components/attachment/src/attachment.js.map +1 -1
  41. package/lib/components/attachment/src/attachment.vue2.js +2 -2
  42. package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
  43. package/lib/components/attachment/src/use-attachment.js +2 -0
  44. package/lib/components/attachment/src/use-attachment.js.map +1 -1
  45. package/lib/components/header/index.d.ts +90 -0
  46. package/lib/components/header/src/header.d.ts +9 -0
  47. package/lib/components/header/src/header.js +10 -0
  48. package/lib/components/header/src/header.js.map +1 -1
  49. package/lib/components/header/src/header.vue.d.ts +38 -0
  50. package/lib/components/header/src/header.vue2.js +3 -2
  51. package/lib/components/header/src/header.vue2.js.map +1 -1
  52. package/lib/hooks/dialog/use-confirm-dialog.d.ts +12 -0
  53. package/lib/hooks/dialog/use-confirm-dialog.js +49 -0
  54. package/lib/hooks/dialog/use-confirm-dialog.js.map +1 -0
  55. package/lib/hooks/dialog/use-dialog.d.ts +2 -0
  56. package/lib/hooks/dialog/use-dialog.js +27 -31
  57. package/lib/hooks/dialog/use-dialog.js.map +1 -1
  58. package/lib/hooks/dialog/use-form-dialog.d.ts +1 -0
  59. package/lib/hooks/dialog/use-form-dialog.js +4 -3
  60. package/lib/hooks/dialog/use-form-dialog.js.map +1 -1
  61. package/lib/hooks/index.d.ts +1 -0
  62. package/lib/hooks/index.js +2 -0
  63. package/lib/hooks/index.js.map +1 -1
  64. package/lib/index.js +2 -0
  65. package/lib/index.js.map +1 -1
  66. package/lib/package.json.js +1 -1
  67. package/package.json +1 -1
  68. package/theme-chalk/dialog.css +1 -1
  69. package/theme-chalk/index.css +1 -1
  70. package/theme-chalk/src/dialog.scss +7 -0
@@ -33,6 +33,14 @@ export declare const EpHeader: {
33
33
  readonly type: BooleanConstructor;
34
34
  readonly default: false;
35
35
  };
36
+ readonly fileList: {
37
+ readonly type: import("vue").PropType<Record<string, any>[]>;
38
+ readonly default: () => never[];
39
+ };
40
+ readonly attachmentProps: {
41
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
42
+ readonly default: () => void;
43
+ };
36
44
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
37
45
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
38
46
  name: string;
@@ -50,6 +58,28 @@ export declare const EpHeader: {
50
58
  readonly allowBack: boolean;
51
59
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
52
60
  readonly isShowAttachmentButton: boolean;
61
+ readonly fileList: Record<string, any>[];
62
+ readonly attachmentProps: {
63
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
64
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
65
+ [key: string]: any;
66
+ required: boolean | (() => boolean);
67
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
68
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
69
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
70
+ type: string;
71
+ props: Record<string, any>;
72
+ filter: boolean;
73
+ editable: boolean | ((formData: Record<string, any>) => void);
74
+ } & {} & {
75
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
76
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
77
+ }>[] | undefined;
78
+ readonly openType?: "dialog" | "normal" | undefined;
79
+ readonly isType?: boolean | undefined;
80
+ readonly isNote?: boolean | undefined;
81
+ readonly isShowOpenDialogButton?: boolean | undefined;
82
+ };
53
83
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
54
84
  P: {};
55
85
  B: {};
@@ -91,6 +121,14 @@ export declare const EpHeader: {
91
121
  readonly type: BooleanConstructor;
92
122
  readonly default: false;
93
123
  };
124
+ readonly fileList: {
125
+ readonly type: import("vue").PropType<Record<string, any>[]>;
126
+ readonly default: () => never[];
127
+ };
128
+ readonly attachmentProps: {
129
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
130
+ readonly default: () => void;
131
+ };
94
132
  }>> & Readonly<{}>, {}, {}, {}, {}, {
95
133
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
96
134
  name: string;
@@ -108,6 +146,28 @@ export declare const EpHeader: {
108
146
  readonly allowBack: boolean;
109
147
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
110
148
  readonly isShowAttachmentButton: boolean;
149
+ readonly fileList: Record<string, any>[];
150
+ readonly attachmentProps: {
151
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
152
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
153
+ [key: string]: any;
154
+ required: boolean | (() => boolean);
155
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
156
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
157
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
158
+ type: string;
159
+ props: Record<string, any>;
160
+ filter: boolean;
161
+ editable: boolean | ((formData: Record<string, any>) => void);
162
+ } & {} & {
163
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
164
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
165
+ }>[] | undefined;
166
+ readonly openType?: "dialog" | "normal" | undefined;
167
+ readonly isType?: boolean | undefined;
168
+ readonly isNote?: boolean | undefined;
169
+ readonly isShowOpenDialogButton?: boolean | undefined;
170
+ };
111
171
  }>;
112
172
  __isFragment?: never;
113
173
  __isTeleport?: never;
@@ -134,6 +194,14 @@ export declare const EpHeader: {
134
194
  readonly type: BooleanConstructor;
135
195
  readonly default: false;
136
196
  };
197
+ readonly fileList: {
198
+ readonly type: import("vue").PropType<Record<string, any>[]>;
199
+ readonly default: () => never[];
200
+ };
201
+ readonly attachmentProps: {
202
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
203
+ readonly default: () => void;
204
+ };
137
205
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
138
206
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
139
207
  name: string;
@@ -151,6 +219,28 @@ export declare const EpHeader: {
151
219
  readonly allowBack: boolean;
152
220
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
153
221
  readonly isShowAttachmentButton: boolean;
222
+ readonly fileList: Record<string, any>[];
223
+ readonly attachmentProps: {
224
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
225
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
226
+ [key: string]: any;
227
+ required: boolean | (() => boolean);
228
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
229
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
230
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
231
+ type: string;
232
+ props: Record<string, any>;
233
+ filter: boolean;
234
+ editable: boolean | ((formData: Record<string, any>) => void);
235
+ } & {} & {
236
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
237
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
238
+ }>[] | undefined;
239
+ readonly openType?: "dialog" | "normal" | undefined;
240
+ readonly isType?: boolean | undefined;
241
+ readonly isNote?: boolean | undefined;
242
+ readonly isShowOpenDialogButton?: boolean | undefined;
243
+ };
154
244
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
155
245
  export default EpHeader;
156
246
  export * from './src/header';
@@ -1,4 +1,5 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
+ import type { AttachmentProps } from 'el-plus/es/components/attachment';
2
3
  import type { PageMode } from 'el-plus/es/hooks/use-navigation';
3
4
  export type defaultButtonsProps = 'modify' | 'save' | 'cancel' | 'refresh' | 'auditLog';
4
5
  export declare const headerProps: {
@@ -23,6 +24,14 @@ export declare const headerProps: {
23
24
  readonly type: BooleanConstructor;
24
25
  readonly default: false;
25
26
  };
27
+ readonly fileList: {
28
+ readonly type: PropType<Record<string, any>[]>;
29
+ readonly default: () => never[];
30
+ };
31
+ readonly attachmentProps: {
32
+ readonly type: PropType<AttachmentProps>;
33
+ readonly default: () => void;
34
+ };
26
35
  };
27
36
  export type HeaderProps = ExtractPropTypes<typeof headerProps>;
28
37
  export declare const headerEmits: {};
@@ -27,6 +27,16 @@ const headerProps = {
27
27
  isShowAttachmentButton: {
28
28
  type: Boolean,
29
29
  default: false
30
+ },
31
+ // 附件列表
32
+ fileList: {
33
+ type: Array,
34
+ default: () => []
35
+ },
36
+ attachmentProps: {
37
+ type: Object,
38
+ default: () => {
39
+ }
30
40
  }
31
41
  };
32
42
  const headerEmits = {};
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n // 是否显示附件按钮\n isShowAttachmentButton: {\n type: Boolean,\n default: false,\n },\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":["buttonsProps"],"mappings":";;;;AAUO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAGA,oBAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY,MAAA;AAAA;AAAA,EAEZ,sBAAA,EAAwB;AAAA,IACtB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb;AAGO,MAAM,cAAc;;;;;"}
1
+ {"version":3,"file":"header.js","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { AttachmentProps } from '@el-plus/components/attachment'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n // 是否显示附件按钮\n isShowAttachmentButton: {\n type: Boolean,\n default: false,\n },\n // 附件列表\n fileList: {\n type: Array as PropType<Record<string, any>[]>,\n default: () => [],\n },\n attachmentProps: {\n type: Object as PropType<AttachmentProps>,\n default: () => {},\n },\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":["buttonsProps"],"mappings":";;;;AAWO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAGA,oBAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY,MAAA;AAAA;AAAA,EAEZ,sBAAA,EAAwB;AAAA,IACtB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,MAAA;AAAA,IACN,SAAS,MAAM;AAAA,IAAC;AAAA;AAEpB;AAGO,MAAM,cAAc;;;;;"}
@@ -20,6 +20,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
20
20
  readonly type: BooleanConstructor;
21
21
  readonly default: false;
22
22
  };
23
+ readonly fileList: {
24
+ readonly type: import("vue").PropType<Record<string, any>[]>;
25
+ readonly default: () => never[];
26
+ };
27
+ readonly attachmentProps: {
28
+ readonly type: import("vue").PropType<import("el-plus/es/components/attachment").AttachmentProps>;
29
+ readonly default: () => void;
30
+ };
23
31
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
32
  readonly mode: {
25
33
  readonly type: import("vue").PropType<import("el-plus/es/hooks").PageMode>;
@@ -42,6 +50,14 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
42
50
  readonly type: BooleanConstructor;
43
51
  readonly default: false;
44
52
  };
53
+ readonly fileList: {
54
+ readonly type: import("vue").PropType<Record<string, any>[]>;
55
+ readonly default: () => never[];
56
+ };
57
+ readonly attachmentProps: {
58
+ readonly type: import("vue").PropType<import("el-plus/es/components/attachment").AttachmentProps>;
59
+ readonly default: () => void;
60
+ };
45
61
  }>> & Readonly<{}>, {
46
62
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
47
63
  name: string;
@@ -59,6 +75,28 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
75
  readonly allowBack: boolean;
60
76
  readonly defaultButtons: import("./header").defaultButtonsProps[];
61
77
  readonly isShowAttachmentButton: boolean;
78
+ readonly fileList: Record<string, any>[];
79
+ readonly attachmentProps: {
80
+ readonly mode?: import("el-plus/es/hooks").PageMode | undefined;
81
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
82
+ [key: string]: any;
83
+ required: boolean | (() => boolean);
84
+ cellRequired: (scope: import("el-plus/es").TableScope) => boolean;
85
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
86
+ disabled: boolean | ((scope: import("el-plus/es").TableScope) => boolean);
87
+ type: string;
88
+ props: Record<string, any>;
89
+ filter: boolean;
90
+ editable: boolean | ((formData: Record<string, any>) => void);
91
+ } & {} & {
92
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
93
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
94
+ }>[] | undefined;
95
+ readonly openType?: "dialog" | "normal" | undefined;
96
+ readonly isType?: boolean | undefined;
97
+ readonly isNote?: boolean | undefined;
98
+ readonly isShowOpenDialogButton?: boolean | undefined;
99
+ };
62
100
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
101
  declare const _default: typeof __VLS_export;
64
102
  export default _default;
@@ -39,10 +39,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
39
39
  _: 1
40
40
  }, 8, ["onBack"])) : vue.createCommentVNode("", true),
41
41
  vue.createVNode(vue.unref(index.EpButtons), { list: vue.unref(buttons) }, null, 8, ["list"]),
42
- props$1.isShowAttachmentButton ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.EpAttachment), {
42
+ props$1.isShowAttachmentButton ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.EpAttachment), vue.mergeProps({
43
43
  key: 1,
44
+ "model-value": props$1.fileList,
44
45
  "is-show-open-dialog-button": ""
45
- })) : vue.createCommentVNode("", true)
46
+ }, props$1.attachmentProps), null, 16, ["model-value"])) : vue.createCommentVNode("", true)
46
47
  ], 6);
47
48
  };
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"header.vue2.js","sources":["../../../../../../packages/components/header/src/header.vue"],"sourcesContent":["<template>\n <div\n :class=\"[bem.b(), prepareClassNames()]\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-page-header v-if=\"isShowBack\" @back=\"goBack\">\n <template #content> </template>\n </el-page-header>\n <EpButtons :list=\"buttons\" />\n <EpAttachment\n v-if=\"props.isShowAttachmentButton\"\n is-show-open-dialog-button\n />\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { headerProps, headerEmits } from './header'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { useHeader, useButtons } from './use-header'\nimport { ElPageHeader } from 'element-plus'\nimport EpButtons from '@el-plus/components/buttons'\nimport EpAttachment from '@el-plus/components/attachment'\ndefineOptions({\n name: 'EpHeader',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('header')\nconst props = defineProps(headerProps)\nconst emit = defineEmits(headerEmits)\nconst { isShowBack, goBack } = useHeader(props, emit)\nconst { buttons } = useButtons(props, emit)\n</script>\n"],"names":["bem","createNameSpace","props","useHeader","useButtons","_createElementBlock","_normalizeClass","_unref","prepareClassNames","_normalizeStyle","prepareStyles","_createBlock","ElPageHeader","_createVNode","EpButtons","EpAttachment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAA,MAAMA,KAAA,GAAMC,oBAAgB,QAAQ,CAAA;AACpC,IAAA,MAAMC,OAAA,GAAQ,OAAA;AAEd,IAAA,MAAM,EAAE,UAAA,EAAY,MAAA,EAAO,GAAIC,mBAAA,CAAUD,OAAW,CAAA;AACpD,IAAA,MAAM,EAAE,OAAA,EAAQ,GAAIE,oBAAA,CAAWF,OAAW,CAAA;;8BAhCxCG,sBAAA,CAcM,KAAA,EAAA;AAAA,QAbH,KAAA,EAAKC,kBAAA,CAAA,CAAGC,SAAA,CAAAP,KAAA,CAAA,CAAI,CAAA,IAAKO,SAAA,CAAAC,uBAAA,CAAA,EAAiB,CAAA,CAAA;AAAA,QAClC,OAAKC,kBAAA,CAAA;AAAA,aAAaF,SAAA,CAAAG,mBAAA,CAAA;AAAa;;QAIVH,SAAA,CAAA,UAAA,CAAA,qBAAtBI,eAAA,CAEiBJ,SAAA,CAAAK,wBAAA,CAAA,EAAA;AAAA;UAFkB,MAAA,EAAML,UAAA,MAAA;AAAA;UAC5B,OAAA,cAAX,MAA+B,EAAA,CAAA;AAAA;;QAEjCM,eAAA,CAA6BN,SAAA,CAAAO,eAAA,CAAA,EAAA,EAAjB,IAAA,EAAMP,SAAA,CAAA,OAAA,CAAA,EAAO,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,CAAA,CAAA;AAAA,QAEjBL,QAAM,sBAAA,qBADdS,eAAA,CAGEJ,SAAA,CAAAQ,oBAAA,CAAA,EAAA;AAAA;UADA,4BAAA,EAAA;AAAA;;;;;;;;"}
1
+ {"version":3,"file":"header.vue2.js","sources":["../../../../../../packages/components/header/src/header.vue"],"sourcesContent":["<template>\n <div\n :class=\"[bem.b(), prepareClassNames()]\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-page-header v-if=\"isShowBack\" @back=\"goBack\">\n <template #content> </template>\n </el-page-header>\n <EpButtons :list=\"buttons\" />\n <EpAttachment\n v-if=\"props.isShowAttachmentButton\"\n :model-value=\"props.fileList\"\n is-show-open-dialog-button\n v-bind=\"props.attachmentProps\"\n />\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { headerProps, headerEmits } from './header'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { useHeader, useButtons } from './use-header'\nimport { ElPageHeader } from 'element-plus'\nimport EpButtons from '@el-plus/components/buttons'\nimport EpAttachment from '@el-plus/components/attachment'\ndefineOptions({\n name: 'EpHeader',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('header')\nconst props = defineProps(headerProps)\nconst emit = defineEmits(headerEmits)\nconst { isShowBack, goBack } = useHeader(props, emit)\nconst { buttons } = useButtons(props, emit)\n</script>\n"],"names":["bem","createNameSpace","props","useHeader","useButtons","_createElementBlock","_normalizeClass","_unref","prepareClassNames","_normalizeStyle","prepareStyles","_createBlock","ElPageHeader","_createVNode","EpButtons","_openBlock","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAMA,KAAA,GAAMC,oBAAgB,QAAQ,CAAA;AACpC,IAAA,MAAMC,OAAA,GAAQ,OAAA;AAEd,IAAA,MAAM,EAAE,UAAA,EAAY,MAAA,EAAO,GAAIC,mBAAA,CAAUD,OAAW,CAAA;AACpD,IAAA,MAAM,EAAE,OAAA,EAAQ,GAAIE,oBAAA,CAAWF,OAAW,CAAA;;8BAlCxCG,sBAAA,CAgBM,KAAA,EAAA;AAAA,QAfH,KAAA,EAAKC,kBAAA,CAAA,CAAGC,SAAA,CAAAP,KAAA,CAAA,CAAI,CAAA,IAAKO,SAAA,CAAAC,uBAAA,CAAA,EAAiB,CAAA,CAAA;AAAA,QAClC,OAAKC,kBAAA,CAAA;AAAA,aAAaF,SAAA,CAAAG,mBAAA,CAAA;AAAa;;QAIVH,SAAA,CAAA,UAAA,CAAA,qBAAtBI,eAAA,CAEiBJ,SAAA,CAAAK,wBAAA,CAAA,EAAA;AAAA;UAFkB,MAAA,EAAML,UAAA,MAAA;AAAA;UAC5B,OAAA,cAAX,MAA+B,EAAA,CAAA;AAAA;;QAEjCM,eAAA,CAA6BN,SAAA,CAAAO,eAAA,CAAA,EAAA,EAAjB,IAAA,EAAMP,SAAA,CAAA,OAAA,CAAA,EAAO,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,CAAA,CAAA;AAAA,QAEjBL,OAAA,CAAM,0BADda,aAAA,EAAA,EAAAJ,gBAKEJ,SAAA,wBALFS,cAAA,CAKE;AAAA;UAHC,eAAad,OAAA,CAAM,QAAA;AAAA,UACpB,4BAAA,EAAA;AAAA,SACQ,EAAAA,OAAA,CAAM,eAAe,CAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA,aAAA,CAAA,CAAA;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ import type { DialogOptions } from './use-dialog';
2
+ import type { FormItemProps } from 'el-plus/es/components/form';
3
+ import type { InputProps } from 'element-plus';
4
+ type Options = Partial<{
5
+ title?: string;
6
+ width?: string;
7
+ dialogProps?: DialogOptions;
8
+ } & TextareaProps & TextareaFormItemProps>;
9
+ type TextareaProps = Pick<InputProps, 'rows' | 'maxlength' | 'minlength' | 'showWordLimit' | 'placeholder'>;
10
+ type TextareaFormItemProps = Pick<FormItemProps, 'rules' | 'required'>;
11
+ export declare const useConfirmDialog: (options?: Options) => import("el-plus/es").TemplatePromise<any, []>;
12
+ export {};
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var useFormDialog = require('./use-form-dialog.js');
4
+ var bem$1 = require('../../utils/bem.js');
5
+
6
+ const bem = bem$1.createNameSpace("confirm-dialog");
7
+ const useConfirmDialog = (options = {}) => {
8
+ const {
9
+ dialogProps = {},
10
+ width = "50%",
11
+ title,
12
+ /** TextareaProps */
13
+ rows = 5,
14
+ maxlength = 500,
15
+ minlength,
16
+ showWordLimit = true,
17
+ /** TextareaFormItemProps */
18
+ rules,
19
+ required = true,
20
+ placeholder
21
+ } = options;
22
+ const formItemList = [{
23
+ rules,
24
+ prop: "value",
25
+ label: " ",
26
+ required,
27
+ props: {
28
+ placeholder,
29
+ type: "textarea",
30
+ rows,
31
+ maxlength,
32
+ minlength,
33
+ showWordLimit
34
+ }
35
+ }];
36
+ return useFormDialog.useFormDialog({
37
+ title,
38
+ width,
39
+ formItemList,
40
+ dialogProps: {
41
+ ...dialogProps,
42
+ class: bem.b(),
43
+ destroyOnClose: true
44
+ }
45
+ });
46
+ };
47
+
48
+ exports.useConfirmDialog = useConfirmDialog;
49
+ //# sourceMappingURL=use-confirm-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-confirm-dialog.js","sources":["../../../../../packages/hooks/dialog/use-confirm-dialog.tsx"],"sourcesContent":["import { useFormDialog } from './use-form-dialog'\nimport type { DialogOptions } from './use-dialog'\nimport type { FormItemProps } from '@el-plus/components/form'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport type { InputProps } from 'element-plus'\nconst bem = createNameSpace('confirm-dialog')\ntype Options = Partial<\n {\n title?: string\n width?: string\n dialogProps?: DialogOptions\n } & TextareaProps &\n TextareaFormItemProps\n>\ntype TextareaProps = Pick<\n InputProps,\n 'rows' | 'maxlength' | 'minlength' | 'showWordLimit' | 'placeholder'\n>\ntype TextareaFormItemProps = Pick<FormItemProps, 'rules' | 'required'>\nexport const useConfirmDialog = (options: Options = {}) => {\n const {\n dialogProps = {},\n width = '50%',\n title,\n /** TextareaProps */\n rows = 5,\n maxlength = 500,\n minlength,\n showWordLimit = true,\n /** TextareaFormItemProps */\n rules,\n required = true,\n placeholder,\n } = options\n const formItemList: FormItemProps[] = [\n {\n rules,\n prop: 'value',\n label: ' ',\n required,\n props: {\n placeholder,\n type: 'textarea',\n rows,\n maxlength,\n minlength,\n showWordLimit,\n },\n },\n ]\n return useFormDialog({\n title,\n width,\n formItemList,\n dialogProps: {\n ...dialogProps,\n class: bem.b(),\n destroyOnClose: true,\n },\n })\n}\n"],"names":["bem","createNameSpace","useConfirmDialog","options","dialogProps","width","title","rows","maxlength","minlength","showWordLimit","rules","required","placeholder","formItemList","prop","label","props","type","useFormDialog","class","b","destroyOnClose"],"mappings":";;;;;AAKA,MAAMA,GAAAA,GAAMC,sBAAgB,gBAAgB,CAAA;AAcrC,MAAMC,gBAAAA,GAAmBA,CAACC,OAAAA,GAAmB,EAAC,KAAM;AACzD,EAAA,MAAM;AAAA,IACJC,cAAc,EAAC;AAAA,IACfC,KAAAA,GAAQ,KAAA;AAAA,IACRC,KAAAA;AAAAA;AAAAA,IAEAC,IAAAA,GAAO,CAAA;AAAA,IACPC,SAAAA,GAAY,GAAA;AAAA,IACZC,SAAAA;AAAAA,IACAC,aAAAA,GAAgB,IAAA;AAAA;AAAA,IAEhBC,KAAAA;AAAAA,IACAC,QAAAA,GAAW,IAAA;AAAA,IACXC;AAAAA,GACF,GAAIV,OAAAA;AACJ,EAAA,MAAMW,eAAgC,CACpC;AAAA,IACEH,KAAAA;AAAAA,IACAI,IAAAA,EAAM,OAAA;AAAA,IACNC,KAAAA,EAAO,GAAA;AAAA,IACPJ,QAAAA;AAAAA,IACAK,KAAAA,EAAO;AAAA,MACLJ,WAAAA;AAAAA,MACAK,IAAAA,EAAM,UAAA;AAAA,MACNX,IAAAA;AAAAA,MACAC,SAAAA;AAAAA,MACAC,SAAAA;AAAAA,MACAC;AAAAA;AACF,GACD,CAAA;AAEH,EAAA,OAAOS,2BAAAA,CAAc;AAAA,IACnBb,KAAAA;AAAAA,IACAD,KAAAA;AAAAA,IACAS,YAAAA;AAAAA,IACAV,WAAAA,EAAa;AAAA,MACX,GAAGA,WAAAA;AAAAA,MACHgB,KAAAA,EAAOpB,IAAIqB,CAAAA,EAAE;AAAA,MACbC,cAAAA,EAAgB;AAAA;AAClB,GACD,CAAA;AACH;;;;"}
@@ -7,7 +7,9 @@ export type DialogOptions = Partial<DialogProps & {
7
7
  scopedSlots: Record<string, (props: any) => VNode>;
8
8
  class: string;
9
9
  onCancel: (reject: any) => void;
10
+ cancelText?: string;
10
11
  onConfirm: (resolve: any) => void;
12
+ confirmText?: string;
11
13
  showFooter: boolean;
12
14
  }>;
13
15
  export type ExpandDialogOptions = {
@@ -7,9 +7,6 @@ var bem$1 = require('../../utils/bem.js');
7
7
  var props = require('../../utils/props.js');
8
8
  var useLocale = require('../use-locale.js');
9
9
 
10
- function _isSlot(s) {
11
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
12
- }
13
10
  const bem = bem$1.createNameSpace("dialog");
14
11
  const useDialog = (options = {}) => {
15
12
  const {
@@ -21,7 +18,9 @@ const useDialog = (options = {}) => {
21
18
  render,
22
19
  destroyOnClose,
23
20
  onConfirm,
21
+ confirmText,
24
22
  onCancel,
23
+ cancelText,
25
24
  showFooter = true,
26
25
  ...dialogProps
27
26
  } = options;
@@ -41,35 +40,32 @@ const useDialog = (options = {}) => {
41
40
  };
42
41
  const slots = {};
43
42
  if (showFooter) {
44
- slots.footer = () => {
45
- let _slot, _slot2;
46
- return vue.createVNode("div", {
47
- "class": bem.e("footer")
48
- }, [scopedSlots.footerPrepend?.(promiseOptions), vue.createVNode(elementPlus.ElButton, {
49
- "size": "default",
50
- "onClick": () => {
51
- if (onCancel) {
52
- onCancel(reject);
53
- } else {
54
- reject("cancel");
55
- }
43
+ slots.footer = () => vue.createVNode("div", {
44
+ "class": bem.e("footer")
45
+ }, [scopedSlots.footerPrepend?.(promiseOptions), vue.createVNode(elementPlus.ElButton, {
46
+ "size": "default",
47
+ "onClick": () => {
48
+ if (onCancel) {
49
+ onCancel(reject);
50
+ } else {
51
+ reject("cancel");
56
52
  }
57
- }, _isSlot(_slot = t("ep.dialog.cancel")) ? _slot : {
58
- default: () => [_slot]
59
- }), scopedSlots.footerInner?.(promiseOptions), vue.createVNode(elementPlus.ElButton, {
60
- "type": "primary",
61
- "onClick": async () => {
62
- if (onConfirm) {
63
- onConfirm(resolve);
64
- } else {
65
- resolve("confirm");
66
- }
67
- },
68
- "loading": isResolving
69
- }, _isSlot(_slot2 = t("ep.dialog.confirm")) ? _slot2 : {
70
- default: () => [_slot2]
71
- }), scopedSlots.footerAppend?.(promiseOptions)]);
72
- };
53
+ }
54
+ }, {
55
+ default: () => [cancelText || t("ep.dialog.cancel")]
56
+ }), scopedSlots.footerInner?.(promiseOptions), vue.createVNode(elementPlus.ElButton, {
57
+ "type": "primary",
58
+ "onClick": async () => {
59
+ if (onConfirm) {
60
+ onConfirm(resolve);
61
+ } else {
62
+ resolve("confirm");
63
+ }
64
+ },
65
+ "loading": isResolving
66
+ }, {
67
+ default: () => [confirmText || t("ep.dialog.confirm")]
68
+ }), scopedSlots.footerAppend?.(promiseOptions)]);
73
69
  }
74
70
  return vue.createVNode(elementPlus.ElDialog, vue.mergeProps({
75
71
  "class": bem.b(),
@@ -1 +1 @@
1
- {"version":3,"file":"use-dialog.js","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n onCancel: (reject) => void\n onConfirm: (resolve) => void\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n onCancel,\n showFooter = true,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={() => {\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","onCancel","showFooter","dialogProps","Dialog","useTemplatePromise","destroy","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_slot","_slot2","_createVNode","e","footerPrepend","ElButton","onClick","footerInner","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;;;AAayC,SAAAA,QAAAC,CAAAA,EAAA;AAAA,EAAA,OAAA,OAAAA,CAAAA,KAAA,UAAA,IAAAC,MAAAA,CAAAC,SAAAA,CAAAC,QAAAA,CAAAC,IAAAA,CAAAJ,CAAA,CAAA,KAAA,iBAAA,IAAA,CAAAK,WAAAA,CAAAL,CAAA,CAAA;AAAA;AAiBzC,MAAMM,GAAAA,GAAMC,sBAAgB,QAAQ,CAAA;AAE7B,MAAMC,SAAAA,GAAYA,CAACC,OAAAA,GAAyB,EAAC,KAAM;AACxD,EAAA,MAAM;AAAA,IAAEC;AAAAA,MAAMC,mBAAAA,EAAU;AACxB,EAAA,MAAM;AAAA,IACJC,cAAc,EAAC;AAAA,IACfC,QAAAA;AAAAA,IACAC,MAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,UAAAA,GAAa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,QACH,GAAGnB;AAAAA,OAAW,CAAA;AAAA,IAMtB;AAAA,GACD,CAAA;AACD,EAAA,IAAIE,MAAAA,EAAQ;AAIV,IAAA,MAAMsC,SAAAA,GAAYC,QAAAA,CAASC,aAAAA,CAAc,KAAK,CAAA;AAE9C,IAAA,MAAMC,WAAAA,GAAc1C,YAAY2C,sBAAAA,EAAmB;AACnD,IAAA,MAAMC,MAAAA,GAASC,WAAOC,oCAAwB,CAAA;AAK9C,IAAA,MAAMC,KAAAA,GAAQC,MACZC,4BAAAA,EACA;AAAA,MAAEC,QAAQN,MAAAA,EAAQM;AAAAA,KAAO,EACzB;AAAA,MAAE/B,OAAAA,EAASA,MAAM6B,KAAAA,CAAEzC,MAAM;AAAA,KAC3B,CAAA;AACA,IAAA,IAAImC,WAAAA,IAAeA,YAAYS,UAAAA,EAAY;AAEzCJ,MAAAA,KAAAA,CAAMI,aAAaT,WAAAA,CAAYS,UAAAA;AAAAA,IACjC;AACAC,IAAAA,YAAAA,CAAS,MAAM;AACbC,MAAAA,UAAAA,CAAQN,OAAOR,SAAS,CAAA;AACxBC,MAAAA,QAAAA,CAASc,IAAAA,CAAKC,YAAYhB,SAAS,CAAA;AAAA,IACrC,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAOhC,MAAAA;AACT;;;;"}
1
+ {"version":3,"file":"use-dialog.js","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n onCancel: (reject) => void\n cancelText?: string\n onConfirm: (resolve) => void\n confirmText?: string\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n confirmText,\n onCancel,\n cancelText,\n showFooter = true,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={() => {\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {cancelText || t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {confirmText || t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","confirmText","onCancel","cancelText","showFooter","dialogProps","Dialog","useTemplatePromise","destroy","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_createVNode","e","footerPrepend","ElButton","onClick","footerInner","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;;;AAgCA,MAAMA,GAAAA,GAAMC,sBAAgB,QAAQ,CAAA;AAE7B,MAAMC,SAAAA,GAAYA,CAACC,OAAAA,GAAyB,EAAC,KAAM;AACxD,EAAA,MAAM;AAAA,IAAEC;AAAAA,MAAMC,mBAAAA,EAAU;AACxB,EAAA,MAAM;AAAA,IACJC,cAAc,EAAC;AAAA,IACfC,QAAAA;AAAAA,IACAC,MAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,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AAAA,CAAc,KAAK,CAAA;AAE9C,IAAA,MAAMC,WAAAA,GAAc1C,YAAY2C,sBAAAA,EAAmB;AACnD,IAAA,MAAMC,MAAAA,GAASC,WAAOC,oCAAwB,CAAA;AAK9C,IAAA,MAAMC,KAAAA,GAAQC,MACZC,4BAAAA,EACA;AAAA,MAAEC,QAAQN,MAAAA,EAAQM;AAAAA,KAAO,EACzB;AAAA,MAAE7B,OAAAA,EAASA,MAAM2B,KAAAA,CAAEvC,MAAM;AAAA,KAC3B,CAAA;AACA,IAAA,IAAIiC,WAAAA,IAAeA,YAAYS,UAAAA,EAAY;AAEzCJ,MAAAA,KAAAA,CAAMI,aAAaT,WAAAA,CAAYS,UAAAA;AAAAA,IACjC;AACAC,IAAAA,YAAAA,CAAS,MAAM;AACbC,MAAAA,UAAAA,CAAQN,OAAOR,SAAS,CAAA;AACxBC,MAAAA,QAAAA,CAASc,IAAAA,CAAKC,YAAYhB,SAAS,CAAA;AAAA,IACrC,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO9B,MAAAA;AACT;;;;"}
@@ -2,6 +2,7 @@ import type { DialogOptions } from './use-dialog';
2
2
  import type { FormProps } from 'el-plus/es/components/form';
3
3
  type Options = {
4
4
  title?: string;
5
+ width?: string;
5
6
  dialogProps?: DialogOptions;
6
7
  formData?: FormProps['model'];
7
8
  } & FormProps;
@@ -10,6 +10,7 @@ const useFormDialog = (options = {}) => {
10
10
  const {
11
11
  dialogProps,
12
12
  title,
13
+ width = "80%",
13
14
  ...formProps
14
15
  } = options;
15
16
  const formRef = vue.ref();
@@ -23,9 +24,9 @@ const useFormDialog = (options = {}) => {
23
24
  };
24
25
  return useDialog.useDialog({
25
26
  class: bem.b(),
26
- width: "80%",
27
+ width,
27
28
  title,
28
- render: (props) => {
29
+ render: () => {
29
30
  return vue.createVNode(index.EpForm, vue.mergeProps({
30
31
  "ref": formRef,
31
32
  "modelValue": formData,
@@ -38,7 +39,7 @@ const useFormDialog = (options = {}) => {
38
39
  },
39
40
  onConfirm: async (resolve) => {
40
41
  await formRef.value.validate();
41
- resolve(JSON.parse(JSON.stringify(formData)));
42
+ resolve(isUseComFormData ? JSON.parse(JSON.stringify(formData)) : formData);
42
43
  resetForm();
43
44
  },
44
45
  onCancel: async (resolve) => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-dialog.js","sources":["../../../../../packages/hooks/dialog/use-form-dialog.tsx"],"sourcesContent":["import type { DialogOptions } from './use-dialog'\nimport type { FormProps } from '@el-plus/components/form'\nimport EpForm from '@el-plus/components/form'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { useDialog } from './use-dialog'\nimport { reactive, ref, toRaw } from 'vue'\nconst bem = createNameSpace('form-dialog')\n\ntype Options = {\n title?: string\n dialogProps?: DialogOptions\n formData?: FormProps['model']\n} & FormProps\nexport const useFormDialog = (options: Options = {}) => {\n const { dialogProps, title, ...formProps } = options\n const formRef = ref()\n const isUseComFormData = !formProps.formData\n let formData = isUseComFormData ? reactive({}) : formProps.formData // eslint-disable-line\n const isDestroy = dialogProps?.destroyOnClose\n const resetForm = async () => {\n if (isDestroy) {\n await formRef.value?.resetFields()\n }\n }\n return useDialog({\n class: bem.b(),\n width: '80%',\n title,\n render: (props) => {\n return (\n <EpForm\n ref={formRef}\n v-model={formData}\n {...{\n col: 1,\n 'label-width': 'auto',\n ...formProps,\n }}\n />\n )\n },\n onConfirm: async (resolve) => {\n await formRef.value.validate()\n resolve(JSON.parse(JSON.stringify(formData)))\n resetForm()\n },\n onCancel: async (resolve) => {\n await resetForm()\n resolve('cancel')\n },\n ...dialogProps,\n })\n}\n"],"names":["bem","createNameSpace","useFormDialog","options","dialogProps","title","formProps","formRef","ref","isUseComFormData","formData","reactive","isDestroy","destroyOnClose","resetForm","value","resetFields","useDialog","class","b","width","render","props","_createVNode","EpForm","_mergeProps","$event","col","onConfirm","resolve","validate","JSON","parse","stringify","onCancel"],"mappings":";;;;;;;AAMA,MAAMA,GAAAA,GAAMC,sBAAgB,a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AAKE,SAAAA,CAAUvB,QAAQ,CAAC,CAAC,CAAA;AAC5CI,MAAAA,SAAAA,EAAU;AAAA,IACZ,CAAA;AAAA,IACAoB,QAAAA,EAAU,OAAOL,OAAAA,KAAY;AAC3B,MAAA,MAAMf,SAAAA,EAAU;AAChBe,MAAAA,OAAAA,CAAQ,QAAQ,CAAA;AAAA,IAClB,CAAA;AAAA,IACA,GAAGzB;AAAAA,GACJ,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-form-dialog.js","sources":["../../../../../packages/hooks/dialog/use-form-dialog.tsx"],"sourcesContent":["import type { DialogOptions } from './use-dialog'\nimport type { FormProps } from '@el-plus/components/form'\nimport EpForm from '@el-plus/components/form'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { useDialog } from './use-dialog'\nimport { reactive, ref, toRaw } from 'vue'\nconst bem = createNameSpace('form-dialog')\n\ntype Options = {\n title?: string\n width?: string\n dialogProps?: DialogOptions\n formData?: FormProps['model']\n} & FormProps\nexport const useFormDialog = (options: Options = {}) => {\n const { dialogProps, title, width = '80%', ...formProps } = options\n const formRef = ref()\n const isUseComFormData = !formProps.formData\n let formData = isUseComFormData ? reactive({}) : formProps.formData // eslint-disable-line\n const isDestroy = dialogProps?.destroyOnClose\n const resetForm = async () => {\n if (isDestroy) {\n await formRef.value?.resetFields()\n }\n }\n return useDialog({\n class: bem.b(),\n width,\n title,\n render: () => {\n return (\n <EpForm\n ref={formRef}\n v-model={formData}\n {...{\n col: 1,\n 'label-width': 'auto',\n ...formProps,\n }}\n />\n )\n },\n onConfirm: async (resolve) => {\n await formRef.value.validate()\n resolve(\n isUseComFormData ? JSON.parse(JSON.stringify(formData)) : formData,\n )\n resetForm()\n },\n onCancel: async (resolve) => {\n await resetForm()\n resolve('cancel')\n },\n ...dialogProps,\n })\n}\n"],"names":["bem","createNameSpace","useFormDialog","options","dialogProps","title","width","formProps","formRef","ref","isUseComFormData","formData","reactive","isDestroy","destroyOnClose","resetForm","value","resetFields","useDialog","class","b","render","_createVNode","EpForm","_mergeProps","$event","col","onConfirm","resolve","validate","JSON","parse","stringify","onCancel"],"mappings":";;;;;;;AAMA,MAAMA,GAAAA,GAAMC,sBAAgB,aAAa,CAAA;AAQlC,MAAMC,aAAAA,GAAgBA,CAACC,OAAAA,GAAmB,EAAC,KAAM;AACtD,EAAA,MAAM;AAAA,IAAEC,WAAAA;AAAAA,IAAaC,KAAAA;AAAAA,IAAOC,KAAAA,GAAQ,KAAA;AAAA,IAAO,GAAGC;AAAAA,GAAU,GAAIJ,OAAAA;AAC5D,EAAA,MAAMK,UAAUC,OAAAA,EAAI;AACpB,EAAA,MAAMC,gBAAAA,GAAmB,CAACH,SAAAA,CAAUI,QAAAA;AACpC,EAAA,IAAIA,WAAWD,gBAAAA,GAAmBE,YAAAA,CAAS,EAAE,IAAIL,SAAAA,CAAUI,QAAAA;AAC3D,EAAA,MAAME,YAAYT,WAAAA,EAAaU,cAAAA;AAC/B,EAAA,MAAMC,YAAY,YAAY;AAC5B,IAAA,IAAIF,SAAAA,EAAW;AACb,MAAA,MAAML,OAAAA,CAAQQ,OAAOC,WAAAA,EAAY;AAAA,IACnC;AAAA,EACF,CAAA;AACA,EAAA,OAAOC,mBAAAA,CAAU;AAAA,IACfC,KAAAA,EAAOnB,IAAIoB,CAAAA,EAAE;AAAA,IACbd,KAAAA;AAAAA,IACAD,KAAAA;AAAAA,IACAgB,QAAQA,MAAM;AACZ,MAAA,OAAAC,eAAAA,CAAAC,cAAAC,cAAAA,CAAA;AAAA,QAAA,KAAA,EAEShB,OAAAA;AAAAA,QAAO,YAAA,EACHG,QAAAA;AAAAA,QAAQ,qBAAA,EAAAc,YAARd,QAAAA,GAAQc;AAAAA,OAAA,EAAA;AAAA,QAEfC,GAAAA,EAAK,CAAA;AAAA,QACL,aAAA,EAAe,MAAA;AAAA,QACf,GAAGnB;AAAAA,OAAS,GAAA,IAAA,CAAA;AAAA,IAIpB,CAAA;AAAA,IACAoB,SAAAA,EAAW,OAAOC,OAAAA,KAAY;AAC5B,MAAA,MAAMpB,OAAAA,CAAQQ,MAAMa,QAAAA,EAAS;AAC7BD,MAAAA,OAAAA,CACElB,gBAAAA,GAAmBoB,KAAKC,KAAAA,CAAMD,IAAAA,CAAKE,UAAUrB,QAAQ,CAAC,IAAIA,QAC5D,CAAA;AACAI,MAAAA,SAAAA,EAAU;AAAA,IACZ,CAAA;AAAA,IACAkB,QAAAA,EAAU,OAAOL,OAAAA,KAAY;AAC3B,MAAA,MAAMb,SAAAA,EAAU;AAChBa,MAAAA,OAAAA,CAAQ,QAAQ,CAAA;AAAA,IAClB,CAAA;AAAA,IACA,GAAGxB;AAAAA,GACJ,CAAA;AACH;;;;"}
@@ -5,3 +5,4 @@ export * from './dialog/use-choose-dialog';
5
5
  export * from './dialog/use-form-dialog';
6
6
  export * from './use-locale';
7
7
  export * from './use-navigation';
8
+ export * from './dialog/use-confirm-dialog';
@@ -7,6 +7,7 @@ var useChooseDialog = require('./dialog/use-choose-dialog.js');
7
7
  var useFormDialog = require('./dialog/use-form-dialog.js');
8
8
  var useLocale = require('./use-locale.js');
9
9
  var useNavigation = require('./use-navigation.js');
10
+ var useConfirmDialog = require('./dialog/use-confirm-dialog.js');
10
11
 
11
12
 
12
13
 
@@ -17,4 +18,5 @@ exports.useChooseDialog = useChooseDialog.useChooseDialog;
17
18
  exports.useFormDialog = useFormDialog.useFormDialog;
18
19
  exports.useLocale = useLocale.useLocale;
19
20
  exports.useNavigation = useNavigation.useNavigation;
21
+ exports.useConfirmDialog = useConfirmDialog.useConfirmDialog;
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
package/lib/index.js CHANGED
@@ -42,6 +42,7 @@ var useChooseDialog = require('./hooks/dialog/use-choose-dialog.js');
42
42
  var useFormDialog = require('./hooks/dialog/use-form-dialog.js');
43
43
  var useLocale = require('./hooks/use-locale.js');
44
44
  var useNavigation = require('./hooks/use-navigation.js');
45
+ var useConfirmDialog = require('./hooks/dialog/use-confirm-dialog.js');
45
46
 
46
47
  const INSTALLED_KEY = /* @__PURE__ */ Symbol("INSTALLED_KEY");
47
48
  const install = (app, options) => {
@@ -110,6 +111,7 @@ exports.useChooseDialog = useChooseDialog.useChooseDialog;
110
111
  exports.useFormDialog = useFormDialog.useFormDialog;
111
112
  exports.useLocale = useLocale.useLocale;
112
113
  exports.useNavigation = useNavigation.useNavigation;
114
+ exports.useConfirmDialog = useConfirmDialog.useConfirmDialog;
113
115
  exports.default = plugin;
114
116
  exports.install = install;
115
117
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../packages/el-plus/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport components from './components'\nimport { version } from './package.json'\nimport * as plugins from './plugins'\n// import type { RouteRecordRaw } from 'vue-router'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\nconst provideGlobalConfig = (config, app) => {}\nexport type EpOptions = {\n // routes?: RouteRecordRaw\n}\nexport const install = (app: App, options?: EpOptions) => {\n if (app[INSTALLED_KEY]) return // 防止多次use导致重复安装注册,控制台警告\n app[INSTALLED_KEY] = true\n components.forEach((c) => app.use(c))\n Object.values(plugins).forEach((p) => app.use(p))\n if (options) {\n provideGlobalConfig(options, app)\n }\n}\n\nconst plugin: Plugin & { version: string } = {\n install,\n version,\n}\nexport default plugin\nexport * from '@el-plus/components/index'\nexport * from '@el-plus/hooks'\nexport * from '@el-plus/directives'\n"],"names":["components","plugins","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,aAAA,0BAAuB,eAAe,CAAA;AAKrC,MAAM,OAAA,GAAU,CAAC,GAAA,EAAU,OAAA,KAAwB;AACxD,EAAA,IAAI,GAAA,CAAI,aAAa,CAAA,EAAG;AACxB,EAAA,GAAA,CAAI,aAAa,CAAA,GAAI,IAAA;AACrB,EAAAA,kBAAA,CAAW,QAAQ,CAAC,CAAA,KAAM,GAAA,CAAI,GAAA,CAAI,CAAC,CAAC,CAAA;AACpC,EAAA,MAAA,CAAO,MAAA,CAAOC,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA,KAAM,GAAA,CAAI,GAAA,CAAI,CAAC,CAAC,CAAA;AAIlD;AAEA,MAAM,MAAA,GAAuC;AAAA,EAC3C,OAAA;AAAA,WACAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../packages/el-plus/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport components from './components'\nimport { version } from './package.json'\nimport * as plugins from './plugins'\n// import type { RouteRecordRaw } from 'vue-router'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\nconst provideGlobalConfig = (config, app) => {}\nexport type EpOptions = {\n // routes?: RouteRecordRaw\n}\nexport const install = (app: App, options?: EpOptions) => {\n if (app[INSTALLED_KEY]) return // 防止多次use导致重复安装注册,控制台警告\n app[INSTALLED_KEY] = true\n components.forEach((c) => app.use(c))\n Object.values(plugins).forEach((p) => app.use(p))\n if (options) {\n provideGlobalConfig(options, app)\n }\n}\n\nconst plugin: Plugin & { version: string } = {\n install,\n version,\n}\nexport default plugin\nexport * from '@el-plus/components/index'\nexport * from '@el-plus/hooks'\nexport * from '@el-plus/directives'\n"],"names":["components","plugins","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,aAAA,0BAAuB,eAAe,CAAA;AAKrC,MAAM,OAAA,GAAU,CAAC,GAAA,EAAU,OAAA,KAAwB;AACxD,EAAA,IAAI,GAAA,CAAI,aAAa,CAAA,EAAG;AACxB,EAAA,GAAA,CAAI,aAAa,CAAA,GAAI,IAAA;AACrB,EAAAA,kBAAA,CAAW,QAAQ,CAAC,CAAA,KAAM,GAAA,CAAI,GAAA,CAAI,CAAC,CAAC,CAAA;AACpC,EAAA,MAAA,CAAO,MAAA,CAAOC,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA,KAAM,GAAA,CAAI,GAAA,CAAI,CAAC,CAAC,CAAA;AAIlD;AAEA,MAAM,MAAA,GAAuC;AAAA,EAC3C,OAAA;AAAA,WACAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.0.51";
3
+ var version = "0.0.53";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "el-plus",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "pro base on element-plus",
5
5
  "module": "./es/index.mjs",
6
6
  "keywords": [
@@ -1 +1 @@
1
- .ep-template-promise{position:relative;z-index:8888888888888888}.ep-dialog{padding:20px 25px 40px}.ep-dialog .el-dialog__headerbtn{height:56px}.ep-dialog .el-dialog__headerbtn .el-dialog__close{transform:scale(1.3)}.ep-dialog .el-dialog__header{text-align:center}.ep-dialog .el-dialog__header .el-dialog__title{color:#505050;font-size:16px;font-weight:600;line-height:24px;margin:4px}.ep-dialog .el-dialog__body{padding:25px 0 0}.ep-dialog__footer{padding:14px 0 0}.ep-dialog__footer button{font-size:12px}.ep-choose-dialog__selected-count{color:#409eff;float:left;font-size:16px;line-height:32px}
1
+ .ep-template-promise{position:relative;z-index:8888888888888888}.ep-dialog{padding:20px 25px 40px}.ep-dialog .el-dialog__headerbtn{height:56px}.ep-dialog .el-dialog__headerbtn .el-dialog__close{transform:scale(1.3)}.ep-dialog .el-dialog__header{text-align:center}.ep-dialog .el-dialog__header .el-dialog__title{color:#505050;font-size:16px;font-weight:600;line-height:24px;margin:4px}.ep-dialog .el-dialog__body{padding:25px 0 0}.ep-dialog__footer{padding:14px 0 0}.ep-dialog__footer button{font-size:12px}.ep-choose-dialog__selected-count{color:#409eff;float:left;font-size:16px;line-height:32px}.ep-confirm-dialog{padding-bottom:20px}.ep-confirm-dialog .ep-dialog__footer{padding-top:0}