orion-design 0.1.29 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. package/dist/Throne/index.js +30 -14
  2. package/dist/Throne/index.js.map +1 -1
  3. package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
  4. package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
  5. package/dist/components/Button/index.js +40 -33
  6. package/dist/components/Button/index.js.map +1 -1
  7. package/dist/components/Flex/index.js +122 -89
  8. package/dist/components/Flex/index.js.map +1 -1
  9. package/dist/components/Form/Form.js +2 -2
  10. package/dist/components/Form/Form.js.map +1 -1
  11. package/dist/components/Form/LovInput/LovInput.js +2 -2
  12. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  13. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  14. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  15. package/dist/components/Form/LovInput/index.js +4 -4
  16. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  17. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  18. package/dist/components/Form/hooks/index.js +128 -66
  19. package/dist/components/Form/hooks/index.js.map +1 -1
  20. package/dist/components/Form/index.js +836 -656
  21. package/dist/components/Form/index.js.map +1 -1
  22. package/dist/components/Form/utils/index.js +30 -18
  23. package/dist/components/Form/utils/index.js.map +1 -1
  24. package/dist/components/LovTable/LovPagetable.vue.d.ts +28 -0
  25. package/dist/components/LovTable/index.d.ts +14 -0
  26. package/dist/components/LovTable/index.js +179 -105
  27. package/dist/components/LovTable/index.js.map +1 -1
  28. package/dist/components/Modal/Modal.d.ts +2 -0
  29. package/dist/components/Modal/ModalLocator.vue.d.ts +20 -0
  30. package/dist/components/Modal/index.d.ts +4 -1
  31. package/dist/components/Modal/index.js +127 -0
  32. package/dist/components/Modal/index.js.map +1 -0
  33. package/dist/components/Modal/types.d.ts +18 -0
  34. package/dist/components/Modal/types.js +7 -0
  35. package/dist/components/Modal/types.js.map +1 -0
  36. package/dist/components/Modal/useModal.d.ts +1 -3
  37. package/dist/components/Modal/useModal.js +5 -4
  38. package/dist/components/Modal/useModal.js.map +1 -1
  39. package/dist/components/Pagetable/Pagetable.d.ts +13 -0
  40. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
  41. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
  42. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +13 -0
  43. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
  44. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
  45. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
  46. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
  47. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
  48. package/dist/components/Pagetable/hooks/useColumns.js +88 -74
  49. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  50. package/dist/components/Pagetable/index.d.ts +9 -0
  51. package/dist/components/Pagetable/index.js +697 -491
  52. package/dist/components/Pagetable/index.js.map +1 -1
  53. package/dist/components/Pagetable/utils/index.js +92 -54
  54. package/dist/components/Pagetable/utils/index.js.map +1 -1
  55. package/dist/components/Querytable/hooks/useColumns.js +82 -74
  56. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  57. package/dist/components/Querytable/index.js +579 -469
  58. package/dist/components/Querytable/index.js.map +1 -1
  59. package/dist/components/Querytable/utils/index.js +92 -54
  60. package/dist/components/Querytable/utils/index.js.map +1 -1
  61. package/dist/components/RichTextEditor/index.js +100 -74
  62. package/dist/components/RichTextEditor/index.js.map +1 -1
  63. package/dist/components/Tabs/constants.js +2 -2
  64. package/dist/components/Tabs/constants.js.map +1 -1
  65. package/dist/components/Tabs/index.js +603 -358
  66. package/dist/components/Tabs/index.js.map +1 -1
  67. package/dist/components/Tabs/tab-bar.js +6 -6
  68. package/dist/components/Tabs/tab-bar.js.map +1 -1
  69. package/dist/components/Tabs/tab-pane.js +3 -3
  70. package/dist/components/Tabs/tab-pane.js.map +1 -1
  71. package/dist/components/_constants/aria.js +2 -2
  72. package/dist/components/_constants/aria.js.map +1 -1
  73. package/dist/components/_constants/event.js +6 -4
  74. package/dist/components/_constants/event.js.map +1 -1
  75. package/dist/components/_constants/index.js +6 -6
  76. package/dist/components/_hooks/index.js +7 -7
  77. package/dist/components/_hooks/use-namespace/index.js +74 -39
  78. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  79. package/dist/components/_hooks/use-ordered-children/index.js +29 -19
  80. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  81. package/dist/components/_util/arrays.js +9 -5
  82. package/dist/components/_util/arrays.js.map +1 -1
  83. package/dist/components/_util/browser.js +6 -6
  84. package/dist/components/_util/browser.js.map +1 -1
  85. package/dist/components/_util/classNames.js +22 -17
  86. package/dist/components/_util/classNames.js.map +1 -1
  87. package/dist/components/_util/dom/aria.js +74 -39
  88. package/dist/components/_util/dom/aria.js.map +1 -1
  89. package/dist/components/_util/dom/element.js +9 -8
  90. package/dist/components/_util/dom/element.js.map +1 -1
  91. package/dist/components/_util/dom/event.js +14 -7
  92. package/dist/components/_util/dom/event.js.map +1 -1
  93. package/dist/components/_util/dom/index.js +36 -36
  94. package/dist/components/_util/dom/position.js +49 -25
  95. package/dist/components/_util/dom/position.js.map +1 -1
  96. package/dist/components/_util/dom/scroll.js +103 -61
  97. package/dist/components/_util/dom/scroll.js.map +1 -1
  98. package/dist/components/_util/dom/style.js +65 -50
  99. package/dist/components/_util/dom/style.js.map +1 -1
  100. package/dist/components/_util/easings.js +8 -4
  101. package/dist/components/_util/easings.js.map +1 -1
  102. package/dist/components/_util/error.js +12 -11
  103. package/dist/components/_util/error.js.map +1 -1
  104. package/dist/components/_util/functions.js +3 -3
  105. package/dist/components/_util/i18n.js +2 -2
  106. package/dist/components/_util/i18n.js.map +1 -1
  107. package/dist/components/_util/index.js +137 -137
  108. package/dist/components/_util/isValid.js +4 -2
  109. package/dist/components/_util/isValid.js.map +1 -1
  110. package/dist/components/_util/objects.js +18 -14
  111. package/dist/components/_util/objects.js.map +1 -1
  112. package/dist/components/_util/props-util/index.js +46 -20
  113. package/dist/components/_util/props-util/index.js.map +1 -1
  114. package/dist/components/_util/props-util/initDefaultProps.js +18 -10
  115. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  116. package/dist/components/_util/raf.js +5 -4
  117. package/dist/components/_util/raf.js.map +1 -1
  118. package/dist/components/_util/rand.js +4 -3
  119. package/dist/components/_util/rand.js.map +1 -1
  120. package/dist/components/_util/strings.js +9 -8
  121. package/dist/components/_util/strings.js.map +1 -1
  122. package/dist/components/_util/throttleByRaf.js +16 -10
  123. package/dist/components/_util/throttleByRaf.js.map +1 -1
  124. package/dist/components/_util/type.js +41 -38
  125. package/dist/components/_util/type.js.map +1 -1
  126. package/dist/components/_util/types.js +41 -22
  127. package/dist/components/_util/types.js.map +1 -1
  128. package/dist/components/_util/typescript.js +2 -2
  129. package/dist/components/_util/typescript.js.map +1 -1
  130. package/dist/components/_util/util.js +85 -43
  131. package/dist/components/_util/util.js.map +1 -1
  132. package/dist/components/_util/vue/global-node.js +27 -15
  133. package/dist/components/_util/vue/global-node.js.map +1 -1
  134. package/dist/components/_util/vue/icon.js +29 -25
  135. package/dist/components/_util/vue/icon.js.map +1 -1
  136. package/dist/components/_util/vue/index.js +41 -41
  137. package/dist/components/_util/vue/install.js +35 -18
  138. package/dist/components/_util/vue/install.js.map +1 -1
  139. package/dist/components/_util/vue/props/index.js +6 -6
  140. package/dist/components/_util/vue/props/runtime.js +46 -30
  141. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  142. package/dist/components/_util/vue/refs.js +12 -6
  143. package/dist/components/_util/vue/refs.js.map +1 -1
  144. package/dist/components/_util/vue/size.js +5 -3
  145. package/dist/components/_util/vue/size.js.map +1 -1
  146. package/dist/components/_util/vue/validator.js +5 -4
  147. package/dist/components/_util/vue/validator.js.map +1 -1
  148. package/dist/components/_util/vue/vnode.js +100 -54
  149. package/dist/components/_util/vue/vnode.js.map +1 -1
  150. package/dist/components/_util/vue-types/index.js +231 -220
  151. package/dist/components/_util/vue-types/index.js.map +1 -1
  152. package/dist/components/components.js +20 -20
  153. package/dist/components/index.js +38 -35
  154. package/dist/components/index.js.map +1 -1
  155. package/dist/components-8oZ2kpUC.js +27 -0
  156. package/dist/components-8oZ2kpUC.js.map +1 -0
  157. package/dist/components-B3d9m_tn.js +27 -0
  158. package/dist/components-B3d9m_tn.js.map +1 -0
  159. package/dist/error/OrionError.js +8 -4
  160. package/dist/error/OrionError.js.map +1 -1
  161. package/dist/functions-BeMkokbY.js +63 -0
  162. package/dist/functions-BeMkokbY.js.map +1 -0
  163. package/dist/index-BOKLZnqH.js +54 -0
  164. package/dist/index-BOKLZnqH.js.map +1 -0
  165. package/dist/index-D1m0KTpK.js +69 -0
  166. package/dist/index-D1m0KTpK.js.map +1 -0
  167. package/dist/index-DR5ZP7mD.js +160 -0
  168. package/dist/index-DR5ZP7mD.js.map +1 -0
  169. package/dist/index-DkwIULcN.js +200 -0
  170. package/dist/index-DkwIULcN.js.map +1 -0
  171. package/dist/index.css +797 -1
  172. package/dist/index.js +36 -36
  173. package/dist/print/LodopFuncs.js +101 -43
  174. package/dist/print/LodopFuncs.js.map +1 -1
  175. package/dist/print/index.js +200 -108
  176. package/dist/print/index.js.map +1 -1
  177. package/dist/request/ErrorHandlerChain.js +17 -14
  178. package/dist/request/ErrorHandlerChain.js.map +1 -1
  179. package/dist/request/RequestFilterChain.js +16 -13
  180. package/dist/request/RequestFilterChain.js.map +1 -1
  181. package/dist/request/ResponseParserChain.js +17 -14
  182. package/dist/request/ResponseParserChain.js.map +1 -1
  183. package/dist/request/disivion/DateSerializer.js +47 -22
  184. package/dist/request/disivion/DateSerializer.js.map +1 -1
  185. package/dist/request/disivion/DivisionErrorHandler.js +40 -25
  186. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  187. package/dist/request/disivion/DivisionResponseParser.js +16 -10
  188. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  189. package/dist/request/disivion/index.js +305 -201
  190. package/dist/request/disivion/index.js.map +1 -1
  191. package/dist/request/error/BizExceptionResponseError.js +11 -5
  192. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  193. package/dist/request/error/ExceptionResponseError.js +11 -5
  194. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  195. package/dist/request/error/ResponseError.js +9 -4
  196. package/dist/request/error/ResponseError.js.map +1 -1
  197. package/dist/request/error/SessionExceptionResponseError.js +11 -5
  198. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  199. package/dist/request/index.js +11 -11
  200. package/dist/utils/DateUtil.js +48 -33
  201. package/dist/utils/DateUtil.js.map +1 -1
  202. package/dist/utils/NumberUtil.js +6 -6
  203. package/dist/utils/NumberUtil.js.map +1 -1
  204. package/dist/utils/cloneDeep.js +2 -2
  205. package/dist/utils/delay.js +3 -3
  206. package/dist/utils/delay.js.map +1 -1
  207. package/dist/utils/functions.js +3 -3
  208. package/dist/utils/index.js +12 -12
  209. package/dist/utils/md5.js +191 -93
  210. package/dist/utils/md5.js.map +1 -1
  211. package/dist/utils/uuid.js +35 -25
  212. package/dist/utils/uuid.js.map +1 -1
  213. package/dist/version/index.js +2 -2
  214. package/dist/version/version.d.ts +1 -1
  215. package/dist/version/version.js +2 -2
  216. package/dist/version/version.js.map +1 -1
  217. package/package.json +1 -1
  218. package/dist/components-J6-qau6Y.js +0 -73
  219. package/dist/components-J6-qau6Y.js.map +0 -1
