orion-design 0.1.31 → 0.1.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. package/README.md +5 -5
  2. package/dist/Throne/hooks/use-throne-context.d.ts +5 -0
  3. package/dist/Throne/hooks/use-throne-context.js +15 -0
  4. package/dist/Throne/hooks/use-throne-context.js.map +1 -0
  5. package/dist/Throne/index.d.ts +1 -1
  6. package/dist/Throne/index.js +14 -30
  7. package/dist/Throne/index.js.map +1 -1
  8. package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +2 -0
  9. package/dist/components/Button/index.js +36 -41
  10. package/dist/components/Button/index.js.map +1 -1
  11. package/dist/components/Flex/index.js +89 -122
  12. package/dist/components/Flex/index.js.map +1 -1
  13. package/dist/components/Form/FileInput/FileInput.vue.d.ts +4 -4
  14. package/dist/components/Form/Form.js +2 -2
  15. package/dist/components/Form/Form.js.map +1 -1
  16. package/dist/components/Form/LovInput/LovInput.js +2 -2
  17. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  18. package/dist/components/Form/LovInput/LovInput.vue.d.ts +894 -0
  19. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  20. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  21. package/dist/components/Form/LovInput/index.js +4 -4
  22. package/dist/components/Form/MultiTableSelect/MultiTableSelect.d.ts +26 -0
  23. package/dist/components/Form/MultiTableSelect/MultiTableSelect.js +5 -0
  24. package/dist/components/Form/MultiTableSelect/MultiTableSelect.js.map +1 -0
  25. package/dist/components/Form/MultiTableSelect/MultiTableSelect.vue.d.ts +6249 -0
  26. package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.d.ts +1 -0
  27. package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js +9 -0
  28. package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js.map +1 -0
  29. package/dist/components/Form/MultiTableSelect/index.d.ts +2 -0
  30. package/dist/components/Form/MultiTableSelect/index.js +7 -0
  31. package/dist/components/Form/MultiTableSelect/index.js.map +1 -0
  32. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  33. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  34. package/dist/components/Form/hooks/index.js +69 -127
  35. package/dist/components/Form/hooks/index.js.map +1 -1
  36. package/dist/components/Form/index.d.ts +3 -0
  37. package/dist/components/Form/index.js +790 -829
  38. package/dist/components/Form/index.js.map +1 -1
  39. package/dist/components/Form/utils/index.js +18 -30
  40. package/dist/components/Form/utils/index.js.map +1 -1
  41. package/dist/components/LovTable/LovPagetable.vue.d.ts +510 -6
  42. package/dist/components/LovTable/LovQuerytable.vue.d.ts +468 -4
  43. package/dist/components/LovTable/index.d.ts +489 -5
  44. package/dist/components/LovTable/index.js +104 -179
  45. package/dist/components/LovTable/index.js.map +1 -1
  46. package/dist/components/Modal/index.js +56 -111
  47. package/dist/components/Modal/index.js.map +1 -1
  48. package/dist/components/Modal/types.d.ts +1 -1
  49. package/dist/components/Modal/types.js +3 -4
  50. package/dist/components/Modal/types.js.map +1 -1
  51. package/dist/components/Modal/useModal.js +5 -5
  52. package/dist/components/Modal/useModal.js.map +1 -1
  53. package/dist/components/MultiTableSelectPagetable/MultiTableSelectPagetable.vue.d.ts +880 -0
  54. package/dist/components/MultiTableSelectPagetable/index.d.ts +462 -0
  55. package/dist/components/MultiTableSelectPagetable/index.js +164 -0
  56. package/dist/components/MultiTableSelectPagetable/index.js.map +1 -0
  57. package/dist/components/Pagetable/Pagetable.d.ts +96 -3
  58. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +14 -1
  59. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +14 -1
  60. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +1 -1
  61. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +14 -1
  62. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +14 -1
  63. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +14 -1
  64. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +14 -1
  65. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +14 -1
  66. package/dist/components/Pagetable/hooks/useCode.d.ts +2 -0
  67. package/dist/components/Pagetable/hooks/useCode.js +24 -0
  68. package/dist/components/Pagetable/hooks/useCode.js.map +1 -0
  69. package/dist/components/Pagetable/hooks/useColumns.js +85 -88
  70. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  71. package/dist/components/Pagetable/index.d.ts +159 -2
  72. package/dist/components/Pagetable/index.js +601 -684
  73. package/dist/components/Pagetable/index.js.map +1 -1
  74. package/dist/components/Pagetable/utils/index.js +54 -92
  75. package/dist/components/Pagetable/utils/index.js.map +1 -1
  76. package/dist/components/Querytable/Querytable.d.ts +80 -2
  77. package/dist/components/Querytable/columns/QuerytableColumnButtongroup.d.ts +14 -1
  78. package/dist/components/Querytable/columns/QuerytableColumnDate.d.ts +14 -1
  79. package/dist/components/Querytable/columns/QuerytableColumnDiy.d.ts +1 -1
  80. package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +14 -1
  81. package/dist/components/Querytable/columns/QuerytableColumnMultiselect.d.ts +14 -1
  82. package/dist/components/Querytable/columns/QuerytableColumnNumber.d.ts +14 -1
  83. package/dist/components/Querytable/columns/QuerytableColumnSingleselect.d.ts +14 -1
  84. package/dist/components/Querytable/columns/QuerytableColumnString.d.ts +14 -1
  85. package/dist/components/Querytable/hooks/useColumns.js +79 -82
  86. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  87. package/dist/components/Querytable/index.d.ts +147 -1
  88. package/dist/components/Querytable/index.js +526 -579
  89. package/dist/components/Querytable/index.js.map +1 -1
  90. package/dist/components/Querytable/utils/index.js +54 -92
  91. package/dist/components/Querytable/utils/index.js.map +1 -1
  92. package/dist/components/RichTextEditor/index.js +74 -100
  93. package/dist/components/RichTextEditor/index.js.map +1 -1
  94. package/dist/components/Tabs/constants.js +2 -2
  95. package/dist/components/Tabs/constants.js.map +1 -1
  96. package/dist/components/Tabs/index.js +358 -603
  97. package/dist/components/Tabs/index.js.map +1 -1
  98. package/dist/components/Tabs/tab-bar.js +6 -6
  99. package/dist/components/Tabs/tab-bar.js.map +1 -1
  100. package/dist/components/Tabs/tab-pane.js +3 -3
  101. package/dist/components/Tabs/tab-pane.js.map +1 -1
  102. package/dist/components/Throne/ThroneContextProvider.d.ts +25 -0
  103. package/dist/components/_constants/aria.js +2 -2
  104. package/dist/components/_constants/aria.js.map +1 -1
  105. package/dist/components/_constants/event.js +4 -6
  106. package/dist/components/_constants/event.js.map +1 -1
  107. package/dist/components/_constants/index.js +6 -6
  108. package/dist/components/_hooks/index.js +7 -7
  109. package/dist/components/_hooks/use-namespace/index.js +39 -74
  110. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  111. package/dist/components/_hooks/use-ordered-children/index.js +19 -29
  112. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  113. package/dist/components/_util/arrays.js +5 -9
  114. package/dist/components/_util/arrays.js.map +1 -1
  115. package/dist/components/_util/browser.js +6 -6
  116. package/dist/components/_util/browser.js.map +1 -1
  117. package/dist/components/_util/classNames.js +17 -22
  118. package/dist/components/_util/classNames.js.map +1 -1
  119. package/dist/components/_util/dom/aria.js +39 -74
  120. package/dist/components/_util/dom/aria.js.map +1 -1
  121. package/dist/components/_util/dom/element.js +8 -9
  122. package/dist/components/_util/dom/element.js.map +1 -1
  123. package/dist/components/_util/dom/event.js +7 -14
  124. package/dist/components/_util/dom/event.js.map +1 -1
  125. package/dist/components/_util/dom/index.js +36 -36
  126. package/dist/components/_util/dom/position.js +25 -49
  127. package/dist/components/_util/dom/position.js.map +1 -1
  128. package/dist/components/_util/dom/scroll.js +61 -103
  129. package/dist/components/_util/dom/scroll.js.map +1 -1
  130. package/dist/components/_util/dom/style.js +50 -65
  131. package/dist/components/_util/dom/style.js.map +1 -1
  132. package/dist/components/_util/easings.js +4 -8
  133. package/dist/components/_util/easings.js.map +1 -1
  134. package/dist/components/_util/error.js +11 -12
  135. package/dist/components/_util/error.js.map +1 -1
  136. package/dist/components/_util/functions.js +3 -3
  137. package/dist/components/_util/i18n.js +2 -2
  138. package/dist/components/_util/i18n.js.map +1 -1
  139. package/dist/components/_util/index.js +137 -137
  140. package/dist/components/_util/isValid.js +2 -4
  141. package/dist/components/_util/isValid.js.map +1 -1
  142. package/dist/components/_util/objects.js +14 -18
  143. package/dist/components/_util/objects.js.map +1 -1
  144. package/dist/components/_util/props-util/index.js +20 -46
  145. package/dist/components/_util/props-util/index.js.map +1 -1
  146. package/dist/components/_util/props-util/initDefaultProps.js +10 -18
  147. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  148. package/dist/components/_util/raf.js +4 -5
  149. package/dist/components/_util/raf.js.map +1 -1
  150. package/dist/components/_util/rand.js +3 -4
  151. package/dist/components/_util/rand.js.map +1 -1
  152. package/dist/components/_util/strings.js +8 -9
  153. package/dist/components/_util/strings.js.map +1 -1
  154. package/dist/components/_util/throttleByRaf.js +10 -16
  155. package/dist/components/_util/throttleByRaf.js.map +1 -1
  156. package/dist/components/_util/type.js +38 -41
  157. package/dist/components/_util/type.js.map +1 -1
  158. package/dist/components/_util/types.js +22 -41
  159. package/dist/components/_util/types.js.map +1 -1
  160. package/dist/components/_util/typescript.js +2 -2
  161. package/dist/components/_util/typescript.js.map +1 -1
  162. package/dist/components/_util/util.js +43 -85
  163. package/dist/components/_util/util.js.map +1 -1
  164. package/dist/components/_util/vue/global-node.js +15 -27
  165. package/dist/components/_util/vue/global-node.js.map +1 -1
  166. package/dist/components/_util/vue/icon.js +25 -29
  167. package/dist/components/_util/vue/icon.js.map +1 -1
  168. package/dist/components/_util/vue/index.js +41 -41
  169. package/dist/components/_util/vue/install.js +18 -35
  170. package/dist/components/_util/vue/install.js.map +1 -1
  171. package/dist/components/_util/vue/props/index.js +6 -6
  172. package/dist/components/_util/vue/props/runtime.js +30 -46
  173. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  174. package/dist/components/_util/vue/refs.js +6 -12
  175. package/dist/components/_util/vue/refs.js.map +1 -1
  176. package/dist/components/_util/vue/size.js +3 -5
  177. package/dist/components/_util/vue/size.js.map +1 -1
  178. package/dist/components/_util/vue/validator.js +4 -5
  179. package/dist/components/_util/vue/validator.js.map +1 -1
  180. package/dist/components/_util/vue/vnode.js +54 -100
  181. package/dist/components/_util/vue/vnode.js.map +1 -1
  182. package/dist/components/_util/vue-types/index.js +220 -231
  183. package/dist/components/_util/vue-types/index.js.map +1 -1
  184. package/dist/components/components.d.ts +2 -0
  185. package/dist/components/components.js +24 -20
  186. package/dist/components/components.js.map +1 -1
  187. package/dist/components/index.js +43 -38
  188. package/dist/components/index.js.map +1 -1
  189. package/dist/components-DP9bnDLm.js +48 -0
  190. package/dist/components-DP9bnDLm.js.map +1 -0
  191. package/dist/error/OrionError.js +4 -8
  192. package/dist/error/OrionError.js.map +1 -1
  193. package/dist/{index-C6P_0wAy.js → index-ChkLOmNK.js} +76 -46
  194. package/dist/{index-C6P_0wAy.js.map → index-ChkLOmNK.js.map} +1 -1
  195. package/dist/index.css +1 -797
  196. package/dist/index.d.ts +1 -0
  197. package/dist/index.js +46 -36
  198. package/dist/index.js.map +1 -1
  199. package/dist/print/LodopFuncs.js +43 -101
  200. package/dist/print/LodopFuncs.js.map +1 -1
  201. package/dist/print/index.js +108 -200
  202. package/dist/print/index.js.map +1 -1
  203. package/dist/request/ErrorHandlerChain.js +14 -17
  204. package/dist/request/ErrorHandlerChain.js.map +1 -1
  205. package/dist/request/RequestFilterChain.js +13 -16
  206. package/dist/request/RequestFilterChain.js.map +1 -1
  207. package/dist/request/ResponseParserChain.js +14 -17
  208. package/dist/request/ResponseParserChain.js.map +1 -1
  209. package/dist/request/disivion/DateSerializer.js +22 -47
  210. package/dist/request/disivion/DateSerializer.js.map +1 -1
  211. package/dist/request/disivion/DivisionErrorHandler.js +25 -40
  212. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  213. package/dist/request/disivion/DivisionResponseParser.js +10 -16
  214. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  215. package/dist/request/disivion/index.js +201 -305
  216. package/dist/request/disivion/index.js.map +1 -1
  217. package/dist/request/error/BizExceptionResponseError.js +5 -11
  218. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  219. package/dist/request/error/ExceptionResponseError.js +5 -11
  220. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  221. package/dist/request/error/ResponseError.js +4 -9
  222. package/dist/request/error/ResponseError.js.map +1 -1
  223. package/dist/request/error/SessionExceptionResponseError.js +5 -11
  224. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  225. package/dist/request/index.js +11 -11
  226. package/dist/utils/DateUtil.js +33 -48
  227. package/dist/utils/DateUtil.js.map +1 -1
  228. package/dist/utils/NumberUtil.js +6 -6
  229. package/dist/utils/NumberUtil.js.map +1 -1
  230. package/dist/utils/cloneDeep.js +2 -2
  231. package/dist/utils/delay.js +3 -3
  232. package/dist/utils/delay.js.map +1 -1
  233. package/dist/utils/functions.js +3 -3
  234. package/dist/utils/index.js +12 -12
  235. package/dist/utils/md5.js +93 -191
  236. package/dist/utils/md5.js.map +1 -1
  237. package/dist/utils/uuid.js +25 -35
  238. package/dist/utils/uuid.js.map +1 -1
  239. package/dist/version/index.js +2 -2
  240. package/dist/version/version.d.ts +1 -1
  241. package/dist/version/version.js +2 -2
  242. package/dist/version/version.js.map +1 -1
  243. package/package.json +1 -1
  244. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
  245. package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
  246. package/dist/components-8oZ2kpUC.js +0 -27
  247. package/dist/components-8oZ2kpUC.js.map +0 -1
  248. package/dist/components-B3d9m_tn.js +0 -27
  249. package/dist/components-B3d9m_tn.js.map +0 -1
  250. package/dist/functions-BeMkokbY.js +0 -63
  251. package/dist/functions-BeMkokbY.js.map +0 -1
  252. package/dist/index-BOKLZnqH.js +0 -54
  253. package/dist/index-BOKLZnqH.js.map +0 -1
  254. package/dist/index-D1m0KTpK.js +0 -69
  255. package/dist/index-D1m0KTpK.js.map +0 -1
  256. package/dist/index-DR5ZP7mD.js +0 -160
  257. package/dist/index-DR5ZP7mD.js.map +0 -1
  258. package/dist/index-DkwIULcN.js +0 -200
  259. package/dist/index-DkwIULcN.js.map +0 -1
