orion-design 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. package/README.md +5 -0
  2. package/dist/components/Button/Button.vue.d.ts +2 -0
  3. package/dist/components/Button/index.d.ts +4 -0
  4. package/dist/components/Button/index.js +27 -0
  5. package/dist/components/Button/index.js.map +1 -0
  6. package/dist/components/Flex/Col.d.ts +4 -4
  7. package/dist/components/Flex/Item.d.ts +4 -4
  8. package/dist/components/Flex/Row.d.ts +4 -4
  9. package/dist/components/Flex/index.d.ts +4 -4
  10. package/dist/components/Flex/index.js +95 -127
  11. package/dist/components/Flex/index.js.map +1 -0
  12. package/dist/components/Form/Form.d.ts +21 -0
  13. package/dist/components/Form/Form.js +5 -0
  14. package/dist/components/Form/Form.js.map +1 -0
  15. package/dist/components/Form/Form.vue.d.ts +465 -0
  16. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +15 -0
  17. package/dist/components/Form/PasswordInput/PasswordInput.js +2 -0
  18. package/dist/components/Form/PasswordInput/PasswordInput.js.map +1 -0
  19. package/dist/components/Form/PasswordInput/PasswordInput.vue.d.ts +3 -0
  20. package/dist/components/Form/PasswordInput/index.d.ts +1 -0
  21. package/dist/components/Form/PasswordInput/index.js +2 -0
  22. package/dist/components/Form/PasswordInput/index.js.map +1 -0
  23. package/dist/components/Form/StringInput/StringInput.d.ts +15 -0
  24. package/dist/components/Form/StringInput/StringInput.js +2 -0
  25. package/dist/components/Form/StringInput/StringInput.js.map +1 -0
  26. package/dist/components/Form/StringInput/StringInput.vue.d.ts +3 -0
  27. package/dist/components/Form/StringInput/index.d.ts +1 -0
  28. package/dist/components/Form/StringInput/index.js +2 -0
  29. package/dist/components/Form/StringInput/index.js.map +1 -0
  30. package/dist/components/Form/Textarea/Textarea.d.ts +16 -0
  31. package/dist/components/Form/Textarea/Textarea.js +2 -0
  32. package/dist/components/Form/Textarea/Textarea.js.map +1 -0
  33. package/dist/components/Form/Textarea/Textarea.vue.d.ts +3 -0
  34. package/dist/components/Form/Textarea/index.d.ts +1 -0
  35. package/dist/components/Form/Textarea/index.js +2 -0
  36. package/dist/components/Form/Textarea/index.js.map +1 -0
  37. package/dist/components/Form/hooks/useForm.d.ts +4 -0
  38. package/dist/components/Form/hooks/useForm.js +21 -0
  39. package/dist/components/Form/hooks/useForm.js.map +1 -0
  40. package/dist/components/Form/index.d.ts +273 -0
  41. package/dist/components/Form/index.js +194 -0
  42. package/dist/components/Form/index.js.map +1 -0
  43. package/dist/components/Modal/index.d.ts +1 -14
  44. package/dist/components/Modal/useModal.d.ts +1 -1
  45. package/dist/components/Modal/useModal.js +7 -7
  46. package/dist/components/Modal/useModal.js.map +1 -0
  47. package/dist/components/Pagetable/Pagetable.d.ts +79 -0
  48. package/dist/components/Pagetable/columns/PagetableDatecolumn.d.ts +88 -0
  49. package/dist/components/Pagetable/columns/PagetableStringcolumn.d.ts +62 -0
  50. package/dist/components/Pagetable/index.d.ts +60 -0
  51. package/dist/components/Pagetable/index.js +144 -0
  52. package/dist/components/Pagetable/index.js.map +1 -0
  53. package/dist/components/Pagetable/interface.d.ts +10 -0
  54. package/dist/components/Pagetable/interface.js +2 -0
  55. package/dist/components/Pagetable/interface.js.map +1 -0
  56. package/dist/components/Space/index.d.ts +9 -9
  57. package/dist/components/_util/arrays.d.ts +5 -0
  58. package/dist/components/_util/arrays.js +8 -0
  59. package/dist/components/_util/arrays.js.map +1 -0
  60. package/dist/components/_util/browser.d.ts +3 -0
  61. package/dist/components/_util/browser.js +9 -0
  62. package/dist/components/_util/browser.js.map +1 -0
  63. package/dist/components/_util/classNames.js +20 -27
  64. package/dist/components/_util/classNames.js.map +1 -0
  65. package/dist/components/_util/dom/aria.d.ts +30 -0
  66. package/dist/components/_util/dom/aria.js +46 -0
  67. package/dist/components/_util/dom/aria.js.map +1 -0
  68. package/dist/components/_util/dom/element.d.ts +3 -0
  69. package/dist/components/_util/dom/element.js +18 -0
  70. package/dist/components/_util/dom/element.js.map +1 -0
  71. package/dist/components/_util/dom/event.d.ts +6 -0
  72. package/dist/components/_util/dom/event.js +10 -0
  73. package/dist/components/_util/dom/event.js.map +1 -0
  74. package/dist/components/_util/dom/index.d.ts +6 -0
  75. package/dist/components/_util/dom/index.js +39 -0
  76. package/dist/components/_util/dom/index.js.map +1 -0
  77. package/dist/components/_util/dom/position.d.ts +7 -0
  78. package/dist/components/_util/dom/position.js +30 -0
  79. package/dist/components/_util/dom/position.js.map +1 -0
  80. package/dist/components/_util/dom/scroll.d.ts +11 -0
  81. package/dist/components/_util/dom/scroll.js +78 -0
  82. package/dist/components/_util/dom/scroll.js.map +1 -0
  83. package/dist/components/_util/dom/style.d.ts +9 -0
  84. package/dist/components/_util/dom/style.js +58 -0
  85. package/dist/components/_util/dom/style.js.map +1 -0
  86. package/dist/components/_util/easings.d.ts +1 -0
  87. package/dist/components/_util/easings.js +8 -0
  88. package/dist/components/_util/easings.js.map +1 -0
  89. package/dist/components/_util/error.d.ts +3 -0
  90. package/dist/components/_util/error.js +22 -0
  91. package/dist/components/_util/error.js.map +1 -0
  92. package/dist/components/_util/functions.d.ts +1 -0
  93. package/dist/components/_util/functions.js +6 -0
  94. package/dist/components/_util/functions.js.map +1 -0
  95. package/dist/components/_util/i18n.d.ts +1 -0
  96. package/dist/components/_util/i18n.js +5 -0
  97. package/dist/components/_util/i18n.js.map +1 -0
  98. package/dist/components/_util/index.d.ts +15 -0
  99. package/dist/components/_util/index.js +140 -0
  100. package/dist/components/_util/index.js.map +1 -0
  101. package/dist/components/_util/isValid.js +4 -4
  102. package/dist/components/_util/isValid.js.map +1 -0
  103. package/dist/components/_util/objects.d.ts +8 -0
  104. package/dist/components/_util/objects.js +17 -0
  105. package/dist/components/_util/objects.js.map +1 -0
  106. package/dist/components/_util/props-util/index.d.ts +4 -4
  107. package/dist/components/_util/props-util/index.js +23 -50
  108. package/dist/components/_util/props-util/index.js.map +1 -0
  109. package/dist/components/_util/props-util/initDefaultProps.d.ts +2 -2
  110. package/dist/components/_util/props-util/initDefaultProps.js +13 -24
  111. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -0
  112. package/dist/components/_util/raf.d.ts +2 -0
  113. package/dist/components/_util/raf.js +7 -0
  114. package/dist/components/_util/raf.js.map +1 -0
  115. package/dist/components/_util/rand.d.ts +12 -0
  116. package/dist/components/_util/rand.js +6 -0
  117. package/dist/components/_util/rand.js.map +1 -0
  118. package/dist/components/_util/strings.d.ts +6 -0
  119. package/dist/components/_util/strings.js +11 -0
  120. package/dist/components/_util/strings.js.map +1 -0
  121. package/dist/components/_util/throttleByRaf.d.ts +4 -0
  122. package/dist/components/_util/throttleByRaf.js +16 -0
  123. package/dist/components/_util/throttleByRaf.js.map +1 -0
  124. package/dist/components/_util/type.d.ts +1 -1
  125. package/dist/components/_util/type.js +48 -65
  126. package/dist/components/_util/type.js.map +1 -0
  127. package/dist/components/_util/types.d.ts +10 -0
  128. package/dist/components/_util/types.js +25 -0
  129. package/dist/components/_util/types.js.map +1 -0
  130. package/dist/components/_util/typescript.d.ts +12 -0
  131. package/dist/components/_util/typescript.js +5 -0
  132. package/dist/components/_util/typescript.js.map +1 -0
  133. package/dist/components/_util/util.d.ts +1 -1
  134. package/dist/components/_util/util.js +46 -74
  135. package/dist/components/_util/util.js.map +1 -0
  136. package/dist/components/_util/vue/global-node.d.ts +3 -0
  137. package/dist/components/_util/vue/global-node.js +21 -0
  138. package/dist/components/_util/vue/global-node.js.map +1 -0
  139. package/dist/components/_util/vue/icon.d.ts +23 -0
  140. package/dist/components/_util/vue/icon.js +154 -0
  141. package/dist/components/_util/vue/icon.js.map +1 -0
  142. package/dist/components/_util/vue/index.d.ts +9 -0
  143. package/dist/components/_util/vue/index.js +44 -0
  144. package/dist/components/_util/vue/index.js.map +1 -0
  145. package/dist/components/_util/vue/install.d.ts +6 -0
  146. package/dist/components/_util/vue/install.js +21 -0
  147. package/dist/components/_util/vue/install.js.map +1 -0
  148. package/dist/components/_util/vue/props/index.d.ts +3 -0
  149. package/dist/components/_util/vue/props/index.js +9 -0
  150. package/dist/components/_util/vue/props/index.js.map +1 -0
  151. package/dist/components/_util/vue/props/runtime.d.ts +29 -0
  152. package/dist/components/_util/vue/props/runtime.js +37 -0
  153. package/dist/components/_util/vue/props/runtime.js.map +1 -0
  154. package/dist/components/_util/vue/props/types.d.ts +120 -0
  155. package/dist/components/_util/vue/props/types.js +2 -0
  156. package/dist/components/_util/vue/props/types.js.map +1 -0
  157. package/dist/components/_util/vue/props/util.d.ts +8 -0
  158. package/dist/components/_util/vue/props/util.js +2 -0
  159. package/dist/components/_util/vue/props/util.js.map +1 -0
  160. package/dist/components/_util/vue/refs.d.ts +3 -0
  161. package/dist/components/_util/vue/refs.js +12 -0
  162. package/dist/components/_util/vue/refs.js.map +1 -0
  163. package/dist/components/_util/vue/size.d.ts +2 -0
  164. package/dist/components/_util/vue/size.js +6 -0
  165. package/dist/components/_util/vue/size.js.map +1 -0
  166. package/dist/components/_util/vue/typescript.d.ts +5 -0
  167. package/dist/components/_util/vue/typescript.js +2 -0
  168. package/dist/components/_util/vue/typescript.js.map +1 -0
  169. package/dist/components/_util/vue/validator.d.ts +3 -0
  170. package/dist/components/_util/vue/validator.js +7 -0
  171. package/dist/components/_util/vue/validator.js.map +1 -0
  172. package/dist/components/_util/vue/vnode.d.ts +50 -0
  173. package/dist/components/_util/vue/vnode.js +68 -0
  174. package/dist/components/_util/vue/vnode.js.map +1 -0
  175. package/dist/components/_util/vue-types/index.d.ts +3 -3
  176. package/dist/components/_util/vue-types/index.js +275 -417
  177. package/dist/components/_util/vue-types/index.js.map +1 -0
  178. package/dist/components/components.d.ts +4 -0
  179. package/dist/components/components.js +18 -12
  180. package/dist/components/components.js.map +1 -0
  181. package/dist/components/index.d.ts +1 -1
  182. package/dist/components/index.js +25 -24
  183. package/dist/components/index.js.map +1 -0
  184. package/dist/components-BZukhWDk.js +106 -0
  185. package/dist/components-BZukhWDk.js.map +1 -0
  186. package/dist/error/OrionError.js +7 -12
  187. package/dist/error/OrionError.js.map +1 -0
  188. package/dist/functions-DzLqXvGt.js +33 -0
  189. package/dist/functions-DzLqXvGt.js.map +1 -0
  190. package/dist/index-C8JNJPWW.js +8 -0
  191. package/dist/index-C8JNJPWW.js.map +1 -0
  192. package/dist/index.css +1 -44
  193. package/dist/index.d.ts +1 -1
  194. package/dist/index.js +24 -14
  195. package/dist/index.js.map +1 -0
  196. package/dist/print/LodopFuncs.js +48 -111
  197. package/dist/print/LodopFuncs.js.map +1 -0
  198. package/dist/print/index.d.ts +2 -2
  199. package/dist/print/index.js +111 -220
  200. package/dist/print/index.js.map +1 -0
  201. package/dist/request/ErrorHandlerChain.js +17 -15
  202. package/dist/request/ErrorHandlerChain.js.map +1 -0
  203. package/dist/request/RequestFilterChain.d.ts +1 -1
  204. package/dist/request/RequestFilterChain.js +16 -14
  205. package/dist/request/RequestFilterChain.js.map +1 -0
  206. package/dist/request/ResponseParserChain.d.ts +1 -1
  207. package/dist/request/ResponseParserChain.js +17 -15
  208. package/dist/request/ResponseParserChain.js.map +1 -0
  209. package/dist/request/disivion/DateSerializer.js +25 -46
  210. package/dist/request/disivion/DateSerializer.js.map +1 -0
  211. package/dist/request/disivion/DivisionErrorHandler.d.ts +1 -1
  212. package/dist/request/disivion/DivisionErrorHandler.js +30 -52
  213. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -0
  214. package/dist/request/disivion/DivisionResponseParser.d.ts +2 -2
  215. package/dist/request/disivion/DivisionResponseParser.js +13 -25
  216. package/dist/request/disivion/DivisionResponseParser.js.map +1 -0
  217. package/dist/request/disivion/index.d.ts +3 -3
  218. package/dist/request/disivion/index.js +230 -480
  219. package/dist/request/disivion/index.js.map +1 -0
  220. package/dist/request/error/BizExceptionResponseError.d.ts +2 -2
  221. package/dist/request/error/BizExceptionResponseError.js +8 -15
  222. package/dist/request/error/BizExceptionResponseError.js.map +1 -0
  223. package/dist/request/error/ExceptionResponseError.d.ts +2 -2
  224. package/dist/request/error/ExceptionResponseError.js +8 -15
  225. package/dist/request/error/ExceptionResponseError.js.map +1 -0
  226. package/dist/request/error/ResponseError.d.ts +1 -1
  227. package/dist/request/error/ResponseError.js +7 -14
  228. package/dist/request/error/ResponseError.js.map +1 -0
  229. package/dist/request/error/SessionExceptionResponseError.d.ts +2 -2
  230. package/dist/request/error/SessionExceptionResponseError.js +8 -15
  231. package/dist/request/error/SessionExceptionResponseError.js.map +1 -0
  232. package/dist/request/index.js +11 -17
  233. package/dist/request/index.js.map +1 -0
  234. package/dist/style/index.d.ts +0 -3
  235. package/dist/style/index.js +1 -0
  236. package/dist/style/index.js.map +1 -0
  237. package/dist/utils/DateUtil.js +36 -50
  238. package/dist/utils/DateUtil.js.map +1 -0
  239. package/dist/utils/NumberUtil.js +9 -8
  240. package/dist/utils/NumberUtil.js.map +1 -0
  241. package/dist/utils/cloneDeep.js +5 -1
  242. package/dist/utils/cloneDeep.js.map +1 -0
  243. package/dist/utils/delay.js +6 -4
  244. package/dist/utils/delay.js.map +1 -0
  245. package/dist/utils/functions.d.ts +1 -0
  246. package/dist/utils/functions.js +6 -0
  247. package/dist/utils/functions.js.map +1 -0
  248. package/dist/utils/index.js +15 -9
  249. package/dist/utils/index.js.map +1 -0
  250. package/dist/utils/md5.js +121 -244
  251. package/dist/utils/md5.js.map +1 -0
  252. package/dist/utils/uuid.js +28 -58
  253. package/dist/utils/uuid.js.map +1 -0
  254. package/dist/utils/vue/install.d.ts +6 -0
  255. package/dist/utils/vue/install.js +21 -0
  256. package/dist/utils/vue/install.js.map +1 -0
  257. package/dist/utils/vue/typescript.d.ts +5 -0
  258. package/dist/utils/vue/typescript.js +2 -0
  259. package/dist/utils/vue/typescript.js.map +1 -0
  260. package/dist/version/index.d.ts +1 -1
  261. package/dist/version/index.js +5 -6
  262. package/dist/version/index.js.map +1 -0
  263. package/dist/version/version.d.ts +1 -1
  264. package/dist/version/version.js +5 -3
  265. package/dist/version/version.js.map +1 -0
  266. package/dist/vite.svg +1 -0
  267. package/global.d.ts +6 -0
  268. package/package.json +52 -63
  269. package/dist/components-DhjIbmR3.js +0 -128
