@steedos-widgets/amis-object 6.3.6 → 6.3.8
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/amis/AmisSteedosFieldGroup.d.ts +9 -0
- package/dist/amis/AmisSteedosObject.d.ts +8 -0
- package/dist/amis/index.d.ts +3 -0
- package/dist/amis/steedos-fields/index.d.ts +4 -0
- package/dist/amis-object.cjs.css +10 -0
- package/dist/amis-object.cjs.js +3064 -296
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +10 -0
- package/dist/amis-object.esm.js +3047 -309
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +10 -0
- package/dist/amis-object.umd.js +892 -40
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/components/SteedosFieldSet.d.ts +143 -0
- package/dist/components/SteedosObject.d.ts +108 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/meta.js +2580 -424
- package/dist/metas/AmisSteedosFieldGroup.d.ts +2 -0
- package/dist/metas/AmisSteedosObject.d.ts +2 -0
- package/dist/metas/steedos-fields/index.d.ts +2 -0
- package/package.json +3 -3
package/dist/amis-object.esm.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { createContext, useState, useEffect, createElement } from 'react';
|
|
2
2
|
import * as _$1 from 'lodash';
|
|
3
|
-
import _$1__default, { isEmpty, isArray, each, find, endsWith, cloneDeep, forEach, has, toArray, mergeWith, isString, union, map, slice, defaultsDeep as defaultsDeep$1, includes, clone, filter, omitBy, isNil, get as get$1, isObject as isObject$
|
|
3
|
+
import _$1__default, { isEmpty, isArray as isArray$3, each, find, endsWith, cloneDeep, forEach, has, toArray, mergeWith, isString, union, map, slice, defaultsDeep as defaultsDeep$1, includes, clone, filter, omitBy, isNil, get as get$1, isObject as isObject$9, trimEnd, isBoolean, startsWith, isFunction as isFunction$4, compact, difference, keys, pick, first, values, pickBy, sampleSize, random, assign, isDate } from 'lodash';
|
|
4
4
|
import { Dropdown, Image, Tabs, Spin, Badge, Skeleton, Modal as Modal$1, message, notification, Button, Space, Drawer as Drawer$1 } from 'antd';
|
|
5
|
+
import { autobind, resolveEventData, isPureVariable, resolveVariableAndFilter, setThemeClassName, buildStyle, CustomStyle } from 'amis-core';
|
|
6
|
+
import { Collapse as Collapse$1, Icon, DndContainer } from 'amis-ui';
|
|
5
7
|
import ReactDOM, { createRoot } from 'react-dom';
|
|
6
8
|
|
|
7
9
|
/******************************************************************************
|
|
@@ -18,6 +20,22 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
18
20
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
21
|
PERFORMANCE OF THIS SOFTWARE.
|
|
20
22
|
***************************************************************************** */
|
|
23
|
+
/* global Reflect, Promise */
|
|
24
|
+
|
|
25
|
+
var extendStatics = function(d, b) {
|
|
26
|
+
extendStatics = Object.setPrototypeOf ||
|
|
27
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
28
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
29
|
+
return extendStatics(d, b);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function __extends(d, b) {
|
|
33
|
+
if (typeof b !== "function" && b !== null)
|
|
34
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
35
|
+
extendStatics(d, b);
|
|
36
|
+
function __() { this.constructor = d; }
|
|
37
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
38
|
+
}
|
|
21
39
|
|
|
22
40
|
var __assign$2 = function() {
|
|
23
41
|
__assign$2 = Object.assign || function __assign(t) {
|
|
@@ -42,6 +60,13 @@ function __rest(s, e) {
|
|
|
42
60
|
return t;
|
|
43
61
|
}
|
|
44
62
|
|
|
63
|
+
function __decorate(decorators, target, key, desc) {
|
|
64
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
65
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
66
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
67
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
68
|
+
}
|
|
69
|
+
|
|
45
70
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
46
71
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
47
72
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -217,7 +242,7 @@ function _getPrototypeOf(o) {
|
|
|
217
242
|
return _getPrototypeOf(o);
|
|
218
243
|
}
|
|
219
244
|
|
|
220
|
-
function _defineProperty$
|
|
245
|
+
function _defineProperty$2(obj, key, value) {
|
|
221
246
|
key = _toPropertyKey$1(key);
|
|
222
247
|
if (key in obj) {
|
|
223
248
|
Object.defineProperty(obj, key, {
|
|
@@ -264,7 +289,7 @@ function _toArray(arr) {
|
|
|
264
289
|
}
|
|
265
290
|
|
|
266
291
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
267
|
-
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
292
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
268
293
|
var consoleLogger = {
|
|
269
294
|
type: 'logger',
|
|
270
295
|
log: function log(args) {
|
|
@@ -572,7 +597,7 @@ function deepFind(obj, path) {
|
|
|
572
597
|
}
|
|
573
598
|
|
|
574
599
|
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
575
|
-
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
600
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
576
601
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
577
602
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
578
603
|
var ResourceStore = function (_EventEmitter) {
|
|
@@ -743,7 +768,7 @@ var postProcessor = {
|
|
|
743
768
|
};
|
|
744
769
|
|
|
745
770
|
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
746
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
771
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
747
772
|
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
748
773
|
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
749
774
|
var checkedLoadedFor = {};
|
|
@@ -1554,7 +1579,7 @@ var PluralResolver = function () {
|
|
|
1554
1579
|
}();
|
|
1555
1580
|
|
|
1556
1581
|
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1557
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
1582
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1558
1583
|
function deepFindWithDefaults(data, defaultData, key) {
|
|
1559
1584
|
var keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
|
|
1560
1585
|
var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
@@ -1759,7 +1784,7 @@ var Interpolator = function () {
|
|
|
1759
1784
|
}();
|
|
1760
1785
|
|
|
1761
1786
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1762
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
1787
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1763
1788
|
function parseFormatStr(formatStr) {
|
|
1764
1789
|
var formatName = formatStr.toLowerCase().trim();
|
|
1765
1790
|
var formatOptions = {};
|
|
@@ -1897,7 +1922,7 @@ var Formatter = function () {
|
|
|
1897
1922
|
}();
|
|
1898
1923
|
|
|
1899
1924
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1900
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
1925
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1901
1926
|
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1902
1927
|
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1903
1928
|
function removePending(q, name) {
|
|
@@ -2234,7 +2259,7 @@ function transformOptions(options) {
|
|
|
2234
2259
|
}
|
|
2235
2260
|
|
|
2236
2261
|
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2237
|
-
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
2262
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2238
2263
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2239
2264
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2240
2265
|
function noop() {}
|
|
@@ -2744,7 +2769,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2744
2769
|
}]);
|
|
2745
2770
|
return I18n;
|
|
2746
2771
|
}(EventEmitter);
|
|
2747
|
-
_defineProperty$
|
|
2772
|
+
_defineProperty$2(I18n, "createInstance", function () {
|
|
2748
2773
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2749
2774
|
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2750
2775
|
return new I18n(options, callback);
|
|
@@ -2793,7 +2818,7 @@ function _toPropertyKey(arg) {
|
|
|
2793
2818
|
return _typeof(key) === "symbol" ? key : String(key);
|
|
2794
2819
|
}
|
|
2795
2820
|
|
|
2796
|
-
function _defineProperty(obj, key, value) {
|
|
2821
|
+
function _defineProperty$1(obj, key, value) {
|
|
2797
2822
|
key = _toPropertyKey(key);
|
|
2798
2823
|
if (key in obj) {
|
|
2799
2824
|
Object.defineProperty(obj, key, {
|
|
@@ -2844,7 +2869,7 @@ var unescape = function unescape(text) {
|
|
|
2844
2869
|
|
|
2845
2870
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2846
2871
|
|
|
2847
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2872
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2848
2873
|
var defaultOptions = {
|
|
2849
2874
|
bindI18n: 'languageChanged',
|
|
2850
2875
|
bindI18nStore: '',
|
|
@@ -2930,31 +2955,31 @@ var freeGlobal = _freeGlobal;
|
|
|
2930
2955
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
2931
2956
|
|
|
2932
2957
|
/** Used as a reference to the global object. */
|
|
2933
|
-
var root$
|
|
2958
|
+
var root$4 = freeGlobal || freeSelf || Function('return this')();
|
|
2934
2959
|
|
|
2935
|
-
var _root = root$
|
|
2960
|
+
var _root = root$4;
|
|
2936
2961
|
|
|
2937
|
-
var root = _root;
|
|
2962
|
+
var root$3 = _root;
|
|
2938
2963
|
|
|
2939
2964
|
/** Built-in value references. */
|
|
2940
|
-
var Symbol$3 = root.Symbol;
|
|
2965
|
+
var Symbol$3 = root$3.Symbol;
|
|
2941
2966
|
|
|
2942
2967
|
var _Symbol = Symbol$3;
|
|
2943
2968
|
|
|
2944
2969
|
var Symbol$2 = _Symbol;
|
|
2945
2970
|
|
|
2946
2971
|
/** Used for built-in method references. */
|
|
2947
|
-
var objectProto$
|
|
2972
|
+
var objectProto$a = Object.prototype;
|
|
2948
2973
|
|
|
2949
2974
|
/** Used to check objects for own properties. */
|
|
2950
|
-
var hasOwnProperty$
|
|
2975
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
2951
2976
|
|
|
2952
2977
|
/**
|
|
2953
2978
|
* Used to resolve the
|
|
2954
2979
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
2955
2980
|
* of values.
|
|
2956
2981
|
*/
|
|
2957
|
-
var nativeObjectToString$1 = objectProto$
|
|
2982
|
+
var nativeObjectToString$1 = objectProto$a.toString;
|
|
2958
2983
|
|
|
2959
2984
|
/** Built-in value references. */
|
|
2960
2985
|
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
@@ -2967,7 +2992,7 @@ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
|
2967
2992
|
* @returns {string} Returns the raw `toStringTag`.
|
|
2968
2993
|
*/
|
|
2969
2994
|
function getRawTag$1(value) {
|
|
2970
|
-
var isOwn = hasOwnProperty$
|
|
2995
|
+
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
|
2971
2996
|
tag = value[symToStringTag$1];
|
|
2972
2997
|
|
|
2973
2998
|
try {
|
|
@@ -2990,14 +3015,14 @@ var _getRawTag = getRawTag$1;
|
|
|
2990
3015
|
|
|
2991
3016
|
/** Used for built-in method references. */
|
|
2992
3017
|
|
|
2993
|
-
var objectProto$
|
|
3018
|
+
var objectProto$9 = Object.prototype;
|
|
2994
3019
|
|
|
2995
3020
|
/**
|
|
2996
3021
|
* Used to resolve the
|
|
2997
3022
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
2998
3023
|
* of values.
|
|
2999
3024
|
*/
|
|
3000
|
-
var nativeObjectToString = objectProto$
|
|
3025
|
+
var nativeObjectToString = objectProto$9.toString;
|
|
3001
3026
|
|
|
3002
3027
|
/**
|
|
3003
3028
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -3030,7 +3055,7 @@ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
|
3030
3055
|
* @param {*} value The value to query.
|
|
3031
3056
|
* @returns {string} Returns the `toStringTag`.
|
|
3032
3057
|
*/
|
|
3033
|
-
function baseGetTag$
|
|
3058
|
+
function baseGetTag$4(value) {
|
|
3034
3059
|
if (value == null) {
|
|
3035
3060
|
return value === undefined ? undefinedTag : nullTag;
|
|
3036
3061
|
}
|
|
@@ -3039,7 +3064,7 @@ function baseGetTag$1(value) {
|
|
|
3039
3064
|
: objectToString(value);
|
|
3040
3065
|
}
|
|
3041
3066
|
|
|
3042
|
-
var _baseGetTag = baseGetTag$
|
|
3067
|
+
var _baseGetTag = baseGetTag$4;
|
|
3043
3068
|
|
|
3044
3069
|
/**
|
|
3045
3070
|
* Creates a unary function that invokes `func` with its argument transformed.
|
|
@@ -3061,9 +3086,9 @@ var _overArg = overArg$1;
|
|
|
3061
3086
|
var overArg = _overArg;
|
|
3062
3087
|
|
|
3063
3088
|
/** Built-in value references. */
|
|
3064
|
-
var getPrototype$
|
|
3089
|
+
var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
|
|
3065
3090
|
|
|
3066
|
-
var _getPrototype = getPrototype$
|
|
3091
|
+
var _getPrototype = getPrototype$2;
|
|
3067
3092
|
|
|
3068
3093
|
/**
|
|
3069
3094
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
@@ -3090,31 +3115,31 @@ var _getPrototype = getPrototype$1;
|
|
|
3090
3115
|
* // => false
|
|
3091
3116
|
*/
|
|
3092
3117
|
|
|
3093
|
-
function isObjectLike$
|
|
3118
|
+
function isObjectLike$5(value) {
|
|
3094
3119
|
return value != null && typeof value == 'object';
|
|
3095
3120
|
}
|
|
3096
3121
|
|
|
3097
|
-
var isObjectLike_1 = isObjectLike$
|
|
3122
|
+
var isObjectLike_1 = isObjectLike$5;
|
|
3098
3123
|
|
|
3099
|
-
var baseGetTag = _baseGetTag,
|
|
3100
|
-
getPrototype = _getPrototype,
|
|
3101
|
-
isObjectLike = isObjectLike_1;
|
|
3124
|
+
var baseGetTag$3 = _baseGetTag,
|
|
3125
|
+
getPrototype$1 = _getPrototype,
|
|
3126
|
+
isObjectLike$4 = isObjectLike_1;
|
|
3102
3127
|
|
|
3103
3128
|
/** `Object#toString` result references. */
|
|
3104
|
-
var objectTag = '[object Object]';
|
|
3129
|
+
var objectTag$1 = '[object Object]';
|
|
3105
3130
|
|
|
3106
3131
|
/** Used for built-in method references. */
|
|
3107
|
-
var funcProto = Function.prototype,
|
|
3108
|
-
objectProto = Object.prototype;
|
|
3132
|
+
var funcProto$2 = Function.prototype,
|
|
3133
|
+
objectProto$8 = Object.prototype;
|
|
3109
3134
|
|
|
3110
3135
|
/** Used to resolve the decompiled source of functions. */
|
|
3111
|
-
var funcToString = funcProto.toString;
|
|
3136
|
+
var funcToString$2 = funcProto$2.toString;
|
|
3112
3137
|
|
|
3113
3138
|
/** Used to check objects for own properties. */
|
|
3114
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3139
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
3115
3140
|
|
|
3116
3141
|
/** Used to infer the `Object` constructor. */
|
|
3117
|
-
var objectCtorString = funcToString.call(Object);
|
|
3142
|
+
var objectCtorString = funcToString$2.call(Object);
|
|
3118
3143
|
|
|
3119
3144
|
/**
|
|
3120
3145
|
* Checks if `value` is a plain object, that is, an object created by the
|
|
@@ -3144,20 +3169,20 @@ var objectCtorString = funcToString.call(Object);
|
|
|
3144
3169
|
* _.isPlainObject(Object.create(null));
|
|
3145
3170
|
* // => true
|
|
3146
3171
|
*/
|
|
3147
|
-
function isPlainObject(value) {
|
|
3148
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
3172
|
+
function isPlainObject$1(value) {
|
|
3173
|
+
if (!isObjectLike$4(value) || baseGetTag$3(value) != objectTag$1) {
|
|
3149
3174
|
return false;
|
|
3150
3175
|
}
|
|
3151
|
-
var proto = getPrototype(value);
|
|
3176
|
+
var proto = getPrototype$1(value);
|
|
3152
3177
|
if (proto === null) {
|
|
3153
3178
|
return true;
|
|
3154
3179
|
}
|
|
3155
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
3180
|
+
var Ctor = hasOwnProperty$7.call(proto, 'constructor') && proto.constructor;
|
|
3156
3181
|
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
3157
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
3182
|
+
funcToString$2.call(Ctor) == objectCtorString;
|
|
3158
3183
|
}
|
|
3159
3184
|
|
|
3160
|
-
var isPlainObject_1 = isPlainObject;
|
|
3185
|
+
var isPlainObject_1 = isPlainObject$1;
|
|
3161
3186
|
|
|
3162
3187
|
/*
|
|
3163
3188
|
* @Author: baozhoutao@steedos.com
|
|
@@ -3265,7 +3290,7 @@ const getEvn = (router)=>{
|
|
|
3265
3290
|
};
|
|
3266
3291
|
|
|
3267
3292
|
const registerRenders = (assets)=>{
|
|
3268
|
-
if(!isEmpty(assets) && isArray(assets)){
|
|
3293
|
+
if(!isEmpty(assets) && isArray$3(assets)){
|
|
3269
3294
|
let amisLib = amisRequire('amis');
|
|
3270
3295
|
|
|
3271
3296
|
const registerMap = {
|
|
@@ -4367,7 +4392,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4367
4392
|
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
4368
4393
|
|
|
4369
4394
|
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
4370
|
-
"recordId":
|
|
4395
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
4371
4396
|
"data": {
|
|
4372
4397
|
...recordPage.schema.data,
|
|
4373
4398
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
@@ -4377,7 +4402,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4377
4402
|
}) : {
|
|
4378
4403
|
"type": "steedos-record-detail",
|
|
4379
4404
|
"objectApiName": options.objectName,
|
|
4380
|
-
"recordId":
|
|
4405
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
4381
4406
|
"showBackButton": false,
|
|
4382
4407
|
"showButtons": true,
|
|
4383
4408
|
"data": {
|
|
@@ -4473,17 +4498,18 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
4473
4498
|
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
4474
4499
|
// <% });} %>`
|
|
4475
4500
|
"type": "control",
|
|
4501
|
+
"name": "",//control若存在name,内部each组件的source则会获取不到内容
|
|
4476
4502
|
"body": {
|
|
4477
4503
|
type: 'each',
|
|
4478
4504
|
placeholder: "",
|
|
4479
|
-
|
|
4505
|
+
className: steedosField.multiple ? `flex flex-col` : '',
|
|
4480
4506
|
source: `\${_display.${steedosField.name}|asArray}`,
|
|
4481
4507
|
items: {
|
|
4482
4508
|
type: 'static',
|
|
4483
4509
|
labelClassName: "hidden",
|
|
4484
4510
|
label: false,
|
|
4485
4511
|
className: 'm-0',
|
|
4486
|
-
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${
|
|
4512
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
4487
4513
|
// tpl: "<%= item.name >",
|
|
4488
4514
|
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
4489
4515
|
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick$1(steedosField, {
|
|
@@ -5135,6 +5161,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5135
5161
|
_display["${field.name}"].push({
|
|
5136
5162
|
"name": event.data.result.name,
|
|
5137
5163
|
"url": event.data.result.url,
|
|
5164
|
+
"value": event.data.result.value,
|
|
5165
|
+
"_id": event.data.result.value,
|
|
5138
5166
|
"type": event.data.item.type,
|
|
5139
5167
|
"size": event.data.item.size
|
|
5140
5168
|
});
|
|
@@ -5147,6 +5175,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5147
5175
|
_display["${field.name}"] = {
|
|
5148
5176
|
"name": event.data.result.name,
|
|
5149
5177
|
"url": event.data.result.url,
|
|
5178
|
+
"value": event.data.result.value,
|
|
5179
|
+
"_id": event.data.result.value,
|
|
5150
5180
|
"type": event.data.item.type,
|
|
5151
5181
|
"size": event.data.item.size
|
|
5152
5182
|
};
|
|
@@ -5592,7 +5622,7 @@ async function getTableColumns$1(object, fields, options){
|
|
|
5592
5622
|
static: true,
|
|
5593
5623
|
className,
|
|
5594
5624
|
...await getAmisFileReadonlySchema(field)
|
|
5595
|
-
}, fieldAmis
|
|
5625
|
+
}, fieldAmis);
|
|
5596
5626
|
}
|
|
5597
5627
|
else if(field.type === 'select'){
|
|
5598
5628
|
const map = getSelectMap(field.options);
|
|
@@ -6403,7 +6433,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6403
6433
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
6404
6434
|
let itemKeyValue = item[key];
|
|
6405
6435
|
item[key] = value.map(function(item, index){
|
|
6406
|
-
item._id = itemKeyValue[index];
|
|
6436
|
+
item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
6437
|
+
item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
6407
6438
|
return item;
|
|
6408
6439
|
});
|
|
6409
6440
|
}else{
|
|
@@ -6756,6 +6787,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
6756
6787
|
if(fileFields[item].multiple){
|
|
6757
6788
|
if(fileFieldDisplayValue instanceof Array){
|
|
6758
6789
|
data[item] = fileFieldDisplayValue.map((item, index)=>{
|
|
6790
|
+
item.value = fileFieldValue[index];
|
|
6759
6791
|
return {
|
|
6760
6792
|
value: fileFieldValue[index],
|
|
6761
6793
|
name: item.name,
|
|
@@ -6765,6 +6797,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
6765
6797
|
});
|
|
6766
6798
|
}
|
|
6767
6799
|
}else{
|
|
6800
|
+
fileFieldDisplayValue.value = fileFieldValue;
|
|
6768
6801
|
data[item] = [{
|
|
6769
6802
|
value: fileFieldValue,
|
|
6770
6803
|
name: fileFieldDisplayValue.name,
|
|
@@ -7589,7 +7622,7 @@ function createObject(superProps, props, properties) {
|
|
|
7589
7622
|
} }))
|
|
7590
7623
|
: Object.create(Object.prototype, properties);
|
|
7591
7624
|
props &&
|
|
7592
|
-
isObject(props) &&
|
|
7625
|
+
isObject$8(props) &&
|
|
7593
7626
|
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
7594
7627
|
return obj;
|
|
7595
7628
|
}
|
|
@@ -7615,7 +7648,7 @@ function extendObject(target, src, persistOwnProps) {
|
|
|
7615
7648
|
src && Object.keys(src).forEach(function (key) { return (obj[key] = src[key]); });
|
|
7616
7649
|
return obj;
|
|
7617
7650
|
}
|
|
7618
|
-
function isObject(obj) {
|
|
7651
|
+
function isObject$8(obj) {
|
|
7619
7652
|
var typename = typeof obj;
|
|
7620
7653
|
return (obj &&
|
|
7621
7654
|
typename !== 'string' &&
|
|
@@ -7797,7 +7830,7 @@ const defaultsDeep = (...args)=>{
|
|
|
7797
7830
|
let output = {};
|
|
7798
7831
|
toArray(args).reverse().forEach(item=> {
|
|
7799
7832
|
mergeWith(output, item, (objectValue, sourceValue) => {
|
|
7800
|
-
return isArray(sourceValue) ? sourceValue : undefined;
|
|
7833
|
+
return isArray$3(sourceValue) ? sourceValue : undefined;
|
|
7801
7834
|
});
|
|
7802
7835
|
});
|
|
7803
7836
|
return output;
|
|
@@ -13558,7 +13591,7 @@ function getListViewSort(listView) {
|
|
|
13558
13591
|
let sort = '';
|
|
13559
13592
|
if(listView && listView.sort && listView.sort.length){
|
|
13560
13593
|
each(listView.sort,function(item,index){
|
|
13561
|
-
if(isArray(item)){
|
|
13594
|
+
if(isArray$3(item)){
|
|
13562
13595
|
const field_name = item[0];
|
|
13563
13596
|
const order = item[1] || '';
|
|
13564
13597
|
let sortStr = field_name + ' ' + order;
|
|
@@ -13896,7 +13929,7 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13896
13929
|
fields.push(columnField);
|
|
13897
13930
|
}
|
|
13898
13931
|
|
|
13899
|
-
} else if (isObject$
|
|
13932
|
+
} else if (isObject$9(column)) {
|
|
13900
13933
|
if (column.field.indexOf('.') > 0) {
|
|
13901
13934
|
fieldName = column.field.split('.')[0];
|
|
13902
13935
|
displayName = column.field.split('.')[1];
|
|
@@ -21709,7 +21742,7 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
21709
21742
|
getUserId: getUserId,
|
|
21710
21743
|
getViewSchema: getViewSchema,
|
|
21711
21744
|
isExpression: isExpression$1,
|
|
21712
|
-
isObject: isObject,
|
|
21745
|
+
isObject: isObject$8,
|
|
21713
21746
|
lookupToAmis: lookupToAmis,
|
|
21714
21747
|
lookupToAmisIdsPicker: lookupToAmisIdsPicker,
|
|
21715
21748
|
lookupToAmisPicker: lookupToAmisPicker,
|
|
@@ -21736,7 +21769,7 @@ var getSchema = function (field, value, ctx) { return __awaiter(void 0, void 0,
|
|
|
21736
21769
|
switch (_a.label) {
|
|
21737
21770
|
case 0:
|
|
21738
21771
|
refTo = field.reference_to;
|
|
21739
|
-
if (refTo && isFunction(refTo)) {
|
|
21772
|
+
if (refTo && isFunction$4(refTo)) {
|
|
21740
21773
|
refTo = refTo();
|
|
21741
21774
|
}
|
|
21742
21775
|
leftName = "".concat(field.name, "__left");
|
|
@@ -21771,7 +21804,7 @@ var getSchema = function (field, value, ctx) { return __awaiter(void 0, void 0,
|
|
|
21771
21804
|
if (!ctx) {
|
|
21772
21805
|
ctx = {};
|
|
21773
21806
|
}
|
|
21774
|
-
ctx.isRefToMutiple = isArray(refTo);
|
|
21807
|
+
ctx.isRefToMutiple = isArray$3(refTo);
|
|
21775
21808
|
return [4 /*yield*/, lookupToAmisSelect(Object.assign({}, field, { reference_to: value.o }), false, ctx)];
|
|
21776
21809
|
case 4:
|
|
21777
21810
|
rightSchema = _a.sent();
|
|
@@ -21816,6 +21849,9 @@ var AmisObjectFieldLookup = function (props) {
|
|
|
21816
21849
|
// if(!data[field.name] && data.recordId && formItemValue === undefined){
|
|
21817
21850
|
// return ;
|
|
21818
21851
|
// }
|
|
21852
|
+
if (!field) {
|
|
21853
|
+
return;
|
|
21854
|
+
}
|
|
21819
21855
|
var _b = __read(useState(), 2), schema = _b[0], setSchema = _b[1];
|
|
21820
21856
|
if (formItemValue === undefined) {
|
|
21821
21857
|
formItemValue = data[field.name];
|
|
@@ -22154,227 +22190,2759 @@ var SteedosSkeleton = function (props) {
|
|
|
22154
22190
|
}))) : null));
|
|
22155
22191
|
};
|
|
22156
22192
|
|
|
22157
|
-
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
22174
|
-
|
|
22175
|
-
|
|
22176
|
-
|
|
22177
|
-
|
|
22178
|
-
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
}
|
|
22186
|
-
globalData = props.data.global || {};
|
|
22187
|
-
globalData.mode = mode === 'edit' ? 'edit' : 'read';
|
|
22188
|
-
allData = createObject(data, {});
|
|
22189
|
-
if (!(mode === 'edit')) return [3 /*break*/, 2];
|
|
22190
|
-
if (defaultData) {
|
|
22191
|
-
// 让ObjectForm支持props中的dafaultData属性与上层组件配置的defaultData混合
|
|
22192
|
-
// 为了解决相关表新建时如果是表单类型微页面,因为找不到ObjectForm在哪层而造成无法设置ObjectForm的defaultData的问题
|
|
22193
|
-
allData.defaultData = __assign$2({ "&": "${defaultData}" }, defaultData //这里的defaultData是form组件的defaultData属性值
|
|
22194
|
-
);
|
|
22195
|
-
}
|
|
22196
|
-
return [4 /*yield*/, getFormSchema(objectApiName, Object.assign({}, options, {
|
|
22197
|
-
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
22198
|
-
initApiAdaptor: initApiAdaptor,
|
|
22199
|
-
apiRequestAdaptor: apiRequestAdaptor,
|
|
22200
|
-
apiAdaptor: apiAdaptor,
|
|
22201
|
-
enableTabs: enableTabs,
|
|
22202
|
-
tabsMode: tabsMode,
|
|
22203
|
-
submitSuccActions: submitSuccActions,
|
|
22204
|
-
formDataFilter: formDataFilter,
|
|
22205
|
-
onFormDataFilter: onFormDataFilter,
|
|
22206
|
-
amisData: allData,
|
|
22207
|
-
env: env
|
|
22208
|
-
}))];
|
|
22209
|
-
case 1:
|
|
22210
|
-
schema = _f.sent();
|
|
22211
|
-
amisSchema = schema.amisSchema;
|
|
22212
|
-
uiSchema = schema.uiSchema;
|
|
22213
|
-
return [3 /*break*/, 4];
|
|
22214
|
-
case 2:
|
|
22215
|
-
if (props.$$editor) {
|
|
22216
|
-
options.isEditor = true;
|
|
22217
|
-
}
|
|
22218
|
-
return [4 /*yield*/, getViewSchema(objectApiName, recordId, Object.assign({}, options, {
|
|
22219
|
-
enableInitApi: enableInitApi,
|
|
22220
|
-
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
22221
|
-
initApiAdaptor: initApiAdaptor,
|
|
22222
|
-
enableTabs: enableTabs,
|
|
22223
|
-
tabsMode: tabsMode || "vertical",
|
|
22224
|
-
formDataFilter: formDataFilter,
|
|
22225
|
-
onFormDataFilter: onFormDataFilter,
|
|
22226
|
-
amisData: allData,
|
|
22227
|
-
env: env
|
|
22228
|
-
}))];
|
|
22229
|
-
case 3:
|
|
22230
|
-
schema = _f.sent();
|
|
22231
|
-
amisSchema = schema.amisSchema;
|
|
22232
|
-
uiSchema = schema.uiSchema;
|
|
22233
|
-
_f.label = 4;
|
|
22234
|
-
case 4:
|
|
22235
|
-
formData = {};
|
|
22236
|
-
// formData.recordId = recordId || null;
|
|
22237
|
-
// if(objectApiName){
|
|
22238
|
-
// formData.objectName = objectApiName;
|
|
22239
|
-
// }
|
|
22240
|
-
if (has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
22241
|
-
formData.recordId = props.recordId;
|
|
22242
|
-
}
|
|
22243
|
-
amisSchema.className = "steedos-object-form ".concat(className);
|
|
22244
|
-
// console.log('AmisObjectForm amisSchema======>', amisSchema)
|
|
22245
|
-
amisSchema.data = Object.assign({}, amisSchema.data || {}, formData, { global: globalData, uiSchema: uiSchema });
|
|
22246
|
-
if (has(props, 'objectApiName')) {
|
|
22247
|
-
amisSchema.data.objectName = objectApiName;
|
|
22193
|
+
var Collapse = /** @class */ (function (_super) {
|
|
22194
|
+
__extends(Collapse, _super);
|
|
22195
|
+
function Collapse() {
|
|
22196
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
22197
|
+
_this.basicCollapse = React.createRef();
|
|
22198
|
+
return _this;
|
|
22199
|
+
}
|
|
22200
|
+
Collapse.prototype.handleCollapseChange = function (collapsed) {
|
|
22201
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22202
|
+
var _a, dispatchEvent, onCollapse, eventData, changeEvent, toggleEvent;
|
|
22203
|
+
return __generator(this, function (_b) {
|
|
22204
|
+
switch (_b.label) {
|
|
22205
|
+
case 0:
|
|
22206
|
+
_a = this.props, dispatchEvent = _a.dispatchEvent, onCollapse = _a.onCollapse;
|
|
22207
|
+
eventData = resolveEventData(this.props, {
|
|
22208
|
+
collapsed: collapsed
|
|
22209
|
+
});
|
|
22210
|
+
return [4 /*yield*/, dispatchEvent('change', eventData)];
|
|
22211
|
+
case 1:
|
|
22212
|
+
changeEvent = _b.sent();
|
|
22213
|
+
return [4 /*yield*/, dispatchEvent(collapsed ? 'collapse' : 'expand', eventData)];
|
|
22214
|
+
case 2:
|
|
22215
|
+
toggleEvent = _b.sent();
|
|
22216
|
+
if ((changeEvent === null || changeEvent === void 0 ? void 0 : changeEvent.prevented) || (toggleEvent === null || toggleEvent === void 0 ? void 0 : toggleEvent.prevented)) {
|
|
22217
|
+
return [2 /*return*/];
|
|
22218
|
+
}
|
|
22219
|
+
onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(collapsed);
|
|
22220
|
+
return [2 /*return*/];
|
|
22248
22221
|
}
|
|
22249
|
-
|
|
22222
|
+
});
|
|
22223
|
+
});
|
|
22224
|
+
};
|
|
22225
|
+
Collapse.prototype.doAction = function (action, data, throwErrors, args) {
|
|
22226
|
+
var _a, _b, _c, _d;
|
|
22227
|
+
if (this.props.disabled || this.props.collapsable === false) {
|
|
22228
|
+
return;
|
|
22250
22229
|
}
|
|
22251
|
-
|
|
22252
|
-
|
|
22230
|
+
if (['expand', 'collapse'].includes(action.actionType)) {
|
|
22231
|
+
var targetState = action.actionType === 'collapse';
|
|
22232
|
+
/**
|
|
22233
|
+
* 说明:changeCollapsedState 会执行 onCollapse 方法(间接执行handleCollapseChange),
|
|
22234
|
+
* 所以这里不需要再重复调用。
|
|
22235
|
+
*/
|
|
22236
|
+
// this.handleCollapseChange(targetState);
|
|
22237
|
+
var collapseInstance = (_c = (_b = (_a = this.basicCollapse) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getWrappedInstance) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
22238
|
+
(_d = collapseInstance === null || collapseInstance === void 0 ? void 0 : collapseInstance.changeCollapsedState) === null || _d === void 0 ? void 0 : _d.call(collapseInstance, targetState);
|
|
22239
|
+
}
|
|
22240
|
+
};
|
|
22241
|
+
Collapse.prototype.render = function () {
|
|
22242
|
+
var _a = this.props, id = _a.id, ns = _a.classPrefix, cx = _a.classnames, size = _a.size, wrapperComponent = _a.wrapperComponent, headingComponent = _a.headingComponent, className = _a.className, style = _a.style, headingClassName = _a.headingClassName, children = _a.children, titlePosition = _a.titlePosition, headerPosition = _a.headerPosition, title = _a.title, collapseTitle = _a.collapseTitle, collapseHeader = _a.collapseHeader, header = _a.header, body = _a.body, bodyClassName = _a.bodyClassName, render = _a.render, collapsable = _a.collapsable; _a.translate; var mountOnEnter = _a.mountOnEnter, unmountOnExit = _a.unmountOnExit, showArrow = _a.showArrow, expandIcon = _a.expandIcon, disabled = _a.disabled, collapsed = _a.collapsed, propsUpdate = _a.propsUpdate, mobileUI = _a.mobileUI, divideLine = _a.divideLine, enableFieldSetStyle = _a.enableFieldSetStyle;
|
|
22243
|
+
var heading = title || header || '';
|
|
22244
|
+
return (React.createElement(Collapse$1, { id: id, ref: this.basicCollapse, classnames: cx, classPrefix: ns, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnExit, size: size, wrapperComponent: wrapperComponent, headingComponent: headingComponent, className: className, style: style, headingClassName: headingClassName, bodyClassName: bodyClassName, headerPosition: titlePosition || headerPosition, collapsable: collapsable, collapsed: collapsed, showArrow: showArrow, disabled: disabled, propsUpdate: propsUpdate, expandIcon: expandIcon ? (typeof expandIcon.icon === 'object' ? (React.createElement(Icon, { cx: cx, icon: expandIcon.icon, className: cx('Collapse-icon-tranform') })) : (render('arrow-icon', expandIcon || '', {
|
|
22245
|
+
className: cx('Collapse-icon-tranform')
|
|
22246
|
+
}))) : null, collapseHeader: collapseTitle || collapseHeader
|
|
22247
|
+
? render('heading', collapseTitle || collapseHeader)
|
|
22248
|
+
: null, header: heading ? render('heading', heading) : null, body: children
|
|
22249
|
+
? typeof children === 'function'
|
|
22250
|
+
? children(this.props)
|
|
22251
|
+
: children
|
|
22252
|
+
: body
|
|
22253
|
+
? render('body', body)
|
|
22254
|
+
: null, mobileUI: mobileUI, onCollapse: this.handleCollapseChange, divideLine: divideLine, enableFieldSetStyle: enableFieldSetStyle }));
|
|
22255
|
+
};
|
|
22256
|
+
Collapse.propsList = [
|
|
22257
|
+
'collapsable',
|
|
22258
|
+
'collapsed',
|
|
22259
|
+
'collapseTitle',
|
|
22260
|
+
'showArrow',
|
|
22261
|
+
'headerPosition',
|
|
22262
|
+
'bodyClassName',
|
|
22263
|
+
'headingClassName',
|
|
22264
|
+
'collapseHeader',
|
|
22265
|
+
'size'
|
|
22266
|
+
];
|
|
22267
|
+
__decorate([
|
|
22268
|
+
autobind
|
|
22269
|
+
], Collapse.prototype, "handleCollapseChange", null);
|
|
22270
|
+
return Collapse;
|
|
22271
|
+
}(React.Component));
|
|
22272
|
+
var FieldSetControl = /** @class */ (function (_super) {
|
|
22273
|
+
__extends(FieldSetControl, _super);
|
|
22274
|
+
function FieldSetControl(props) {
|
|
22275
|
+
var _this = _super.call(this, props) || this;
|
|
22276
|
+
_this.renderBody = _this.renderBody.bind(_this);
|
|
22277
|
+
return _this;
|
|
22278
|
+
}
|
|
22279
|
+
FieldSetControl.prototype.renderBody = function () {
|
|
22280
|
+
var _a = this.props, body = _a.body; _a.collapsable; var horizontal = _a.horizontal, render = _a.render, mode = _a.mode, formMode = _a.formMode, cx = _a.classnames, store = _a.store, formClassName = _a.formClassName, disabled = _a.disabled, formHorizontal = _a.formHorizontal, subFormMode = _a.subFormMode, subFormHorizontal = _a.subFormHorizontal;
|
|
22281
|
+
var props = {
|
|
22282
|
+
store: store,
|
|
22283
|
+
data: store === null || store === void 0 ? void 0 : store.data,
|
|
22284
|
+
render: render,
|
|
22285
|
+
disabled: disabled,
|
|
22286
|
+
formMode: subFormMode || formMode,
|
|
22287
|
+
formHorizontal: subFormHorizontal || formHorizontal
|
|
22288
|
+
};
|
|
22289
|
+
mode && (props.mode = mode);
|
|
22290
|
+
horizontal && (props.horizontal = horizontal);
|
|
22291
|
+
return (React.createElement("div", { className: cx("Form--".concat(props.mode || formMode || 'normal'), formClassName) }, body ? render('body', body, props) : null));
|
|
22292
|
+
};
|
|
22293
|
+
FieldSetControl.prototype.render = function () {
|
|
22294
|
+
var _a = this.props; _a.controls; var className = _a.className; _a.mode; var body = _a.body, rest = __rest(_a, ["controls", "className", "mode", "body"]);
|
|
22295
|
+
var children = this.renderBody;
|
|
22296
|
+
return (React.createElement(Collapse, __assign$2({}, rest, { body: body, className: className, children: children, wrapperComponent: "SteedosFieldSet", headingComponent: rest.titlePosition === 'bottom' ? 'div' : 'legend' })));
|
|
22297
|
+
};
|
|
22298
|
+
FieldSetControl.defaultProps = {
|
|
22299
|
+
titlePosition: 'top',
|
|
22300
|
+
headingClassName: '',
|
|
22301
|
+
collapsable: false
|
|
22302
|
+
};
|
|
22303
|
+
FieldSetControl.propsList = [
|
|
22304
|
+
'collapsable',
|
|
22305
|
+
'collapsed',
|
|
22306
|
+
'collapseTitle',
|
|
22307
|
+
'titlePosition',
|
|
22308
|
+
'collapseTitle'
|
|
22309
|
+
];
|
|
22310
|
+
return FieldSetControl;
|
|
22311
|
+
}(React.Component));
|
|
22312
|
+
// @Renderer({
|
|
22313
|
+
// type: 'SteedosFieldSet',
|
|
22314
|
+
// weight: -100,
|
|
22315
|
+
// name: 'SteedosFieldSet'
|
|
22316
|
+
// })
|
|
22317
|
+
var SteedosFieldSet = /** @class */ (function (_super) {
|
|
22318
|
+
__extends(SteedosFieldSet, _super);
|
|
22319
|
+
function SteedosFieldSet() {
|
|
22320
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22321
|
+
}
|
|
22322
|
+
return SteedosFieldSet;
|
|
22323
|
+
}(FieldSetControl));
|
|
22253
22324
|
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
|
|
22281
|
-
|
|
22282
|
-
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
|
|
22286
|
-
|
|
22287
|
-
|
|
22288
|
-
|
|
22289
|
-
|
|
22290
|
-
|
|
22291
|
-
|
|
22292
|
-
|
|
22293
|
-
|
|
22294
|
-
|
|
22295
|
-
|
|
22296
|
-
|
|
22297
|
-
|
|
22298
|
-
|
|
22299
|
-
|
|
22300
|
-
|
|
22301
|
-
|
|
22302
|
-
|
|
22303
|
-
|
|
22304
|
-
|
|
22305
|
-
|
|
22306
|
-
|
|
22307
|
-
|
|
22308
|
-
|
|
22309
|
-
|
|
22310
|
-
|
|
22311
|
-
|
|
22312
|
-
|
|
22313
|
-
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
|
|
22317
|
-
|
|
22318
|
-
|
|
22319
|
-
|
|
22320
|
-
|
|
22321
|
-
|
|
22322
|
-
|
|
22323
|
-
|
|
22324
|
-
|
|
22325
|
-
|
|
22326
|
-
|
|
22327
|
-
|
|
22328
|
-
|
|
22329
|
-
|
|
22330
|
-
|
|
22331
|
-
|
|
22332
|
-
|
|
22333
|
-
|
|
22334
|
-
|
|
22335
|
-
|
|
22336
|
-
|
|
22337
|
-
|
|
22338
|
-
|
|
22339
|
-
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
-
|
|
22354
|
-
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22325
|
+
/**
|
|
22326
|
+
* Removes all key-value entries from the list cache.
|
|
22327
|
+
*
|
|
22328
|
+
* @private
|
|
22329
|
+
* @name clear
|
|
22330
|
+
* @memberOf ListCache
|
|
22331
|
+
*/
|
|
22332
|
+
|
|
22333
|
+
function listCacheClear$1() {
|
|
22334
|
+
this.__data__ = [];
|
|
22335
|
+
this.size = 0;
|
|
22336
|
+
}
|
|
22337
|
+
|
|
22338
|
+
var _listCacheClear = listCacheClear$1;
|
|
22339
|
+
|
|
22340
|
+
/**
|
|
22341
|
+
* Performs a
|
|
22342
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
22343
|
+
* comparison between two values to determine if they are equivalent.
|
|
22344
|
+
*
|
|
22345
|
+
* @static
|
|
22346
|
+
* @memberOf _
|
|
22347
|
+
* @since 4.0.0
|
|
22348
|
+
* @category Lang
|
|
22349
|
+
* @param {*} value The value to compare.
|
|
22350
|
+
* @param {*} other The other value to compare.
|
|
22351
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
22352
|
+
* @example
|
|
22353
|
+
*
|
|
22354
|
+
* var object = { 'a': 1 };
|
|
22355
|
+
* var other = { 'a': 1 };
|
|
22356
|
+
*
|
|
22357
|
+
* _.eq(object, object);
|
|
22358
|
+
* // => true
|
|
22359
|
+
*
|
|
22360
|
+
* _.eq(object, other);
|
|
22361
|
+
* // => false
|
|
22362
|
+
*
|
|
22363
|
+
* _.eq('a', 'a');
|
|
22364
|
+
* // => true
|
|
22365
|
+
*
|
|
22366
|
+
* _.eq('a', Object('a'));
|
|
22367
|
+
* // => false
|
|
22368
|
+
*
|
|
22369
|
+
* _.eq(NaN, NaN);
|
|
22370
|
+
* // => true
|
|
22371
|
+
*/
|
|
22372
|
+
|
|
22373
|
+
function eq$4(value, other) {
|
|
22374
|
+
return value === other || (value !== value && other !== other);
|
|
22375
|
+
}
|
|
22376
|
+
|
|
22377
|
+
var eq_1 = eq$4;
|
|
22378
|
+
|
|
22379
|
+
var eq$3 = eq_1;
|
|
22380
|
+
|
|
22381
|
+
/**
|
|
22382
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
22383
|
+
*
|
|
22384
|
+
* @private
|
|
22385
|
+
* @param {Array} array The array to inspect.
|
|
22386
|
+
* @param {*} key The key to search for.
|
|
22387
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
22388
|
+
*/
|
|
22389
|
+
function assocIndexOf$4(array, key) {
|
|
22390
|
+
var length = array.length;
|
|
22391
|
+
while (length--) {
|
|
22392
|
+
if (eq$3(array[length][0], key)) {
|
|
22393
|
+
return length;
|
|
22394
|
+
}
|
|
22395
|
+
}
|
|
22396
|
+
return -1;
|
|
22397
|
+
}
|
|
22398
|
+
|
|
22399
|
+
var _assocIndexOf = assocIndexOf$4;
|
|
22400
|
+
|
|
22401
|
+
var assocIndexOf$3 = _assocIndexOf;
|
|
22402
|
+
|
|
22403
|
+
/** Used for built-in method references. */
|
|
22404
|
+
var arrayProto = Array.prototype;
|
|
22405
|
+
|
|
22406
|
+
/** Built-in value references. */
|
|
22407
|
+
var splice = arrayProto.splice;
|
|
22408
|
+
|
|
22409
|
+
/**
|
|
22410
|
+
* Removes `key` and its value from the list cache.
|
|
22411
|
+
*
|
|
22412
|
+
* @private
|
|
22413
|
+
* @name delete
|
|
22414
|
+
* @memberOf ListCache
|
|
22415
|
+
* @param {string} key The key of the value to remove.
|
|
22416
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
22417
|
+
*/
|
|
22418
|
+
function listCacheDelete$1(key) {
|
|
22419
|
+
var data = this.__data__,
|
|
22420
|
+
index = assocIndexOf$3(data, key);
|
|
22421
|
+
|
|
22422
|
+
if (index < 0) {
|
|
22423
|
+
return false;
|
|
22424
|
+
}
|
|
22425
|
+
var lastIndex = data.length - 1;
|
|
22426
|
+
if (index == lastIndex) {
|
|
22427
|
+
data.pop();
|
|
22428
|
+
} else {
|
|
22429
|
+
splice.call(data, index, 1);
|
|
22430
|
+
}
|
|
22431
|
+
--this.size;
|
|
22432
|
+
return true;
|
|
22433
|
+
}
|
|
22434
|
+
|
|
22435
|
+
var _listCacheDelete = listCacheDelete$1;
|
|
22436
|
+
|
|
22437
|
+
var assocIndexOf$2 = _assocIndexOf;
|
|
22438
|
+
|
|
22439
|
+
/**
|
|
22440
|
+
* Gets the list cache value for `key`.
|
|
22441
|
+
*
|
|
22442
|
+
* @private
|
|
22443
|
+
* @name get
|
|
22444
|
+
* @memberOf ListCache
|
|
22445
|
+
* @param {string} key The key of the value to get.
|
|
22446
|
+
* @returns {*} Returns the entry value.
|
|
22447
|
+
*/
|
|
22448
|
+
function listCacheGet$1(key) {
|
|
22449
|
+
var data = this.__data__,
|
|
22450
|
+
index = assocIndexOf$2(data, key);
|
|
22451
|
+
|
|
22452
|
+
return index < 0 ? undefined : data[index][1];
|
|
22453
|
+
}
|
|
22454
|
+
|
|
22455
|
+
var _listCacheGet = listCacheGet$1;
|
|
22456
|
+
|
|
22457
|
+
var assocIndexOf$1 = _assocIndexOf;
|
|
22458
|
+
|
|
22459
|
+
/**
|
|
22460
|
+
* Checks if a list cache value for `key` exists.
|
|
22461
|
+
*
|
|
22462
|
+
* @private
|
|
22463
|
+
* @name has
|
|
22464
|
+
* @memberOf ListCache
|
|
22465
|
+
* @param {string} key The key of the entry to check.
|
|
22466
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
22467
|
+
*/
|
|
22468
|
+
function listCacheHas$1(key) {
|
|
22469
|
+
return assocIndexOf$1(this.__data__, key) > -1;
|
|
22470
|
+
}
|
|
22471
|
+
|
|
22472
|
+
var _listCacheHas = listCacheHas$1;
|
|
22473
|
+
|
|
22474
|
+
var assocIndexOf = _assocIndexOf;
|
|
22475
|
+
|
|
22476
|
+
/**
|
|
22477
|
+
* Sets the list cache `key` to `value`.
|
|
22478
|
+
*
|
|
22479
|
+
* @private
|
|
22480
|
+
* @name set
|
|
22481
|
+
* @memberOf ListCache
|
|
22482
|
+
* @param {string} key The key of the value to set.
|
|
22483
|
+
* @param {*} value The value to set.
|
|
22484
|
+
* @returns {Object} Returns the list cache instance.
|
|
22485
|
+
*/
|
|
22486
|
+
function listCacheSet$1(key, value) {
|
|
22487
|
+
var data = this.__data__,
|
|
22488
|
+
index = assocIndexOf(data, key);
|
|
22489
|
+
|
|
22490
|
+
if (index < 0) {
|
|
22491
|
+
++this.size;
|
|
22492
|
+
data.push([key, value]);
|
|
22493
|
+
} else {
|
|
22494
|
+
data[index][1] = value;
|
|
22495
|
+
}
|
|
22496
|
+
return this;
|
|
22497
|
+
}
|
|
22498
|
+
|
|
22499
|
+
var _listCacheSet = listCacheSet$1;
|
|
22500
|
+
|
|
22501
|
+
var listCacheClear = _listCacheClear,
|
|
22502
|
+
listCacheDelete = _listCacheDelete,
|
|
22503
|
+
listCacheGet = _listCacheGet,
|
|
22504
|
+
listCacheHas = _listCacheHas,
|
|
22505
|
+
listCacheSet = _listCacheSet;
|
|
22506
|
+
|
|
22507
|
+
/**
|
|
22508
|
+
* Creates an list cache object.
|
|
22509
|
+
*
|
|
22510
|
+
* @private
|
|
22511
|
+
* @constructor
|
|
22512
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
22513
|
+
*/
|
|
22514
|
+
function ListCache$4(entries) {
|
|
22515
|
+
var index = -1,
|
|
22516
|
+
length = entries == null ? 0 : entries.length;
|
|
22517
|
+
|
|
22518
|
+
this.clear();
|
|
22519
|
+
while (++index < length) {
|
|
22520
|
+
var entry = entries[index];
|
|
22521
|
+
this.set(entry[0], entry[1]);
|
|
22522
|
+
}
|
|
22523
|
+
}
|
|
22524
|
+
|
|
22525
|
+
// Add methods to `ListCache`.
|
|
22526
|
+
ListCache$4.prototype.clear = listCacheClear;
|
|
22527
|
+
ListCache$4.prototype['delete'] = listCacheDelete;
|
|
22528
|
+
ListCache$4.prototype.get = listCacheGet;
|
|
22529
|
+
ListCache$4.prototype.has = listCacheHas;
|
|
22530
|
+
ListCache$4.prototype.set = listCacheSet;
|
|
22531
|
+
|
|
22532
|
+
var _ListCache = ListCache$4;
|
|
22533
|
+
|
|
22534
|
+
var ListCache$3 = _ListCache;
|
|
22535
|
+
|
|
22536
|
+
/**
|
|
22537
|
+
* Removes all key-value entries from the stack.
|
|
22538
|
+
*
|
|
22539
|
+
* @private
|
|
22540
|
+
* @name clear
|
|
22541
|
+
* @memberOf Stack
|
|
22542
|
+
*/
|
|
22543
|
+
function stackClear$1() {
|
|
22544
|
+
this.__data__ = new ListCache$3;
|
|
22545
|
+
this.size = 0;
|
|
22546
|
+
}
|
|
22547
|
+
|
|
22548
|
+
var _stackClear = stackClear$1;
|
|
22549
|
+
|
|
22550
|
+
/**
|
|
22551
|
+
* Removes `key` and its value from the stack.
|
|
22552
|
+
*
|
|
22553
|
+
* @private
|
|
22554
|
+
* @name delete
|
|
22555
|
+
* @memberOf Stack
|
|
22556
|
+
* @param {string} key The key of the value to remove.
|
|
22557
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
22558
|
+
*/
|
|
22559
|
+
|
|
22560
|
+
function stackDelete$1(key) {
|
|
22561
|
+
var data = this.__data__,
|
|
22562
|
+
result = data['delete'](key);
|
|
22563
|
+
|
|
22564
|
+
this.size = data.size;
|
|
22565
|
+
return result;
|
|
22566
|
+
}
|
|
22567
|
+
|
|
22568
|
+
var _stackDelete = stackDelete$1;
|
|
22569
|
+
|
|
22570
|
+
/**
|
|
22571
|
+
* Gets the stack value for `key`.
|
|
22572
|
+
*
|
|
22573
|
+
* @private
|
|
22574
|
+
* @name get
|
|
22575
|
+
* @memberOf Stack
|
|
22576
|
+
* @param {string} key The key of the value to get.
|
|
22577
|
+
* @returns {*} Returns the entry value.
|
|
22578
|
+
*/
|
|
22579
|
+
|
|
22580
|
+
function stackGet$1(key) {
|
|
22581
|
+
return this.__data__.get(key);
|
|
22582
|
+
}
|
|
22583
|
+
|
|
22584
|
+
var _stackGet = stackGet$1;
|
|
22585
|
+
|
|
22586
|
+
/**
|
|
22587
|
+
* Checks if a stack value for `key` exists.
|
|
22588
|
+
*
|
|
22589
|
+
* @private
|
|
22590
|
+
* @name has
|
|
22591
|
+
* @memberOf Stack
|
|
22592
|
+
* @param {string} key The key of the entry to check.
|
|
22593
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
22594
|
+
*/
|
|
22595
|
+
|
|
22596
|
+
function stackHas$1(key) {
|
|
22597
|
+
return this.__data__.has(key);
|
|
22598
|
+
}
|
|
22599
|
+
|
|
22600
|
+
var _stackHas = stackHas$1;
|
|
22601
|
+
|
|
22602
|
+
/**
|
|
22603
|
+
* Checks if `value` is the
|
|
22604
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
22605
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
22606
|
+
*
|
|
22607
|
+
* @static
|
|
22608
|
+
* @memberOf _
|
|
22609
|
+
* @since 0.1.0
|
|
22610
|
+
* @category Lang
|
|
22611
|
+
* @param {*} value The value to check.
|
|
22612
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
22613
|
+
* @example
|
|
22614
|
+
*
|
|
22615
|
+
* _.isObject({});
|
|
22616
|
+
* // => true
|
|
22617
|
+
*
|
|
22618
|
+
* _.isObject([1, 2, 3]);
|
|
22619
|
+
* // => true
|
|
22620
|
+
*
|
|
22621
|
+
* _.isObject(_.noop);
|
|
22622
|
+
* // => true
|
|
22623
|
+
*
|
|
22624
|
+
* _.isObject(null);
|
|
22625
|
+
* // => false
|
|
22626
|
+
*/
|
|
22627
|
+
|
|
22628
|
+
function isObject$7(value) {
|
|
22629
|
+
var type = typeof value;
|
|
22630
|
+
return value != null && (type == 'object' || type == 'function');
|
|
22631
|
+
}
|
|
22632
|
+
|
|
22633
|
+
var isObject_1 = isObject$7;
|
|
22634
|
+
|
|
22635
|
+
var baseGetTag$2 = _baseGetTag,
|
|
22636
|
+
isObject$6 = isObject_1;
|
|
22637
|
+
|
|
22638
|
+
/** `Object#toString` result references. */
|
|
22639
|
+
var asyncTag = '[object AsyncFunction]',
|
|
22640
|
+
funcTag$1 = '[object Function]',
|
|
22641
|
+
genTag = '[object GeneratorFunction]',
|
|
22642
|
+
proxyTag = '[object Proxy]';
|
|
22643
|
+
|
|
22644
|
+
/**
|
|
22645
|
+
* Checks if `value` is classified as a `Function` object.
|
|
22646
|
+
*
|
|
22647
|
+
* @static
|
|
22648
|
+
* @memberOf _
|
|
22649
|
+
* @since 0.1.0
|
|
22650
|
+
* @category Lang
|
|
22651
|
+
* @param {*} value The value to check.
|
|
22652
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
22653
|
+
* @example
|
|
22654
|
+
*
|
|
22655
|
+
* _.isFunction(_);
|
|
22656
|
+
* // => true
|
|
22657
|
+
*
|
|
22658
|
+
* _.isFunction(/abc/);
|
|
22659
|
+
* // => false
|
|
22660
|
+
*/
|
|
22661
|
+
function isFunction$3(value) {
|
|
22662
|
+
if (!isObject$6(value)) {
|
|
22663
|
+
return false;
|
|
22664
|
+
}
|
|
22665
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
22666
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
22667
|
+
var tag = baseGetTag$2(value);
|
|
22668
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
22669
|
+
}
|
|
22670
|
+
|
|
22671
|
+
var isFunction_1 = isFunction$3;
|
|
22672
|
+
|
|
22673
|
+
var root$2 = _root;
|
|
22674
|
+
|
|
22675
|
+
/** Used to detect overreaching core-js shims. */
|
|
22676
|
+
var coreJsData$1 = root$2['__core-js_shared__'];
|
|
22677
|
+
|
|
22678
|
+
var _coreJsData = coreJsData$1;
|
|
22679
|
+
|
|
22680
|
+
var coreJsData = _coreJsData;
|
|
22681
|
+
|
|
22682
|
+
/** Used to detect methods masquerading as native. */
|
|
22683
|
+
var maskSrcKey = (function() {
|
|
22684
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
22685
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
22686
|
+
}());
|
|
22687
|
+
|
|
22688
|
+
/**
|
|
22689
|
+
* Checks if `func` has its source masked.
|
|
22690
|
+
*
|
|
22691
|
+
* @private
|
|
22692
|
+
* @param {Function} func The function to check.
|
|
22693
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
22694
|
+
*/
|
|
22695
|
+
function isMasked$1(func) {
|
|
22696
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
22697
|
+
}
|
|
22698
|
+
|
|
22699
|
+
var _isMasked = isMasked$1;
|
|
22700
|
+
|
|
22701
|
+
/** Used for built-in method references. */
|
|
22702
|
+
|
|
22703
|
+
var funcProto$1 = Function.prototype;
|
|
22704
|
+
|
|
22705
|
+
/** Used to resolve the decompiled source of functions. */
|
|
22706
|
+
var funcToString$1 = funcProto$1.toString;
|
|
22707
|
+
|
|
22708
|
+
/**
|
|
22709
|
+
* Converts `func` to its source code.
|
|
22710
|
+
*
|
|
22711
|
+
* @private
|
|
22712
|
+
* @param {Function} func The function to convert.
|
|
22713
|
+
* @returns {string} Returns the source code.
|
|
22714
|
+
*/
|
|
22715
|
+
function toSource$1(func) {
|
|
22716
|
+
if (func != null) {
|
|
22717
|
+
try {
|
|
22718
|
+
return funcToString$1.call(func);
|
|
22719
|
+
} catch (e) {}
|
|
22720
|
+
try {
|
|
22721
|
+
return (func + '');
|
|
22722
|
+
} catch (e) {}
|
|
22723
|
+
}
|
|
22724
|
+
return '';
|
|
22725
|
+
}
|
|
22726
|
+
|
|
22727
|
+
var _toSource = toSource$1;
|
|
22728
|
+
|
|
22729
|
+
var isFunction$2 = isFunction_1,
|
|
22730
|
+
isMasked = _isMasked,
|
|
22731
|
+
isObject$5 = isObject_1,
|
|
22732
|
+
toSource = _toSource;
|
|
22733
|
+
|
|
22734
|
+
/**
|
|
22735
|
+
* Used to match `RegExp`
|
|
22736
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
22737
|
+
*/
|
|
22738
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
22739
|
+
|
|
22740
|
+
/** Used to detect host constructors (Safari). */
|
|
22741
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
22742
|
+
|
|
22743
|
+
/** Used for built-in method references. */
|
|
22744
|
+
var funcProto = Function.prototype,
|
|
22745
|
+
objectProto$7 = Object.prototype;
|
|
22746
|
+
|
|
22747
|
+
/** Used to resolve the decompiled source of functions. */
|
|
22748
|
+
var funcToString = funcProto.toString;
|
|
22749
|
+
|
|
22750
|
+
/** Used to check objects for own properties. */
|
|
22751
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
22752
|
+
|
|
22753
|
+
/** Used to detect if a method is native. */
|
|
22754
|
+
var reIsNative = RegExp('^' +
|
|
22755
|
+
funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&')
|
|
22756
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
22757
|
+
);
|
|
22758
|
+
|
|
22759
|
+
/**
|
|
22760
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
22761
|
+
*
|
|
22762
|
+
* @private
|
|
22763
|
+
* @param {*} value The value to check.
|
|
22764
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
22765
|
+
* else `false`.
|
|
22766
|
+
*/
|
|
22767
|
+
function baseIsNative$1(value) {
|
|
22768
|
+
if (!isObject$5(value) || isMasked(value)) {
|
|
22769
|
+
return false;
|
|
22770
|
+
}
|
|
22771
|
+
var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
|
|
22772
|
+
return pattern.test(toSource(value));
|
|
22773
|
+
}
|
|
22774
|
+
|
|
22775
|
+
var _baseIsNative = baseIsNative$1;
|
|
22776
|
+
|
|
22777
|
+
/**
|
|
22778
|
+
* Gets the value at `key` of `object`.
|
|
22779
|
+
*
|
|
22780
|
+
* @private
|
|
22781
|
+
* @param {Object} [object] The object to query.
|
|
22782
|
+
* @param {string} key The key of the property to get.
|
|
22783
|
+
* @returns {*} Returns the property value.
|
|
22784
|
+
*/
|
|
22785
|
+
|
|
22786
|
+
function getValue$1(object, key) {
|
|
22787
|
+
return object == null ? undefined : object[key];
|
|
22788
|
+
}
|
|
22789
|
+
|
|
22790
|
+
var _getValue = getValue$1;
|
|
22791
|
+
|
|
22792
|
+
var baseIsNative = _baseIsNative,
|
|
22793
|
+
getValue = _getValue;
|
|
22794
|
+
|
|
22795
|
+
/**
|
|
22796
|
+
* Gets the native function at `key` of `object`.
|
|
22797
|
+
*
|
|
22798
|
+
* @private
|
|
22799
|
+
* @param {Object} object The object to query.
|
|
22800
|
+
* @param {string} key The key of the method to get.
|
|
22801
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
22802
|
+
*/
|
|
22803
|
+
function getNative$3(object, key) {
|
|
22804
|
+
var value = getValue(object, key);
|
|
22805
|
+
return baseIsNative(value) ? value : undefined;
|
|
22806
|
+
}
|
|
22807
|
+
|
|
22808
|
+
var _getNative = getNative$3;
|
|
22809
|
+
|
|
22810
|
+
var getNative$2 = _getNative,
|
|
22811
|
+
root$1 = _root;
|
|
22812
|
+
|
|
22813
|
+
/* Built-in method references that are verified to be native. */
|
|
22814
|
+
var Map$2 = getNative$2(root$1, 'Map');
|
|
22815
|
+
|
|
22816
|
+
var _Map = Map$2;
|
|
22817
|
+
|
|
22818
|
+
var getNative$1 = _getNative;
|
|
22819
|
+
|
|
22820
|
+
/* Built-in method references that are verified to be native. */
|
|
22821
|
+
var nativeCreate$4 = getNative$1(Object, 'create');
|
|
22822
|
+
|
|
22823
|
+
var _nativeCreate = nativeCreate$4;
|
|
22824
|
+
|
|
22825
|
+
var nativeCreate$3 = _nativeCreate;
|
|
22826
|
+
|
|
22827
|
+
/**
|
|
22828
|
+
* Removes all key-value entries from the hash.
|
|
22829
|
+
*
|
|
22830
|
+
* @private
|
|
22831
|
+
* @name clear
|
|
22832
|
+
* @memberOf Hash
|
|
22833
|
+
*/
|
|
22834
|
+
function hashClear$1() {
|
|
22835
|
+
this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
|
|
22836
|
+
this.size = 0;
|
|
22837
|
+
}
|
|
22838
|
+
|
|
22839
|
+
var _hashClear = hashClear$1;
|
|
22840
|
+
|
|
22841
|
+
/**
|
|
22842
|
+
* Removes `key` and its value from the hash.
|
|
22843
|
+
*
|
|
22844
|
+
* @private
|
|
22845
|
+
* @name delete
|
|
22846
|
+
* @memberOf Hash
|
|
22847
|
+
* @param {Object} hash The hash to modify.
|
|
22848
|
+
* @param {string} key The key of the value to remove.
|
|
22849
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
22850
|
+
*/
|
|
22851
|
+
|
|
22852
|
+
function hashDelete$1(key) {
|
|
22853
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
22854
|
+
this.size -= result ? 1 : 0;
|
|
22855
|
+
return result;
|
|
22856
|
+
}
|
|
22857
|
+
|
|
22858
|
+
var _hashDelete = hashDelete$1;
|
|
22859
|
+
|
|
22860
|
+
var nativeCreate$2 = _nativeCreate;
|
|
22861
|
+
|
|
22862
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
22863
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
22864
|
+
|
|
22865
|
+
/** Used for built-in method references. */
|
|
22866
|
+
var objectProto$6 = Object.prototype;
|
|
22867
|
+
|
|
22868
|
+
/** Used to check objects for own properties. */
|
|
22869
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
22870
|
+
|
|
22871
|
+
/**
|
|
22872
|
+
* Gets the hash value for `key`.
|
|
22873
|
+
*
|
|
22874
|
+
* @private
|
|
22875
|
+
* @name get
|
|
22876
|
+
* @memberOf Hash
|
|
22877
|
+
* @param {string} key The key of the value to get.
|
|
22878
|
+
* @returns {*} Returns the entry value.
|
|
22879
|
+
*/
|
|
22880
|
+
function hashGet$1(key) {
|
|
22881
|
+
var data = this.__data__;
|
|
22882
|
+
if (nativeCreate$2) {
|
|
22883
|
+
var result = data[key];
|
|
22884
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
22885
|
+
}
|
|
22886
|
+
return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
|
|
22887
|
+
}
|
|
22888
|
+
|
|
22889
|
+
var _hashGet = hashGet$1;
|
|
22890
|
+
|
|
22891
|
+
var nativeCreate$1 = _nativeCreate;
|
|
22892
|
+
|
|
22893
|
+
/** Used for built-in method references. */
|
|
22894
|
+
var objectProto$5 = Object.prototype;
|
|
22895
|
+
|
|
22896
|
+
/** Used to check objects for own properties. */
|
|
22897
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
22898
|
+
|
|
22899
|
+
/**
|
|
22900
|
+
* Checks if a hash value for `key` exists.
|
|
22901
|
+
*
|
|
22902
|
+
* @private
|
|
22903
|
+
* @name has
|
|
22904
|
+
* @memberOf Hash
|
|
22905
|
+
* @param {string} key The key of the entry to check.
|
|
22906
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
22907
|
+
*/
|
|
22908
|
+
function hashHas$1(key) {
|
|
22909
|
+
var data = this.__data__;
|
|
22910
|
+
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
|
|
22911
|
+
}
|
|
22912
|
+
|
|
22913
|
+
var _hashHas = hashHas$1;
|
|
22914
|
+
|
|
22915
|
+
var nativeCreate = _nativeCreate;
|
|
22916
|
+
|
|
22917
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
22918
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
22919
|
+
|
|
22920
|
+
/**
|
|
22921
|
+
* Sets the hash `key` to `value`.
|
|
22922
|
+
*
|
|
22923
|
+
* @private
|
|
22924
|
+
* @name set
|
|
22925
|
+
* @memberOf Hash
|
|
22926
|
+
* @param {string} key The key of the value to set.
|
|
22927
|
+
* @param {*} value The value to set.
|
|
22928
|
+
* @returns {Object} Returns the hash instance.
|
|
22929
|
+
*/
|
|
22930
|
+
function hashSet$1(key, value) {
|
|
22931
|
+
var data = this.__data__;
|
|
22932
|
+
this.size += this.has(key) ? 0 : 1;
|
|
22933
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
22934
|
+
return this;
|
|
22935
|
+
}
|
|
22936
|
+
|
|
22937
|
+
var _hashSet = hashSet$1;
|
|
22938
|
+
|
|
22939
|
+
var hashClear = _hashClear,
|
|
22940
|
+
hashDelete = _hashDelete,
|
|
22941
|
+
hashGet = _hashGet,
|
|
22942
|
+
hashHas = _hashHas,
|
|
22943
|
+
hashSet = _hashSet;
|
|
22944
|
+
|
|
22945
|
+
/**
|
|
22946
|
+
* Creates a hash object.
|
|
22947
|
+
*
|
|
22948
|
+
* @private
|
|
22949
|
+
* @constructor
|
|
22950
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
22951
|
+
*/
|
|
22952
|
+
function Hash$1(entries) {
|
|
22953
|
+
var index = -1,
|
|
22954
|
+
length = entries == null ? 0 : entries.length;
|
|
22955
|
+
|
|
22956
|
+
this.clear();
|
|
22957
|
+
while (++index < length) {
|
|
22958
|
+
var entry = entries[index];
|
|
22959
|
+
this.set(entry[0], entry[1]);
|
|
22960
|
+
}
|
|
22961
|
+
}
|
|
22962
|
+
|
|
22963
|
+
// Add methods to `Hash`.
|
|
22964
|
+
Hash$1.prototype.clear = hashClear;
|
|
22965
|
+
Hash$1.prototype['delete'] = hashDelete;
|
|
22966
|
+
Hash$1.prototype.get = hashGet;
|
|
22967
|
+
Hash$1.prototype.has = hashHas;
|
|
22968
|
+
Hash$1.prototype.set = hashSet;
|
|
22969
|
+
|
|
22970
|
+
var _Hash = Hash$1;
|
|
22971
|
+
|
|
22972
|
+
var Hash = _Hash,
|
|
22973
|
+
ListCache$2 = _ListCache,
|
|
22974
|
+
Map$1 = _Map;
|
|
22975
|
+
|
|
22976
|
+
/**
|
|
22977
|
+
* Removes all key-value entries from the map.
|
|
22978
|
+
*
|
|
22979
|
+
* @private
|
|
22980
|
+
* @name clear
|
|
22981
|
+
* @memberOf MapCache
|
|
22982
|
+
*/
|
|
22983
|
+
function mapCacheClear$1() {
|
|
22984
|
+
this.size = 0;
|
|
22985
|
+
this.__data__ = {
|
|
22986
|
+
'hash': new Hash,
|
|
22987
|
+
'map': new (Map$1 || ListCache$2),
|
|
22988
|
+
'string': new Hash
|
|
22989
|
+
};
|
|
22990
|
+
}
|
|
22991
|
+
|
|
22992
|
+
var _mapCacheClear = mapCacheClear$1;
|
|
22993
|
+
|
|
22994
|
+
/**
|
|
22995
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
22996
|
+
*
|
|
22997
|
+
* @private
|
|
22998
|
+
* @param {*} value The value to check.
|
|
22999
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
23000
|
+
*/
|
|
23001
|
+
|
|
23002
|
+
function isKeyable$1(value) {
|
|
23003
|
+
var type = typeof value;
|
|
23004
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
23005
|
+
? (value !== '__proto__')
|
|
23006
|
+
: (value === null);
|
|
23007
|
+
}
|
|
23008
|
+
|
|
23009
|
+
var _isKeyable = isKeyable$1;
|
|
23010
|
+
|
|
23011
|
+
var isKeyable = _isKeyable;
|
|
23012
|
+
|
|
23013
|
+
/**
|
|
23014
|
+
* Gets the data for `map`.
|
|
23015
|
+
*
|
|
23016
|
+
* @private
|
|
23017
|
+
* @param {Object} map The map to query.
|
|
23018
|
+
* @param {string} key The reference key.
|
|
23019
|
+
* @returns {*} Returns the map data.
|
|
23020
|
+
*/
|
|
23021
|
+
function getMapData$4(map, key) {
|
|
23022
|
+
var data = map.__data__;
|
|
23023
|
+
return isKeyable(key)
|
|
23024
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
23025
|
+
: data.map;
|
|
23026
|
+
}
|
|
23027
|
+
|
|
23028
|
+
var _getMapData = getMapData$4;
|
|
23029
|
+
|
|
23030
|
+
var getMapData$3 = _getMapData;
|
|
23031
|
+
|
|
23032
|
+
/**
|
|
23033
|
+
* Removes `key` and its value from the map.
|
|
23034
|
+
*
|
|
23035
|
+
* @private
|
|
23036
|
+
* @name delete
|
|
23037
|
+
* @memberOf MapCache
|
|
23038
|
+
* @param {string} key The key of the value to remove.
|
|
23039
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
23040
|
+
*/
|
|
23041
|
+
function mapCacheDelete$1(key) {
|
|
23042
|
+
var result = getMapData$3(this, key)['delete'](key);
|
|
23043
|
+
this.size -= result ? 1 : 0;
|
|
23044
|
+
return result;
|
|
23045
|
+
}
|
|
23046
|
+
|
|
23047
|
+
var _mapCacheDelete = mapCacheDelete$1;
|
|
23048
|
+
|
|
23049
|
+
var getMapData$2 = _getMapData;
|
|
23050
|
+
|
|
23051
|
+
/**
|
|
23052
|
+
* Gets the map value for `key`.
|
|
23053
|
+
*
|
|
23054
|
+
* @private
|
|
23055
|
+
* @name get
|
|
23056
|
+
* @memberOf MapCache
|
|
23057
|
+
* @param {string} key The key of the value to get.
|
|
23058
|
+
* @returns {*} Returns the entry value.
|
|
23059
|
+
*/
|
|
23060
|
+
function mapCacheGet$1(key) {
|
|
23061
|
+
return getMapData$2(this, key).get(key);
|
|
23062
|
+
}
|
|
23063
|
+
|
|
23064
|
+
var _mapCacheGet = mapCacheGet$1;
|
|
23065
|
+
|
|
23066
|
+
var getMapData$1 = _getMapData;
|
|
23067
|
+
|
|
23068
|
+
/**
|
|
23069
|
+
* Checks if a map value for `key` exists.
|
|
23070
|
+
*
|
|
23071
|
+
* @private
|
|
23072
|
+
* @name has
|
|
23073
|
+
* @memberOf MapCache
|
|
23074
|
+
* @param {string} key The key of the entry to check.
|
|
23075
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
23076
|
+
*/
|
|
23077
|
+
function mapCacheHas$1(key) {
|
|
23078
|
+
return getMapData$1(this, key).has(key);
|
|
23079
|
+
}
|
|
23080
|
+
|
|
23081
|
+
var _mapCacheHas = mapCacheHas$1;
|
|
23082
|
+
|
|
23083
|
+
var getMapData = _getMapData;
|
|
23084
|
+
|
|
23085
|
+
/**
|
|
23086
|
+
* Sets the map `key` to `value`.
|
|
23087
|
+
*
|
|
23088
|
+
* @private
|
|
23089
|
+
* @name set
|
|
23090
|
+
* @memberOf MapCache
|
|
23091
|
+
* @param {string} key The key of the value to set.
|
|
23092
|
+
* @param {*} value The value to set.
|
|
23093
|
+
* @returns {Object} Returns the map cache instance.
|
|
23094
|
+
*/
|
|
23095
|
+
function mapCacheSet$1(key, value) {
|
|
23096
|
+
var data = getMapData(this, key),
|
|
23097
|
+
size = data.size;
|
|
23098
|
+
|
|
23099
|
+
data.set(key, value);
|
|
23100
|
+
this.size += data.size == size ? 0 : 1;
|
|
23101
|
+
return this;
|
|
23102
|
+
}
|
|
23103
|
+
|
|
23104
|
+
var _mapCacheSet = mapCacheSet$1;
|
|
23105
|
+
|
|
23106
|
+
var mapCacheClear = _mapCacheClear,
|
|
23107
|
+
mapCacheDelete = _mapCacheDelete,
|
|
23108
|
+
mapCacheGet = _mapCacheGet,
|
|
23109
|
+
mapCacheHas = _mapCacheHas,
|
|
23110
|
+
mapCacheSet = _mapCacheSet;
|
|
23111
|
+
|
|
23112
|
+
/**
|
|
23113
|
+
* Creates a map cache object to store key-value pairs.
|
|
23114
|
+
*
|
|
23115
|
+
* @private
|
|
23116
|
+
* @constructor
|
|
23117
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
23118
|
+
*/
|
|
23119
|
+
function MapCache$1(entries) {
|
|
23120
|
+
var index = -1,
|
|
23121
|
+
length = entries == null ? 0 : entries.length;
|
|
23122
|
+
|
|
23123
|
+
this.clear();
|
|
23124
|
+
while (++index < length) {
|
|
23125
|
+
var entry = entries[index];
|
|
23126
|
+
this.set(entry[0], entry[1]);
|
|
23127
|
+
}
|
|
23128
|
+
}
|
|
23129
|
+
|
|
23130
|
+
// Add methods to `MapCache`.
|
|
23131
|
+
MapCache$1.prototype.clear = mapCacheClear;
|
|
23132
|
+
MapCache$1.prototype['delete'] = mapCacheDelete;
|
|
23133
|
+
MapCache$1.prototype.get = mapCacheGet;
|
|
23134
|
+
MapCache$1.prototype.has = mapCacheHas;
|
|
23135
|
+
MapCache$1.prototype.set = mapCacheSet;
|
|
23136
|
+
|
|
23137
|
+
var _MapCache = MapCache$1;
|
|
23138
|
+
|
|
23139
|
+
var ListCache$1 = _ListCache,
|
|
23140
|
+
Map = _Map,
|
|
23141
|
+
MapCache = _MapCache;
|
|
23142
|
+
|
|
23143
|
+
/** Used as the size to enable large array optimizations. */
|
|
23144
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
23145
|
+
|
|
23146
|
+
/**
|
|
23147
|
+
* Sets the stack `key` to `value`.
|
|
23148
|
+
*
|
|
23149
|
+
* @private
|
|
23150
|
+
* @name set
|
|
23151
|
+
* @memberOf Stack
|
|
23152
|
+
* @param {string} key The key of the value to set.
|
|
23153
|
+
* @param {*} value The value to set.
|
|
23154
|
+
* @returns {Object} Returns the stack cache instance.
|
|
23155
|
+
*/
|
|
23156
|
+
function stackSet$1(key, value) {
|
|
23157
|
+
var data = this.__data__;
|
|
23158
|
+
if (data instanceof ListCache$1) {
|
|
23159
|
+
var pairs = data.__data__;
|
|
23160
|
+
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
23161
|
+
pairs.push([key, value]);
|
|
23162
|
+
this.size = ++data.size;
|
|
23163
|
+
return this;
|
|
23164
|
+
}
|
|
23165
|
+
data = this.__data__ = new MapCache(pairs);
|
|
23166
|
+
}
|
|
23167
|
+
data.set(key, value);
|
|
23168
|
+
this.size = data.size;
|
|
23169
|
+
return this;
|
|
23170
|
+
}
|
|
23171
|
+
|
|
23172
|
+
var _stackSet = stackSet$1;
|
|
23173
|
+
|
|
23174
|
+
var ListCache = _ListCache,
|
|
23175
|
+
stackClear = _stackClear,
|
|
23176
|
+
stackDelete = _stackDelete,
|
|
23177
|
+
stackGet = _stackGet,
|
|
23178
|
+
stackHas = _stackHas,
|
|
23179
|
+
stackSet = _stackSet;
|
|
23180
|
+
|
|
23181
|
+
/**
|
|
23182
|
+
* Creates a stack cache object to store key-value pairs.
|
|
23183
|
+
*
|
|
23184
|
+
* @private
|
|
23185
|
+
* @constructor
|
|
23186
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
23187
|
+
*/
|
|
23188
|
+
function Stack$1(entries) {
|
|
23189
|
+
var data = this.__data__ = new ListCache(entries);
|
|
23190
|
+
this.size = data.size;
|
|
23191
|
+
}
|
|
23192
|
+
|
|
23193
|
+
// Add methods to `Stack`.
|
|
23194
|
+
Stack$1.prototype.clear = stackClear;
|
|
23195
|
+
Stack$1.prototype['delete'] = stackDelete;
|
|
23196
|
+
Stack$1.prototype.get = stackGet;
|
|
23197
|
+
Stack$1.prototype.has = stackHas;
|
|
23198
|
+
Stack$1.prototype.set = stackSet;
|
|
23199
|
+
|
|
23200
|
+
var _Stack = Stack$1;
|
|
23201
|
+
|
|
23202
|
+
var getNative = _getNative;
|
|
23203
|
+
|
|
23204
|
+
var defineProperty$2 = (function() {
|
|
23205
|
+
try {
|
|
23206
|
+
var func = getNative(Object, 'defineProperty');
|
|
23207
|
+
func({}, '', {});
|
|
23208
|
+
return func;
|
|
23209
|
+
} catch (e) {}
|
|
23210
|
+
}());
|
|
23211
|
+
|
|
23212
|
+
var _defineProperty = defineProperty$2;
|
|
23213
|
+
|
|
23214
|
+
var defineProperty$1 = _defineProperty;
|
|
23215
|
+
|
|
23216
|
+
/**
|
|
23217
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
23218
|
+
* value checks.
|
|
23219
|
+
*
|
|
23220
|
+
* @private
|
|
23221
|
+
* @param {Object} object The object to modify.
|
|
23222
|
+
* @param {string} key The key of the property to assign.
|
|
23223
|
+
* @param {*} value The value to assign.
|
|
23224
|
+
*/
|
|
23225
|
+
function baseAssignValue$3(object, key, value) {
|
|
23226
|
+
if (key == '__proto__' && defineProperty$1) {
|
|
23227
|
+
defineProperty$1(object, key, {
|
|
23228
|
+
'configurable': true,
|
|
23229
|
+
'enumerable': true,
|
|
23230
|
+
'value': value,
|
|
23231
|
+
'writable': true
|
|
23232
|
+
});
|
|
23233
|
+
} else {
|
|
23234
|
+
object[key] = value;
|
|
23235
|
+
}
|
|
23236
|
+
}
|
|
23237
|
+
|
|
23238
|
+
var _baseAssignValue = baseAssignValue$3;
|
|
23239
|
+
|
|
23240
|
+
var baseAssignValue$2 = _baseAssignValue,
|
|
23241
|
+
eq$2 = eq_1;
|
|
23242
|
+
|
|
23243
|
+
/**
|
|
23244
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
23245
|
+
* `undefined` values.
|
|
23246
|
+
*
|
|
23247
|
+
* @private
|
|
23248
|
+
* @param {Object} object The object to modify.
|
|
23249
|
+
* @param {string} key The key of the property to assign.
|
|
23250
|
+
* @param {*} value The value to assign.
|
|
23251
|
+
*/
|
|
23252
|
+
function assignMergeValue$2(object, key, value) {
|
|
23253
|
+
if ((value !== undefined && !eq$2(object[key], value)) ||
|
|
23254
|
+
(value === undefined && !(key in object))) {
|
|
23255
|
+
baseAssignValue$2(object, key, value);
|
|
23256
|
+
}
|
|
23257
|
+
}
|
|
23258
|
+
|
|
23259
|
+
var _assignMergeValue = assignMergeValue$2;
|
|
23260
|
+
|
|
23261
|
+
/**
|
|
23262
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
23263
|
+
*
|
|
23264
|
+
* @private
|
|
23265
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
23266
|
+
* @returns {Function} Returns the new base function.
|
|
23267
|
+
*/
|
|
23268
|
+
|
|
23269
|
+
function createBaseFor$1(fromRight) {
|
|
23270
|
+
return function(object, iteratee, keysFunc) {
|
|
23271
|
+
var index = -1,
|
|
23272
|
+
iterable = Object(object),
|
|
23273
|
+
props = keysFunc(object),
|
|
23274
|
+
length = props.length;
|
|
23275
|
+
|
|
23276
|
+
while (length--) {
|
|
23277
|
+
var key = props[fromRight ? length : ++index];
|
|
23278
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
23279
|
+
break;
|
|
23280
|
+
}
|
|
23281
|
+
}
|
|
23282
|
+
return object;
|
|
23283
|
+
};
|
|
23284
|
+
}
|
|
23285
|
+
|
|
23286
|
+
var _createBaseFor = createBaseFor$1;
|
|
23287
|
+
|
|
23288
|
+
var createBaseFor = _createBaseFor;
|
|
23289
|
+
|
|
23290
|
+
/**
|
|
23291
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
23292
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
23293
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
23294
|
+
*
|
|
23295
|
+
* @private
|
|
23296
|
+
* @param {Object} object The object to iterate over.
|
|
23297
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
23298
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
23299
|
+
* @returns {Object} Returns `object`.
|
|
23300
|
+
*/
|
|
23301
|
+
var baseFor$1 = createBaseFor();
|
|
23302
|
+
|
|
23303
|
+
var _baseFor = baseFor$1;
|
|
23304
|
+
|
|
23305
|
+
var _cloneBuffer = {exports: {}};
|
|
23306
|
+
|
|
23307
|
+
(function (module, exports) {
|
|
23308
|
+
var root = _root;
|
|
23309
|
+
|
|
23310
|
+
/** Detect free variable `exports`. */
|
|
23311
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
23312
|
+
|
|
23313
|
+
/** Detect free variable `module`. */
|
|
23314
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
23315
|
+
|
|
23316
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
23317
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
23318
|
+
|
|
23319
|
+
/** Built-in value references. */
|
|
23320
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
23321
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
23322
|
+
|
|
23323
|
+
/**
|
|
23324
|
+
* Creates a clone of `buffer`.
|
|
23325
|
+
*
|
|
23326
|
+
* @private
|
|
23327
|
+
* @param {Buffer} buffer The buffer to clone.
|
|
23328
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
23329
|
+
* @returns {Buffer} Returns the cloned buffer.
|
|
23330
|
+
*/
|
|
23331
|
+
function cloneBuffer(buffer, isDeep) {
|
|
23332
|
+
if (isDeep) {
|
|
23333
|
+
return buffer.slice();
|
|
23334
|
+
}
|
|
23335
|
+
var length = buffer.length,
|
|
23336
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
23337
|
+
|
|
23338
|
+
buffer.copy(result);
|
|
23339
|
+
return result;
|
|
23340
|
+
}
|
|
23341
|
+
|
|
23342
|
+
module.exports = cloneBuffer;
|
|
23343
|
+
} (_cloneBuffer, _cloneBuffer.exports));
|
|
23344
|
+
|
|
23345
|
+
var root = _root;
|
|
23346
|
+
|
|
23347
|
+
/** Built-in value references. */
|
|
23348
|
+
var Uint8Array$2 = root.Uint8Array;
|
|
23349
|
+
|
|
23350
|
+
var _Uint8Array = Uint8Array$2;
|
|
23351
|
+
|
|
23352
|
+
var Uint8Array$1 = _Uint8Array;
|
|
23353
|
+
|
|
23354
|
+
/**
|
|
23355
|
+
* Creates a clone of `arrayBuffer`.
|
|
23356
|
+
*
|
|
23357
|
+
* @private
|
|
23358
|
+
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
|
23359
|
+
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
|
23360
|
+
*/
|
|
23361
|
+
function cloneArrayBuffer$1(arrayBuffer) {
|
|
23362
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
23363
|
+
new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
|
|
23364
|
+
return result;
|
|
23365
|
+
}
|
|
23366
|
+
|
|
23367
|
+
var _cloneArrayBuffer = cloneArrayBuffer$1;
|
|
23368
|
+
|
|
23369
|
+
var cloneArrayBuffer = _cloneArrayBuffer;
|
|
23370
|
+
|
|
23371
|
+
/**
|
|
23372
|
+
* Creates a clone of `typedArray`.
|
|
23373
|
+
*
|
|
23374
|
+
* @private
|
|
23375
|
+
* @param {Object} typedArray The typed array to clone.
|
|
23376
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
23377
|
+
* @returns {Object} Returns the cloned typed array.
|
|
23378
|
+
*/
|
|
23379
|
+
function cloneTypedArray$1(typedArray, isDeep) {
|
|
23380
|
+
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
23381
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
23382
|
+
}
|
|
23383
|
+
|
|
23384
|
+
var _cloneTypedArray = cloneTypedArray$1;
|
|
23385
|
+
|
|
23386
|
+
/**
|
|
23387
|
+
* Copies the values of `source` to `array`.
|
|
23388
|
+
*
|
|
23389
|
+
* @private
|
|
23390
|
+
* @param {Array} source The array to copy values from.
|
|
23391
|
+
* @param {Array} [array=[]] The array to copy values to.
|
|
23392
|
+
* @returns {Array} Returns `array`.
|
|
23393
|
+
*/
|
|
23394
|
+
|
|
23395
|
+
function copyArray$1(source, array) {
|
|
23396
|
+
var index = -1,
|
|
23397
|
+
length = source.length;
|
|
23398
|
+
|
|
23399
|
+
array || (array = Array(length));
|
|
23400
|
+
while (++index < length) {
|
|
23401
|
+
array[index] = source[index];
|
|
23402
|
+
}
|
|
23403
|
+
return array;
|
|
23404
|
+
}
|
|
23405
|
+
|
|
23406
|
+
var _copyArray = copyArray$1;
|
|
23407
|
+
|
|
23408
|
+
var isObject$4 = isObject_1;
|
|
23409
|
+
|
|
23410
|
+
/** Built-in value references. */
|
|
23411
|
+
var objectCreate = Object.create;
|
|
23412
|
+
|
|
23413
|
+
/**
|
|
23414
|
+
* The base implementation of `_.create` without support for assigning
|
|
23415
|
+
* properties to the created object.
|
|
23416
|
+
*
|
|
23417
|
+
* @private
|
|
23418
|
+
* @param {Object} proto The object to inherit from.
|
|
23419
|
+
* @returns {Object} Returns the new object.
|
|
23420
|
+
*/
|
|
23421
|
+
var baseCreate$1 = (function() {
|
|
23422
|
+
function object() {}
|
|
23423
|
+
return function(proto) {
|
|
23424
|
+
if (!isObject$4(proto)) {
|
|
23425
|
+
return {};
|
|
23426
|
+
}
|
|
23427
|
+
if (objectCreate) {
|
|
23428
|
+
return objectCreate(proto);
|
|
23429
|
+
}
|
|
23430
|
+
object.prototype = proto;
|
|
23431
|
+
var result = new object;
|
|
23432
|
+
object.prototype = undefined;
|
|
23433
|
+
return result;
|
|
23434
|
+
};
|
|
23435
|
+
}());
|
|
23436
|
+
|
|
23437
|
+
var _baseCreate = baseCreate$1;
|
|
23438
|
+
|
|
23439
|
+
/** Used for built-in method references. */
|
|
23440
|
+
|
|
23441
|
+
var objectProto$4 = Object.prototype;
|
|
23442
|
+
|
|
23443
|
+
/**
|
|
23444
|
+
* Checks if `value` is likely a prototype object.
|
|
23445
|
+
*
|
|
23446
|
+
* @private
|
|
23447
|
+
* @param {*} value The value to check.
|
|
23448
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
23449
|
+
*/
|
|
23450
|
+
function isPrototype$2(value) {
|
|
23451
|
+
var Ctor = value && value.constructor,
|
|
23452
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
|
|
23453
|
+
|
|
23454
|
+
return value === proto;
|
|
23455
|
+
}
|
|
23456
|
+
|
|
23457
|
+
var _isPrototype = isPrototype$2;
|
|
23458
|
+
|
|
23459
|
+
var baseCreate = _baseCreate,
|
|
23460
|
+
getPrototype = _getPrototype,
|
|
23461
|
+
isPrototype$1 = _isPrototype;
|
|
23462
|
+
|
|
23463
|
+
/**
|
|
23464
|
+
* Initializes an object clone.
|
|
23465
|
+
*
|
|
23466
|
+
* @private
|
|
23467
|
+
* @param {Object} object The object to clone.
|
|
23468
|
+
* @returns {Object} Returns the initialized clone.
|
|
23469
|
+
*/
|
|
23470
|
+
function initCloneObject$1(object) {
|
|
23471
|
+
return (typeof object.constructor == 'function' && !isPrototype$1(object))
|
|
23472
|
+
? baseCreate(getPrototype(object))
|
|
23473
|
+
: {};
|
|
23474
|
+
}
|
|
23475
|
+
|
|
23476
|
+
var _initCloneObject = initCloneObject$1;
|
|
23477
|
+
|
|
23478
|
+
var baseGetTag$1 = _baseGetTag,
|
|
23479
|
+
isObjectLike$3 = isObjectLike_1;
|
|
23480
|
+
|
|
23481
|
+
/** `Object#toString` result references. */
|
|
23482
|
+
var argsTag$1 = '[object Arguments]';
|
|
23483
|
+
|
|
23484
|
+
/**
|
|
23485
|
+
* The base implementation of `_.isArguments`.
|
|
23486
|
+
*
|
|
23487
|
+
* @private
|
|
23488
|
+
* @param {*} value The value to check.
|
|
23489
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
23490
|
+
*/
|
|
23491
|
+
function baseIsArguments$1(value) {
|
|
23492
|
+
return isObjectLike$3(value) && baseGetTag$1(value) == argsTag$1;
|
|
23493
|
+
}
|
|
23494
|
+
|
|
23495
|
+
var _baseIsArguments = baseIsArguments$1;
|
|
23496
|
+
|
|
23497
|
+
var baseIsArguments = _baseIsArguments,
|
|
23498
|
+
isObjectLike$2 = isObjectLike_1;
|
|
23499
|
+
|
|
23500
|
+
/** Used for built-in method references. */
|
|
23501
|
+
var objectProto$3 = Object.prototype;
|
|
23502
|
+
|
|
23503
|
+
/** Used to check objects for own properties. */
|
|
23504
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
23505
|
+
|
|
23506
|
+
/** Built-in value references. */
|
|
23507
|
+
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
23508
|
+
|
|
23509
|
+
/**
|
|
23510
|
+
* Checks if `value` is likely an `arguments` object.
|
|
23511
|
+
*
|
|
23512
|
+
* @static
|
|
23513
|
+
* @memberOf _
|
|
23514
|
+
* @since 0.1.0
|
|
23515
|
+
* @category Lang
|
|
23516
|
+
* @param {*} value The value to check.
|
|
23517
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
23518
|
+
* else `false`.
|
|
23519
|
+
* @example
|
|
23520
|
+
*
|
|
23521
|
+
* _.isArguments(function() { return arguments; }());
|
|
23522
|
+
* // => true
|
|
23523
|
+
*
|
|
23524
|
+
* _.isArguments([1, 2, 3]);
|
|
23525
|
+
* // => false
|
|
23526
|
+
*/
|
|
23527
|
+
var isArguments$2 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
23528
|
+
return isObjectLike$2(value) && hasOwnProperty$3.call(value, 'callee') &&
|
|
23529
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
23530
|
+
};
|
|
23531
|
+
|
|
23532
|
+
var isArguments_1 = isArguments$2;
|
|
23533
|
+
|
|
23534
|
+
/**
|
|
23535
|
+
* Checks if `value` is classified as an `Array` object.
|
|
23536
|
+
*
|
|
23537
|
+
* @static
|
|
23538
|
+
* @memberOf _
|
|
23539
|
+
* @since 0.1.0
|
|
23540
|
+
* @category Lang
|
|
23541
|
+
* @param {*} value The value to check.
|
|
23542
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
23543
|
+
* @example
|
|
23544
|
+
*
|
|
23545
|
+
* _.isArray([1, 2, 3]);
|
|
23546
|
+
* // => true
|
|
23547
|
+
*
|
|
23548
|
+
* _.isArray(document.body.children);
|
|
23549
|
+
* // => false
|
|
23550
|
+
*
|
|
23551
|
+
* _.isArray('abc');
|
|
23552
|
+
* // => false
|
|
23553
|
+
*
|
|
23554
|
+
* _.isArray(_.noop);
|
|
23555
|
+
* // => false
|
|
23556
|
+
*/
|
|
23557
|
+
|
|
23558
|
+
var isArray$2 = Array.isArray;
|
|
23559
|
+
|
|
23560
|
+
var isArray_1 = isArray$2;
|
|
23561
|
+
|
|
23562
|
+
/** Used as references for various `Number` constants. */
|
|
23563
|
+
|
|
23564
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
23565
|
+
|
|
23566
|
+
/**
|
|
23567
|
+
* Checks if `value` is a valid array-like length.
|
|
23568
|
+
*
|
|
23569
|
+
* **Note:** This method is loosely based on
|
|
23570
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
23571
|
+
*
|
|
23572
|
+
* @static
|
|
23573
|
+
* @memberOf _
|
|
23574
|
+
* @since 4.0.0
|
|
23575
|
+
* @category Lang
|
|
23576
|
+
* @param {*} value The value to check.
|
|
23577
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
23578
|
+
* @example
|
|
23579
|
+
*
|
|
23580
|
+
* _.isLength(3);
|
|
23581
|
+
* // => true
|
|
23582
|
+
*
|
|
23583
|
+
* _.isLength(Number.MIN_VALUE);
|
|
23584
|
+
* // => false
|
|
23585
|
+
*
|
|
23586
|
+
* _.isLength(Infinity);
|
|
23587
|
+
* // => false
|
|
23588
|
+
*
|
|
23589
|
+
* _.isLength('3');
|
|
23590
|
+
* // => false
|
|
23591
|
+
*/
|
|
23592
|
+
function isLength$2(value) {
|
|
23593
|
+
return typeof value == 'number' &&
|
|
23594
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
23595
|
+
}
|
|
23596
|
+
|
|
23597
|
+
var isLength_1 = isLength$2;
|
|
23598
|
+
|
|
23599
|
+
var isFunction$1 = isFunction_1,
|
|
23600
|
+
isLength$1 = isLength_1;
|
|
23601
|
+
|
|
23602
|
+
/**
|
|
23603
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
23604
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
23605
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
23606
|
+
*
|
|
23607
|
+
* @static
|
|
23608
|
+
* @memberOf _
|
|
23609
|
+
* @since 4.0.0
|
|
23610
|
+
* @category Lang
|
|
23611
|
+
* @param {*} value The value to check.
|
|
23612
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
23613
|
+
* @example
|
|
23614
|
+
*
|
|
23615
|
+
* _.isArrayLike([1, 2, 3]);
|
|
23616
|
+
* // => true
|
|
23617
|
+
*
|
|
23618
|
+
* _.isArrayLike(document.body.children);
|
|
23619
|
+
* // => true
|
|
23620
|
+
*
|
|
23621
|
+
* _.isArrayLike('abc');
|
|
23622
|
+
* // => true
|
|
23623
|
+
*
|
|
23624
|
+
* _.isArrayLike(_.noop);
|
|
23625
|
+
* // => false
|
|
23626
|
+
*/
|
|
23627
|
+
function isArrayLike$3(value) {
|
|
23628
|
+
return value != null && isLength$1(value.length) && !isFunction$1(value);
|
|
23629
|
+
}
|
|
23630
|
+
|
|
23631
|
+
var isArrayLike_1 = isArrayLike$3;
|
|
23632
|
+
|
|
23633
|
+
var isArrayLike$2 = isArrayLike_1,
|
|
23634
|
+
isObjectLike$1 = isObjectLike_1;
|
|
23635
|
+
|
|
23636
|
+
/**
|
|
23637
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
23638
|
+
* is an object.
|
|
23639
|
+
*
|
|
23640
|
+
* @static
|
|
23641
|
+
* @memberOf _
|
|
23642
|
+
* @since 4.0.0
|
|
23643
|
+
* @category Lang
|
|
23644
|
+
* @param {*} value The value to check.
|
|
23645
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
23646
|
+
* else `false`.
|
|
23647
|
+
* @example
|
|
23648
|
+
*
|
|
23649
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
23650
|
+
* // => true
|
|
23651
|
+
*
|
|
23652
|
+
* _.isArrayLikeObject(document.body.children);
|
|
23653
|
+
* // => true
|
|
23654
|
+
*
|
|
23655
|
+
* _.isArrayLikeObject('abc');
|
|
23656
|
+
* // => false
|
|
23657
|
+
*
|
|
23658
|
+
* _.isArrayLikeObject(_.noop);
|
|
23659
|
+
* // => false
|
|
23660
|
+
*/
|
|
23661
|
+
function isArrayLikeObject$1(value) {
|
|
23662
|
+
return isObjectLike$1(value) && isArrayLike$2(value);
|
|
23663
|
+
}
|
|
23664
|
+
|
|
23665
|
+
var isArrayLikeObject_1 = isArrayLikeObject$1;
|
|
23666
|
+
|
|
23667
|
+
var isBuffer$2 = {exports: {}};
|
|
23668
|
+
|
|
23669
|
+
/**
|
|
23670
|
+
* This method returns `false`.
|
|
23671
|
+
*
|
|
23672
|
+
* @static
|
|
23673
|
+
* @memberOf _
|
|
23674
|
+
* @since 4.13.0
|
|
23675
|
+
* @category Util
|
|
23676
|
+
* @returns {boolean} Returns `false`.
|
|
23677
|
+
* @example
|
|
23678
|
+
*
|
|
23679
|
+
* _.times(2, _.stubFalse);
|
|
23680
|
+
* // => [false, false]
|
|
23681
|
+
*/
|
|
23682
|
+
|
|
23683
|
+
function stubFalse() {
|
|
23684
|
+
return false;
|
|
23685
|
+
}
|
|
23686
|
+
|
|
23687
|
+
var stubFalse_1 = stubFalse;
|
|
23688
|
+
|
|
23689
|
+
(function (module, exports) {
|
|
23690
|
+
var root = _root,
|
|
23691
|
+
stubFalse = stubFalse_1;
|
|
23692
|
+
|
|
23693
|
+
/** Detect free variable `exports`. */
|
|
23694
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
23695
|
+
|
|
23696
|
+
/** Detect free variable `module`. */
|
|
23697
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
23698
|
+
|
|
23699
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
23700
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
23701
|
+
|
|
23702
|
+
/** Built-in value references. */
|
|
23703
|
+
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
23704
|
+
|
|
23705
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
23706
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
23707
|
+
|
|
23708
|
+
/**
|
|
23709
|
+
* Checks if `value` is a buffer.
|
|
23710
|
+
*
|
|
23711
|
+
* @static
|
|
23712
|
+
* @memberOf _
|
|
23713
|
+
* @since 4.3.0
|
|
23714
|
+
* @category Lang
|
|
23715
|
+
* @param {*} value The value to check.
|
|
23716
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
23717
|
+
* @example
|
|
23718
|
+
*
|
|
23719
|
+
* _.isBuffer(new Buffer(2));
|
|
23720
|
+
* // => true
|
|
23721
|
+
*
|
|
23722
|
+
* _.isBuffer(new Uint8Array(2));
|
|
23723
|
+
* // => false
|
|
23724
|
+
*/
|
|
23725
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
23726
|
+
|
|
23727
|
+
module.exports = isBuffer;
|
|
23728
|
+
} (isBuffer$2, isBuffer$2.exports));
|
|
23729
|
+
|
|
23730
|
+
var baseGetTag = _baseGetTag,
|
|
23731
|
+
isLength = isLength_1,
|
|
23732
|
+
isObjectLike = isObjectLike_1;
|
|
23733
|
+
|
|
23734
|
+
/** `Object#toString` result references. */
|
|
23735
|
+
var argsTag = '[object Arguments]',
|
|
23736
|
+
arrayTag = '[object Array]',
|
|
23737
|
+
boolTag = '[object Boolean]',
|
|
23738
|
+
dateTag = '[object Date]',
|
|
23739
|
+
errorTag = '[object Error]',
|
|
23740
|
+
funcTag = '[object Function]',
|
|
23741
|
+
mapTag = '[object Map]',
|
|
23742
|
+
numberTag = '[object Number]',
|
|
23743
|
+
objectTag = '[object Object]',
|
|
23744
|
+
regexpTag = '[object RegExp]',
|
|
23745
|
+
setTag = '[object Set]',
|
|
23746
|
+
stringTag = '[object String]',
|
|
23747
|
+
weakMapTag = '[object WeakMap]';
|
|
23748
|
+
|
|
23749
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
23750
|
+
dataViewTag = '[object DataView]',
|
|
23751
|
+
float32Tag = '[object Float32Array]',
|
|
23752
|
+
float64Tag = '[object Float64Array]',
|
|
23753
|
+
int8Tag = '[object Int8Array]',
|
|
23754
|
+
int16Tag = '[object Int16Array]',
|
|
23755
|
+
int32Tag = '[object Int32Array]',
|
|
23756
|
+
uint8Tag = '[object Uint8Array]',
|
|
23757
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
23758
|
+
uint16Tag = '[object Uint16Array]',
|
|
23759
|
+
uint32Tag = '[object Uint32Array]';
|
|
23760
|
+
|
|
23761
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
23762
|
+
var typedArrayTags = {};
|
|
23763
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
23764
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
23765
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
23766
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
23767
|
+
typedArrayTags[uint32Tag] = true;
|
|
23768
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
23769
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
23770
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
23771
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
23772
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
23773
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
23774
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
23775
|
+
typedArrayTags[weakMapTag] = false;
|
|
23776
|
+
|
|
23777
|
+
/**
|
|
23778
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
23779
|
+
*
|
|
23780
|
+
* @private
|
|
23781
|
+
* @param {*} value The value to check.
|
|
23782
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
23783
|
+
*/
|
|
23784
|
+
function baseIsTypedArray$1(value) {
|
|
23785
|
+
return isObjectLike(value) &&
|
|
23786
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
23787
|
+
}
|
|
23788
|
+
|
|
23789
|
+
var _baseIsTypedArray = baseIsTypedArray$1;
|
|
23790
|
+
|
|
23791
|
+
/**
|
|
23792
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
23793
|
+
*
|
|
23794
|
+
* @private
|
|
23795
|
+
* @param {Function} func The function to cap arguments for.
|
|
23796
|
+
* @returns {Function} Returns the new capped function.
|
|
23797
|
+
*/
|
|
23798
|
+
|
|
23799
|
+
function baseUnary$1(func) {
|
|
23800
|
+
return function(value) {
|
|
23801
|
+
return func(value);
|
|
23802
|
+
};
|
|
23803
|
+
}
|
|
23804
|
+
|
|
23805
|
+
var _baseUnary = baseUnary$1;
|
|
23806
|
+
|
|
23807
|
+
var _nodeUtil = {exports: {}};
|
|
23808
|
+
|
|
23809
|
+
(function (module, exports) {
|
|
23810
|
+
var freeGlobal = _freeGlobal;
|
|
23811
|
+
|
|
23812
|
+
/** Detect free variable `exports`. */
|
|
23813
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
23814
|
+
|
|
23815
|
+
/** Detect free variable `module`. */
|
|
23816
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
23817
|
+
|
|
23818
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
23819
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
23820
|
+
|
|
23821
|
+
/** Detect free variable `process` from Node.js. */
|
|
23822
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
23823
|
+
|
|
23824
|
+
/** Used to access faster Node.js helpers. */
|
|
23825
|
+
var nodeUtil = (function() {
|
|
23826
|
+
try {
|
|
23827
|
+
// Use `util.types` for Node.js 10+.
|
|
23828
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
23829
|
+
|
|
23830
|
+
if (types) {
|
|
23831
|
+
return types;
|
|
23832
|
+
}
|
|
23833
|
+
|
|
23834
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
23835
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
23836
|
+
} catch (e) {}
|
|
23837
|
+
}());
|
|
23838
|
+
|
|
23839
|
+
module.exports = nodeUtil;
|
|
23840
|
+
} (_nodeUtil, _nodeUtil.exports));
|
|
23841
|
+
|
|
23842
|
+
var baseIsTypedArray = _baseIsTypedArray,
|
|
23843
|
+
baseUnary = _baseUnary,
|
|
23844
|
+
nodeUtil = _nodeUtil.exports;
|
|
23845
|
+
|
|
23846
|
+
/* Node.js helper references. */
|
|
23847
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
23848
|
+
|
|
23849
|
+
/**
|
|
23850
|
+
* Checks if `value` is classified as a typed array.
|
|
23851
|
+
*
|
|
23852
|
+
* @static
|
|
23853
|
+
* @memberOf _
|
|
23854
|
+
* @since 3.0.0
|
|
23855
|
+
* @category Lang
|
|
23856
|
+
* @param {*} value The value to check.
|
|
23857
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
23858
|
+
* @example
|
|
23859
|
+
*
|
|
23860
|
+
* _.isTypedArray(new Uint8Array);
|
|
23861
|
+
* // => true
|
|
23862
|
+
*
|
|
23863
|
+
* _.isTypedArray([]);
|
|
23864
|
+
* // => false
|
|
23865
|
+
*/
|
|
23866
|
+
var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
23867
|
+
|
|
23868
|
+
var isTypedArray_1 = isTypedArray$2;
|
|
23869
|
+
|
|
23870
|
+
/**
|
|
23871
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
23872
|
+
*
|
|
23873
|
+
* @private
|
|
23874
|
+
* @param {Object} object The object to query.
|
|
23875
|
+
* @param {string} key The key of the property to get.
|
|
23876
|
+
* @returns {*} Returns the property value.
|
|
23877
|
+
*/
|
|
23878
|
+
|
|
23879
|
+
function safeGet$2(object, key) {
|
|
23880
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
23881
|
+
return;
|
|
23882
|
+
}
|
|
23883
|
+
|
|
23884
|
+
if (key == '__proto__') {
|
|
23885
|
+
return;
|
|
23886
|
+
}
|
|
23887
|
+
|
|
23888
|
+
return object[key];
|
|
23889
|
+
}
|
|
23890
|
+
|
|
23891
|
+
var _safeGet = safeGet$2;
|
|
23892
|
+
|
|
23893
|
+
var baseAssignValue$1 = _baseAssignValue,
|
|
23894
|
+
eq$1 = eq_1;
|
|
23895
|
+
|
|
23896
|
+
/** Used for built-in method references. */
|
|
23897
|
+
var objectProto$2 = Object.prototype;
|
|
23898
|
+
|
|
23899
|
+
/** Used to check objects for own properties. */
|
|
23900
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
23901
|
+
|
|
23902
|
+
/**
|
|
23903
|
+
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
23904
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
23905
|
+
* for equality comparisons.
|
|
23906
|
+
*
|
|
23907
|
+
* @private
|
|
23908
|
+
* @param {Object} object The object to modify.
|
|
23909
|
+
* @param {string} key The key of the property to assign.
|
|
23910
|
+
* @param {*} value The value to assign.
|
|
23911
|
+
*/
|
|
23912
|
+
function assignValue$1(object, key, value) {
|
|
23913
|
+
var objValue = object[key];
|
|
23914
|
+
if (!(hasOwnProperty$2.call(object, key) && eq$1(objValue, value)) ||
|
|
23915
|
+
(value === undefined && !(key in object))) {
|
|
23916
|
+
baseAssignValue$1(object, key, value);
|
|
23917
|
+
}
|
|
23918
|
+
}
|
|
23919
|
+
|
|
23920
|
+
var _assignValue = assignValue$1;
|
|
23921
|
+
|
|
23922
|
+
var assignValue = _assignValue,
|
|
23923
|
+
baseAssignValue = _baseAssignValue;
|
|
23924
|
+
|
|
23925
|
+
/**
|
|
23926
|
+
* Copies properties of `source` to `object`.
|
|
23927
|
+
*
|
|
23928
|
+
* @private
|
|
23929
|
+
* @param {Object} source The object to copy properties from.
|
|
23930
|
+
* @param {Array} props The property identifiers to copy.
|
|
23931
|
+
* @param {Object} [object={}] The object to copy properties to.
|
|
23932
|
+
* @param {Function} [customizer] The function to customize copied values.
|
|
23933
|
+
* @returns {Object} Returns `object`.
|
|
23934
|
+
*/
|
|
23935
|
+
function copyObject$1(source, props, object, customizer) {
|
|
23936
|
+
var isNew = !object;
|
|
23937
|
+
object || (object = {});
|
|
23938
|
+
|
|
23939
|
+
var index = -1,
|
|
23940
|
+
length = props.length;
|
|
23941
|
+
|
|
23942
|
+
while (++index < length) {
|
|
23943
|
+
var key = props[index];
|
|
23944
|
+
|
|
23945
|
+
var newValue = customizer
|
|
23946
|
+
? customizer(object[key], source[key], key, object, source)
|
|
23947
|
+
: undefined;
|
|
23948
|
+
|
|
23949
|
+
if (newValue === undefined) {
|
|
23950
|
+
newValue = source[key];
|
|
23951
|
+
}
|
|
23952
|
+
if (isNew) {
|
|
23953
|
+
baseAssignValue(object, key, newValue);
|
|
23954
|
+
} else {
|
|
23955
|
+
assignValue(object, key, newValue);
|
|
23956
|
+
}
|
|
23957
|
+
}
|
|
23958
|
+
return object;
|
|
23959
|
+
}
|
|
23960
|
+
|
|
23961
|
+
var _copyObject = copyObject$1;
|
|
23962
|
+
|
|
23963
|
+
/**
|
|
23964
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
23965
|
+
* or max array length checks.
|
|
23966
|
+
*
|
|
23967
|
+
* @private
|
|
23968
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
23969
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
23970
|
+
* @returns {Array} Returns the array of results.
|
|
23971
|
+
*/
|
|
23972
|
+
|
|
23973
|
+
function baseTimes$1(n, iteratee) {
|
|
23974
|
+
var index = -1,
|
|
23975
|
+
result = Array(n);
|
|
23976
|
+
|
|
23977
|
+
while (++index < n) {
|
|
23978
|
+
result[index] = iteratee(index);
|
|
23979
|
+
}
|
|
23980
|
+
return result;
|
|
23981
|
+
}
|
|
23982
|
+
|
|
23983
|
+
var _baseTimes = baseTimes$1;
|
|
23984
|
+
|
|
23985
|
+
/** Used as references for various `Number` constants. */
|
|
23986
|
+
|
|
23987
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
23988
|
+
|
|
23989
|
+
/** Used to detect unsigned integer values. */
|
|
23990
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
23991
|
+
|
|
23992
|
+
/**
|
|
23993
|
+
* Checks if `value` is a valid array-like index.
|
|
23994
|
+
*
|
|
23995
|
+
* @private
|
|
23996
|
+
* @param {*} value The value to check.
|
|
23997
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
23998
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
23999
|
+
*/
|
|
24000
|
+
function isIndex$2(value, length) {
|
|
24001
|
+
var type = typeof value;
|
|
24002
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
24003
|
+
|
|
24004
|
+
return !!length &&
|
|
24005
|
+
(type == 'number' ||
|
|
24006
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
|
24007
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
24008
|
+
}
|
|
24009
|
+
|
|
24010
|
+
var _isIndex = isIndex$2;
|
|
24011
|
+
|
|
24012
|
+
var baseTimes = _baseTimes,
|
|
24013
|
+
isArguments$1 = isArguments_1,
|
|
24014
|
+
isArray$1 = isArray_1,
|
|
24015
|
+
isBuffer$1 = isBuffer$2.exports,
|
|
24016
|
+
isIndex$1 = _isIndex,
|
|
24017
|
+
isTypedArray$1 = isTypedArray_1;
|
|
24018
|
+
|
|
24019
|
+
/** Used for built-in method references. */
|
|
24020
|
+
var objectProto$1 = Object.prototype;
|
|
24021
|
+
|
|
24022
|
+
/** Used to check objects for own properties. */
|
|
24023
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
24024
|
+
|
|
24025
|
+
/**
|
|
24026
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
24027
|
+
*
|
|
24028
|
+
* @private
|
|
24029
|
+
* @param {*} value The value to query.
|
|
24030
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
24031
|
+
* @returns {Array} Returns the array of property names.
|
|
24032
|
+
*/
|
|
24033
|
+
function arrayLikeKeys$1(value, inherited) {
|
|
24034
|
+
var isArr = isArray$1(value),
|
|
24035
|
+
isArg = !isArr && isArguments$1(value),
|
|
24036
|
+
isBuff = !isArr && !isArg && isBuffer$1(value),
|
|
24037
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
|
|
24038
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
24039
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
24040
|
+
length = result.length;
|
|
24041
|
+
|
|
24042
|
+
for (var key in value) {
|
|
24043
|
+
if ((inherited || hasOwnProperty$1.call(value, key)) &&
|
|
24044
|
+
!(skipIndexes && (
|
|
24045
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
24046
|
+
key == 'length' ||
|
|
24047
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
24048
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
24049
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
24050
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
24051
|
+
// Skip index properties.
|
|
24052
|
+
isIndex$1(key, length)
|
|
24053
|
+
))) {
|
|
24054
|
+
result.push(key);
|
|
24055
|
+
}
|
|
24056
|
+
}
|
|
24057
|
+
return result;
|
|
24058
|
+
}
|
|
24059
|
+
|
|
24060
|
+
var _arrayLikeKeys = arrayLikeKeys$1;
|
|
24061
|
+
|
|
24062
|
+
/**
|
|
24063
|
+
* This function is like
|
|
24064
|
+
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
24065
|
+
* except that it includes inherited enumerable properties.
|
|
24066
|
+
*
|
|
24067
|
+
* @private
|
|
24068
|
+
* @param {Object} object The object to query.
|
|
24069
|
+
* @returns {Array} Returns the array of property names.
|
|
24070
|
+
*/
|
|
24071
|
+
|
|
24072
|
+
function nativeKeysIn$1(object) {
|
|
24073
|
+
var result = [];
|
|
24074
|
+
if (object != null) {
|
|
24075
|
+
for (var key in Object(object)) {
|
|
24076
|
+
result.push(key);
|
|
24077
|
+
}
|
|
24078
|
+
}
|
|
24079
|
+
return result;
|
|
24080
|
+
}
|
|
24081
|
+
|
|
24082
|
+
var _nativeKeysIn = nativeKeysIn$1;
|
|
24083
|
+
|
|
24084
|
+
var isObject$3 = isObject_1,
|
|
24085
|
+
isPrototype = _isPrototype,
|
|
24086
|
+
nativeKeysIn = _nativeKeysIn;
|
|
24087
|
+
|
|
24088
|
+
/** Used for built-in method references. */
|
|
24089
|
+
var objectProto = Object.prototype;
|
|
24090
|
+
|
|
24091
|
+
/** Used to check objects for own properties. */
|
|
24092
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
24093
|
+
|
|
24094
|
+
/**
|
|
24095
|
+
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
24096
|
+
*
|
|
24097
|
+
* @private
|
|
24098
|
+
* @param {Object} object The object to query.
|
|
24099
|
+
* @returns {Array} Returns the array of property names.
|
|
24100
|
+
*/
|
|
24101
|
+
function baseKeysIn$1(object) {
|
|
24102
|
+
if (!isObject$3(object)) {
|
|
24103
|
+
return nativeKeysIn(object);
|
|
24104
|
+
}
|
|
24105
|
+
var isProto = isPrototype(object),
|
|
24106
|
+
result = [];
|
|
24107
|
+
|
|
24108
|
+
for (var key in object) {
|
|
24109
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
24110
|
+
result.push(key);
|
|
24111
|
+
}
|
|
24112
|
+
}
|
|
24113
|
+
return result;
|
|
24114
|
+
}
|
|
24115
|
+
|
|
24116
|
+
var _baseKeysIn = baseKeysIn$1;
|
|
24117
|
+
|
|
24118
|
+
var arrayLikeKeys = _arrayLikeKeys,
|
|
24119
|
+
baseKeysIn = _baseKeysIn,
|
|
24120
|
+
isArrayLike$1 = isArrayLike_1;
|
|
24121
|
+
|
|
24122
|
+
/**
|
|
24123
|
+
* Creates an array of the own and inherited enumerable property names of `object`.
|
|
24124
|
+
*
|
|
24125
|
+
* **Note:** Non-object values are coerced to objects.
|
|
24126
|
+
*
|
|
24127
|
+
* @static
|
|
24128
|
+
* @memberOf _
|
|
24129
|
+
* @since 3.0.0
|
|
24130
|
+
* @category Object
|
|
24131
|
+
* @param {Object} object The object to query.
|
|
24132
|
+
* @returns {Array} Returns the array of property names.
|
|
24133
|
+
* @example
|
|
24134
|
+
*
|
|
24135
|
+
* function Foo() {
|
|
24136
|
+
* this.a = 1;
|
|
24137
|
+
* this.b = 2;
|
|
24138
|
+
* }
|
|
24139
|
+
*
|
|
24140
|
+
* Foo.prototype.c = 3;
|
|
24141
|
+
*
|
|
24142
|
+
* _.keysIn(new Foo);
|
|
24143
|
+
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
|
24144
|
+
*/
|
|
24145
|
+
function keysIn$2(object) {
|
|
24146
|
+
return isArrayLike$1(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
24147
|
+
}
|
|
24148
|
+
|
|
24149
|
+
var keysIn_1 = keysIn$2;
|
|
24150
|
+
|
|
24151
|
+
var copyObject = _copyObject,
|
|
24152
|
+
keysIn$1 = keysIn_1;
|
|
24153
|
+
|
|
24154
|
+
/**
|
|
24155
|
+
* Converts `value` to a plain object flattening inherited enumerable string
|
|
24156
|
+
* keyed properties of `value` to own properties of the plain object.
|
|
24157
|
+
*
|
|
24158
|
+
* @static
|
|
24159
|
+
* @memberOf _
|
|
24160
|
+
* @since 3.0.0
|
|
24161
|
+
* @category Lang
|
|
24162
|
+
* @param {*} value The value to convert.
|
|
24163
|
+
* @returns {Object} Returns the converted plain object.
|
|
24164
|
+
* @example
|
|
24165
|
+
*
|
|
24166
|
+
* function Foo() {
|
|
24167
|
+
* this.b = 2;
|
|
24168
|
+
* }
|
|
24169
|
+
*
|
|
24170
|
+
* Foo.prototype.c = 3;
|
|
24171
|
+
*
|
|
24172
|
+
* _.assign({ 'a': 1 }, new Foo);
|
|
24173
|
+
* // => { 'a': 1, 'b': 2 }
|
|
24174
|
+
*
|
|
24175
|
+
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
24176
|
+
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
24177
|
+
*/
|
|
24178
|
+
function toPlainObject$1(value) {
|
|
24179
|
+
return copyObject(value, keysIn$1(value));
|
|
24180
|
+
}
|
|
24181
|
+
|
|
24182
|
+
var toPlainObject_1 = toPlainObject$1;
|
|
24183
|
+
|
|
24184
|
+
var assignMergeValue$1 = _assignMergeValue,
|
|
24185
|
+
cloneBuffer = _cloneBuffer.exports,
|
|
24186
|
+
cloneTypedArray = _cloneTypedArray,
|
|
24187
|
+
copyArray = _copyArray,
|
|
24188
|
+
initCloneObject = _initCloneObject,
|
|
24189
|
+
isArguments = isArguments_1,
|
|
24190
|
+
isArray = isArray_1,
|
|
24191
|
+
isArrayLikeObject = isArrayLikeObject_1,
|
|
24192
|
+
isBuffer = isBuffer$2.exports,
|
|
24193
|
+
isFunction = isFunction_1,
|
|
24194
|
+
isObject$2 = isObject_1,
|
|
24195
|
+
isPlainObject = isPlainObject_1,
|
|
24196
|
+
isTypedArray = isTypedArray_1,
|
|
24197
|
+
safeGet$1 = _safeGet,
|
|
24198
|
+
toPlainObject = toPlainObject_1;
|
|
24199
|
+
|
|
24200
|
+
/**
|
|
24201
|
+
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
24202
|
+
* deep merges and tracks traversed objects enabling objects with circular
|
|
24203
|
+
* references to be merged.
|
|
24204
|
+
*
|
|
24205
|
+
* @private
|
|
24206
|
+
* @param {Object} object The destination object.
|
|
24207
|
+
* @param {Object} source The source object.
|
|
24208
|
+
* @param {string} key The key of the value to merge.
|
|
24209
|
+
* @param {number} srcIndex The index of `source`.
|
|
24210
|
+
* @param {Function} mergeFunc The function to merge values.
|
|
24211
|
+
* @param {Function} [customizer] The function to customize assigned values.
|
|
24212
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
24213
|
+
* counterparts.
|
|
24214
|
+
*/
|
|
24215
|
+
function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
24216
|
+
var objValue = safeGet$1(object, key),
|
|
24217
|
+
srcValue = safeGet$1(source, key),
|
|
24218
|
+
stacked = stack.get(srcValue);
|
|
24219
|
+
|
|
24220
|
+
if (stacked) {
|
|
24221
|
+
assignMergeValue$1(object, key, stacked);
|
|
24222
|
+
return;
|
|
24223
|
+
}
|
|
24224
|
+
var newValue = customizer
|
|
24225
|
+
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
24226
|
+
: undefined;
|
|
24227
|
+
|
|
24228
|
+
var isCommon = newValue === undefined;
|
|
24229
|
+
|
|
24230
|
+
if (isCommon) {
|
|
24231
|
+
var isArr = isArray(srcValue),
|
|
24232
|
+
isBuff = !isArr && isBuffer(srcValue),
|
|
24233
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
24234
|
+
|
|
24235
|
+
newValue = srcValue;
|
|
24236
|
+
if (isArr || isBuff || isTyped) {
|
|
24237
|
+
if (isArray(objValue)) {
|
|
24238
|
+
newValue = objValue;
|
|
24239
|
+
}
|
|
24240
|
+
else if (isArrayLikeObject(objValue)) {
|
|
24241
|
+
newValue = copyArray(objValue);
|
|
24242
|
+
}
|
|
24243
|
+
else if (isBuff) {
|
|
24244
|
+
isCommon = false;
|
|
24245
|
+
newValue = cloneBuffer(srcValue, true);
|
|
24246
|
+
}
|
|
24247
|
+
else if (isTyped) {
|
|
24248
|
+
isCommon = false;
|
|
24249
|
+
newValue = cloneTypedArray(srcValue, true);
|
|
24250
|
+
}
|
|
24251
|
+
else {
|
|
24252
|
+
newValue = [];
|
|
24253
|
+
}
|
|
24254
|
+
}
|
|
24255
|
+
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
24256
|
+
newValue = objValue;
|
|
24257
|
+
if (isArguments(objValue)) {
|
|
24258
|
+
newValue = toPlainObject(objValue);
|
|
24259
|
+
}
|
|
24260
|
+
else if (!isObject$2(objValue) || isFunction(objValue)) {
|
|
24261
|
+
newValue = initCloneObject(srcValue);
|
|
24262
|
+
}
|
|
24263
|
+
}
|
|
24264
|
+
else {
|
|
24265
|
+
isCommon = false;
|
|
24266
|
+
}
|
|
24267
|
+
}
|
|
24268
|
+
if (isCommon) {
|
|
24269
|
+
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
24270
|
+
stack.set(srcValue, newValue);
|
|
24271
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
24272
|
+
stack['delete'](srcValue);
|
|
24273
|
+
}
|
|
24274
|
+
assignMergeValue$1(object, key, newValue);
|
|
24275
|
+
}
|
|
24276
|
+
|
|
24277
|
+
var _baseMergeDeep = baseMergeDeep$1;
|
|
24278
|
+
|
|
24279
|
+
var Stack = _Stack,
|
|
24280
|
+
assignMergeValue = _assignMergeValue,
|
|
24281
|
+
baseFor = _baseFor,
|
|
24282
|
+
baseMergeDeep = _baseMergeDeep,
|
|
24283
|
+
isObject$1 = isObject_1,
|
|
24284
|
+
keysIn = keysIn_1,
|
|
24285
|
+
safeGet = _safeGet;
|
|
24286
|
+
|
|
24287
|
+
/**
|
|
24288
|
+
* The base implementation of `_.merge` without support for multiple sources.
|
|
24289
|
+
*
|
|
24290
|
+
* @private
|
|
24291
|
+
* @param {Object} object The destination object.
|
|
24292
|
+
* @param {Object} source The source object.
|
|
24293
|
+
* @param {number} srcIndex The index of `source`.
|
|
24294
|
+
* @param {Function} [customizer] The function to customize merged values.
|
|
24295
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
24296
|
+
* counterparts.
|
|
24297
|
+
*/
|
|
24298
|
+
function baseMerge$1(object, source, srcIndex, customizer, stack) {
|
|
24299
|
+
if (object === source) {
|
|
24300
|
+
return;
|
|
24301
|
+
}
|
|
24302
|
+
baseFor(source, function(srcValue, key) {
|
|
24303
|
+
stack || (stack = new Stack);
|
|
24304
|
+
if (isObject$1(srcValue)) {
|
|
24305
|
+
baseMergeDeep(object, source, key, srcIndex, baseMerge$1, customizer, stack);
|
|
24306
|
+
}
|
|
24307
|
+
else {
|
|
24308
|
+
var newValue = customizer
|
|
24309
|
+
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
24310
|
+
: undefined;
|
|
24311
|
+
|
|
24312
|
+
if (newValue === undefined) {
|
|
24313
|
+
newValue = srcValue;
|
|
24314
|
+
}
|
|
24315
|
+
assignMergeValue(object, key, newValue);
|
|
24316
|
+
}
|
|
24317
|
+
}, keysIn);
|
|
24318
|
+
}
|
|
24319
|
+
|
|
24320
|
+
var _baseMerge = baseMerge$1;
|
|
24321
|
+
|
|
24322
|
+
/**
|
|
24323
|
+
* This method returns the first argument it receives.
|
|
24324
|
+
*
|
|
24325
|
+
* @static
|
|
24326
|
+
* @since 0.1.0
|
|
24327
|
+
* @memberOf _
|
|
24328
|
+
* @category Util
|
|
24329
|
+
* @param {*} value Any value.
|
|
24330
|
+
* @returns {*} Returns `value`.
|
|
24331
|
+
* @example
|
|
24332
|
+
*
|
|
24333
|
+
* var object = { 'a': 1 };
|
|
24334
|
+
*
|
|
24335
|
+
* console.log(_.identity(object) === object);
|
|
24336
|
+
* // => true
|
|
24337
|
+
*/
|
|
24338
|
+
|
|
24339
|
+
function identity$2(value) {
|
|
24340
|
+
return value;
|
|
24341
|
+
}
|
|
24342
|
+
|
|
24343
|
+
var identity_1 = identity$2;
|
|
24344
|
+
|
|
24345
|
+
/**
|
|
24346
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
24347
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
24348
|
+
*
|
|
24349
|
+
* @private
|
|
24350
|
+
* @param {Function} func The function to invoke.
|
|
24351
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
24352
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
24353
|
+
* @returns {*} Returns the result of `func`.
|
|
24354
|
+
*/
|
|
24355
|
+
|
|
24356
|
+
function apply$1(func, thisArg, args) {
|
|
24357
|
+
switch (args.length) {
|
|
24358
|
+
case 0: return func.call(thisArg);
|
|
24359
|
+
case 1: return func.call(thisArg, args[0]);
|
|
24360
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
24361
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
24362
|
+
}
|
|
24363
|
+
return func.apply(thisArg, args);
|
|
24364
|
+
}
|
|
24365
|
+
|
|
24366
|
+
var _apply = apply$1;
|
|
24367
|
+
|
|
24368
|
+
var apply = _apply;
|
|
24369
|
+
|
|
24370
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
24371
|
+
var nativeMax = Math.max;
|
|
24372
|
+
|
|
24373
|
+
/**
|
|
24374
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
24375
|
+
*
|
|
24376
|
+
* @private
|
|
24377
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
24378
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
24379
|
+
* @param {Function} transform The rest array transform.
|
|
24380
|
+
* @returns {Function} Returns the new function.
|
|
24381
|
+
*/
|
|
24382
|
+
function overRest$1(func, start, transform) {
|
|
24383
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
24384
|
+
return function() {
|
|
24385
|
+
var args = arguments,
|
|
24386
|
+
index = -1,
|
|
24387
|
+
length = nativeMax(args.length - start, 0),
|
|
24388
|
+
array = Array(length);
|
|
24389
|
+
|
|
24390
|
+
while (++index < length) {
|
|
24391
|
+
array[index] = args[start + index];
|
|
24392
|
+
}
|
|
24393
|
+
index = -1;
|
|
24394
|
+
var otherArgs = Array(start + 1);
|
|
24395
|
+
while (++index < start) {
|
|
24396
|
+
otherArgs[index] = args[index];
|
|
24397
|
+
}
|
|
24398
|
+
otherArgs[start] = transform(array);
|
|
24399
|
+
return apply(func, this, otherArgs);
|
|
24400
|
+
};
|
|
24401
|
+
}
|
|
24402
|
+
|
|
24403
|
+
var _overRest = overRest$1;
|
|
24404
|
+
|
|
24405
|
+
/**
|
|
24406
|
+
* Creates a function that returns `value`.
|
|
24407
|
+
*
|
|
24408
|
+
* @static
|
|
24409
|
+
* @memberOf _
|
|
24410
|
+
* @since 2.4.0
|
|
24411
|
+
* @category Util
|
|
24412
|
+
* @param {*} value The value to return from the new function.
|
|
24413
|
+
* @returns {Function} Returns the new constant function.
|
|
24414
|
+
* @example
|
|
24415
|
+
*
|
|
24416
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
24417
|
+
*
|
|
24418
|
+
* console.log(objects);
|
|
24419
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
24420
|
+
*
|
|
24421
|
+
* console.log(objects[0] === objects[1]);
|
|
24422
|
+
* // => true
|
|
24423
|
+
*/
|
|
24424
|
+
|
|
24425
|
+
function constant$1(value) {
|
|
24426
|
+
return function() {
|
|
24427
|
+
return value;
|
|
24428
|
+
};
|
|
24429
|
+
}
|
|
24430
|
+
|
|
24431
|
+
var constant_1 = constant$1;
|
|
24432
|
+
|
|
24433
|
+
var constant = constant_1,
|
|
24434
|
+
defineProperty = _defineProperty,
|
|
24435
|
+
identity$1 = identity_1;
|
|
24436
|
+
|
|
24437
|
+
/**
|
|
24438
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
24439
|
+
*
|
|
24440
|
+
* @private
|
|
24441
|
+
* @param {Function} func The function to modify.
|
|
24442
|
+
* @param {Function} string The `toString` result.
|
|
24443
|
+
* @returns {Function} Returns `func`.
|
|
24444
|
+
*/
|
|
24445
|
+
var baseSetToString$1 = !defineProperty ? identity$1 : function(func, string) {
|
|
24446
|
+
return defineProperty(func, 'toString', {
|
|
24447
|
+
'configurable': true,
|
|
24448
|
+
'enumerable': false,
|
|
24449
|
+
'value': constant(string),
|
|
24450
|
+
'writable': true
|
|
24451
|
+
});
|
|
24452
|
+
};
|
|
24453
|
+
|
|
24454
|
+
var _baseSetToString = baseSetToString$1;
|
|
24455
|
+
|
|
24456
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
24457
|
+
|
|
24458
|
+
var HOT_COUNT = 800,
|
|
24459
|
+
HOT_SPAN = 16;
|
|
24460
|
+
|
|
24461
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
24462
|
+
var nativeNow = Date.now;
|
|
24463
|
+
|
|
24464
|
+
/**
|
|
24465
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
24466
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
24467
|
+
* milliseconds.
|
|
24468
|
+
*
|
|
24469
|
+
* @private
|
|
24470
|
+
* @param {Function} func The function to restrict.
|
|
24471
|
+
* @returns {Function} Returns the new shortable function.
|
|
24472
|
+
*/
|
|
24473
|
+
function shortOut$1(func) {
|
|
24474
|
+
var count = 0,
|
|
24475
|
+
lastCalled = 0;
|
|
24476
|
+
|
|
24477
|
+
return function() {
|
|
24478
|
+
var stamp = nativeNow(),
|
|
24479
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
24480
|
+
|
|
24481
|
+
lastCalled = stamp;
|
|
24482
|
+
if (remaining > 0) {
|
|
24483
|
+
if (++count >= HOT_COUNT) {
|
|
24484
|
+
return arguments[0];
|
|
24485
|
+
}
|
|
24486
|
+
} else {
|
|
24487
|
+
count = 0;
|
|
24488
|
+
}
|
|
24489
|
+
return func.apply(undefined, arguments);
|
|
24490
|
+
};
|
|
24491
|
+
}
|
|
24492
|
+
|
|
24493
|
+
var _shortOut = shortOut$1;
|
|
24494
|
+
|
|
24495
|
+
var baseSetToString = _baseSetToString,
|
|
24496
|
+
shortOut = _shortOut;
|
|
24497
|
+
|
|
24498
|
+
/**
|
|
24499
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
24500
|
+
*
|
|
24501
|
+
* @private
|
|
24502
|
+
* @param {Function} func The function to modify.
|
|
24503
|
+
* @param {Function} string The `toString` result.
|
|
24504
|
+
* @returns {Function} Returns `func`.
|
|
24505
|
+
*/
|
|
24506
|
+
var setToString$1 = shortOut(baseSetToString);
|
|
24507
|
+
|
|
24508
|
+
var _setToString = setToString$1;
|
|
24509
|
+
|
|
24510
|
+
var identity = identity_1,
|
|
24511
|
+
overRest = _overRest,
|
|
24512
|
+
setToString = _setToString;
|
|
24513
|
+
|
|
24514
|
+
/**
|
|
24515
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
24516
|
+
*
|
|
24517
|
+
* @private
|
|
24518
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
24519
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
24520
|
+
* @returns {Function} Returns the new function.
|
|
24521
|
+
*/
|
|
24522
|
+
function baseRest$1(func, start) {
|
|
24523
|
+
return setToString(overRest(func, start, identity), func + '');
|
|
24524
|
+
}
|
|
24525
|
+
|
|
24526
|
+
var _baseRest = baseRest$1;
|
|
24527
|
+
|
|
24528
|
+
var eq = eq_1,
|
|
24529
|
+
isArrayLike = isArrayLike_1,
|
|
24530
|
+
isIndex = _isIndex,
|
|
24531
|
+
isObject = isObject_1;
|
|
24532
|
+
|
|
24533
|
+
/**
|
|
24534
|
+
* Checks if the given arguments are from an iteratee call.
|
|
24535
|
+
*
|
|
24536
|
+
* @private
|
|
24537
|
+
* @param {*} value The potential iteratee value argument.
|
|
24538
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
24539
|
+
* @param {*} object The potential iteratee object argument.
|
|
24540
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
24541
|
+
* else `false`.
|
|
24542
|
+
*/
|
|
24543
|
+
function isIterateeCall$1(value, index, object) {
|
|
24544
|
+
if (!isObject(object)) {
|
|
24545
|
+
return false;
|
|
24546
|
+
}
|
|
24547
|
+
var type = typeof index;
|
|
24548
|
+
if (type == 'number'
|
|
24549
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
|
24550
|
+
: (type == 'string' && index in object)
|
|
24551
|
+
) {
|
|
24552
|
+
return eq(object[index], value);
|
|
24553
|
+
}
|
|
24554
|
+
return false;
|
|
24555
|
+
}
|
|
24556
|
+
|
|
24557
|
+
var _isIterateeCall = isIterateeCall$1;
|
|
24558
|
+
|
|
24559
|
+
var baseRest = _baseRest,
|
|
24560
|
+
isIterateeCall = _isIterateeCall;
|
|
24561
|
+
|
|
24562
|
+
/**
|
|
24563
|
+
* Creates a function like `_.assign`.
|
|
24564
|
+
*
|
|
24565
|
+
* @private
|
|
24566
|
+
* @param {Function} assigner The function to assign values.
|
|
24567
|
+
* @returns {Function} Returns the new assigner function.
|
|
24568
|
+
*/
|
|
24569
|
+
function createAssigner$1(assigner) {
|
|
24570
|
+
return baseRest(function(object, sources) {
|
|
24571
|
+
var index = -1,
|
|
24572
|
+
length = sources.length,
|
|
24573
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
24574
|
+
guard = length > 2 ? sources[2] : undefined;
|
|
24575
|
+
|
|
24576
|
+
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
|
24577
|
+
? (length--, customizer)
|
|
24578
|
+
: undefined;
|
|
24579
|
+
|
|
24580
|
+
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
24581
|
+
customizer = length < 3 ? undefined : customizer;
|
|
24582
|
+
length = 1;
|
|
24583
|
+
}
|
|
24584
|
+
object = Object(object);
|
|
24585
|
+
while (++index < length) {
|
|
24586
|
+
var source = sources[index];
|
|
24587
|
+
if (source) {
|
|
24588
|
+
assigner(object, source, index, customizer);
|
|
24589
|
+
}
|
|
24590
|
+
}
|
|
24591
|
+
return object;
|
|
24592
|
+
});
|
|
24593
|
+
}
|
|
24594
|
+
|
|
24595
|
+
var _createAssigner = createAssigner$1;
|
|
24596
|
+
|
|
24597
|
+
var baseMerge = _baseMerge,
|
|
24598
|
+
createAssigner = _createAssigner;
|
|
24599
|
+
|
|
24600
|
+
/**
|
|
24601
|
+
* This method is like `_.assign` except that it recursively merges own and
|
|
24602
|
+
* inherited enumerable string keyed properties of source objects into the
|
|
24603
|
+
* destination object. Source properties that resolve to `undefined` are
|
|
24604
|
+
* skipped if a destination value exists. Array and plain object properties
|
|
24605
|
+
* are merged recursively. Other objects and value types are overridden by
|
|
24606
|
+
* assignment. Source objects are applied from left to right. Subsequent
|
|
24607
|
+
* sources overwrite property assignments of previous sources.
|
|
24608
|
+
*
|
|
24609
|
+
* **Note:** This method mutates `object`.
|
|
24610
|
+
*
|
|
24611
|
+
* @static
|
|
24612
|
+
* @memberOf _
|
|
24613
|
+
* @since 0.5.0
|
|
24614
|
+
* @category Object
|
|
24615
|
+
* @param {Object} object The destination object.
|
|
24616
|
+
* @param {...Object} [sources] The source objects.
|
|
24617
|
+
* @returns {Object} Returns `object`.
|
|
24618
|
+
* @example
|
|
24619
|
+
*
|
|
24620
|
+
* var object = {
|
|
24621
|
+
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
|
24622
|
+
* };
|
|
24623
|
+
*
|
|
24624
|
+
* var other = {
|
|
24625
|
+
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
24626
|
+
* };
|
|
24627
|
+
*
|
|
24628
|
+
* _.merge(object, other);
|
|
24629
|
+
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
24630
|
+
*/
|
|
24631
|
+
var merge = createAssigner(function(object, source, srcIndex) {
|
|
24632
|
+
baseMerge(object, source, srcIndex);
|
|
24633
|
+
});
|
|
24634
|
+
|
|
24635
|
+
var merge_1 = merge;
|
|
24636
|
+
|
|
24637
|
+
var Container = /** @class */ (function (_super) {
|
|
24638
|
+
__extends(Container, _super);
|
|
24639
|
+
function Container() {
|
|
24640
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24641
|
+
}
|
|
24642
|
+
Container.prototype.handleClick = function (e) {
|
|
24643
|
+
var _a = this.props, dispatchEvent = _a.dispatchEvent, data = _a.data;
|
|
24644
|
+
dispatchEvent(e, data);
|
|
24645
|
+
};
|
|
24646
|
+
Container.prototype.handleMouseEnter = function (e) {
|
|
24647
|
+
var _a = this.props, dispatchEvent = _a.dispatchEvent, data = _a.data;
|
|
24648
|
+
dispatchEvent(e, data);
|
|
24649
|
+
};
|
|
24650
|
+
Container.prototype.handleMouseLeave = function (e) {
|
|
24651
|
+
var _a = this.props, dispatchEvent = _a.dispatchEvent, data = _a.data;
|
|
24652
|
+
dispatchEvent(e, data);
|
|
24653
|
+
};
|
|
24654
|
+
Container.prototype.renderBody = function () {
|
|
24655
|
+
var _a = this.props, children = _a.children, body = _a.body, render = _a.render, cx = _a.classnames, bodyClassName = _a.bodyClassName, disabled = _a.disabled, wrapperBody = _a.wrapperBody;
|
|
24656
|
+
var isWrapperBody = wrapperBody !== null && wrapperBody !== void 0 ? wrapperBody : true;
|
|
24657
|
+
var containerBody = children
|
|
24658
|
+
? typeof children === 'function'
|
|
24659
|
+
? children(this.props)
|
|
24660
|
+
: children
|
|
24661
|
+
: body
|
|
24662
|
+
? render('body', body, { disabled: disabled })
|
|
24663
|
+
: null;
|
|
24664
|
+
if (isWrapperBody) {
|
|
24665
|
+
return (React.createElement("div", { className: cx('Container-body', bodyClassName) }, containerBody));
|
|
24666
|
+
}
|
|
24667
|
+
else {
|
|
24668
|
+
return containerBody;
|
|
24669
|
+
}
|
|
24670
|
+
};
|
|
24671
|
+
Container.prototype.render = function () {
|
|
24672
|
+
var _a = this.props, className = _a.className, wrapperComponent = _a.wrapperComponent, size = _a.size, cx = _a.classnames, style = _a.style, data = _a.data, draggable = _a.draggable, draggableConfig = _a.draggableConfig, id = _a.id, wrapperCustomStyle = _a.wrapperCustomStyle, env = _a.env, themeCss = _a.themeCss; _a.baseControlClassName; _a.testid;
|
|
24673
|
+
var finalDraggable = isPureVariable(draggable)
|
|
24674
|
+
? resolveVariableAndFilter(draggable, data, '| raw')
|
|
24675
|
+
: draggable;
|
|
24676
|
+
var finalDraggableConfig = merge_1(Container.defaultProps.draggableConfig, isPureVariable(draggableConfig)
|
|
24677
|
+
? resolveVariableAndFilter(draggableConfig, data, '| raw')
|
|
24678
|
+
: draggableConfig);
|
|
24679
|
+
var Component = wrapperComponent || 'div';
|
|
24680
|
+
var contentDom = (React.createElement(Component, { className: cx('antd-Form antd-Form--horizontal steedos-amis-form Container', size && size !== 'none' ? "Container--".concat(size) : '', className, setThemeClassName(__assign$2(__assign$2({}, this.props), { name: 'baseControlClassName', id: id, themeCss: themeCss })), setThemeClassName(__assign$2(__assign$2({}, this.props), { name: 'wrapperCustomStyle', id: id, themeCss: wrapperCustomStyle }))), onClick: this.handleClick, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, style: buildStyle(style, data) },
|
|
24681
|
+
this.renderBody(),
|
|
24682
|
+
React.createElement(CustomStyle, __assign$2({}, this.props, { config: {
|
|
24683
|
+
wrapperCustomStyle: wrapperCustomStyle,
|
|
24684
|
+
id: id,
|
|
24685
|
+
themeCss: themeCss,
|
|
24686
|
+
classNames: [
|
|
24687
|
+
{
|
|
24688
|
+
key: 'baseControlClassName'
|
|
24689
|
+
}
|
|
24690
|
+
]
|
|
24691
|
+
}, env: env }))));
|
|
24692
|
+
return finalDraggable ? (React.createElement(DndContainer, __assign$2({}, finalDraggableConfig, { draggable: true }), contentDom)) : (contentDom);
|
|
24693
|
+
};
|
|
24694
|
+
Container.propsList = ['body', 'className'];
|
|
24695
|
+
Container.defaultProps = {
|
|
24696
|
+
className: '',
|
|
24697
|
+
draggableConfig: {
|
|
24698
|
+
axis: 'both',
|
|
24699
|
+
scale: 1,
|
|
24700
|
+
enableUserSelect: false
|
|
24701
|
+
}
|
|
24702
|
+
};
|
|
24703
|
+
__decorate([
|
|
24704
|
+
autobind
|
|
24705
|
+
], Container.prototype, "handleClick", null);
|
|
24706
|
+
__decorate([
|
|
24707
|
+
autobind
|
|
24708
|
+
], Container.prototype, "handleMouseEnter", null);
|
|
24709
|
+
__decorate([
|
|
24710
|
+
autobind
|
|
24711
|
+
], Container.prototype, "handleMouseLeave", null);
|
|
24712
|
+
return Container;
|
|
24713
|
+
}(React.Component));
|
|
24714
|
+
// @Renderer({
|
|
24715
|
+
// type: 'container'
|
|
24716
|
+
// })
|
|
24717
|
+
var SteedosObject = /** @class */ (function (_super) {
|
|
24718
|
+
__extends(SteedosObject, _super);
|
|
24719
|
+
function SteedosObject() {
|
|
24720
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24721
|
+
}
|
|
24722
|
+
return SteedosObject;
|
|
24723
|
+
}(Container));
|
|
24724
|
+
|
|
24725
|
+
// md:border-b
|
|
24726
|
+
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24727
|
+
var $schema, recordId, defaultData, mode, _a, layout, labelAlign, appId, fieldsExtend, _b, excludedFields, _c, fields, _d, form, _e, className, enableInitApi, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, data, formDataFilter, onFormDataFilter, env, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, allData, schema, schema, formData;
|
|
24728
|
+
return __generator(this, function (_f) {
|
|
24729
|
+
switch (_f.label) {
|
|
24730
|
+
case 0:
|
|
24731
|
+
$schema = props.$schema, recordId = props.recordId, defaultData = props.defaultData, mode = props.mode, _a = props.layout, layout = _a === void 0 ? "horizontal" : _a, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _b = props.excludedFields, excludedFields = _b === void 0 ? null : _b, _c = props.fields, fields = _c === void 0 ? null : _c, _d = props.form, form = _d === void 0 ? {} : _d, _e = props.className, className = _e === void 0 ? "" : _e, enableInitApi = props.enableInitApi, initApiRequestAdaptor = props.initApiRequestAdaptor, initApiAdaptor = props.initApiAdaptor, apiRequestAdaptor = props.apiRequestAdaptor, apiAdaptor = props.apiAdaptor, enableTabs = props.enableTabs, tabsMode = props.tabsMode, submitSuccActions = props.submitSuccActions, data = props.data, formDataFilter = props.formDataFilter, onFormDataFilter = props.onFormDataFilter, env = props.env;
|
|
24732
|
+
objectApiName = props.objectApiName || "space_users";
|
|
24733
|
+
schemaKeys = difference(keys($schema), ["id", "form", "type", "mode", "layout", "defaultData", "formDataFilter", "onFormDataFilter", "env"]);
|
|
24734
|
+
formSchema = pick(props, schemaKeys);
|
|
24735
|
+
defaults = {
|
|
24736
|
+
formSchema: Object.assign({}, formSchema, form)
|
|
24737
|
+
};
|
|
24738
|
+
options = {
|
|
24739
|
+
recordId: recordId,
|
|
24740
|
+
mode: mode,
|
|
24741
|
+
layout: layout === 'vertical' ? 'normal' : layout,
|
|
24742
|
+
labelAlign: labelAlign,
|
|
24743
|
+
defaults: defaults,
|
|
24744
|
+
appId: appId,
|
|
24745
|
+
excludedFields: excludedFields,
|
|
24746
|
+
fields: fields
|
|
24747
|
+
};
|
|
24748
|
+
try {
|
|
24749
|
+
options.fieldsExtend = isString(fieldsExtend) ? JSON.parse(fieldsExtend) : fieldsExtend;
|
|
24750
|
+
}
|
|
24751
|
+
catch (error) {
|
|
24752
|
+
console.warn(error);
|
|
24753
|
+
}
|
|
24754
|
+
globalData = props.data.global || {};
|
|
24755
|
+
globalData.mode = mode === 'edit' ? 'edit' : 'read';
|
|
24756
|
+
allData = createObject(data, {});
|
|
24757
|
+
if (!(mode === 'edit')) return [3 /*break*/, 2];
|
|
24758
|
+
if (defaultData) {
|
|
24759
|
+
// 让ObjectForm支持props中的dafaultData属性与上层组件配置的defaultData混合
|
|
24760
|
+
// 为了解决相关表新建时如果是表单类型微页面,因为找不到ObjectForm在哪层而造成无法设置ObjectForm的defaultData的问题
|
|
24761
|
+
allData.defaultData = __assign$2({ "&": "${defaultData}" }, defaultData //这里的defaultData是form组件的defaultData属性值
|
|
24762
|
+
);
|
|
24763
|
+
}
|
|
24764
|
+
return [4 /*yield*/, getFormSchema(objectApiName, Object.assign({}, options, {
|
|
24765
|
+
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
24766
|
+
initApiAdaptor: initApiAdaptor,
|
|
24767
|
+
apiRequestAdaptor: apiRequestAdaptor,
|
|
24768
|
+
apiAdaptor: apiAdaptor,
|
|
24769
|
+
enableTabs: enableTabs,
|
|
24770
|
+
tabsMode: tabsMode,
|
|
24771
|
+
submitSuccActions: submitSuccActions,
|
|
24772
|
+
formDataFilter: formDataFilter,
|
|
24773
|
+
onFormDataFilter: onFormDataFilter,
|
|
24774
|
+
amisData: allData,
|
|
24775
|
+
env: env
|
|
24776
|
+
}))];
|
|
24777
|
+
case 1:
|
|
24778
|
+
schema = _f.sent();
|
|
24779
|
+
amisSchema = schema.amisSchema;
|
|
24780
|
+
uiSchema = schema.uiSchema;
|
|
24781
|
+
return [3 /*break*/, 4];
|
|
24782
|
+
case 2:
|
|
24783
|
+
if (props.$$editor) {
|
|
24784
|
+
options.isEditor = true;
|
|
24785
|
+
}
|
|
24786
|
+
return [4 /*yield*/, getViewSchema(objectApiName, recordId, Object.assign({}, options, {
|
|
24787
|
+
enableInitApi: enableInitApi,
|
|
24788
|
+
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
24789
|
+
initApiAdaptor: initApiAdaptor,
|
|
24790
|
+
enableTabs: enableTabs,
|
|
24791
|
+
tabsMode: tabsMode || "vertical",
|
|
24792
|
+
formDataFilter: formDataFilter,
|
|
24793
|
+
onFormDataFilter: onFormDataFilter,
|
|
24794
|
+
amisData: allData,
|
|
24795
|
+
env: env
|
|
24796
|
+
}))];
|
|
24797
|
+
case 3:
|
|
24798
|
+
schema = _f.sent();
|
|
24799
|
+
amisSchema = schema.amisSchema;
|
|
24800
|
+
uiSchema = schema.uiSchema;
|
|
24801
|
+
_f.label = 4;
|
|
24802
|
+
case 4:
|
|
24803
|
+
formData = {};
|
|
24804
|
+
// formData.recordId = recordId || null;
|
|
24805
|
+
// if(objectApiName){
|
|
24806
|
+
// formData.objectName = objectApiName;
|
|
24807
|
+
// }
|
|
24808
|
+
if (has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
24809
|
+
formData.recordId = props.recordId;
|
|
24810
|
+
}
|
|
24811
|
+
amisSchema.className = "steedos-object-form ".concat(className);
|
|
24812
|
+
// console.log('AmisObjectForm amisSchema======>', amisSchema)
|
|
24813
|
+
amisSchema.data = Object.assign({}, amisSchema.data || {}, formData, { global: globalData, uiSchema: uiSchema });
|
|
24814
|
+
if (has(props, 'objectApiName')) {
|
|
24815
|
+
amisSchema.data.objectName = objectApiName;
|
|
24816
|
+
}
|
|
24817
|
+
return [2 /*return*/, amisSchema];
|
|
24818
|
+
}
|
|
24819
|
+
});
|
|
24820
|
+
}); };
|
|
24821
|
+
|
|
24822
|
+
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24823
|
+
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, className, _c, style, crudClassName, _d, showDisplayAs, sideSchema, _f, filterVisible, headerToolbarItems, rowClassNameExpr, _g, hiddenColumnOperation, columns, crudDataFilter, onCrudDataFilter, env, rebuildOn, crudMode, requestAdaptor, adaptor, headerSchema, ctx, crud, listName, defaults, objectApiName, uiSchema, displayAs, formFactor, isMobile, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, allData, listViewSchemaProps, serviceData;
|
|
24824
|
+
var _h;
|
|
24825
|
+
return __generator(this, function (_j) {
|
|
24826
|
+
switch (_j.label) {
|
|
24827
|
+
case 0:
|
|
24828
|
+
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.className, className = _b === void 0 ? "" : _b, _c = props.style, style = _c === void 0 ? {} : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr, _g = props.hiddenColumnOperation, hiddenColumnOperation = _g === void 0 ? false : _g, columns = props.columns, crudDataFilter = props.crudDataFilter, onCrudDataFilter = props.onCrudDataFilter, env = props.env, rebuildOn = props.rebuildOn, crudMode = props.crudMode, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor;
|
|
24829
|
+
headerSchema = props.headerSchema;
|
|
24830
|
+
ctx = props.ctx;
|
|
24831
|
+
crud = props.crud || {};
|
|
24832
|
+
listName = (defaultData === null || defaultData === void 0 ? void 0 : defaultData.listName) || (data === null || data === void 0 ? void 0 : data.listName) || (props === null || props === void 0 ? void 0 : props.listName);
|
|
24833
|
+
defaults = {};
|
|
24834
|
+
objectApiName = props.objectApiName || "space_users";
|
|
24835
|
+
if (!ctx) {
|
|
24836
|
+
ctx = {};
|
|
24837
|
+
}
|
|
24838
|
+
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
24839
|
+
case 1:
|
|
24840
|
+
uiSchema = _j.sent();
|
|
24841
|
+
displayAs = Router$1.getTabDisplayAs(objectApiName, uiSchema.enable_split);
|
|
24842
|
+
formFactor = props.formFactor;
|
|
24843
|
+
if (!formFactor) {
|
|
24844
|
+
isMobile = window.innerWidth < 768;
|
|
24845
|
+
if (isMobile) {
|
|
24846
|
+
formFactor = 'SMALL';
|
|
24847
|
+
}
|
|
24848
|
+
else {
|
|
24849
|
+
formFactor = 'LARGE';
|
|
24850
|
+
}
|
|
24851
|
+
}
|
|
24852
|
+
// 分栏模式不应该改变尺寸变量值
|
|
24853
|
+
// if(["split"].indexOf(displayAs) > -1){
|
|
24854
|
+
// formFactor = 'SMALL';
|
|
24855
|
+
// }
|
|
24856
|
+
if (!ctx.formFactor) {
|
|
24857
|
+
ctx.formFactor = formFactor;
|
|
24858
|
+
}
|
|
24859
|
+
listView = find(uiSchema.list_views, function (listView, name) {
|
|
24860
|
+
// 传入listViewName空值则取第一个
|
|
24861
|
+
if (!listName) {
|
|
24862
|
+
listName = name;
|
|
24863
|
+
}
|
|
24864
|
+
return name === listName || listView._id === listName;
|
|
24865
|
+
});
|
|
24866
|
+
if (!listView) {
|
|
24867
|
+
return [2 /*return*/, {
|
|
24868
|
+
"type": "alert",
|
|
24869
|
+
"body": "".concat(instance.t('frontend_listview_warning_start')).concat(listName).concat(instance.t('frontend_listview_warning_end')),
|
|
24870
|
+
"level": "warning",
|
|
24871
|
+
"showIcon": true,
|
|
24872
|
+
"className": "mb-3"
|
|
24873
|
+
}];
|
|
24874
|
+
}
|
|
24875
|
+
listName = listView.name;
|
|
24876
|
+
if (crudMode) {
|
|
24877
|
+
// 把crudMode属性传入到crud.mode属性值中
|
|
24878
|
+
// 如果只配置了crudMode属性,则后续内核代码会自动生成对应mode的默认属性值,比如card,listItem
|
|
24879
|
+
// 这样可以省去手动配置crud.card或crud.listItem属性的时间提高开发效率
|
|
24880
|
+
crud = Object.assign({
|
|
24881
|
+
mode: crudMode
|
|
24882
|
+
}, crud);
|
|
24883
|
+
}
|
|
24884
|
+
if (!(ctx && ctx.defaults)) {
|
|
24885
|
+
schemaKeys = difference(keys($schema), ["type", "showHeader", "id",
|
|
24886
|
+
"crud", "crudDataFilter", "onCrudDataFilter", "env", "rebuildOn", "crudMode"]);
|
|
24887
|
+
listSchema = pick(props, schemaKeys);
|
|
24888
|
+
// className不传入crud组件,crud单独识别crudClassName属性
|
|
24889
|
+
listSchema.className = crudClassName;
|
|
24890
|
+
listSchema.onEvent = {}; // 为啥要将一个内置event放在此处?
|
|
24891
|
+
// 下面expression中_isRelated参数判断的是列表视图分栏模式下,新建、编辑、删除相关子表记录时不应该刷新左侧(主表)列表视图组件
|
|
24892
|
+
listSchema.onEvent["@data.changed.".concat(objectApiName)] = {
|
|
24893
|
+
"actions": [
|
|
24894
|
+
{
|
|
24895
|
+
"args": {
|
|
24896
|
+
"link": "/app/${appId}/${objectName}/view/${event.data.result.data.recordId}?side_object=${objectName}&side_listview_id=${listName}",
|
|
24897
|
+
"blank": false
|
|
24898
|
+
},
|
|
24899
|
+
"actionType": "link",
|
|
24900
|
+
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true && event.data._isRelated != true}" //是新建, 则进入详细页面.
|
|
24901
|
+
},
|
|
24902
|
+
{
|
|
24903
|
+
"actionType": "reload",
|
|
24904
|
+
"expression": "${(event.data.recordId || event.data.__deletedRecord === true || event.data.displayAs === 'split') && event.data._isRelated != true}" //不是新建, 或分栏模式下新建主对象记录, 则刷新列表
|
|
24905
|
+
}
|
|
24906
|
+
]
|
|
24907
|
+
};
|
|
24908
|
+
//触发amis crud 高度重算
|
|
24909
|
+
listSchema.onEvent["selectedChange"] = {
|
|
24910
|
+
"actions": [
|
|
24911
|
+
{
|
|
24912
|
+
"actionType": "broadcast",
|
|
24913
|
+
"args": {
|
|
24914
|
+
"eventName": "@height.changed.".concat(objectApiName),
|
|
24915
|
+
},
|
|
24916
|
+
"data": {
|
|
24917
|
+
"timeOut": 500
|
|
24918
|
+
}
|
|
24919
|
+
}
|
|
24920
|
+
]
|
|
24921
|
+
};
|
|
24922
|
+
defaults = {
|
|
24923
|
+
listSchema: Object.assign({}, listSchema, crud)
|
|
24924
|
+
};
|
|
24925
|
+
}
|
|
24926
|
+
setDataToComponentId = ctx && ctx.setDataToComponentId;
|
|
24927
|
+
if (!setDataToComponentId) {
|
|
24928
|
+
setDataToComponentId = "service_listview_".concat(objectApiName);
|
|
24929
|
+
}
|
|
24930
|
+
amisSchemaData = Object.assign({}, data, defaultData);
|
|
24931
|
+
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
24932
|
+
allData = createObject(data, defaultData);
|
|
24933
|
+
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation, columns: columns, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env, requestAdaptor: requestAdaptor, adaptor: adaptor });
|
|
24934
|
+
if (!headerSchema) {
|
|
24935
|
+
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
24936
|
+
}
|
|
24937
|
+
headerSchema.className = "steedos-object-listview-header " + headerSchema.className || "";
|
|
24938
|
+
serviceData = Object.assign({}, { showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName, isObjectListview: true });
|
|
24939
|
+
if (has(props, 'objectApiName')) {
|
|
24940
|
+
serviceData.objectName = objectApiName;
|
|
24941
|
+
}
|
|
24942
|
+
if (has(props, 'listName') && has(props, '$$editor')) {
|
|
24943
|
+
serviceData.listName = listName;
|
|
24944
|
+
}
|
|
24945
|
+
if (!has(data, 'uiSchema')) {
|
|
22378
24946
|
serviceData.uiSchema = uiSchema;
|
|
22379
24947
|
}
|
|
22380
24948
|
serviceData.defaultListName = listName ? listName : (_h = first(values(uiSchema.list_views))) === null || _h === void 0 ? void 0 : _h.name;
|
|
@@ -24273,21 +26841,73 @@ function getLookupLinkOnClick(field, options) {
|
|
|
24273
26841
|
});
|
|
24274
26842
|
});
|
|
24275
26843
|
}
|
|
26844
|
+
function addEditorClass(schema, editorClassName) {
|
|
26845
|
+
if (schema.className && typeof schema.className == 'string') {
|
|
26846
|
+
schema.className += " ".concat(editorClassName);
|
|
26847
|
+
}
|
|
26848
|
+
else if (schema.className && typeof schema.className == 'object') {
|
|
26849
|
+
schema.className[editorClassName] = "true";
|
|
26850
|
+
}
|
|
26851
|
+
else {
|
|
26852
|
+
schema.className = editorClassName;
|
|
26853
|
+
}
|
|
26854
|
+
}
|
|
26855
|
+
function generateRandomString$1(length) {
|
|
26856
|
+
if (length === void 0) { length = 5; }
|
|
26857
|
+
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
26858
|
+
return sampleSize(characters, length).join('');
|
|
26859
|
+
}
|
|
24276
26860
|
var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24277
|
-
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, className, _c, appId, formFactor, lookupATagClick, defaultSource, source, fieldBaseProps, referenceTo_1, fieldValue, fieldRefObject, _d, _e, _f, _g, res, valueOptions_1, fieldValue, values, disPlayValue_1, _h, _j, _k, _l, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, map, tableFields, _m, _o, subField, subFieldName, fieldAmis, schema, error_1;
|
|
26861
|
+
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, className, _c, appId, formFactor, editorClassName, lookupATagClick, defaultSource, source, fieldBaseProps, referenceTo_1, fieldValue, fieldRefObject, _d, _e, _f, _g, res, valueOptions_1, fieldValue, values, disPlayValue_1, _h, _j, _k, _l, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, map, tableFields, _m, _o, subField, subFieldName, fieldAmis, schema, error_1;
|
|
24278
26862
|
var _p, _q, _r, _s, _t, _u, _v, _w, _x, e_1, _y;
|
|
24279
|
-
var _z, _0, _1, _2, _3, _4;
|
|
24280
|
-
return __generator(this, function (
|
|
24281
|
-
switch (
|
|
26863
|
+
var _z, _0, _1, _2, _3, _4, _5;
|
|
26864
|
+
return __generator(this, function (_6) {
|
|
26865
|
+
switch (_6.label) {
|
|
24282
26866
|
case 0:
|
|
26867
|
+
if (has(props, '$$editor')) {
|
|
26868
|
+
setTimeout(function () {
|
|
26869
|
+
var fieldEditDiv = document.getElementsByName(props.id)[0];
|
|
26870
|
+
if (fieldEditDiv) {
|
|
26871
|
+
if (props.config.is_wide) {
|
|
26872
|
+
fieldEditDiv.style.gridColumn = 'span 2 / span 2';
|
|
26873
|
+
}
|
|
26874
|
+
else {
|
|
26875
|
+
fieldEditDiv.style.gridColumn = "";
|
|
26876
|
+
}
|
|
26877
|
+
var amisFieldEditDiv_1 = fieldEditDiv.children[0];
|
|
26878
|
+
//拖动字段后, 也要清理amis字段的编辑属性.
|
|
26879
|
+
setInterval(function () {
|
|
26880
|
+
if (amisFieldEditDiv_1) {
|
|
26881
|
+
amisFieldEditDiv_1.removeAttribute("data-editor-id");
|
|
26882
|
+
amisFieldEditDiv_1.removeAttribute("name");
|
|
26883
|
+
amisFieldEditDiv_1.removeAttribute("data-visible");
|
|
26884
|
+
amisFieldEditDiv_1.removeAttribute("data-hide-text");
|
|
26885
|
+
}
|
|
26886
|
+
}, 200);
|
|
26887
|
+
}
|
|
26888
|
+
}, 200);
|
|
26889
|
+
}
|
|
26890
|
+
if (!props.config) {
|
|
26891
|
+
props.config = {};
|
|
26892
|
+
}
|
|
26893
|
+
if (!props.config.object) {
|
|
26894
|
+
props.config.object = ((_z = props.data) === null || _z === void 0 ? void 0 : _z.objectName) || '';
|
|
26895
|
+
}
|
|
26896
|
+
if (!props.config.name) {
|
|
26897
|
+
props.config.name = "f".concat(generateRandomString$1(5));
|
|
26898
|
+
}
|
|
24283
26899
|
steedosField = null;
|
|
24284
26900
|
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static, env = props.env, inInputTable = props.inInputTable, className = props.className;
|
|
24285
26901
|
_c = props.data || {}, appId = _c.appId, formFactor = _c.formFactor;
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24289
|
-
|
|
24290
|
-
|
|
26902
|
+
editorClassName = "";
|
|
26903
|
+
if (props.$$editor) {
|
|
26904
|
+
if (config.amis) {
|
|
26905
|
+
if (config.amis.name !== config.name) {
|
|
26906
|
+
config.amis.name = config.name;
|
|
26907
|
+
}
|
|
26908
|
+
}
|
|
26909
|
+
editorClassName = "mx-10";
|
|
26910
|
+
}
|
|
24291
26911
|
if (isString(ctx)) {
|
|
24292
26912
|
ctx = JSON.parse(ctx);
|
|
24293
26913
|
}
|
|
@@ -24310,9 +26930,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24310
26930
|
// 字段配置为只读,强制走fStatic模式,加上_display判断是为了不影响历史代码,比如直接在ObjectForm中调用steedos-field组件
|
|
24311
26931
|
fStatic = true;
|
|
24312
26932
|
}
|
|
24313
|
-
|
|
26933
|
+
_6.label = 1;
|
|
24314
26934
|
case 1:
|
|
24315
|
-
|
|
26935
|
+
_6.trys.push([1, 22, , 23]);
|
|
24316
26936
|
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 16];
|
|
24317
26937
|
lookupATagClick = 'onclick="return false;"';
|
|
24318
26938
|
if (window.innerWidth < 768) {
|
|
@@ -24338,14 +26958,14 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24338
26958
|
defaultSource.adaptor = "\n var options = ".concat(JSON.stringify(steedosField.options), "\n if(api.body.$term){\n options = _.filter(options, function(o) {\n var label = o.label;\n return label.toLowerCase().indexOf(api.body.$term.toLowerCase()) > -1;\n });\n }\n if(!payload.data){\n payload.data = {};\n }\n payload.data.options = options;\n return payload;\n ");
|
|
24339
26959
|
}
|
|
24340
26960
|
}
|
|
24341
|
-
source = ((
|
|
26961
|
+
source = ((_0 = steedosField.amis) === null || _0 === void 0 ? void 0 : _0.source) || ((_1 = steedosField.amis) === null || _1 === void 0 ? void 0 : _1.autoComplete) || defaultSource;
|
|
24342
26962
|
fieldBaseProps = {
|
|
24343
26963
|
multiple: steedosField.multiple,
|
|
24344
26964
|
name: steedosField.name,
|
|
24345
26965
|
label: steedosField.label,
|
|
24346
26966
|
static: true,
|
|
24347
26967
|
required: steedosField.required,
|
|
24348
|
-
className: "".concat(className || '', " ").concat(((
|
|
26968
|
+
className: "".concat(className || '', " ").concat(((_2 = steedosField.amis) === null || _2 === void 0 ? void 0 : _2.className) || '')
|
|
24349
26969
|
};
|
|
24350
26970
|
if (!inInputTable) return [3 /*break*/, 2];
|
|
24351
26971
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
@@ -24353,8 +26973,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24353
26973
|
case 2:
|
|
24354
26974
|
referenceTo_1 = steedosField.reference_to;
|
|
24355
26975
|
if (!referenceTo_1) return [3 /*break*/, 14];
|
|
24356
|
-
if (isArray(referenceTo_1)) {
|
|
24357
|
-
fieldValue = (
|
|
26976
|
+
if (isArray$3(referenceTo_1)) {
|
|
26977
|
+
fieldValue = (_3 = props.data) === null || _3 === void 0 ? void 0 : _3[steedosField.name];
|
|
24358
26978
|
if (fieldValue && fieldValue.o) {
|
|
24359
26979
|
referenceTo_1 = fieldValue.o;
|
|
24360
26980
|
}
|
|
@@ -24368,7 +26988,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24368
26988
|
}
|
|
24369
26989
|
return [4 /*yield*/, getUISchema(referenceTo_1)];
|
|
24370
26990
|
case 3:
|
|
24371
|
-
fieldRefObject =
|
|
26991
|
+
fieldRefObject = _6.sent();
|
|
24372
26992
|
if (!(props.data._display && has(props.data._display, steedosField.name))) return [3 /*break*/, 7];
|
|
24373
26993
|
_e = (_d = Object).assign;
|
|
24374
26994
|
_f = [{}, fieldBaseProps];
|
|
@@ -24429,8 +27049,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24429
27049
|
formFactor: formFactor
|
|
24430
27050
|
})];
|
|
24431
27051
|
case 5:
|
|
24432
|
-
_g =
|
|
24433
|
-
|
|
27052
|
+
_g = _6.sent();
|
|
27053
|
+
_6.label = 6;
|
|
24434
27054
|
case 6:
|
|
24435
27055
|
fieldBaseProps = _e.apply(_d, _f.concat([(_p.body = [(_q.body = [
|
|
24436
27056
|
(_r.items = (
|
|
@@ -24449,9 +27069,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24449
27069
|
return [3 /*break*/, 13];
|
|
24450
27070
|
case 7: return [4 /*yield*/, env.fetcher(source, props.data)];
|
|
24451
27071
|
case 8:
|
|
24452
|
-
res =
|
|
24453
|
-
valueOptions_1 = ((
|
|
24454
|
-
fieldValue = (
|
|
27072
|
+
res = _6.sent();
|
|
27073
|
+
valueOptions_1 = ((_4 = res === null || res === void 0 ? void 0 : res.data) === null || _4 === void 0 ? void 0 : _4.options) || [];
|
|
27074
|
+
fieldValue = (_5 = props.data) === null || _5 === void 0 ? void 0 : _5[steedosField.name];
|
|
24455
27075
|
values = fieldValue;
|
|
24456
27076
|
if (isString(values)) {
|
|
24457
27077
|
values = [values];
|
|
@@ -24524,8 +27144,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24524
27144
|
formFactor: formFactor
|
|
24525
27145
|
})];
|
|
24526
27146
|
case 10:
|
|
24527
|
-
_l =
|
|
24528
|
-
|
|
27147
|
+
_l = _6.sent();
|
|
27148
|
+
_6.label = 11;
|
|
24529
27149
|
case 11:
|
|
24530
27150
|
fieldBaseProps = _j.apply(_h, _k.concat([(_t.body = (_u.body = [
|
|
24531
27151
|
(_w.items = (
|
|
@@ -24538,14 +27158,15 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24538
27158
|
return [3 /*break*/, 13];
|
|
24539
27159
|
case 12:
|
|
24540
27160
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'static', tpl: '-', className: "".concat(fieldBaseProps.className || '', " text-muted") });
|
|
24541
|
-
|
|
27161
|
+
_6.label = 13;
|
|
24542
27162
|
case 13: return [3 /*break*/, 15];
|
|
24543
27163
|
case 14:
|
|
24544
27164
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
24545
|
-
|
|
27165
|
+
_6.label = 15;
|
|
24546
27166
|
case 15:
|
|
24547
27167
|
schema = Object.assign({}, fieldBaseProps, pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
|
|
24548
27168
|
schema.placeholder = "";
|
|
27169
|
+
addEditorClass(schema, editorClassName);
|
|
24549
27170
|
// console.log(`steedos field [lookup] schema:`, schema)
|
|
24550
27171
|
return [2 /*return*/, schema];
|
|
24551
27172
|
case 16:
|
|
@@ -24553,7 +27174,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24553
27174
|
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 18];
|
|
24554
27175
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, true, ctx)];
|
|
24555
27176
|
case 17:
|
|
24556
|
-
fieldSchema =
|
|
27177
|
+
fieldSchema = _6.sent();
|
|
24557
27178
|
if (steedosField.type === 'file' && fieldSchema.disabled) {
|
|
24558
27179
|
fieldValue = fieldSchema.value;
|
|
24559
27180
|
if (fieldValue && fieldValue.length) {
|
|
@@ -24592,6 +27213,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24592
27213
|
}];
|
|
24593
27214
|
}
|
|
24594
27215
|
}
|
|
27216
|
+
addEditorClass(fieldSchema, editorClassName);
|
|
24595
27217
|
return [2 /*return*/, fieldSchema];
|
|
24596
27218
|
case 18:
|
|
24597
27219
|
schema = Object.assign({}, steedosField, {
|
|
@@ -24688,7 +27310,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24688
27310
|
});
|
|
24689
27311
|
}
|
|
24690
27312
|
else {
|
|
24691
|
-
if (isArray(value)) {
|
|
27313
|
+
if (isArray$3(value)) {
|
|
24692
27314
|
value = value[0];
|
|
24693
27315
|
}
|
|
24694
27316
|
if (value && value.split("/").length === 1) {
|
|
@@ -24803,6 +27425,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24803
27425
|
});
|
|
24804
27426
|
}
|
|
24805
27427
|
Object.assign(schema, steedosField.amis || {});
|
|
27428
|
+
addEditorClass(schema, editorClassName);
|
|
24806
27429
|
return [2 /*return*/, schema];
|
|
24807
27430
|
case 19:
|
|
24808
27431
|
if (!ctx.className) {
|
|
@@ -24827,7 +27450,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24827
27450
|
});
|
|
24828
27451
|
}
|
|
24829
27452
|
else {
|
|
24830
|
-
if (isArray(value)) {
|
|
27453
|
+
if (isArray$3(value)) {
|
|
24831
27454
|
value = value[0];
|
|
24832
27455
|
}
|
|
24833
27456
|
if (value && value.split("/").length === 1) {
|
|
@@ -24850,7 +27473,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24850
27473
|
});
|
|
24851
27474
|
}
|
|
24852
27475
|
else {
|
|
24853
|
-
if (isArray(value)) {
|
|
27476
|
+
if (isArray$3(value)) {
|
|
24854
27477
|
value = value[0];
|
|
24855
27478
|
}
|
|
24856
27479
|
if (value && value.split("/").length > 1) {
|
|
@@ -24866,12 +27489,13 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24866
27489
|
}
|
|
24867
27490
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
24868
27491
|
case 20:
|
|
24869
|
-
schema =
|
|
27492
|
+
schema = _6.sent();
|
|
27493
|
+
addEditorClass(schema, editorClassName);
|
|
24870
27494
|
// console.log(`AmisSteedosField return schema`, schema)
|
|
24871
27495
|
return [2 /*return*/, schema];
|
|
24872
27496
|
case 21: return [3 /*break*/, 23];
|
|
24873
27497
|
case 22:
|
|
24874
|
-
error_1 =
|
|
27498
|
+
error_1 = _6.sent();
|
|
24875
27499
|
console.log("error", error_1);
|
|
24876
27500
|
return [3 /*break*/, 23];
|
|
24877
27501
|
case 23: return [2 /*return*/, null];
|
|
@@ -25184,6 +27808,120 @@ var AmisRecordDetailMini = function (props) { return __awaiter(void 0, void 0, v
|
|
|
25184
27808
|
});
|
|
25185
27809
|
}); };
|
|
25186
27810
|
|
|
27811
|
+
function generateRandomString(length) {
|
|
27812
|
+
if (length === void 0) { length = 5; }
|
|
27813
|
+
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
27814
|
+
return sampleSize(characters, length).join('');
|
|
27815
|
+
}
|
|
27816
|
+
// 通用函数生成器
|
|
27817
|
+
var createFieldFunction = function (type) {
|
|
27818
|
+
return function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
27819
|
+
var _a;
|
|
27820
|
+
return __generator(this, function (_b) {
|
|
27821
|
+
switch (_b.label) {
|
|
27822
|
+
case 0:
|
|
27823
|
+
if (!props.config) {
|
|
27824
|
+
props.config = {};
|
|
27825
|
+
}
|
|
27826
|
+
if (!props.config.object) {
|
|
27827
|
+
props.config.object = ((_a = props.data) === null || _a === void 0 ? void 0 : _a.objectName) || '';
|
|
27828
|
+
}
|
|
27829
|
+
if (!props.config.name) {
|
|
27830
|
+
props.config.name = "f".concat(generateRandomString(5));
|
|
27831
|
+
}
|
|
27832
|
+
if (has(props, '$$editor')) {
|
|
27833
|
+
// props.config = Object.assign({}, props.config, {label: `${props.config.label}:${props.config.name}`})
|
|
27834
|
+
if (props.config.hidden || props.config.visible_on === '{{false}}') {
|
|
27835
|
+
props.config = Object.assign({}, props.config, { label: "".concat(props.config.label, "(\u9690\u85CF)"), visible_on: null });
|
|
27836
|
+
}
|
|
27837
|
+
}
|
|
27838
|
+
return [4 /*yield*/, AmisSteedosField(props)
|
|
27839
|
+
// {
|
|
27840
|
+
// type: "steedos-field",
|
|
27841
|
+
// config: Object.assign({}, props.config || {}, {
|
|
27842
|
+
// type: type
|
|
27843
|
+
// })
|
|
27844
|
+
// };
|
|
27845
|
+
];
|
|
27846
|
+
case 1: return [2 /*return*/, _b.sent()
|
|
27847
|
+
// {
|
|
27848
|
+
// type: "steedos-field",
|
|
27849
|
+
// config: Object.assign({}, props.config || {}, {
|
|
27850
|
+
// type: type
|
|
27851
|
+
// })
|
|
27852
|
+
// };
|
|
27853
|
+
];
|
|
27854
|
+
}
|
|
27855
|
+
});
|
|
27856
|
+
}); };
|
|
27857
|
+
};
|
|
27858
|
+
// 针对每个字段类型生成函数和元数据
|
|
27859
|
+
var fieldTypes = [
|
|
27860
|
+
{ name: "Text", type: "text", title: "文本", icon: "fa-fw fa fa-list-alt" },
|
|
27861
|
+
{ name: "Textarea", type: "textarea", title: "多行文本", icon: "fa-fw fa fa-list-alt" },
|
|
27862
|
+
{ name: "Html", type: "html", title: "HTML", icon: "fa-fw fa fa-code" },
|
|
27863
|
+
{ name: "Lookup", type: "lookup", title: "查找", icon: "fa-fw fa fa-search" },
|
|
27864
|
+
{ name: "MasterDetail", type: "master_detail", title: "主细节", icon: "fa-fw fa fa-link" },
|
|
27865
|
+
{ name: "Select", type: "select", title: "选择", icon: "fa-fw fa fa-list" },
|
|
27866
|
+
{ name: "Boolean", type: "boolean", title: "布尔", icon: "fa-fw fa fa-check" },
|
|
27867
|
+
{ name: "Date", type: "date", title: "日期", icon: "fa-fw fa fa-calendar" },
|
|
27868
|
+
{ name: "Datetime", type: "datetime", title: "日期时间", icon: "fa-fw fa fa-clock" },
|
|
27869
|
+
{ name: "Time", type: "time", title: "时间", icon: "fa-fw fa fa-clock" },
|
|
27870
|
+
{ name: "Number", type: "number", title: "数字", icon: "fa-fw fa fa-calculator" },
|
|
27871
|
+
{ name: "Currency", type: "currency", title: "货币", icon: "fa-fw fa fa-money" },
|
|
27872
|
+
{ name: "Percent", type: "percent", title: "百分比", icon: "fa-fw fa fa-percent" },
|
|
27873
|
+
{ name: "Image", type: "image", title: "图片", icon: "fa-fw fa fa-image" },
|
|
27874
|
+
{ name: "File", type: "file", title: "文件", icon: "fa-fw fa fa-file" },
|
|
27875
|
+
{ name: "Code", type: "code", title: "代码", icon: "fa-fw fa fa-code" },
|
|
27876
|
+
{ name: "Markdown", type: "markdown", title: "Markdown", icon: "fa-fw fa fa-markdown" },
|
|
27877
|
+
{ name: "Color", type: "color", title: "颜色", icon: "fa-fw fa fa-palette" },
|
|
27878
|
+
{ name: "Toggle", type: "toggle", title: "切换", icon: "fa-fw fa fa-toggle-on" },
|
|
27879
|
+
{ name: "Password", type: "password", title: "密码", icon: "fa-fw fa fa-key" },
|
|
27880
|
+
{ name: "Autonumber", type: "autonumber", title: "自动编号", icon: "fa-fw fa fa-hashtag" },
|
|
27881
|
+
{ name: "Url", type: "url", title: "URL", icon: "fa-fw fa fa-link" },
|
|
27882
|
+
{ name: "Email", type: "email", title: "电子邮件", icon: "fa-fw fa fa-envelope" },
|
|
27883
|
+
{ name: "Location", type: "location", title: "位置", icon: "fa-fw fa fa-map-marker" },
|
|
27884
|
+
{ name: "Formula", type: "formula", title: "公式", icon: "fa-fw fa fa-sigma" },
|
|
27885
|
+
{ name: "Summary", type: "summary", title: "累计汇总", icon: "fa-fw fa fa-sum" }
|
|
27886
|
+
];
|
|
27887
|
+
// 生成每个字段类型的函数
|
|
27888
|
+
var generatedFunctions = fieldTypes.reduce(function (acc, _a) {
|
|
27889
|
+
var name = _a.name; _a.type;
|
|
27890
|
+
acc["SteedosField".concat(name)] = createFieldFunction();
|
|
27891
|
+
return acc;
|
|
27892
|
+
}, {});
|
|
27893
|
+
// 导出所有生成的函数
|
|
27894
|
+
var SteedosFieldText = generatedFunctions.SteedosFieldText, SteedosFieldTextarea = generatedFunctions.SteedosFieldTextarea, SteedosFieldHtml = generatedFunctions.SteedosFieldHtml, SteedosFieldLookup = generatedFunctions.SteedosFieldLookup, SteedosFieldMasterDetail = generatedFunctions.SteedosFieldMasterDetail, SteedosFieldSelect = generatedFunctions.SteedosFieldSelect, SteedosFieldBoolean = generatedFunctions.SteedosFieldBoolean, SteedosFieldDate = generatedFunctions.SteedosFieldDate, SteedosFieldDatetime = generatedFunctions.SteedosFieldDatetime, SteedosFieldTime = generatedFunctions.SteedosFieldTime, SteedosFieldNumber = generatedFunctions.SteedosFieldNumber, SteedosFieldCurrency = generatedFunctions.SteedosFieldCurrency, SteedosFieldPercent = generatedFunctions.SteedosFieldPercent, SteedosFieldImage = generatedFunctions.SteedosFieldImage, SteedosFieldFile = generatedFunctions.SteedosFieldFile, SteedosFieldCode = generatedFunctions.SteedosFieldCode, SteedosFieldMarkdown = generatedFunctions.SteedosFieldMarkdown, SteedosFieldColor = generatedFunctions.SteedosFieldColor, SteedosFieldToggle = generatedFunctions.SteedosFieldToggle, SteedosFieldPassword = generatedFunctions.SteedosFieldPassword, SteedosFieldAutonumber = generatedFunctions.SteedosFieldAutonumber, SteedosFieldUrl = generatedFunctions.SteedosFieldUrl, SteedosFieldEmail = generatedFunctions.SteedosFieldEmail, SteedosFieldLocation = generatedFunctions.SteedosFieldLocation, SteedosFieldFormula = generatedFunctions.SteedosFieldFormula, SteedosFieldSummary = generatedFunctions.SteedosFieldSummary;
|
|
27895
|
+
|
|
27896
|
+
var AmisSteedosFieldGroup = function (props) {
|
|
27897
|
+
if (props === void 0) { props = { title: null, body: null }; }
|
|
27898
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
27899
|
+
var _a;
|
|
27900
|
+
return __generator(this, function (_b) {
|
|
27901
|
+
console.log("props===>", props);
|
|
27902
|
+
return [2 /*return*/, {
|
|
27903
|
+
type: "fieldSet",
|
|
27904
|
+
title: props.title || "分组",
|
|
27905
|
+
collapsable: true,
|
|
27906
|
+
body: ((_a = props.body) === null || _a === void 0 ? void 0 : _a.length) > 0 ? props.body : [{ type: 'sfield-text', "label": '文本', amis: {} }]
|
|
27907
|
+
}];
|
|
27908
|
+
});
|
|
27909
|
+
});
|
|
27910
|
+
};
|
|
27911
|
+
|
|
27912
|
+
var AmisSteedosObject = function (props) {
|
|
27913
|
+
if (props === void 0) { props = { className: null, body: null }; }
|
|
27914
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
27915
|
+
return __generator(this, function (_a) {
|
|
27916
|
+
return [2 /*return*/, {
|
|
27917
|
+
type: "container",
|
|
27918
|
+
className: props.className,
|
|
27919
|
+
body: props.body || []
|
|
27920
|
+
}];
|
|
27921
|
+
});
|
|
27922
|
+
});
|
|
27923
|
+
};
|
|
27924
|
+
|
|
25187
27925
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
25188
27926
|
var formFactor, appId, objectApiName, display, data, _display, page, listSchema;
|
|
25189
27927
|
return __generator(this, function (_b) {
|
|
@@ -25378,7 +28116,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
25378
28116
|
});
|
|
25379
28117
|
}); };
|
|
25380
28118
|
|
|
25381
|
-
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var a=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){a=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(a={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),a}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=useState(!0);var n=()=>{r(!1);};return has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React.createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React.createElement(newFunctionComponent(n),e);createRoot(t).render(e);},Modal=assign(newComponentRender("modal",Modal$1),{info:Modal$1.info,success:Modal$1.success,error:Modal$1.error,warning:Modal$1.warning,confirm:Modal$1.confirm}),Drawer=newComponentRender("drawer",Drawer$1),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,r)=>{e=e.replace(/\./g,"_");r=getGraphqlFieldsQuery(r);let n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:r}){return `/app/${e}/${t}/grid/`+r},getObjectDetailPath({appId:e,objectName:t,recordId:r}){return `/app/${e}/${t}/view/`+r},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:r,objectName:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=createElement(e,__assign({},t));return ReactDOM.render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var a=window.Creator;if(!!(!a||!a.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return isNil(r)||(e=isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),n=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return n.set("year",1970),n.set("month",0),n.set("date",1),n.set("hours",n.hours()+n.utcOffset()/60),n.set("seconds",0),n.set("milliseconds",0),n=n.toDate(),{now:e,today:r,timeNow:n}},parseSingleExpression=function(t,e,r,n){var o,a;if(n&&Object.assign(n,getGlobalNowData()),a=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{},"string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(a));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);switch(n&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||n||e.multiple||("text"!==o||isString(r)?"number"===o&&isString(r)?r=Number(r):"boolean"===o&&isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":isString(r)&&(r=Number(r));break;case"boolean":isString(r)?r="true"===r.toLowerCase()||"1"===r:isBoolean(r)||(r=!1);break;case"time":if(isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],a=(e,t,r,n)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=a(e,t,e.children,n-1))):e.children&&(e.children=a(e,t,e.children,n));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][o]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:a(e,t,e.children,r-1)}))):n.push(Object.assign({},e,{children:a(e,t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let a=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(a)return a;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(a=getClosestAmisComponentByType(t.children[e],r,n));e++);return a}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:message,notification:notification,components:{Button:Button,Space:Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var a;return e&&t&&(a=e.split(/\s+/),a=compact(a),t.forEach(function(r,e){let n=[];1==a.length?n=[r,"contains",a[0]]:a.forEach(function(e,t){n.push([r,"contains",e]),t<a.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o},getFormulaVariables:(e,t=!0)=>{const r=[];return isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r}});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
28119
|
+
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var a=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){a=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(a={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),a}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=useState(!0);var n=()=>{r(!1);};return has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React.createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React.createElement(newFunctionComponent(n),e);createRoot(t).render(e);},Modal=assign(newComponentRender("modal",Modal$1),{info:Modal$1.info,success:Modal$1.success,error:Modal$1.error,warning:Modal$1.warning,confirm:Modal$1.confirm}),Drawer=newComponentRender("drawer",Drawer$1),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,r)=>{e=e.replace(/\./g,"_");r=getGraphqlFieldsQuery(r);let n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:r}){return `/app/${e}/${t}/grid/`+r},getObjectDetailPath({appId:e,objectName:t,recordId:r}){return `/app/${e}/${t}/view/`+r},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:r,objectName:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=createElement(e,__assign({},t));return ReactDOM.render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var a=window.Creator;if(!!(!a||!a.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return isNil(r)||(e=isArray$3(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),n=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return n.set("year",1970),n.set("month",0),n.set("date",1),n.set("hours",n.hours()+n.utcOffset()/60),n.set("seconds",0),n.set("milliseconds",0),n=n.toDate(),{now:e,today:r,timeNow:n}},parseSingleExpression=function(t,e,r,n){var o,a;if(n&&Object.assign(n,getGlobalNowData()),a=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{},"string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(a));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),isFunction$4(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);switch(n&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||n||e.multiple||("text"!==o||isString(r)?"number"===o&&isString(r)?r=Number(r):"boolean"===o&&isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":isString(r)&&(r=Number(r));break;case"boolean":isString(r)?r="true"===r.toLowerCase()||"1"===r:isBoolean(r)||(r=!1);break;case"time":if(isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],a=(e,t,r,n)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=a(e,t,e.children,n-1))):e.children&&(e.children=a(e,t,e.children,n));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][o]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:a(e,t,e.children,r-1)}))):n.push(Object.assign({},e,{children:a(e,t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let a=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(a)return a;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(a=getClosestAmisComponentByType(t.children[e],r,n));e++);return a}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:message,notification:notification,components:{Button:Button,Space:Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var a;return e&&t&&(a=e.split(/\s+/),a=compact(a),t.forEach(function(r,e){let n=[];1==a.length?n=[r,"contains",a[0]]:a.forEach(function(e,t){n.push([r,"contains",e]),t<a.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o},getFormulaVariables:(e,t=!0)=>{const r=[];return isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r}});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
25382
28120
|
|
|
25383
28121
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
25384
28122
|
__proto__: null,
|
|
@@ -25386,5 +28124,5 @@ var index_esm = /*#__PURE__*/Object.freeze({
|
|
|
25386
28124
|
SteedosUI: SteedosUI$1
|
|
25387
28125
|
});
|
|
25388
28126
|
|
|
25389
|
-
export { AmisAppLauncher, AmisAppMenu, AmisGlobalFooter, AmisGlobalHeader, AmisGlobalHeaderToolbar, AmisInputTable, AmisInstanceDetail, index_esm$1 as AmisLib, AmisLogo, AmisObjectButton, AmisObjectCalendar, AmisObjectFieldLookup, AmisObjectForm, AmisObjectListView, AmisObjectTable, AmisProvider, AmisRecordDetail, AmisRecordDetailHeader, AmisRecordDetailMini, AmisRecordDetailRelatedList, AmisRecordDetailRelatedLists, AmisRecordService, AmisSelectFlow, AmisSelectUser, AmisSteedosField, FromNow, PageListView, PageObject, PageRecordDetail, SteedosBadge, SteedosBadgeRibbon, SteedosDropdown, SteedosDropdownButton, SteedosIcon, index_esm as SteedosLib, SteedosLoading, SteedosSkeleton };
|
|
28127
|
+
export { AmisAppLauncher, AmisAppMenu, AmisGlobalFooter, AmisGlobalHeader, AmisGlobalHeaderToolbar, AmisInputTable, AmisInstanceDetail, index_esm$1 as AmisLib, AmisLogo, AmisObjectButton, AmisObjectCalendar, AmisObjectFieldLookup, AmisObjectForm, AmisObjectListView, AmisObjectTable, AmisProvider, AmisRecordDetail, AmisRecordDetailHeader, AmisRecordDetailMini, AmisRecordDetailRelatedList, AmisRecordDetailRelatedLists, AmisRecordService, AmisSelectFlow, AmisSelectUser, AmisSteedosField, AmisSteedosFieldGroup, AmisSteedosObject, FromNow, PageListView, PageObject, PageRecordDetail, SteedosBadge, SteedosBadgeRibbon, SteedosDropdown, SteedosDropdownButton, SteedosFieldAutonumber, SteedosFieldBoolean, SteedosFieldCode, SteedosFieldColor, SteedosFieldCurrency, SteedosFieldDate, SteedosFieldDatetime, SteedosFieldEmail, SteedosFieldFile, SteedosFieldFormula, SteedosFieldHtml, SteedosFieldImage, SteedosFieldLocation, SteedosFieldLookup, SteedosFieldMarkdown, SteedosFieldMasterDetail, SteedosFieldNumber, SteedosFieldPassword, SteedosFieldPercent, SteedosFieldSelect, SteedosFieldSet, SteedosFieldSummary, SteedosFieldText, SteedosFieldTextarea, SteedosFieldTime, SteedosFieldToggle, SteedosFieldUrl, SteedosIcon, index_esm as SteedosLib, SteedosLoading, SteedosObject, SteedosSkeleton };
|
|
25390
28128
|
//# sourceMappingURL=amis-object.esm.js.map
|