hy-dispatch-ui-v3 0.1.0 → 0.1.2

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 (256) hide show
  1. package/dist/tailwind.css +186 -45
  2. package/es/bussiness/index.mjs +0 -1
  3. package/es/components/appButton/appButton.vue.mjs +133 -0
  4. package/es/components/appButton/index.mjs +6 -0
  5. package/es/components/appButton/style/appButton.scss +289 -0
  6. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +91 -0
  7. package/es/components/appConfigProvider/index.mjs +6 -0
  8. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +105 -60
  9. package/es/components/appConfirmDialog/appConfirmMethod.mjs +49 -27
  10. package/es/components/appConfirmDialog/index.mjs +0 -1
  11. package/es/components/appDatePicker/appDatePicker.vue.mjs +0 -1
  12. package/es/components/appDatePicker/index.mjs +0 -1
  13. package/es/components/appForm/appForm.vue.mjs +64 -67
  14. package/es/components/appForm/index.mjs +0 -1
  15. package/es/components/appForm/js/index.mjs +0 -1
  16. package/es/components/appForm/js/useAppForm.mjs +0 -1
  17. package/es/components/appForm/style/appForm.scss +1 -1
  18. package/es/components/{svgIcon/svgIcon.vue.mjs → appIcon/appIcon.vue.mjs} +4 -5
  19. package/es/components/appIcon/index.mjs +6 -0
  20. package/es/components/{svgIcon/style/svgIcon.scss → appIcon/style/appIcon.scss} +1 -4
  21. package/es/components/{svgIcon/iconBox.vue.mjs → appIconBox/appIconBox.vue.mjs} +6 -7
  22. package/es/components/appIconBox/index.mjs +6 -0
  23. package/es/components/appIconBox/style/appIconBox.scss +27 -0
  24. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +18 -11
  25. package/es/components/appOrgCascader/index.mjs +0 -1
  26. package/es/components/appSearch/appSearch.vue.mjs +2 -6
  27. package/es/components/appSearch/index.mjs +0 -1
  28. package/es/components/appSearch/js/index.mjs +5 -6
  29. package/es/components/appSearch/js/useAppSearch.mjs +0 -1
  30. package/es/components/appSearch/style/appSearch.scss +17 -11
  31. package/es/components/appTable/appTable.vue.mjs +57 -32
  32. package/es/components/appTable/cpns/columnSelect.vue.mjs +87 -123
  33. package/es/components/appTable/cpns/columnSelectItem.vue.mjs +5 -0
  34. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +167 -0
  35. package/es/components/appTable/index.mjs +0 -1
  36. package/es/components/appTable/js/index.mjs +9 -8
  37. package/es/components/appTable/js/search.mjs +6 -6
  38. package/es/components/appTable/js/useAppTable.mjs +6 -3
  39. package/es/components/appTable/style/appTable.scss +20 -11
  40. package/es/components/appTooltip/appTooltip.vue.mjs +0 -1
  41. package/es/components/appTooltip/index.mjs +0 -1
  42. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +136 -0
  43. package/es/components/appUserAvatar/index.mjs +6 -0
  44. package/es/components/appUserAvatar/style/appUserAvatar.scss +33 -0
  45. package/es/components/index.mjs +5 -2
  46. package/es/config/index.mjs +0 -1
  47. package/es/constants/index.mjs +0 -1
  48. package/es/constants/keys.mjs +0 -1
  49. package/es/hooks/index.mjs +4 -3
  50. package/es/hooks/useApi.mjs +20 -5
  51. package/es/hooks/useGlobalConfig.mjs +19 -10
  52. package/es/hooks/useLocale.mjs +1 -2
  53. package/es/hooks/useMixins.mjs +0 -1
  54. package/es/{store/maintain.mjs → hooks/useResizeHandler.mjs} +29 -44
  55. package/es/hooks/useUserAvatarMap.mjs +9 -0
  56. package/es/index.mjs +9 -6
  57. package/es/locale/{en_US.mjs → en.mjs} +8 -5
  58. package/es/locale/index.mjs +2 -3
  59. package/es/locale/zh_CN.mjs +6 -3
  60. package/es/make-installer.mjs +2 -8
  61. package/es/static/hy-svg-icons.mjs +11 -0
  62. package/es/style/element/element.scss +16313 -0
  63. package/es/style/element/index.scss +932 -0
  64. package/es/style/index.scss +37 -0
  65. package/es/style/theme.scss +18 -120
  66. package/es/utils/adaptive.mjs +0 -1
  67. package/es/utils/bus.mjs +0 -1
  68. package/es/utils/crypto.mjs +0 -1
  69. package/es/utils/date.mjs +0 -1
  70. package/es/utils/handler.mjs +0 -1
  71. package/es/utils/index.mjs +0 -1
  72. package/es/utils/is.mjs +0 -1
  73. package/es/version.mjs +1 -2
  74. package/lib/bussiness/index.js +0 -1
  75. package/lib/components/appButton/appButton.vue.js +137 -0
  76. package/lib/components/appButton/index.js +11 -0
  77. package/lib/components/appButton/style/appButton.scss +289 -0
  78. package/lib/components/appConfigProvider/appConfigProvider.vue.js +114 -0
  79. package/lib/components/appConfigProvider/index.js +11 -0
  80. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +103 -58
  81. package/lib/components/appConfirmDialog/appConfirmMethod.js +48 -26
  82. package/lib/components/appConfirmDialog/index.js +0 -1
  83. package/lib/components/appDatePicker/appDatePicker.vue.js +0 -1
  84. package/lib/components/appDatePicker/index.js +0 -1
  85. package/lib/components/appForm/appForm.vue.js +61 -64
  86. package/lib/components/appForm/index.js +0 -1
  87. package/lib/components/appForm/js/index.js +0 -1
  88. package/lib/components/appForm/js/useAppForm.js +0 -1
  89. package/lib/components/appForm/style/appForm.scss +1 -1
  90. package/lib/components/{svgIcon/svgIcon.vue.js → appIcon/appIcon.vue.js} +4 -5
  91. package/lib/components/appIcon/index.js +11 -0
  92. package/lib/components/{svgIcon/style/svgIcon.scss → appIcon/style/appIcon.scss} +1 -4
  93. package/lib/components/{svgIcon/iconBox.vue.js → appIconBox/appIconBox.vue.js} +6 -7
  94. package/lib/components/appIconBox/index.js +11 -0
  95. package/lib/components/appIconBox/style/appIconBox.scss +27 -0
  96. package/lib/components/appOrgCascader/appOrgCascader.vue.js +18 -11
  97. package/lib/components/appOrgCascader/index.js +0 -1
  98. package/lib/components/appSearch/appSearch.vue.js +2 -6
  99. package/lib/components/appSearch/index.js +0 -1
  100. package/lib/components/appSearch/js/index.js +5 -6
  101. package/lib/components/appSearch/js/useAppSearch.js +0 -1
  102. package/lib/components/appSearch/style/appSearch.scss +17 -11
  103. package/lib/components/appTable/appTable.vue.js +56 -31
  104. package/lib/components/appTable/cpns/columnSelect.vue.js +86 -122
  105. package/lib/components/appTable/cpns/columnSelectItem.vue.js +9 -0
  106. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +171 -0
  107. package/lib/components/appTable/index.js +0 -1
  108. package/lib/components/appTable/js/index.js +9 -7
  109. package/lib/components/appTable/js/search.js +6 -6
  110. package/lib/components/appTable/js/useAppTable.js +6 -3
  111. package/lib/components/appTable/style/appTable.scss +20 -11
  112. package/lib/components/appTooltip/appTooltip.vue.js +0 -1
  113. package/lib/components/appTooltip/index.js +0 -1
  114. package/lib/components/appUserAvatar/appUserAvatar.vue.js +140 -0
  115. package/lib/components/appUserAvatar/index.js +11 -0
  116. package/lib/components/appUserAvatar/style/appUserAvatar.scss +33 -0
  117. package/lib/components/index.js +24 -18
  118. package/lib/config/index.js +0 -1
  119. package/lib/constants/index.js +0 -1
  120. package/lib/constants/keys.js +0 -1
  121. package/lib/hooks/index.js +8 -2
  122. package/lib/hooks/useApi.js +19 -3
  123. package/lib/hooks/useGlobalConfig.js +21 -11
  124. package/lib/hooks/useLocale.js +1 -2
  125. package/lib/hooks/useMixins.js +0 -1
  126. package/lib/{store/maintain.js → hooks/useResizeHandler.js} +29 -44
  127. package/lib/hooks/useUserAvatarMap.js +12 -0
  128. package/lib/index.js +37 -28
  129. package/lib/locale/{en_US.js → en.js} +8 -5
  130. package/lib/locale/index.js +3 -4
  131. package/lib/locale/zh_CN.js +6 -3
  132. package/lib/make-installer.js +1 -7
  133. package/lib/static/hy-svg-icons.js +13 -0
  134. package/lib/style/element/element.scss +16313 -0
  135. package/lib/style/element/index.scss +932 -0
  136. package/lib/style/index.scss +37 -0
  137. package/lib/style/theme.scss +18 -120
  138. package/lib/utils/adaptive.js +0 -1
  139. package/lib/utils/bus.js +0 -1
  140. package/lib/utils/crypto.js +0 -1
  141. package/lib/utils/date.js +0 -1
  142. package/lib/utils/handler.js +0 -1
  143. package/lib/utils/index.js +0 -1
  144. package/lib/utils/is.js +0 -1
  145. package/lib/version.js +1 -2
  146. package/package.json +17 -7
  147. package/es/bussiness/index.mjs.map +0 -1
  148. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs.map +0 -1
  149. package/es/components/appConfirmDialog/appConfirmMethod.mjs.map +0 -1
  150. package/es/components/appConfirmDialog/index.mjs.map +0 -1
  151. package/es/components/appConfirmDialog/style/appConfirmDialog.scss +0 -5
  152. package/es/components/appDatePicker/appDatePicker.vue.mjs.map +0 -1
  153. package/es/components/appDatePicker/index.mjs.map +0 -1
  154. package/es/components/appForm/appForm.vue.mjs.map +0 -1
  155. package/es/components/appForm/index.mjs.map +0 -1
  156. package/es/components/appForm/js/index.mjs.map +0 -1
  157. package/es/components/appForm/js/useAppForm.mjs.map +0 -1
  158. package/es/components/appOrgCascader/appOrgCascader.vue.mjs.map +0 -1
  159. package/es/components/appOrgCascader/index.mjs.map +0 -1
  160. package/es/components/appSearch/appSearch.vue.mjs.map +0 -1
  161. package/es/components/appSearch/index.mjs.map +0 -1
  162. package/es/components/appSearch/js/index.mjs.map +0 -1
  163. package/es/components/appSearch/js/useAppSearch.mjs.map +0 -1
  164. package/es/components/appTable/appTable.vue.mjs.map +0 -1
  165. package/es/components/appTable/cpns/columnSelect.vue.mjs.map +0 -1
  166. package/es/components/appTable/index.mjs.map +0 -1
  167. package/es/components/appTable/js/index.mjs.map +0 -1
  168. package/es/components/appTable/js/search.mjs.map +0 -1
  169. package/es/components/appTable/js/useAppTable.mjs.map +0 -1
  170. package/es/components/appTooltip/appTooltip.vue.mjs.map +0 -1
  171. package/es/components/appTooltip/index.mjs.map +0 -1
  172. package/es/components/index.mjs.map +0 -1
  173. package/es/components/svgIcon/iconBox.vue.mjs.map +0 -1
  174. package/es/components/svgIcon/index.mjs +0 -9
  175. package/es/components/svgIcon/index.mjs.map +0 -1
  176. package/es/components/svgIcon/style/iconBox.scss +0 -13
  177. package/es/components/svgIcon/svgIcon.vue.mjs.map +0 -1
  178. package/es/config/index.mjs.map +0 -1
  179. package/es/constants/index.mjs.map +0 -1
  180. package/es/constants/keys.mjs.map +0 -1
  181. package/es/hooks/index.mjs.map +0 -1
  182. package/es/hooks/useApi.mjs.map +0 -1
  183. package/es/hooks/useGlobalConfig.mjs.map +0 -1
  184. package/es/hooks/useLocale.mjs.map +0 -1
  185. package/es/hooks/useMixins.mjs.map +0 -1
  186. package/es/index.mjs.map +0 -1
  187. package/es/locale/en_US.mjs.map +0 -1
  188. package/es/locale/index.mjs.map +0 -1
  189. package/es/locale/zh_CN.mjs.map +0 -1
  190. package/es/make-installer.mjs.map +0 -1
  191. package/es/store/index.mjs +0 -7
  192. package/es/store/index.mjs.map +0 -1
  193. package/es/store/maintain.mjs.map +0 -1
  194. package/es/utils/adaptive.mjs.map +0 -1
  195. package/es/utils/bus.mjs.map +0 -1
  196. package/es/utils/crypto.mjs.map +0 -1
  197. package/es/utils/date.mjs.map +0 -1
  198. package/es/utils/handler.mjs.map +0 -1
  199. package/es/utils/index.mjs.map +0 -1
  200. package/es/utils/is.mjs.map +0 -1
  201. package/es/version.mjs.map +0 -1
  202. package/lib/bussiness/index.js.map +0 -1
  203. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js.map +0 -1
  204. package/lib/components/appConfirmDialog/appConfirmMethod.js.map +0 -1
  205. package/lib/components/appConfirmDialog/index.js.map +0 -1
  206. package/lib/components/appConfirmDialog/style/appConfirmDialog.scss +0 -5
  207. package/lib/components/appDatePicker/appDatePicker.vue.js.map +0 -1
  208. package/lib/components/appDatePicker/index.js.map +0 -1
  209. package/lib/components/appForm/appForm.vue.js.map +0 -1
  210. package/lib/components/appForm/index.js.map +0 -1
  211. package/lib/components/appForm/js/index.js.map +0 -1
  212. package/lib/components/appForm/js/useAppForm.js.map +0 -1
  213. package/lib/components/appOrgCascader/appOrgCascader.vue.js.map +0 -1
  214. package/lib/components/appOrgCascader/index.js.map +0 -1
  215. package/lib/components/appSearch/appSearch.vue.js.map +0 -1
  216. package/lib/components/appSearch/index.js.map +0 -1
  217. package/lib/components/appSearch/js/index.js.map +0 -1
  218. package/lib/components/appSearch/js/useAppSearch.js.map +0 -1
  219. package/lib/components/appTable/appTable.vue.js.map +0 -1
  220. package/lib/components/appTable/cpns/columnSelect.vue.js.map +0 -1
  221. package/lib/components/appTable/index.js.map +0 -1
  222. package/lib/components/appTable/js/index.js.map +0 -1
  223. package/lib/components/appTable/js/search.js.map +0 -1
  224. package/lib/components/appTable/js/useAppTable.js.map +0 -1
  225. package/lib/components/appTooltip/appTooltip.vue.js.map +0 -1
  226. package/lib/components/appTooltip/index.js.map +0 -1
  227. package/lib/components/index.js.map +0 -1
  228. package/lib/components/svgIcon/iconBox.vue.js.map +0 -1
  229. package/lib/components/svgIcon/index.js +0 -15
  230. package/lib/components/svgIcon/index.js.map +0 -1
  231. package/lib/components/svgIcon/style/iconBox.scss +0 -13
  232. package/lib/components/svgIcon/svgIcon.vue.js.map +0 -1
  233. package/lib/config/index.js.map +0 -1
  234. package/lib/constants/index.js.map +0 -1
  235. package/lib/constants/keys.js.map +0 -1
  236. package/lib/hooks/index.js.map +0 -1
  237. package/lib/hooks/useApi.js.map +0 -1
  238. package/lib/hooks/useGlobalConfig.js.map +0 -1
  239. package/lib/hooks/useLocale.js.map +0 -1
  240. package/lib/hooks/useMixins.js.map +0 -1
  241. package/lib/index.js.map +0 -1
  242. package/lib/locale/en_US.js.map +0 -1
  243. package/lib/locale/index.js.map +0 -1
  244. package/lib/locale/zh_CN.js.map +0 -1
  245. package/lib/make-installer.js.map +0 -1
  246. package/lib/store/index.js +0 -10
  247. package/lib/store/index.js.map +0 -1
  248. package/lib/store/maintain.js.map +0 -1
  249. package/lib/utils/adaptive.js.map +0 -1
  250. package/lib/utils/bus.js.map +0 -1
  251. package/lib/utils/crypto.js.map +0 -1
  252. package/lib/utils/date.js.map +0 -1
  253. package/lib/utils/handler.js.map +0 -1
  254. package/lib/utils/index.js.map +0 -1
  255. package/lib/utils/is.js.map +0 -1
  256. package/lib/version.js.map +0 -1