@@ -4,470 +4,328 @@
4
4
  * Copyright (c) 2014-2017, Jon Schlinkert.
5
5
  * Released under the MIT License.
6
6
  */
7
-
8
- function isObject(o) {
9
- return Object.prototype.toString.call(o) === '[object Object]';
7
+ function $(e) {
8
+ return Object.prototype.toString.call(e) === "[object Object]";
10
9
  }
11
-
12
- function isPlainObject(o) {
13
- var ctor,prot;
14
-
15
- if (isObject(o) === false) return false;
16
-
17
- // If has modified constructor
18
- ctor = o.constructor;
19
- if (ctor === undefined) return true;
20
-
21
- // If has modified prototype
22
- prot = ctor.prototype;
23
- if (isObject(prot) === false) return false;
24
-
25
- // If constructor does not have an Object-specific method
26
- if (prot.hasOwnProperty('isPrototypeOf') === false) {
27
- return false;
28
- }
29
-
30
- // Most likely a plain Object
31
- return true;
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)));
32
13
  }
33
-
34
- function t() {
35
- return t = Object.assign ? Object.assign.bind() : function (e) {
36
- for (var t = 1; t < arguments.length; t++) {
37
- var n = arguments[t];
38
- for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
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]);
39
19
  }
40
20
  return e;