@@ -1,97 +1,55 @@
1
- const isFunction = (val) => typeof val === "function";
2
- const controlDefaultValue = Symbol("controlDefaultValue");
3
- const isArray = Array.isArray;
4
- const isString = (val) => typeof val === "string";
5
- const isSymbol = (val) => typeof val === "symbol";
6
- const isObject = (val) => val !== null && typeof val === "object";
7
- const onRE = /^on[^a-z]/;
8
- const isOn = (key) => onRE.test(key);
9
- const cacheStringFunction = (fn) => {
10
- const cache = /* @__PURE__ */ Object.create(null);
11
- return (str) => {
12
- const hit = cache[str];
13
- return hit || (cache[str] = fn(str));
14
- };
15
- };
16
- const camelizeRE = /-(\w)/g;
17
- const camelize = cacheStringFunction((str) => {
18
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
19
- });
20
- const hyphenateRE = /\B([A-Z])/g;
21
- const hyphenate = cacheStringFunction((str) => {
22
- return str.replace(hyphenateRE, "-$1").toLowerCase();
23
- });
24
- const capitalize = cacheStringFunction((str) => {
25
- return str.charAt(0).toUpperCase() + str.slice(1);
26
- });
27
- const hasOwnProperty = Object.prototype.hasOwnProperty;
28
- const hasOwn = (val, key) => hasOwnProperty.call(val, key);
29
- function resolvePropValue(options, props, key, value) {
30
- const opt = options[key];
31
- if (opt != null) {
32
- const hasDefault = hasOwn(opt, "default");
33
- if (hasDefault && value === void 0) {
34
- const defaultValue = opt.default;
35
- value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue;
36
- }
37
- if (opt.type === Boolean) {
38
- if (!hasOwn(props, key) && !hasDefault) {
39
- value = false;
40
- } else if (value === "") {
41
- value = true;
42
- }
1
+ const u = (t) => typeof t == "function", y = Symbol("controlDefaultValue"), b = Array.isArray, d = (t) => typeof t == "string", m = (t) => typeof t == "symbol", O = (t) => t !== null && typeof t == "object", f = /^on[^a-z]/, P = (t) => f.test(t), i = (t) => {
2
+ const n = /* @__PURE__ */ Object.create(null);
3
+ return (e) => n[e] || (n[e] = t(e));
4
+ }, l = /-(\w)/g, w = i((t) => t.replace(l, (n, e) => e ? e.toUpperCase() : "")), p = /\B([A-Z])/g, A = i((t) => t.replace(p, "-$1").toLowerCase()), g = i((t) => t.charAt(0).toUpperCase() + t.slice(1)), h = Object.prototype.hasOwnProperty, a = (t, n) => h.call(t, n);
5
+ function j(t, n, e, o) {
6
+ const r = t[e];
7
+ if (r != null) {
8
+ const c = a(r, "default");
9
+ if (c && o === void 0) {
10
+ const s = r.default;
11
+ o = r.type !== Function && u(s) ? s() : s;
43
12
  }
13
+ r.type === Boolean && (!a(n, e) && !c ? o = !1 : o === "" && (o = !0));
44
14
  }
45
- return value;
15
+ return o;
46
16
  }
47
- function getDataAndAriaProps(props) {
48
- return Object.keys(props).reduce((memo, key) => {
49
- if (key.startsWith("data-") || key.startsWith("aria-")) {
50
- memo[key] = props[key];
51
- }
52
- return memo;
53
- }, {});
17
+ function z(t) {
18
+ return Object.keys(t).reduce((n, e) => ((e.startsWith("data-") || e.startsWith("aria-")) && (n[e] = t[e]), n), {});
54
19
  }
55
- function toPx(val) {
56
- if (typeof val === "number") return `${val}px`;
57
- return val;
20
+ function D(t) {
21
+ return typeof t == "number" ? `${t}px` : t;
58
22
  }
59
- function renderHelper(v, props = {}, defaultV) {
60
- if (typeof v === "function") {
61
- return v(props);
62
- }
63
- return v ?? defaultV;
23
+ function S(t, n = {}, e) {
24
+ return typeof t == "function" ? t(n) : t ?? e;
64
25
  }
65
- function wrapPromiseFn(openFn) {
66
- let closeFn;
67
- const closePromise = new Promise((resolve) => {
68
- closeFn = openFn(() => {
69
- resolve(true);
26
+ function V(t) {
27
+ let n;
28
+ const e = new Promise((r) => {
29
+ n = t(() => {
30
+ r(!0);
70
31
  });
71
- });
72
- const result = () => {
73
- closeFn == null ? void 0 : closeFn();
32
+ }), o = () => {
33
+ n == null || n();
74
34
  };
75
- result.then = (filled, rejected) => closePromise.then(filled, rejected);
76
- result.promise = closePromise;
77
- return result;
35
+ return o.then = (r, c) => e.then(r, c), o.promise = e, o;
78
36
  }
79
37
  export {
80
- cacheStringFunction,
81
- camelize,
82
- capitalize,
83
- controlDefaultValue,
84
- getDataAndAriaProps,
85
- hyphenate,
86
- isArray,
87
- isFunction,
88
- isObject,
89
- isOn,
90
- isString,
91
- isSymbol,
92
- renderHelper,
93
- resolvePropValue,
94
- toPx,
95
- wrapPromiseFn
38
+ i as cacheStringFunction,
39
+ w as camelize,
40
+ g as capitalize,
41
+ y as controlDefaultValue,
42
+ z as getDataAndAriaProps,
43
+ A as hyphenate,
44
+ b as isArray,
45
+ u as isFunction,
46
+ O as isObject,
47
+ P as isOn,
48
+ d as isString,
49
+ m as isSymbol,
50
+ S as renderHelper,
51
+ j as resolvePropValue,
52
+ D as toPx,
53
+ V as wrapPromiseFn
96
54
  };
97
55
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/components/_util/util.ts"],"sourcesContent":["import type { VueNode } from './type'\r\nexport const isFunction = (val) => typeof val === 'function'\r\nexport const controlDefaultValue = Symbol('controlDefaultValue') as any\r\nexport const isArray = Array.isArray\r\nexport const isString = (val) => typeof val === 'string'\r\nexport const isSymbol = (val) => typeof val === 'symbol'\r\nexport const isObject = (val) => val !== null && typeof val === 'object'\r\nconst onRE = /^on[^a-z]/\r\nconst isOn = (key) => onRE.test(key)\r\n\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null)\r\n return (str) => {\r\n const hit = cache[str]\r\n return hit || (cache[str] = fn(str))\r\n }\r\n}\r\nconst camelizeRE = /-(\\w)/g\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\r\n})\r\n\r\nconst hyphenateRE = /\\B([A-Z])/g\r\nconst hyphenate = cacheStringFunction((str) => {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase()\r\n})\r\n\r\nconst capitalize = cacheStringFunction((str) => {\r\n return str.charAt(0).toUpperCase() + str.slice(1)\r\n})\r\n\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key)\r\n\r\n// change from vue sourcecode\r\nfunction resolvePropValue(options, props, key, value) {\r\n const opt = options[key]\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default')\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default\r\n value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue\r\n }\r\n // boolean casting\r\n if (opt.type === Boolean) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false\r\n } else if (value === '') {\r\n value = true\r\n }\r\n }\r\n }\r\n return value\r\n}\r\n\r\nexport function getDataAndAriaProps(props) {\r\n return Object.keys(props).reduce((memo, key) => {\r\n if (key.startsWith('data-') || key.startsWith('aria-')) {\r\n memo[key] = props[key]\r\n }\r\n return memo\r\n }, {})\r\n}\r\n\r\nexport function toPx(val) {\r\n if (typeof val === 'number') return `${val}px`\r\n return val\r\n}\r\n\r\nexport function renderHelper<T = Record<string, any>>(v: VueNode | ((arg0: T) => VueNode), props: T = {} as T, defaultV?: any) {\r\n if (typeof v === 'function') {\r\n return v(props)\r\n }\r\n return v ?? defaultV\r\n}\r\nexport function wrapPromiseFn(openFn: (resolve: VoidFunction) => VoidFunction) {\r\n let closeFn: VoidFunction\r\n\r\n const closePromise = new Promise<boolean>((resolve) => {\r\n closeFn = openFn(() => {\r\n resolve(true)\r\n })\r\n })\r\n\r\n const result: any = () => {\r\n closeFn?.()\r\n }\r\n\r\n result.then = (filled: VoidFunction, rejected: VoidFunction) => closePromise.then(filled, rejected)\r\n result.promise = closePromise\r\n\r\n return result\r\n}\r\n\r\nexport { isOn, cacheStringFunction, camelize, hyphenate, capitalize, resolvePropValue }\r\n"],"names":[],"mappings":"AACO,MAAM,aAAa,CAAC,QAAQ,OAAO,QAAQ;AACrC,MAAA,sBAAsB,OAAO,qBAAqB;AACxD,MAAM,UAAU,MAAM;AACtB,MAAM,WAAW,CAAC,QAAQ,OAAO,QAAQ;AACzC,MAAM,WAAW,CAAC,QAAQ,OAAO,QAAQ;AACzC,MAAM,WAAW,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ;AAChE,MAAM,OAAO;AACb,MAAM,OAAO,CAAC,QAAQ,KAAK,KAAK,GAAG;AAE7B,MAAA,sBAAsB,CAAC,OAAO;AAC5B,QAAA,QAAe,uBAAA,OAAO,IAAI;AAChC,SAAO,CAAC,QAAQ;AACR,UAAA,MAAM,MAAM,GAAG;AACrB,WAAO,QAAQ,MAAM,GAAG,IAAI,GAAG,GAAG;AAAA,EAAA;AAEtC;AACA,MAAM,aAAa;AACb,MAAA,WAAW,oBAAoB,CAAC,QAAQ;AACrC,SAAA,IAAI,QAAQ,YAAY,CAAC,GAAG,MAAO,IAAI,EAAE,YAAY,IAAI,EAAG;AACrE,CAAC;AAED,MAAM,cAAc;AACd,MAAA,YAAY,oBAAoB,CAAC,QAAQ;AAC7C,SAAO,IAAI,QAAQ,aAAa,KAAK,EAAE,YAAY;AACrD,CAAC;AAEK,MAAA,aAAa,oBAAoB,CAAC,QAAQ;AACvC,SAAA,IAAI,OAAO,CAAC,EAAE,gBAAgB,IAAI,MAAM,CAAC;AAClD,CAAC;AAED,MAAM,iBAAiB,OAAO,UAAU;AACxC,MAAM,SAAS,CAAC,KAAK,QAAQ,eAAe,KAAK,KAAK,GAAG;AAGzD,SAAS,iBAAiB,SAAS,OAAO,KAAK,OAAO;AAC9C,QAAA,MAAM,QAAQ,GAAG;AACvB,MAAI,OAAO,MAAM;AACT,UAAA,aAAa,OAAO,KAAK,SAAS;AAEpC,QAAA,cAAc,UAAU,QAAW;AACrC,YAAM,eAAe,IAAI;AACzB,cAAQ,IAAI,SAAS,YAAY,WAAW,YAAY,IAAI,aAAiB,IAAA;AAAA,IAC/E;AAEI,QAAA,IAAI,SAAS,SAAS;AACxB,UAAI,CAAC,OAAO,OAAO,GAAG,KAAK,CAAC,YAAY;AAC9B,gBAAA;AAAA,MAAA,WACC,UAAU,IAAI;AACf,gBAAA;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACO,SAAA;AACT;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,MAAM,QAAQ;AAC9C,QAAI,IAAI,WAAW,OAAO,KAAK,IAAI,WAAW,OAAO,GAAG;AACjD,WAAA,GAAG,IAAI,MAAM,GAAG;AAAA,IACvB;AACO,WAAA;AAAA,EACT,GAAG,CAAE,CAAA;AACP;AAEO,SAAS,KAAK,KAAK;AACxB,MAAI,OAAO,QAAQ,SAAU,QAAO,GAAG,GAAG;AACnC,SAAA;AACT;AAEO,SAAS,aAAsC,GAAqC,QAAW,CAAA,GAAS,UAAgB;AACzH,MAAA,OAAO,MAAM,YAAY;AAC3B,WAAO,EAAE,KAAK;AAAA,EAChB;AACA,SAAO,KAAK;AACd;AACO,SAAS,cAAc,QAAiD;AACzE,MAAA;AAEJ,QAAM,eAAe,IAAI,QAAiB,CAAC,YAAY;AACrD,cAAU,OAAO,MAAM;AACrB,cAAQ,IAAI;AAAA,IAAA,CACb;AAAA,EAAA,CACF;AAED,QAAM,SAAc,MAAM;AACd;AAAA,EAAA;AAGZ,SAAO,OAAO,CAAC,QAAsB,aAA2B,aAAa,KAAK,QAAQ,QAAQ;AAClG,SAAO,UAAU;AAEV,SAAA;AACT;"}
1
+ {"version":3,"file":"util.js","sources":["../../../src/components/_util/util.ts"],"sourcesContent":["import type { VueNode } from './type'\r\nexport const isFunction = (val) => typeof val === 'function'\r\nexport const controlDefaultValue = Symbol('controlDefaultValue') as any\r\nexport const isArray = Array.isArray\r\nexport const isString = (val) => typeof val === 'string'\r\nexport const isSymbol = (val) => typeof val === 'symbol'\r\nexport const isObject = (val) => val !== null && typeof val === 'object'\r\nconst onRE = /^on[^a-z]/\r\nconst isOn = (key) => onRE.test(key)\r\n\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null)\r\n return (str) => {\r\n const hit = cache[str]\r\n return hit || (cache[str] = fn(str))\r\n }\r\n}\r\nconst camelizeRE = /-(\\w)/g\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\r\n})\r\n\r\nconst hyphenateRE = /\\B([A-Z])/g\r\nconst hyphenate = cacheStringFunction((str) => {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase()\r\n})\r\n\r\nconst capitalize = cacheStringFunction((str) => {\r\n return str.charAt(0).toUpperCase() + str.slice(1)\r\n})\r\n\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key)\r\n\r\n// change from vue sourcecode\r\nfunction resolvePropValue(options, props, key, value) {\r\n const opt = options[key]\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default')\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default\r\n value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue\r\n }\r\n // boolean casting\r\n if (opt.type === Boolean) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false\r\n } else if (value === '') {\r\n value = true\r\n }\r\n }\r\n }\r\n return value\r\n}\r\n\r\nexport function getDataAndAriaProps(props) {\r\n return Object.keys(props).reduce((memo, key) => {\r\n if (key.startsWith('data-') || key.startsWith('aria-')) {\r\n memo[key] = props[key]\r\n }\r\n return memo\r\n }, {})\r\n}\r\n\r\nexport function toPx(val) {\r\n if (typeof val === 'number') return `${val}px`\r\n return val\r\n}\r\n\r\nexport function renderHelper<T = Record<string, any>>(v: VueNode | ((arg0: T) => VueNode), props: T = {} as T, defaultV?: any) {\r\n if (typeof v === 'function') {\r\n return v(props)\r\n }\r\n return v ?? defaultV\r\n}\r\nexport function wrapPromiseFn(openFn: (resolve: VoidFunction) => VoidFunction) {\r\n let closeFn: VoidFunction\r\n\r\n const closePromise = new Promise<boolean>((resolve) => {\r\n closeFn = openFn(() => {\r\n resolve(true)\r\n })\r\n })\r\n\r\n const result: any = () => {\r\n closeFn?.()\r\n }\r\n\r\n result.then = (filled: VoidFunction, rejected: VoidFunction) => closePromise.then(filled, rejected)\r\n result.promise = closePromise\r\n\r\n return result\r\n}\r\n\r\nexport { isOn, cacheStringFunction, camelize, hyphenate, capitalize, resolvePropValue }\r\n"],"names":["isFunction","val","controlDefaultValue","isArray","isString","isSymbol","isObject","onRE","isOn","key","cacheStringFunction","fn","cache","str","camelizeRE","camelize","_","c","hyphenateRE","hyphenate","capitalize","hasOwnProperty","hasOwn","resolvePropValue","options","props","value","opt","hasDefault","defaultValue","getDataAndAriaProps","memo","toPx","renderHelper","v","defaultV","wrapPromiseFn","openFn","closeFn","closePromise","resolve","result","filled","rejected"],"mappings":"AACO,MAAMA,IAAa,CAACC,MAAQ,OAAOA,KAAQ,YACrCC,IAAsB,OAAO,qBAAqB,GAClDC,IAAU,MAAM,SAChBC,IAAW,CAACH,MAAQ,OAAOA,KAAQ,UACnCI,IAAW,CAACJ,MAAQ,OAAOA,KAAQ,UACnCK,IAAW,CAACL,MAAQA,MAAQ,QAAQ,OAAOA,KAAQ,UAC1DM,IAAO,aACPC,IAAO,CAACC,MAAQF,EAAK,KAAKE,CAAG,GAE7BC,IAAsB,CAACC,MAAO;AAC5B,QAAAC,IAAe,uBAAA,OAAO,IAAI;AAChC,SAAO,CAACC,MACMD,EAAMC,CAAG,MACND,EAAMC,CAAG,IAAIF,EAAGE,CAAG;AAEtC,GACMC,IAAa,UACbC,IAAWL,EAAoB,CAACG,MAC7BA,EAAI,QAAQC,GAAY,CAACE,GAAGC,MAAOA,IAAIA,EAAE,YAAY,IAAI,EAAG,CACpE,GAEKC,IAAc,cACdC,IAAYT,EAAoB,CAACG,MAC9BA,EAAI,QAAQK,GAAa,KAAK,EAAE,YAAY,CACpD,GAEKE,IAAaV,EAAoB,CAACG,MAC/BA,EAAI,OAAO,CAAC,EAAE,gBAAgBA,EAAI,MAAM,CAAC,CACjD,GAEKQ,IAAiB,OAAO,UAAU,gBAClCC,IAAS,CAACrB,GAAKQ,MAAQY,EAAe,KAAKpB,GAAKQ,CAAG;AAGzD,SAASc,EAAiBC,GAASC,GAAOhB,GAAKiB,GAAO;AAC9C,QAAAC,IAAMH,EAAQf,CAAG;AACvB,MAAIkB,KAAO,MAAM;AACT,UAAAC,IAAaN,EAAOK,GAAK,SAAS;AAEpC,QAAAC,KAAcF,MAAU,QAAW;AACrC,YAAMG,IAAeF,EAAI;AACzB,MAAAD,IAAQC,EAAI,SAAS,YAAY3B,EAAW6B,CAAY,IAAIA,EAAiB,IAAAA;AAAA,IAC/E;AAEI,IAAAF,EAAI,SAAS,YACX,CAACL,EAAOG,GAAOhB,CAAG,KAAK,CAACmB,IAClBF,IAAA,KACCA,MAAU,OACXA,IAAA;AAAA,EAGd;AACO,SAAAA;AACT;AAEO,SAASI,EAAoBL,GAAO;AACzC,SAAO,OAAO,KAAKA,CAAK,EAAE,OAAO,CAACM,GAAMtB,QAClCA,EAAI,WAAW,OAAO,KAAKA,EAAI,WAAW,OAAO,OAC9CsB,EAAAtB,CAAG,IAAIgB,EAAMhB,CAAG,IAEhBsB,IACN,CAAE,CAAA;AACP;AAEO,SAASC,EAAK/B,GAAK;AACxB,SAAI,OAAOA,KAAQ,WAAiB,GAAGA,CAAG,OACnCA;AACT;AAEO,SAASgC,EAAsCC,GAAqCT,IAAW,CAAA,GAASU,GAAgB;AACzH,SAAA,OAAOD,KAAM,aACRA,EAAET,CAAK,IAETS,KAAKC;AACd;AACO,SAASC,EAAcC,GAAiD;AACzE,MAAAC;AAEJ,QAAMC,IAAe,IAAI,QAAiB,CAACC,MAAY;AACrD,IAAAF,IAAUD,EAAO,MAAM;AACrB,MAAAG,EAAQ,EAAI;AAAA,IAAA,CACb;AAAA,EAAA,CACF,GAEKC,IAAc,MAAM;AACd,IAAAH,KAAA,QAAAA;AAAA,EAAA;AAGZ,SAAAG,EAAO,OAAO,CAACC,GAAsBC,MAA2BJ,EAAa,KAAKG,GAAQC,CAAQ,GAClGF,EAAO,UAAUF,GAEVE;AACT;"}
@@ -1,33 +1,21 @@
1
- import { i as isClient } from "../../../index-D1m0KTpK.js";
2
- const globalNodes = [];
3
- let target = !isClient ? void 0 : document.body;
4
- function createGlobalNode(id) {
5
- const el = document.createElement("div");
6
- if (id !== void 0) {
7
- el.setAttribute("id", id);
8
- }
9
- if (target) {
10
- target.appendChild(el);
11
- globalNodes.push(el);
12
- }
13
- return el;
1
+ import { i as n } from "../../../index-C9tCD90X.js";
2
+ const i = [];
3
+ let t = n ? document.body : void 0;
4
+ function r(e) {
5
+ const o = document.createElement("div");
6
+ return e !== void 0 && o.setAttribute("id", e), t && (t.appendChild(o), i.push(o)), o;
14
7
  }
15
- function removeGlobalNode(el) {
16
- globalNodes.splice(globalNodes.indexOf(el), 1);
17
- el.remove();
8
+ function a(e) {
9
+ i.splice(i.indexOf(e), 1), e.remove();
18
10
  }
19
- function changeGlobalNodesTarget(el) {
20
- if (el === target) return;
21
- target = el;
22
- globalNodes.forEach((el2) => {
23
- if (target && !el2.contains(target)) {
24
- target.appendChild(el2);
25
- }
26
- });
11
+ function c(e) {
12
+ e !== t && (t = e, i.forEach((o) => {
13
+ t && !o.contains(t) && t.appendChild(o);
14
+ }));
27
15
  }
28
16
  export {
29
- changeGlobalNodesTarget,
30
- createGlobalNode,
31
- removeGlobalNode
17
+ c as changeGlobalNodesTarget,
18
+ r as createGlobalNode,
19
+ a as removeGlobalNode
32
20
  };
33
21
  //# sourceMappingURL=global-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nconst globalNodes: HTMLElement[] = []\r\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\r\n\r\nexport function createGlobalNode(id?: string) {\r\n const el = document.createElement('div')\r\n if (id !== undefined) {\r\n el.setAttribute('id', id)\r\n }\r\n\r\n if (target) {\r\n target.appendChild(el)\r\n globalNodes.push(el)\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function removeGlobalNode(el: HTMLElement) {\r\n globalNodes.splice(globalNodes.indexOf(el), 1)\r\n el.remove()\r\n}\r\n\r\nexport function changeGlobalNodesTarget(el: HTMLElement) {\r\n if (el === target) return\r\n\r\n target = el\r\n globalNodes.forEach((el) => {\r\n if (target && !el.contains(target)) {\r\n target.appendChild(el)\r\n }\r\n })\r\n}\r\n"],"names":["el"],"mappings":";AAEA,MAAM,cAA6B,CAAA;AACnC,IAAI,SAAkC,CAAC,WAAW,SAAY,SAAS;AAEhE,SAAS,iBAAiB,IAAa;AACtC,QAAA,KAAK,SAAS,cAAc,KAAK;AACvC,MAAI,OAAO,QAAW;AACjB,OAAA,aAAa,MAAM,EAAE;AAAA,EAC1B;AAEA,MAAI,QAAQ;AACV,WAAO,YAAY,EAAE;AACrB,gBAAY,KAAK,EAAE;AAAA,EACrB;AAEO,SAAA;AACT;AAEO,SAAS,iBAAiB,IAAiB;AAChD,cAAY,OAAO,YAAY,QAAQ,EAAE,GAAG,CAAC;AAC7C,KAAG,OAAO;AACZ;AAEO,SAAS,wBAAwB,IAAiB;AACvD,MAAI,OAAO,OAAQ;AAEV,WAAA;AACG,cAAA,QAAQ,CAACA,QAAO;AAC1B,QAAI,UAAU,CAACA,IAAG,SAAS,MAAM,GAAG;AAClC,aAAO,YAAYA,GAAE;AAAA,IACvB;AAAA,EAAA,CACD;AACH;"}
1
+ {"version":3,"file":"global-node.js","sources":["../../../../src/components/_util/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nconst globalNodes: HTMLElement[] = []\r\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\r\n\r\nexport function createGlobalNode(id?: string) {\r\n const el = document.createElement('div')\r\n if (id !== undefined) {\r\n el.setAttribute('id', id)\r\n }\r\n\r\n if (target) {\r\n target.appendChild(el)\r\n globalNodes.push(el)\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function removeGlobalNode(el: HTMLElement) {\r\n globalNodes.splice(globalNodes.indexOf(el), 1)\r\n el.remove()\r\n}\r\n\r\nexport function changeGlobalNodesTarget(el: HTMLElement) {\r\n if (el === target) return\r\n\r\n target = el\r\n globalNodes.forEach((el) => {\r\n if (target && !el.contains(target)) {\r\n target.appendChild(el)\r\n }\r\n })\r\n}\r\n"],"names":["globalNodes","target","isClient","createGlobalNode","id","el","removeGlobalNode","changeGlobalNodesTarget"],"mappings":";AAEA,MAAMA,IAA6B,CAAA;AACnC,IAAIC,IAAmCC,IAAuB,SAAS,OAArB;AAE3C,SAASC,EAAiBC,GAAa;AACtC,QAAAC,IAAK,SAAS,cAAc,KAAK;AACvC,SAAID,MAAO,UACNC,EAAA,aAAa,MAAMD,CAAE,GAGtBH,MACFA,EAAO,YAAYI,CAAE,GACrBL,EAAY,KAAKK,CAAE,IAGdA;AACT;AAEO,SAASC,EAAiBD,GAAiB;AAChD,EAAAL,EAAY,OAAOA,EAAY,QAAQK,CAAE,GAAG,CAAC,GAC7CA,EAAG,OAAO;AACZ;AAEO,SAASE,EAAwBF,GAAiB;AACvD,EAAIA,MAAOJ,MAEFA,IAAAI,GACGL,EAAA,QAAQ,CAACK,MAAO;AAC1B,IAAIJ,KAAU,CAACI,EAAG,SAASJ,CAAM,KAC/BA,EAAO,YAAYI,CAAE;AAAA,EACvB,CACD;AACH;"}
@@ -1,36 +1,32 @@
1
- import { c as close_default, s as success_filled_default, i as info_filled_default, w as warning_filled_default, a as circle_close_filled_default, l as loading_default, b as circle_check_default, d as circle_close_default } from "../../../index-DkwIULcN.js";
2
- import { definePropType } from "./props/runtime.js";
3
- const iconPropType = definePropType([
1
+ import { c as e, s as l, i as s, w as o, a as c, l as n, b as i, d as a } from "../../../index-ChkLOmNK.js";
2
+ import { definePropType as t } from "./props/runtime.js";
3
+ const f = t([
4
4
  String,
5
5
  Object,
6
6
  Function
7
- ]);
8
- const CloseComponents = {
9
- Close: close_default
10
- };
11
- const TypeComponents = {
12
- Close: close_default,
13
- SuccessFilled: success_filled_default,
14
- InfoFilled: info_filled_default,
15
- WarningFilled: warning_filled_default,
16
- CircleCloseFilled: circle_close_filled_default
17
- };
18
- const TypeComponentsMap = {
19
- success: success_filled_default,
20
- warning: warning_filled_default,
21
- error: circle_close_filled_default,
22
- info: info_filled_default
23
- };
24
- const ValidateComponentsMap = {
25
- validating: loading_default,
26
- success: circle_check_default,
27
- error: circle_close_default
7
+ ]), p = {
8
+ Close: e
9
+ }, _ = {
10
+ Close: e,
11
+ SuccessFilled: l,
12
+ InfoFilled: s,
13
+ WarningFilled: o,
14
+ CircleCloseFilled: c
15
+ }, u = {
16
+ success: l,
17
+ warning: o,
18
+ error: c,
19
+ info: s
20
+ }, C = {
21
+ validating: n,
22
+ success: i,
23
+ error: a
28
24
  };
29
25
  export {
30
- CloseComponents,
31
- TypeComponents,
32
- TypeComponentsMap,
33
- ValidateComponentsMap,
34
- iconPropType
26
+ p as CloseComponents,
27
+ _ as TypeComponents,
28
+ u as TypeComponentsMap,
29
+ C as ValidateComponentsMap,
30
+ f as iconPropType
35
31
  };
36
32
  //# sourceMappingURL=icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\r\n CircleCheck,\r\n CircleClose,\r\n CircleCloseFilled,\r\n Close,\r\n InfoFilled,\r\n Loading,\r\n SuccessFilled,\r\n WarningFilled,\r\n} from '@element-plus/icons-vue'\r\nimport { definePropType } from './props'\r\n\r\nimport type { Component } from 'vue'\r\n\r\nexport const iconPropType = definePropType<string | Component>([\r\n String,\r\n Object,\r\n Function,\r\n])\r\n\r\nexport const CloseComponents = {\r\n Close,\r\n}\r\n\r\nexport const TypeComponents = {\r\n Close,\r\n SuccessFilled,\r\n InfoFilled,\r\n WarningFilled,\r\n CircleCloseFilled,\r\n}\r\n\r\nexport const TypeComponentsMap = {\r\n success: SuccessFilled,\r\n warning: WarningFilled,\r\n error: CircleCloseFilled,\r\n info: InfoFilled,\r\n}\r\n\r\nexport const ValidateComponentsMap = {\r\n validating: Loading,\r\n success: CircleCheck,\r\n error: CircleClose,\r\n}\r\n"],"names":["Close","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","Loading","CircleCheck","CircleClose"],"mappings":";;AAcO,MAAM,eAAe,eAAmC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,MAAM,kBAAkB;AAAA,EAAA,OAC7BA;AACF;AAEO,MAAM,iBAAiB;AAAA,EAAA,OAC5BA;AAAAA,EAAA,eACAC;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,mBACAC;AACF;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAASH;AAAAA,EACT,SAASE;AAAAA,EACT,OAAOC;AAAAA,EACP,MAAMF;AACR;AAEO,MAAM,wBAAwB;AAAA,EACnC,YAAYG;AAAAA,EACZ,SAASC;AAAAA,EACT,OAAOC;AACT;"}
1
+ {"version":3,"file":"icon.js","sources":["../../../../src/components/_util/vue/icon.ts"],"sourcesContent":["import {\r\n CircleCheck,\r\n CircleClose,\r\n CircleCloseFilled,\r\n Close,\r\n InfoFilled,\r\n Loading,\r\n SuccessFilled,\r\n WarningFilled,\r\n} from '@element-plus/icons-vue'\r\nimport { definePropType } from './props'\r\n\r\nimport type { Component } from 'vue'\r\n\r\nexport const iconPropType = definePropType<string | Component>([\r\n String,\r\n Object,\r\n Function,\r\n])\r\n\r\nexport const CloseComponents = {\r\n Close,\r\n}\r\n\r\nexport const TypeComponents = {\r\n Close,\r\n SuccessFilled,\r\n InfoFilled,\r\n WarningFilled,\r\n CircleCloseFilled,\r\n}\r\n\r\nexport const TypeComponentsMap = {\r\n success: SuccessFilled,\r\n warning: WarningFilled,\r\n error: CircleCloseFilled,\r\n info: InfoFilled,\r\n}\r\n\r\nexport const ValidateComponentsMap = {\r\n validating: Loading,\r\n success: CircleCheck,\r\n error: CircleClose,\r\n}\r\n"],"names":["iconPropType","definePropType","CloseComponents","Close","TypeComponents","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","TypeComponentsMap","ValidateComponentsMap","Loading","CircleCheck","CircleClose"],"mappings":";;AAcO,MAAMA,IAAeC,EAAmC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEYC,IAAkB;AAAA,EAAA,OAC7BC;AACF,GAEaC,IAAiB;AAAA,EAAA,OAC5BD;AAAAA,EAAA,eACAE;AAAAA,EAAA,YACAC;AAAAA,EAAA,eACAC;AAAAA,EAAA,mBACAC;AACF,GAEaC,IAAoB;AAAA,EAC/B,SAASJ;AAAAA,EACT,SAASE;AAAAA,EACT,OAAOC;AAAAA,EACP,MAAMF;AACR,GAEaI,IAAwB;AAAA,EACnC,YAAYC;AAAAA,EACZ,SAASC;AAAAA,EACT,OAAOC;AACT;"}
@@ -1,44 +1,44 @@
1
- import { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode } from "./global-node.js";
2
- import { CloseComponents, TypeComponents, TypeComponentsMap, ValidateComponentsMap, iconPropType } from "./icon.js";
3
- import { withInstall, withInstallDirective, withInstallFunction, withNoopInstall } from "./install.js";
4
- import { buildProp, buildProps, definePropType, epPropKey, isEpProp } from "./props/runtime.js";
5
- import { composeRefs } from "./refs.js";
6
- import { getComponentSize } from "./size.js";
7
- import { isValidComponentSize, isValidDatePickType } from "./validator.js";
8
- import { PatchFlags, ensureOnlyChild, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf } from "./vnode.js";
1
+ import { changeGlobalNodesTarget as t, createGlobalNode as r, removeGlobalNode as p } from "./global-node.js";
2
+ import { CloseComponents as l, TypeComponents as n, TypeComponentsMap as a, ValidateComponentsMap as s, iconPropType as m } from "./icon.js";
3
+ import { withInstall as f, withInstallDirective as C, withInstallFunction as c, withNoopInstall as x } from "./install.js";
4
+ import { buildProp as h, buildProps as T, definePropType as g, epPropKey as y, isEpProp as N } from "./props/runtime.js";
5
+ import { composeRefs as I } from "./refs.js";
6
+ import { getComponentSize as u } from "./size.js";
7
+ import { isValidComponentSize as F, isValidDatePickType as z } from "./validator.js";
8
+ import { PatchFlags as k, ensureOnlyChild as v, flattedChildren as D, getFirstValidNode as E, getNormalizedProps as M, isComment as S, isFragment as B, isTemplate as K, isText as O, isValidElementNode as R, renderBlock as j, renderIf as q } from "./vnode.js";
9
9
  export {
10
- CloseComponents,
11
- PatchFlags,
12
- TypeComponents,
13
- TypeComponentsMap,
14
- ValidateComponentsMap,
15
- buildProp,
16
- buildProps,
17
- changeGlobalNodesTarget,
18
- composeRefs,
19
- createGlobalNode,
20
- definePropType,
21
- ensureOnlyChild,
22
- epPropKey,
23
- flattedChildren,
24
- getComponentSize,
25
- getFirstValidNode,
26
- getNormalizedProps,
27
- iconPropType,
28
- isComment,
29
- isEpProp,
30
- isFragment,
31
- isTemplate,
32
- isText,
33
- isValidComponentSize,
34
- isValidDatePickType,
35
- isValidElementNode,
36
- removeGlobalNode,
37
- renderBlock,
38
- renderIf,
39
- withInstall,
40
- withInstallDirective,
41
- withInstallFunction,
42
- withNoopInstall
10
+ l as CloseComponents,
11
+ k as PatchFlags,
12
+ n as TypeComponents,
13
+ a as TypeComponentsMap,
14
+ s as ValidateComponentsMap,
15
+ h as buildProp,
16
+ T as buildProps,
17
+ t as changeGlobalNodesTarget,
18
+ I as composeRefs,
19
+ r as createGlobalNode,
20
+ g as definePropType,
21
+ v as ensureOnlyChild,
22
+ y as epPropKey,
23
+ D as flattedChildren,
24
+ u as getComponentSize,
25
+ E as getFirstValidNode,
26
+ M as getNormalizedProps,
27
+ m as iconPropType,
28
+ S as isComment,
29
+ N as isEpProp,
30
+ B as isFragment,
31
+ K as isTemplate,
32
+ O as isText,
33
+ F as isValidComponentSize,
34
+ z as isValidDatePickType,
35
+ R as isValidElementNode,
36
+ p as removeGlobalNode,
37
+ j as renderBlock,
38
+ q as renderIf,
39
+ f as withInstall,
40
+ C as withInstallDirective,
41
+ c as withInstallFunction,
42
+ x as withNoopInstall
43
43
  };
44
44
  //# sourceMappingURL=index.js.map
@@ -1,38 +1,21 @@
1
- import { N as NOOP } from "../../../functions-BeMkokbY.js";
2
- const withInstall = (main, extra) => {
3
- main.install = (app) => {
4
- for (const comp of [main, ...Object.values(extra ?? {})]) {
5
- app.component(comp.name, comp);
6
- }
7
- };
8
- if (extra) {
9
- for (const [key, comp] of Object.entries(extra)) {
10
- main[key] = comp;
11
- }
12
- }
13
- return main;
14
- };
15
- const withInstallFunction = (fn, name) => {
16
- fn.install = (app) => {
17
- fn._context = app._context;
18
- app.config.globalProperties[name] = fn;
19
- };
20
- return fn;
21
- };
22
- const withInstallDirective = (directive, name) => {
23
- directive.install = (app) => {
24
- app.directive(name, directive);
25
- };
26
- return directive;
27
- };
28
- const withNoopInstall = (component) => {
29
- component.install = NOOP;
30
- return component;
31
- };
1
+ import { N as s } from "../../../functions-DzLqXvGt.js";
2
+ const e = (t, l) => {
3
+ if (t.install = (o) => {
4
+ for (const n of [t, ...Object.values(l ?? {})])
5
+ o.component(n.name, n);
6
+ }, l)
7
+ for (const [o, n] of Object.entries(l))
8
+ t[o] = n;
9
+ return t;
10
+ }, r = (t, l) => (t.install = (o) => {
11
+ t._context = o._context, o.config.globalProperties[l] = t;
12
+ }, t), i = (t, l) => (t.install = (o) => {
13
+ o.directive(l, t);
14
+ }, t), a = (t) => (t.install = s, t);
32
15
  export {
33
- withInstall,
34
- withInstallDirective,
35
- withInstallFunction,
36
- withNoopInstall
16
+ e as withInstall,
17
+ i as withInstallDirective,
18
+ r as withInstallFunction,
19
+ a as withNoopInstall
37
20
  };
38
21
  //# sourceMappingURL=install.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\r\n\r\nimport type { App, Directive } from 'vue'\r\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\r\n\r\nexport const withInstall = <T, E extends Record<string, any>>(\r\n main: T,\r\n extra?: E\r\n) => {\r\n ;(main as SFCWithInstall<T>).install = (app): void => {\r\n for (const comp of [main, ...Object.values(extra ?? {})]) {\r\n app.component(comp.name, comp)\r\n }\r\n }\r\n\r\n if (extra) {\r\n for (const [key, comp] of Object.entries(extra)) {\r\n ;(main as any)[key] = comp\r\n }\r\n }\r\n return main as SFCWithInstall<T> & E\r\n}\r\n\r\nexport const withInstallFunction = <T>(fn: T, name: string) => {\r\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\r\n ;(fn as SFCInstallWithContext<T>)._context = app._context\r\n app.config.globalProperties[name] = fn\r\n }\r\n\r\n return fn as SFCInstallWithContext<T>\r\n}\r\n\r\nexport const withInstallDirective = <T extends Directive>(\r\n directive: T,\r\n name: string\r\n) => {\r\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\r\n app.directive(name, directive)\r\n }\r\n\r\n return directive as SFCWithInstall<T>\r\n}\r\n\r\nexport const withNoopInstall = <T>(component: T) => {\r\n ;(component as SFCWithInstall<T>).install = NOOP\r\n\r\n return component as SFCWithInstall<T>\r\n}\r\n"],"names":[],"mappings":";AAKa,MAAA,cAAc,CACzB,MACA,UACG;AACD,OAA2B,UAAU,CAAC,QAAc;AACzC,eAAA,QAAQ,CAAC,MAAM,GAAG,OAAO,OAAO,SAAS,CAAE,CAAA,CAAC,GAAG;AACpD,UAAA,UAAU,KAAK,MAAM,IAAI;AAAA,IAC/B;AAAA,EAAA;AAGF,MAAI,OAAO;AACT,eAAW,CAAC,KAAK,IAAI,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC7C,WAAa,GAAG,IAAI;AAAA,IACxB;AAAA,EACF;AACO,SAAA;AACT;AAEa,MAAA,sBAAsB,CAAI,IAAO,SAAiB;AAC3D,KAAyB,UAAU,CAAC,QAAa;AAC/C,OAAgC,WAAW,IAAI;AAC7C,QAAA,OAAO,iBAAiB,IAAI,IAAI;AAAA,EAAA;AAG/B,SAAA;AACT;AAEa,MAAA,uBAAuB,CAClC,WACA,SACG;AACD,YAAgC,UAAU,CAAC,QAAmB;AAC1D,QAAA,UAAU,MAAM,SAAS;AAAA,EAAA;AAGxB,SAAA;AACT;AAEa,MAAA,kBAAkB,CAAI,cAAiB;AAChD,YAAgC,UAAU;AAErC,SAAA;AACT;"}
1
+ {"version":3,"file":"install.js","sources":["../../../../src/components/_util/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\r\n\r\nimport type { App, Directive } from 'vue'\r\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\r\n\r\nexport const withInstall = <T, E extends Record<string, any>>(\r\n main: T,\r\n extra?: E\r\n) => {\r\n ;(main as SFCWithInstall<T>).install = (app): void => {\r\n for (const comp of [main, ...Object.values(extra ?? {})]) {\r\n app.component(comp.name, comp)\r\n }\r\n }\r\n\r\n if (extra) {\r\n for (const [key, comp] of Object.entries(extra)) {\r\n ;(main as any)[key] = comp\r\n }\r\n }\r\n return main as SFCWithInstall<T> & E\r\n}\r\n\r\nexport const withInstallFunction = <T>(fn: T, name: string) => {\r\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\r\n ;(fn as SFCInstallWithContext<T>)._context = app._context\r\n app.config.globalProperties[name] = fn\r\n }\r\n\r\n return fn as SFCInstallWithContext<T>\r\n}\r\n\r\nexport const withInstallDirective = <T extends Directive>(\r\n directive: T,\r\n name: string\r\n) => {\r\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\r\n app.directive(name, directive)\r\n }\r\n\r\n return directive as SFCWithInstall<T>\r\n}\r\n\r\nexport const withNoopInstall = <T>(component: T) => {\r\n ;(component as SFCWithInstall<T>).install = NOOP\r\n\r\n return component as SFCWithInstall<T>\r\n}\r\n"],"names":["withInstall","main","extra","app","comp","key","withInstallFunction","fn","name","withInstallDirective","directive","withNoopInstall","component","NOOP"],"mappings":";AAKa,MAAAA,IAAc,CACzBC,GACAC,MACG;AAOH,MANED,EAA2B,UAAU,CAACE,MAAc;AACzC,eAAAC,KAAQ,CAACH,GAAM,GAAG,OAAO,OAAOC,KAAS,CAAE,CAAA,CAAC;AACjD,MAAAC,EAAA,UAAUC,EAAK,MAAMA,CAAI;AAAA,EAC/B,GAGEF;AACF,eAAW,CAACG,GAAKD,CAAI,KAAK,OAAO,QAAQF,CAAK;AAC1C,MAAAD,EAAaI,CAAG,IAAID;AAGnB,SAAAH;AACT,GAEaK,IAAsB,CAAIC,GAAOC,OAC1CD,EAAyB,UAAU,CAACJ,MAAa;AAC/C,EAAAI,EAAgC,WAAWJ,EAAI,UAC7CA,EAAA,OAAO,iBAAiBK,CAAI,IAAID;AAAA,GAG/BA,IAGIE,IAAuB,CAClCC,GACAF,OAEEE,EAAgC,UAAU,CAACP,MAAmB;AAC1D,EAAAA,EAAA,UAAUK,GAAME,CAAS;AAAA,GAGxBA,IAGIC,IAAkB,CAAIC,OAC/BA,EAAgC,UAAUC,GAErCD;"}
@@ -1,9 +1,9 @@
1
- import { buildProp, buildProps, definePropType, epPropKey, isEpProp } from "./runtime.js";
1
+ import { buildProp as r, buildProps as e, definePropType as P, epPropKey as i, isEpProp as d } from "./runtime.js";
2
2
  export {
3
- buildProp,
4
- buildProps,
5
- definePropType,
6
- epPropKey,
7
- isEpProp
3
+ r as buildProp,
4
+ e as buildProps,
5
+ P as definePropType,
6
+ i as epPropKey,
7
+ d as isEpProp
8
8
  };
9
9
  //# sourceMappingURL=index.js.map
@@ -1,53 +1,37 @@
1
- import { warn } from "vue";
2
- import { fromPairs } from "lodash-es";
3
- import { d as isObject, h as hasOwn } from "../../../../functions-BeMkokbY.js";
4
- const epPropKey = "__epPropKey";
5
- const definePropType = (val) => val;
6
- const isEpProp = (val) => isObject(val) && !!val[epPropKey];
7
- const buildProp = (prop, key) => {
8
- if (!isObject(prop) || isEpProp(prop)) return prop;
9
- const { values, required, default: defaultValue, type, validator } = prop;
10
- const _validator = values || validator ? (val) => {
11
- let valid = false;
12
- let allowedValues = [];
13
- if (values) {
14
- allowedValues = Array.from(values);
15
- if (hasOwn(prop, "default")) {
16
- allowedValues.push(defaultValue);
1
+ import { warn as v } from "vue";
2
+ import { fromPairs as w } from "lodash-es";
3
+ import { d as f, h as d } from "../../../../functions-DzLqXvGt.js";
4
+ const u = "__epPropKey", $ = (e) => e, y = (e) => f(e) && !!e[u], O = (e, t) => {
5
+ if (!f(e) || y(e)) return e;
6
+ const { values: r, required: p, default: n, type: c, validator: a } = e, s = {
7
+ type: c,
8
+ required: !!p,
9
+ validator: r || a ? (l) => {
10
+ let i = !1, o = [];
11
+ if (r && (o = Array.from(r), d(e, "default") && o.push(n), i || (i = o.includes(l))), a && (i || (i = a(l))), !i && o.length > 0) {
12
+ const m = [...new Set(o)].map((P) => JSON.stringify(P)).join(", ");
13
+ v(
14
+ `Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${m}], got value ${JSON.stringify(
15
+ l
16
+ )}.`
17
+ );
17
18
  }
18
- valid || (valid = allowedValues.includes(val));
19
- }
20
- if (validator) valid || (valid = validator(val));
21
- if (!valid && allowedValues.length > 0) {
22
- const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
23
- warn(
24
- `Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
25
- val
26
- )}.`
27
- );
28
- }
29
- return valid;
30
- } : void 0;
31
- const epProp = {
32
- type,
33
- required: !!required,
34
- validator: _validator,
35
- [epPropKey]: true
19
+ return i;
20
+ } : void 0,
21
+ [u]: !0
36
22
  };
37
- if (hasOwn(prop, "default")) epProp.default = defaultValue;
38
- return epProp;
39
- };
40
- const buildProps = (props) => fromPairs(
41
- Object.entries(props).map(([key, option]) => [
42
- key,
43
- buildProp(option, key)
23
+ return d(e, "default") && (s.default = n), s;
24
+ }, j = (e) => w(
25
+ Object.entries(e).map(([t, r]) => [
26
+ t,
27
+ O(r, t)
44
28
  ])
45
29
  );
46
30
  export {
47
- buildProp,
48
- buildProps,
49
- definePropType,
50
- epPropKey,
51
- isEpProp
31
+ O as buildProp,
32
+ j as buildProps,
33
+ $ as definePropType,
34
+ u as epPropKey,
35
+ y as isEpProp
52
36
  };
53
37
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\r\nimport { fromPairs } from 'lodash-unified'\r\nimport { isObject } from '../../types'\r\nimport { hasOwn } from '../../objects'\r\n\r\nimport type { PropType } from 'vue'\r\nimport type {\r\n EpProp,\r\n EpPropConvert,\r\n EpPropFinalized,\r\n EpPropInput,\r\n EpPropMergeType,\r\n IfEpProp,\r\n IfNativePropType,\r\n NativePropType,\r\n} from './types'\r\n\r\nexport const epPropKey = '__epPropKey'\r\n\r\nexport const definePropType = <T>(val: any): PropType<T> => val\r\n\r\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\r\n isObject(val) && !!(val as any)[epPropKey]\r\n\r\n/**\r\n * @description Build prop. It can better optimize prop types\r\n * @description 生成 prop,能更好地优化类型\r\n * @example\r\n // limited options\r\n // the type will be PropType<'light' | 'dark'>\r\n buildProp({\r\n type: String,\r\n values: ['light', 'dark'],\r\n } as const)\r\n * @example\r\n // limited options and other types\r\n // the type will be PropType<'small' | 'large' | number>\r\n buildProp({\r\n type: [String, Number],\r\n values: ['small', 'large'],\r\n validator: (val: unknown): val is number => typeof val === 'number',\r\n } as const)\r\n @link see more: https://github.com/element-plus/element-plus/pull/3341\r\n */\r\nexport const buildProp = <\r\n Type = never,\r\n Value = never,\r\n Validator = never,\r\n Default extends EpPropMergeType<Type, Value, Validator> = never,\r\n Required extends boolean = false\r\n>(\r\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\r\n key?: string\r\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\r\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\r\n if (!isObject(prop) || isEpProp(prop)) return prop as any\r\n\r\n const { values, required, default: defaultValue, type, validator } = prop\r\n\r\n const _validator =\r\n values || validator\r\n ? (val: unknown) => {\r\n let valid = false\r\n let allowedValues: unknown[] = []\r\n\r\n if (values) {\r\n allowedValues = Array.from(values)\r\n if (hasOwn(prop, 'default')) {\r\n allowedValues.push(defaultValue)\r\n }\r\n valid ||= allowedValues.includes(val)\r\n }\r\n if (validator) valid ||= validator(val)\r\n\r\n if (!valid && allowedValues.length > 0) {\r\n const allowValuesText = [...new Set(allowedValues)]\r\n .map((value) => JSON.stringify(value))\r\n .join(', ')\r\n warn(\r\n `Invalid prop: validation failed${\r\n key ? ` for prop \"${key}\"` : ''\r\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\r\n val\r\n )}.`\r\n )\r\n }\r\n return valid\r\n }\r\n : undefined\r\n\r\n const epProp: any = {\r\n type,\r\n required: !!required,\r\n validator: _validator,\r\n [epPropKey]: true,\r\n }\r\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\r\n return epProp\r\n}\r\n\r\nexport const buildProps = <\r\n Props extends Record<\r\n string,\r\n | { [epPropKey]: true }\r\n | NativePropType\r\n | EpPropInput<any, any, any, any, any>\r\n >\r\n>(\r\n props: Props\r\n): {\r\n [K in keyof Props]: IfEpProp<\r\n Props[K],\r\n Props[K],\r\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\r\n >\r\n} =>\r\n fromPairs(\r\n Object.entries(props).map(([key, option]) => [\r\n key,\r\n buildProp(option as any, key),\r\n ])\r\n ) as any\r\n"],"names":[],"mappings":";;;AAiBO,MAAM,YAAY;AAEZ,MAAA,iBAAiB,CAAI,QAA0B;AAE/C,MAAA,WAAW,CAAC,QACvB,SAAS,GAAG,KAAK,CAAC,CAAE,IAAY,SAAS;AAsB9B,MAAA,YAAY,CAOvB,MACA,QAC+D;AAE/D,MAAI,CAAC,SAAS,IAAI,KAAK,SAAS,IAAI,EAAU,QAAA;AAE9C,QAAM,EAAE,QAAQ,UAAU,SAAS,cAAc,MAAM,UAAc,IAAA;AAErE,QAAM,aACJ,UAAU,YACN,CAAC,QAAiB;AAChB,QAAI,QAAQ;AACZ,QAAI,gBAA2B,CAAA;AAE/B,QAAI,QAAQ;AACM,sBAAA,MAAM,KAAK,MAAM;AAC7B,UAAA,OAAO,MAAM,SAAS,GAAG;AAC3B,sBAAc,KAAK,YAAY;AAAA,MACjC;AACU,wBAAA,cAAc,SAAS,GAAG;AAAA,IACtC;AACI,QAAA,UAAqB,mBAAA,UAAU,GAAG;AAEtC,QAAI,CAAC,SAAS,cAAc,SAAS,GAAG;AACtC,YAAM,kBAAkB,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC,EAC/C,IAAI,CAAC,UAAU,KAAK,UAAU,KAAK,CAAC,EACpC,KAAK,IAAI;AACZ;AAAA,QACE,kCACE,MAAM,cAAc,GAAG,MAAM,EAC/B,sBAAsB,eAAe,gBAAgB,KAAK;AAAA,UACxD;AAAA,QACD,CAAA;AAAA,MAAA;AAAA,IAEL;AACO,WAAA;AAAA,EAET,IAAA;AAEN,QAAM,SAAc;AAAA,IAClB;AAAA,IACA,UAAU,CAAC,CAAC;AAAA,IACZ,WAAW;AAAA,IACX,CAAC,SAAS,GAAG;AAAA,EAAA;AAEf,MAAI,OAAO,MAAM,SAAS,UAAU,UAAU;AACvC,SAAA;AACT;AAEa,MAAA,aAAa,CAQxB,UAQA;AAAA,EACE,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,MAAM,MAAM;AAAA,IAC3C;AAAA,IACA,UAAU,QAAe,GAAG;AAAA,EAAA,CAC7B;AACH;"}
1
+ {"version":3,"file":"runtime.js","sources":["../../../../../src/components/_util/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\r\nimport { fromPairs } from 'lodash-unified'\r\nimport { isObject } from '../../types'\r\nimport { hasOwn } from '../../objects'\r\n\r\nimport type { PropType } from 'vue'\r\nimport type {\r\n EpProp,\r\n EpPropConvert,\r\n EpPropFinalized,\r\n EpPropInput,\r\n EpPropMergeType,\r\n IfEpProp,\r\n IfNativePropType,\r\n NativePropType,\r\n} from './types'\r\n\r\nexport const epPropKey = '__epPropKey'\r\n\r\nexport const definePropType = <T>(val: any): PropType<T> => val\r\n\r\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\r\n isObject(val) && !!(val as any)[epPropKey]\r\n\r\n/**\r\n * @description Build prop. It can better optimize prop types\r\n * @description 生成 prop,能更好地优化类型\r\n * @example\r\n // limited options\r\n // the type will be PropType<'light' | 'dark'>\r\n buildProp({\r\n type: String,\r\n values: ['light', 'dark'],\r\n } as const)\r\n * @example\r\n // limited options and other types\r\n // the type will be PropType<'small' | 'large' | number>\r\n buildProp({\r\n type: [String, Number],\r\n values: ['small', 'large'],\r\n validator: (val: unknown): val is number => typeof val === 'number',\r\n } as const)\r\n @link see more: https://github.com/element-plus/element-plus/pull/3341\r\n */\r\nexport const buildProp = <\r\n Type = never,\r\n Value = never,\r\n Validator = never,\r\n Default extends EpPropMergeType<Type, Value, Validator> = never,\r\n Required extends boolean = false\r\n>(\r\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\r\n key?: string\r\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\r\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\r\n if (!isObject(prop) || isEpProp(prop)) return prop as any\r\n\r\n const { values, required, default: defaultValue, type, validator } = prop\r\n\r\n const _validator =\r\n values || validator\r\n ? (val: unknown) => {\r\n let valid = false\r\n let allowedValues: unknown[] = []\r\n\r\n if (values) {\r\n allowedValues = Array.from(values)\r\n if (hasOwn(prop, 'default')) {\r\n allowedValues.push(defaultValue)\r\n }\r\n valid ||= allowedValues.includes(val)\r\n }\r\n if (validator) valid ||= validator(val)\r\n\r\n if (!valid && allowedValues.length > 0) {\r\n const allowValuesText = [...new Set(allowedValues)]\r\n .map((value) => JSON.stringify(value))\r\n .join(', ')\r\n warn(\r\n `Invalid prop: validation failed${\r\n key ? ` for prop \"${key}\"` : ''\r\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\r\n val\r\n )}.`\r\n )\r\n }\r\n return valid\r\n }\r\n : undefined\r\n\r\n const epProp: any = {\r\n type,\r\n required: !!required,\r\n validator: _validator,\r\n [epPropKey]: true,\r\n }\r\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\r\n return epProp\r\n}\r\n\r\nexport const buildProps = <\r\n Props extends Record<\r\n string,\r\n | { [epPropKey]: true }\r\n | NativePropType\r\n | EpPropInput<any, any, any, any, any>\r\n >\r\n>(\r\n props: Props\r\n): {\r\n [K in keyof Props]: IfEpProp<\r\n Props[K],\r\n Props[K],\r\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\r\n >\r\n} =>\r\n fromPairs(\r\n Object.entries(props).map(([key, option]) => [\r\n key,\r\n buildProp(option as any, key),\r\n ])\r\n ) as any\r\n"],"names":["epPropKey","definePropType","val","isEpProp","isObject","buildProp","prop","key","values","required","defaultValue","type","validator","epProp","valid","allowedValues","hasOwn","allowValuesText","value","warn","buildProps","props","fromPairs","option"],"mappings":";;;AAiBO,MAAMA,IAAY,eAEZC,IAAiB,CAAIC,MAA0BA,GAE/CC,IAAW,CAACD,MACvBE,EAASF,CAAG,KAAK,CAAC,CAAEA,EAAYF,CAAS,GAsB9BK,IAAY,CAOvBC,GACAC,MAC+D;AAE/D,MAAI,CAACH,EAASE,CAAI,KAAKH,EAASG,CAAI,EAAU,QAAAA;AAE9C,QAAM,EAAE,QAAAE,GAAQ,UAAAC,GAAU,SAASC,GAAc,MAAAC,GAAM,WAAAC,EAAc,IAAAN,GAiC/DO,IAAc;AAAA,IAClB,MAAAF;AAAA,IACA,UAAU,CAAC,CAACF;AAAA,IACZ,WAjCAD,KAAUI,IACN,CAACV,MAAiB;AAChB,UAAIY,IAAQ,IACRC,IAA2B,CAAA;AAW/B,UATIP,MACcO,IAAA,MAAM,KAAKP,CAAM,GAC7BQ,EAAOV,GAAM,SAAS,KACxBS,EAAc,KAAKL,CAAY,GAEvBI,UAAAC,EAAc,SAASb,CAAG,KAElCU,MAAqBE,UAAAF,EAAUV,CAAG,KAElC,CAACY,KAASC,EAAc,SAAS,GAAG;AACtC,cAAME,IAAkB,CAAC,GAAG,IAAI,IAAIF,CAAa,CAAC,EAC/C,IAAI,CAACG,MAAU,KAAK,UAAUA,CAAK,CAAC,EACpC,KAAK,IAAI;AACZ,QAAAC;AAAA,UACE,kCACEZ,IAAM,cAAcA,CAAG,MAAM,EAC/B,sBAAsBU,CAAe,gBAAgB,KAAK;AAAA,YACxDf;AAAA,UACD,CAAA;AAAA,QAAA;AAAA,MAEL;AACO,aAAAY;AAAA,IAET,IAAA;AAAA,IAMJ,CAACd,CAAS,GAAG;AAAA,EAAA;AAEf,SAAIgB,EAAOV,GAAM,SAAS,QAAU,UAAUI,IACvCG;AACT,GAEaO,IAAa,CAQxBC,MAQAC;AAAA,EACE,OAAO,QAAQD,CAAK,EAAE,IAAI,CAAC,CAACd,GAAKgB,CAAM,MAAM;AAAA,IAC3ChB;AAAA,IACAF,EAAUkB,GAAehB,CAAG;AAAA,EAAA,CAC7B;AACH;"}