@para-ui/core 3.0.108 → 3.0.109-rc.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.
Files changed (183) hide show
  1. package/AutoBox/index.js +5 -9
  2. package/AutoTips/index.js +5 -12
  3. package/Breadcrumbs/index.js +7 -11
  4. package/Button/index.js +8 -12
  5. package/ButtonGroup/index.js +8 -12
  6. package/Carousel/index.js +4 -8
  7. package/Cascader/index.js +7 -11
  8. package/Checkbox/index.js +4 -8
  9. package/CheckboxGroup/index.js +4 -8
  10. package/Collapse/index.js +1 -5
  11. package/CollapseBox/index.js +4 -8
  12. package/CollapseLayout/index.js +6 -10
  13. package/ColorPicker/index.js +0 -2
  14. package/ComboSelect/index.js +14 -18
  15. package/Container/index.js +1 -5
  16. package/DatePicker/index.js +10 -14
  17. package/Desktop/index.js +10 -14
  18. package/DragVerify/index.js +6 -10
  19. package/Drawer/index.js +8 -12
  20. package/Dropdown/index.js +3 -4
  21. package/DynamicMultiBox/index.js +15 -19
  22. package/Empty/index.js +3 -7
  23. package/Form/index.js +15 -16
  24. package/FormItem/index.js +15 -16
  25. package/FunctionModal/index.js +14 -15
  26. package/GlobalContext/index.js +3 -3
  27. package/Help/index.js +4 -8
  28. package/HelperText/index.js +1 -5
  29. package/InputLang/index.js +11 -15
  30. package/InputNumber/index.js +4 -8
  31. package/Label/index.js +4 -8
  32. package/Loading/index.js +1 -5
  33. package/Menu/index.js +5 -9
  34. package/Message/index.js +4 -8
  35. package/Modal/index.js +10 -17
  36. package/MultiBox/index.js +10 -14
  37. package/Notification/index.js +3 -7
  38. package/OperateBtn/index.js +9 -13
  39. package/PageHeader/index.js +9 -13
  40. package/Pagination/index.js +11 -15
  41. package/ParauiProvider/index.js +3 -7
  42. package/PasswordRules/index.js +3 -7
  43. package/PopConfirm/index.js +8 -12
  44. package/Popover/index.js +5 -9
  45. package/Progress/index.js +2 -6
  46. package/Querying/index.js +3 -7
  47. package/README.md +5 -0
  48. package/Radio/index.js +4 -8
  49. package/RadioGroup/index.js +4 -8
  50. package/Search/index.js +9 -13
  51. package/Select/index.js +11 -15
  52. package/SelectInput/index.js +11 -12
  53. package/Selector/index.js +11 -24
  54. package/SelectorPicker/index.js +12 -16
  55. package/SingleBox/index.js +10 -14
  56. package/Slider/index.js +6 -10
  57. package/Split/index.js +4 -8
  58. package/Status/index.js +1 -5
  59. package/Stepper/index.js +3 -7
  60. package/Styles/theme/theme-api.scss +75 -0
  61. package/Styles/theme/theme-default.scss +74 -0
  62. package/Styles/theme/theme-shrcb.scss +80 -0
  63. package/Styles/theme.scss +1 -69
  64. package/Switch/index.js +6 -10
  65. package/Table/index.js +12 -37
  66. package/Tabs/index.js +9 -13
  67. package/Tag/index.js +7 -11
  68. package/TextEditor/index.js +5 -12
  69. package/TextField/index.js +8 -12
  70. package/TimePicker/index.js +10 -11
  71. package/Timeline/index.js +4 -8
  72. package/Title/index.js +1 -5
  73. package/ToggleButton/index.js +9 -13
  74. package/Tooltip/index.js +4 -8
  75. package/Transfer/index.js +13 -17
  76. package/Tree/index.js +12 -13
  77. package/Upload/index.js +12 -28
  78. package/_verture/{index-519a9fdf.js → closestPolyfill-af1e3129.js} +8 -15
  79. package/_verture/closestPolyfill-c45cda78.js +1354 -0
  80. package/_verture/constant-60484ff1.js +10 -0
  81. package/_verture/{defineProperty-62acccfc.js → defineProperty-7aa4e7b0.js} +1 -1
  82. package/_verture/defineProperty-e2de1981.js +34 -0
  83. package/_verture/{index-77f9e0fb.js → index-0b16a77e.js} +2 -6
  84. package/_verture/{index-8bad96b3.js → index-76c48610.js} +4 -11
  85. package/_verture/index-7cb40909.js +757 -0
  86. package/_verture/index-a63894d0.js +232 -0
  87. package/_verture/index-c8575171.js +340 -0
  88. package/_verture/index-ef1e15e8.js +18 -0
  89. package/_verture/{intl-4a9f1b44.js → intl-4ad778ba.js} +1 -1
  90. package/_verture/intl-519338cb.js +81 -0
  91. package/_verture/{modalContext-da105e06.js → modalContext-2256753f.js} +4 -8
  92. package/_verture/modalContext-fc6309c5.js +197 -0
  93. package/_verture/{slicedToArray-76060636.js → slicedToArray-545d9fcd.js} +1 -1
  94. package/_verture/slicedToArray-94962ec5.js +43 -0
  95. package/_verture/sortable.esm-c0270144.js +3791 -0
  96. package/_verture/{toConsumableArray-81040c9e.js → toConsumableArray-295100d6.js} +1 -1
  97. package/_verture/toConsumableArray-a444c3ba.js +19 -0
  98. package/_verture/tslib.es6-b07fd47a.js +38 -0
  99. package/_verture/typeof-99c4c2af.js +11 -0
  100. package/_verture/unsupportedIterableToArray-e9a428c9.js +16 -0
  101. package/_verture/useFormatMessage-5777ad0a.js +20 -0
  102. package/_verture/useGlobalProps-fbb58670.js +11 -0
  103. package/_verture/usePopupContainer-b086ca46.js +68 -0
  104. package/_verture/util-d56ad080.js +18 -0
  105. package/_verture/{utils-1ffeadec.js → utils-2e9c05bc.js} +1 -1
  106. package/_verture/utils-5e4b0846.js +92 -0
  107. package/index.d.ts +0 -2
  108. package/index.js +20 -23
  109. package/package.json +4 -1
  110. package/theme/theme-shrcb.css +14600 -0
  111. package/theme/theme.css +14996 -0
  112. package/umd/AutoTips.js +1 -1
  113. package/umd/Breadcrumbs.js +1 -1
  114. package/umd/Button.js +1 -1
  115. package/umd/ButtonGroup.js +1 -1
  116. package/umd/Checkbox.js +1 -1
  117. package/umd/CheckboxGroup.js +1 -1
  118. package/umd/CollapseLayout.js +3 -3
  119. package/umd/ComboSelect.js +1 -1
  120. package/umd/DatePicker.js +1 -1
  121. package/umd/Desktop.js +1 -1
  122. package/umd/DragVerify.js +1 -1
  123. package/umd/Drawer.js +1 -1
  124. package/umd/DynamicMultiBox.js +1 -1
  125. package/umd/Empty.js +1 -1
  126. package/umd/Form.js +1 -1
  127. package/umd/FormItem.js +1 -1
  128. package/umd/FunctionModal.js +1 -1
  129. package/umd/Help.js +1 -1
  130. package/umd/InputLang.js +1 -1
  131. package/umd/InputNumber.js +1 -1
  132. package/umd/Label.js +1 -1
  133. package/umd/Menu.js +3 -3
  134. package/umd/Message.js +1 -1
  135. package/umd/Modal.js +1 -1
  136. package/umd/MultiBox.js +1 -1
  137. package/umd/Notification.js +1 -1
  138. package/umd/OperateBtn.js +1 -1
  139. package/umd/PageHeader.js +7 -7
  140. package/umd/Pagination.js +4 -4
  141. package/umd/PopConfirm.js +1 -1
  142. package/umd/Progress.js +1 -1
  143. package/umd/Radio.js +1 -1
  144. package/umd/RadioGroup.js +1 -1
  145. package/umd/Search.js +1 -1
  146. package/umd/Select.js +1 -1
  147. package/umd/SelectInput.js +1 -1
  148. package/umd/Selector.js +1 -1
  149. package/umd/SelectorPicker.js +1 -1
  150. package/umd/SingleBox.js +1 -1
  151. package/umd/Slider.js +1 -1
  152. package/umd/Stepper.js +4 -4
  153. package/umd/Switch.js +4 -4
  154. package/umd/Table.js +1 -1
  155. package/umd/Tabs.js +1 -1
  156. package/umd/Tag.js +1 -1
  157. package/umd/TextEditor.js +1 -1
  158. package/umd/TextField.js +1 -1
  159. package/umd/TimePicker.js +1 -1
  160. package/umd/Timeline.js +1 -1
  161. package/umd/Title.js +1 -1
  162. package/umd/ToggleButton.js +1 -1
  163. package/umd/Transfer.js +1 -1
  164. package/umd/Tree.js +1 -1
  165. package/umd/Upload.js +1 -1
  166. package/_verture/index-a369ca3f.js +0 -4
  167. package/_verture/style-inject.es-300983ab.js +0 -28
  168. package/locale/en-US.d.ts +0 -165
  169. package/locale/index.d.ts +0 -331
  170. package/locale/index.js +0 -336
  171. package/locale/zh-CN.d.ts +0 -165
  172. package/umd/locale.js +0 -1
  173. /package/_verture/{constant-66aa48a1.js → constant-4091d66f.js} +0 -0
  174. /package/_verture/{index-65bbd1e4.js → index-1fdf8def.js} +0 -0
  175. /package/_verture/{index-beef914f.js → index-6faec6b4.js} +0 -0
  176. /package/_verture/{sortable.esm-49896035.js → sortable.esm-2593ef9b.js} +0 -0
  177. /package/_verture/{tslib.es6-55ed4bd2.js → tslib.es6-24e733a1.js} +0 -0
  178. /package/_verture/{typeof-498dd2b1.js → typeof-3d6c2390.js} +0 -0
  179. /package/_verture/{unsupportedIterableToArray-cb478f24.js → unsupportedIterableToArray-2fb1516b.js} +0 -0
  180. /package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-45bb2ce2.js} +0 -0
  181. /package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-be263385.js} +0 -0
  182. /package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-09af2ab3.js} +0 -0
  183. /package/_verture/{util-7e1fb1e2.js → util-2a5a3b41.js} +0 -0