@@ -0,0 +1,114 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var ElementLocale = require('element-plus/es/locales.mjs');
8
+ var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
9
+
10
+ function _interopNamespaceDefault(e) {
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var ElementLocale__namespace = /*#__PURE__*/_interopNamespaceDefault(ElementLocale);
28
+
29
+ const __default__ = vue.defineComponent({
30
+ name: "AppConfigProvider"
31
+ });
32
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
33
+ props: {
34
+ locale: {
35
+ type: String,
36
+ required: false,
37
+ default: "zhCn"
38
+ },
39
+ api: {
40
+ type: [Object, Function],
41
+ required: false
42
+ },
43
+ userAvatarMap: {
44
+ type: Map,
45
+ required: false,
46
+ default: () => /* @__PURE__ */ new Map()
47
+ },
48
+ size: {
49
+ type: String,
50
+ required: false,
51
+ default: "default"
52
+ },
53
+ zIndex: {
54
+ type: Number,
55
+ required: false
56
+ },
57
+ button: {
58
+ type: Object,
59
+ required: false
60
+ },
61
+ link: {
62
+ type: Object,
63
+ required: false
64
+ },
65
+ dialog: {
66
+ type: Object,
67
+ required: false
68
+ },
69
+ message: {
70
+ type: Object,
71
+ required: false
72
+ },
73
+ emptyValues: {
74
+ type: String,
75
+ required: false
76
+ },
77
+ valueOnClear: {
78
+ type: [String, Number, null],
79
+ required: false
80
+ },
81
+ table: {
82
+ type: Object,
83
+ required: false
84
+ }
85
+ },
86
+ setup(__props) {
87
+ const props = __props;
88
+ const globalConfig = useGlobalConfig.provideGlobalConfig(props);
89
+ const config = vue.computed(() => {
90
+ const { locale, api, userAvatarMap, ...config2 } = globalConfig.value;
91
+ return {
92
+ locale: ElementLocale__namespace[locale] || ElementLocale__namespace["zhCn"],
93
+ ...config2
94
+ };
95
+ });
96
+ return (_ctx, _cache) => {
97
+ return vue.openBlock(), vue.createBlock(
98
+ vue.unref(elementPlus.ElConfigProvider),
99
+ vue.mergeProps(config.value, { namespace: "hy-el" }),
100
+ {
101
+ default: vue.withCtx(({ config: config2 }) => [
102
+ vue.renderSlot(_ctx.$slots, "default", { config: config2 })
103
+ ]),
104
+ _: 3
105
+ /* FORWARDED */
106
+ },
107
+ 16
108
+ /* FULL_PROPS */
109
+ );
110
+ };
111
+ }
112
+ });
113
+
114
+ exports.default = _sfc_main;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var appConfigProvider = require('./appConfigProvider.vue.js');
6
+ var handler = require('../../utils/handler.js');
7
+
8
+ const AppConfigProvider = handler.withInstall(appConfigProvider.default);
9
+
10
+ exports.AppConfigProvider = AppConfigProvider;
11
+ exports.default = AppConfigProvider;
@@ -5,15 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var iconsVue = require('@element-plus/icons-vue');
8
+ var index = require('../appButton/index.js');
8
9
  var useLocale = require('../../hooks/useLocale.js');
