@vortex-ui/env-puzzle 2.0.0-beta.9 → 3.0.0-beta.1
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/README.md +46 -46
- package/lib/b-map/b-map.d.ts +1 -1
- package/lib/b-map/b-map.js +100 -162
- package/lib/b-map/b-map.js.map +1 -1
- package/lib/b-map/custom-overlay.js +17 -37
- package/lib/b-map/custom-overlay.js.map +1 -1
- package/lib/b-map/drawing.js +11 -25
- package/lib/b-map/drawing.js.map +1 -1
- package/lib/b-map/index.d.ts +2 -2
- package/lib/b-map/index.js +4 -16
- package/lib/b-map/index.js.map +1 -1
- package/lib/b-map/js/marker-clusterer.js +223 -339
- package/lib/b-map/js/marker-clusterer.js.map +1 -1
- package/lib/b-map/lushu.js +17 -36
- package/lib/b-map/lushu.js.map +1 -1
- package/lib/b-map/marker-clusterer.js +6 -14
- package/lib/b-map/marker-clusterer.js.map +1 -1
- package/lib/b-map/marker.js +32 -70
- package/lib/b-map/marker.js.map +1 -1
- package/lib/b-map/polygon.js +5 -13
- package/lib/b-map/polygon.js.map +1 -1
- package/lib/b-map/style/css.js.map +1 -1
- package/lib/b-map/style/index.js.map +1 -1
- package/lib/b-map/style/index.less +10 -10
- package/lib/create-modal/create-modal.js +150 -288
- package/lib/create-modal/create-modal.js.map +1 -1
- package/lib/create-modal/index.d.ts +1 -2
- package/lib/create-modal/index.js +2 -8
- package/lib/create-modal/index.js.map +1 -1
- package/lib/create-modal/style/css.js +0 -18
- package/lib/create-modal/style/css.js.map +1 -1
- package/lib/create-modal/style/index.css +2 -2
- package/lib/create-modal/style/index.d.ts +0 -9
- package/lib/create-modal/style/index.js +0 -18
- package/lib/create-modal/style/index.js.map +1 -1
- package/lib/create-modal/style/index.less +116 -119
- package/lib/global.less +5 -6
- package/lib/import-modal/import-modal.d.ts +2 -0
- package/lib/import-modal/import-modal.js +133 -192
- package/lib/import-modal/import-modal.js.map +1 -1
- package/lib/import-modal/index.js +2 -6
- package/lib/import-modal/index.js.map +1 -1
- package/lib/import-modal/style/css.js +0 -10
- package/lib/import-modal/style/css.js.map +1 -1
- package/lib/import-modal/style/index.d.ts +0 -5
- package/lib/import-modal/style/index.js +0 -10
- package/lib/import-modal/style/index.js.map +1 -1
- package/lib/import-modal/style/index.less +14 -15
- package/lib/index.js +1 -14
- package/lib/index.js.map +1 -1
- package/lib/interface/index.js.map +1 -1
- package/lib/mapv-Layer/Function.js +0 -2
- package/lib/mapv-Layer/Function.js.map +1 -1
- package/lib/mapv-Layer/index.js +2 -6
- package/lib/mapv-Layer/index.js.map +1 -1
- package/lib/mapv-Layer/mapv-Layer.js +19 -40
- package/lib/mapv-Layer/mapv-Layer.js.map +1 -1
- package/lib/mapv-Layer/style/css.js.map +1 -1
- package/lib/mapv-Layer/style/index.js.map +1 -1
- package/lib/percent/index.d.ts +1 -1
- package/lib/percent/index.js +2 -7
- package/lib/percent/index.js.map +1 -1
- package/lib/percent/interface.js.map +1 -1
- package/lib/percent/line-percent.js +20 -37
- package/lib/percent/line-percent.js.map +1 -1
- package/lib/percent/percent.js +20 -43
- package/lib/percent/percent.js.map +1 -1
- package/lib/percent/style/css.js.map +1 -1
- package/lib/percent/style/index.js.map +1 -1
- package/lib/percent/style/index.less +41 -41
- package/lib/scroll/index.js +2 -6
- package/lib/scroll/index.js.map +1 -1
- package/lib/scroll/scroll.d.ts +1 -1
- package/lib/scroll/scroll.js +19 -47
- package/lib/scroll/scroll.js.map +1 -1
- package/lib/scroll/style/css.js.map +1 -1
- package/lib/scroll/style/index.js.map +1 -1
- package/lib/scroll/style/index.less +3 -3
- package/lib/scroll-select/index.js +2 -6
- package/lib/scroll-select/index.js.map +1 -1
- package/lib/scroll-select/scrollSelect.d.ts +2 -1
- package/lib/scroll-select/scrollSelect.js +141 -215
- package/lib/scroll-select/scrollSelect.js.map +1 -1
- package/lib/scroll-select/style/css.js +0 -2
- package/lib/scroll-select/style/css.js.map +1 -1
- package/lib/scroll-select/style/index.d.ts +0 -1
- package/lib/scroll-select/style/index.js +0 -2
- package/lib/scroll-select/style/index.js.map +1 -1
- package/lib/scroll-select/style/index.less +7 -7
- package/lib/style/color.less +1 -1
- package/lib/table/index.js +2 -6
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/css.js +0 -2
- package/lib/table/style/css.js.map +1 -1
- package/lib/table/style/index.d.ts +0 -1
- package/lib/table/style/index.js +0 -2
- package/lib/table/style/index.js.map +1 -1
- package/lib/table/table.js +22 -54
- package/lib/table/table.js.map +1 -1
- package/lib/template/action.d.ts +3 -1
- package/lib/template/action.js +80 -116
- package/lib/template/action.js.map +1 -1
- package/lib/template/card-table.d.ts +4 -4
- package/lib/template/card-table.js +40 -82
- package/lib/template/card-table.js.map +1 -1
- package/lib/template/card.d.ts +1 -1
- package/lib/template/card.js +20 -38
- package/lib/template/card.js.map +1 -1
- package/lib/template/check-row.d.ts +2 -1
- package/lib/template/check-row.js +7 -12
- package/lib/template/check-row.js.map +1 -1
- package/lib/template/field.js +8 -24
- package/lib/template/field.js.map +1 -1
- package/lib/template/filter.d.ts +0 -1
- package/lib/template/filter.js +25 -63
- package/lib/template/filter.js.map +1 -1
- package/lib/template/icon.js +4 -15
- package/lib/template/icon.js.map +1 -1
- package/lib/template/index.d.ts +2 -3
- package/lib/template/index.js +4 -12
- package/lib/template/index.js.map +1 -1
- package/lib/template/interface.js.map +1 -1
- package/lib/template/renderColumnButtons.js +64 -95
- package/lib/template/renderColumnButtons.js.map +1 -1
- package/lib/template/style/action.css +3 -2
- package/lib/template/style/action.less +74 -71
- package/lib/template/style/card.css +2 -2
- package/lib/template/style/card.less +87 -88
- package/lib/template/style/check-row.less +27 -27
- package/lib/template/style/css.js +0 -36
- package/lib/template/style/css.js.map +1 -1
- package/lib/template/style/field.less +11 -11
- package/lib/template/style/filter.css +0 -29
- package/lib/template/style/filter.less +46 -72
- package/lib/template/style/icon.less +7 -7
- package/lib/template/style/index.css +8 -42
- package/lib/template/style/index.d.ts +0 -18
- package/lib/template/style/index.js +0 -36
- package/lib/template/style/index.js.map +1 -1
- package/lib/template/style/index.less +48 -49
- package/lib/template/style/table.css +0 -6
- package/lib/template/style/table.less +79 -91
- package/lib/template/table.d.ts +5 -4
- package/lib/template/table.js +21 -43
- package/lib/template/table.js.map +1 -1
- package/lib/template/template.d.ts +3 -3
- package/lib/template/template.js +134 -258
- package/lib/template/template.js.map +1 -1
- package/lib/template/toolbar.d.ts +1 -1
- package/lib/template/toolbar.js +52 -56
- package/lib/template/toolbar.js.map +1 -1
- package/lib/to-map/container.js +48 -95
- package/lib/to-map/container.js.map +1 -1
- package/lib/to-map/draw-area.js +12 -32
- package/lib/to-map/draw-area.js.map +1 -1
- package/lib/to-map/index.d.ts +1 -1
- package/lib/to-map/index.js +2 -7
- package/lib/to-map/index.js.map +1 -1
- package/lib/to-map/style/css.js +0 -2
- package/lib/to-map/style/css.js.map +1 -1
- package/lib/to-map/style/index.d.ts +0 -1
- package/lib/to-map/style/index.js +0 -2
- package/lib/to-map/style/index.js.map +1 -1
- package/lib/to-map/style/index.less +86 -86
- package/lib/to-map/to-map.js +20 -47
- package/lib/to-map/to-map.js.map +1 -1
- package/lib/upload/index.js +2 -6
- package/lib/upload/index.js.map +1 -1
- package/lib/upload/style/css.js +0 -5
- package/lib/upload/style/css.js.map +1 -1
- package/lib/upload/style/index.d.ts +0 -2
- package/lib/upload/style/index.js +0 -5
- package/lib/upload/style/index.js.map +1 -1
- package/lib/upload/upload.d.ts +3 -0
- package/lib/upload/upload.js +158 -237
- package/lib/upload/upload.js.map +1 -1
- package/lib/use-simple-res/demos/index.d.ts +2 -1
- package/lib/use-simple-res/demos/index.js +31 -59
- package/lib/use-simple-res/demos/index.js.map +1 -1
- package/lib/use-simple-res/index.js +60 -73
- package/lib/use-simple-res/index.js.map +1 -1
- package/lib/use-simple-res/style/css.js.map +1 -1
- package/lib/use-simple-res/style/index.js.map +1 -1
- package/lib/utils/dom-util.js +8 -27
- package/lib/utils/dom-util.js.map +1 -1
- package/lib/utils/request-util.d.ts +10 -1
- package/lib/utils/request-util.js +170 -45
- package/lib/utils/request-util.js.map +1 -1
- package/lib/utils/string-util.d.ts +2 -0
- package/lib/utils/string-util.js +34 -16
- package/lib/utils/string-util.js.map +1 -1
- package/lib/view-modal/index.d.ts +0 -1
- package/lib/view-modal/index.js +2 -8
- package/lib/view-modal/index.js.map +1 -1
- package/lib/view-modal/style/css.js +0 -12
- package/lib/view-modal/style/css.js.map +1 -1
- package/lib/view-modal/style/index.css +3 -41
- package/lib/view-modal/style/index.d.ts +0 -7
- package/lib/view-modal/style/index.js +0 -12
- package/lib/view-modal/style/index.js.map +1 -1
- package/lib/view-modal/style/index.less +42 -57
- package/lib/view-modal/view-modal.js +28 -75
- package/lib/view-modal/view-modal.js.map +1 -1
- package/package.json +157 -143
- package/lib/style/css.js +0 -13
- package/lib/style/css.js.map +0 -1
- package/lib/style/darkGreen.css +0 -719
- package/lib/style/darkGreen.less +0 -482
- package/lib/style/index.d.ts +0 -2
- package/lib/style/index.js +0 -13
- package/lib/style/index.js.map +0 -1
- package/lib/template/vtx-search/index.d.ts +0 -2
- package/lib/template/vtx-search/index.js +0 -126
- package/lib/template/vtx-search/index.js.map +0 -1
- package/lib/template/vtx-search/style/index.css +0 -92
- package/lib/template/vtx-search/style/index.less +0 -92
|
@@ -1,73 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.renderFieldItem = exports["default"] = void 0;
|
|
9
|
-
|
|
10
7
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
11
|
-
|
|
12
8
|
var _message = _interopRequireDefault(require("antd/lib/message"));
|
|
13
|
-
|
|
14
9
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
15
|
-
|
|
16
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
11
|
var _col = _interopRequireDefault(require("antd/lib/col"));
|
|
19
|
-
|
|
20
12
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
21
|
-
|
|
22
13
|
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
23
|
-
|
|
24
14
|
var _inputNumber = _interopRequireDefault(require("antd/lib/input-number"));
|
|
25
|
-
|
|
26
15
|
var _vtxFormLayout = _interopRequireDefault(require("@vtx/components/lib/vtx-form-layout"));
|
|
27
|
-
|
|
28
16
|
var _vtxModal = _interopRequireDefault(require("@vtx/components/lib/vtx-modal"));
|
|
29
|
-
|
|
30
17
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
|
-
|
|
40
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
41
|
-
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
42
21
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
49
|
-
|
|
50
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
51
|
-
|
|
22
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
25
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
26
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
52
27
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
63
|
-
|
|
28
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
29
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
30
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
31
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
33
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
64
36
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
65
37
|
function adopt(value) {
|
|
66
38
|
return value instanceof P ? value : new P(function (resolve) {
|
|
67
39
|
resolve(value);
|
|
68
40
|
});
|
|
69
41
|
}
|
|
70
|
-
|
|
71
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
72
43
|
function fulfilled(value) {
|
|
73
44
|
try {
|
|
@@ -76,7 +47,6 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
76
47
|
reject(e);
|
|
77
48
|
}
|
|
78
49
|
}
|
|
79
|
-
|
|
80
50
|
function rejected(value) {
|
|
81
51
|
try {
|
|
82
52
|
step(generator["throw"](value));
|
|
@@ -84,89 +54,67 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
84
54
|
reject(e);
|
|
85
55
|
}
|
|
86
56
|
}
|
|
87
|
-
|
|
88
57
|
function step(result) {
|
|
89
58
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
90
59
|
}
|
|
91
|
-
|
|
92
60
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
93
61
|
});
|
|
94
62
|
};
|
|
95
|
-
|
|
96
63
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
97
64
|
var t = {};
|
|
98
|
-
|
|
99
|
-
for (var p in s) {
|
|
100
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
101
|
-
}
|
|
102
|
-
|
|
65
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
103
66
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
104
67
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
105
68
|
}
|
|
106
69
|
return t;
|
|
107
70
|
};
|
|
108
|
-
|
|
109
|
-
var
|
|
110
|
-
|
|
111
|
-
var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel, viewMode) {
|
|
112
|
-
var hasChildrenWithKeyProp = false; // 处理数组的方式传入的值
|
|
113
|
-
|
|
71
|
+
var _renderFieldItem = exports.renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel, viewMode) {
|
|
72
|
+
var hasChildrenWithKeyProp = false;
|
|
73
|
+
// 处理数组的方式传入的值
|
|
114
74
|
var hasReactDOMWithKeyProp = false;
|
|
115
|
-
|
|
116
75
|
_react["default"].Children.forEach(reactNode, function (child, index) {
|
|
117
76
|
if ((child === null || child === void 0 ? void 0 : child.key) && child) {
|
|
118
|
-
if (
|
|
77
|
+
if (/*#__PURE__*/_react["default"].isValidElement(child.props.children)) {
|
|
119
78
|
hasChildrenWithKeyProp = true;
|
|
120
79
|
} else {
|
|
121
80
|
hasReactDOMWithKeyProp = true;
|
|
122
81
|
}
|
|
123
82
|
}
|
|
124
83
|
});
|
|
125
|
-
|
|
126
84
|
if (hasReactDOMWithKeyProp) {
|
|
127
85
|
if (Array.isArray(reactNode)) {
|
|
128
86
|
var resultArray = [];
|
|
129
87
|
reactNode.forEach(function (item) {
|
|
130
|
-
resultArray.push(
|
|
88
|
+
resultArray.push(/*#__PURE__*/_react["default"].cloneElement(item, {}, _renderFieldItem(item)));
|
|
131
89
|
});
|
|
132
90
|
}
|
|
133
91
|
}
|
|
134
|
-
|
|
135
92
|
if (hasChildrenWithKeyProp) {
|
|
136
93
|
if (Array.isArray(reactNode)) {
|
|
137
94
|
var _resultArray = [];
|
|
138
95
|
reactNode.forEach(function (item) {
|
|
139
|
-
_resultArray.push(
|
|
96
|
+
_resultArray.push(/*#__PURE__*/_react["default"].cloneElement(item, {}, _renderFieldItem(item.props.children)));
|
|
140
97
|
});
|
|
141
98
|
return _resultArray;
|
|
142
99
|
} else {
|
|
143
100
|
var node = reactNode;
|
|
144
|
-
|
|
145
|
-
var result = /*#__PURE__*/_react["default"].cloneElement(node, {}, renderFieldItem(node.props.children));
|
|
146
|
-
|
|
101
|
+
var result = /*#__PURE__*/_react["default"].cloneElement(node, {}, _renderFieldItem(node.props.children));
|
|
147
102
|
return result;
|
|
148
103
|
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
104
|
+
}
|
|
105
|
+
// child: : React.ReactNode 但是有个type类型
|
|
152
106
|
return _react["default"].Children.map(reactNode, function (child, index) {
|
|
153
|
-
var _classnames;
|
|
154
|
-
|
|
155
107
|
var _a, _b, _c;
|
|
156
|
-
|
|
157
108
|
if (child === null || typeof child === 'string' || typeof child === 'boolean' || typeof child === 'number') {
|
|
158
|
-
return
|
|
159
|
-
className: 'text-node'
|
|
160
|
-
}, child);
|
|
109
|
+
return child;
|
|
161
110
|
}
|
|
162
|
-
|
|
163
111
|
var _child = child,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
var displayName = (_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
167
|
-
|
|
168
|
-
var title = props['data-title'];
|
|
169
|
-
|
|
112
|
+
props = _child.props,
|
|
113
|
+
type = _child.type;
|
|
114
|
+
var displayName = (_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
115
|
+
// 标题组件用到的props
|
|
116
|
+
var title = props['data-title'];
|
|
117
|
+
// 没有 label 也没有 name, 视为默认元素
|
|
170
118
|
if (title) {
|
|
171
119
|
return /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
172
120
|
key: title,
|
|
@@ -174,78 +122,60 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
174
122
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
175
123
|
className: "env-create-modal-title"
|
|
176
124
|
}, title));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
125
|
+
}
|
|
126
|
+
// 传入样式处理
|
|
180
127
|
var style = props['data-style'];
|
|
181
|
-
var className = props['data-class'];
|
|
182
|
-
|
|
128
|
+
var className = props['data-class'];
|
|
129
|
+
// 表单组件用到的props
|
|
183
130
|
var required = props['data-required'];
|
|
184
131
|
var label = props['data-label'];
|
|
185
132
|
var name = props['data-name'];
|
|
186
|
-
var weights = props['data-weights'];
|
|
187
|
-
|
|
133
|
+
var weights = props['data-weights'];
|
|
188
134
|
var rules = props['data-rules'] || [];
|
|
189
135
|
var labelAfter = props['data-label-after'];
|
|
190
136
|
var mode = props['v-mode']; // 获取是编辑模式还是只读模式
|
|
191
|
-
|
|
192
137
|
var viewName = (props === null || props === void 0 ? void 0 : props['v-name']) ? props === null || props === void 0 ? void 0 : props['v-name'] : name;
|
|
193
|
-
var tooltip = props === null || props === void 0 ? void 0 : props['data-tooltip'];
|
|
138
|
+
var tooltip = props === null || props === void 0 ? void 0 : props['data-tooltip'];
|
|
139
|
+
// 获取所有的
|
|
194
140
|
// 自定义列 默认为24
|
|
195
|
-
|
|
196
141
|
var fromItemProps = {};
|
|
197
142
|
var fromElementProps = {};
|
|
198
|
-
|
|
199
143
|
for (var i in props) {
|
|
200
144
|
if (i.includes('data-')) {
|
|
201
145
|
var _result = i.replace('data-', '');
|
|
202
|
-
|
|
203
146
|
var arr = _result.split('-').map(function (item, index) {
|
|
204
147
|
if (index !== 0) {
|
|
205
148
|
return item.charAt(0).toLocaleUpperCase() + item.slice(1);
|
|
206
149
|
}
|
|
207
|
-
|
|
208
150
|
return item;
|
|
209
151
|
});
|
|
210
|
-
|
|
211
152
|
switch (_result) {
|
|
212
153
|
case 'span':
|
|
213
154
|
break;
|
|
214
|
-
|
|
215
155
|
case 'style':
|
|
216
156
|
break;
|
|
217
|
-
|
|
218
157
|
case 'label-after':
|
|
219
158
|
break;
|
|
220
|
-
|
|
221
159
|
case 'class':
|
|
222
160
|
break;
|
|
223
|
-
|
|
224
161
|
case 'required':
|
|
225
162
|
break;
|
|
226
|
-
|
|
227
163
|
default:
|
|
228
164
|
fromItemProps[arr.join('')] = props[i];
|
|
229
165
|
break;
|
|
230
166
|
}
|
|
231
|
-
|
|
232
167
|
fromElementProps[i] = undefined;
|
|
233
168
|
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
169
|
+
}
|
|
170
|
+
// 不设置 `data-label` 和 `data-name` 则视为自定义字段
|
|
237
171
|
if (!label && !name) {
|
|
238
172
|
var propChildren = child.props.children;
|
|
239
|
-
|
|
240
173
|
if (propChildren) {
|
|
241
|
-
var clonedNode = /*#__PURE__*/_react["default"].cloneElement(child, {},
|
|
242
|
-
|
|
174
|
+
var clonedNode = /*#__PURE__*/_react["default"].cloneElement(child, {}, _renderFieldItem(propChildren, child));
|
|
243
175
|
return clonedNode;
|
|
244
176
|
}
|
|
245
|
-
|
|
246
177
|
return child;
|
|
247
178
|
}
|
|
248
|
-
|
|
249
179
|
if (!props['data-rules']) {
|
|
250
180
|
if (type === _input["default"] || type === _input["default"].TextArea) {
|
|
251
181
|
rules.push({
|
|
@@ -267,35 +197,28 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
267
197
|
message: "".concat(label, "\u4E0D\u80FD\u4E3A\u7A7A")
|
|
268
198
|
});
|
|
269
199
|
}
|
|
270
|
-
}
|
|
200
|
+
}
|
|
201
|
+
// 很多时候input会忘记设置最大长度的属性
|
|
271
202
|
// 这里为input组件自动注入`maxlength`属性
|
|
272
|
-
|
|
273
|
-
|
|
274
203
|
var maxLength = props.maxLength;
|
|
275
|
-
|
|
276
204
|
if ((type === _input["default"] || type === _input["default"].TextArea) && !maxLength) {
|
|
277
205
|
child = /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
278
206
|
maxLength: 50
|
|
279
207
|
});
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
208
|
+
}
|
|
209
|
+
// 深copy比较
|
|
283
210
|
var isUpload = displayName === 'HJYUpload';
|
|
284
|
-
|
|
285
211
|
var getValuePropName = function getValuePropName() {
|
|
286
212
|
switch (displayName) {
|
|
287
213
|
case 'Checkbox':
|
|
288
214
|
case 'Switch':
|
|
289
215
|
return 'checked';
|
|
290
|
-
|
|
291
216
|
case 'HJYUpload':
|
|
292
217
|
return 'fileList';
|
|
293
|
-
|
|
294
218
|
default:
|
|
295
219
|
return 'value';
|
|
296
220
|
}
|
|
297
221
|
};
|
|
298
|
-
|
|
299
222
|
var rest = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
300
223
|
valuePropName: getValuePropName()
|
|
301
224
|
}, isUpload ? {
|
|
@@ -303,7 +226,6 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
303
226
|
if (Array.isArray(e)) {
|
|
304
227
|
return e;
|
|
305
228
|
}
|
|
306
|
-
|
|
307
229
|
return e && e.fileList;
|
|
308
230
|
}
|
|
309
231
|
} : {}), {
|
|
@@ -312,7 +234,6 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
312
234
|
label: label
|
|
313
235
|
});
|
|
314
236
|
var viewRest = Object.assign({}, fromItemProps);
|
|
315
|
-
|
|
316
237
|
if (viewMode == 'read' && mode != 'edit' || mode == 'read') {
|
|
317
238
|
// 图片用Upload组件配置 mode 模式即可
|
|
318
239
|
return /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, Object.assign({
|
|
@@ -323,17 +244,13 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
323
244
|
label: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
324
245
|
title: typeof tooltip == 'string' ? tooltip : label
|
|
325
246
|
}, label))
|
|
326
|
-
}, viewRest
|
|
247
|
+
}, viewRest), (viewModel === null || viewModel === void 0 ? void 0 : viewModel[viewName]) ? viewModel[viewName] : '--');
|
|
327
248
|
}
|
|
328
|
-
|
|
329
249
|
var formNode1 = /*#__PURE__*/_react["default"].cloneElement(child, Object.assign({
|
|
330
|
-
placeholder: initPlaceholder(props.placeholder, label, child)
|
|
250
|
+
placeholder: initPlaceholder(props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
|
|
331
251
|
}, fromElementProps));
|
|
332
|
-
|
|
333
252
|
var divNode = /*#__PURE__*/_react["default"].cloneElement(child, Object.assign({}, fromElementProps));
|
|
334
|
-
|
|
335
253
|
var labelAfterNode = labelAfter;
|
|
336
|
-
|
|
337
254
|
if (((_c = (_b = labelAfter === null || labelAfter === void 0 ? void 0 : labelAfter.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.type) === 'div' && typeof label == 'string') {
|
|
338
255
|
var span = document.createElement('span');
|
|
339
256
|
span.style.fontSize = '14px';
|
|
@@ -351,225 +268,181 @@ var renderFieldItem = function renderFieldItem(reactNode, parentNode, viewModel,
|
|
|
351
268
|
}));
|
|
352
269
|
document.body.removeChild(span);
|
|
353
270
|
}
|
|
354
|
-
|
|
355
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, child.type == 'div' ? /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, Object.assign({
|
|
271
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, child.type == 'div' ? (/*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, Object.assign({
|
|
356
272
|
key: index,
|
|
357
273
|
style: style,
|
|
358
|
-
className: (0, _classnames2["default"])((
|
|
274
|
+
className: (0, _classnames2["default"])(_defineProperty(_defineProperty(_defineProperty({
|
|
359
275
|
className: className
|
|
360
|
-
},
|
|
276
|
+
}, 'vtx-form-item', true), 'vtx-form-item-vertical', true), 'vtx-form-item--inline', true)),
|
|
361
277
|
weights: weights,
|
|
362
278
|
inline: true
|
|
363
|
-
}, rest), divNode) : /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, Object.assign({
|
|
279
|
+
}, rest), divNode)) : (/*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, Object.assign({
|
|
364
280
|
key: index,
|
|
365
281
|
style: style,
|
|
366
282
|
className: className,
|
|
367
283
|
weights: weights
|
|
368
284
|
}, rest, {
|
|
369
285
|
extra: labelAfterNode
|
|
370
|
-
}), formNode1));
|
|
286
|
+
}), formNode1)));
|
|
371
287
|
});
|
|
372
288
|
};
|
|
373
289
|
/**
|
|
374
290
|
*
|
|
375
291
|
* @param {String | String[]} placeholder
|
|
376
292
|
* @param {String} label
|
|
377
|
-
* @param {ANY}
|
|
293
|
+
* @param {ANY} type
|
|
378
294
|
* @return {String | String[]} 返回placeholder
|
|
379
295
|
*/
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
exports.renderFieldItem = renderFieldItem;
|
|
383
|
-
|
|
384
|
-
function initPlaceholder(placeholder, label, child) {
|
|
385
|
-
var _a;
|
|
386
|
-
|
|
387
|
-
var type = child === null || child === void 0 ? void 0 : child.type;
|
|
388
|
-
|
|
296
|
+
function initPlaceholder(placeholder, label, type) {
|
|
297
|
+
var _a, _b, _c;
|
|
389
298
|
if (placeholder) {
|
|
390
299
|
return placeholder;
|
|
391
300
|
}
|
|
392
|
-
|
|
393
301
|
var isInput = type === _input["default"] || type === _input["default"].TextArea || type === _inputNumber["default"] || ((_a = type === null || type === void 0 ? void 0 : type.propTypes) === null || _a === void 0 ? void 0 : _a.maxLength);
|
|
394
|
-
var
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
302
|
+
var itemType = undefined;
|
|
303
|
+
if (type && _typeof(type) != 'object') {
|
|
304
|
+
itemType = (_c = (_b = type === null || type === void 0 ? void 0 : type.toString()) === null || _b === void 0 ? void 0 : _b.match(/function\s*([^(]*)\(/)) === null || _c === void 0 ? void 0 : _c[1];
|
|
305
|
+
}
|
|
399
306
|
if (isInput) {
|
|
400
|
-
return '请输入' + label;
|
|
401
|
-
} else if (
|
|
307
|
+
return '请输入' + label;
|
|
308
|
+
} else if (itemType === 'RangePicker') {
|
|
402
309
|
return ['开始时间', '结束时间'];
|
|
403
310
|
} else {
|
|
404
311
|
return '请选择' + label;
|
|
405
312
|
}
|
|
406
313
|
}
|
|
407
|
-
|
|
408
314
|
var CreateModal = function CreateModal(props, ref) {
|
|
409
315
|
var size = props.size,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
316
|
+
width = props.width,
|
|
317
|
+
children = props.children,
|
|
318
|
+
visible = props.visible,
|
|
319
|
+
onSave = props.onSave,
|
|
320
|
+
onReset = props.onReset,
|
|
321
|
+
onError = props.onError,
|
|
322
|
+
onCancel = props.onCancel,
|
|
323
|
+
_props$deafultFooter = props.deafultFooter,
|
|
324
|
+
deafultFooter = _props$deafultFooter === void 0 ? false : _props$deafultFooter,
|
|
325
|
+
_props$extraFooter = props.extraFooter,
|
|
326
|
+
extraFooter = _props$extraFooter === void 0 ? [] : _props$extraFooter,
|
|
327
|
+
_props$clearText = props.clearText,
|
|
328
|
+
clearText = _props$clearText === void 0 ? '清空' : _props$clearText,
|
|
329
|
+
_props$okText = props.okText,
|
|
330
|
+
okText = _props$okText === void 0 ? '保存' : _props$okText,
|
|
331
|
+
_props$closeText = props.closeText,
|
|
332
|
+
closeText = _props$closeText === void 0 ? '关闭' : _props$closeText,
|
|
333
|
+
_props$onlyForm = props.onlyForm,
|
|
334
|
+
onlyForm = _props$onlyForm === void 0 ? false : _props$onlyForm,
|
|
335
|
+
footer = props.footer,
|
|
336
|
+
formProps = props.formProps,
|
|
337
|
+
onlyCloseBtn = props.onlyCloseBtn,
|
|
338
|
+
isViewLayout = props.isViewLayout,
|
|
339
|
+
isCompact = props.isCompact,
|
|
340
|
+
viewModel = props.viewModel,
|
|
341
|
+
viewMode = props.viewMode,
|
|
342
|
+
labelColSpan = props.labelColSpan,
|
|
343
|
+
layout = props.layout,
|
|
344
|
+
rest = __rest(props, ["size", "width", "children", "visible", "onSave", "onReset", "onError", "onCancel", "deafultFooter", "extraFooter", "clearText", "okText", "closeText", "onlyForm", "footer", "formProps", "onlyCloseBtn", "isViewLayout", "isCompact", "viewModel", "viewMode", "labelColSpan", "layout"]);
|
|
440
345
|
var _Form$useForm = _form["default"].useForm(),
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
346
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
347
|
+
form = _Form$useForm2[0];
|
|
444
348
|
var formRef = (0, _react.useRef)(null);
|
|
445
|
-
|
|
446
349
|
var _useState = (0, _react.useState)(false),
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
350
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
351
|
+
saving = _useState2[0],
|
|
352
|
+
setSaving = _useState2[1];
|
|
451
353
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
452
354
|
return {
|
|
453
355
|
form: form
|
|
454
356
|
};
|
|
455
357
|
});
|
|
456
|
-
|
|
457
358
|
var handleSave = function handleSave() {
|
|
458
|
-
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/
|
|
459
|
-
var _a, res;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
_context.prev = 11;
|
|
483
|
-
setSaving(true);
|
|
484
|
-
_context.t1 = onSave;
|
|
485
|
-
|
|
486
|
-
if (!_context.t1) {
|
|
487
|
-
_context.next = 17;
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
_context.next = 17;
|
|
492
|
-
return onSave(res);
|
|
493
|
-
|
|
494
|
-
case 17:
|
|
495
|
-
_context.next = 22;
|
|
359
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
|
|
360
|
+
var _a, res, _t, _t2, _t3;
|
|
361
|
+
return _regenerator().w(function (_context) {
|
|
362
|
+
while (1) switch (_context.p = _context.n) {
|
|
363
|
+
case 0:
|
|
364
|
+
res = undefined;
|
|
365
|
+
_context.p = 1;
|
|
366
|
+
_context.n = 2;
|
|
367
|
+
return form.validateFields();
|
|
368
|
+
case 2:
|
|
369
|
+
res = _context.v;
|
|
370
|
+
_context.n = 4;
|
|
371
|
+
break;
|
|
372
|
+
case 3:
|
|
373
|
+
_context.p = 3;
|
|
374
|
+
_t = _context.v;
|
|
375
|
+
onError && onError(_t);
|
|
376
|
+
return _context.a(2);
|
|
377
|
+
case 4:
|
|
378
|
+
_context.p = 4;
|
|
379
|
+
setSaving(true);
|
|
380
|
+
_t2 = onSave;
|
|
381
|
+
if (!_t2) {
|
|
382
|
+
_context.n = 5;
|
|
496
383
|
break;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
384
|
+
}
|
|
385
|
+
_context.n = 5;
|
|
386
|
+
return onSave(res);
|
|
387
|
+
case 5:
|
|
388
|
+
_context.n = 7;
|
|
389
|
+
break;
|
|
390
|
+
case 6:
|
|
391
|
+
_context.p = 6;
|
|
392
|
+
_t3 = _context.v;
|
|
393
|
+
_message["default"].error(((_a = _t3 === null || _t3 === void 0 ? void 0 : _t3.data) === null || _a === void 0 ? void 0 : _a.msg) || (_t3 === null || _t3 === void 0 ? void 0 : _t3.data) || _t3);
|
|
394
|
+
case 7:
|
|
395
|
+
_context.p = 7;
|
|
396
|
+
setSaving(false);
|
|
397
|
+
return _context.f(7);
|
|
398
|
+
case 8:
|
|
399
|
+
return _context.a(2);
|
|
513
400
|
}
|
|
514
|
-
}, _callee, null, [[
|
|
401
|
+
}, _callee, null, [[4, 6, 7, 8], [1, 3]]);
|
|
515
402
|
}));
|
|
516
403
|
};
|
|
517
|
-
|
|
518
404
|
var handleReset = function handleReset() {
|
|
519
405
|
form.resetFields();
|
|
520
406
|
onReset && onReset();
|
|
521
407
|
};
|
|
522
|
-
|
|
523
408
|
_react["default"].useEffect(function () {
|
|
524
409
|
// 关闭弹窗后, 清除错误, 清除数据
|
|
525
410
|
if (!visible && formRef.current && !onlyForm) {
|
|
526
411
|
form.resetFields();
|
|
527
412
|
}
|
|
528
413
|
}, [visible]);
|
|
529
|
-
|
|
530
414
|
var getWidth = function getWidth() {
|
|
531
415
|
if (typeof width === 'number') {
|
|
532
416
|
return width;
|
|
533
417
|
}
|
|
534
|
-
|
|
535
418
|
switch (size) {
|
|
536
419
|
case 'xsmall':
|
|
537
420
|
return _vtxModal["default"].size.xsmall;
|
|
538
|
-
|
|
539
421
|
case 'small':
|
|
540
422
|
return _vtxModal["default"].size.small;
|
|
541
|
-
|
|
542
423
|
case 'middle':
|
|
543
|
-
|
|
544
|
-
return 900;
|
|
545
|
-
|
|
424
|
+
return _vtxModal["default"].size.middle;
|
|
546
425
|
case 'large':
|
|
547
426
|
return _vtxModal["default"].size.large;
|
|
548
|
-
|
|
549
427
|
default:
|
|
550
|
-
|
|
551
|
-
return 900;
|
|
428
|
+
return _vtxModal["default"].size.middle;
|
|
552
429
|
}
|
|
553
430
|
};
|
|
554
|
-
|
|
555
431
|
var getCols = function getCols() {
|
|
556
432
|
switch (size) {
|
|
557
433
|
case 'xsmall':
|
|
558
434
|
return 1;
|
|
559
|
-
|
|
560
435
|
case 'small':
|
|
561
436
|
return 1;
|
|
562
|
-
|
|
563
437
|
case 'middle':
|
|
564
438
|
return undefined;
|
|
565
|
-
|
|
566
439
|
case 'large':
|
|
567
440
|
return 3;
|
|
568
|
-
|
|
569
441
|
default:
|
|
570
442
|
return undefined;
|
|
571
443
|
}
|
|
572
|
-
};
|
|
444
|
+
};
|
|
445
|
+
// const getCard = () => {
|
|
573
446
|
// switch (size) {
|
|
574
447
|
// case 'xsmall':
|
|
575
448
|
// return false;
|
|
@@ -583,24 +456,19 @@ var CreateModal = function CreateModal(props, ref) {
|
|
|
583
456
|
// return true;
|
|
584
457
|
// }
|
|
585
458
|
// };
|
|
586
|
-
|
|
587
|
-
|
|
588
459
|
var getLabelColSpan = function getLabelColSpan() {
|
|
589
|
-
return labelColSpan ? labelColSpan :
|
|
460
|
+
return labelColSpan ? labelColSpan : undefined;
|
|
590
461
|
};
|
|
591
|
-
|
|
592
462
|
var getLayout = function getLayout() {
|
|
593
463
|
if (layout) return layout;
|
|
594
|
-
|
|
595
464
|
if (viewMode == 'mix') {
|
|
596
465
|
return undefined;
|
|
597
466
|
} else if ((viewMode == 'read' || viewMode == 'inline') && isViewLayout != false) {
|
|
598
467
|
return 'inline';
|
|
599
468
|
} else {
|
|
600
|
-
return '
|
|
469
|
+
return 'vertical';
|
|
601
470
|
}
|
|
602
471
|
};
|
|
603
|
-
|
|
604
472
|
var renderFooter = function renderFooter() {
|
|
605
473
|
if (footer) {
|
|
606
474
|
// 优先使用自定义的footer
|
|
@@ -634,31 +502,25 @@ var CreateModal = function CreateModal(props, ref) {
|
|
|
634
502
|
}, okText)]);
|
|
635
503
|
}
|
|
636
504
|
};
|
|
637
|
-
|
|
638
505
|
var formNode = /*#__PURE__*/_react["default"].createElement(_form["default"], Object.assign({
|
|
639
506
|
ref: formRef,
|
|
640
507
|
form: form,
|
|
641
|
-
layout: getLayout()
|
|
642
|
-
scrollToFirstError: true
|
|
508
|
+
layout: getLayout()
|
|
643
509
|
}, formProps), /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"], {
|
|
644
510
|
cols: getCols(),
|
|
645
511
|
labelColSpan: getLabelColSpan(),
|
|
646
512
|
layout: getLayout()
|
|
647
|
-
},
|
|
648
|
-
|
|
649
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !onlyForm ? /*#__PURE__*/_react["default"].createElement(_vtxModal["default"], Object.assign({
|
|
513
|
+
}, _renderFieldItem(children, undefined, viewModel, viewMode)));
|
|
514
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !onlyForm ? (/*#__PURE__*/_react["default"].createElement(_vtxModal["default"], Object.assign({
|
|
650
515
|
className: viewMode == 'read' && isCompact != false ? 'env-create-view-modal' : 'env-create-modal',
|
|
651
516
|
visible: onlyForm ? true : visible,
|
|
652
517
|
width: getWidth(),
|
|
653
518
|
maskClosable: false,
|
|
654
519
|
onCancel: onCancel,
|
|
655
520
|
footer: renderFooter()
|
|
656
|
-
}, rest), formNode) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
521
|
+
}, rest), formNode)) : (/*#__PURE__*/_react["default"].createElement("div", {
|
|
657
522
|
className: viewMode == 'read' && isCompact != false ? 'env-create-view-modal' : 'env-create-modal'
|
|
658
|
-
}, formNode));
|
|
523
|
+
}, formNode)));
|
|
659
524
|
};
|
|
660
|
-
|
|
661
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(CreateModal);
|
|
662
|
-
|
|
663
|
-
exports["default"] = _default;
|
|
525
|
+
var _default = exports["default"] = /*#__PURE__*/(0, _react.forwardRef)(CreateModal);
|
|
664
526
|
//# sourceMappingURL=create-modal.js.map
|