@@ -4,295 +4,305 @@
4
4
  * Copyright (c) 2014-2017, Jon Schlinkert.
5
5
  * Released under the MIT License.
6
6
  */
7
- function $(e) {
8
- return Object.prototype.toString.call(e) === "[object Object]";
7
+ function isObject(o2) {
8
+ return Object.prototype.toString.call(o2) === "[object Object]";
9
9
  }
10
- function k(e) {
11
- var n, r;
12
- return $(e) === !1 ? !1 : (n = e.constructor, n === void 0 ? !0 : (r = n.prototype, !($(r) === !1 || r.hasOwnProperty("isPrototypeOf") === !1)));
10
+ function isPlainObject(o2) {
11
+ var ctor, prot;
12
+ if (isObject(o2) === false) return false;
13
+ ctor = o2.constructor;
14
+ if (ctor === void 0) return true;
15
+ prot = ctor.prototype;
16
+ if (isObject(prot) === false) return false;
17
+ if (prot.hasOwnProperty("isPrototypeOf") === false) {
18
+ return false;
19
+ }
20
+ return true;
13
21
  }
14
- function O() {
15
- return O = Object.assign ? Object.assign.bind() : function(e) {
16
- for (var n = 1; n < arguments.length; n++) {
17
- var r = arguments[n];
18
- for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
22
+ function t() {
23
+ return t = Object.assign ? Object.assign.bind() : function(e) {
24
+ for (var t2 = 1; t2 < arguments.length; t2++) {
25
+ var n2 = arguments[t2];
26
+ for (var r2 in n2) Object.prototype.hasOwnProperty.call(n2, r2) && (e[r2] = n2[r2]);
19
27
  }
20
28
  return e;
21
- }, O.apply(this, arguments);
29
+ }, t.apply(this, arguments);
22
30
  }
23
- function S(e, n) {
24
- if (e == null) return {};
25
- var r = {};
26
- for (var t in e) if (Object.prototype.hasOwnProperty.call(e, t)) {
27
- if (n.indexOf(t) >= 0) continue;
28
- r[t] = e[t];
31
+ function n(e, t2) {
32
+ if (null == e) return {};
33
+ var n2 = {};
34
+ for (var r2 in e) if (Object.prototype.hasOwnProperty.call(e, r2)) {
35
+ if (t2.indexOf(r2) >= 0) continue;
36
+ n2[r2] = e[r2];
29
37
  }
30
- return r;
38
+ return n2;
31
39
  }
32
- const _ = { silent: !1, logLevel: "warn" }, D = ["validator"], A = Object.prototype, E = A.toString, L = A.hasOwnProperty, N = /^\s*function (\w+)/;
33
- function w(e) {
34
- var n;
35
- const r = (n = e == null ? void 0 : e.type) !== null && n !== void 0 ? n : e;
36
- if (r) {
37
- const t = r.toString().match(N);
38
- return t ? t[1] : "";
40
+ const r = { silent: false, logLevel: "warn" }, i = ["validator"], o = Object.prototype, a = o.toString, s = o.hasOwnProperty, u = /^\s*function (\w+)/;
41
+ function l(e) {
42
+ var t2;
43
+ const n2 = null !== (t2 = null == e ? void 0 : e.type) && void 0 !== t2 ? t2 : e;
44
+ if (n2) {
45
+ const e2 = n2.toString().match(u);
46
+ return e2 ? e2[1] : "";
39
47
  }
40
48
  return "";
41
49
  }
42
- const y = k;
43
- function V() {
50
+ const c = isPlainObject;
51
+ function f() {
44
52
  }
45
- let c = V;
46
- process.env.NODE_ENV !== "production" && (c = typeof console < "u" ? function(n, r = _.logLevel) {
47
- _.silent === !1 && console[r](`[VueTypes warn]: ${n}`);
48
- } : V);
49
- const h = (e, n) => L.call(e, n), F = Number.isInteger || function(e) {
50
- return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
51
- }, b = Array.isArray || function(e) {
52
- return E.call(e) === "[object Array]";
53
- }, g = (e) => E.call(e) === "[object Function]", m = (e, n) => y(e) && h(e, "_vueTypes_name") && (!n || e._vueTypes_name === n), q = (e) => y(e) && (h(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((n) => h(e, n)));
54
- function T(e, n) {
55
- return Object.defineProperty(e.bind(n), "__original", { value: e });
53
+ let d = f;
54
+ if ("production" !== process.env.NODE_ENV) {
55
+ const e = "undefined" != typeof console;
56
+ d = e ? function(e2, t2 = r.logLevel) {
57
+ false === r.silent && console[t2](`[VueTypes warn]: ${e2}`);
58
+ } : f;
56
59
  }
57
- function v(e, n, r = !1) {
58
- let t, i = !0, a = "";
59
- t = y(e) ? e : { type: e };
60
- const o = m(t) ? t._vueTypes_name + " - " : "";
61
- if (q(t) && t.type !== null) {
62
- if (t.type === void 0 || t.type === !0 || !t.required && n == null) return i;
63
- b(t.type) ? (i = t.type.some((s) => v(s, n, !0) === !0), a = t.type.map((s) => w(s)).join(" or ")) : (a = w(t), i = a === "Array" ? b(n) : a === "Object" ? y(n) : a === "String" || a === "Number" || a === "Boolean" || a === "Function" ? function(s) {
64
- if (s == null) return "";
65
- const u = s.constructor.toString().match(N);
66
- return u ? u[1].replace(/^Async/, "") : "";
67
- }(n) === a : n instanceof t.type);
60
+ const p = (e, t2) => s.call(e, t2), y = Number.isInteger || function(e) {
61
+ return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
62
+ }, v = Array.isArray || function(e) {
63
+ return "[object Array]" === a.call(e);
64
+ }, h = (e) => "[object Function]" === a.call(e), b = (e, t2) => c(e) && p(e, "_vueTypes_name") && (!t2 || e._vueTypes_name === t2), g = (e) => c(e) && (p(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t2) => p(e, t2)));
65
+ function O(e, t2) {
66
+ return Object.defineProperty(e.bind(t2), "__original", { value: e });
67
+ }
68
+ function m(e, t2, n2 = false) {
69
+ let r2, i2 = true, o2 = "";
70
+ r2 = c(e) ? e : { type: e };
71
+ const a2 = b(r2) ? r2._vueTypes_name + " - " : "";
72
+ if (g(r2) && null !== r2.type) {
73
+ if (void 0 === r2.type || true === r2.type) return i2;
74
+ if (!r2.required && null == t2) return i2;
75
+ v(r2.type) ? (i2 = r2.type.some((e2) => true === m(e2, t2, true)), o2 = r2.type.map((e2) => l(e2)).join(" or ")) : (o2 = l(r2), i2 = "Array" === o2 ? v(t2) : "Object" === o2 ? c(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e2) {
76
+ if (null == e2) return "";
77
+ const t3 = e2.constructor.toString().match(u);
78
+ return t3 ? t3[1].replace(/^Async/, "") : "";
79
+ }(t2) === o2 : t2 instanceof r2.type);
68
80
  }
69
- if (!i) {
70
- const s = `${o}value "${n}" should be of type "${a}"`;
71
- return r === !1 ? (c(s), !1) : s;
81
+ if (!i2) {
82
+ const e2 = `${a2}value "${t2}" should be of type "${o2}"`;
83
+ return false === n2 ? (d(e2), false) : e2;
72
84
  }
73
- if (h(t, "validator") && g(t.validator)) {
74
- const s = c, u = [];
75
- if (c = (l) => {
76
- u.push(l);
77
- }, i = t.validator(n), c = s, !i) {
78
- const l = (u.length > 1 ? "* " : "") + u.join(`
79
- * `);
80
- return u.length = 0, r === !1 ? (c(l), i) : l;
85
+ if (p(r2, "validator") && h(r2.validator)) {
86
+ const e2 = d, o3 = [];
87
+ if (d = (e3) => {
88
+ o3.push(e3);
89
+ }, i2 = r2.validator(t2), d = e2, !i2) {
90
+ const e3 = (o3.length > 1 ? "* " : "") + o3.join("\n* ");
91
+ return o3.length = 0, false === n2 ? (d(e3), i2) : e3;
81
92
  }
82
93
  }
83
- return i;
94
+ return i2;
84
95
  }
85
- function f(e, n) {
86
- const r = Object.defineProperties(n, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get() {
87
- return this.required = !0, this;
88
- } }, def: { value(i) {
89
- return i === void 0 ? this.type === Boolean || Array.isArray(this.type) && this.type.includes(Boolean) ? void (this.default = void 0) : (h(this, "default") && delete this.default, this) : g(i) || v(this, i, !0) === !0 ? (this.default = b(i) ? () => [...i] : y(i) ? () => Object.assign({}, i) : i, this) : (c(`${this._vueTypes_name} - invalid default value: "${i}"`), this);
90
- } } }), { validator: t } = r;
91
- return g(t) && (r.validator = T(t, r)), r;
96
+ function j(e, t2) {
97
+ const n2 = Object.defineProperties(t2, { _vueTypes_name: { value: e, writable: true }, isRequired: { get() {
98
+ return this.required = true, this;
99
+ } }, def: { value(e2) {
100
+ return void 0 === e2 ? this.type === Boolean || Array.isArray(this.type) && this.type.includes(Boolean) ? void (this.default = void 0) : (p(this, "default") && delete this.default, this) : h(e2) || true === m(this, e2, true) ? (this.default = v(e2) ? () => [...e2] : c(e2) ? () => Object.assign({}, e2) : e2, this) : (d(`${this._vueTypes_name} - invalid default value: "${e2}"`), this);
101
+ } } }), { validator: r2 } = n2;
102
+ return h(r2) && (n2.validator = O(r2, n2)), n2;
92
103
  }
93
- function d(e, n) {
94
- const r = f(e, n);
95
- return Object.defineProperty(r, "validate", { value(t) {
96
- return g(this.validator) && c(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
97
- ${JSON.stringify(this)}`), this.validator = T(t, this), this;
104
+ function _(e, t2) {
105
+ const n2 = j(e, t2);
106
+ return Object.defineProperty(n2, "validate", { value(e2) {
107
+ return h(this.validator) && d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
108
+ ${JSON.stringify(this)}`), this.validator = O(e2, this), this;
98
109
  } });
99
110
  }
100
- function P(e, n, r) {
101
- const t = function(u) {
102
- const l = {};
103
- return Object.getOwnPropertyNames(u).forEach((p) => {
104
- l[p] = Object.getOwnPropertyDescriptor(u, p);
105
- }), Object.defineProperties({}, l);
106
- }(n);
107
- if (t._vueTypes_name = e, !y(r)) return t;
108
- const { validator: i } = r, a = S(r, D);
109
- if (g(i)) {
110
- let { validator: u } = t;
111
- u && (u = (s = (o = u).__original) !== null && s !== void 0 ? s : o), t.validator = T(u ? function(l) {
112
- return u.call(this, l) && i.call(this, l);
113
- } : i, t);
111
+ function T(e, t2, r2) {
112
+ const o2 = function(e2) {
113
+ const t3 = {};
114
+ return Object.getOwnPropertyNames(e2).forEach((n2) => {
115
+ t3[n2] = Object.getOwnPropertyDescriptor(e2, n2);
116
+ }), Object.defineProperties({}, t3);
117
+ }(t2);
118
+ if (o2._vueTypes_name = e, !c(r2)) return o2;
119
+ const { validator: a2 } = r2, s2 = n(r2, i);
120
+ if (h(a2)) {
121
+ let { validator: e2 } = o2;
122
+ e2 && (e2 = null !== (l2 = (u2 = e2).__original) && void 0 !== l2 ? l2 : u2), o2.validator = O(e2 ? function(t3) {
123
+ return e2.call(this, t3) && a2.call(this, t3);
124
+ } : a2, o2);
114
125
  }
115
- var o, s;
116
- return Object.assign(t, a);
126
+ var u2, l2;
127
+ return Object.assign(o2, s2);
117
128
  }
118
- function j(e) {
129
+ function $(e) {
119
130
  return e.replace(/^(?!\s*$)/gm, " ");
120
131
  }
121
- const Y = () => d("any", {}), U = () => d("function", { type: Function }), x = () => d("boolean", { type: Boolean }), I = () => d("string", { type: String }), J = () => d("number", { type: Number }), M = () => d("array", { type: Array }), R = () => d("object", { type: Object }), z = () => f("integer", { type: Number, validator(e) {
122
- const n = F(e);
123
- return n === !1 && c(`integer - "${e}" is not an integer`), n;
124
- } }), C = () => f("symbol", { validator(e) {
125
- const n = typeof e == "symbol";
126
- return n === !1 && c(`symbol - invalid value "${e}"`), n;
127
- } }), G = () => Object.defineProperty({ type: null, validator(e) {
128
- const n = e === null;
129
- return n === !1 && c("nullable - value should be null"), n;
132
+ const w = () => _("any", {}), x = () => _("function", { type: Function }), P = () => _("boolean", { type: Boolean }), A = () => _("string", { type: String }), E = () => _("number", { type: Number }), S = () => _("array", { type: Array }), N = () => _("object", { type: Object }), V = () => j("integer", { type: Number, validator(e) {
133
+ const t2 = y(e);
134
+ return false === t2 && d(`integer - "${e}" is not an integer`), t2;
135
+ } }), q = () => j("symbol", { validator(e) {
136
+ const t2 = "symbol" == typeof e;
137
+ return false === t2 && d(`symbol - invalid value "${e}"`), t2;
138
+ } }), k = () => Object.defineProperty({ type: null, validator(e) {
139
+ const t2 = null === e;
140
+ return false === t2 && d("nullable - value should be null"), t2;
130
141
  } }, "_vueTypes_name", { value: "nullable" });
131
- function H(e, n = "custom validation failed") {
132
- if (typeof e != "function") throw new TypeError("[VueTypes error]: You must provide a function as argument");
133
- return f(e.name || "<<anonymous function>>", { type: null, validator(r) {
134
- const t = e(r);
135
- return t || c(`${this._vueTypes_name} - ${n}`), t;
142
+ function D(e, t2 = "custom validation failed") {
143
+ if ("function" != typeof e) throw new TypeError("[VueTypes error]: You must provide a function as argument");
144
+ return j(e.name || "<<anonymous function>>", { type: null, validator(n2) {
145
+ const r2 = e(n2);
146
+ return r2 || d(`${this._vueTypes_name} - ${t2}`), r2;
136
147
  } });
137
148
  }
138
- function K(e) {
139
- if (!b(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
140
- const n = `oneOf - value should be one of "${e.map((t) => typeof t == "symbol" ? t.toString() : t).join('", "')}".`, r = { validator(t) {
141
- const i = e.indexOf(t) !== -1;
142
- return i || c(n), i;
149
+ function L(e) {
150
+ if (!v(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
151
+ const t2 = `oneOf - value should be one of "${e.map((e2) => "symbol" == typeof e2 ? e2.toString() : e2).join('", "')}".`, n2 = { validator(n3) {
152
+ const r2 = -1 !== e.indexOf(n3);
153
+ return r2 || d(t2), r2;
143
154
  } };
144
- if (e.indexOf(null) === -1) {
145
- const t = e.reduce((i, a) => {
146
- if (a != null) {
147
- const o = a.constructor;
148
- i.indexOf(o) === -1 && i.push(o);
155
+ if (-1 === e.indexOf(null)) {
156
+ const t3 = e.reduce((e2, t4) => {
157
+ if (null != t4) {
158
+ const n3 = t4.constructor;
159
+ -1 === e2.indexOf(n3) && e2.push(n3);
149
160
  }
150
- return i;
161
+ return e2;
151
162
  }, []);
152
- t.length > 0 && (r.type = t);
163
+ t3.length > 0 && (n2.type = t3);
153
164
  }
154
- return f("oneOf", r);
165
+ return j("oneOf", n2);
155
166
  }
156
- function Q(e) {
157
- if (!b(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
158
- let n = !1, r = !1, t = [];
159
- for (let a = 0; a < e.length; a += 1) {
160
- const o = e[a];
161
- if (q(o)) {
162
- if (g(o.validator) && (n = !0), m(o, "oneOf") && o.type) {
163
- t = t.concat(o.type);
167
+ function B(e) {
168
+ if (!v(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
169
+ let t2 = false, n2 = false, r2 = [];
170
+ for (let i3 = 0; i3 < e.length; i3 += 1) {
171
+ const o2 = e[i3];
172
+ if (g(o2)) {
173
+ if (h(o2.validator) && (t2 = true), b(o2, "oneOf") && o2.type) {
174
+ r2 = r2.concat(o2.type);
164
175
  continue;
165
176
  }
166
- if (m(o, "nullable")) {
167
- r = !0;
177
+ if (b(o2, "nullable")) {
178
+ n2 = true;
168
179
  continue;
169
180
  }
170
- if (o.type === !0 || !o.type) {
171
- c('oneOfType - invalid usage of "true" and "null" as types.');
181
+ if (true === o2.type || !o2.type) {
182
+ d('oneOfType - invalid usage of "true" and "null" as types.');
172
183
  continue;
173
184
  }
174
- t = t.concat(o.type);
175
- } else t.push(o);
185
+ r2 = r2.concat(o2.type);
186
+ } else r2.push(o2);
176
187
  }
177
- t = t.filter((a, o) => t.indexOf(a) === o);
178
- const i = r === !1 && t.length > 0 ? t : null;
179
- return f("oneOfType", n ? { type: i, validator(a) {
180
- const o = [], s = e.some((u) => {
181
- const l = v(u, a, !0);
182
- return typeof l == "string" && o.push(l), l === !0;
188
+ r2 = r2.filter((e2, t3) => r2.indexOf(e2) === t3);
189
+ const i2 = false === n2 && r2.length > 0 ? r2 : null;
190
+ return j("oneOfType", t2 ? { type: i2, validator(t3) {
191
+ const n3 = [], r3 = e.some((e2) => {
192
+ const r4 = m(e2, t3, true);
193
+ return "string" == typeof r4 && n3.push(r4), true === r4;
183
194
  });
184
- return s || c(`oneOfType - provided value does not match any of the ${o.length} passed-in validators:
185
- ${j(o.join(`
186
- `))}`), s;
187
- } } : { type: i });
195
+ return r3 || d(`oneOfType - provided value does not match any of the ${n3.length} passed-in validators:
196
+ ${$(n3.join("\n"))}`), r3;
197
+ } } : { type: i2 });
188
198
  }
189
- function W(e) {
190
- return f("arrayOf", { type: Array, validator(n) {
191
- let r = "";
192
- const t = n.every((i) => (r = v(e, i, !0), r === !0));
193
- return t || c(`arrayOf - value validation error:
194
- ${j(r)}`), t;
199
+ function F(e) {
200
+ return j("arrayOf", { type: Array, validator(t2) {
201
+ let n2 = "";
202
+ const r2 = t2.every((t3) => (n2 = m(e, t3, true), true === n2));
203
+ return r2 || d(`arrayOf - value validation error:
204
+ ${$(n2)}`), r2;
195
205
  } });
196
206
  }
197
- function X(e) {
198
- return f("instanceOf", { type: e });
207
+ function Y(e) {
208
+ return j("instanceOf", { type: e });
199
209
  }
200
- function Z(e) {
201
- return f("objectOf", { type: Object, validator(n) {
202
- let r = "";
203
- const t = Object.keys(n).every((i) => (r = v(e, n[i], !0), r === !0));
204
- return t || c(`objectOf - value validation error:
205
- ${j(r)}`), t;
210
+ function I(e) {
211
+ return j("objectOf", { type: Object, validator(t2) {
212
+ let n2 = "";
213
+ const r2 = Object.keys(t2).every((r3) => (n2 = m(e, t2[r3], true), true === n2));
214
+ return r2 || d(`objectOf - value validation error:
215
+ ${$(n2)}`), r2;
206
216
  } });
207
217
  }
208
- function ee(e) {
209
- const n = Object.keys(e), r = n.filter((i) => {
210
- var a;
211
- return !((a = e[i]) === null || a === void 0 || !a.required);
212
- }), t = f("shape", { type: Object, validator(i) {
213
- if (!y(i)) return !1;
214
- const a = Object.keys(i);
215
- if (r.length > 0 && r.some((o) => a.indexOf(o) === -1)) {
216
- const o = r.filter((s) => a.indexOf(s) === -1);
217
- return c(o.length === 1 ? `shape - required property "${o[0]}" is not defined.` : `shape - required properties "${o.join('", "')}" are not defined.`), !1;
218
+ function J(e) {
219
+ const t2 = Object.keys(e), n2 = t2.filter((t3) => {
220
+ var n3;
221
+ return !(null === (n3 = e[t3]) || void 0 === n3 || !n3.required);
222
+ }), r2 = j("shape", { type: Object, validator(r3) {
223
+ if (!c(r3)) return false;
224
+ const i2 = Object.keys(r3);
225
+ if (n2.length > 0 && n2.some((e2) => -1 === i2.indexOf(e2))) {
226
+ const e2 = n2.filter((e3) => -1 === i2.indexOf(e3));
227
+ return d(1 === e2.length ? `shape - required property "${e2[0]}" is not defined.` : `shape - required properties "${e2.join('", "')}" are not defined.`), false;
218
228
  }
219
- return a.every((o) => {
220
- if (n.indexOf(o) === -1) return this._vueTypes_isLoose === !0 || (c(`shape - shape definition does not include a "${o}" property. Allowed keys: "${n.join('", "')}".`), !1);
221
- const s = v(e[o], i[o], !0);
222
- return typeof s == "string" && c(`shape - "${o}" property validation error:
223
- ${j(s)}`), s === !0;
229
+ return i2.every((n3) => {
230
+ if (-1 === t2.indexOf(n3)) return true === this._vueTypes_isLoose || (d(`shape - shape definition does not include a "${n3}" property. Allowed keys: "${t2.join('", "')}".`), false);
231
+ const i3 = m(e[n3], r3[n3], true);
232
+ return "string" == typeof i3 && d(`shape - "${n3}" property validation error:
233
+ ${$(i3)}`), true === i3;
224
234
  });
225
235
  } });
226
- return Object.defineProperty(t, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(t, "loose", { get() {
227
- return this._vueTypes_isLoose = !0, this;
228
- } }), t;
236
+ return Object.defineProperty(r2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(r2, "loose", { get() {
237
+ return this._vueTypes_isLoose = true, this;
238
+ } }), r2;
229
239
  }
230
- const te = ["name", "validate", "getter"], ne = /* @__PURE__ */ ((e) => ((e = class {
240
+ const M = ["name", "validate", "getter"], R = /* @__PURE__ */ ((e) => ((e = class {
231
241
  static get any() {
232
- return Y();
242
+ return w();
233
243
  }
234
244
  static get func() {
235
- return U().def(this.defaults.func);
245
+ return x().def(this.defaults.func);
236
246
  }
237
247
  static get bool() {
238
- return this.defaults.bool === void 0 ? x() : x().def(this.defaults.bool);
248
+ return void 0 === this.defaults.bool ? P() : P().def(this.defaults.bool);
239
249
  }
240
250
  static get string() {
241
- return I().def(this.defaults.string);
251
+ return A().def(this.defaults.string);
242
252
  }
243
253
  static get number() {
244
- return J().def(this.defaults.number);
254
+ return E().def(this.defaults.number);
245
255
  }
246
256
  static get array() {
247
- return M().def(this.defaults.array);
257
+ return S().def(this.defaults.array);
248
258
  }
249
259
  static get object() {
250
- return R().def(this.defaults.object);
260
+ return N().def(this.defaults.object);
251
261
  }
252
262
  static get integer() {
253
- return z().def(this.defaults.integer);
263
+ return V().def(this.defaults.integer);
254
264
  }
255
265
  static get symbol() {
256
- return C();
266
+ return q();
257
267
  }
258
268
  static get nullable() {
259
- return G();
269
+ return k();
260
270
  }
261
- static extend(n) {
262
- if (c("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."), b(n)) return n.forEach((u) => this.extend(u)), this;
263
- const { name: r, validate: t = !1, getter: i = !1 } = n, a = S(n, te);
264
- if (h(this, r)) throw new TypeError(`[VueTypes error]: Type "${r}" already defined`);
265
- const { type: o } = a;
266
- if (m(o)) return delete a.type, Object.defineProperty(this, r, i ? { get: () => P(r, o, a) } : { value(...u) {
267
- const l = P(r, o, a);
268
- return l.validator && (l.validator = l.validator.bind(l, ...u)), l;
271
+ static extend(e2) {
272
+ if (d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."), v(e2)) return e2.forEach((e3) => this.extend(e3)), this;
273
+ const { name: t2, validate: r2 = false, getter: i2 = false } = e2, o2 = n(e2, M);
274
+ if (p(this, t2)) throw new TypeError(`[VueTypes error]: Type "${t2}" already defined`);
275
+ const { type: a2 } = o2;
276
+ if (b(a2)) return delete o2.type, Object.defineProperty(this, t2, i2 ? { get: () => T(t2, a2, o2) } : { value(...e3) {
277
+ const n2 = T(t2, a2, o2);
278
+ return n2.validator && (n2.validator = n2.validator.bind(n2, ...e3)), n2;
269
279
  } });
270
- let s;
271
- return s = i ? { get() {
272
- const u = Object.assign({}, a);
273
- return t ? d(r, u) : f(r, u);
274
- }, enumerable: !0 } : { value(...u) {
275
- const l = Object.assign({}, a);
276
- let p;
277
- return p = t ? d(r, l) : f(r, l), l.validator && (p.validator = l.validator.bind(p, ...u)), p;
278
- }, enumerable: !0 }, Object.defineProperty(this, r, s);
280
+ let s2;
281
+ return s2 = i2 ? { get() {
282
+ const e3 = Object.assign({}, o2);
283
+ return r2 ? _(t2, e3) : j(t2, e3);
284
+ }, enumerable: true } : { value(...e3) {
285
+ const n2 = Object.assign({}, o2);
286
+ let i3;
287
+ return i3 = r2 ? _(t2, n2) : j(t2, n2), n2.validator && (i3.validator = n2.validator.bind(i3, ...e3)), i3;
288
+ }, enumerable: true }, Object.defineProperty(this, t2, s2);
279
289
  }
280
- }).defaults = {}, e.sensibleDefaults = void 0, e.config = _, e.custom = H, e.oneOf = K, e.instanceOf = X, e.oneOfType = Q, e.arrayOf = W, e.objectOf = Z, e.shape = ee, e.utils = { validate: (n, r) => v(r, n, !0) === !0, toType: (n, r, t = !1) => t ? d(n, r) : f(n, r) }, e))();
281
- function B(e = { func: () => {
282
- }, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
283
- var n;
284
- return (n = class extends ne {
290
+ }).defaults = {}, e.sensibleDefaults = void 0, e.config = r, e.custom = D, e.oneOf = L, e.instanceOf = Y, e.oneOfType = B, e.arrayOf = F, e.objectOf = I, e.shape = J, e.utils = { validate: (e2, t2) => true === m(t2, e2, true), toType: (e2, t2, n2 = false) => n2 ? _(e2, t2) : j(e2, t2) }, e))();
291
+ function U(e = { func: () => {
292
+ }, bool: true, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
293
+ var n2;
294
+ return (n2 = class extends R {
285
295
  static get sensibleDefaults() {
286
- return O({}, this.defaults);
296
+ return t({}, this.defaults);
287
297
  }
288
- static set sensibleDefaults(r) {
289
- this.defaults = r !== !1 ? O({}, r !== !0 ? r : e) : {};
298
+ static set sensibleDefaults(n3) {
299
+ this.defaults = false !== n3 ? t({}, true !== n3 ? n3 : e) : {};
290
300
  }
291
- }).defaults = O({}, e), n;
301
+ }).defaults = t({}, e), n2;
292
302
  }
293
- class ie extends B() {
303
+ class z extends U() {
294
304
  }
295
- const re = B({
305
+ const PropTypes = U({
296
306
  func: void 0,
297
307
  bool: void 0,
298
308
  string: void 0,
@@ -301,31 +311,32 @@ const re = B({
301
311
  object: void 0,
302
312
  integer: void 0
303
313
  });
304
- re.extend([
314
+ PropTypes.extend([
305
315
  {
306
316
  name: "looseBool",
307
- getter: !0,
317
+ getter: true,
308
318
  type: Boolean,
309
319
  default: void 0
310
320
  },
311
321
  {
312
322
  name: "style",
313
- getter: !0,
323
+ getter: true,
314
324
  type: [String, Object],
315
325
  default: void 0
316
326
  },
317
327
  {
318
328
  name: "VueNode",
319
- getter: !0,
329
+ getter: true,
320
330
  // @ts-ignore
321
331
  type: null
322
332
  }
323
333
  ]);
324
- function oe(e) {
325
- return e.default = void 0, e;
334
+ function withUndefined(type) {
335
+ type.default = void 0;
336
+ return type;
326
337
  }
327
338
  export {
328
- re as default,
329
- oe as withUndefined
339
+ PropTypes as default,
340
+ withUndefined
330
341
  };
331
342
  //# sourceMappingURL=index.js.map