@para-ui/core 3.0.111-rc → 3.0.112

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.
Files changed (182) hide show
  1. package/AutoBox/index.js +9 -5
  2. package/AutoTips/index.js +11 -4
  3. package/Breadcrumbs/index.js +11 -7
  4. package/Button/index.js +12 -8
  5. package/ButtonGroup/index.js +12 -8
  6. package/Carousel/index.js +8 -4
  7. package/Cascader/index.js +11 -7
  8. package/Checkbox/index.js +8 -4
  9. package/CheckboxGroup/index.js +8 -4
  10. package/Collapse/index.js +5 -1
  11. package/CollapseBox/index.js +8 -4
  12. package/CollapseLayout/index.js +10 -6
  13. package/ColorPicker/index.js +2 -0
  14. package/ComboSelect/index.js +18 -14
  15. package/Container/index.js +5 -1
  16. package/DatePicker/index.js +14 -10
  17. package/Desktop/index.js +14 -10
  18. package/DragVerify/index.js +10 -6
  19. package/Drawer/index.js +12 -8
  20. package/Dropdown/index.js +4 -3
  21. package/DynamicMultiBox/index.js +19 -15
  22. package/Empty/index.js +7 -3
  23. package/Form/index.js +16 -15
  24. package/FormItem/index.js +16 -15
  25. package/FunctionModal/index.js +15 -14
  26. package/GlobalContext/index.js +3 -3
  27. package/Help/index.js +8 -4
  28. package/HelperText/index.js +5 -1
  29. package/InputLang/index.js +15 -11
  30. package/InputNumber/index.js +8 -4
  31. package/Label/index.js +8 -4
  32. package/Loading/index.js +5 -1
  33. package/Menu/index.js +9 -5
  34. package/Message/index.js +8 -4
  35. package/Modal/index.js +17 -10
  36. package/MultiBox/index.js +14 -10
  37. package/Notification/index.js +7 -3
  38. package/OperateBtn/index.js +13 -9
  39. package/PageHeader/index.js +13 -9
  40. package/Pagination/index.js +15 -11
  41. package/ParauiProvider/index.js +7 -3
  42. package/PasswordRules/index.js +7 -3
  43. package/PopConfirm/index.js +12 -8
  44. package/Popover/index.js +9 -5
  45. package/Progress/index.js +6 -2
  46. package/Querying/index.js +7 -3
  47. package/README.md +5 -0
  48. package/Radio/index.js +8 -4
  49. package/RadioGroup/index.js +8 -4
  50. package/Search/index.js +13 -9
  51. package/Select/index.js +15 -11
  52. package/SelectInput/index.js +12 -11
  53. package/Selector/index.js +24 -11
  54. package/SelectorPicker/index.js +16 -12
  55. package/SingleBox/index.js +14 -10
  56. package/Slider/index.js +10 -6
  57. package/Split/index.js +8 -4
  58. package/Status/index.js +5 -1
  59. package/Stepper/index.js +7 -3
  60. package/Styles/theme.scss +69 -1
  61. package/Switch/index.js +10 -6
  62. package/Table/index.js +37 -12
  63. package/Tabs/index.js +13 -9
  64. package/Tag/index.js +11 -7
  65. package/TextEditor/index.js +12 -5
  66. package/TextField/index.js +12 -8
  67. package/TimePicker/index.js +11 -10
  68. package/Timeline/index.js +8 -4
  69. package/Title/index.js +5 -1
  70. package/ToggleButton/index.js +13 -9
  71. package/Tooltip/index.js +8 -4
  72. package/Transfer/index.js +17 -13
  73. package/Tree/index.js +13 -12
  74. package/Upload/index.js +28 -12
  75. package/_verture/{defineProperty-a3595bb4.js → defineProperty-62acccfc.js} +1 -1
  76. package/_verture/{index-1e744dcd.js → index-3414a559.js} +11 -4
  77. package/_verture/{closestPolyfill-230b7b1c.js → index-48dc6207.js} +15 -8
  78. package/_verture/{index-4ee4e41a.js → index-77f9e0fb.js} +6 -2
  79. package/_verture/index-a369ca3f.js +4 -0
  80. package/_verture/{intl-e0637ffc.js → intl-4a9f1b44.js} +1 -1
  81. package/_verture/{modalContext-7312fb44.js → modalContext-305f73f4.js} +8 -4
  82. package/_verture/{slicedToArray-e838a33c.js → slicedToArray-76060636.js} +1 -1
  83. package/_verture/style-inject.es-300983ab.js +28 -0
  84. package/_verture/{toConsumableArray-037466a3.js → toConsumableArray-81040c9e.js} +1 -1
  85. package/_verture/{utils-1b82eac1.js → utils-1ffeadec.js} +1 -1
  86. package/index.d.ts +2 -0
  87. package/index.js +23 -20
  88. package/locale/en-US.d.ts +165 -0
  89. package/locale/index.d.ts +331 -0
  90. package/locale/index.js +336 -0
  91. package/locale/zh-CN.d.ts +165 -0
  92. package/package.json +1 -4
  93. package/umd/Breadcrumbs.js +1 -1
  94. package/umd/Button.js +1 -1
  95. package/umd/ButtonGroup.js +1 -1
  96. package/umd/Checkbox.js +1 -1
  97. package/umd/CheckboxGroup.js +1 -1
  98. package/umd/CollapseLayout.js +4 -4
  99. package/umd/ComboSelect.js +1 -1
  100. package/umd/DatePicker.js +1 -1
  101. package/umd/Desktop.js +1 -1
  102. package/umd/DragVerify.js +1 -1
  103. package/umd/Drawer.js +1 -1
  104. package/umd/DynamicMultiBox.js +1 -1
  105. package/umd/Empty.js +1 -1
  106. package/umd/Form.js +1 -1
  107. package/umd/FormItem.js +1 -1
  108. package/umd/FunctionModal.js +1 -1
  109. package/umd/Help.js +1 -1
  110. package/umd/InputLang.js +1 -1
  111. package/umd/InputNumber.js +1 -1
  112. package/umd/Label.js +1 -1
  113. package/umd/Menu.js +3 -3
  114. package/umd/Message.js +1 -1
  115. package/umd/Modal.js +1 -1
  116. package/umd/MultiBox.js +1 -1
  117. package/umd/Notification.js +1 -1
  118. package/umd/OperateBtn.js +1 -1
  119. package/umd/PageHeader.js +7 -7
  120. package/umd/Pagination.js +4 -4
  121. package/umd/PopConfirm.js +1 -1
  122. package/umd/Progress.js +1 -1
  123. package/umd/Radio.js +1 -1
  124. package/umd/RadioGroup.js +1 -1
  125. package/umd/Search.js +1 -1
  126. package/umd/Select.js +1 -1
  127. package/umd/SelectInput.js +1 -1
  128. package/umd/Selector.js +1 -1
  129. package/umd/SelectorPicker.js +1 -1
  130. package/umd/SingleBox.js +1 -1
  131. package/umd/Slider.js +1 -1
  132. package/umd/Stepper.js +4 -4
  133. package/umd/Switch.js +4 -4
  134. package/umd/Table.js +1 -1
  135. package/umd/Tabs.js +1 -1
  136. package/umd/Tag.js +1 -1
  137. package/umd/TextEditor.js +1 -1
  138. package/umd/TextField.js +1 -1
  139. package/umd/TimePicker.js +1 -1
  140. package/umd/Timeline.js +1 -1
  141. package/umd/Title.js +1 -1
  142. package/umd/ToggleButton.js +1 -1
  143. package/umd/Transfer.js +1 -1
  144. package/umd/Tree.js +1 -1
  145. package/umd/Upload.js +1 -1
  146. package/umd/locale.js +1 -0
  147. package/Styles/theme/theme-api.scss +0 -75
  148. package/Styles/theme/theme-default.scss +0 -74
  149. package/Styles/theme/theme-shrcb.scss +0 -80
  150. package/_verture/closestPolyfill-0ea0e7a5.js +0 -1354
  151. package/_verture/constant-d26faf32.js +0 -10
  152. package/_verture/defineProperty-d7016ad3.js +0 -34
  153. package/_verture/index-59046762.js +0 -232
  154. package/_verture/index-66004ebf.js +0 -757
  155. package/_verture/index-eefd3ff1.js +0 -18
  156. package/_verture/index-fe55d90e.js +0 -340
  157. package/_verture/intl-638e7f5e.js +0 -81
  158. package/_verture/modalContext-762c9eb8.js +0 -197
  159. package/_verture/slicedToArray-cf682b7d.js +0 -43
  160. package/_verture/sortable.esm-d3f0b100.js +0 -3791
  161. package/_verture/toConsumableArray-2f4549d3.js +0 -19
  162. package/_verture/tslib.es6-9e8a62ad.js +0 -38
  163. package/_verture/typeof-ef74f13b.js +0 -11
  164. package/_verture/unsupportedIterableToArray-bd7e0e01.js +0 -16
  165. package/_verture/useFormatMessage-e3507273.js +0 -20
  166. package/_verture/useGlobalProps-c2be96c7.js +0 -11
  167. package/_verture/usePopupContainer-dde75227.js +0 -68
  168. package/_verture/util-9d3101fc.js +0 -18
  169. package/_verture/utils-cc6f5f94.js +0 -92
  170. package/theme/theme-shrcb.css +0 -14622
  171. package/theme/theme.css +0 -15018
  172. /package/_verture/{constant-ce36e642.js → constant-66aa48a1.js} +0 -0
  173. /package/_verture/{index-a055cc71.js → index-65bbd1e4.js} +0 -0
  174. /package/_verture/{index-67a00291.js → index-beef914f.js} +0 -0
  175. /package/_verture/{sortable.esm-5dbbc690.js → sortable.esm-49896035.js} +0 -0
  176. /package/_verture/{tslib.es6-44149323.js → tslib.es6-55ed4bd2.js} +0 -0
  177. /package/_verture/{typeof-c4ef74bc.js → typeof-498dd2b1.js} +0 -0
  178. /package/_verture/{unsupportedIterableToArray-6655197b.js → unsupportedIterableToArray-cb478f24.js} +0 -0
  179. /package/_verture/{useFormatMessage-8394ec71.js → useFormatMessage-703f8b20.js} +0 -0
  180. /package/_verture/{useGlobalProps-929e5233.js → useGlobalProps-1b846a65.js} +0 -0
  181. /package/_verture/{usePopupContainer-6fa1cc58.js → usePopupContainer-87febeb9.js} +0 -0
  182. /package/_verture/{util-8a7a5c8d.js → util-7e1fb1e2.js} +0 -0
