@para-ui/core 3.0.111-rc → 3.0.111

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 (181) 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/Radio/index.js +8 -4
  48. package/RadioGroup/index.js +8 -4
  49. package/Search/index.js +13 -9
  50. package/Select/index.js +15 -11
  51. package/SelectInput/index.js +12 -11
  52. package/Selector/index.js +24 -11
  53. package/SelectorPicker/index.js +16 -12
  54. package/SingleBox/index.js +14 -10
  55. package/Slider/index.js +10 -6
  56. package/Split/index.js +8 -4
  57. package/Status/index.js +5 -1
  58. package/Stepper/index.js +7 -3
  59. package/Styles/theme.scss +69 -1
  60. package/Switch/index.js +10 -6
  61. package/Table/index.js +37 -12
  62. package/Tabs/index.js +13 -9
  63. package/Tag/index.js +11 -7
  64. package/TextEditor/index.js +12 -5
  65. package/TextField/index.js +12 -8
  66. package/TimePicker/index.js +11 -10
  67. package/Timeline/index.js +8 -4
  68. package/Title/index.js +5 -1
  69. package/ToggleButton/index.js +13 -9
  70. package/Tooltip/index.js +8 -4
  71. package/Transfer/index.js +17 -13
  72. package/Tree/index.js +13 -12
  73. package/Upload/index.js +28 -12
  74. package/_verture/{defineProperty-a3595bb4.js → defineProperty-62acccfc.js} +1 -1
  75. package/_verture/{index-1e744dcd.js → index-3414a559.js} +11 -4
  76. package/_verture/{closestPolyfill-230b7b1c.js → index-48dc6207.js} +15 -8
  77. package/_verture/{index-4ee4e41a.js → index-77f9e0fb.js} +6 -2
  78. package/_verture/index-a369ca3f.js +4 -0
  79. package/_verture/{intl-e0637ffc.js → intl-4a9f1b44.js} +1 -1
  80. package/_verture/{modalContext-7312fb44.js → modalContext-305f73f4.js} +8 -4
  81. package/_verture/{slicedToArray-e838a33c.js → slicedToArray-76060636.js} +1 -1
  82. package/_verture/style-inject.es-300983ab.js +28 -0
  83. package/_verture/{toConsumableArray-037466a3.js → toConsumableArray-81040c9e.js} +1 -1
  84. package/_verture/{utils-1b82eac1.js → utils-1ffeadec.js} +1 -1
  85. package/index.d.ts +2 -0
  86. package/index.js +23 -20
  87. package/locale/en-US.d.ts +165 -0
  88. package/locale/index.d.ts +331 -0
  89. package/locale/index.js +336 -0
  90. package/locale/zh-CN.d.ts +165 -0
  91. package/package.json +1 -4
  92. package/umd/Breadcrumbs.js +1 -1
  93. package/umd/Button.js +1 -1
  94. package/umd/ButtonGroup.js +1 -1
  95. package/umd/Checkbox.js +1 -1
  96. package/umd/CheckboxGroup.js +1 -1
  97. package/umd/CollapseLayout.js +3 -3
  98. package/umd/ComboSelect.js +1 -1
  99. package/umd/DatePicker.js +1 -1
  100. package/umd/Desktop.js +1 -1
  101. package/umd/DragVerify.js +1 -1
  102. package/umd/Drawer.js +1 -1
  103. package/umd/DynamicMultiBox.js +1 -1
  104. package/umd/Empty.js +1 -1
  105. package/umd/Form.js +1 -1
  106. package/umd/FormItem.js +1 -1
  107. package/umd/FunctionModal.js +1 -1
  108. package/umd/Help.js +1 -1
  109. package/umd/InputLang.js +1 -1
  110. package/umd/InputNumber.js +1 -1
  111. package/umd/Label.js +1 -1
  112. package/umd/Menu.js +3 -3
  113. package/umd/Message.js +1 -1
  114. package/umd/Modal.js +1 -1
  115. package/umd/MultiBox.js +1 -1
  116. package/umd/Notification.js +1 -1
  117. package/umd/OperateBtn.js +1 -1
  118. package/umd/PageHeader.js +7 -7
  119. package/umd/Pagination.js +4 -4
  120. package/umd/PopConfirm.js +1 -1
  121. package/umd/Progress.js +1 -1
  122. package/umd/Radio.js +1 -1
  123. package/umd/RadioGroup.js +1 -1
  124. package/umd/Search.js +1 -1
  125. package/umd/Select.js +1 -1
  126. package/umd/SelectInput.js +1 -1
  127. package/umd/Selector.js +1 -1
  128. package/umd/SelectorPicker.js +1 -1
  129. package/umd/SingleBox.js +1 -1
  130. package/umd/Slider.js +1 -1
  131. package/umd/Stepper.js +4 -4
  132. package/umd/Switch.js +4 -4
  133. package/umd/Table.js +1 -1
  134. package/umd/Tabs.js +1 -1
  135. package/umd/Tag.js +1 -1
  136. package/umd/TextEditor.js +1 -1
  137. package/umd/TextField.js +1 -1
  138. package/umd/TimePicker.js +1 -1
  139. package/umd/Timeline.js +1 -1
  140. package/umd/Title.js +1 -1
  141. package/umd/ToggleButton.js +1 -1
  142. package/umd/Transfer.js +1 -1
  143. package/umd/Tree.js +1 -1
  144. package/umd/Upload.js +1 -1
  145. package/umd/locale.js +1 -0
  146. package/Styles/theme/theme-api.scss +0 -75
  147. package/Styles/theme/theme-default.scss +0 -74
  148. package/Styles/theme/theme-shrcb.scss +0 -80
  149. package/_verture/closestPolyfill-0ea0e7a5.js +0 -1354
  150. package/_verture/constant-d26faf32.js +0 -10
  151. package/_verture/defineProperty-d7016ad3.js +0 -34
  152. package/_verture/index-59046762.js +0 -232
  153. package/_verture/index-66004ebf.js +0 -757
  154. package/_verture/index-eefd3ff1.js +0 -18
  155. package/_verture/index-fe55d90e.js +0 -340
  156. package/_verture/intl-638e7f5e.js +0 -81
  157. package/_verture/modalContext-762c9eb8.js +0 -197
  158. package/_verture/slicedToArray-cf682b7d.js +0 -43
  159. package/_verture/sortable.esm-d3f0b100.js +0 -3791
  160. package/_verture/toConsumableArray-2f4549d3.js +0 -19
  161. package/_verture/tslib.es6-9e8a62ad.js +0 -38
  162. package/_verture/typeof-ef74f13b.js +0 -11
  163. package/_verture/unsupportedIterableToArray-bd7e0e01.js +0 -16
  164. package/_verture/useFormatMessage-e3507273.js +0 -20
  165. package/_verture/useGlobalProps-c2be96c7.js +0 -11
  166. package/_verture/usePopupContainer-dde75227.js +0 -68
  167. package/_verture/util-9d3101fc.js +0 -18
  168. package/_verture/utils-cc6f5f94.js +0 -92
  169. package/theme/theme-shrcb.css +0 -14622
  170. package/theme/theme.css +0 -15018
  171. /package/_verture/{constant-ce36e642.js → constant-66aa48a1.js} +0 -0
  172. /package/_verture/{index-a055cc71.js → index-65bbd1e4.js} +0 -0
  173. /package/_verture/{index-67a00291.js → index-beef914f.js} +0 -0
  174. /package/_verture/{sortable.esm-5dbbc690.js → sortable.esm-49896035.js} +0 -0
  175. /package/_verture/{tslib.es6-44149323.js → tslib.es6-55ed4bd2.js} +0 -0
  176. /package/_verture/{typeof-c4ef74bc.js → typeof-498dd2b1.js} +0 -0
  177. /package/_verture/{unsupportedIterableToArray-6655197b.js → unsupportedIterableToArray-cb478f24.js} +0 -0
  178. /package/_verture/{useFormatMessage-8394ec71.js → useFormatMessage-703f8b20.js} +0 -0
  179. /package/_verture/{useGlobalProps-929e5233.js → useGlobalProps-1b846a65.js} +0 -0
  180. /package/_verture/{usePopupContainer-6fa1cc58.js → usePopupContainer-87febeb9.js} +0 -0
  181. /package/_verture/{util-8a7a5c8d.js → util-7e1fb1e2.js} +0 -0