9
10
 
10
- import "./style/appConfirmDialog.scss";
11
-
12
11
  const __default__ = vue.defineComponent({
13
12
  name: "AppConfirmDialog"
14
13
  });
15
14
  const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
16
- props: {
15
+ props: /* @__PURE__ */ vue.mergeModels({
17
16
  width: {
18
17
  type: [String, Number],
19
18
  default: 500
@@ -32,15 +31,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
32
31
  },
33
32
  showClose: {
34
33
  type: Boolean,
35
- default: true
34
+ default: false
36
35
  },
37
36
  showCancel: {
38
37
  type: Boolean,
39
38
  default: true
40
39
  },
41
- cancelClass: {
40
+ cancelType: {
42
41
  type: String,
43
- default: "button_default"
42
+ default: "default"
44
43
  },
45
44
  cancelText: {
46
45
  type: String
@@ -49,40 +48,78 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
49
48
  type: Boolean,
50
49
  default: true
51
50
  },
52
- submitClass: {
51
+ submitType: {
53
52
  type: String,
54
- default: "button_delete"
53
+ default: "primary"
55
54
  },
56
55
  submitText: {
57
56
  type: String
58
57
  },
59
- textAlign: {
58
+ iconColor: {
60
59
  type: String,
61
- default: "center"
62
- },
63
- onCancel: {
64
- type: Function
60
+ default: "rgb(var(--hy-main))"
65
61
  },
66
- onSubmit: {
67
- type: Function
68
- }
69
- },
70
- emits: ["on-submit", "on-close"],
62
+ onClose: Function,
63
+ onCancel: Function,
64
+ onSubmit: Function
65
+ }, {
66
+ "modelValue": { type: Boolean, default: false },
67
+ "modelModifiers": {}
68
+ }),
69
+ emits: /* @__PURE__ */ vue.mergeModels(["hide"], ["update:modelValue"]),
71
70
  setup(__props, { expose: __expose, emit: __emit }) {
72
71
  const props = __props;
72
+ const emits = __emit;
73
73
  const { t } = useLocale.useLocale();
74
- const visible = vue.ref(false);
74
+ const visible = vue.useModel(__props, "modelValue");
75
+ const loading = vue.ref(false);
75
76
  async function onSubmitHandler() {
77
+ if (loading.value) return;
78
+ loading.value = true;
76
79
  if (props.onSubmit) {
77
- await props.onSubmit();
80
+ try {
81
+ await props.onSubmit();
82
+ } catch (err) {
83
+ console.error(err);
84
+ loading.value = false;
85
+ return;
86
+ }
78
87
  }
79
88
  visible.value = false;
89
+ loading.value = false;
90
+ emits("hide");
80
91
  }
81
- async function onCloseHandler() {
92
+ async function onCancelHandler() {
93
+ if (loading.value) return;
94
+ loading.value = true;
82
95
  if (props.onCancel) {
83
- await props.onCancel();
96
+ try {
97
+ await props.onCancel();
98
+ } catch (err) {
99
+ console.error(err);
100
+ loading.value = false;
101
+ return;
102
+ }
84
103
  }
85
104
  visible.value = false;
105
+ loading.value = false;
106
+ emits("hide");
107
+ }
108
+ async function onCloseHandler() {
109
+ if (loading.value) return;
110
+ loading.value = true;
111
+ if (props.onClose) {
112
+ try {
113
+ await props.onClose();
114
+ } catch (err) {
115
+ console.error(err);
116
+ loading.value = false;
117
+ return;
118
+ }
119
+ }
120
+ visible.value = false;
121
+ loading.value = false;
122
+ emits("hide");
86
123
  }
87
124
  __expose({
88
125
  show: () => {
@@ -101,11 +138,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
101
138
  "close-on-click-modal": false,
102
139
  "close-on-press-escape": false,
103
140
  "show-close": false,
104
- top: "15%",
105
- class: "app-confirm-dialog"
141
+ top: "15%"
106
142
  }, _ctx.$attrs), {
107
143
  header: vue.withCtx(() => [
108
- vue.createElementVNode("div", { class: "h-[38px] flex items-center justify-between border-b border-border pl-4 pr-[10px]" }, [
144
+ vue.createElementVNode("div", {
145
+ class: "h-[38px] flex items-center justify-between border-b border-border pl-4 pr-[10px]",
146
+ onClick: vue.withModifiers(() => {
147
+ }, ["stop"])
148
+ }, [
109
149
  vue.createElementVNode(
110
150
  "span",
111
151
  { class: "text-sm text-main font-bold" },
@@ -113,60 +153,66 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
113
153
  1
114
154
  /* TEXT */
115
155
  ),
116
- __props.showClose ? (vue.openBlock(), vue.createElementBlock("div", {
117
- key: 0,
118
- class: "flex items-center clickBox",
119
- onClick: onCloseHandler
120
- }, [
121
- vue.createVNode(vue.unref(elementPlus.ElIcon), {
122
- size: "18",
123
- color: "var(--danger)"
124
- }, {
125
- default: vue.withCtx(() => [
126
- vue.createVNode(vue.unref(iconsVue.CircleClose))
127
- ]),
128
- _: 1
129
- /* STABLE */
130
- })
131
- ])) : vue.createCommentVNode("v-if", true)
132
- ])
156
+ __props.showClose ? (vue.openBlock(), vue.createElementBlock(
157
+ "div",
158
+ {
159
+ key: 0,
160
+ class: vue.normalizeClass(["flex items-center clickBox", { "cursor-not-allowed": loading.value }]),
161
+ onClick: onCloseHandler
162
+ },
163
+ [
164
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
165
+ size: "18",
166
+ color: "rgb(var(--hy-danger-2))"
167
+ }, {
168
+ default: vue.withCtx(() => [
169
+ vue.createVNode(vue.unref(iconsVue.CircleClose))
170
+ ]),
171
+ _: 1
172
+ /* STABLE */
173
+ })
174
+ ],
175
+ 2
176
+ /* CLASS */
177
+ )) : vue.createCommentVNode("v-if", true)
178
+ ], 8, ["onClick"])
133
179
  ]),
134
180
  default: vue.withCtx(() => [
135
- vue.createElementVNode("div", { class: "h-[253px] flex flex-col items-center justify-between pt-[37px] pb-[27px]" }, [
181
+ vue.createElementVNode("div", { class: "flex flex-col items-center justify-between pt-[37px] pb-[27px]" }, [
136
182
  vue.createElementVNode("div", { class: "flex flex-col items-center text-main" }, [
137
183
  vue.createVNode(vue.unref(elementPlus.ElIcon), {
138
184
  size: "40",
139
- color: "var(--main)"
185
+ color: __props.iconColor
140
186
  }, {
141
187
  default: vue.withCtx(() => [
142
188
  vue.createVNode(vue.unref(iconsVue.Warning))
143
189
  ]),
144
190
  _: 1
145
191
  /* STABLE */
146
- }),
192
+ }, 8, ["color"]),
147
193
  vue.createElementVNode(
148
194
  "div",
149
195
  {
150
- class: vue.normalizeClass(["text-base font-bold mt-[10px] mb-[26px]", __props.titleClass])
196
+ class: vue.normalizeClass(["text-base text-center font-bold mt-[10px] mb-[26px]", __props.titleClass])
151
197
  },
152
198
  vue.toDisplayString(__props.title),
153
199
  3
154
200
  /* TEXT, CLASS */
155
201
  ),
156
202
  vue.createElementVNode("div", {
157
- class: "max-w-[240px] text-smword-break",
203
+ class: "max-w-[300px] text-smword-break text-center break-all",
158
204
  innerHTML: __props.content
159
205
  }, null, 8, ["innerHTML"])
160
206
  ]),
161
207
  __props.showSubmit || __props.showCancel ? (vue.openBlock(), vue.createElementBlock("div", {
162
208
  key: 0,
163
- class: "flex gap-4 mt-3"
209
+ class: "pt-[32px]"
164
210
  }, [
165
- __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
211
+ __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
166
212
  key: 0,
167
- class: vue.normalizeClass([__props.cancelClass, "buttonBox"]),
168
- type: "primary",
169
- onClick: onCloseHandler
213
+ type: __props.cancelType,
214
+ disabled: loading.value,
215
+ onClick: onCancelHandler
170
216
  }, {
171
217
  default: vue.withCtx(() => [
172
218
  vue.createTextVNode(
@@ -177,11 +223,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
177
223
  ]),
178
224
  _: 1
179
225
  /* STABLE */
180
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
181
- __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
226
+ }, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true),
227
+ __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
182
228
  key: 1,
183
- class: vue.normalizeClass([__props.submitClass, "buttonBox mx-2"]),
184
- type: "primary",
229
+ type: __props.submitType,
230
+ disabled: loading.value,
185
231
  onClick: onSubmitHandler
186
232
  }, {
187
233
  default: vue.withCtx(() => [
@@ -193,7 +239,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
193
239
  ]),
194
240
  _: 1
195
241
  /* STABLE */
196
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
242
+ }, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true)
197
243
  ])) : vue.createCommentVNode("v-if", true)
198
244
  ])
199
245
  ]),
@@ -205,4 +251,3 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
205
251
  });