@@ -0,0 +1,232 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import RcDropdown from 'rc-dropdown';
4
+ import { a as $rcPrefixCls, $ as $prefixCls } from './constant-4091d66f.js';
5
+ import { g as getNearestOverflowAncestor, u as usePopupContainer } from './usePopupContainer-09af2ab3.js';
6
+ import clsx from 'clsx';
7
+ import dayjs from 'dayjs';
8
+ import { UUID } from '@paraview/lib';
9
+
10
+ function getPlaceholder(picker, locale, customizePlaceholder) {
11
+ if (customizePlaceholder !== undefined) {
12
+ return customizePlaceholder;
13
+ }
14
+ if (picker === 'year' && locale.lang.yearPlaceholder) {
15
+ return locale.lang.yearPlaceholder;
16
+ }
17
+ if (picker === 'quarter' && locale.lang.quarterPlaceholder) {
18
+ return locale.lang.quarterPlaceholder;
19
+ }
20
+ if (picker === 'month' && locale.lang.monthPlaceholder) {
21
+ return locale.lang.monthPlaceholder;
22
+ }
23
+ if (picker === 'week' && locale.lang.weekPlaceholder) {
24
+ return locale.lang.weekPlaceholder;
25
+ }
26
+ if (picker === 'time' && locale.timePickerLocale.placeholder) {
27
+ return locale.timePickerLocale.placeholder;
28
+ }
29
+ return locale.lang.placeholder;
30
+ }
31
+ function getRangePlaceholder(picker, locale, customizePlaceholder) {
32
+ if (customizePlaceholder !== undefined) {
33
+ return customizePlaceholder;
34
+ }
35
+ if (picker === 'year' && locale.lang.yearPlaceholder) {
36
+ return locale.lang.rangeYearPlaceholder;
37
+ }
38
+ if (picker === 'month' && locale.lang.monthPlaceholder) {
39
+ return locale.lang.rangeMonthPlaceholder;
40
+ }
41
+ if (picker === 'week' && locale.lang.weekPlaceholder) {
42
+ return locale.lang.rangeWeekPlaceholder;
43
+ }
44
+ if (picker === 'time' && locale.timePickerLocale.placeholder) {
45
+ return locale.timePickerLocale.rangePlaceholder;
46
+ }
47
+ return locale.lang.rangePlaceholder;
48
+ }
49
+ function toArray(list) {
50
+ if (!list) {
51
+ return [];
52
+ }
53
+ return Array.isArray(list) ? list : [list];
54
+ }
55
+ function getTimeProps(props) {
56
+ var format = props.format,
57
+ picker = props.picker,
58
+ showHour = props.showHour,
59
+ showMinute = props.showMinute,
60
+ showSecond = props.showSecond,
61
+ use12Hours = props.use12Hours;
62
+ var firstFormat = toArray(format)[0];
63
+ var showTimeObj = Object.assign({}, props);
64
+ if (firstFormat && typeof firstFormat === 'string') {
65
+ if (!firstFormat.includes('s') && showSecond === undefined) {
66
+ showTimeObj.showSecond = false;
67
+ }
68
+ if (!firstFormat.includes('m') && showMinute === undefined) {
69
+ showTimeObj.showMinute = false;
70
+ }
71
+ if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) {
72
+ showTimeObj.showHour = false;
73
+ }
74
+ if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) {
75
+ showTimeObj.use12Hours = true;
76
+ }
77
+ }
78
+ if (picker === 'time') {
79
+ return showTimeObj;
80
+ }
81
+ if (typeof firstFormat === 'function') {
82
+ delete showTimeObj.format;
83
+ }
84
+ return {
85
+ showTime: showTimeObj
86
+ };
87
+ }
88
+ function formatPickerValue(value, format) {
89
+ if (typeof value === 'string') {
90
+ if (value === '') return null;
91
+ if (format) {
92
+ if (dayjs(value, format).isValid()) return dayjs(value, format);
93
+ } else {
94
+ if (dayjs(value).isValid()) return dayjs(value);
95
+ }
96
+ return null;
97
+ }
98
+ return value;
99
+ }
100
+ function mergedLocale(locale, defaultLocale) {
101
+ var lang = Object.assign(Object.assign({}, defaultLocale === null || defaultLocale === void 0 ? void 0 : defaultLocale.lang), (locale === null || locale === void 0 ? void 0 : locale.lang) || {});
102
+ var timePickerLocale = Object.assign(Object.assign({}, defaultLocale === null || defaultLocale === void 0 ? void 0 : defaultLocale.timePickerLocale), (locale === null || locale === void 0 ? void 0 : locale.timeLang) || {});
103
+ return {
104
+ lang: lang,
105
+ timePickerLocale: timePickerLocale
106
+ };
107
+ }
108
+ //最近的绝对定位滚动元素
109
+ function getNearestAbsoluteAncestor(node, pos) {
110
+ var _a;
111
+ var parentNode = node.parentNode;
112
+ var nodeName = ((_a = parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
113
+ if (['html', 'body', '#document'].includes(nodeName)) {
114
+ return null;
115
+ }
116
+ if (parentNode instanceof window.HTMLElement) {
117
+ var _window$getComputedSt = window.getComputedStyle(parentNode),
118
+ position = _window$getComputedSt.position;
119
+ if (new RegExp(pos).test(position)) return parentNode;
120
+ }
121
+ return getNearestAbsoluteAncestor(parentNode, pos);
122
+ }
123
+ //下拉弹出框关闭时,隔离dom污染
124
+ function isolationPopupPollution(open, uniqueCls) {
125
+ var popupDom = document.getElementsByClassName("".concat(uniqueCls))[0];
126
+ if (!popupDom) return;
127
+ var position = open ? 'fixed' : 'absolute';
128
+ var nearestDom = getNearestAbsoluteAncestor(popupDom, position);
129
+ if (!nearestDom) return;
130
+ if (!open) {
131
+ //关闭弹框
132
+ nearestDom.style.position = 'fixed';
133
+ nearestDom.style.left = '-9999px';
134
+ nearestDom.style.top = '-9999px';
135
+ } else {
136
+ //打开弹框
137
+ nearestDom.style.position = 'absolute';
138
+ nearestDom.style.left = '0';
139
+ nearestDom.style.top = '0';
140
+ }
141
+ }
142
+ //浮层渲染容器
143
+ function getPopupContainer(triggerNode, customizeContainer, that) {
144
+ var _a, _b;
145
+ var container;
146
+ if (!customizeContainer) {
147
+ var rootNode = that.wrapRef.current;
148
+ if (rootNode) {
149
+ container = getNearestOverflowAncestor(rootNode);
150
+ var scrollHeight = container.scrollHeight;
151
+ var clientHeight = container.clientHeight;
152
+ if (scrollHeight <= clientHeight) {
153
+ container = document.body;
154
+ }
155
+ } else {
156
+ container = document.body;
157
+ }
158
+ var nodeName = (_a = container.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
159
+ if (nodeName !== 'body') {
160
+ if (((_b = window.getComputedStyle(container)) === null || _b === void 0 ? void 0 : _b.position) === 'static') {
161
+ container.style.position = 'relative';
162
+ }
163
+ }
164
+ that.popupRecord = container;
165
+ } else {
166
+ container = customizeContainer(triggerNode) || document.body;
167
+ }
168
+ return container;
169
+ }
170
+
171
+ //dropdown偏移量
172
+ var getDropdownOffset = function getDropdownOffset(place) {
173
+ var _a, _b;
174
+ var offsetMap = {
175
+ top: {
176
+ offset: [0, -8]
177
+ },
178
+ topLeft: {
179
+ offset: [0, -8]
180
+ },
181
+ topRight: {
182
+ offset: [0, -8]
183
+ },
184
+ bottom: {
185
+ offset: [0, 8]
186
+ },
187
+ bottomRight: {
188
+ offset: [0, 8]
189
+ },
190
+ bottomLeft: {
191
+ offset: [0, 8]
192
+ }
193
+ };
194
+ return (_b = (_a = offsetMap[place]) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : [0, 0];
195
+ };
196
+ //dropdown
197
+ var Dropdown = function Dropdown(props) {
198
+ var wrapRef = React__default.useRef();
199
+ var getPopupContainer = usePopupContainer(wrapRef, props.getPopupContainer);
200
+ var uuidRef = React__default.useRef(UUID());
201
+ //visible change
202
+ var handleVisibleChange = function handleVisibleChange(visible) {
203
+ var _a;
204
+ (_a = props.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(props, visible);
205
+ if (props.isolationPopupOnHide) {
206
+ //关闭时隔离dom污染
207
+ isolationPopupPollution(visible, uuidRef.current);
208
+ }
209
+ };
210
+ return jsx(RcDropdown, Object.assign({}, props, {
211
+ prefixCls: "".concat($rcPrefixCls, "-dropdown"),
212
+ overlayClassName: clsx("".concat($prefixCls, "-dropdown"), props.overlayClassName, uuidRef.current),
213
+ animation: "slide-up",
214
+ align: {
215
+ offset: getDropdownOffset(props.placement)
216
+ },
217
+ getPopupContainer: getPopupContainer,
218
+ ref: wrapRef,
219
+ onVisibleChange: handleVisibleChange
220
+ }, {
221
+ children: props.children
222
+ }));
223
+ };
224
+ Dropdown.defaultProps = {
225
+ mouseEnterDelay: 0.15,
226
+ mouseLeaveDelay: 0.1,
227
+ trigger: ['hover'],
228
+ placement: 'bottomRight',
229
+ isolationPopupOnHide: false
230
+ };
231
+
232
+ export { Dropdown as D, getPlaceholder as a, getPopupContainer as b, getRangePlaceholder as c, formatPickerValue as f, getTimeProps as g, isolationPopupPollution as i, mergedLocale as m };
@@ -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 };
@@ -0,0 +1,18 @@
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,4 +1,4 @@
1
- import { _ as _typeof } from './typeof-498dd2b1.js';
1
+ import { _ as _typeof } from './typeof-3d6c2390.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-99c4c2af.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 };