41
- }, t.apply(this, arguments);
21
+ }, O.apply(this, arguments);
42
22
  }
43
- function n(e, t) {
44
- if (null == e) return {};
45
- var n = {};
46
- for (var r in e) if (Object.prototype.hasOwnProperty.call(e, r)) {
47
- if (t.indexOf(r) >= 0) continue;
48
- n[r] = e[r];
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];
49
29
  }
50
- return n;
30
+ return r;
51
31
  }
52
- const r = {
53
- silent: !1,
54
- logLevel: "warn"
55
- },
56
- i = ["validator"],
57
- o = Object.prototype,
58
- a = o.toString,
59
- s = o.hasOwnProperty,
60
- u = /^\s*function (\w+)/;
61
- function l(e) {
62
- var t;
63
- const n = null !== (t = null == e ? void 0 : e.type) && void 0 !== t ? t : e;
64
- if (n) {
65
- const e = n.toString().match(u);
66
- return e ? e[1] : "";
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] : "";
67
39
  }
68
40
  return "";
69
41
  }
70
- const c = isPlainObject;
71
- function f() {}
72
- let d = f;
73
- if ("production" !== process.env.NODE_ENV) {
74
- const e = "undefined" != typeof console;
75
- d = e ? function (e, t = r.logLevel) {
76
- !1 === r.silent && console[t](`[VueTypes warn]: ${e}`);
77
- } : f;
42
+ const y = k;
43
+ function V() {
78
44
  }
79
- const p = (e, t) => s.call(e, t),
80
- y = Number.isInteger || function (e) {
81
- return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
82
- },
83
- v = Array.isArray || function (e) {
84
- return "[object Array]" === a.call(e);
85
- },
86
- h = e => "[object Function]" === a.call(e),
87
- b = (e, t) => c(e) && p(e, "_vueTypes_name") && (!t || e._vueTypes_name === t),
88
- g = e => c(e) && (p(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some(t => p(e, t)));
89
- function O(e, t) {
90
- return Object.defineProperty(e.bind(t), "__original", {
91
- value: e
92
- });
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 });
93
56
  }