@@ -1,18 +0,0 @@
1
- var en = {
2
- cancel: 'Cancel',
3
- ok: 'Ok'
4
- };
5
-
6
- var zh = {
7
- cancel: '取消',
8
- ok: '确定'
9
- };
10
-
11
- var defaultModalLocale = {
12
- zh: zh,
13
- en: en,
14
- 'zh-CN': zh,
15
- 'en-US': en
16
- };
17
-
18
- export { defaultModalLocale as d };
@@ -1,340 +0,0 @@
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,81 +0,0 @@
1
- import { _ as _typeof } from './typeof-c4ef74bc.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,197 +0,0 @@
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 };
@@ -1,43 +0,0 @@
1
- import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-bd7e0e01.js';
2
-
3
- function _arrayWithHoles(arr) {
4
- if (Array.isArray(arr)) return arr;
5
- }
6
-
7
- function _iterableToArrayLimit(arr, i) {
8
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
9
- if (null != _i) {
10
- var _s,
11
- _e,
12
- _x,
13
- _r,
14
- _arr = [],
15
- _n = !0,
16
- _d = !1;
17
- try {
18
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
19
- if (Object(_i) !== _i) return;
20
- _n = !1;
21
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
22
- } catch (err) {
23
- _d = !0, _e = err;
24
- } finally {
25
- try {
26
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
27
- } finally {
28
- if (_d) throw _e;
29
- }
30
- }
31
- return _arr;
32
- }
33
- }
34
-
35
- function _nonIterableRest() {
36
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
37
- }
38
-
39
- function _slicedToArray(arr, i) {
40
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
41
- }
42
-
43
- export { _slicedToArray as _ };