orion-design 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Flex/Col.d.ts +25 -0
- package/dist/components/Flex/Item.d.ts +25 -0
- package/dist/components/Flex/Row.d.ts +25 -0
- package/dist/components/Flex/index.d.ts +10 -0
- package/dist/components/Flex/index.js +151 -0
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Space/index.d.ts +76 -0
- package/dist/components/_util/classNames.d.ts +2 -0
- package/dist/components/_util/classNames.js +31 -0
- package/dist/components/_util/isValid.d.ts +2 -0
- package/dist/components/_util/isValid.js +5 -0
- package/dist/components/_util/props-util/index.d.ts +6 -0
- package/dist/components/_util/props-util/index.js +53 -0
- package/dist/components/_util/props-util/initDefaultProps.d.ts +6 -0
- package/dist/components/_util/props-util/initDefaultProps.js +25 -0
- package/dist/components/_util/type.d.ts +62 -0
- package/dist/components/_util/type.js +66 -0
- package/dist/components/_util/util.d.ts +18 -0
- package/dist/components/_util/util.js +83 -0
- package/dist/components/_util/vue-types/index.d.ts +12 -0
- package/dist/components/_util/vue-types/index.js +473 -0
- package/dist/components/components.d.ts +4 -0
- package/dist/components/components.js +10 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +23 -0
- package/dist/components-O4L3qYfM.js +61 -0
- package/dist/error/OrionError.js +9 -7
- package/dist/index.css +44 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +12 -3
- package/dist/print/LodopFuncs.js +109 -140
- package/dist/print/index.js +204 -199
- package/dist/request/ErrorHandlerChain.js +13 -13
- package/dist/request/RequestFilterChain.js +13 -13
- package/dist/request/ResponseParserChain.js +13 -13
- package/dist/request/disivion/DateSerializer.js +44 -53
- package/dist/request/disivion/DivisionErrorHandler.js +42 -42
- package/dist/request/disivion/DivisionResponseParser.js +22 -18
- package/dist/request/disivion/index.d.ts +21 -1
- package/dist/request/disivion/index.js +493 -24
- package/dist/request/error/BizExceptionResponseError.js +10 -10
- package/dist/request/error/ExceptionResponseError.js +10 -10
- package/dist/request/error/ResponseError.js +11 -9
- package/dist/request/error/SessionExceptionResponseError.js +10 -10
- package/dist/request/index.d.ts +3 -0
- package/dist/request/index.js +9 -20
- package/dist/style/index.d.ts +3 -0
- package/dist/style/index.js +1 -0
- package/dist/utils/DateUtil.js +47 -52
- package/dist/utils/NumberUtil.js +5 -5
- package/dist/utils/cloneDeep.js +1 -2255
- package/dist/utils/delay.js +1 -1
- package/dist/utils/index.js +3 -4
- package/dist/utils/md5.js +218 -272
- package/dist/version/index.d.ts +2 -0
- package/dist/version/index.js +6 -0
- package/dist/version/version.d.ts +2 -0
- package/dist/version/version.js +3 -0
- package/global.d.ts +9 -0
- package/package.json +28 -10
- package/dist/_commonjsHelpers-BFTU3MAI.js +0 -7
- package/dist/bignumber-upqAL281.js +0 -2907
- package/dist/dayjs.min-CYqA_arp.js +0 -12
- package/dist/request/disivion/request.d.ts +0 -21
- package/dist/request/disivion/request.js +0 -19345
- package/dist/request/postByOpenNewWindow.d.ts +0 -1
- package/dist/request/postByOpenNewWindow.js +0 -41
@@ -0,0 +1,83 @@
|
|
1
|
+
const isFunction = val => typeof val === 'function';
|
2
|
+
const controlDefaultValue = Symbol('controlDefaultValue');
|
3
|
+
const isArray = Array.isArray;
|
4
|
+
const isString = val => typeof val === 'string';
|
5
|
+
const isSymbol = val => typeof val === 'symbol';
|
6
|
+
const isObject = val => val !== null && typeof val === 'object';
|
7
|
+
const onRE = /^on[^a-z]/;
|
8
|
+
const isOn = key => onRE.test(key);
|
9
|
+
const cacheStringFunction = fn => {
|
10
|
+
const cache = Object.create(null);
|
11
|
+
return str => {
|
12
|
+
const hit = cache[str];
|
13
|
+
return hit || (cache[str] = fn(str));
|
14
|
+
};
|
15
|
+
};
|
16
|
+
const camelizeRE = /-(\w)/g;
|
17
|
+
const camelize = cacheStringFunction(str => {
|
18
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '');
|
19
|
+
});
|
20
|
+
const hyphenateRE = /\B([A-Z])/g;
|
21
|
+
const hyphenate = cacheStringFunction(str => {
|
22
|
+
return str.replace(hyphenateRE, '-$1').toLowerCase();
|
23
|
+
});
|
24
|
+
const capitalize = cacheStringFunction(str => {
|
25
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
26
|
+
});
|
27
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
28
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
29
|
+
// change from vue sourcecode
|
30
|
+
function resolvePropValue(options, props, key, value) {
|
31
|
+
const opt = options[key];
|
32
|
+
if (opt != null) {
|
33
|
+
const hasDefault = hasOwn(opt, 'default');
|
34
|
+
// default values
|
35
|
+
if (hasDefault && value === undefined) {
|
36
|
+
const defaultValue = opt.default;
|
37
|
+
value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue;
|
38
|
+
}
|
39
|
+
// boolean casting
|
40
|
+
if (opt.type === Boolean) {
|
41
|
+
if (!hasOwn(props, key) && !hasDefault) {
|
42
|
+
value = false;
|
43
|
+
} else if (value === '') {
|
44
|
+
value = true;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return value;
|
49
|
+
}
|
50
|
+
function getDataAndAriaProps(props) {
|
51
|
+
return Object.keys(props).reduce((memo, key) => {
|
52
|
+
if (key.startsWith('data-') || key.startsWith('aria-')) {
|
53
|
+
memo[key] = props[key];
|
54
|
+
}
|
55
|
+
return memo;
|
56
|
+
}, {});
|
57
|
+
}
|
58
|
+
function toPx(val) {
|
59
|
+
if (typeof val === 'number') return `${val}px`;
|
60
|
+
return val;
|
61
|
+
}
|
62
|
+
function renderHelper(v, props = {}, defaultV) {
|
63
|
+
if (typeof v === 'function') {
|
64
|
+
return v(props);
|
65
|
+
}
|
66
|
+
return v ?? defaultV;
|
67
|
+
}
|
68
|
+
function wrapPromiseFn(openFn) {
|
69
|
+
let closeFn;
|
70
|
+
const closePromise = new Promise(resolve => {
|
71
|
+
closeFn = openFn(() => {
|
72
|
+
resolve(true);
|
73
|
+
});
|
74
|
+
});
|
75
|
+
const result = () => {
|
76
|
+
closeFn?.();
|
77
|
+
};
|
78
|
+
result.then = (filled, rejected) => closePromise.then(filled, rejected);
|
79
|
+
result.promise = closePromise;
|
80
|
+
return result;
|
81
|
+
}
|
82
|
+
|
83
|
+
export { cacheStringFunction, camelize, capitalize, controlDefaultValue, getDataAndAriaProps, hyphenate, isArray, isFunction, isObject, isOn, isString, isSymbol, renderHelper, resolvePropValue, toPx, wrapPromiseFn };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
2
|
+
import type { VueTypeValidableDef, VueTypesInterface } from 'vue-types';
|
3
|
+
import type { VueNode } from '../type';
|
4
|
+
export declare function withUndefined<T extends {
|
5
|
+
default?: any;
|
6
|
+
}>(type: T): T;
|
7
|
+
declare const _default: VueTypesInterface & {
|
8
|
+
readonly looseBool: VueTypeValidableDef<boolean>;
|
9
|
+
readonly style: VueTypeValidableDef<CSSProperties>;
|
10
|
+
readonly VueNode: VueTypeValidableDef<VueNode>;
|
11
|
+
};
|
12
|
+
export default _default;
|
@@ -0,0 +1,473 @@
|
|
1
|
+
/*!
|
2
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
3
|
+
*
|
4
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
5
|
+
* Released under the MIT License.
|
6
|
+
*/
|
7
|
+
|
8
|
+
function isObject(o) {
|
9
|
+
return Object.prototype.toString.call(o) === '[object Object]';
|
10
|
+
}
|
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;
|
32
|
+
}
|
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]);
|
39
|
+
}
|
40
|
+
return e;
|
41
|
+
}, t.apply(this, arguments);
|
42
|
+
}
|
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];
|
49
|
+
}
|
50
|
+
return n;
|
51
|
+
}
|
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] : "";
|
67
|
+
}
|
68
|
+
return "";
|
69
|
+
}
|
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;
|
78
|
+
}
|
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
|
+
});
|
93
|
+
}
|
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);
|
110
|
+
}
|
111
|
+
if (!i) {
|
112
|
+
const e = `${a}value "${t}" should be of type "${o}"`;
|
113
|
+
return !1 === n ? (d(e), !1) : e;
|
114
|
+
}
|
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;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
return i;
|
126
|
+
}
|
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;
|
148
|
+
}
|
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
|
+
});
|
156
|
+
}
|
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);
|
176
|
+
}
|
177
|
+
var u, l;
|
178
|
+
return Object.assign(o, s);
|
179
|
+
}
|
180
|
+
function $(e) {
|
181
|
+
return e.replace(/^(?!\s*$)/gm, " ");
|
182
|
+
}
|
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
|
+
});
|
233
|
+
}
|
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);
|
248
|
+
}
|
249
|
+
return e;
|
250
|
+
}, []);
|
251
|
+
t.length > 0 && (n.type = t);
|
252
|
+
}
|
253
|
+
return j("oneOf", n);
|
254
|
+
}
|
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);
|
265
|
+
continue;
|
266
|
+
}
|
267
|
+
if (b(o, "nullable")) {
|
268
|
+
n = !0;
|
269
|
+
continue;
|
270
|
+
}
|
271
|
+
if (!0 === o.type || !o.type) {
|
272
|
+
d('oneOfType - invalid usage of "true" and "null" as types.');
|
273
|
+
continue;
|
274
|
+
}
|
275
|
+
r = r.concat(o.type);
|
276
|
+
} else r.push(o);
|
277
|
+
}
|
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
|
+
});
|
293
|
+
}
|
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
|
+
});
|
303
|
+
}
|
304
|
+
function Y(e) {
|
305
|
+
return j("instanceOf", {
|
306
|
+
type: e
|
307
|
+
});
|
308
|
+
}
|
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
|
+
});
|
318
|
+
}
|
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;
|
347
|
+
}
|
348
|
+
}), r;
|
349
|
+
}
|
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
|
+
}) {
|
431
|
+
var n;
|
432
|
+
return (n = class extends R {
|
433
|
+
static get sensibleDefaults() {
|
434
|
+
return t({}, this.defaults);
|
435
|
+
}
|
436
|
+
static set sensibleDefaults(n) {
|
437
|
+
this.defaults = !1 !== n ? t({}, !0 !== n ? n : e) : {};
|
438
|
+
}
|
439
|
+
}).defaults = t({}, e), n;
|
440
|
+
}
|
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
|
451
|
+
});
|
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;
|
471
|
+
}
|
472
|
+
|
473
|
+
export { PropTypes as default, withUndefined };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export { i as Space } from '../components-O4L3qYfM.js';
|
2
|
+
export { Colflex, Flexitem, Rowflex } from './Flex/index.js';
|
3
|
+
import 'vue';
|
4
|
+
import './_util/props-util/index.js';
|
5
|
+
import './_util/isValid.js';
|
6
|
+
import './_util/props-util/initDefaultProps.js';
|
7
|
+
import './_util/type.js';
|
8
|
+
import './_util/classNames.js';
|
9
|
+
import './_util/util.js';
|
10
|
+
import '../error/OrionError.js';
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { c as components } from '../components-O4L3qYfM.js';
|
2
|
+
export { i as Space } from '../components-O4L3qYfM.js';
|
3
|
+
export { Colflex, Flexitem, Rowflex } from './Flex/index.js';
|
4
|
+
import 'vue';
|
5
|
+
import './_util/props-util/index.js';
|
6
|
+
import './_util/isValid.js';
|
7
|
+
import './_util/props-util/initDefaultProps.js';
|
8
|
+
import './_util/type.js';
|
9
|
+
import './_util/classNames.js';
|
10
|
+
import './_util/util.js';
|
11
|
+
import '../error/OrionError.js';
|
12
|
+
|
13
|
+
const install = function (app) {
|
14
|
+
Object.keys(components).forEach(key => {
|
15
|
+
const component = components[key];
|
16
|
+
if (component.install) {
|
17
|
+
app.use(component);
|
18
|
+
}
|
19
|
+
});
|
20
|
+
return app;
|
21
|
+
};
|
22
|
+
|
23
|
+
export { install };
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
2
|
+
import { filterEmpty } from './components/_util/props-util/index.js';
|
3
|
+
import { withInstall, anyType } from './components/_util/type.js';
|
4
|
+
import { Colflex, Flexitem, Rowflex } from './components/Flex/index.js';
|
5
|
+
|
6
|
+
const spaceProps = () => ({
|
7
|
+
gutter: anyType(),
|
8
|
+
vertical: anyType()
|
9
|
+
});
|
10
|
+
const Space = defineComponent({
|
11
|
+
name: 'OSpace',
|
12
|
+
inheritAttrs: false,
|
13
|
+
props: spaceProps(),
|
14
|
+
slots: Object,
|
15
|
+
setup(props, {
|
16
|
+
slots,
|
17
|
+
attrs,
|
18
|
+
emit,
|
19
|
+
expose
|
20
|
+
}) {
|
21
|
+
const classes = computed(() => {
|
22
|
+
const {
|
23
|
+
vertical
|
24
|
+
} = props;
|
25
|
+
return ['orion-space', {
|
26
|
+
[`vertical`]: vertical === true || vertical === ''
|
27
|
+
}];
|
28
|
+
});
|
29
|
+
return () => {
|
30
|
+
const children = slots.default?.();
|
31
|
+
const items = filterEmpty(children);
|
32
|
+
const len = items.length;
|
33
|
+
if (len === 0) {
|
34
|
+
return null;
|
35
|
+
}
|
36
|
+
const gapStyle = {};
|
37
|
+
if (typeof props.gutter == 'string' && props.gutter) {
|
38
|
+
gapStyle.gap = props.gutter;
|
39
|
+
}
|
40
|
+
return createVNode("div", {
|
41
|
+
"class": [classes.value, attrs.class],
|
42
|
+
"style": [gapStyle, attrs.style]
|
43
|
+
}, [items.map(child => {
|
44
|
+
return createVNode("div", {
|
45
|
+
"class": ['orion-space-item']
|
46
|
+
}, [child]);
|
47
|
+
})]);
|
48
|
+
};
|
49
|
+
}
|
50
|
+
});
|
51
|
+
var index = withInstall(Space);
|
52
|
+
|
53
|
+
var components = /*#__PURE__*/Object.freeze({
|
54
|
+
__proto__: null,
|
55
|
+
Colflex: Colflex,
|
56
|
+
Flexitem: Flexitem,
|
57
|
+
Rowflex: Rowflex,
|
58
|
+
Space: index
|
59
|
+
});
|
60
|
+
|
61
|
+
export { components as c, index as i };
|
package/dist/error/OrionError.js
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
class OrionError extends Error {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
constructor(message, cause) {
|
3
|
+
super(message, {
|
4
|
+
cause
|
5
|
+
});
|
6
|
+
// Maintains proper stack trace for where our error was thrown (only available on V8)
|
7
|
+
if (Error.captureStackTrace) {
|
8
|
+
Error.captureStackTrace(this, OrionError);
|
9
9
|
}
|
10
|
+
this.name = 'OrionError';
|
11
|
+
}
|
10
12
|
}
|
11
13
|
|
12
14
|
export { OrionError as default };
|