94
- function m(e, t, n = !1) {
95
- let r,
96
- i = !0,
97
- o = "";
98
- r = c(e) ? e : {
99
- type: e
100
- };
101
- const a = b(r) ? r._vueTypes_name + " - " : "";
102
- if (g(r) && null !== r.type) {
103
- if (void 0 === r.type || !0 === r.type) return i;
104
- if (!r.required && null == t) return i;
105
- v(r.type) ? (i = r.type.some(e => !0 === m(e, t, !0)), o = r.type.map(e => l(e)).join(" or ")) : (o = l(r), i = "Array" === o ? v(t) : "Object" === o ? c(t) : "String" === o || "Number" === o || "Boolean" === o || "Function" === o ? function (e) {
106
- if (null == e) return "";
107
- const t = e.constructor.toString().match(u);
108
- return t ? t[1].replace(/^Async/, "") : "";
109
- }(t) === o : t instanceof r.type);
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);
110
68
  }
111
69
  if (!i) {
112
- const e = `${a}value "${t}" should be of type "${o}"`;
113
- return !1 === n ? (d(e), !1) : e;
70
+ const s = `${o}value "${n}" should be of type "${a}"`;
71
+ return r === !1 ? (c(s), !1) : s;
114
72
  }
115
- if (p(r, "validator") && h(r.validator)) {
116
- const e = d,
117
- o = [];
118
- if (d = e => {
119
- o.push(e);
120
- }, i = r.validator(t), d = e, !i) {
121
- const e = (o.length > 1 ? "* " : "") + o.join("\n* ");
122
- return o.length = 0, !1 === n ? (d(e), i) : e;
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;
123
81
  }
124
82
  }
