@zzdadelu/schema-builder 1.0.0-alpha.130 → 1.0.0-alpha.132

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/index.js DELETED
@@ -1,4208 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
3
- typeof define === 'function' && define.amd ? define(['react'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.FormRenderSchemaBuilder = factory(global.React));
5
- }(this, (function (React) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
-
11
- function _defineProperty(e, r, t) {
12
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13
- value: t,
14
- enumerable: !0,
15
- configurable: !0,
16
- writable: !0
17
- }) : e[r] = t, e;
18
- }
19
- function ownKeys(e, r) {
20
- var t = Object.keys(e);
21
- if (Object.getOwnPropertySymbols) {
22
- var o = Object.getOwnPropertySymbols(e);
23
- r && (o = o.filter(function (r) {
24
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
25
- })), t.push.apply(t, o);
26
- }
27
- return t;
28
- }
29
- function _objectSpread2(e) {
30
- for (var r = 1; r < arguments.length; r++) {
31
- var t = null != arguments[r] ? arguments[r] : {};
32
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
33
- _defineProperty(e, r, t[r]);
34
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
35
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
36
- });
37
- }
38
- return e;
39
- }
40
- function _objectWithoutProperties(e, t) {
41
- if (null == e) return {};
42
- var o,
43
- r,
44
- i = _objectWithoutPropertiesLoose(e, t);
45
- if (Object.getOwnPropertySymbols) {
46
- var n = Object.getOwnPropertySymbols(e);
47
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
48
- }
49
- return i;
50
- }
51
- function _objectWithoutPropertiesLoose(r, e) {
52
- if (null == r) return {};
53
- var t = {};
54
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
55
- if (-1 !== e.indexOf(n)) continue;
56
- t[n] = r[n];
57
- }
58
- return t;
59
- }
60
- function _toPrimitive(t, r) {
61
- if ("object" != typeof t || !t) return t;
62
- var e = t[Symbol.toPrimitive];
63
- if (void 0 !== e) {
64
- var i = e.call(t, r || "default");
65
- if ("object" != typeof i) return i;
66
- throw new TypeError("@@toPrimitive must return a primitive value.");
67
- }
68
- return ("string" === r ? String : Number)(t);
69
- }
70
- function _toPropertyKey(t) {
71
- var i = _toPrimitive(t, "string");
72
- return "symbol" == typeof i ? i : i + "";
73
- }
74
-
75
- var createIframeContent = function createIframeContent() {
76
- var html = "\n <html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\n\n <script>\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n </script>\n \n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js\"></script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js\"></script>\n </body>\n </html>\n ";
77
- return html;
78
- };
79
- var createIframe = (function () {
80
- var iframe = document.createElement('iframe');
81
- iframe.width = '100%';
82
- iframe.height = '100%';
83
- iframe.frameBorder = '0';
84
- iframe.srcdoc = createIframeContent();
85
- return iframe;
86
- });
87
-
88
- /**
89
- * Removes all key-value entries from the list cache.
90
- *
91
- * @private
92
- * @name clear
93
- * @memberOf ListCache
94
- */
95
- function listCacheClear() {
96
- this.__data__ = [];
97
- this.size = 0;
98
- }
99
-
100
- var _listCacheClear = listCacheClear;
101
-
102
- /**
103
- * Performs a
104
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
105
- * comparison between two values to determine if they are equivalent.
106
- *
107
- * @static
108
- * @memberOf _
109
- * @since 4.0.0
110
- * @category Lang
111
- * @param {*} value The value to compare.
112
- * @param {*} other The other value to compare.
113
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
114
- * @example
115
- *
116
- * var object = { 'a': 1 };
117
- * var other = { 'a': 1 };
118
- *
119
- * _.eq(object, object);
120
- * // => true
121
- *
122
- * _.eq(object, other);
123
- * // => false
124
- *
125
- * _.eq('a', 'a');
126
- * // => true
127
- *
128
- * _.eq('a', Object('a'));
129
- * // => false
130
- *
131
- * _.eq(NaN, NaN);
132
- * // => true
133
- */
134
- function eq(value, other) {
135
- return value === other || (value !== value && other !== other);
136
- }
137
-
138
- var eq_1 = eq;
139
-
140
- /**
141
- * Gets the index at which the `key` is found in `array` of key-value pairs.
142
- *
143
- * @private
144
- * @param {Array} array The array to inspect.
145
- * @param {*} key The key to search for.
146
- * @returns {number} Returns the index of the matched value, else `-1`.
147
- */
148
- function assocIndexOf(array, key) {
149
- var length = array.length;
150
- while (length--) {
151
- if (eq_1(array[length][0], key)) {
152
- return length;
153
- }
154
- }
155
- return -1;
156
- }
157
-
158
- var _assocIndexOf = assocIndexOf;
159
-
160
- /** Used for built-in method references. */
161
- var arrayProto = Array.prototype;
162
-
163
- /** Built-in value references. */
164
- var splice = arrayProto.splice;
165
-
166
- /**
167
- * Removes `key` and its value from the list cache.
168
- *
169
- * @private
170
- * @name delete
171
- * @memberOf ListCache
172
- * @param {string} key The key of the value to remove.
173
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
174
- */
175
- function listCacheDelete(key) {
176
- var data = this.__data__,
177
- index = _assocIndexOf(data, key);
178
-
179
- if (index < 0) {
180
- return false;
181
- }
182
- var lastIndex = data.length - 1;
183
- if (index == lastIndex) {
184
- data.pop();
185
- } else {
186
- splice.call(data, index, 1);
187
- }
188
- --this.size;
189
- return true;
190
- }
191
-
192
- var _listCacheDelete = listCacheDelete;
193
-
194
- /**
195
- * Gets the list cache value for `key`.
196
- *
197
- * @private
198
- * @name get
199
- * @memberOf ListCache
200
- * @param {string} key The key of the value to get.
201
- * @returns {*} Returns the entry value.
202
- */
203
- function listCacheGet(key) {
204
- var data = this.__data__,
205
- index = _assocIndexOf(data, key);
206
-
207
- return index < 0 ? undefined : data[index][1];
208
- }
209
-
210
- var _listCacheGet = listCacheGet;
211
-
212
- /**
213
- * Checks if a list cache value for `key` exists.
214
- *
215
- * @private
216
- * @name has
217
- * @memberOf ListCache
218
- * @param {string} key The key of the entry to check.
219
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
220
- */
221
- function listCacheHas(key) {
222
- return _assocIndexOf(this.__data__, key) > -1;
223
- }
224
-
225
- var _listCacheHas = listCacheHas;
226
-
227
- /**
228
- * Sets the list cache `key` to `value`.
229
- *
230
- * @private
231
- * @name set
232
- * @memberOf ListCache
233
- * @param {string} key The key of the value to set.
234
- * @param {*} value The value to set.
235
- * @returns {Object} Returns the list cache instance.
236
- */
237
- function listCacheSet(key, value) {
238
- var data = this.__data__,
239
- index = _assocIndexOf(data, key);
240
-
241
- if (index < 0) {
242
- ++this.size;
243
- data.push([key, value]);
244
- } else {
245
- data[index][1] = value;
246
- }
247
- return this;
248
- }
249
-
250
- var _listCacheSet = listCacheSet;
251
-
252
- /**
253
- * Creates an list cache object.
254
- *
255
- * @private
256
- * @constructor
257
- * @param {Array} [entries] The key-value pairs to cache.
258
- */
259
- function ListCache(entries) {
260
- var index = -1,
261
- length = entries == null ? 0 : entries.length;
262
-
263
- this.clear();
264
- while (++index < length) {
265
- var entry = entries[index];
266
- this.set(entry[0], entry[1]);
267
- }
268
- }
269
-
270
- // Add methods to `ListCache`.
271
- ListCache.prototype.clear = _listCacheClear;
272
- ListCache.prototype['delete'] = _listCacheDelete;
273
- ListCache.prototype.get = _listCacheGet;
274
- ListCache.prototype.has = _listCacheHas;
275
- ListCache.prototype.set = _listCacheSet;
276
-
277
- var _ListCache = ListCache;
278
-
279
- /**
280
- * Removes all key-value entries from the stack.
281
- *
282
- * @private
283
- * @name clear
284
- * @memberOf Stack
285
- */
286
- function stackClear() {
287
- this.__data__ = new _ListCache;
288
- this.size = 0;
289
- }
290
-
291
- var _stackClear = stackClear;
292
-
293
- /**
294
- * Removes `key` and its value from the stack.
295
- *
296
- * @private
297
- * @name delete
298
- * @memberOf Stack
299
- * @param {string} key The key of the value to remove.
300
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
301
- */
302
- function stackDelete(key) {
303
- var data = this.__data__,
304
- result = data['delete'](key);
305
-
306
- this.size = data.size;
307
- return result;
308
- }
309
-
310
- var _stackDelete = stackDelete;
311
-
312
- /**
313
- * Gets the stack value for `key`.
314
- *
315
- * @private
316
- * @name get
317
- * @memberOf Stack
318
- * @param {string} key The key of the value to get.
319
- * @returns {*} Returns the entry value.
320
- */
321
- function stackGet(key) {
322
- return this.__data__.get(key);
323
- }
324
-
325
- var _stackGet = stackGet;
326
-
327
- /**
328
- * Checks if a stack value for `key` exists.
329
- *
330
- * @private
331
- * @name has
332
- * @memberOf Stack
333
- * @param {string} key The key of the entry to check.
334
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
335
- */
336
- function stackHas(key) {
337
- return this.__data__.has(key);
338
- }
339
-
340
- var _stackHas = stackHas;
341
-
342
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
343
-
344
- function createCommonjsModule(fn, basedir, module) {
345
- return module = {
346
- path: basedir,
347
- exports: {},
348
- require: function (path, base) {
349
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
350
- }
351
- }, fn(module, module.exports), module.exports;
352
- }
353
-
354
- function commonjsRequire () {
355
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
356
- }
357
-
358
- /** Detect free variable `global` from Node.js. */
359
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
360
-
361
- var _freeGlobal = freeGlobal;
362
-
363
- /** Detect free variable `self`. */
364
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
365
-
366
- /** Used as a reference to the global object. */
367
- var root = _freeGlobal || freeSelf || Function('return this')();
368
-
369
- var _root = root;
370
-
371
- /** Built-in value references. */
372
- var Symbol$1 = _root.Symbol;
373
-
374
- var _Symbol = Symbol$1;
375
-
376
- /** Used for built-in method references. */
377
- var objectProto = Object.prototype;
378
-
379
- /** Used to check objects for own properties. */
380
- var hasOwnProperty = objectProto.hasOwnProperty;
381
-
382
- /**
383
- * Used to resolve the
384
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
385
- * of values.
386
- */
387
- var nativeObjectToString = objectProto.toString;
388
-
389
- /** Built-in value references. */
390
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
391
-
392
- /**
393
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
394
- *
395
- * @private
396
- * @param {*} value The value to query.
397
- * @returns {string} Returns the raw `toStringTag`.
398
- */
399
- function getRawTag(value) {
400
- var isOwn = hasOwnProperty.call(value, symToStringTag),
401
- tag = value[symToStringTag];
402
-
403
- try {
404
- value[symToStringTag] = undefined;
405
- var unmasked = true;
406
- } catch (e) {}
407
-
408
- var result = nativeObjectToString.call(value);
409
- if (unmasked) {
410
- if (isOwn) {
411
- value[symToStringTag] = tag;
412
- } else {
413
- delete value[symToStringTag];
414
- }
415
- }
416
- return result;
417
- }
418
-
419
- var _getRawTag = getRawTag;
420
-
421
- /** Used for built-in method references. */
422
- var objectProto$1 = Object.prototype;
423
-
424
- /**
425
- * Used to resolve the
426
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
427
- * of values.
428
- */
429
- var nativeObjectToString$1 = objectProto$1.toString;
430
-
431
- /**
432
- * Converts `value` to a string using `Object.prototype.toString`.
433
- *
434
- * @private
435
- * @param {*} value The value to convert.
436
- * @returns {string} Returns the converted string.
437
- */
438
- function objectToString(value) {
439
- return nativeObjectToString$1.call(value);
440
- }
441
-
442
- var _objectToString = objectToString;
443
-
444
- /** `Object#toString` result references. */
445
- var nullTag = '[object Null]',
446
- undefinedTag = '[object Undefined]';
447
-
448
- /** Built-in value references. */
449
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
450
-
451
- /**
452
- * The base implementation of `getTag` without fallbacks for buggy environments.
453
- *
454
- * @private
455
- * @param {*} value The value to query.
456
- * @returns {string} Returns the `toStringTag`.
457
- */
458
- function baseGetTag(value) {
459
- if (value == null) {
460
- return value === undefined ? undefinedTag : nullTag;
461
- }
462
- return (symToStringTag$1 && symToStringTag$1 in Object(value))
463
- ? _getRawTag(value)
464
- : _objectToString(value);
465
- }
466
-
467
- var _baseGetTag = baseGetTag;
468
-
469
- /**
470
- * Checks if `value` is the
471
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
472
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
473
- *
474
- * @static
475
- * @memberOf _
476
- * @since 0.1.0
477
- * @category Lang
478
- * @param {*} value The value to check.
479
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
480
- * @example
481
- *
482
- * _.isObject({});
483
- * // => true
484
- *
485
- * _.isObject([1, 2, 3]);
486
- * // => true
487
- *
488
- * _.isObject(_.noop);
489
- * // => true
490
- *
491
- * _.isObject(null);
492
- * // => false
493
- */
494
- function isObject(value) {
495
- var type = typeof value;
496
- return value != null && (type == 'object' || type == 'function');
497
- }
498
-
499
- var isObject_1 = isObject;
500
-
501
- /** `Object#toString` result references. */
502
- var asyncTag = '[object AsyncFunction]',
503
- funcTag = '[object Function]',
504
- genTag = '[object GeneratorFunction]',
505
- proxyTag = '[object Proxy]';
506
-
507
- /**
508
- * Checks if `value` is classified as a `Function` object.
509
- *
510
- * @static
511
- * @memberOf _
512
- * @since 0.1.0
513
- * @category Lang
514
- * @param {*} value The value to check.
515
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
516
- * @example
517
- *
518
- * _.isFunction(_);
519
- * // => true
520
- *
521
- * _.isFunction(/abc/);
522
- * // => false
523
- */
524
- function isFunction(value) {
525
- if (!isObject_1(value)) {
526
- return false;
527
- }
528
- // The use of `Object#toString` avoids issues with the `typeof` operator
529
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
530
- var tag = _baseGetTag(value);
531
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
532
- }
533
-
534
- var isFunction_1 = isFunction;
535
-
536
- /** Used to detect overreaching core-js shims. */
537
- var coreJsData = _root['__core-js_shared__'];
538
-
539
- var _coreJsData = coreJsData;
540
-
541
- /** Used to detect methods masquerading as native. */
542
- var maskSrcKey = (function() {
543
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
544
- return uid ? ('Symbol(src)_1.' + uid) : '';
545
- }());
546
-
547
- /**
548
- * Checks if `func` has its source masked.
549
- *
550
- * @private
551
- * @param {Function} func The function to check.
552
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
553
- */
554
- function isMasked(func) {
555
- return !!maskSrcKey && (maskSrcKey in func);
556
- }
557
-
558
- var _isMasked = isMasked;
559
-
560
- /** Used for built-in method references. */
561
- var funcProto = Function.prototype;
562
-
563
- /** Used to resolve the decompiled source of functions. */
564
- var funcToString = funcProto.toString;
565
-
566
- /**
567
- * Converts `func` to its source code.
568
- *
569
- * @private
570
- * @param {Function} func The function to convert.
571
- * @returns {string} Returns the source code.
572
- */
573
- function toSource(func) {
574
- if (func != null) {
575
- try {
576
- return funcToString.call(func);
577
- } catch (e) {}
578
- try {
579
- return (func + '');
580
- } catch (e) {}
581
- }
582
- return '';
583
- }
584
-
585
- var _toSource = toSource;
586
-
587
- /**
588
- * Used to match `RegExp`
589
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
590
- */
591
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
592
-
593
- /** Used to detect host constructors (Safari). */
594
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
595
-
596
- /** Used for built-in method references. */
597
- var funcProto$1 = Function.prototype,
598
- objectProto$2 = Object.prototype;
599
-
600
- /** Used to resolve the decompiled source of functions. */
601
- var funcToString$1 = funcProto$1.toString;
602
-
603
- /** Used to check objects for own properties. */
604
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
605
-
606
- /** Used to detect if a method is native. */
607
- var reIsNative = RegExp('^' +
608
- funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
609
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
610
- );
611
-
612
- /**
613
- * The base implementation of `_.isNative` without bad shim checks.
614
- *
615
- * @private
616
- * @param {*} value The value to check.
617
- * @returns {boolean} Returns `true` if `value` is a native function,
618
- * else `false`.
619
- */
620
- function baseIsNative(value) {
621
- if (!isObject_1(value) || _isMasked(value)) {
622
- return false;
623
- }
624
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
625
- return pattern.test(_toSource(value));
626
- }
627
-
628
- var _baseIsNative = baseIsNative;
629
-
630
- /**
631
- * Gets the value at `key` of `object`.
632
- *
633
- * @private
634
- * @param {Object} [object] The object to query.
635
- * @param {string} key The key of the property to get.
636
- * @returns {*} Returns the property value.
637
- */
638
- function getValue(object, key) {
639
- return object == null ? undefined : object[key];
640
- }
641
-
642
- var _getValue = getValue;
643
-
644
- /**
645
- * Gets the native function at `key` of `object`.
646
- *
647
- * @private
648
- * @param {Object} object The object to query.
649
- * @param {string} key The key of the method to get.
650
- * @returns {*} Returns the function if it's native, else `undefined`.
651
- */
652
- function getNative(object, key) {
653
- var value = _getValue(object, key);
654
- return _baseIsNative(value) ? value : undefined;
655
- }
656
-
657
- var _getNative = getNative;
658
-
659
- /* Built-in method references that are verified to be native. */
660
- var Map = _getNative(_root, 'Map');
661
-
662
- var _Map = Map;
663
-
664
- /* Built-in method references that are verified to be native. */
665
- var nativeCreate = _getNative(Object, 'create');
666
-
667
- var _nativeCreate = nativeCreate;
668
-
669
- /**
670
- * Removes all key-value entries from the hash.
671
- *
672
- * @private
673
- * @name clear
674
- * @memberOf Hash
675
- */
676
- function hashClear() {
677
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
678
- this.size = 0;
679
- }
680
-
681
- var _hashClear = hashClear;
682
-
683
- /**
684
- * Removes `key` and its value from the hash.
685
- *
686
- * @private
687
- * @name delete
688
- * @memberOf Hash
689
- * @param {Object} hash The hash to modify.
690
- * @param {string} key The key of the value to remove.
691
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
692
- */
693
- function hashDelete(key) {
694
- var result = this.has(key) && delete this.__data__[key];
695
- this.size -= result ? 1 : 0;
696
- return result;
697
- }
698
-
699
- var _hashDelete = hashDelete;
700
-
701
- /** Used to stand-in for `undefined` hash values. */
702
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
703
-
704
- /** Used for built-in method references. */
705
- var objectProto$3 = Object.prototype;
706
-
707
- /** Used to check objects for own properties. */
708
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
709
-
710
- /**
711
- * Gets the hash value for `key`.
712
- *
713
- * @private
714
- * @name get
715
- * @memberOf Hash
716
- * @param {string} key The key of the value to get.
717
- * @returns {*} Returns the entry value.
718
- */
719
- function hashGet(key) {
720
- var data = this.__data__;
721
- if (_nativeCreate) {
722
- var result = data[key];
723
- return result === HASH_UNDEFINED ? undefined : result;
724
- }
725
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
726
- }
727
-
728
- var _hashGet = hashGet;
729
-
730
- /** Used for built-in method references. */
731
- var objectProto$4 = Object.prototype;
732
-
733
- /** Used to check objects for own properties. */
734
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
735
-
736
- /**
737
- * Checks if a hash value for `key` exists.
738
- *
739
- * @private
740
- * @name has
741
- * @memberOf Hash
742
- * @param {string} key The key of the entry to check.
743
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
744
- */
745
- function hashHas(key) {
746
- var data = this.__data__;
747
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$3.call(data, key);
748
- }
749
-
750
- var _hashHas = hashHas;
751
-
752
- /** Used to stand-in for `undefined` hash values. */
753
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
754
-
755
- /**
756
- * Sets the hash `key` to `value`.
757
- *
758
- * @private
759
- * @name set
760
- * @memberOf Hash
761
- * @param {string} key The key of the value to set.
762
- * @param {*} value The value to set.
763
- * @returns {Object} Returns the hash instance.
764
- */
765
- function hashSet(key, value) {
766
- var data = this.__data__;
767
- this.size += this.has(key) ? 0 : 1;
768
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
769
- return this;
770
- }
771
-
772
- var _hashSet = hashSet;
773
-
774
- /**
775
- * Creates a hash object.
776
- *
777
- * @private
778
- * @constructor
779
- * @param {Array} [entries] The key-value pairs to cache.
780
- */
781
- function Hash(entries) {
782
- var index = -1,
783
- length = entries == null ? 0 : entries.length;
784
-
785
- this.clear();
786
- while (++index < length) {
787
- var entry = entries[index];
788
- this.set(entry[0], entry[1]);
789
- }
790
- }
791
-
792
- // Add methods to `Hash`.
793
- Hash.prototype.clear = _hashClear;
794
- Hash.prototype['delete'] = _hashDelete;
795
- Hash.prototype.get = _hashGet;
796
- Hash.prototype.has = _hashHas;
797
- Hash.prototype.set = _hashSet;
798
-
799
- var _Hash = Hash;
800
-
801
- /**
802
- * Removes all key-value entries from the map.
803
- *
804
- * @private
805
- * @name clear
806
- * @memberOf MapCache
807
- */
808
- function mapCacheClear() {
809
- this.size = 0;
810
- this.__data__ = {
811
- 'hash': new _Hash,
812
- 'map': new (_Map || _ListCache),
813
- 'string': new _Hash
814
- };
815
- }
816
-
817
- var _mapCacheClear = mapCacheClear;
818
-
819
- /**
820
- * Checks if `value` is suitable for use as unique object key.
821
- *
822
- * @private
823
- * @param {*} value The value to check.
824
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
825
- */
826
- function isKeyable(value) {
827
- var type = typeof value;
828
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
829
- ? (value !== '__proto__')
830
- : (value === null);
831
- }
832
-
833
- var _isKeyable = isKeyable;
834
-
835
- /**
836
- * Gets the data for `map`.
837
- *
838
- * @private
839
- * @param {Object} map The map to query.
840
- * @param {string} key The reference key.
841
- * @returns {*} Returns the map data.
842
- */
843
- function getMapData(map, key) {
844
- var data = map.__data__;
845
- return _isKeyable(key)
846
- ? data[typeof key == 'string' ? 'string' : 'hash']
847
- : data.map;
848
- }
849
-
850
- var _getMapData = getMapData;
851
-
852
- /**
853
- * Removes `key` and its value from the map.
854
- *
855
- * @private
856
- * @name delete
857
- * @memberOf MapCache
858
- * @param {string} key The key of the value to remove.
859
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
860
- */
861
- function mapCacheDelete(key) {
862
- var result = _getMapData(this, key)['delete'](key);
863
- this.size -= result ? 1 : 0;
864
- return result;
865
- }
866
-
867
- var _mapCacheDelete = mapCacheDelete;
868
-
869
- /**
870
- * Gets the map value for `key`.
871
- *
872
- * @private
873
- * @name get
874
- * @memberOf MapCache
875
- * @param {string} key The key of the value to get.
876
- * @returns {*} Returns the entry value.
877
- */
878
- function mapCacheGet(key) {
879
- return _getMapData(this, key).get(key);
880
- }
881
-
882
- var _mapCacheGet = mapCacheGet;
883
-
884
- /**
885
- * Checks if a map value for `key` exists.
886
- *
887
- * @private
888
- * @name has
889
- * @memberOf MapCache
890
- * @param {string} key The key of the entry to check.
891
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
892
- */
893
- function mapCacheHas(key) {
894
- return _getMapData(this, key).has(key);
895
- }
896
-
897
- var _mapCacheHas = mapCacheHas;
898
-
899
- /**
900
- * Sets the map `key` to `value`.
901
- *
902
- * @private
903
- * @name set
904
- * @memberOf MapCache
905
- * @param {string} key The key of the value to set.
906
- * @param {*} value The value to set.
907
- * @returns {Object} Returns the map cache instance.
908
- */
909
- function mapCacheSet(key, value) {
910
- var data = _getMapData(this, key),
911
- size = data.size;
912
-
913
- data.set(key, value);
914
- this.size += data.size == size ? 0 : 1;
915
- return this;
916
- }
917
-
918
- var _mapCacheSet = mapCacheSet;
919
-
920
- /**
921
- * Creates a map cache object to store key-value pairs.
922
- *
923
- * @private
924
- * @constructor
925
- * @param {Array} [entries] The key-value pairs to cache.
926
- */
927
- function MapCache(entries) {
928
- var index = -1,
929
- length = entries == null ? 0 : entries.length;
930
-
931
- this.clear();
932
- while (++index < length) {
933
- var entry = entries[index];
934
- this.set(entry[0], entry[1]);
935
- }
936
- }
937
-
938
- // Add methods to `MapCache`.
939
- MapCache.prototype.clear = _mapCacheClear;
940
- MapCache.prototype['delete'] = _mapCacheDelete;
941
- MapCache.prototype.get = _mapCacheGet;
942
- MapCache.prototype.has = _mapCacheHas;
943
- MapCache.prototype.set = _mapCacheSet;
944
-
945
- var _MapCache = MapCache;
946
-
947
- /** Used as the size to enable large array optimizations. */
948
- var LARGE_ARRAY_SIZE = 200;
949
-
950
- /**
951
- * Sets the stack `key` to `value`.
952
- *
953
- * @private
954
- * @name set
955
- * @memberOf Stack
956
- * @param {string} key The key of the value to set.
957
- * @param {*} value The value to set.
958
- * @returns {Object} Returns the stack cache instance.
959
- */
960
- function stackSet(key, value) {
961
- var data = this.__data__;
962
- if (data instanceof _ListCache) {
963
- var pairs = data.__data__;
964
- if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
965
- pairs.push([key, value]);
966
- this.size = ++data.size;
967
- return this;
968
- }
969
- data = this.__data__ = new _MapCache(pairs);
970
- }
971
- data.set(key, value);
972
- this.size = data.size;
973
- return this;
974
- }
975
-
976
- var _stackSet = stackSet;
977
-
978
- /**
979
- * Creates a stack cache object to store key-value pairs.
980
- *
981
- * @private
982
- * @constructor
983
- * @param {Array} [entries] The key-value pairs to cache.
984
- */
985
- function Stack(entries) {
986
- var data = this.__data__ = new _ListCache(entries);
987
- this.size = data.size;
988
- }
989
-
990
- // Add methods to `Stack`.
991
- Stack.prototype.clear = _stackClear;
992
- Stack.prototype['delete'] = _stackDelete;
993
- Stack.prototype.get = _stackGet;
994
- Stack.prototype.has = _stackHas;
995
- Stack.prototype.set = _stackSet;
996
-
997
- var _Stack = Stack;
998
-
999
- /**
1000
- * A specialized version of `_.forEach` for arrays without support for
1001
- * iteratee shorthands.
1002
- *
1003
- * @private
1004
- * @param {Array} [array] The array to iterate over.
1005
- * @param {Function} iteratee The function invoked per iteration.
1006
- * @returns {Array} Returns `array`.
1007
- */
1008
- function arrayEach(array, iteratee) {
1009
- var index = -1,
1010
- length = array == null ? 0 : array.length;
1011
-
1012
- while (++index < length) {
1013
- if (iteratee(array[index], index, array) === false) {
1014
- break;
1015
- }
1016
- }
1017
- return array;
1018
- }
1019
-
1020
- var _arrayEach = arrayEach;
1021
-
1022
- var defineProperty = (function() {
1023
- try {
1024
- var func = _getNative(Object, 'defineProperty');
1025
- func({}, '', {});
1026
- return func;
1027
- } catch (e) {}
1028
- }());
1029
-
1030
- var _defineProperty$1 = defineProperty;
1031
-
1032
- /**
1033
- * The base implementation of `assignValue` and `assignMergeValue` without
1034
- * value checks.
1035
- *
1036
- * @private
1037
- * @param {Object} object The object to modify.
1038
- * @param {string} key The key of the property to assign.
1039
- * @param {*} value The value to assign.
1040
- */
1041
- function baseAssignValue(object, key, value) {
1042
- if (key == '__proto__' && _defineProperty$1) {
1043
- _defineProperty$1(object, key, {
1044
- 'configurable': true,
1045
- 'enumerable': true,
1046
- 'value': value,
1047
- 'writable': true
1048
- });
1049
- } else {
1050
- object[key] = value;
1051
- }
1052
- }
1053
-
1054
- var _baseAssignValue = baseAssignValue;
1055
-
1056
- /** Used for built-in method references. */
1057
- var objectProto$5 = Object.prototype;
1058
-
1059
- /** Used to check objects for own properties. */
1060
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1061
-
1062
- /**
1063
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
1064
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1065
- * for equality comparisons.
1066
- *
1067
- * @private
1068
- * @param {Object} object The object to modify.
1069
- * @param {string} key The key of the property to assign.
1070
- * @param {*} value The value to assign.
1071
- */
1072
- function assignValue(object, key, value) {
1073
- var objValue = object[key];
1074
- if (!(hasOwnProperty$4.call(object, key) && eq_1(objValue, value)) ||
1075
- (value === undefined && !(key in object))) {
1076
- _baseAssignValue(object, key, value);
1077
- }
1078
- }
1079
-
1080
- var _assignValue = assignValue;
1081
-
1082
- /**
1083
- * Copies properties of `source` to `object`.
1084
- *
1085
- * @private
1086
- * @param {Object} source The object to copy properties from.
1087
- * @param {Array} props The property identifiers to copy.
1088
- * @param {Object} [object={}] The object to copy properties to.
1089
- * @param {Function} [customizer] The function to customize copied values.
1090
- * @returns {Object} Returns `object`.
1091
- */
1092
- function copyObject(source, props, object, customizer) {
1093
- var isNew = !object;
1094
- object || (object = {});
1095
-
1096
- var index = -1,
1097
- length = props.length;
1098
-
1099
- while (++index < length) {
1100
- var key = props[index];
1101
-
1102
- var newValue = customizer
1103
- ? customizer(object[key], source[key], key, object, source)
1104
- : undefined;
1105
-
1106
- if (newValue === undefined) {
1107
- newValue = source[key];
1108
- }
1109
- if (isNew) {
1110
- _baseAssignValue(object, key, newValue);
1111
- } else {
1112
- _assignValue(object, key, newValue);
1113
- }
1114
- }
1115
- return object;
1116
- }
1117
-
1118
- var _copyObject = copyObject;
1119
-
1120
- /**
1121
- * The base implementation of `_.times` without support for iteratee shorthands
1122
- * or max array length checks.
1123
- *
1124
- * @private
1125
- * @param {number} n The number of times to invoke `iteratee`.
1126
- * @param {Function} iteratee The function invoked per iteration.
1127
- * @returns {Array} Returns the array of results.
1128
- */
1129
- function baseTimes(n, iteratee) {
1130
- var index = -1,
1131
- result = Array(n);
1132
-
1133
- while (++index < n) {
1134
- result[index] = iteratee(index);
1135
- }
1136
- return result;
1137
- }
1138
-
1139
- var _baseTimes = baseTimes;
1140
-
1141
- /**
1142
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1143
- * and has a `typeof` result of "object".
1144
- *
1145
- * @static
1146
- * @memberOf _
1147
- * @since 4.0.0
1148
- * @category Lang
1149
- * @param {*} value The value to check.
1150
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1151
- * @example
1152
- *
1153
- * _.isObjectLike({});
1154
- * // => true
1155
- *
1156
- * _.isObjectLike([1, 2, 3]);
1157
- * // => true
1158
- *
1159
- * _.isObjectLike(_.noop);
1160
- * // => false
1161
- *
1162
- * _.isObjectLike(null);
1163
- * // => false
1164
- */
1165
- function isObjectLike(value) {
1166
- return value != null && typeof value == 'object';
1167
- }
1168
-
1169
- var isObjectLike_1 = isObjectLike;
1170
-
1171
- /** `Object#toString` result references. */
1172
- var argsTag = '[object Arguments]';
1173
-
1174
- /**
1175
- * The base implementation of `_.isArguments`.
1176
- *
1177
- * @private
1178
- * @param {*} value The value to check.
1179
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1180
- */
1181
- function baseIsArguments(value) {
1182
- return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
1183
- }
1184
-
1185
- var _baseIsArguments = baseIsArguments;
1186
-
1187
- /** Used for built-in method references. */
1188
- var objectProto$6 = Object.prototype;
1189
-
1190
- /** Used to check objects for own properties. */
1191
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
1192
-
1193
- /** Built-in value references. */
1194
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
1195
-
1196
- /**
1197
- * Checks if `value` is likely an `arguments` object.
1198
- *
1199
- * @static
1200
- * @memberOf _
1201
- * @since 0.1.0
1202
- * @category Lang
1203
- * @param {*} value The value to check.
1204
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1205
- * else `false`.
1206
- * @example
1207
- *
1208
- * _.isArguments(function() { return arguments; }());
1209
- * // => true
1210
- *
1211
- * _.isArguments([1, 2, 3]);
1212
- * // => false
1213
- */
1214
- var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
1215
- return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') &&
1216
- !propertyIsEnumerable.call(value, 'callee');
1217
- };
1218
-
1219
- var isArguments_1 = isArguments;
1220
-
1221
- /**
1222
- * Checks if `value` is classified as an `Array` object.
1223
- *
1224
- * @static
1225
- * @memberOf _
1226
- * @since 0.1.0
1227
- * @category Lang
1228
- * @param {*} value The value to check.
1229
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1230
- * @example
1231
- *
1232
- * _.isArray([1, 2, 3]);
1233
- * // => true
1234
- *
1235
- * _.isArray(document.body.children);
1236
- * // => false
1237
- *
1238
- * _.isArray('abc');
1239
- * // => false
1240
- *
1241
- * _.isArray(_.noop);
1242
- * // => false
1243
- */
1244
- var isArray = Array.isArray;
1245
-
1246
- var isArray_1 = isArray;
1247
-
1248
- /**
1249
- * This method returns `false`.
1250
- *
1251
- * @static
1252
- * @memberOf _
1253
- * @since 4.13.0
1254
- * @category Util
1255
- * @returns {boolean} Returns `false`.
1256
- * @example
1257
- *
1258
- * _.times(2, _.stubFalse);
1259
- * // => [false, false]
1260
- */
1261
- function stubFalse() {
1262
- return false;
1263
- }
1264
-
1265
- var stubFalse_1 = stubFalse;
1266
-
1267
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
1268
- /** Detect free variable `exports`. */
1269
- var freeExports = exports && !exports.nodeType && exports;
1270
-
1271
- /** Detect free variable `module`. */
1272
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1273
-
1274
- /** Detect the popular CommonJS extension `module.exports`. */
1275
- var moduleExports = freeModule && freeModule.exports === freeExports;
1276
-
1277
- /** Built-in value references. */
1278
- var Buffer = moduleExports ? _root.Buffer : undefined;
1279
-
1280
- /* Built-in method references for those with the same name as other `lodash` methods. */
1281
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1282
-
1283
- /**
1284
- * Checks if `value` is a buffer.
1285
- *
1286
- * @static
1287
- * @memberOf _
1288
- * @since 4.3.0
1289
- * @category Lang
1290
- * @param {*} value The value to check.
1291
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1292
- * @example
1293
- *
1294
- * _.isBuffer(new Buffer(2));
1295
- * // => true
1296
- *
1297
- * _.isBuffer(new Uint8Array(2));
1298
- * // => false
1299
- */
1300
- var isBuffer = nativeIsBuffer || stubFalse_1;
1301
-
1302
- module.exports = isBuffer;
1303
- });
1304
-
1305
- /** Used as references for various `Number` constants. */
1306
- var MAX_SAFE_INTEGER = 9007199254740991;
1307
-
1308
- /** Used to detect unsigned integer values. */
1309
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1310
-
1311
- /**
1312
- * Checks if `value` is a valid array-like index.
1313
- *
1314
- * @private
1315
- * @param {*} value The value to check.
1316
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1317
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1318
- */
1319
- function isIndex(value, length) {
1320
- var type = typeof value;
1321
- length = length == null ? MAX_SAFE_INTEGER : length;
1322
-
1323
- return !!length &&
1324
- (type == 'number' ||
1325
- (type != 'symbol' && reIsUint.test(value))) &&
1326
- (value > -1 && value % 1 == 0 && value < length);
1327
- }
1328
-
1329
- var _isIndex = isIndex;
1330
-
1331
- /** Used as references for various `Number` constants. */
1332
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
1333
-
1334
- /**
1335
- * Checks if `value` is a valid array-like length.
1336
- *
1337
- * **Note:** This method is loosely based on
1338
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1339
- *
1340
- * @static
1341
- * @memberOf _
1342
- * @since 4.0.0
1343
- * @category Lang
1344
- * @param {*} value The value to check.
1345
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1346
- * @example
1347
- *
1348
- * _.isLength(3);
1349
- * // => true
1350
- *
1351
- * _.isLength(Number.MIN_VALUE);
1352
- * // => false
1353
- *
1354
- * _.isLength(Infinity);
1355
- * // => false
1356
- *
1357
- * _.isLength('3');
1358
- * // => false
1359
- */
1360
- function isLength(value) {
1361
- return typeof value == 'number' &&
1362
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
1363
- }
1364
-
1365
- var isLength_1 = isLength;
1366
-
1367
- /** `Object#toString` result references. */
1368
- var argsTag$1 = '[object Arguments]',
1369
- arrayTag = '[object Array]',
1370
- boolTag = '[object Boolean]',
1371
- dateTag = '[object Date]',
1372
- errorTag = '[object Error]',
1373
- funcTag$1 = '[object Function]',
1374
- mapTag = '[object Map]',
1375
- numberTag = '[object Number]',
1376
- objectTag = '[object Object]',
1377
- regexpTag = '[object RegExp]',
1378
- setTag = '[object Set]',
1379
- stringTag = '[object String]',
1380
- weakMapTag = '[object WeakMap]';
1381
-
1382
- var arrayBufferTag = '[object ArrayBuffer]',
1383
- dataViewTag = '[object DataView]',
1384
- float32Tag = '[object Float32Array]',
1385
- float64Tag = '[object Float64Array]',
1386
- int8Tag = '[object Int8Array]',
1387
- int16Tag = '[object Int16Array]',
1388
- int32Tag = '[object Int32Array]',
1389
- uint8Tag = '[object Uint8Array]',
1390
- uint8ClampedTag = '[object Uint8ClampedArray]',
1391
- uint16Tag = '[object Uint16Array]',
1392
- uint32Tag = '[object Uint32Array]';
1393
-
1394
- /** Used to identify `toStringTag` values of typed arrays. */
1395
- var typedArrayTags = {};
1396
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
1397
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
1398
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
1399
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
1400
- typedArrayTags[uint32Tag] = true;
1401
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
1402
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
1403
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
1404
- typedArrayTags[errorTag] = typedArrayTags[funcTag$1] =
1405
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
1406
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
1407
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
1408
- typedArrayTags[weakMapTag] = false;
1409
-
1410
- /**
1411
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1412
- *
1413
- * @private
1414
- * @param {*} value The value to check.
1415
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1416
- */
1417
- function baseIsTypedArray(value) {
1418
- return isObjectLike_1(value) &&
1419
- isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
1420
- }
1421
-
1422
- var _baseIsTypedArray = baseIsTypedArray;
1423
-
1424
- /**
1425
- * The base implementation of `_.unary` without support for storing metadata.
1426
- *
1427
- * @private
1428
- * @param {Function} func The function to cap arguments for.
1429
- * @returns {Function} Returns the new capped function.
1430
- */
1431
- function baseUnary(func) {
1432
- return function(value) {
1433
- return func(value);
1434
- };
1435
- }
1436
-
1437
- var _baseUnary = baseUnary;
1438
-
1439
- var _nodeUtil = createCommonjsModule(function (module, exports) {
1440
- /** Detect free variable `exports`. */
1441
- var freeExports = exports && !exports.nodeType && exports;
1442
-
1443
- /** Detect free variable `module`. */
1444
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1445
-
1446
- /** Detect the popular CommonJS extension `module.exports`. */
1447
- var moduleExports = freeModule && freeModule.exports === freeExports;
1448
-
1449
- /** Detect free variable `process` from Node.js. */
1450
- var freeProcess = moduleExports && _freeGlobal.process;
1451
-
1452
- /** Used to access faster Node.js helpers. */
1453
- var nodeUtil = (function() {
1454
- try {
1455
- // Use `util.types` for Node.js 10+.
1456
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1457
-
1458
- if (types) {
1459
- return types;
1460
- }
1461
-
1462
- // Legacy `process.binding('util')` for Node.js < 10.
1463
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1464
- } catch (e) {}
1465
- }());
1466
-
1467
- module.exports = nodeUtil;
1468
- });
1469
-
1470
- /* Node.js helper references. */
1471
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
1472
-
1473
- /**
1474
- * Checks if `value` is classified as a typed array.
1475
- *
1476
- * @static
1477
- * @memberOf _
1478
- * @since 3.0.0
1479
- * @category Lang
1480
- * @param {*} value The value to check.
1481
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1482
- * @example
1483
- *
1484
- * _.isTypedArray(new Uint8Array);
1485
- * // => true
1486
- *
1487
- * _.isTypedArray([]);
1488
- * // => false
1489
- */
1490
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
1491
-
1492
- var isTypedArray_1 = isTypedArray;
1493
-
1494
- /** Used for built-in method references. */
1495
- var objectProto$7 = Object.prototype;
1496
-
1497
- /** Used to check objects for own properties. */
1498
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
1499
-
1500
- /**
1501
- * Creates an array of the enumerable property names of the array-like `value`.
1502
- *
1503
- * @private
1504
- * @param {*} value The value to query.
1505
- * @param {boolean} inherited Specify returning inherited property names.
1506
- * @returns {Array} Returns the array of property names.
1507
- */
1508
- function arrayLikeKeys(value, inherited) {
1509
- var isArr = isArray_1(value),
1510
- isArg = !isArr && isArguments_1(value),
1511
- isBuff = !isArr && !isArg && isBuffer_1(value),
1512
- isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
1513
- skipIndexes = isArr || isArg || isBuff || isType,
1514
- result = skipIndexes ? _baseTimes(value.length, String) : [],
1515
- length = result.length;
1516
-
1517
- for (var key in value) {
1518
- if ((inherited || hasOwnProperty$6.call(value, key)) &&
1519
- !(skipIndexes && (
1520
- // Safari 9 has enumerable `arguments.length` in strict mode.
1521
- key == 'length' ||
1522
- // Node.js 0.10 has enumerable non-index properties on buffers.
1523
- (isBuff && (key == 'offset' || key == 'parent')) ||
1524
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1525
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1526
- // Skip index properties.
1527
- _isIndex(key, length)
1528
- ))) {
1529
- result.push(key);
1530
- }
1531
- }
1532
- return result;
1533
- }
1534
-
1535
- var _arrayLikeKeys = arrayLikeKeys;
1536
-
1537
- /** Used for built-in method references. */
1538
- var objectProto$8 = Object.prototype;
1539
-
1540
- /**
1541
- * Checks if `value` is likely a prototype object.
1542
- *
1543
- * @private
1544
- * @param {*} value The value to check.
1545
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1546
- */
1547
- function isPrototype(value) {
1548
- var Ctor = value && value.constructor,
1549
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
1550
-
1551
- return value === proto;
1552
- }
1553
-
1554
- var _isPrototype = isPrototype;
1555
-
1556
- /**
1557
- * Creates a unary function that invokes `func` with its argument transformed.
1558
- *
1559
- * @private
1560
- * @param {Function} func The function to wrap.
1561
- * @param {Function} transform The argument transform.
1562
- * @returns {Function} Returns the new function.
1563
- */
1564
- function overArg(func, transform) {
1565
- return function(arg) {
1566
- return func(transform(arg));
1567
- };
1568
- }
1569
-
1570
- var _overArg = overArg;
1571
-
1572
- /* Built-in method references for those with the same name as other `lodash` methods. */
1573
- var nativeKeys = _overArg(Object.keys, Object);
1574
-
1575
- var _nativeKeys = nativeKeys;
1576
-
1577
- /** Used for built-in method references. */
1578
- var objectProto$9 = Object.prototype;
1579
-
1580
- /** Used to check objects for own properties. */
1581
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
1582
-
1583
- /**
1584
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1585
- *
1586
- * @private
1587
- * @param {Object} object The object to query.
1588
- * @returns {Array} Returns the array of property names.
1589
- */
1590
- function baseKeys(object) {
1591
- if (!_isPrototype(object)) {
1592
- return _nativeKeys(object);
1593
- }
1594
- var result = [];
1595
- for (var key in Object(object)) {
1596
- if (hasOwnProperty$7.call(object, key) && key != 'constructor') {
1597
- result.push(key);
1598
- }
1599
- }
1600
- return result;
1601
- }
1602
-
1603
- var _baseKeys = baseKeys;
1604
-
1605
- /**
1606
- * Checks if `value` is array-like. A value is considered array-like if it's
1607
- * not a function and has a `value.length` that's an integer greater than or
1608
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1609
- *
1610
- * @static
1611
- * @memberOf _
1612
- * @since 4.0.0
1613
- * @category Lang
1614
- * @param {*} value The value to check.
1615
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1616
- * @example
1617
- *
1618
- * _.isArrayLike([1, 2, 3]);
1619
- * // => true
1620
- *
1621
- * _.isArrayLike(document.body.children);
1622
- * // => true
1623
- *
1624
- * _.isArrayLike('abc');
1625
- * // => true
1626
- *
1627
- * _.isArrayLike(_.noop);
1628
- * // => false
1629
- */
1630
- function isArrayLike(value) {
1631
- return value != null && isLength_1(value.length) && !isFunction_1(value);
1632
- }
1633
-
1634
- var isArrayLike_1 = isArrayLike;
1635
-
1636
- /**
1637
- * Creates an array of the own enumerable property names of `object`.
1638
- *
1639
- * **Note:** Non-object values are coerced to objects. See the
1640
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1641
- * for more details.
1642
- *
1643
- * @static
1644
- * @since 0.1.0
1645
- * @memberOf _
1646
- * @category Object
1647
- * @param {Object} object The object to query.
1648
- * @returns {Array} Returns the array of property names.
1649
- * @example
1650
- *
1651
- * function Foo() {
1652
- * this.a = 1;
1653
- * this.b = 2;
1654
- * }
1655
- *
1656
- * Foo.prototype.c = 3;
1657
- *
1658
- * _.keys(new Foo);
1659
- * // => ['a', 'b'] (iteration order is not guaranteed)
1660
- *
1661
- * _.keys('hi');
1662
- * // => ['0', '1']
1663
- */
1664
- function keys(object) {
1665
- return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
1666
- }
1667
-
1668
- var keys_1 = keys;
1669
-
1670
- /**
1671
- * The base implementation of `_.assign` without support for multiple sources
1672
- * or `customizer` functions.
1673
- *
1674
- * @private
1675
- * @param {Object} object The destination object.
1676
- * @param {Object} source The source object.
1677
- * @returns {Object} Returns `object`.
1678
- */
1679
- function baseAssign(object, source) {
1680
- return object && _copyObject(source, keys_1(source), object);
1681
- }
1682
-
1683
- var _baseAssign = baseAssign;
1684
-
1685
- /**
1686
- * This function is like
1687
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1688
- * except that it includes inherited enumerable properties.
1689
- *
1690
- * @private
1691
- * @param {Object} object The object to query.
1692
- * @returns {Array} Returns the array of property names.
1693
- */
1694
- function nativeKeysIn(object) {
1695
- var result = [];
1696
- if (object != null) {
1697
- for (var key in Object(object)) {
1698
- result.push(key);
1699
- }
1700
- }
1701
- return result;
1702
- }
1703
-
1704
- var _nativeKeysIn = nativeKeysIn;
1705
-
1706
- /** Used for built-in method references. */
1707
- var objectProto$a = Object.prototype;
1708
-
1709
- /** Used to check objects for own properties. */
1710
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
1711
-
1712
- /**
1713
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1714
- *
1715
- * @private
1716
- * @param {Object} object The object to query.
1717
- * @returns {Array} Returns the array of property names.
1718
- */
1719
- function baseKeysIn(object) {
1720
- if (!isObject_1(object)) {
1721
- return _nativeKeysIn(object);
1722
- }
1723
- var isProto = _isPrototype(object),
1724
- result = [];
1725
-
1726
- for (var key in object) {
1727
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$8.call(object, key)))) {
1728
- result.push(key);
1729
- }
1730
- }
1731
- return result;
1732
- }
1733
-
1734
- var _baseKeysIn = baseKeysIn;
1735
-
1736
- /**
1737
- * Creates an array of the own and inherited enumerable property names of `object`.
1738
- *
1739
- * **Note:** Non-object values are coerced to objects.
1740
- *
1741
- * @static
1742
- * @memberOf _
1743
- * @since 3.0.0
1744
- * @category Object
1745
- * @param {Object} object The object to query.
1746
- * @returns {Array} Returns the array of property names.
1747
- * @example
1748
- *
1749
- * function Foo() {
1750
- * this.a = 1;
1751
- * this.b = 2;
1752
- * }
1753
- *
1754
- * Foo.prototype.c = 3;
1755
- *
1756
- * _.keysIn(new Foo);
1757
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1758
- */
1759
- function keysIn(object) {
1760
- return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
1761
- }
1762
-
1763
- var keysIn_1 = keysIn;
1764
-
1765
- /**
1766
- * The base implementation of `_.assignIn` without support for multiple sources
1767
- * or `customizer` functions.
1768
- *
1769
- * @private
1770
- * @param {Object} object The destination object.
1771
- * @param {Object} source The source object.
1772
- * @returns {Object} Returns `object`.
1773
- */
1774
- function baseAssignIn(object, source) {
1775
- return object && _copyObject(source, keysIn_1(source), object);
1776
- }
1777
-
1778
- var _baseAssignIn = baseAssignIn;
1779
-
1780
- var _cloneBuffer = createCommonjsModule(function (module, exports) {
1781
- /** Detect free variable `exports`. */
1782
- var freeExports = exports && !exports.nodeType && exports;
1783
-
1784
- /** Detect free variable `module`. */
1785
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1786
-
1787
- /** Detect the popular CommonJS extension `module.exports`. */
1788
- var moduleExports = freeModule && freeModule.exports === freeExports;
1789
-
1790
- /** Built-in value references. */
1791
- var Buffer = moduleExports ? _root.Buffer : undefined,
1792
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1793
-
1794
- /**
1795
- * Creates a clone of `buffer`.
1796
- *
1797
- * @private
1798
- * @param {Buffer} buffer The buffer to clone.
1799
- * @param {boolean} [isDeep] Specify a deep clone.
1800
- * @returns {Buffer} Returns the cloned buffer.
1801
- */
1802
- function cloneBuffer(buffer, isDeep) {
1803
- if (isDeep) {
1804
- return buffer.slice();
1805
- }
1806
- var length = buffer.length,
1807
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1808
-
1809
- buffer.copy(result);
1810
- return result;
1811
- }
1812
-
1813
- module.exports = cloneBuffer;
1814
- });
1815
-
1816
- /**
1817
- * Copies the values of `source` to `array`.
1818
- *
1819
- * @private
1820
- * @param {Array} source The array to copy values from.
1821
- * @param {Array} [array=[]] The array to copy values to.
1822
- * @returns {Array} Returns `array`.
1823
- */
1824
- function copyArray(source, array) {
1825
- var index = -1,
1826
- length = source.length;
1827
-
1828
- array || (array = Array(length));
1829
- while (++index < length) {
1830
- array[index] = source[index];
1831
- }
1832
- return array;
1833
- }
1834
-
1835
- var _copyArray = copyArray;
1836
-
1837
- /**
1838
- * A specialized version of `_.filter` for arrays without support for
1839
- * iteratee shorthands.
1840
- *
1841
- * @private
1842
- * @param {Array} [array] The array to iterate over.
1843
- * @param {Function} predicate The function invoked per iteration.
1844
- * @returns {Array} Returns the new filtered array.
1845
- */
1846
- function arrayFilter(array, predicate) {
1847
- var index = -1,
1848
- length = array == null ? 0 : array.length,
1849
- resIndex = 0,
1850
- result = [];
1851
-
1852
- while (++index < length) {
1853
- var value = array[index];
1854
- if (predicate(value, index, array)) {
1855
- result[resIndex++] = value;
1856
- }
1857
- }
1858
- return result;
1859
- }
1860
-
1861
- var _arrayFilter = arrayFilter;
1862
-
1863
- /**
1864
- * This method returns a new empty array.
1865
- *
1866
- * @static
1867
- * @memberOf _
1868
- * @since 4.13.0
1869
- * @category Util
1870
- * @returns {Array} Returns the new empty array.
1871
- * @example
1872
- *
1873
- * var arrays = _.times(2, _.stubArray);
1874
- *
1875
- * console.log(arrays);
1876
- * // => [[], []]
1877
- *
1878
- * console.log(arrays[0] === arrays[1]);
1879
- * // => false
1880
- */
1881
- function stubArray() {
1882
- return [];
1883
- }
1884
-
1885
- var stubArray_1 = stubArray;
1886
-
1887
- /** Used for built-in method references. */
1888
- var objectProto$b = Object.prototype;
1889
-
1890
- /** Built-in value references. */
1891
- var propertyIsEnumerable$1 = objectProto$b.propertyIsEnumerable;
1892
-
1893
- /* Built-in method references for those with the same name as other `lodash` methods. */
1894
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1895
-
1896
- /**
1897
- * Creates an array of the own enumerable symbols of `object`.
1898
- *
1899
- * @private
1900
- * @param {Object} object The object to query.
1901
- * @returns {Array} Returns the array of symbols.
1902
- */
1903
- var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
1904
- if (object == null) {
1905
- return [];
1906
- }
1907
- object = Object(object);
1908
- return _arrayFilter(nativeGetSymbols(object), function(symbol) {
1909
- return propertyIsEnumerable$1.call(object, symbol);
1910
- });
1911
- };
1912
-
1913
- var _getSymbols = getSymbols;
1914
-
1915
- /**
1916
- * Copies own symbols of `source` to `object`.
1917
- *
1918
- * @private
1919
- * @param {Object} source The object to copy symbols from.
1920
- * @param {Object} [object={}] The object to copy symbols to.
1921
- * @returns {Object} Returns `object`.
1922
- */
1923
- function copySymbols(source, object) {
1924
- return _copyObject(source, _getSymbols(source), object);
1925
- }
1926
-
1927
- var _copySymbols = copySymbols;
1928
-
1929
- /**
1930
- * Appends the elements of `values` to `array`.
1931
- *
1932
- * @private
1933
- * @param {Array} array The array to modify.
1934
- * @param {Array} values The values to append.
1935
- * @returns {Array} Returns `array`.
1936
- */
1937
- function arrayPush(array, values) {
1938
- var index = -1,
1939
- length = values.length,
1940
- offset = array.length;
1941
-
1942
- while (++index < length) {
1943
- array[offset + index] = values[index];
1944
- }
1945
- return array;
1946
- }
1947
-
1948
- var _arrayPush = arrayPush;
1949
-
1950
- /** Built-in value references. */
1951
- var getPrototype = _overArg(Object.getPrototypeOf, Object);
1952
-
1953
- var _getPrototype = getPrototype;
1954
-
1955
- /* Built-in method references for those with the same name as other `lodash` methods. */
1956
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1957
-
1958
- /**
1959
- * Creates an array of the own and inherited enumerable symbols of `object`.
1960
- *
1961
- * @private
1962
- * @param {Object} object The object to query.
1963
- * @returns {Array} Returns the array of symbols.
1964
- */
1965
- var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function(object) {
1966
- var result = [];
1967
- while (object) {
1968
- _arrayPush(result, _getSymbols(object));
1969
- object = _getPrototype(object);
1970
- }
1971
- return result;
1972
- };
1973
-
1974
- var _getSymbolsIn = getSymbolsIn;
1975
-
1976
- /**
1977
- * Copies own and inherited symbols of `source` to `object`.
1978
- *
1979
- * @private
1980
- * @param {Object} source The object to copy symbols from.
1981
- * @param {Object} [object={}] The object to copy symbols to.
1982
- * @returns {Object} Returns `object`.
1983
- */
1984
- function copySymbolsIn(source, object) {
1985
- return _copyObject(source, _getSymbolsIn(source), object);
1986
- }
1987
-
1988
- var _copySymbolsIn = copySymbolsIn;
1989
-
1990
- /**
1991
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1992
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1993
- * symbols of `object`.
1994
- *
1995
- * @private
1996
- * @param {Object} object The object to query.
1997
- * @param {Function} keysFunc The function to get the keys of `object`.
1998
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1999
- * @returns {Array} Returns the array of property names and symbols.
2000
- */
2001
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2002
- var result = keysFunc(object);
2003
- return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
2004
- }
2005
-
2006
- var _baseGetAllKeys = baseGetAllKeys;
2007
-
2008
- /**
2009
- * Creates an array of own enumerable property names and symbols of `object`.
2010
- *
2011
- * @private
2012
- * @param {Object} object The object to query.
2013
- * @returns {Array} Returns the array of property names and symbols.
2014
- */
2015
- function getAllKeys(object) {
2016
- return _baseGetAllKeys(object, keys_1, _getSymbols);
2017
- }
2018
-
2019
- var _getAllKeys = getAllKeys;
2020
-
2021
- /**
2022
- * Creates an array of own and inherited enumerable property names and
2023
- * symbols of `object`.
2024
- *
2025
- * @private
2026
- * @param {Object} object The object to query.
2027
- * @returns {Array} Returns the array of property names and symbols.
2028
- */
2029
- function getAllKeysIn(object) {
2030
- return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);
2031
- }
2032
-
2033
- var _getAllKeysIn = getAllKeysIn;
2034
-
2035
- /* Built-in method references that are verified to be native. */
2036
- var DataView = _getNative(_root, 'DataView');
2037
-
2038
- var _DataView = DataView;
2039
-
2040
- /* Built-in method references that are verified to be native. */
2041
- var Promise = _getNative(_root, 'Promise');
2042
-
2043
- var _Promise = Promise;
2044
-
2045
- /* Built-in method references that are verified to be native. */
2046
- var Set = _getNative(_root, 'Set');
2047
-
2048
- var _Set = Set;
2049
-
2050
- /* Built-in method references that are verified to be native. */
2051
- var WeakMap = _getNative(_root, 'WeakMap');
2052
-
2053
- var _WeakMap = WeakMap;
2054
-
2055
- /** `Object#toString` result references. */
2056
- var mapTag$1 = '[object Map]',
2057
- objectTag$1 = '[object Object]',
2058
- promiseTag = '[object Promise]',
2059
- setTag$1 = '[object Set]',
2060
- weakMapTag$1 = '[object WeakMap]';
2061
-
2062
- var dataViewTag$1 = '[object DataView]';
2063
-
2064
- /** Used to detect maps, sets, and weakmaps. */
2065
- var dataViewCtorString = _toSource(_DataView),
2066
- mapCtorString = _toSource(_Map),
2067
- promiseCtorString = _toSource(_Promise),
2068
- setCtorString = _toSource(_Set),
2069
- weakMapCtorString = _toSource(_WeakMap);
2070
-
2071
- /**
2072
- * Gets the `toStringTag` of `value`.
2073
- *
2074
- * @private
2075
- * @param {*} value The value to query.
2076
- * @returns {string} Returns the `toStringTag`.
2077
- */
2078
- var getTag = _baseGetTag;
2079
-
2080
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2081
- if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
2082
- (_Map && getTag(new _Map) != mapTag$1) ||
2083
- (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
2084
- (_Set && getTag(new _Set) != setTag$1) ||
2085
- (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) {
2086
- getTag = function(value) {
2087
- var result = _baseGetTag(value),
2088
- Ctor = result == objectTag$1 ? value.constructor : undefined,
2089
- ctorString = Ctor ? _toSource(Ctor) : '';
2090
-
2091
- if (ctorString) {
2092
- switch (ctorString) {
2093
- case dataViewCtorString: return dataViewTag$1;
2094
- case mapCtorString: return mapTag$1;
2095
- case promiseCtorString: return promiseTag;
2096
- case setCtorString: return setTag$1;
2097
- case weakMapCtorString: return weakMapTag$1;
2098
- }
2099
- }
2100
- return result;
2101
- };
2102
- }
2103
-
2104
- var _getTag = getTag;
2105
-
2106
- /** Used for built-in method references. */
2107
- var objectProto$c = Object.prototype;
2108
-
2109
- /** Used to check objects for own properties. */
2110
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
2111
-
2112
- /**
2113
- * Initializes an array clone.
2114
- *
2115
- * @private
2116
- * @param {Array} array The array to clone.
2117
- * @returns {Array} Returns the initialized clone.
2118
- */
2119
- function initCloneArray(array) {
2120
- var length = array.length,
2121
- result = new array.constructor(length);
2122
-
2123
- // Add properties assigned by `RegExp#exec`.
2124
- if (length && typeof array[0] == 'string' && hasOwnProperty$9.call(array, 'index')) {
2125
- result.index = array.index;
2126
- result.input = array.input;
2127
- }
2128
- return result;
2129
- }
2130
-
2131
- var _initCloneArray = initCloneArray;
2132
-
2133
- /** Built-in value references. */
2134
- var Uint8Array = _root.Uint8Array;
2135
-
2136
- var _Uint8Array = Uint8Array;
2137
-
2138
- /**
2139
- * Creates a clone of `arrayBuffer`.
2140
- *
2141
- * @private
2142
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2143
- * @returns {ArrayBuffer} Returns the cloned array buffer.
2144
- */
2145
- function cloneArrayBuffer(arrayBuffer) {
2146
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2147
- new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
2148
- return result;
2149
- }
2150
-
2151
- var _cloneArrayBuffer = cloneArrayBuffer;
2152
-
2153
- /**
2154
- * Creates a clone of `dataView`.
2155
- *
2156
- * @private
2157
- * @param {Object} dataView The data view to clone.
2158
- * @param {boolean} [isDeep] Specify a deep clone.
2159
- * @returns {Object} Returns the cloned data view.
2160
- */
2161
- function cloneDataView(dataView, isDeep) {
2162
- var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2163
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2164
- }
2165
-
2166
- var _cloneDataView = cloneDataView;
2167
-
2168
- /** Used to match `RegExp` flags from their coerced string values. */
2169
- var reFlags = /\w*$/;
2170
-
2171
- /**
2172
- * Creates a clone of `regexp`.
2173
- *
2174
- * @private
2175
- * @param {Object} regexp The regexp to clone.
2176
- * @returns {Object} Returns the cloned regexp.
2177
- */
2178
- function cloneRegExp(regexp) {
2179
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2180
- result.lastIndex = regexp.lastIndex;
2181
- return result;
2182
- }
2183
-
2184
- var _cloneRegExp = cloneRegExp;
2185
-
2186
- /** Used to convert symbols to primitives and strings. */
2187
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
2188
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2189
-
2190
- /**
2191
- * Creates a clone of the `symbol` object.
2192
- *
2193
- * @private
2194
- * @param {Object} symbol The symbol object to clone.
2195
- * @returns {Object} Returns the cloned symbol object.
2196
- */
2197
- function cloneSymbol(symbol) {
2198
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2199
- }
2200
-
2201
- var _cloneSymbol = cloneSymbol;
2202
-
2203
- /**
2204
- * Creates a clone of `typedArray`.
2205
- *
2206
- * @private
2207
- * @param {Object} typedArray The typed array to clone.
2208
- * @param {boolean} [isDeep] Specify a deep clone.
2209
- * @returns {Object} Returns the cloned typed array.
2210
- */
2211
- function cloneTypedArray(typedArray, isDeep) {
2212
- var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2213
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2214
- }
2215
-
2216
- var _cloneTypedArray = cloneTypedArray;
2217
-
2218
- /** `Object#toString` result references. */
2219
- var boolTag$1 = '[object Boolean]',
2220
- dateTag$1 = '[object Date]',
2221
- mapTag$2 = '[object Map]',
2222
- numberTag$1 = '[object Number]',
2223
- regexpTag$1 = '[object RegExp]',
2224
- setTag$2 = '[object Set]',
2225
- stringTag$1 = '[object String]',
2226
- symbolTag = '[object Symbol]';
2227
-
2228
- var arrayBufferTag$1 = '[object ArrayBuffer]',
2229
- dataViewTag$2 = '[object DataView]',
2230
- float32Tag$1 = '[object Float32Array]',
2231
- float64Tag$1 = '[object Float64Array]',
2232
- int8Tag$1 = '[object Int8Array]',
2233
- int16Tag$1 = '[object Int16Array]',
2234
- int32Tag$1 = '[object Int32Array]',
2235
- uint8Tag$1 = '[object Uint8Array]',
2236
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2237
- uint16Tag$1 = '[object Uint16Array]',
2238
- uint32Tag$1 = '[object Uint32Array]';
2239
-
2240
- /**
2241
- * Initializes an object clone based on its `toStringTag`.
2242
- *
2243
- * **Note:** This function only supports cloning values with tags of
2244
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2245
- *
2246
- * @private
2247
- * @param {Object} object The object to clone.
2248
- * @param {string} tag The `toStringTag` of the object to clone.
2249
- * @param {boolean} [isDeep] Specify a deep clone.
2250
- * @returns {Object} Returns the initialized clone.
2251
- */
2252
- function initCloneByTag(object, tag, isDeep) {
2253
- var Ctor = object.constructor;
2254
- switch (tag) {
2255
- case arrayBufferTag$1:
2256
- return _cloneArrayBuffer(object);
2257
-
2258
- case boolTag$1:
2259
- case dateTag$1:
2260
- return new Ctor(+object);
2261
-
2262
- case dataViewTag$2:
2263
- return _cloneDataView(object, isDeep);
2264
-
2265
- case float32Tag$1: case float64Tag$1:
2266
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
2267
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2268
- return _cloneTypedArray(object, isDeep);
2269
-
2270
- case mapTag$2:
2271
- return new Ctor;
2272
-
2273
- case numberTag$1:
2274
- case stringTag$1:
2275
- return new Ctor(object);
2276
-
2277
- case regexpTag$1:
2278
- return _cloneRegExp(object);
2279
-
2280
- case setTag$2:
2281
- return new Ctor;
2282
-
2283
- case symbolTag:
2284
- return _cloneSymbol(object);
2285
- }
2286
- }
2287
-
2288
- var _initCloneByTag = initCloneByTag;
2289
-
2290
- /** Built-in value references. */
2291
- var objectCreate = Object.create;
2292
-
2293
- /**
2294
- * The base implementation of `_.create` without support for assigning
2295
- * properties to the created object.
2296
- *
2297
- * @private
2298
- * @param {Object} proto The object to inherit from.
2299
- * @returns {Object} Returns the new object.
2300
- */
2301
- var baseCreate = (function() {
2302
- function object() {}
2303
- return function(proto) {
2304
- if (!isObject_1(proto)) {
2305
- return {};
2306
- }
2307
- if (objectCreate) {
2308
- return objectCreate(proto);
2309
- }
2310
- object.prototype = proto;
2311
- var result = new object;
2312
- object.prototype = undefined;
2313
- return result;
2314
- };
2315
- }());
2316
-
2317
- var _baseCreate = baseCreate;
2318
-
2319
- /**
2320
- * Initializes an object clone.
2321
- *
2322
- * @private
2323
- * @param {Object} object The object to clone.
2324
- * @returns {Object} Returns the initialized clone.
2325
- */
2326
- function initCloneObject(object) {
2327
- return (typeof object.constructor == 'function' && !_isPrototype(object))
2328
- ? _baseCreate(_getPrototype(object))
2329
- : {};
2330
- }
2331
-
2332
- var _initCloneObject = initCloneObject;
2333
-
2334
- /** `Object#toString` result references. */
2335
- var mapTag$3 = '[object Map]';
2336
-
2337
- /**
2338
- * The base implementation of `_.isMap` without Node.js optimizations.
2339
- *
2340
- * @private
2341
- * @param {*} value The value to check.
2342
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2343
- */
2344
- function baseIsMap(value) {
2345
- return isObjectLike_1(value) && _getTag(value) == mapTag$3;
2346
- }
2347
-
2348
- var _baseIsMap = baseIsMap;
2349
-
2350
- /* Node.js helper references. */
2351
- var nodeIsMap = _nodeUtil && _nodeUtil.isMap;
2352
-
2353
- /**
2354
- * Checks if `value` is classified as a `Map` object.
2355
- *
2356
- * @static
2357
- * @memberOf _
2358
- * @since 4.3.0
2359
- * @category Lang
2360
- * @param {*} value The value to check.
2361
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2362
- * @example
2363
- *
2364
- * _.isMap(new Map);
2365
- * // => true
2366
- *
2367
- * _.isMap(new WeakMap);
2368
- * // => false
2369
- */
2370
- var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;
2371
-
2372
- var isMap_1 = isMap;
2373
-
2374
- /** `Object#toString` result references. */
2375
- var setTag$3 = '[object Set]';
2376
-
2377
- /**
2378
- * The base implementation of `_.isSet` without Node.js optimizations.
2379
- *
2380
- * @private
2381
- * @param {*} value The value to check.
2382
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2383
- */
2384
- function baseIsSet(value) {
2385
- return isObjectLike_1(value) && _getTag(value) == setTag$3;
2386
- }
2387
-
2388
- var _baseIsSet = baseIsSet;
2389
-
2390
- /* Node.js helper references. */
2391
- var nodeIsSet = _nodeUtil && _nodeUtil.isSet;
2392
-
2393
- /**
2394
- * Checks if `value` is classified as a `Set` object.
2395
- *
2396
- * @static
2397
- * @memberOf _
2398
- * @since 4.3.0
2399
- * @category Lang
2400
- * @param {*} value The value to check.
2401
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2402
- * @example
2403
- *
2404
- * _.isSet(new Set);
2405
- * // => true
2406
- *
2407
- * _.isSet(new WeakSet);
2408
- * // => false
2409
- */
2410
- var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;
2411
-
2412
- var isSet_1 = isSet;
2413
-
2414
- /** Used to compose bitmasks for cloning. */
2415
- var CLONE_DEEP_FLAG = 1,
2416
- CLONE_FLAT_FLAG = 2,
2417
- CLONE_SYMBOLS_FLAG = 4;
2418
-
2419
- /** `Object#toString` result references. */
2420
- var argsTag$2 = '[object Arguments]',
2421
- arrayTag$1 = '[object Array]',
2422
- boolTag$2 = '[object Boolean]',
2423
- dateTag$2 = '[object Date]',
2424
- errorTag$1 = '[object Error]',
2425
- funcTag$2 = '[object Function]',
2426
- genTag$1 = '[object GeneratorFunction]',
2427
- mapTag$4 = '[object Map]',
2428
- numberTag$2 = '[object Number]',
2429
- objectTag$2 = '[object Object]',
2430
- regexpTag$2 = '[object RegExp]',
2431
- setTag$4 = '[object Set]',
2432
- stringTag$2 = '[object String]',
2433
- symbolTag$1 = '[object Symbol]',
2434
- weakMapTag$2 = '[object WeakMap]';
2435
-
2436
- var arrayBufferTag$2 = '[object ArrayBuffer]',
2437
- dataViewTag$3 = '[object DataView]',
2438
- float32Tag$2 = '[object Float32Array]',
2439
- float64Tag$2 = '[object Float64Array]',
2440
- int8Tag$2 = '[object Int8Array]',
2441
- int16Tag$2 = '[object Int16Array]',
2442
- int32Tag$2 = '[object Int32Array]',
2443
- uint8Tag$2 = '[object Uint8Array]',
2444
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
2445
- uint16Tag$2 = '[object Uint16Array]',
2446
- uint32Tag$2 = '[object Uint32Array]';
2447
-
2448
- /** Used to identify `toStringTag` values supported by `_.clone`. */
2449
- var cloneableTags = {};
2450
- cloneableTags[argsTag$2] = cloneableTags[arrayTag$1] =
2451
- cloneableTags[arrayBufferTag$2] = cloneableTags[dataViewTag$3] =
2452
- cloneableTags[boolTag$2] = cloneableTags[dateTag$2] =
2453
- cloneableTags[float32Tag$2] = cloneableTags[float64Tag$2] =
2454
- cloneableTags[int8Tag$2] = cloneableTags[int16Tag$2] =
2455
- cloneableTags[int32Tag$2] = cloneableTags[mapTag$4] =
2456
- cloneableTags[numberTag$2] = cloneableTags[objectTag$2] =
2457
- cloneableTags[regexpTag$2] = cloneableTags[setTag$4] =
2458
- cloneableTags[stringTag$2] = cloneableTags[symbolTag$1] =
2459
- cloneableTags[uint8Tag$2] = cloneableTags[uint8ClampedTag$2] =
2460
- cloneableTags[uint16Tag$2] = cloneableTags[uint32Tag$2] = true;
2461
- cloneableTags[errorTag$1] = cloneableTags[funcTag$2] =
2462
- cloneableTags[weakMapTag$2] = false;
2463
-
2464
- /**
2465
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2466
- * traversed objects.
2467
- *
2468
- * @private
2469
- * @param {*} value The value to clone.
2470
- * @param {boolean} bitmask The bitmask flags.
2471
- * 1 - Deep clone
2472
- * 2 - Flatten inherited properties
2473
- * 4 - Clone symbols
2474
- * @param {Function} [customizer] The function to customize cloning.
2475
- * @param {string} [key] The key of `value`.
2476
- * @param {Object} [object] The parent object of `value`.
2477
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2478
- * @returns {*} Returns the cloned value.
2479
- */
2480
- function baseClone(value, bitmask, customizer, key, object, stack) {
2481
- var result,
2482
- isDeep = bitmask & CLONE_DEEP_FLAG,
2483
- isFlat = bitmask & CLONE_FLAT_FLAG,
2484
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
2485
-
2486
- if (customizer) {
2487
- result = object ? customizer(value, key, object, stack) : customizer(value);
2488
- }
2489
- if (result !== undefined) {
2490
- return result;
2491
- }
2492
- if (!isObject_1(value)) {
2493
- return value;
2494
- }
2495
- var isArr = isArray_1(value);
2496
- if (isArr) {
2497
- result = _initCloneArray(value);
2498
- if (!isDeep) {
2499
- return _copyArray(value, result);
2500
- }
2501
- } else {
2502
- var tag = _getTag(value),
2503
- isFunc = tag == funcTag$2 || tag == genTag$1;
2504
-
2505
- if (isBuffer_1(value)) {
2506
- return _cloneBuffer(value, isDeep);
2507
- }
2508
- if (tag == objectTag$2 || tag == argsTag$2 || (isFunc && !object)) {
2509
- result = (isFlat || isFunc) ? {} : _initCloneObject(value);
2510
- if (!isDeep) {
2511
- return isFlat
2512
- ? _copySymbolsIn(value, _baseAssignIn(result, value))
2513
- : _copySymbols(value, _baseAssign(result, value));
2514
- }
2515
- } else {
2516
- if (!cloneableTags[tag]) {
2517
- return object ? value : {};
2518
- }
2519
- result = _initCloneByTag(value, tag, isDeep);
2520
- }
2521
- }
2522
- // Check for circular references and return its corresponding clone.
2523
- stack || (stack = new _Stack);
2524
- var stacked = stack.get(value);
2525
- if (stacked) {
2526
- return stacked;
2527
- }
2528
- stack.set(value, result);
2529
-
2530
- if (isSet_1(value)) {
2531
- value.forEach(function(subValue) {
2532
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2533
- });
2534
- } else if (isMap_1(value)) {
2535
- value.forEach(function(subValue, key) {
2536
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2537
- });
2538
- }
2539
-
2540
- var keysFunc = isFull
2541
- ? (isFlat ? _getAllKeysIn : _getAllKeys)
2542
- : (isFlat ? keysIn_1 : keys_1);
2543
-
2544
- var props = isArr ? undefined : keysFunc(value);
2545
- _arrayEach(props || value, function(subValue, key) {
2546
- if (props) {
2547
- key = subValue;
2548
- subValue = value[key];
2549
- }
2550
- // Recursively populate clone (susceptible to call stack limits).
2551
- _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2552
- });
2553
- return result;
2554
- }
2555
-
2556
- var _baseClone = baseClone;
2557
-
2558
- /** Used to compose bitmasks for cloning. */
2559
- var CLONE_DEEP_FLAG$1 = 1,
2560
- CLONE_SYMBOLS_FLAG$1 = 4;
2561
-
2562
- /**
2563
- * This method is like `_.clone` except that it recursively clones `value`.
2564
- *
2565
- * @static
2566
- * @memberOf _
2567
- * @since 1.0.0
2568
- * @category Lang
2569
- * @param {*} value The value to recursively clone.
2570
- * @returns {*} Returns the deep cloned value.
2571
- * @see _.clone
2572
- * @example
2573
- *
2574
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2575
- *
2576
- * var deep = _.cloneDeep(objects);
2577
- * console.log(deep[0] === objects[0]);
2578
- * // => false
2579
- */
2580
- function cloneDeep(value) {
2581
- return _baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
2582
- }
2583
-
2584
- var cloneDeep_1 = cloneDeep;
2585
-
2586
- var inputPropsBasic = [{
2587
- name: 'title',
2588
- title: {
2589
- label: '标题',
2590
- tip: 'title | 标题'
2591
- },
2592
- setter: 'StringSetter'
2593
- }, {
2594
- name: 'code',
2595
- title: {
2596
- label: '字段名',
2597
- tip: 'key | 字段名'
2598
- },
2599
- setter: 'StringSetter'
2600
- }, {
2601
- name: 'defaultValue',
2602
- title: {
2603
- label: '默认值',
2604
- tip: 'defaultValue | 默认值'
2605
- },
2606
- setter: 'StringSetter'
2607
- }, {
2608
- name: 'props.placeholder',
2609
- title: {
2610
- label: '提示文案',
2611
- tip: 'placeholder | 提示文案'
2612
- },
2613
- setter: 'StringSetter'
2614
- }, {
2615
- name: 'description',
2616
- title: {
2617
- label: '补充说明',
2618
- tip: 'description | 补充说明'
2619
- },
2620
- setter: 'StringSetter'
2621
- }, {
2622
- name: 'tooltip.title',
2623
- title: {
2624
- label: '气泡提示',
2625
- tip: 'tooltip.title | 气泡提示文案'
2626
- },
2627
- setter: 'StringSetter'
2628
- }, {
2629
- name: 'extra',
2630
- title: {
2631
- label: '额外提示',
2632
- tip: 'extra | 额外的提示信息'
2633
- },
2634
- setter: 'StringSetter'
2635
- }, {
2636
- name: 'disabled',
2637
- title: {
2638
- label: '禁用',
2639
- tip: 'disabled | 禁用'
2640
- },
2641
- setter: 'FrExpressionSetter'
2642
- }, {
2643
- name: 'hidden',
2644
- title: {
2645
- label: '隐藏',
2646
- tip: 'hidden | 隐藏'
2647
- },
2648
- setter: 'FrExpressionSetter'
2649
- }, {
2650
- name: 'readOnly',
2651
- title: {
2652
- label: '只读',
2653
- tip: 'readOnly | 只读'
2654
- },
2655
- setter: 'FrExpressionSetter'
2656
- }, {
2657
- name: 'readOnlyWidget',
2658
- title: {
2659
- label: '只读组件',
2660
- tip: 'readOnlyWidget | 只读组件'
2661
- },
2662
- setter: 'StringSetter',
2663
- condition: function condition(target) {
2664
- return !!target.getProps().getPropValue('readOnly');
2665
- }
2666
- }];
2667
- var notInputPropsBasic = [{
2668
- name: 'title',
2669
- title: {
2670
- label: '标题',
2671
- tip: 'title | 标题'
2672
- },
2673
- setter: 'StringSetter'
2674
- }, {
2675
- name: 'code',
2676
- title: {
2677
- label: '字段名',
2678
- tip: 'key | 字段名'
2679
- },
2680
- setter: 'StringSetter'
2681
- }, {
2682
- name: 'defaultValue',
2683
- title: {
2684
- label: '默认值',
2685
- tip: 'defaultValue | 默认值'
2686
- },
2687
- setter: 'StringSetter'
2688
- }, {
2689
- name: 'description',
2690
- title: {
2691
- label: '补充说明',
2692
- tip: 'description | 补充说明'
2693
- },
2694
- setter: 'StringSetter'
2695
- }, {
2696
- name: 'tooltip',
2697
- title: {
2698
- label: '气泡提示',
2699
- tip: 'tooltip | 气泡提示文案'
2700
- },
2701
- setter: 'StringSetter'
2702
- }, {
2703
- name: 'extra',
2704
- title: {
2705
- label: '额外提示',
2706
- tip: 'extra | 额外的提示信息'
2707
- },
2708
- setter: 'StringSetter'
2709
- }, {
2710
- name: 'disabled',
2711
- title: {
2712
- label: '禁用',
2713
- tip: 'disabled | 禁用'
2714
- },
2715
- setter: 'FrExpressionSetter'
2716
- }, {
2717
- name: 'hidden',
2718
- title: {
2719
- label: '隐藏',
2720
- tip: 'hidden | 隐藏'
2721
- },
2722
- setter: 'FrExpressionSetter'
2723
- }, {
2724
- name: 'readOnly',
2725
- title: {
2726
- label: '只读',
2727
- tip: 'readOnly | 只读'
2728
- },
2729
- setter: 'FrExpressionSetter'
2730
- }, {
2731
- name: 'readOnlyWidget',
2732
- title: {
2733
- label: '只读组件',
2734
- tip: 'readOnlyWidget | 只读组件'
2735
- },
2736
- setter: 'StringSetter',
2737
- condition: function condition(target) {
2738
- return !!target.getProps().getPropValue('readOnly');
2739
- }
2740
- }];
2741
- var optionsProp = {
2742
- display: 'accordion',
2743
- name: 'props.options',
2744
- title: {
2745
- label: '选项配置',
2746
- tip: 'options | 选项配置'
2747
- },
2748
- setter: {
2749
- componentName: 'ArraySetter',
2750
- props: {
2751
- itemSetter: {
2752
- componentName: 'ObjectSetter',
2753
- initialValue: function initialValue() {
2754
- return {
2755
- label: '选项名',
2756
- value: uuid()
2757
- };
2758
- },
2759
- props: {
2760
- config: {
2761
- items: [{
2762
- name: 'label',
2763
- title: '选项名',
2764
- important: true,
2765
- setter: 'StringSetter'
2766
- }, {
2767
- name: 'value',
2768
- title: '选项值',
2769
- setter: ['StringSetter', 'NumberSetter'],
2770
- important: true
2771
- }, {
2772
- name: 'disabled',
2773
- title: '禁用',
2774
- setter: 'JsonSetter'
2775
- }]
2776
- }
2777
- }
2778
- }
2779
- }
2780
- }
2781
- };
2782
- var getInputPropsBasic = function getInputPropsBasic(defaultValueProp, placeholder) {
2783
- var result = cloneDeep_1(inputPropsBasic);
2784
- result.splice(2, 0, defaultValueProp);
2785
- if (placeholder) {
2786
- result.splice(3, 0, defaultValueProp);
2787
- }
2788
- return result;
2789
- };
2790
- var getNotInputPropsBasic = function getNotInputPropsBasic(defaultValueProp) {
2791
- var result = cloneDeep_1(notInputPropsBasic);
2792
- result.splice(2, 0, defaultValueProp);
2793
- return result;
2794
- };
2795
- var uuid = function uuid() {
2796
- return (Math.random() * 1e6 >> 0).toString(36);
2797
- };
2798
- var createMeta = function createMeta(componentName, params) {
2799
- return _objectSpread2({
2800
- componentName: componentName,
2801
- docUrl: '',
2802
- screenshot: '',
2803
- devMode: 'proCode',
2804
- npm: {
2805
- package: '@ali/form-render-material',
2806
- version: '1.0.0',
2807
- exportName: componentName,
2808
- main: 'src/index.tsx',
2809
- destructuring: true,
2810
- subName: ''
2811
- },
2812
- configure: {
2813
- supports: {
2814
- loop: false,
2815
- condition: false
2816
- },
2817
- component: {
2818
- isContainer: false,
2819
- isModal: false,
2820
- nestingRule: {
2821
- parentWhitelist: ['FormRender', 'Card', 'CardList', 'TableList']
2822
- }
2823
- }
2824
- },
2825
- group: '基础组件',
2826
- category: '常用',
2827
- icon: 'https://img.alicdn.com/imgextra/i4/O1CN01gxzRdT1hm9KXRbZkU_!!6000000004319-2-tps-200-200.png'
2828
- }, params);
2829
- };
2830
-
2831
- var input = createMeta('Input', {
2832
- title: '单行文本',
2833
- priority: 1000,
2834
- props: [{
2835
- title: '基础配置',
2836
- type: 'group',
2837
- display: 'accordion',
2838
- items: inputPropsBasic
2839
- }, {
2840
- title: '其他配置',
2841
- type: 'group',
2842
- display: 'accordion',
2843
- items: [{
2844
- name: 'props.prefix',
2845
- title: {
2846
- label: '前缀',
2847
- tip: 'prefix | 前缀'
2848
- },
2849
- setter: 'StringSetter'
2850
- }, {
2851
- name: 'props.suffix',
2852
- title: {
2853
- label: '后缀',
2854
- tip: 'suffix | 后缀'
2855
- },
2856
- setter: 'StringSetter'
2857
- }, {
2858
- name: 'props.addonBefore',
2859
- title: {
2860
- label: '前置标签',
2861
- tip: 'addonBefore | 前置标签'
2862
- },
2863
- setter: 'StringSetter'
2864
- }, {
2865
- name: 'props.addonAfter',
2866
- title: {
2867
- label: '后置标签',
2868
- tip: 'addonAfter | 后置标签'
2869
- },
2870
- setter: 'StringSetter'
2871
- }, {
2872
- name: 'props.allowClear',
2873
- title: {
2874
- label: '支持清除',
2875
- tip: 'allowClear | 支持清除'
2876
- },
2877
- setter: 'BoolSetter'
2878
- }]
2879
- }],
2880
- snippets: [{
2881
- label: '单行文本',
2882
- screenshot: 'icon-input',
2883
- schema: {
2884
- componentName: 'Input',
2885
- props: {
2886
- title: '单行文本',
2887
- type: 'string'
2888
- }
2889
- }
2890
- }]
2891
- });
2892
-
2893
- var number = createMeta('InputNumber', {
2894
- title: '数字输入框',
2895
- priority: 999,
2896
- props: [{
2897
- title: '基础配置',
2898
- type: 'group',
2899
- display: 'accordion',
2900
- items: getInputPropsBasic({
2901
- name: 'defaultValue',
2902
- title: {
2903
- label: '默认值',
2904
- tip: 'defaultValue | 默认值'
2905
- },
2906
- setter: 'NumberSetter'
2907
- })
2908
- }, {
2909
- title: '其他配置',
2910
- display: 'accordion',
2911
- type: 'group',
2912
- items: [{
2913
- name: 'props.prefix',
2914
- title: {
2915
- label: '前缀',
2916
- tip: 'prefix | 前缀'
2917
- },
2918
- setter: 'StringSetter'
2919
- }, {
2920
- name: 'props.addonBefore',
2921
- title: {
2922
- label: '前置标签',
2923
- tip: 'addonBefore | 前置标签'
2924
- },
2925
- setter: 'StringSetter'
2926
- }, {
2927
- name: 'props.addonAfter',
2928
- title: {
2929
- label: '后置标签',
2930
- tip: 'addonAfter | 后置标签'
2931
- },
2932
- setter: 'StringSetter'
2933
- }, {
2934
- name: 'props.precision',
2935
- title: {
2936
- label: '数值精度',
2937
- tip: 'precision | 数值精度'
2938
- },
2939
- setter: 'NumberSetter'
2940
- }, {
2941
- name: 'props.step',
2942
- title: {
2943
- label: '单步步长',
2944
- tip: 'step | 每次改变步数,可以为小数'
2945
- },
2946
- setter: ['NumberSetter', 'StringSetter']
2947
- }]
2948
- }],
2949
- snippets: [{
2950
- label: '数字输入框',
2951
- screenshot: 'icon-inputNumber',
2952
- schema: {
2953
- componentName: 'InputNumber',
2954
- props: {
2955
- title: '数字输入框',
2956
- type: 'number'
2957
- }
2958
- }
2959
- }]
2960
- });
2961
-
2962
- var select = createMeta('Select', {
2963
- title: '下拉选择',
2964
- priority: 998,
2965
- props: [{
2966
- title: '基础配置',
2967
- type: 'group',
2968
- display: 'accordion',
2969
- items: getInputPropsBasic({
2970
- name: 'defaultValue',
2971
- title: {
2972
- label: '默认值',
2973
- tip: 'defaultValue | 默认值'
2974
- },
2975
- setter: 'JsonSetter'
2976
- })
2977
- }, optionsProp],
2978
- snippets: [{
2979
- title: '下拉单选',
2980
- screenshot: 'icon-select',
2981
- schema: {
2982
- componentName: 'Select',
2983
- props: {
2984
- title: '下拉单选',
2985
- type: 'string',
2986
- props: {
2987
- options: [{
2988
- label: 'A',
2989
- value: 'A'
2990
- }, {
2991
- label: 'B',
2992
- value: 'B'
2993
- }]
2994
- }
2995
- }
2996
- }
2997
- }, {
2998
- title: '下拉多选',
2999
- screenshot: 'icon-multiSelect',
3000
- schema: {
3001
- componentName: 'Select',
3002
- props: {
3003
- title: '下拉多选',
3004
- type: 'array',
3005
- widget: 'multiSelect',
3006
- props: {
3007
- options: [{
3008
- label: 'A',
3009
- value: 'A'
3010
- }, {
3011
- label: 'B',
3012
- value: 'B'
3013
- }]
3014
- }
3015
- }
3016
- }
3017
- }]
3018
- });
3019
-
3020
- var radio = createMeta('Radio', {
3021
- title: '点击单选',
3022
- priority: 997,
3023
- props: [{
3024
- title: '基础配置',
3025
- type: 'group',
3026
- display: 'accordion',
3027
- items: getNotInputPropsBasic({
3028
- name: 'defaultValue',
3029
- title: {
3030
- label: '默认值',
3031
- tip: 'defaultValue | 默认值'
3032
- },
3033
- setter: 'JsonSetter'
3034
- })
3035
- }, optionsProp, {
3036
- title: '其他配置',
3037
- display: 'accordion',
3038
- type: 'group',
3039
- items: [{
3040
- name: 'props.direction',
3041
- title: {
3042
- label: '排列方向',
3043
- tip: '选项的排列方向'
3044
- },
3045
- defaultValue: 'row',
3046
- setter: {
3047
- componentName: 'RadioGroupSetter',
3048
- props: {
3049
- options: [{
3050
- title: '水平',
3051
- value: 'row'
3052
- }, {
3053
- title: '垂直',
3054
- value: 'column'
3055
- }]
3056
- }
3057
- }
3058
- }]
3059
- }],
3060
- snippets: [{
3061
- title: '点击单选',
3062
- screenshot: 'icon-radio',
3063
- schema: {
3064
- componentName: 'Radio',
3065
- props: {
3066
- title: '点击单选',
3067
- type: 'string',
3068
- props: {
3069
- options: [{
3070
- label: 'A',
3071
- value: 'A'
3072
- }, {
3073
- label: 'B',
3074
- value: 'B'
3075
- }, {
3076
- label: 'C',
3077
- value: 'C'
3078
- }]
3079
- }
3080
- }
3081
- }
3082
- }]
3083
- });
3084
-
3085
- var checkbox = createMeta('Checkbox', {
3086
- title: '是否选择',
3087
- priority: 994,
3088
- props: [{
3089
- title: '基础配置',
3090
- type: 'group',
3091
- display: 'accordion',
3092
- items: getNotInputPropsBasic({
3093
- name: 'defaultValue',
3094
- title: {
3095
- label: '默认值',
3096
- tip: 'defaultValue | 默认值'
3097
- },
3098
- setter: 'BoolSetter'
3099
- })
3100
- }],
3101
- snippets: [{
3102
- title: '是否选择',
3103
- screenshot: 'icon-isNot',
3104
- schema: {
3105
- componentName: 'Checkbox',
3106
- props: {
3107
- title: '是否选择',
3108
- type: 'boolean'
3109
- }
3110
- }
3111
- }]
3112
- });
3113
-
3114
- var checkboxes = createMeta('Checkboxes', {
3115
- title: '点击多选框',
3116
- // priority: 996,
3117
- props: [{
3118
- title: '基础配置',
3119
- type: 'group',
3120
- display: 'accordion',
3121
- items: getNotInputPropsBasic({
3122
- name: 'defaultValue',
3123
- title: {
3124
- label: '默认值',
3125
- tip: 'defaultValue | 默认值'
3126
- },
3127
- setter: 'JsonSetter'
3128
- })
3129
- }, optionsProp, {
3130
- title: '其他配置',
3131
- display: 'accordion',
3132
- type: 'group',
3133
- items: [{
3134
- name: 'props.direction',
3135
- title: {
3136
- label: '排列方向',
3137
- tip: '选项的排列方向'
3138
- },
3139
- defaultValue: 'row',
3140
- setter: {
3141
- componentName: 'RadioGroupSetter',
3142
- props: {
3143
- options: [{
3144
- title: '水平',
3145
- value: 'row'
3146
- }, {
3147
- title: '垂直',
3148
- value: 'column'
3149
- }]
3150
- }
3151
- }
3152
- }]
3153
- }],
3154
- snippets: [{
3155
- title: '点击多选',
3156
- screenshot: 'icon-checkbox',
3157
- schema: {
3158
- componentName: 'Checkboxes',
3159
- props: {
3160
- title: '点击多选',
3161
- type: 'array',
3162
- props: {
3163
- options: [{
3164
- label: 'A',
3165
- value: 'A'
3166
- }, {
3167
- label: 'B',
3168
- value: 'B'
3169
- }, {
3170
- label: 'C',
3171
- value: 'C'
3172
- }],
3173
- direction: 'row'
3174
- }
3175
- }
3176
- }
3177
- }]
3178
- });
3179
-
3180
- var textarea = createMeta('TextArea', {
3181
- title: '多行文本',
3182
- priority: 995,
3183
- props: [{
3184
- title: '基础配置',
3185
- type: 'group',
3186
- display: 'accordion',
3187
- items: inputPropsBasic
3188
- }, {
3189
- title: '其他配置',
3190
- display: 'accordion',
3191
- type: 'group',
3192
- items: [{
3193
- name: 'props.allowClear',
3194
- title: {
3195
- label: '支持清除',
3196
- tip: 'allowClear | 支持清除'
3197
- },
3198
- setter: 'BoolSetter'
3199
- }, {
3200
- name: 'props.showCount',
3201
- title: {
3202
- label: '展示字数',
3203
- tip: 'showCount | 是否展示字数'
3204
- },
3205
- setter: 'BoolSetter'
3206
- }, {
3207
- name: 'props.autoSize',
3208
- title: {
3209
- label: '高度自动',
3210
- tip: 'autoSize | 文本域高度自适应内容'
3211
- },
3212
- setter: 'BoolSetter'
3213
- }, {
3214
- name: 'props.rows',
3215
- title: {
3216
- label: '指定行数',
3217
- tip: 'minRows | 指定显示的行数'
3218
- },
3219
- setter: 'NumberSetter'
3220
- }, {
3221
- name: 'props.minLength',
3222
- title: {
3223
- label: '最小长度',
3224
- tip: 'minLength | 内容最小长度'
3225
- },
3226
- setter: 'NumberSetter'
3227
- }, {
3228
- name: 'props.maxLength',
3229
- title: {
3230
- label: '最大长度',
3231
- tip: 'maxLength | 内容最大长度'
3232
- },
3233
- setter: 'NumberSetter'
3234
- }]
3235
- }],
3236
- snippets: [{
3237
- label: '多行文本',
3238
- screenshot: 'icon-textarea',
3239
- schema: {
3240
- componentName: 'TextArea',
3241
- props: {
3242
- title: '多行文本',
3243
- type: 'string'
3244
- }
3245
- }
3246
- }]
3247
- });
3248
-
3249
- var date = createMeta('DatePicker', {
3250
- title: '日期选择',
3251
- props: [{
3252
- title: '基础配置',
3253
- type: 'group',
3254
- display: 'accordion',
3255
- items: getInputPropsBasic({
3256
- name: 'defaultValue',
3257
- title: {
3258
- label: '默认值',
3259
- tip: 'defaultValue | 默认值'
3260
- },
3261
- setter: 'CustomDateSetter'
3262
- })
3263
- }],
3264
- snippets: [{
3265
- title: '日期选择',
3266
- screenshot: 'icon-date',
3267
- schema: {
3268
- componentName: 'DatePicker',
3269
- props: {
3270
- title: '日期选择',
3271
- type: 'string'
3272
- }
3273
- }
3274
- }]
3275
- });
3276
-
3277
- var dateRange = createMeta('DateRange', {
3278
- title: '日期选择区间',
3279
- props: [{
3280
- title: '基础配置',
3281
- type: 'group',
3282
- display: 'accordion',
3283
- items: getInputPropsBasic({
3284
- name: 'defaultValue',
3285
- title: {
3286
- label: '默认值',
3287
- tip: 'defaultValue | 默认值'
3288
- },
3289
- setter: 'CustomDateRangeSetter'
3290
- }, {
3291
- name: 'props.placeholder',
3292
- title: {
3293
- label: '提示文字',
3294
- tip: 'placeholder | 输入框提示文字'
3295
- },
3296
- setter: 'JsonSetter',
3297
- defaultValue: ['开始时间', '结束时间']
3298
- })
3299
- }],
3300
- snippets: [{
3301
- title: '日期区间选择',
3302
- screenshot: 'icon-date',
3303
- schema: {
3304
- componentName: 'DateRange',
3305
- props: {
3306
- title: '日期区间选择',
3307
- type: 'range',
3308
- format: 'date'
3309
- }
3310
- }
3311
- }]
3312
- });
3313
-
3314
- var time = createMeta('TimePicker', {
3315
- title: '时间选择',
3316
- props: [{
3317
- title: '基础配置',
3318
- type: 'group',
3319
- display: 'accordion',
3320
- items: getInputPropsBasic({
3321
- name: 'defaultValue',
3322
- title: {
3323
- label: '默认值',
3324
- tip: 'default | 默认值'
3325
- },
3326
- setter: 'CustomTimeSetter'
3327
- })
3328
- }],
3329
- snippets: [{
3330
- title: '时间选择',
3331
- screenshot: 'icon-time',
3332
- schema: {
3333
- componentName: 'TimePicker',
3334
- props: {
3335
- title: '时间选择',
3336
- type: 'string',
3337
- format: 'time'
3338
- }
3339
- }
3340
- }]
3341
- });
3342
-
3343
- var timeRange = createMeta('TimeRange', {
3344
- title: '时间区间选择',
3345
- props: [{
3346
- title: '基础配置',
3347
- type: 'group',
3348
- display: 'accordion',
3349
- items: getInputPropsBasic({
3350
- name: 'defaultValue',
3351
- title: {
3352
- label: '默认值',
3353
- tip: 'default | 默认值'
3354
- },
3355
- setter: 'CustomTimeRangeSetter'
3356
- }, {
3357
- name: 'props.placeholder',
3358
- title: {
3359
- label: '提示文字',
3360
- tip: 'placeholder | 输入框提示文字'
3361
- },
3362
- defaultValue: ['开始时间', '结束时间'],
3363
- setter: 'JsonSetter'
3364
- })
3365
- }],
3366
- snippets: [{
3367
- title: '时间区间选择',
3368
- screenshot: 'icon-time',
3369
- schema: {
3370
- componentName: 'TimeRange',
3371
- props: {
3372
- title: '时间区间',
3373
- type: 'range',
3374
- format: 'time'
3375
- }
3376
- }
3377
- }]
3378
- });
3379
-
3380
- var rate = createMeta('Rate', {
3381
- title: '评分',
3382
- priority: 992,
3383
- props: [{
3384
- title: '基础配置',
3385
- type: 'group',
3386
- display: 'accordion',
3387
- items: getNotInputPropsBasic({
3388
- name: 'defaultValue',
3389
- title: {
3390
- label: '默认值',
3391
- tip: 'defaultValue | 默认值'
3392
- },
3393
- setter: 'NumberSetter'
3394
- })
3395
- }, {
3396
- title: '其他配置',
3397
- display: 'accordion',
3398
- type: 'group',
3399
- items: [{
3400
- name: 'props.allowClear',
3401
- title: {
3402
- label: '支持清除',
3403
- tip: '是否允许清除'
3404
- },
3405
- setter: 'BoolSetter',
3406
- defaultValue: true
3407
- }, {
3408
- name: 'props.allowHalf',
3409
- title: {
3410
- label: '支持半选',
3411
- tip: '支持半选'
3412
- },
3413
- setter: 'BoolSetter'
3414
- }, {
3415
- name: 'props.count',
3416
- title: {
3417
- label: '总数',
3418
- tip: 'star 总数'
3419
- },
3420
- setter: 'NumberSetter',
3421
- defaultValue: 5
3422
- }]
3423
- }],
3424
- snippets: [{
3425
- label: '评分',
3426
- screenshot: 'icon-rate',
3427
- schema: {
3428
- componentName: 'Rate',
3429
- props: {
3430
- title: '评分'
3431
- }
3432
- }
3433
- }]
3434
- });
3435
-
3436
- var _switch = createMeta('Switch', {
3437
- title: '开关',
3438
- priority: 993,
3439
- props: [{
3440
- title: '基础配置',
3441
- type: 'group',
3442
- display: 'accordion',
3443
- items: getNotInputPropsBasic({
3444
- name: 'defaultValue',
3445
- title: {
3446
- label: '默认值',
3447
- tip: 'defaultValue | 默认值'
3448
- },
3449
- setter: 'BoolSetter'
3450
- })
3451
- }, {
3452
- title: '其他配置',
3453
- display: 'accordion',
3454
- type: 'group',
3455
- items: [{
3456
- name: 'props.checkedChildren',
3457
- title: {
3458
- label: '选中时内容',
3459
- tip: 'checkedChildren | 选中时内容'
3460
- },
3461
- setter: 'StringSetter'
3462
- }, {
3463
- name: 'props.unCheckedChildren',
3464
- title: {
3465
- label: '非选中时内容',
3466
- tip: 'unCheckedChildren | 非选中时内容'
3467
- },
3468
- setter: 'StringSetter'
3469
- }]
3470
- }],
3471
- snippets: [{
3472
- label: '开关',
3473
- screenshot: 'icon-switch',
3474
- schema: {
3475
- componentName: 'Switch',
3476
- props: {
3477
- title: '开关',
3478
- type: 'boolean'
3479
- }
3480
- }
3481
- }]
3482
- });
3483
-
3484
- var slider = createMeta('Slider', {
3485
- title: '滑动条',
3486
- priority: 991,
3487
- props: [{
3488
- title: '基础配置',
3489
- type: 'group',
3490
- display: 'accordion',
3491
- items: getNotInputPropsBasic({
3492
- name: 'defaultValue',
3493
- title: {
3494
- label: '默认值',
3495
- tip: 'defaultValue | 默认值'
3496
- },
3497
- setter: 'NumberSetter'
3498
- })
3499
- }, {
3500
- title: '其他配置',
3501
- display: 'accordion',
3502
- type: 'group',
3503
- items: [{
3504
- name: 'props.hideInput',
3505
- title: {
3506
- label: '隐藏输入框',
3507
- tip: '隐藏输入框'
3508
- },
3509
- setter: 'BoolSetter'
3510
- }]
3511
- }],
3512
- snippets: [{
3513
- label: '滑动条',
3514
- screenshot: 'icon-slider',
3515
- schema: {
3516
- componentName: 'Slider',
3517
- props: {
3518
- title: '滑动条'
3519
- }
3520
- }
3521
- }]
3522
- });
3523
-
3524
- var color = createMeta('Color', {
3525
- title: '颜色选择',
3526
- category: '其他',
3527
- props: [{
3528
- title: '基础配置',
3529
- type: 'group',
3530
- display: 'accordion',
3531
- items: notInputPropsBasic
3532
- }],
3533
- snippets: [{
3534
- title: '颜色选择',
3535
- screenshot: 'icon-color',
3536
- schema: {
3537
- componentName: 'Color',
3538
- props: {
3539
- title: '颜色选择'
3540
- }
3541
- }
3542
- }]
3543
- });
3544
-
3545
- var imageInput = createMeta('ImageInput', {
3546
- title: '图片 URL',
3547
- category: '其他',
3548
- props: [{
3549
- title: '基础配置',
3550
- type: 'group',
3551
- display: 'accordion',
3552
- items: inputPropsBasic
3553
- }],
3554
- snippets: [{
3555
- title: '图片 URL',
3556
- screenshot: 'icon-image',
3557
- schema: {
3558
- componentName: 'ImageInput',
3559
- props: {
3560
- title: '图片 URL'
3561
- }
3562
- }
3563
- }]
3564
- });
3565
-
3566
- var urlInput = createMeta('UrlInput', {
3567
- title: '链接输入框',
3568
- category: '其他',
3569
- props: [{
3570
- title: '基础配置',
3571
- type: 'group',
3572
- display: 'accordion',
3573
- items: inputPropsBasic
3574
- }, {
3575
- title: '其他配置',
3576
- display: 'accordion',
3577
- type: 'group',
3578
- items: [{
3579
- name: 'props.addonText',
3580
- title: {
3581
- label: '按钮文案',
3582
- tip: '跳转按钮的文案配置'
3583
- },
3584
- defaultValue: '测试链接',
3585
- setter: 'StringSetter'
3586
- }]
3587
- }],
3588
- snippets: [{
3589
- title: '链接输入框',
3590
- screenshot: 'icon-link',
3591
- schema: {
3592
- componentName: 'UrlInput',
3593
- props: {
3594
- title: '链接输入框'
3595
- }
3596
- }
3597
- }]
3598
- });
3599
-
3600
- var treeSelect = createMeta('TreeSelect', {
3601
- title: '树选择',
3602
- category: '其他',
3603
- props: [{
3604
- title: '基础配置',
3605
- type: 'group',
3606
- display: 'accordion',
3607
- items: getInputPropsBasic({
3608
- name: 'defaultValue',
3609
- title: {
3610
- label: '默认值',
3611
- tip: 'defaultValue | 默认值'
3612
- },
3613
- setter: 'JsonSetter'
3614
- })
3615
- }, {
3616
- title: '其他配置',
3617
- display: 'accordion',
3618
- type: 'group',
3619
- items: [{
3620
- name: 'props.treeData',
3621
- title: {
3622
- label: '数据源',
3623
- tip: '数据源'
3624
- },
3625
- setter: 'JsonSetter'
3626
- }, {
3627
- name: 'props.multiple',
3628
- title: {
3629
- label: '支持多选',
3630
- tip: '支持多选(当设置 treeCheckable 时自动变为 true)'
3631
- },
3632
- setter: 'BoolSetter'
3633
- }, {
3634
- name: 'props.allowClear',
3635
- title: {
3636
- label: '支持清除',
3637
- tip: '是否允许清除'
3638
- },
3639
- setter: 'BoolSetter'
3640
- }, {
3641
- name: 'props.treeCheckable',
3642
- title: {
3643
- label: '显示勾选框',
3644
- tip: '显示勾选框'
3645
- },
3646
- setter: 'BoolSetter'
3647
- }, {
3648
- name: 'props.treeDefaultExpandAll',
3649
- title: {
3650
- label: '默认展开所有树节点',
3651
- tip: '默认展开所有树节点'
3652
- },
3653
- setter: 'BoolSetter'
3654
- }]
3655
- }],
3656
- snippets: [{
3657
- label: '树选择',
3658
- screenshot: 'icon-tree',
3659
- schema: {
3660
- componentName: 'TreeSelect',
3661
- props: {
3662
- title: '树选择',
3663
- props: {
3664
- treeData: [{
3665
- value: 'parent 1',
3666
- title: 'parent 1',
3667
- children: [{
3668
- value: 'parent 1-0',
3669
- title: 'parent 1-0',
3670
- children: [{
3671
- value: 'leaf1',
3672
- title: 'leaf1'
3673
- }, {
3674
- value: 'leaf2',
3675
- title: 'leaf2'
3676
- }]
3677
- }]
3678
- }]
3679
- }
3680
- }
3681
- }
3682
- }]
3683
- });
3684
-
3685
- var form = createMeta('FormRender', {
3686
- title: '表单',
3687
- group: '基础组件',
3688
- category: '表单',
3689
- props: [{
3690
- title: '表单布局',
3691
- display: 'accordion',
3692
- type: 'group',
3693
- items: [{
3694
- name: 'displayType',
3695
- title: {
3696
- label: '标签位置',
3697
- tip: 'displayType | 标签的展示位置'
3698
- },
3699
- defaultValue: 'row',
3700
- setter: {
3701
- componentName: 'RadioGroupSetter',
3702
- props: {
3703
- options: [{
3704
- title: '水平居左',
3705
- value: 'row'
3706
- }, {
3707
- title: '垂直居上',
3708
- value: 'column'
3709
- }, {
3710
- title: '紧凑',
3711
- value: 'inline'
3712
- }]
3713
- }
3714
- }
3715
- }, {
3716
- name: 'column',
3717
- title: {
3718
- label: '一行多列',
3719
- tip: 'column | 一行多列'
3720
- },
3721
- defaultValue: 1,
3722
- setter: {
3723
- componentName: 'RadioGroupSetter',
3724
- props: {
3725
- options: [{
3726
- title: '一列',
3727
- value: 1
3728
- }, {
3729
- title: '两列',
3730
- value: 2
3731
- }, {
3732
- title: '三列',
3733
- value: 3
3734
- }, {
3735
- title: '四列',
3736
- value: 4
3737
- }]
3738
- }
3739
- }
3740
- }, {
3741
- name: 'labelWidth',
3742
- title: {
3743
- label: '标签宽度',
3744
- tip: 'labelWidth | 标签宽度'
3745
- },
3746
- setter: 'NumberSetter'
3747
- }]
3748
- }, {
3749
- title: '标签和控件栅格总数不能超过24',
3750
- display: 'block',
3751
- type: 'group',
3752
- items: [{
3753
- name: 'labelCol',
3754
- title: {
3755
- label: '标签栅格数',
3756
- tip: 'labelCol | 栅格占位格数'
3757
- },
3758
- setter: {
3759
- componentName: 'NumberSetter',
3760
- props: {
3761
- min: 0,
3762
- max: 24
3763
- }
3764
- }
3765
- }, {
3766
- name: 'fieldCol',
3767
- title: {
3768
- label: '控件栅格数',
3769
- tip: 'fieldCol | 栅格占位格数'
3770
- },
3771
- setter: {
3772
- componentName: 'NumberSetter',
3773
- props: {
3774
- min: 0,
3775
- max: 24
3776
- }
3777
- }
3778
- }, {
3779
- name: 'maxWidth',
3780
- title: {
3781
- label: '最大宽度',
3782
- tip: 'maxWidth | 最大宽度'
3783
- },
3784
- defaultValue: '340px',
3785
- setter: 'StringSetter'
3786
- }]
3787
- }],
3788
- configure: {
3789
- supports: {
3790
- loop: false,
3791
- condition: false
3792
- },
3793
- component: {
3794
- isContainer: true,
3795
- isModal: false
3796
- }
3797
- }
3798
- });
3799
-
3800
- var props = [{
3801
- name: 'title',
3802
- title: {
3803
- label: '标题',
3804
- tip: 'title | 卡片主题'
3805
- },
3806
- setter: 'StringSetter'
3807
- }, {
3808
- name: 'code',
3809
- title: {
3810
- label: '字段名',
3811
- tip: 'key | 字段名'
3812
- },
3813
- setter: 'StringSetter'
3814
- }, {
3815
- name: 'description',
3816
- title: {
3817
- label: '描述',
3818
- tip: 'description | 卡片的描述'
3819
- },
3820
- setter: 'StringSetter'
3821
- }, {
3822
- name: 'column',
3823
- title: {
3824
- label: '一行多列',
3825
- tip: 'column | 表单内容分成几列展示'
3826
- },
3827
- defaultValue: 1,
3828
- setter: {
3829
- componentName: 'RadioGroupSetter',
3830
- props: {
3831
- options: [{
3832
- title: '一列',
3833
- value: 1
3834
- }, {
3835
- title: '两列',
3836
- value: 2
3837
- }, {
3838
- title: '三列',
3839
- value: 3
3840
- }, {
3841
- title: '四列',
3842
- value: 4
3843
- }]
3844
- }
3845
- }
3846
- }, {
3847
- name: 'widget',
3848
- title: {
3849
- label: '类型',
3850
- tip: 'widget | 类型'
3851
- },
3852
- defaultValue: 1,
3853
- setter: {
3854
- componentName: 'RadioGroupSetter',
3855
- props: {
3856
- options: [{
3857
- title: '卡片',
3858
- value: 'card'
3859
- }, {
3860
- title: '折叠面板',
3861
- value: 'collapse'
3862
- }, {
3863
- title: '标题线',
3864
- value: 'lineTitle'
3865
- }, {
3866
- title: '内联',
3867
- value: 'subInline'
3868
- }]
3869
- }
3870
- }
3871
- }];
3872
- var snippets = [{
3873
- title: '对象',
3874
- screenshot: 'icon-object',
3875
- schema: {
3876
- componentName: 'Card',
3877
- props: {
3878
- title: '卡片主题',
3879
- description: '这是一个对象类型',
3880
- column: 3,
3881
- type: 'object',
3882
- widget: 'collapse'
3883
- }
3884
- }
3885
- }];
3886
- var card = createMeta('Card', {
3887
- title: '对象',
3888
- category: '布局',
3889
- group: '基础组件',
3890
- priority: 1,
3891
- props: props,
3892
- snippets: snippets,
3893
- configure: {
3894
- supports: {
3895
- loop: false,
3896
- condition: false
3897
- },
3898
- component: {
3899
- isContainer: true,
3900
- isModal: false,
3901
- nestingRule: {
3902
- parentWhitelist: ['FormRender', 'Card', 'CardList']
3903
- }
3904
- }
3905
- }
3906
- });
3907
-
3908
- var props$1 = [{
3909
- name: 'title',
3910
- title: {
3911
- label: '标题',
3912
- tip: 'title | 卡片主题'
3913
- },
3914
- setter: 'StringSetter'
3915
- }, {
3916
- name: 'code',
3917
- title: {
3918
- label: '字段名',
3919
- tip: 'key | 字段名'
3920
- },
3921
- setter: 'StringSetter'
3922
- }, {
3923
- name: 'description',
3924
- title: {
3925
- label: '描述',
3926
- tip: 'description | 卡片的描述'
3927
- },
3928
- setter: 'StringSetter'
3929
- }, {
3930
- title: '模版配置',
3931
- display: 'block',
3932
- type: 'group',
3933
- items: [{
3934
- name: 'widget',
3935
- title: {
3936
- label: '类型',
3937
- tip: 'widget | 类型'
3938
- },
3939
- setter: {
3940
- componentName: 'SelectSetter',
3941
- props: {
3942
- options: [{
3943
- title: 'SimpleList',
3944
- value: 'simpleList'
3945
- }, {
3946
- title: 'CardList',
3947
- value: 'cardList'
3948
- }, {
3949
- title: 'DrawerList',
3950
- value: 'drawerList'
3951
- }, {
3952
- title: 'TableList',
3953
- value: 'tableList'
3954
- }, {
3955
- title: 'VirtualList',
3956
- value: 'virtualList'
3957
- }, {
3958
- title: 'TabList',
3959
- value: 'tabList'
3960
- }]
3961
- }
3962
- },
3963
- extraProps: {
3964
- setValue: function setValue(target, value) {
3965
- var node = target.getNode();
3966
- if (value !== 'cardList') {
3967
- node.setPropValue('items.widget', undefined);
3968
- node.setPropValue('items.title', undefined);
3969
- node.setPropValue('items.description', undefined);
3970
- node.setPropValue('items.column', undefined);
3971
- }
3972
- }
3973
- }
3974
- }, {
3975
- name: 'items.widget',
3976
- title: {
3977
- label: '样式类型',
3978
- tip: '样式类型'
3979
- },
3980
- setter: {
3981
- componentName: 'RadioGroupSetter',
3982
- props: {
3983
- options: [{
3984
- title: '卡片',
3985
- value: 'card'
3986
- }, {
3987
- title: '折叠面板',
3988
- value: 'collapse'
3989
- }, {
3990
- title: '标题线',
3991
- value: 'lineTitle'
3992
- }, {
3993
- title: '内联',
3994
- value: 'subInline'
3995
- }]
3996
- }
3997
- },
3998
- condition: function condition(target) {
3999
- return target.getProps().getPropValue('widget') === 'cardList';
4000
- }
4001
- }, {
4002
- name: 'items.title',
4003
- title: {
4004
- label: '标题',
4005
- tip: 'title | 卡片主题'
4006
- },
4007
- setter: 'StringSetter',
4008
- condition: function condition(target) {
4009
- return target.getProps().getPropValue('widget') === 'cardList';
4010
- }
4011
- }, {
4012
- name: 'items.description',
4013
- title: {
4014
- label: '描述',
4015
- tip: 'description | 卡片的描述'
4016
- },
4017
- setter: 'StringSetter',
4018
- condition: function condition(target) {
4019
- return target.getProps().getPropValue('widget') === 'cardList';
4020
- }
4021
- }, {
4022
- name: 'items.column',
4023
- title: {
4024
- label: '一行多列',
4025
- tip: 'column | 表单内容分成几列展示'
4026
- },
4027
- defaultValue: 1,
4028
- setter: {
4029
- componentName: 'RadioGroupSetter',
4030
- props: {
4031
- options: [{
4032
- title: '一列',
4033
- value: 1
4034
- }, {
4035
- title: '两列',
4036
- value: 2
4037
- }, {
4038
- title: '三列',
4039
- value: 3
4040
- }, {
4041
- title: '四列',
4042
- value: 4
4043
- }]
4044
- }
4045
- },
4046
- condition: function condition(target) {
4047
- return target.getProps().getPropValue('widget') === 'cardList';
4048
- },
4049
- extraProps: {
4050
- setValue: function setValue(target, value) {
4051
- var node = target.getNode();
4052
- var labelSpan = 8;
4053
- var wrapperColSpan = 16;
4054
- if (value === 1) {
4055
- labelSpan = 4;
4056
- wrapperColSpan = 6;
4057
- } else if (value === 2) {
4058
- wrapperColSpan = 10;
4059
- }
4060
- node.setPropValue('labelCol.span', labelSpan);
4061
- node.setPropValue('wrapperCol.span', wrapperColSpan);
4062
- node.mergeChildren(function (child) {
4063
- var span = 24 / value;
4064
- child.setPropValue('span', span);
4065
- return false;
4066
- }, function () {}, function () {});
4067
- }
4068
- }
4069
- }]
4070
- }];
4071
- var snippets$1 = [{
4072
- title: '列表',
4073
- screenshot: 'icon-list',
4074
- schema: {
4075
- componentName: 'CardList',
4076
- props: {
4077
- title: '列表',
4078
- description: '这是一个列表',
4079
- type: 'array',
4080
- items: {
4081
- title: '卡片主题',
4082
- description: '这是一个对象类型',
4083
- column: 3,
4084
- type: 'object'
4085
- }
4086
- }
4087
- }
4088
- }];
4089
- var cardList = createMeta('CardList', {
4090
- title: '列表',
4091
- category: '布局',
4092
- group: '基础组件',
4093
- priority: 1,
4094
- props: props$1,
4095
- snippets: snippets$1,
4096
- configure: {
4097
- supports: {
4098
- loop: false,
4099
- condition: false
4100
- },
4101
- component: {
4102
- isContainer: true,
4103
- isModal: false,
4104
- nestingRule: {
4105
- parentWhitelist: ['FormRender', 'Card']
4106
- }
4107
- }
4108
- }
4109
- });
4110
-
4111
- // 常用组件配置
4112
-
4113
- var defaultSetting = /*#__PURE__*/Object.freeze({
4114
- __proto__: null,
4115
- Input: input,
4116
- Number: number,
4117
- Select: select,
4118
- Radio: radio,
4119
- Checkbox: checkbox,
4120
- Checkboxes: checkboxes,
4121
- Textarea: textarea,
4122
- DatePicker: date,
4123
- DateRange: dateRange,
4124
- TimePicker: time,
4125
- TimeRange: timeRange,
4126
- Rate: rate,
4127
- Switch: _switch,
4128
- Slider: slider,
4129
- Color: color,
4130
- ImageInput: imageInput,
4131
- UrlInput: urlInput,
4132
- TreeSelect: treeSelect,
4133
- Form: form,
4134
- card: card,
4135
- CardList: cardList
4136
- });
4137
-
4138
- var _excluded = ["widgets", "settings"];
4139
- if (typeof window !== 'undefined') {
4140
- console.log('设置全局方法 getFormRenderMaterial', window);
4141
- window.getFormRenderMaterial = function () {
4142
- return defaultSetting;
4143
- };
4144
- }
4145
- var Design = function Design(props, ref) {
4146
- var widgets = props.widgets,
4147
- settings = props.settings,
4148
- restProps = _objectWithoutProperties(props, _excluded);
4149
- var containerRef = React.useRef();
4150
- var iframeRef = React.useRef(null);
4151
- React.useImperativeHandle(ref, function () {
4152
- return {
4153
- getValue: function getValue() {
4154
- var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current$co3;
4155
- return (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentWindow) === null || _iframeRef$current$co === void 0 ? void 0 : (_iframeRef$current$co2 = _iframeRef$current$co.__FR_ENGINE__) === null || _iframeRef$current$co2 === void 0 ? void 0 : (_iframeRef$current$co3 = _iframeRef$current$co2.exportSchema) === null || _iframeRef$current$co3 === void 0 ? void 0 : _iframeRef$current$co3.call(_iframeRef$current$co2);
4156
- },
4157
- setValue: function setValue(schema) {
4158
- var _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2, _iframeRef$current2$c3;
4159
- return (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentWindow) === null || _iframeRef$current2$c === void 0 ? void 0 : (_iframeRef$current2$c2 = _iframeRef$current2$c.__FR_ENGINE__) === null || _iframeRef$current2$c2 === void 0 ? void 0 : (_iframeRef$current2$c3 = _iframeRef$current2$c2.importSchema) === null || _iframeRef$current2$c3 === void 0 ? void 0 : _iframeRef$current2$c3.call(_iframeRef$current2$c2, schema);
4160
- }
4161
- };
4162
- });
4163
- React.useEffect(function () {
4164
- initIframe();
4165
- window.addEventListener('message', engineOnLoad);
4166
- return function () {
4167
- window.removeEventListener('message', engineOnLoad);
4168
- };
4169
- }, []);
4170
- var initIframe = function initIframe() {
4171
- var iframe = createIframe();
4172
- iframeRef.current = iframe;
4173
- containerRef.current.appendChild(iframe);
4174
- // 关键修复:将 material 加载函数注入到设计器 iframe 的 window 中
4175
- if (iframe.contentWindow) {
4176
- iframe.contentWindow.getFormRenderMaterial = function () {
4177
- return defaultSetting;
4178
- };
4179
- }
4180
- };
4181
- var engineOnLoad = function engineOnLoad(event) {
4182
- var _iframeRef$current3, _iframeRef$current3$c, _iframeRef$current3$c2;
4183
- if (event.data.type !== 'engine-load') {
4184
- return;
4185
- }
4186
- (_iframeRef$current3 = iframeRef.current) === null || _iframeRef$current3 === void 0 ? void 0 : (_iframeRef$current3$c = _iframeRef$current3.contentWindow) === null || _iframeRef$current3$c === void 0 ? void 0 : (_iframeRef$current3$c2 = _iframeRef$current3$c.__FR_ENGINE__) === null || _iframeRef$current3$c2 === void 0 ? void 0 : _iframeRef$current3$c2.init(_objectSpread2({
4187
- settings: _objectSpread2(_objectSpread2({}, defaultSetting), settings),
4188
- widgets: widgets,
4189
- // recordEnable: true,
4190
- logo: {
4191
- title: 'XRender'
4192
- }
4193
- }, restProps));
4194
- };
4195
- return /*#__PURE__*/React__default['default'].createElement("div", {
4196
- ref: containerRef,
4197
- style: {
4198
- width: '100%',
4199
- height: '100%'
4200
- }
4201
- });
4202
- };
4203
- var Main = /*#__PURE__*/React.forwardRef(Design);
4204
-
4205
- return Main;
4206
-
4207
- })));
4208
- //# sourceMappingURL=index.js.map