206
252
 
207
253
  exports.default = _sfc_main;
208
- //# sourceMappingURL=appConfirmDialog.vue.js.map
@@ -3,44 +3,68 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var useApi = require('../../hooks/useApi.js');
7
+ var index = require('../appConfigProvider/index.js');
6
8
  var appConfirmDialog = require('./appConfirmDialog.vue.js');
7
9
  var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
8
10
  var useLocale = require('../../hooks/useLocale.js');
9
11
 
10
12
  function appConfirmMethod(config) {
11
- const container = document.createDocumentFragment();
12
- const currentConfig = { ...config };
13
+ let container = document.createDocumentFragment();
14
+ const currentConfig = {
15
+ ...config,
16
+ onHide: () => {
17
+ destroy();
18
+ }
19
+ };
13
20
  let confirmDialogInstance = null;
14
21
  function render(props) {
22
+ const globalConfig = useGlobalConfig.useGlobalConfig();
23
+ const {
24
+ locale = "zhCn",
25
+ api = useApi.defaultAxios,
26
+ ...args
27
+ } = vue.unref(globalConfig) || {};
15
28
  const vm = vue.createVNode(appConfirmDialog.default, props);
16
- vue.render(vm, container);
29
+ const configProvider = vue.createVNode(
30
+ index.AppConfigProvider,
31
+ {
32
+ locale,
33
+ api,
34
+ ...args
35
+ },
36
+ () => [vm]
37
+ );
38
+ vue.render(configProvider, container);
17
39
  return vm;
18
40
  }
19
- function destroy() {
20
- confirmDialogInstance.component.exposed.close();
21
- confirmDialogInstance.unmout();
41
+ async function destroy() {
42
+ if (confirmDialogInstance) {
43
+ confirmDialogInstance.component.exposed.close();
44
+ }
45
+ if (container) {
46
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
47
+ vue.render(null, container);
48
+ }
49
+ container = null;
50
+ confirmDialogInstance = null;
22
51
  }
23
52
  confirmDialogInstance = render(currentConfig);
24
53
  confirmDialogInstance.component.exposed.show();
25
54
  return destroy;
26
55
  }
27
- appConfirmDialog.default.tip = function(props) {
28
- var _a;
29
- const globalConfig = useGlobalConfig.getGlobalConfig();
30
- const { t } = useLocale.useLocale((_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale);
56
+ appConfirmDialog.default.tip = (props) => {
57
+ const { t } = useLocale.useLocale();
31
58
  return appConfirmMethod({
32
- showCancel: false,
33
- submitText: t("confirmDialog.haveKnown"),
34
59
  dialogTitle: t("confirmDialog.prompt"),
35
60
  title: t("confirmDialog.prompt"),
36
61
  content: t("confirmDialog.content"),
62
+ showCancel: false,
37
63
  ...props
38
64
  });
39
65
  };
40
- appConfirmDialog.default.confirm = function(props) {
41
- var _a;
42
- const globalConfig = useGlobalConfig.getGlobalConfig();
43
- const { t } = useLocale.useLocale((_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale);
66
+ appConfirmDialog.default.confirm = (props) => {
67
+ const { t } = useLocale.useLocale();
44
68
  return appConfirmMethod({
45
69
  dialogTitle: t("confirmDialog.prompt"),
46
70
  title: t("confirmDialog.prompt"),
@@ -48,30 +72,28 @@ appConfirmDialog.default.confirm = function(props) {
48
72
  ...props
49
73
  });
50
74
  };
51
- appConfirmDialog.default.warning = function(props) {
52
- var _a;
53
- const globalConfig = useGlobalConfig.getGlobalConfig();
54
- const { t } = useLocale.useLocale((_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale);
75
+ appConfirmDialog.default.warning = (props) => {
76
+ const { t } = useLocale.useLocale();
55
77
  return appConfirmMethod({
56
78
  dialogTitle: t("confirmDialog.riskWarning"),
57
79
  title: t("confirmDialog.prompt"),
58
80
  titleClass: "text-warning",
59
81
  content: t("confirmDialog.content"),
82
+ iconColor: "rgb(var(--hy-warning))",
60
83
  ...props
61
84
  });
62
85
  };
63
- appConfirmDialog.default.danger = function(props) {
64
- var _a;
65
- const globalConfig = useGlobalConfig.getGlobalConfig();
66
- const { t } = useLocale.useLocale((_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale);
86
+ appConfirmDialog.default.danger = (props) => {
87
+ const { t } = useLocale.useLocale();
67
88
  return appConfirmMethod({
68
89
  dialogTitle: t("confirmDialog.dangerousOperation"),
69
- titleClass: "text-dangerv2",
90
+ titleClass: "text-danger",
70
91
  title: t("confirmDialog.prompt"),
71
92
  content: t("confirmDialog.content"),
93
+ submitType: "danger",
94
+ iconColor: "rgb(var(--hy-danger))",
72
95
  ...props
73
96
  });
74
97
  };
75
98
 
76
99
  exports.default = appConfirmDialog.default;
77
- //# sourceMappingURL=appConfirmMethod.js.map
@@ -10,4 +10,3 @@ const AppConfirmDialog = handler.withInstall(appConfirmDialog.default);
10
10
 
11
11
  exports.AppConfirmDialog = AppConfirmDialog;
12
12
  exports.default = AppConfirmDialog;
13
- //# sourceMappingURL=index.js.map
@@ -100,4 +100,3 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
100
100
  });
101
101
 
102
102
  exports.default = _sfc_main;
103
- //# sourceMappingURL=appDatePicker.vue.js.map
@@ -9,4 +9,3 @@ const AppDatePicker = handler.withInstall(appDatePicker.default);
9
9
 
10
10
  exports.AppDatePicker = AppDatePicker;
11
11
  exports.default = AppDatePicker;
12
- //# sourceMappingURL=index.js.map