@para-ui/core 3.0.109 → 3.0.111-rc
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/AutoBox/index.js +5 -9
- package/AutoTips/index.js +17 -24
- package/Breadcrumbs/index.js +7 -11
- package/Button/index.js +8 -12
- package/ButtonGroup/index.js +8 -12
- package/Carousel/index.js +4 -8
- package/Cascader/index.js +7 -11
- package/Checkbox/index.js +4 -8
- package/CheckboxGroup/index.js +4 -8
- package/Collapse/index.js +1 -5
- package/CollapseBox/index.js +4 -8
- package/CollapseLayout/index.js +6 -10
- package/ColorPicker/index.js +0 -2
- package/ComboSelect/index.js +14 -18
- package/Container/index.js +1 -5
- package/DatePicker/index.js +10 -14
- package/Desktop/index.js +10 -14
- package/DragVerify/index.js +6 -10
- package/Drawer/index.js +8 -12
- package/Dropdown/index.js +3 -4
- package/DynamicMultiBox/index.js +15 -19
- package/Empty/index.js +3 -7
- package/Form/index.js +15 -16
- package/FormItem/index.js +15 -16
- package/FunctionModal/index.js +14 -15
- package/GlobalContext/index.js +3 -3
- package/Help/index.js +4 -8
- package/HelperText/index.js +1 -5
- package/InputLang/index.js +11 -15
- package/InputNumber/index.js +4 -8
- package/Label/index.js +4 -8
- package/Loading/index.js +1 -5
- package/Menu/index.js +5 -9
- package/Message/index.js +4 -8
- package/Modal/index.js +10 -17
- package/MultiBox/index.js +10 -14
- package/Notification/index.js +3 -7
- package/OperateBtn/index.js +9 -13
- package/PageHeader/index.js +9 -13
- package/Pagination/index.js +11 -15
- package/ParauiProvider/index.js +3 -7
- package/PasswordRules/index.js +3 -7
- package/PopConfirm/index.js +8 -12
- package/Popover/index.js +5 -9
- package/Progress/index.js +2 -6
- package/Querying/index.js +3 -7
- package/README.md +10 -0
- package/Radio/index.js +4 -8
- package/RadioGroup/index.js +4 -8
- package/Search/index.js +9 -13
- package/Select/index.js +11 -15
- package/SelectInput/index.js +11 -12
- package/Selector/index.js +11 -24
- package/SelectorPicker/index.js +12 -16
- package/SingleBox/index.js +10 -14
- package/Slider/index.js +6 -10
- package/Split/index.js +4 -8
- package/Status/index.js +1 -5
- package/Stepper/index.js +3 -7
- package/Styles/theme/theme-api.scss +75 -0
- package/Styles/theme/theme-default.scss +74 -0
- package/Styles/theme/theme-shrcb.scss +80 -0
- package/Styles/theme.scss +1 -69
- package/Switch/index.js +6 -10
- package/Table/index.js +12 -37
- package/Tabs/index.js +9 -13
- package/Tag/index.js +7 -11
- package/TextEditor/index.js +5 -12
- package/TextField/index.js +8 -12
- package/TimePicker/index.js +10 -11
- package/Timeline/index.js +4 -8
- package/Title/index.js +1 -5
- package/ToggleButton/index.js +9 -13
- package/Tooltip/index.js +4 -8
- package/Transfer/index.js +13 -17
- package/Tree/index.js +12 -13
- package/Upload/index.js +57 -53
- package/Upload/interface.d.ts +3 -0
- package/_verture/{index-efa2ef9a.js → closestPolyfill-0ea0e7a5.js} +8 -15
- package/_verture/closestPolyfill-230b7b1c.js +1354 -0
- package/_verture/constant-d26faf32.js +10 -0
- package/_verture/{defineProperty-62acccfc.js → defineProperty-a3595bb4.js} +1 -1
- package/_verture/defineProperty-d7016ad3.js +34 -0
- package/_verture/{index-faea6d44.js → index-1e744dcd.js} +4 -11
- package/_verture/{index-77f9e0fb.js → index-4ee4e41a.js} +2 -6
- package/_verture/index-59046762.js +232 -0
- package/_verture/index-66004ebf.js +757 -0
- package/_verture/index-eefd3ff1.js +18 -0
- package/_verture/index-fe55d90e.js +340 -0
- package/_verture/{intl-4a9f1b44.js → intl-638e7f5e.js} +1 -1
- package/_verture/intl-e0637ffc.js +81 -0
- package/_verture/{modalContext-7833df3b.js → modalContext-7312fb44.js} +4 -8
- package/_verture/modalContext-762c9eb8.js +197 -0
- package/_verture/{slicedToArray-76060636.js → slicedToArray-cf682b7d.js} +1 -1
- package/_verture/slicedToArray-e838a33c.js +43 -0
- package/_verture/sortable.esm-d3f0b100.js +3791 -0
- package/_verture/{toConsumableArray-81040c9e.js → toConsumableArray-037466a3.js} +1 -1
- package/_verture/toConsumableArray-2f4549d3.js +19 -0
- package/_verture/tslib.es6-9e8a62ad.js +38 -0
- package/_verture/typeof-ef74f13b.js +11 -0
- package/_verture/unsupportedIterableToArray-bd7e0e01.js +16 -0
- package/_verture/useFormatMessage-e3507273.js +20 -0
- package/_verture/useGlobalProps-c2be96c7.js +11 -0
- package/_verture/usePopupContainer-dde75227.js +68 -0
- package/_verture/util-9d3101fc.js +18 -0
- package/_verture/{utils-1ffeadec.js → utils-1b82eac1.js} +1 -1
- package/_verture/utils-cc6f5f94.js +92 -0
- package/index.d.ts +0 -2
- package/index.js +20 -23
- package/package.json +4 -1
- package/theme/theme-shrcb.css +14622 -0
- package/theme/theme.css +15018 -0
- package/umd/AutoTips.js +1 -1
- package/umd/Breadcrumbs.js +2 -2
- package/umd/Button.js +1 -1
- package/umd/ButtonGroup.js +1 -1
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/CollapseLayout.js +3 -3
- package/umd/ComboSelect.js +2 -2
- package/umd/DatePicker.js +2 -2
- package/umd/Desktop.js +2 -2
- package/umd/DragVerify.js +1 -1
- package/umd/Drawer.js +2 -2
- package/umd/DynamicMultiBox.js +2 -2
- package/umd/Empty.js +1 -1
- package/umd/Form.js +2 -2
- package/umd/FormItem.js +2 -2
- package/umd/FunctionModal.js +2 -2
- package/umd/Help.js +1 -1
- package/umd/InputLang.js +2 -2
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/Menu.js +3 -3
- package/umd/Message.js +1 -1
- package/umd/Modal.js +2 -2
- package/umd/MultiBox.js +2 -2
- package/umd/Notification.js +1 -1
- package/umd/OperateBtn.js +2 -2
- package/umd/PageHeader.js +7 -7
- package/umd/Pagination.js +4 -4
- package/umd/PopConfirm.js +1 -1
- package/umd/Progress.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/Search.js +2 -2
- package/umd/Select.js +2 -2
- package/umd/SelectInput.js +2 -2
- package/umd/Selector.js +2 -2
- package/umd/SelectorPicker.js +2 -2
- package/umd/SingleBox.js +2 -2
- package/umd/Slider.js +1 -1
- package/umd/Stepper.js +4 -4
- package/umd/Switch.js +4 -4
- package/umd/Table.js +2 -2
- package/umd/Tabs.js +1 -1
- package/umd/Tag.js +2 -2
- package/umd/TextEditor.js +1 -1
- package/umd/TextField.js +2 -2
- package/umd/TimePicker.js +2 -2
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +2 -2
- package/umd/Transfer.js +2 -2
- package/umd/Tree.js +2 -2
- package/umd/Upload.js +4 -4
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/style-inject.es-300983ab.js +0 -28
- package/locale/en-US.d.ts +0 -165
- package/locale/index.d.ts +0 -331
- package/locale/index.js +0 -336
- package/locale/zh-CN.d.ts +0 -165
- package/umd/locale.js +0 -1
- /package/_verture/{constant-66aa48a1.js → constant-ce36e642.js} +0 -0
- /package/_verture/{index-beef914f.js → index-67a00291.js} +0 -0
- /package/_verture/{index-65bbd1e4.js → index-a055cc71.js} +0 -0
- /package/_verture/{sortable.esm-49896035.js → sortable.esm-5dbbc690.js} +0 -0
- /package/_verture/{tslib.es6-55ed4bd2.js → tslib.es6-44149323.js} +0 -0
- /package/_verture/{typeof-498dd2b1.js → typeof-c4ef74bc.js} +0 -0
- /package/_verture/{unsupportedIterableToArray-cb478f24.js → unsupportedIterableToArray-6655197b.js} +0 -0
- /package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-8394ec71.js} +0 -0
- /package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-929e5233.js} +0 -0
- /package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-6fa1cc58.js} +0 -0
- /package/_verture/{util-7e1fb1e2.js → util-8a7a5c8d.js} +0 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
2
|
+
|
|
3
|
+
var _typeof = {exports: {}};
|
|
4
|
+
|
|
5
|
+
(function (module) {
|
|
6
|
+
function _typeof(obj) {
|
|
7
|
+
"@babel/helpers - typeof";
|
|
8
|
+
|
|
9
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
10
|
+
return typeof obj;
|
|
11
|
+
} : function (obj) {
|
|
12
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
13
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
|
14
|
+
}
|
|
15
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16
|
+
} (_typeof));
|
|
17
|
+
|
|
18
|
+
(function (module) {
|
|
19
|
+
var _typeof$1 = _typeof.exports["default"];
|
|
20
|
+
function _regeneratorRuntime() {
|
|
21
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
22
|
+
return exports;
|
|
23
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
24
|
+
var exports = {},
|
|
25
|
+
Op = Object.prototype,
|
|
26
|
+
hasOwn = Op.hasOwnProperty,
|
|
27
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
28
|
+
obj[key] = desc.value;
|
|
29
|
+
},
|
|
30
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
31
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
32
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
33
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
34
|
+
function define(obj, key, value) {
|
|
35
|
+
return Object.defineProperty(obj, key, {
|
|
36
|
+
value: value,
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0
|
|
40
|
+
}), obj[key];
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
define({}, "");
|
|
44
|
+
} catch (err) {
|
|
45
|
+
define = function define(obj, key, value) {
|
|
46
|
+
return obj[key] = value;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
50
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
51
|
+
generator = Object.create(protoGenerator.prototype),
|
|
52
|
+
context = new Context(tryLocsList || []);
|
|
53
|
+
return defineProperty(generator, "_invoke", {
|
|
54
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
55
|
+
}), generator;
|
|
56
|
+
}
|
|
57
|
+
function tryCatch(fn, obj, arg) {
|
|
58
|
+
try {
|
|
59
|
+
return {
|
|
60
|
+
type: "normal",
|
|
61
|
+
arg: fn.call(obj, arg)
|
|
62
|
+
};
|
|
63
|
+
} catch (err) {
|
|
64
|
+
return {
|
|
65
|
+
type: "throw",
|
|
66
|
+
arg: err
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.wrap = wrap;
|
|
71
|
+
var ContinueSentinel = {};
|
|
72
|
+
function Generator() {}
|
|
73
|
+
function GeneratorFunction() {}
|
|
74
|
+
function GeneratorFunctionPrototype() {}
|
|
75
|
+
var IteratorPrototype = {};
|
|
76
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
77
|
+
return this;
|
|
78
|
+
});
|
|
79
|
+
var getProto = Object.getPrototypeOf,
|
|
80
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
81
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
82
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
83
|
+
function defineIteratorMethods(prototype) {
|
|
84
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
85
|
+
define(prototype, method, function (arg) {
|
|
86
|
+
return this._invoke(method, arg);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
91
|
+
function invoke(method, arg, resolve, reject) {
|
|
92
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
93
|
+
if ("throw" !== record.type) {
|
|
94
|
+
var result = record.arg,
|
|
95
|
+
value = result.value;
|
|
96
|
+
return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
97
|
+
invoke("next", value, resolve, reject);
|
|
98
|
+
}, function (err) {
|
|
99
|
+
invoke("throw", err, resolve, reject);
|
|
100
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
101
|
+
result.value = unwrapped, resolve(result);
|
|
102
|
+
}, function (error) {
|
|
103
|
+
return invoke("throw", error, resolve, reject);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
reject(record.arg);
|
|
107
|
+
}
|
|
108
|
+
var previousPromise;
|
|
109
|
+
defineProperty(this, "_invoke", {
|
|
110
|
+
value: function value(method, arg) {
|
|
111
|
+
function callInvokeWithMethodAndArg() {
|
|
112
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
113
|
+
invoke(method, arg, resolve, reject);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
121
|
+
var state = "suspendedStart";
|
|
122
|
+
return function (method, arg) {
|
|
123
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
124
|
+
if ("completed" === state) {
|
|
125
|
+
if ("throw" === method) throw arg;
|
|
126
|
+
return doneResult();
|
|
127
|
+
}
|
|
128
|
+
for (context.method = method, context.arg = arg;;) {
|
|
129
|
+
var delegate = context.delegate;
|
|
130
|
+
if (delegate) {
|
|
131
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
132
|
+
if (delegateResult) {
|
|
133
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
134
|
+
return delegateResult;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
138
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
139
|
+
context.dispatchException(context.arg);
|
|
140
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
141
|
+
state = "executing";
|
|
142
|
+
var record = tryCatch(innerFn, self, context);
|
|
143
|
+
if ("normal" === record.type) {
|
|
144
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
145
|
+
return {
|
|
146
|
+
value: record.arg,
|
|
147
|
+
done: context.done
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
155
|
+
var methodName = context.method,
|
|
156
|
+
method = delegate.iterator[methodName];
|
|
157
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
158
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
159
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
160
|
+
var info = record.arg;
|
|
161
|
+
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);
|
|
162
|
+
}
|
|
163
|
+
function pushTryEntry(locs) {
|
|
164
|
+
var entry = {
|
|
165
|
+
tryLoc: locs[0]
|
|
166
|
+
};
|
|
167
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
168
|
+
}
|
|
169
|
+
function resetTryEntry(entry) {
|
|
170
|
+
var record = entry.completion || {};
|
|
171
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
172
|
+
}
|
|
173
|
+
function Context(tryLocsList) {
|
|
174
|
+
this.tryEntries = [{
|
|
175
|
+
tryLoc: "root"
|
|
176
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
177
|
+
}
|
|
178
|
+
function values(iterable) {
|
|
179
|
+
if (iterable) {
|
|
180
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
181
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
182
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
183
|
+
if (!isNaN(iterable.length)) {
|
|
184
|
+
var i = -1,
|
|
185
|
+
next = function next() {
|
|
186
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
187
|
+
return next.value = undefined, next.done = !0, next;
|
|
188
|
+
};
|
|
189
|
+
return next.next = next;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
next: doneResult
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function doneResult() {
|
|
197
|
+
return {
|
|
198
|
+
value: undefined,
|
|
199
|
+
done: !0
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
203
|
+
value: GeneratorFunctionPrototype,
|
|
204
|
+
configurable: !0
|
|
205
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
206
|
+
value: GeneratorFunction,
|
|
207
|
+
configurable: !0
|
|
208
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
209
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
210
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
211
|
+
}, exports.mark = function (genFun) {
|
|
212
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
213
|
+
}, exports.awrap = function (arg) {
|
|
214
|
+
return {
|
|
215
|
+
__await: arg
|
|
216
|
+
};
|
|
217
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
218
|
+
return this;
|
|
219
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
220
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
221
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
222
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
223
|
+
return result.done ? result.value : iter.next();
|
|
224
|
+
});
|
|
225
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
226
|
+
return this;
|
|
227
|
+
}), define(Gp, "toString", function () {
|
|
228
|
+
return "[object Generator]";
|
|
229
|
+
}), exports.keys = function (val) {
|
|
230
|
+
var object = Object(val),
|
|
231
|
+
keys = [];
|
|
232
|
+
for (var key in object) keys.push(key);
|
|
233
|
+
return keys.reverse(), function next() {
|
|
234
|
+
for (; keys.length;) {
|
|
235
|
+
var key = keys.pop();
|
|
236
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
237
|
+
}
|
|
238
|
+
return next.done = !0, next;
|
|
239
|
+
};
|
|
240
|
+
}, exports.values = values, Context.prototype = {
|
|
241
|
+
constructor: Context,
|
|
242
|
+
reset: function reset(skipTempReset) {
|
|
243
|
+
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);
|
|
244
|
+
},
|
|
245
|
+
stop: function stop() {
|
|
246
|
+
this.done = !0;
|
|
247
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
248
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
249
|
+
return this.rval;
|
|
250
|
+
},
|
|
251
|
+
dispatchException: function dispatchException(exception) {
|
|
252
|
+
if (this.done) throw exception;
|
|
253
|
+
var context = this;
|
|
254
|
+
function handle(loc, caught) {
|
|
255
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
256
|
+
}
|
|
257
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
258
|
+
var entry = this.tryEntries[i],
|
|
259
|
+
record = entry.completion;
|
|
260
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
261
|
+
if (entry.tryLoc <= this.prev) {
|
|
262
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
263
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
264
|
+
if (hasCatch && hasFinally) {
|
|
265
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
266
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
267
|
+
} else if (hasCatch) {
|
|
268
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
269
|
+
} else {
|
|
270
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
271
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
abrupt: function abrupt(type, arg) {
|
|
277
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
278
|
+
var entry = this.tryEntries[i];
|
|
279
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
280
|
+
var finallyEntry = entry;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
285
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
286
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
287
|
+
},
|
|
288
|
+
complete: function complete(record, afterLoc) {
|
|
289
|
+
if ("throw" === record.type) throw record.arg;
|
|
290
|
+
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;
|
|
291
|
+
},
|
|
292
|
+
finish: function finish(finallyLoc) {
|
|
293
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
294
|
+
var entry = this.tryEntries[i];
|
|
295
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"catch": function _catch(tryLoc) {
|
|
299
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
300
|
+
var entry = this.tryEntries[i];
|
|
301
|
+
if (entry.tryLoc === tryLoc) {
|
|
302
|
+
var record = entry.completion;
|
|
303
|
+
if ("throw" === record.type) {
|
|
304
|
+
var thrown = record.arg;
|
|
305
|
+
resetTryEntry(entry);
|
|
306
|
+
}
|
|
307
|
+
return thrown;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
throw new Error("illegal catch attempt");
|
|
311
|
+
},
|
|
312
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
313
|
+
return this.delegate = {
|
|
314
|
+
iterator: values(iterable),
|
|
315
|
+
resultName: resultName,
|
|
316
|
+
nextLoc: nextLoc
|
|
317
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
318
|
+
}
|
|
319
|
+
}, exports;
|
|
320
|
+
}
|
|
321
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
322
|
+
} (regeneratorRuntime$1));
|
|
323
|
+
|
|
324
|
+
// TODO(Babel 8): Remove this file.
|
|
325
|
+
|
|
326
|
+
var runtime = regeneratorRuntime$1.exports();
|
|
327
|
+
var regenerator = runtime;
|
|
328
|
+
|
|
329
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
330
|
+
try {
|
|
331
|
+
regeneratorRuntime = runtime;
|
|
332
|
+
} catch (accidentalStrictMode) {
|
|
333
|
+
if (typeof globalThis === "object") {
|
|
334
|
+
globalThis.regeneratorRuntime = runtime;
|
|
335
|
+
} else {
|
|
336
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export { regenerator as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _typeof } from './typeof-
|
|
1
|
+
import { _ as _typeof } from './typeof-c4ef74bc.js';
|
|
2
2
|
|
|
3
3
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { _ as _typeof } from './typeof-ef74f13b.js';
|
|
2
|
+
|
|
3
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
// 实现 get 方法
|
|
7
|
+
// 支持对象和数组/支持默认值/支持路径/支持字符串模版变量/支持jsx/支持.运算符和[]运算符
|
|
8
|
+
var get = function get(obj, path, defaultValue) {
|
|
9
|
+
var pathArr = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
|
10
|
+
var result = obj;
|
|
11
|
+
var _iterator = _createForOfIteratorHelper(pathArr),
|
|
12
|
+
_step;
|
|
13
|
+
try {
|
|
14
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
15
|
+
var p = _step.value;
|
|
16
|
+
result = Object(result)[p];
|
|
17
|
+
if (result === undefined) {
|
|
18
|
+
return defaultValue;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_iterator.e(err);
|
|
23
|
+
} finally {
|
|
24
|
+
_iterator.f();
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 替换字符串模版变量
|
|
30
|
+
* @param str
|
|
31
|
+
* @param vars
|
|
32
|
+
*/
|
|
33
|
+
var replaceStrTemplateVars = function replaceStrTemplateVars(str, vars) {
|
|
34
|
+
if (!vars) return str;
|
|
35
|
+
str = str.replace(/\"/g, '\\"');
|
|
36
|
+
// 模版字符串正则
|
|
37
|
+
var strTemplateReg = /({[^{}]+})/g;
|
|
38
|
+
var parts = str.split(strTemplateReg);
|
|
39
|
+
return parts.map(function (part) {
|
|
40
|
+
if (part.match(strTemplateReg)) {
|
|
41
|
+
var key = part.replace(/({|})/g, '');
|
|
42
|
+
var val = get(vars, key);
|
|
43
|
+
return val === undefined ? key : val;
|
|
44
|
+
}
|
|
45
|
+
return part;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 国际化获取方法
|
|
50
|
+
* @param ops 国际化取值key参数
|
|
51
|
+
* @param i18nData 国际化数据对象
|
|
52
|
+
* @param params 国际化字符变量对象
|
|
53
|
+
* @param lang 指定国际化语言
|
|
54
|
+
* @param defI18nData 默认国际化数据对象
|
|
55
|
+
*/
|
|
56
|
+
var i18nIntl = function i18nIntl(props) {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
var ops = props.ops,
|
|
59
|
+
i18nData = props.i18nData,
|
|
60
|
+
lang = props.lang,
|
|
61
|
+
params = props.params,
|
|
62
|
+
defI18nData = props.defI18nData;
|
|
63
|
+
var text, key;
|
|
64
|
+
if (typeof ops === 'string') {
|
|
65
|
+
key = ops;
|
|
66
|
+
} else if (_typeof(ops) === 'object') {
|
|
67
|
+
if (typeof ops.id !== 'string') return 'i18n intl object "id" is missing';
|
|
68
|
+
key = ops.id;
|
|
69
|
+
}
|
|
70
|
+
if (key !== undefined) {
|
|
71
|
+
text = (_a = i18nData[lang]) === null || _a === void 0 ? void 0 : _a[key];
|
|
72
|
+
if (text === undefined && defI18nData) {
|
|
73
|
+
// 尝试从默认国际化数据获取
|
|
74
|
+
text = (_b = defI18nData[lang]) === null || _b === void 0 ? void 0 : _b[key];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (typeof text !== 'string') return "{".concat(key, "}");
|
|
78
|
+
return replaceStrTemplateVars(text, params);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { i18nIntl as i };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from './toConsumableArray-
|
|
2
|
-
import { _ as _slicedToArray } from './slicedToArray-
|
|
3
|
-
import { r as regenerator } from './index-
|
|
4
|
-
import { a as __awaiter } from './tslib.es6-
|
|
1
|
+
import { _ as _toConsumableArray } from './toConsumableArray-037466a3.js';
|
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-e838a33c.js';
|
|
3
|
+
import { r as regenerator } from './index-67a00291.js';
|
|
4
|
+
import { a as __awaiter } from './tslib.es6-9e8a62ad.js';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import React__default from 'react';
|
|
7
7
|
import { Modal } from '../Modal/index.js';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import { s as styleInject } from './style-inject.es-300983ab.js';
|
|
10
|
-
|
|
11
|
-
var css_248z = ".function-modal-default [class*=makeStyles-md] {\n width: 440px;\n height: auto;\n max-height: initial;\n}";
|
|
12
|
-
styleInject(css_248z);
|
|
13
9
|
|
|
14
10
|
var FDialog = function FDialog(props) {
|
|
15
11
|
var open = props.open,
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { _ as _toConsumableArray } from './toConsumableArray-2f4549d3.js';
|
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-cf682b7d.js';
|
|
3
|
+
import { r as regenerator } from './index-fe55d90e.js';
|
|
4
|
+
import { a as __awaiter } from './tslib.es6-44149323.js';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import React__default from 'react';
|
|
7
|
+
import { Modal } from '../Modal/index.js';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
|
|
10
|
+
var FDialog = function FDialog(props) {
|
|
11
|
+
var open = props.open,
|
|
12
|
+
title = props.title,
|
|
13
|
+
size = props.size,
|
|
14
|
+
context = props.context,
|
|
15
|
+
content = props.content,
|
|
16
|
+
onSubmit = props.onSubmit,
|
|
17
|
+
onClose = props.onClose,
|
|
18
|
+
getClose = props.getClose,
|
|
19
|
+
listIndex = props.listIndex,
|
|
20
|
+
ModalProps = props.ModalProps;
|
|
21
|
+
/**
|
|
22
|
+
* 外部想要单独关闭弹窗传出
|
|
23
|
+
*/
|
|
24
|
+
React__default.useEffect(function () {
|
|
25
|
+
getClose && getClose(function () {
|
|
26
|
+
return onClose(listIndex);
|
|
27
|
+
});
|
|
28
|
+
}, [getClose, listIndex, onClose]);
|
|
29
|
+
return jsx(Modal, Object.assign({}, ModalProps, {
|
|
30
|
+
className: clsx('function-modal', !size && 'function-modal-default'),
|
|
31
|
+
open: open,
|
|
32
|
+
title: title,
|
|
33
|
+
onCancel: function onCancel() {
|
|
34
|
+
return onClose(listIndex);
|
|
35
|
+
},
|
|
36
|
+
onOk: function onOk() {
|
|
37
|
+
return onSubmit(listIndex);
|
|
38
|
+
},
|
|
39
|
+
size: size || 'md',
|
|
40
|
+
children: content || context,
|
|
41
|
+
okButtonProps: {
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return onSubmit(listIndex);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
cancelButtonProps: {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return onClose(listIndex);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 创建模态框的上下文
|
|
56
|
+
*/
|
|
57
|
+
var FunctionModalContext = /*#__PURE__*/React__default.createContext(Promise.reject);
|
|
58
|
+
/**
|
|
59
|
+
* 弹出框组件
|
|
60
|
+
* @param context 主体内容
|
|
61
|
+
* @param title 弹出框标题
|
|
62
|
+
* @param hideClose 隐藏右上角关闭图标 boolean 默认 false
|
|
63
|
+
* @param checkFunction 检查方法,返回 boolean 值,true则关闭弹窗,false反之
|
|
64
|
+
**/
|
|
65
|
+
var useModal = function useModal() {
|
|
66
|
+
return React__default.useContext(FunctionModalContext);
|
|
67
|
+
};
|
|
68
|
+
var setState;
|
|
69
|
+
/**
|
|
70
|
+
* 函数弹窗组件Provider
|
|
71
|
+
*/
|
|
72
|
+
var FunctionModalProvider = function FunctionModalProvider(_ref) {
|
|
73
|
+
var children = _ref.children;
|
|
74
|
+
// 模态框组 配置
|
|
75
|
+
var _React$useState = React__default.useState([]),
|
|
76
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
77
|
+
confirmationState = _React$useState2[0],
|
|
78
|
+
setConfirmationState = _React$useState2[1];
|
|
79
|
+
// 传出设置模态框数组hook,用于关闭所有弹窗
|
|
80
|
+
setState = function setState() {
|
|
81
|
+
setConfirmationState([]);
|
|
82
|
+
awaitingPromiseRef.current = [];
|
|
83
|
+
};
|
|
84
|
+
// 存储每个模态框的 promise 方法
|
|
85
|
+
var awaitingPromiseRef = React__default.useRef([]);
|
|
86
|
+
/**
|
|
87
|
+
* 模态框初始化方法
|
|
88
|
+
* @param options 模态框配置
|
|
89
|
+
* @return 返回一个promise 用于外部判断弹窗状态
|
|
90
|
+
*/
|
|
91
|
+
var openConfirmation = function openConfirmation(options) {
|
|
92
|
+
setConfirmationState(function (pre) {
|
|
93
|
+
pre.push(options);
|
|
94
|
+
return _toConsumableArray(pre);
|
|
95
|
+
});
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
awaitingPromiseRef.current.push({
|
|
98
|
+
resolve: resolve,
|
|
99
|
+
reject: reject
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 模态框关闭方法
|
|
105
|
+
* @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
|
|
106
|
+
* @description 关闭后会清空相关配置
|
|
107
|
+
*/
|
|
108
|
+
var handleClose = function handleClose(idx) {
|
|
109
|
+
// 是否有禁用取消停止功能的配置
|
|
110
|
+
if (confirmationState[idx] && !confirmationState[idx].disCatchOnCancel && awaitingPromiseRef.current[idx]) {
|
|
111
|
+
awaitingPromiseRef.current[idx].resolve(false);
|
|
112
|
+
} else if (awaitingPromiseRef.current[idx]) {
|
|
113
|
+
awaitingPromiseRef.current[idx].resolve(true);
|
|
114
|
+
}
|
|
115
|
+
hideDialog(idx);
|
|
116
|
+
deleteOption(idx);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* 模态框确定触发的方法
|
|
120
|
+
* @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
|
|
121
|
+
*/
|
|
122
|
+
var handleSubmit = function handleSubmit(idx) {
|
|
123
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
124
|
+
var checkFuc, jude, pRef;
|
|
125
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
126
|
+
while (1) switch (_context.prev = _context.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
checkFuc = confirmationState && confirmationState[idx] && confirmationState[idx].checkFunction;
|
|
129
|
+
jude = true; // 判断是否有检查方法,如果有则先执行检查方法
|
|
130
|
+
if (!checkFuc) {
|
|
131
|
+
_context.next = 6;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
_context.next = 5;
|
|
135
|
+
return checkFuc();
|
|
136
|
+
case 5:
|
|
137
|
+
jude = _context.sent;
|
|
138
|
+
case 6:
|
|
139
|
+
if (jude) {
|
|
140
|
+
_context.next = 8;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
return _context.abrupt("return");
|
|
144
|
+
case 8:
|
|
145
|
+
hideDialog(idx);
|
|
146
|
+
pRef = awaitingPromiseRef.current[idx];
|
|
147
|
+
deleteOption(idx, pRef);
|
|
148
|
+
case 11:
|
|
149
|
+
case "end":
|
|
150
|
+
return _context.stop();
|
|
151
|
+
}
|
|
152
|
+
}, _callee);
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* 删除模态框配置,promise 执行成功操作
|
|
157
|
+
* @param pRef 模态框的promise
|
|
158
|
+
* @param idx 模态框在模态框组里的下标
|
|
159
|
+
*/
|
|
160
|
+
var deleteOption = function deleteOption(idx, pRef) {
|
|
161
|
+
setTimeout(function () {
|
|
162
|
+
pRef && pRef.resolve(true);
|
|
163
|
+
setConfirmationState(function (pre) {
|
|
164
|
+
pre.splice(idx, 1);
|
|
165
|
+
awaitingPromiseRef.current.splice(idx, 1);
|
|
166
|
+
return _toConsumableArray(pre);
|
|
167
|
+
});
|
|
168
|
+
}, 200);
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* 隐藏模态框对应的dom
|
|
172
|
+
* @param idx 模态框在模态框数组里的下标
|
|
173
|
+
* @desc 解决异步导致的闪烁问题
|
|
174
|
+
*/
|
|
175
|
+
var hideDialog = function hideDialog(idx) {
|
|
176
|
+
var dialogEl = document.querySelectorAll('.function-modal .MuiDialog-container')[idx];
|
|
177
|
+
if (dialogEl) dialogEl.style.opacity = '0';
|
|
178
|
+
};
|
|
179
|
+
return jsxs(Fragment, {
|
|
180
|
+
children: [jsx(FunctionModalContext.Provider, {
|
|
181
|
+
value: openConfirmation,
|
|
182
|
+
children: children
|
|
183
|
+
}), confirmationState && confirmationState.map(function (option, idx) {
|
|
184
|
+
return jsx(FDialog, Object.assign({
|
|
185
|
+
listIndex: idx,
|
|
186
|
+
open: Boolean(option),
|
|
187
|
+
onSubmit: handleSubmit,
|
|
188
|
+
onClose: handleClose
|
|
189
|
+
}, option), "modal-item-".concat(idx));
|
|
190
|
+
})]
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
var useClose = function useClose() {
|
|
194
|
+
return setState;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export { FunctionModalProvider as F, useClose as a, useModal as u };
|