125
83
  return i;
126
84
  }
127
- function j(e, t) {
128
- const n = Object.defineProperties(t, {
129
- _vueTypes_name: {
130
- value: e,
131
- writable: !0
132
- },
133
- isRequired: {
134
- get() {
135
- return this.required = !0, this;
136
- }
137
- },
138
- def: {
139
- value(e) {
140
- return void 0 === e ? this.type === Boolean || Array.isArray(this.type) && this.type.includes(Boolean) ? void (this.default = void 0) : (p(this, "default") && delete this.default, this) : h(e) || !0 === m(this, e, !0) ? (this.default = v(e) ? () => [...e] : c(e) ? () => Object.assign({}, e) : e, this) : (d(`${this._vueTypes_name} - invalid default value: "${e}"`), this);
141
- }
142
- }
143
- }),
144
- {
145
- validator: r
146
- } = n;
147
- return h(r) && (n.validator = O(r, n)), n;
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;
148
92
  }
149
- function _(e, t) {
150
- const n = j(e, t);
151
- return Object.defineProperty(n, "validate", {
152
- value(e) {
153
- return h(this.validator) && d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`), this.validator = O(e, this), this;
154
- }
155
- });
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;
98
+ } });
156
99
  }
157
- function T(e, t, r) {
158
- const o = function (e) {
159
- const t = {};
160
- return Object.getOwnPropertyNames(e).forEach(n => {
161
- t[n] = Object.getOwnPropertyDescriptor(e, n);
162
- }), Object.defineProperties({}, t);
163
- }(t);
164
- if (o._vueTypes_name = e, !c(r)) return o;
165
- const {
166
- validator: a
167
- } = r,
168
- s = n(r, i);
169
- if (h(a)) {
170
- let {
171
- validator: e
172
- } = o;
173
- e && (e = null !== (l = (u = e).__original) && void 0 !== l ? l : u), o.validator = O(e ? function (t) {
174
- return e.call(this, t) && a.call(this, t);
175
- } : a, o);
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);
176
114
  }
177
- var u, l;
178
- return Object.assign(o, s);
115
+ var o, s;
116
+ return Object.assign(t, a);
179
117
  }
180
- function $(e) {
118
+ function j(e) {
181
119
  return e.replace(/^(?!\s*$)/gm, " ");
182
120
  }
183
- const w = () => _("any", {}),
184
- x = () => _("function", {
185
- type: Function
186
- }),
187
- P = () => _("boolean", {
188
- type: Boolean
189
- }),
190
- A = () => _("string", {
191
- type: String
192
- }),
193
- E = () => _("number", {
194
- type: Number
195
- }),
196
- S = () => _("array", {
197
- type: Array
198
- }),
199
- N = () => _("object", {
200
- type: Object
201
- }),
202
- V = () => j("integer", {
203
- type: Number,
204
- validator(e) {
205
- const t = y(e);
206
- return !1 === t && d(`integer - "${e}" is not an integer`), t;
207
- }
208
- }),
209
- q = () => j("symbol", {
210
- validator(e) {
211
- const t = "symbol" == typeof e;
212
- return !1 === t && d(`symbol - invalid value "${e}"`), t;
213
- }
214
- }),
215
- k = () => Object.defineProperty({
216
- type: null,
217
- validator(e) {
218
- const t = null === e;
219
- return !1 === t && d("nullable - value should be null"), t;
220
- }
221
- }, "_vueTypes_name", {
222
- value: "nullable"
223
- });
224
- function D(e, t = "custom validation failed") {
225
- if ("function" != typeof e) throw new TypeError("[VueTypes error]: You must provide a function as argument");
226
- return j(e.name || "<<anonymous function>>", {
227
- type: null,
228
- validator(n) {
229
- const r = e(n);
230
- return r || d(`${this._vueTypes_name} - ${t}`), r;
231
- }
232
- });
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;
130
+ } }, "_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;
136
+ } });
233
137
  }
234
- function L(e) {
235
- if (!v(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
236
- const t = `oneOf - value should be one of "${e.map(e => "symbol" == typeof e ? e.toString() : e).join('", "')}".`,
237
- n = {
238
- validator(n) {
239
- const r = -1 !== e.indexOf(n);
240
- return r || d(t), r;
241
- }
242
- };
243
- if (-1 === e.indexOf(null)) {
244
- const t = e.reduce((e, t) => {
245
- if (null != t) {
246
- const n = t.constructor;
247
- -1 === e.indexOf(n) && e.push(n);
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;
143
+ } };
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);
248
149
  }
249
- return e;
150
+ return i;
250
151
  }, []);
251
- t.length > 0 && (n.type = t);
152
+ t.length > 0 && (r.type = t);
252
153
  }
253
- return j("oneOf", n);
154
+ return f("oneOf", r);
254
155
  }
255
- function B(e) {
256
- if (!v(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
257
- let t = !1,
258
- n = !1,
259
- r = [];
260
- for (let i = 0; i < e.length; i += 1) {
261
- const o = e[i];
262
- if (g(o)) {
263
- if (h(o.validator) && (t = !0), b(o, "oneOf") && o.type) {
264
- r = r.concat(o.type);
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);
265
164
  continue;
266
165
  }
267
- if (b(o, "nullable")) {
268
- n = !0;
166
+ if (m(o, "nullable")) {
167
+ r = !0;
269
168
  continue;
270
169
  }
271
- if (!0 === o.type || !o.type) {
272
- d('oneOfType - invalid usage of "true" and "null" as types.');
170
+ if (o.type === !0 || !o.type) {
171
+ c('oneOfType - invalid usage of "true" and "null" as types.');
273
172
  continue;
274
173
  }
275
- r = r.concat(o.type);
276
- } else r.push(o);
174
+ t = t.concat(o.type);
175
+ } else t.push(o);
277
176
  }
278
- r = r.filter((e, t) => r.indexOf(e) === t);
279
- const i = !1 === n && r.length > 0 ? r : null;
280
- return j("oneOfType", t ? {
281
- type: i,
282
- validator(t) {
283
- const n = [],
284
- r = e.some(e => {
285
- const r = m(e, t, !0);
286
- return "string" == typeof r && n.push(r), !0 === r;
287
- });
288
- return r || d(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${$(n.join("\n"))}`), r;
289
- }
290
- } : {
291
- type: i
292
- });
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;
183
+ });
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 });
293
188
  }
