orion-design 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/Throne/index.js +30 -14
- package/dist/Throne/index.js.map +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
- package/dist/components/Button/index.js +40 -33
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +122 -89
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +128 -66
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.js +836 -656
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +30 -18
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/index.js +179 -105
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/index.js +111 -56
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.js +4 -3
- package/dist/components/Modal/types.js.map +1 -1
- package/dist/components/Modal/useModal.js +5 -5
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/Pagetable/hooks/useColumns.js +88 -80
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.js +687 -542
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +92 -54
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/hooks/useColumns.js +82 -74
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.js +579 -469
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +92 -54
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +100 -74
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +603 -358
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +6 -4
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +74 -39
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +29 -19
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +9 -5
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +22 -17
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +74 -39
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +9 -8
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +14 -7
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +49 -25
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +103 -61
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +65 -50
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +8 -4
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +12 -11
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +4 -2
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +18 -14
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +46 -20
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +18 -10
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +5 -4
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +4 -3
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +9 -8
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +16 -10
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +41 -38
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +41 -22
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +85 -43
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +27 -15
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +29 -25
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +35 -18
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +46 -30
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +12 -6
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +5 -3
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +5 -4
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +100 -54
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +231 -220
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.js +20 -20
- package/dist/components/index.js +38 -35
- package/dist/components/index.js.map +1 -1
- package/dist/components-B3d9m_tn.js +27 -0
- package/dist/components-B3d9m_tn.js.map +1 -0
- package/dist/error/OrionError.js +8 -4
- package/dist/error/OrionError.js.map +1 -1
- package/dist/functions-BeMkokbY.js +63 -0
- package/dist/functions-BeMkokbY.js.map +1 -0
- package/dist/index-BOKLZnqH.js +54 -0
- package/dist/index-BOKLZnqH.js.map +1 -0
- package/dist/index-D1m0KTpK.js +69 -0
- package/dist/index-D1m0KTpK.js.map +1 -0
- package/dist/index-DR5ZP7mD.js +160 -0
- package/dist/index-DR5ZP7mD.js.map +1 -0
- package/dist/index-DkwIULcN.js +200 -0
- package/dist/index-DkwIULcN.js.map +1 -0
- package/dist/index.css +797 -1
- package/dist/index.js +36 -36
- package/dist/print/LodopFuncs.js +101 -43
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +200 -108
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +17 -14
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +16 -13
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +17 -14
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +47 -22
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +40 -25
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +16 -10
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +305 -201
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +11 -5
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +11 -5
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +9 -4
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +11 -5
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +48 -33
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +191 -93
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +35 -25
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
@@ -4,295 +4,305 @@
|
|
4
4
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
5
5
|
* Released under the MIT License.
|
6
6
|
*/
|
7
|
-
function
|
8
|
-
return Object.prototype.toString.call(
|
7
|
+
function isObject(o2) {
|
8
|
+
return Object.prototype.toString.call(o2) === "[object Object]";
|
9
9
|
}
|
10
|
-
function
|
11
|
-
var
|
12
|
-
|
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
|
15
|
-
return
|
16
|
-
for (var
|
17
|
-
var
|
18
|
-
for (var
|
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
|
-
},
|
29
|
+
}, t.apply(this, arguments);
|
22
30
|
}
|
23
|
-
function
|
24
|
-
if (
|
25
|
-
var
|
26
|
-
for (var
|
27
|
-
if (
|
28
|
-
|
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
|
38
|
+
return n2;
|
31
39
|
}
|
32
|
-
const
|
33
|
-
function
|
34
|
-
var
|
35
|
-
const
|
36
|
-
if (
|
37
|
-
const
|
38
|
-
return
|
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
|
43
|
-
function
|
50
|
+
const c = isPlainObject;
|
51
|
+
function f() {
|
44
52
|
}
|
45
|
-
let
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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 (!
|
70
|
-
const
|
71
|
-
return
|
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 (
|
74
|
-
const
|
75
|
-
if (
|
76
|
-
|
77
|
-
},
|
78
|
-
const
|
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
|
94
|
+
return i2;
|
84
95
|
}
|
85
|
-
function
|
86
|
-
const
|
87
|
-
return this.required =
|
88
|
-
} }, def: { value(
|
89
|
-
return
|
90
|
-
} } }), { validator:
|
91
|
-
return
|
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
|
94
|
-
const
|
95
|
-
return Object.defineProperty(
|
96
|
-
return
|
97
|
-
${JSON.stringify(this)}`), this.validator =
|
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
|
101
|
-
const
|
102
|
-
const
|
103
|
-
return Object.getOwnPropertyNames(
|
104
|
-
|
105
|
-
}), Object.defineProperties({},
|
106
|
-
}(
|
107
|
-
if (
|
108
|
-
const { validator:
|
109
|
-
if (
|
110
|
-
let { validator:
|
111
|
-
|
112
|
-
return
|
113
|
-
} :
|
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
|
116
|
-
return Object.assign(
|
126
|
+
var u2, l2;
|
127
|
+
return Object.assign(o2, s2);
|
117
128
|
}
|
118
|
-
function
|
129
|
+
function $(e) {
|
119
130
|
return e.replace(/^(?!\s*$)/gm, " ");
|
120
131
|
}
|
121
|
-
const
|
122
|
-
const
|
123
|
-
return
|
124
|
-
} }),
|
125
|
-
const
|
126
|
-
return
|
127
|
-
} }),
|
128
|
-
const
|
129
|
-
return
|
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
|
132
|
-
if (typeof e
|
133
|
-
return
|
134
|
-
const
|
135
|
-
return
|
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
|
139
|
-
if (!
|
140
|
-
const
|
141
|
-
const
|
142
|
-
return
|
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)
|
145
|
-
const
|
146
|
-
if (
|
147
|
-
const
|
148
|
-
|
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
|
161
|
+
return e2;
|
151
162
|
}, []);
|
152
|
-
|
163
|
+
t3.length > 0 && (n2.type = t3);
|
153
164
|
}
|
154
|
-
return
|
165
|
+
return j("oneOf", n2);
|
155
166
|
}
|
156
|
-
function
|
157
|
-
if (!
|
158
|
-
let
|
159
|
-
for (let
|
160
|
-
const
|
161
|
-
if (
|
162
|
-
if (
|
163
|
-
|
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 (
|
167
|
-
|
177
|
+
if (b(o2, "nullable")) {
|
178
|
+
n2 = true;
|
168
179
|
continue;
|
169
180
|
}
|
170
|
-
if (
|
171
|
-
|
181
|
+
if (true === o2.type || !o2.type) {
|
182
|
+
d('oneOfType - invalid usage of "true" and "null" as types.');
|
172
183
|
continue;
|
173
184
|
}
|
174
|
-
|
175
|
-
} else
|
185
|
+
r2 = r2.concat(o2.type);
|
186
|
+
} else r2.push(o2);
|
176
187
|
}
|
177
|
-
|
178
|
-
const
|
179
|
-
return
|
180
|
-
const
|
181
|
-
const
|
182
|
-
return
|
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
|
185
|
-
${
|
186
|
-
|
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
|
190
|
-
return
|
191
|
-
let
|
192
|
-
const
|
193
|
-
return
|
194
|
-
${
|
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
|
198
|
-
return
|
207
|
+
function Y(e) {
|
208
|
+
return j("instanceOf", { type: e });
|
199
209
|
}
|
200
|
-
function
|
201
|
-
return
|
202
|
-
let
|
203
|
-
const
|
204
|
-
return
|
205
|
-
${
|
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
|
209
|
-
const
|
210
|
-
var
|
211
|
-
return !((
|
212
|
-
}),
|
213
|
-
if (!
|
214
|
-
const
|
215
|
-
if (
|
216
|
-
const
|
217
|
-
return
|
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
|
220
|
-
if (
|
221
|
-
const
|
222
|
-
return
|
223
|
-
${
|
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(
|
227
|
-
return this._vueTypes_isLoose =
|
228
|
-
} }),
|
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
|
240
|
+
const M = ["name", "validate", "getter"], R = /* @__PURE__ */ ((e) => ((e = class {
|
231
241
|
static get any() {
|
232
|
-
return
|
242
|
+
return w();
|
233
243
|
}
|
234
244
|
static get func() {
|
235
|
-
return
|
245
|
+
return x().def(this.defaults.func);
|
236
246
|
}
|
237
247
|
static get bool() {
|
238
|
-
return 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
|
251
|
+
return A().def(this.defaults.string);
|
242
252
|
}
|
243
253
|
static get number() {
|
244
|
-
return
|
254
|
+
return E().def(this.defaults.number);
|
245
255
|
}
|
246
256
|
static get array() {
|
247
|
-
return
|
257
|
+
return S().def(this.defaults.array);
|
248
258
|
}
|
249
259
|
static get object() {
|
250
|
-
return
|
260
|
+
return N().def(this.defaults.object);
|
251
261
|
}
|
252
262
|
static get integer() {
|
253
|
-
return
|
263
|
+
return V().def(this.defaults.integer);
|
254
264
|
}
|
255
265
|
static get symbol() {
|
256
|
-
return
|
266
|
+
return q();
|
257
267
|
}
|
258
268
|
static get nullable() {
|
259
|
-
return
|
269
|
+
return k();
|
260
270
|
}
|
261
|
-
static extend(
|
262
|
-
if (
|
263
|
-
const { name:
|
264
|
-
if (
|
265
|
-
const { type:
|
266
|
-
if (
|
267
|
-
const
|
268
|
-
return
|
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
|
271
|
-
return
|
272
|
-
const
|
273
|
-
return
|
274
|
-
}, enumerable:
|
275
|
-
const
|
276
|
-
let
|
277
|
-
return
|
278
|
-
}, enumerable:
|
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 =
|
281
|
-
function
|
282
|
-
}, bool:
|
283
|
-
var
|
284
|
-
return (
|
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
|
296
|
+
return t({}, this.defaults);
|
287
297
|
}
|
288
|
-
static set sensibleDefaults(
|
289
|
-
this.defaults =
|
298
|
+
static set sensibleDefaults(n3) {
|
299
|
+
this.defaults = false !== n3 ? t({}, true !== n3 ? n3 : e) : {};
|
290
300
|
}
|
291
|
-
}).defaults =
|
301
|
+
}).defaults = t({}, e), n2;
|
292
302
|
}
|
293
|
-
class
|
303
|
+
class z extends U() {
|
294
304
|
}
|
295
|
-
const
|
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
|
-
|
314
|
+
PropTypes.extend([
|
305
315
|
{
|
306
316
|
name: "looseBool",
|
307
|
-
getter:
|
317
|
+
getter: true,
|
308
318
|
type: Boolean,
|
309
319
|
default: void 0
|
310
320
|
},
|
311
321
|
{
|
312
322
|
name: "style",
|
313
|
-
getter:
|
323
|
+
getter: true,
|
314
324
|
type: [String, Object],
|
315
325
|
default: void 0
|
316
326
|
},
|
317
327
|
{
|
318
328
|
name: "VueNode",
|
319
|
-
getter:
|
329
|
+
getter: true,
|
320
330
|
// @ts-ignore
|
321
331
|
type: null
|
322
332
|
}
|
323
333
|
]);
|
324
|
-
function
|
325
|
-
|
334
|
+
function withUndefined(type) {
|
335
|
+
type.default = void 0;
|
336
|
+
return type;
|
326
337
|
}
|
327
338
|
export {
|
328
|
-
|
329
|
-
|
339
|
+
PropTypes as default,
|
340
|
+
withUndefined
|
330
341
|
};
|
331
342
|
//# sourceMappingURL=index.js.map
|