@@ -1,10 +0,0 @@
1
- /**
2
- * @author linhd
3
- * @date 2022/8/12 5:27 PM
4
- * @description 全局变量
5
- */
6
- /** 组件全局class前缀 */
7
- var $prefixCls = 'paraui-v3';
8
- var $rcPrefixCls = 'component';
9
-
10
- export { $prefixCls as $, $rcPrefixCls as a };
@@ -1,34 +0,0 @@
1
- import { _ as _typeof } from './typeof-ef74f13b.js';
2
-
3
- function _toPrimitive(input, hint) {
4
- if (_typeof(input) !== "object" || input === null) return input;
5
- var prim = input[Symbol.toPrimitive];
6
- if (prim !== undefined) {
7
- var res = prim.call(input, hint || "default");
8
- if (_typeof(res) !== "object") return res;
9
- throw new TypeError("@@toPrimitive must return a primitive value.");
10
- }
11
- return (hint === "string" ? String : Number)(input);
12
- }
13
-
14
- function _toPropertyKey(arg) {
15
- var key = _toPrimitive(arg, "string");
16
- return _typeof(key) === "symbol" ? key : String(key);
17
- }
18
-
19
- function _defineProperty(obj, key, value) {
20
- key = _toPropertyKey(key);
21
- if (key in obj) {
22
- Object.defineProperty(obj, key, {
23
- value: value,
24
- enumerable: true,
25
- configurable: true,
26
- writable: true
27
- });
28
- } else {
29
- obj[key] = value;
30
- }
31
- return obj;
32
- }
33
-
34
- export { _defineProperty as _, _toPropertyKey as a };
@@ -1,232 +0,0 @@
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-d26faf32.js';
5
- import { g as getNearestOverflowAncestor, u as usePopupContainer } from './usePopupContainer-6fa1cc58.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 };