294
- function F(e) {
295
- return j("arrayOf", {
296
- type: Array,
297
- validator(t) {
298
- let n = "";
299
- const r = t.every(t => (n = m(e, t, !0), !0 === n));
300
- return r || d(`arrayOf - value validation error:\n${$(n)}`), r;
301
- }
302
- });
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;
195
+ } });
303
196
  }
304
- function Y(e) {
305
- return j("instanceOf", {
306
- type: e
307
- });
197
+ function X(e) {
198
+ return f("instanceOf", { type: e });
308
199
  }
309
- function I(e) {
310
- return j("objectOf", {
311
- type: Object,
312
- validator(t) {
313
- let n = "";
314
- const r = Object.keys(t).every(r => (n = m(e, t[r], !0), !0 === n));
315
- return r || d(`objectOf - value validation error:\n${$(n)}`), r;
316
- }
317
- });
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;
206
+ } });
318
207
  }
319
- function J(e) {
320
- const t = Object.keys(e),
321
- n = t.filter(t => {
322
- var n;
323
- return !(null === (n = e[t]) || void 0 === n || !n.required);
324
- }),
325
- r = j("shape", {
326
- type: Object,
327
- validator(r) {
328
- if (!c(r)) return !1;
329
- const i = Object.keys(r);
330
- if (n.length > 0 && n.some(e => -1 === i.indexOf(e))) {
331
- const e = n.filter(e => -1 === i.indexOf(e));
332
- return d(1 === e.length ? `shape - required property "${e[0]}" is not defined.` : `shape - required properties "${e.join('", "')}" are not defined.`), !1;
333
- }
334
- return i.every(n => {
335
- if (-1 === t.indexOf(n)) return !0 === this._vueTypes_isLoose || (d(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`), !1);
336
- const i = m(e[n], r[n], !0);
337
- return "string" == typeof i && d(`shape - "${n}" property validation error:\n ${$(i)}`), !0 === i;
338
- });
339
- }
340
- });
341
- return Object.defineProperty(r, "_vueTypes_isLoose", {
342
- writable: !0,
343
- value: !1
344
- }), Object.defineProperty(r, "loose", {
345
- get() {
346
- return this._vueTypes_isLoose = !0, this;
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;
347
218
  }
348
- }), r;
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;
224
+ });
225
+ } });
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;
349
229
  }
350
- const M = ["name", "validate", "getter"],
351
- R = /*#__PURE__*/(e => ((e = class {
352
- static get any() {
353
- return w();
354
- }
355
- static get func() {
356
- return x().def(this.defaults.func);
357
- }
358
- static get bool() {
359
- return void 0 === this.defaults.bool ? P() : P().def(this.defaults.bool);
360
- }
361
- static get string() {
362
- return A().def(this.defaults.string);
363
- }
364
- static get number() {
365
- return E().def(this.defaults.number);
366
- }
367
- static get array() {
368
- return S().def(this.defaults.array);
369
- }
370
- static get object() {
371
- return N().def(this.defaults.object);
372
- }
373
- static get integer() {
374
- return V().def(this.defaults.integer);
375
- }
376
- static get symbol() {
377
- return q();
378
- }
379
- static get nullable() {
380
- return k();
381
- }
382
- static extend(e) {
383
- 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(e)) return e.forEach(e => this.extend(e)), this;
384
- const {
385
- name: t,
386
- validate: r = !1,
387
- getter: i = !1
388
- } = e,
389
- o = n(e, M);
390
- if (p(this, t)) throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);
391
- const {
392
- type: a
393
- } = o;
394
- if (b(a)) return delete o.type, Object.defineProperty(this, t, i ? {
395
- get: () => T(t, a, o)
396
- } : {
397
- value(...e) {
398
- const n = T(t, a, o);
399
- return n.validator && (n.validator = n.validator.bind(n, ...e)), n;
400
- }
401
- });
402
- let s;
403
- return s = i ? {
404
- get() {
405
- const e = Object.assign({}, o);
406
- return r ? _(t, e) : j(t, e);
407
- },
408
- enumerable: !0
409
- } : {
410
- value(...e) {
411
- const n = Object.assign({}, o);
412
- let i;
413
- return i = r ? _(t, n) : j(t, n), n.validator && (i.validator = n.validator.bind(i, ...e)), i;
414
- },
415
- enumerable: !0
416
- }, Object.defineProperty(this, t, s);
417
- }
418
- }).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 = {
419
- validate: (e, t) => !0 === m(t, e, !0),
420
- toType: (e, t, n = !1) => n ? _(e, t) : j(e, t)
421
- }, e))();
422
- function U(e = {
423
- func: () => {},
424
- bool: !0,
425
- string: "",
426
- number: 0,
427
- array: () => [],
428
- object: () => ({}),
429
- integer: 0
430
- }) {
230
+ const te = ["name", "validate", "getter"], ne = /* @__PURE__ */ ((e) => ((e = class {
231
+ static get any() {
232
+ return Y();
233
+ }
234
+ static get func() {
235
+ return U().def(this.defaults.func);
236
+ }
237
+ static get bool() {
238
+ return this.defaults.bool === void 0 ? x() : x().def(this.defaults.bool);
239
+ }
240
+ static get string() {
241
+ return I().def(this.defaults.string);
242
+ }
243
+ static get number() {
244
+ return J().def(this.defaults.number);
245
+ }
246
+ static get array() {
247
+ return M().def(this.defaults.array);
248
+ }
249
+ static get object() {
250
+ return R().def(this.defaults.object);
251
+ }
252
+ static get integer() {
253
+ return z().def(this.defaults.integer);
254
+ }
255
+ static get symbol() {
256
+ return C();
257
+ }
258
+ static get nullable() {
259
+ return G();
260
+ }
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;
269
+ } });
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);
279
+ }
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 }) {
431
283
  var n;
432
- return (n = class extends R {
284
+ return (n = class extends ne {
433
285
  static get sensibleDefaults() {
434
- return t({}, this.defaults);
286
+ return O({}, this.defaults);
435
287
  }
436
- static set sensibleDefaults(n) {
437
- this.defaults = !1 !== n ? t({}, !0 !== n ? n : e) : {};
288
+ static set sensibleDefaults(r) {
289
+ this.defaults = r !== !1 ? O({}, r !== !0 ? r : e) : {};
438
290
  }
439
- }).defaults = t({}, e), n;
291
+ }).defaults = O({}, e), n;
292
+ }
293
+ class ie extends B() {
440
294
  }
441
- class z extends U() {}
442
-
443
- const PropTypes = U({
444
- func: undefined,
445
- bool: undefined,
446
- string: undefined,
447
- number: undefined,
448
- array: undefined,
449
- object: undefined,
450
- integer: undefined
295
+ const re = B({
296
+ func: void 0,
297
+ bool: void 0,
298
+ string: void 0,
299
+ number: void 0,
300
+ array: void 0,
301
+ object: void 0,
302
+ integer: void 0
451
303
  });
452
- PropTypes.extend([{
453
- name: 'looseBool',
454
- getter: true,
455
- type: Boolean,
456
- default: undefined
457
- }, {
458
- name: 'style',
459
- getter: true,
460
- type: [String, Object],
461
- default: undefined
462
- }, {
463
- name: 'VueNode',
464
- getter: true,
465
- // @ts-ignore
466
- type: null
467
- }]);
468
- function withUndefined(type) {
469
- type.default = undefined;
470
- return type;
304
+ re.extend([
305
+ {
306
+ name: "looseBool",
307
+ getter: !0,
308
+ type: Boolean,
309
+ default: void 0
310
+ },
311
+ {
312
+ name: "style",
313
+ getter: !0,
314
+ type: [String, Object],
315
+ default: void 0
316
+ },
317
+ {
318
+ name: "VueNode",
319
+ getter: !0,
320
+ // @ts-ignore
321
+ type: null
322
+ }
323
+ ]);
324
+ function oe(e) {
325
+ return e.default = void 0, e;
471
326
  }
472
-
473
- export { PropTypes as default, withUndefined };
327
+ export {
328
+ re as default,
329
+ oe as withUndefined
330
+ };
331
+ //# sourceMappingURL=index.js.map