@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.6

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 (188) hide show
  1. package/AutoBox/index.js +72 -85
  2. package/AutoTips/index.js +72 -95
  3. package/Badge/index.js +17 -16
  4. package/Breadcrumbs/index.js +57 -73
  5. package/Button/index.js +90 -118
  6. package/ButtonGroup/index.js +30 -33
  7. package/Carousel/index.js +29 -33
  8. package/Cascader/index.js +9 -10
  9. package/Checkbox/index.js +28 -35
  10. package/CheckboxGroup/index.js +43 -58
  11. package/Collapse/index.js +52 -49
  12. package/CollapseBox/index.js +65 -70
  13. package/CollapseLayout/index.js +106 -101
  14. package/ColorPicker/index.js +3 -3
  15. package/ComboSelect/index.js +260 -337
  16. package/ComboSelect/lang/en_US.d.ts +1 -0
  17. package/ComboSelect/lang/index.d.ts +2 -0
  18. package/ComboSelect/lang/zh_CN.d.ts +1 -0
  19. package/ComboSelect/utils.d.ts +6 -0
  20. package/Container/index.js +17 -21
  21. package/CopyText/index.js +50 -83
  22. package/DatePicker/index.js +24 -27
  23. package/Descriptions/index.js +50 -59
  24. package/Desktop/index.js +161 -180
  25. package/DragVerify/index.js +77 -113
  26. package/Drawer/index.js +80 -95
  27. package/Dropdown/index.js +3 -3
  28. package/DynamicMultiBox/index.js +222 -224
  29. package/DynamicMultiBox/interface.d.ts +7 -0
  30. package/Empty/index.js +26 -28
  31. package/Form/index.js +70 -74
  32. package/FormItem/index.js +18 -15
  33. package/FunctionModal/index.js +7 -14
  34. package/GlobalContext/index.js +17 -20
  35. package/Help/index.js +9 -12
  36. package/HelperText/index.js +11 -11
  37. package/InputLang/index.js +104 -124
  38. package/InputNumber/index.js +62 -81
  39. package/Label/index.js +19 -21
  40. package/Loading/index.js +11 -10
  41. package/Menu/index.js +302 -371
  42. package/Message/index.js +104 -113
  43. package/Modal/index.js +122 -148
  44. package/MultiBox/index.d.ts +5 -0
  45. package/MultiBox/index.js +111 -115
  46. package/Notification/index.js +105 -103
  47. package/OperateBtn/index.d.ts +3 -0
  48. package/OperateBtn/index.js +77 -107
  49. package/PageHeader/index.js +327 -406
  50. package/Pagination/index.js +107 -137
  51. package/ParauiProvider/index.js +20 -22
  52. package/PasswordRules/index.js +36 -40
  53. package/PopConfirm/index.js +60 -77
  54. package/Popover/index.js +12 -12
  55. package/Progress/index.js +72 -74
  56. package/Querying/index.js +22 -23
  57. package/README.md +2 -0
  58. package/Radio/index.js +27 -34
  59. package/RadioGroup/index.js +38 -52
  60. package/Search/index.js +34 -43
  61. package/Select/index.js +281 -345
  62. package/SelectInput/index.js +8 -13
  63. package/Selector/index.js +582 -796
  64. package/SelectorPicker/index.js +113 -134
  65. package/SingleBox/index.d.ts +5 -0
  66. package/SingleBox/index.js +92 -88
  67. package/Slider/index.js +46 -57
  68. package/Status/index.js +14 -13
  69. package/Stepper/index.js +24 -25
  70. package/Styles/theme.scss +9 -9
  71. package/Switch/index.js +32 -35
  72. package/Table/index.js +360 -494
  73. package/Tabs/index.js +100 -100
  74. package/Tag/index.js +64 -82
  75. package/TextEditor/index.js +78 -100
  76. package/TextField/index.js +142 -183
  77. package/TimePicker/index.js +29 -28
  78. package/Timeline/index.js +50 -47
  79. package/Title/index.js +32 -34
  80. package/ToggleButton/index.js +29 -29
  81. package/Tooltip/index.js +52 -56
  82. package/Transfer/index.js +117 -154
  83. package/Tree/index.js +9 -10
  84. package/Upload/index.js +125 -143
  85. package/Upload/interface.d.ts +2 -0
  86. package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
  87. package/_verture/{index-5a7e2438.js → index-3cdaba96.js} +967 -934
  88. package/_verture/{index-b1f80962.js → index-4fafd0a0.js} +6 -8
  89. package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
  90. package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
  91. package/_verture/{index-232d890b.js → index-d63bd287.js} +1 -1
  92. package/_verture/index-da9097d3.js +239 -0
  93. package/_verture/{index-9331b116.js → index-e0f9064d.js} +125 -134
  94. package/_verture/intl-f2f27722.js +69 -0
  95. package/_verture/{modalContext-736ff215.js → modalContext-8534f23d.js} +36 -64
  96. package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
  97. package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
  98. package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
  99. package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
  100. package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
  101. package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
  102. package/_verture/utils-c17b5265.js +97 -0
  103. package/index.js +24 -23
  104. package/locale/en-US.d.ts +1 -0
  105. package/locale/index.d.ts +2 -0
  106. package/locale/index.js +10 -8
  107. package/locale/zh-CN.d.ts +1 -0
  108. package/package.json +11 -10
  109. package/umd/AutoBox.js +9 -8
  110. package/umd/AutoTips.js +9 -8
  111. package/umd/Badge.js +1 -1
  112. package/umd/Breadcrumbs.js +9 -8
  113. package/umd/Button.js +9 -8
  114. package/umd/ButtonGroup.js +9 -8
  115. package/umd/Carousel.js +5 -5
  116. package/umd/Cascader.js +9 -8
  117. package/umd/Checkbox.js +9 -8
  118. package/umd/CheckboxGroup.js +9 -8
  119. package/umd/Collapse.js +8 -7
  120. package/umd/CollapseBox.js +1 -1
  121. package/umd/CollapseLayout.js +4 -4
  122. package/umd/ColorPicker.js +1 -1
  123. package/umd/ComboSelect.js +9 -8
  124. package/umd/Container.js +1 -1
  125. package/umd/CopyText.js +9 -8
  126. package/umd/DatePicker.js +9 -8
  127. package/umd/Descriptions.js +9 -8
  128. package/umd/Desktop.js +9 -8
  129. package/umd/DragVerify.js +4 -4
  130. package/umd/Drawer.js +9 -8
  131. package/umd/Dropdown.js +6 -5
  132. package/umd/DynamicMultiBox.js +11 -10
  133. package/umd/Empty.js +1 -1
  134. package/umd/Form.js +9 -8
  135. package/umd/FormItem.js +9 -8
  136. package/umd/FunctionModal.js +9 -8
  137. package/umd/GlobalContext.js +1 -1
  138. package/umd/Help.js +9 -8
  139. package/umd/HelperText.js +1 -1
  140. package/umd/InputLang.js +9 -8
  141. package/umd/InputNumber.js +9 -8
  142. package/umd/Label.js +9 -8
  143. package/umd/Loading.js +4 -4
  144. package/umd/Menu.js +4 -4
  145. package/umd/Message.js +4 -4
  146. package/umd/Modal.js +9 -8
  147. package/umd/MultiBox.js +9 -8
  148. package/umd/Notification.js +8 -7
  149. package/umd/OperateBtn.js +9 -8
  150. package/umd/PageHeader.js +9 -8
  151. package/umd/Pagination.js +9 -8
  152. package/umd/ParauiProvider.js +1 -1
  153. package/umd/PasswordRules.js +4 -4
  154. package/umd/PopConfirm.js +9 -8
  155. package/umd/Popover.js +9 -8
  156. package/umd/Progress.js +5 -5
  157. package/umd/Querying.js +1 -1
  158. package/umd/Radio.js +9 -8
  159. package/umd/RadioGroup.js +9 -8
  160. package/umd/Search.js +9 -8
  161. package/umd/Select.js +9 -8
  162. package/umd/SelectInput.js +9 -8
  163. package/umd/Selector.js +9 -8
  164. package/umd/SelectorPicker.js +9 -8
  165. package/umd/SingleBox.js +9 -8
  166. package/umd/Slider.js +6 -5
  167. package/umd/Status.js +4 -4
  168. package/umd/Stepper.js +9 -8
  169. package/umd/Switch.js +9 -8
  170. package/umd/Table.js +9 -8
  171. package/umd/Tabs.js +9 -8
  172. package/umd/Tag.js +9 -8
  173. package/umd/TextEditor.js +22 -21
  174. package/umd/TextField.js +9 -8
  175. package/umd/TimePicker.js +9 -8
  176. package/umd/Timeline.js +1 -1
  177. package/umd/Title.js +9 -8
  178. package/umd/ToggleButton.js +9 -8
  179. package/umd/Tooltip.js +9 -8
  180. package/umd/Transfer.js +10 -9
  181. package/umd/Tree.js +9 -8
  182. package/umd/Upload.js +10 -9
  183. package/umd/locale.js +1 -1
  184. package/_verture/index-e9007d6a.js +0 -236
  185. package/_verture/intl-5c1ec055.js +0 -81
  186. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
  187. package/_verture/utils-418da0a4.js +0 -73
  188. /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
package/AutoBox/index.js CHANGED
@@ -1,39 +1,36 @@
1
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
2
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
2
  import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
4
3
  import { Popover } from '../Popover/index.js';
5
4
  import { createPortal } from 'react-dom';
6
5
  import { UUID } from '@paraview/lib';
7
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
6
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
8
7
  import More from '@para-ui/icons/More';
9
8
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
10
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
11
9
  import '../_verture/tslib.es6-55ed4bd2.js';
12
10
  import '../Tooltip/index.js';
13
11
  import 'rc-tooltip';
14
12
  import 'rc-tooltip/lib/placements';
15
13
  import 'clsx';
16
14
  import '@para-ui/icons/Forbid';
17
- import '../_verture/usePopupContainer-87febeb9.js';
15
+ import '../_verture/usePopupContainer-635f66f4.js';
18
16
 
19
- var Protal = function Protal(props) {
20
- var children = props.children,
21
- className = props.className,
22
- anchorEl = props.anchorEl,
23
- onClose = props.onClose;
24
- var _useState = useState({}),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- styleCom = _useState2[0],
27
- setStyleCom = _useState2[1];
28
- var constData = useRef({
17
+ const Protal = props => {
18
+ const {
19
+ children,
20
+ className,
21
+ anchorEl,
22
+ onClose
23
+ } = props;
24
+ const [styleCom, setStyleCom] = useState({});
25
+ const constData = useRef({
29
26
  uuid: "".concat($prefixCls, "-protal-box-content-").concat(UUID())
30
27
  });
31
- var domRef = useRef();
32
- var contentRef = useRef();
33
- useEffect(function () {
28
+ const domRef = useRef();
29
+ const contentRef = useRef();
30
+ useEffect(() => {
34
31
  handStyle();
35
32
  window.addEventListener('click', clickFunc);
36
- return function () {
33
+ return () => {
37
34
  domRef && domRef.current && domRef.current.remove();
38
35
  window.removeEventListener('click', clickFunc);
39
36
  };
@@ -43,8 +40,8 @@ var Protal = function Protal(props) {
43
40
  * @param el 当前元素
44
41
  * @param selector 查找元素class
45
42
  */
46
- var closest = function closest(el, selector) {
47
- var matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
43
+ const closest = (el, selector) => {
44
+ const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
48
45
  while (el) {
49
46
  if (matchesSelector.call(el, selector)) {
50
47
  break;
@@ -54,23 +51,23 @@ var Protal = function Protal(props) {
54
51
  return el;
55
52
  };
56
53
  /** 全局监听点击事件 */
57
- var clickFunc = function clickFunc(e) {
54
+ const clickFunc = e => {
58
55
  if (!constData.current) return;
59
- var bol = closest(e.target, ".".concat(constData.current.uuid)); // 是否存在下拉当中
56
+ const bol = closest(e.target, ".".concat(constData.current.uuid)); // 是否存在下拉当中
60
57
  if (!bol) onClose && onClose();
61
58
  };
62
59
  /** 处理内容的定位样式 */
63
- var handStyle = function handStyle() {
60
+ const handStyle = () => {
64
61
  if (!anchorEl || !contentRef.current) return;
65
- var posDomRect = anchorEl.getBoundingClientRect();
66
- var contentDomRect = contentRef.current.getBoundingClientRect();
67
- var json = {
62
+ const posDomRect = anchorEl.getBoundingClientRect();
63
+ const contentDomRect = contentRef.current.getBoundingClientRect();
64
+ const json = {
68
65
  opacity: 1,
69
66
  left: posDomRect.left,
70
67
  top: posDomRect.top + posDomRect.height
71
68
  };
72
- var winHeight = window.innerHeight;
73
- var winWidth = window.innerWidth;
69
+ const winHeight = window.innerHeight;
70
+ const winWidth = window.innerWidth;
74
71
  if (json.left + contentDomRect.width > winWidth) {
75
72
  json.left = winWidth - contentDomRect.width - 8;
76
73
  if (json.left < 0) json.left = 0;
@@ -82,12 +79,12 @@ var Protal = function Protal(props) {
82
79
  setStyleCom(json);
83
80
  };
84
81
  /** 处理className */
85
- var handClass = function handClass() {
86
- var str = "".concat($prefixCls, "-protal-box");
82
+ const handClass = () => {
83
+ let str = "".concat($prefixCls, "-protal-box");
87
84
  if (className) str += " ".concat(className);
88
85
  return str;
89
86
  };
90
- var handContent = function handContent() {
87
+ const handContent = () => {
91
88
  return jsxs("div", Object.assign({
92
89
  className: handClass(),
93
90
  ref: domRef
@@ -108,88 +105,78 @@ var Protal = function Protal(props) {
108
105
  });
109
106
  };
110
107
 
111
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-auto-box {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n}\n.paraui-v4-auto-box > .auto-box-more {\n display: inline-block;\n height: 100%;\n cursor: pointer;\n vertical-align: middle;\n}\n\n.paraui-v4-auto-box-popover .auto-box-popover-content {\n display: flex;\n flex-direction: column;\n}\n\n.paraui-v4-protal-box {\n position: fixed;\n z-index: 1500;\n inset: 0px;\n}\n.paraui-v4-protal-box .protal-mask {\n z-index: -1;\n position: fixed;\n inset: 0px;\n background-color: transparent;\n}\n.paraui-v4-protal-box .protal-content {\n border-radius: 4px;\n box-shadow: 0px 2px 8px 0px rgb(234, 236, 241);\n background-color: white;\n outline: 0;\n position: absolute;\n max-width: calc(100% - 32px);\n min-width: 16px;\n max-height: calc(100% - 32px);\n min-height: 16px;\n overflow-x: hidden;\n overflow-y: auto;\n opacity: 0;\n transform: none;\n transition: opacity 243ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 162ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}";
108
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-auto-box {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n}\n.paraui-v4-auto-box > .auto-box-more {\n display: inline-block;\n height: 100%;\n cursor: pointer;\n vertical-align: middle;\n}\n\n.paraui-v4-auto-box-popover .auto-box-popover-content {\n display: flex;\n flex-direction: column;\n}\n\n.paraui-v4-protal-box {\n position: fixed;\n z-index: 1500;\n inset: 0px;\n}\n.paraui-v4-protal-box .protal-mask {\n z-index: -1;\n position: fixed;\n inset: 0px;\n background-color: transparent;\n}\n.paraui-v4-protal-box .protal-content {\n border-radius: 4px;\n box-shadow: 1px 1px 10px 2px rgba(212, 218, 227, 0.4);\n background-color: white;\n outline: 0;\n position: absolute;\n max-width: calc(100% - 32px);\n min-width: 16px;\n max-height: calc(100% - 32px);\n min-height: 16px;\n overflow-x: hidden;\n overflow-y: auto;\n opacity: 0;\n transform: none;\n transition: opacity 243ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 162ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}";
112
109
  styleInject(css_248z);
113
110
 
114
- var AutoBox = function AutoBox(props) {
115
- var className = props.className,
116
- _props$list = props.list,
117
- list = _props$list === void 0 ? [] : _props$list,
118
- popoverClassName = props.popoverClassName,
119
- moreCustomize = props.moreCustomize,
120
- anchorEl = props.anchorEl,
121
- _props$hideMore = props.hideMore,
122
- hideMore = _props$hideMore === void 0 ? false : _props$hideMore,
123
- showNum = props.showNum,
124
- onCloseMore = props.onCloseMore,
125
- onShowMore = props.onShowMore,
126
- style = props.style,
127
- _props$trigger = props.trigger,
128
- trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
129
- _props$placement = props.placement,
130
- placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement;
131
- var comRef = useRef(null);
132
- var _useState = useState(null),
133
- _useState2 = _slicedToArray(_useState, 2),
134
- morePos = _useState2[0],
135
- setMorePos = _useState2[1]; // 超出在原始位置
136
- var _useState3 = useState(false),
137
- _useState4 = _slicedToArray(_useState3, 2),
138
- openMoreCom = _useState4[0],
139
- setOpenMoreCom = _useState4[1]; // 显示更多
140
- var _useState5 = useState({}),
141
- _useState6 = _slicedToArray(_useState5, 1),
142
- timer = _useState6[0];
143
- var posDom = useRef();
111
+ const AutoBox = props => {
112
+ const {
113
+ className,
114
+ list = [],
115
+ popoverClassName,
116
+ moreCustomize,
117
+ anchorEl,
118
+ hideMore = false,
119
+ showNum,
120
+ onCloseMore,
121
+ onShowMore,
122
+ style,
123
+ trigger = 'click',
124
+ placement = 'bottomLeft'
125
+ } = props;
126
+ const comRef = useRef(null);
127
+ const [morePos, setMorePos] = useState(null); // 超出在原始位置
128
+ const [openMoreCom, setOpenMoreCom] = useState(false); // 显示更多
129
+ const [timer] = useState({});
130
+ const posDom = useRef();
144
131
  // 监听打开更多
145
- useEffect(function () {
132
+ useEffect(() => {
146
133
  if (props.openMore !== undefined) {
147
134
  setOpenMoreCom(props.openMore);
148
135
  }
149
136
  }, [props.openMore]);
150
- useEffect(function () {
137
+ useEffect(() => {
151
138
  if (props.showNum !== undefined) return;
152
139
  changeSize();
153
140
  window.addEventListener('resize', changeSize);
154
- return function () {
141
+ return () => {
155
142
  window.removeEventListener('resize', changeSize);
156
143
  clearTimeout(timer.timer);
157
144
  };
158
145
  }, [list]);
159
- useEffect(function () {
146
+ useEffect(() => {
160
147
  if (showNum !== undefined) {
161
148
  setMorePos(showNum);
162
149
  window.removeEventListener('resize', changeSize);
163
150
  }
164
151
  }, [showNum]);
165
- useEffect(function () {
152
+ useEffect(() => {
166
153
  if (morePos !== null && list.length > morePos) {
167
154
  onShowMore && onShowMore(true);
168
155
  } else {
169
156
  onShowMore && onShowMore(false);
170
157
  }
171
158
  }, [list, morePos, onShowMore]);
172
- var onVisibleChange = function onVisibleChange(bol) {
159
+ const onVisibleChange = bol => {
173
160
  if (bol) return setOpenMoreCom(true);
174
161
  closeMore();
175
162
  };
176
163
  // 关闭显示更多
177
- var closeMore = function closeMore() {
164
+ const closeMore = () => {
178
165
  setOpenMoreCom(false);
179
166
  onCloseMore && onCloseMore();
180
167
  };
181
168
  // 关闭显示更多
182
- var handleCloseMore = function handleCloseMore() {
169
+ const handleCloseMore = () => {
183
170
  closeMore();
184
171
  };
185
172
  // 不换行 计算
186
- var handMultiline = function handMultiline(index) {
173
+ const handMultiline = index => {
187
174
  if (index === null || index === 0) return;
188
175
  if (index === undefined) index = list.length;
189
- var boxDom = comRef.current;
176
+ const boxDom = comRef.current;
190
177
  if (!boxDom) return;
191
178
  if (boxDom.scrollWidth > boxDom.clientWidth) {
192
- var num = Number(index) - 1;
179
+ const num = Number(index) - 1;
193
180
  // 超出
194
181
  setMorePos(num);
195
182
  handMultiline(num);
@@ -199,32 +186,32 @@ var AutoBox = function AutoBox(props) {
199
186
  }
200
187
  };
201
188
  // 多选 不换行
202
- var changeSize = function changeSize() {
189
+ const changeSize = () => {
203
190
  clearTimeout(timer.timer);
204
191
  closeMore();
205
- timer.timer = setTimeout(function () {
192
+ timer.timer = setTimeout(() => {
206
193
  setMorePos(list.length);
207
194
  handMultiline();
208
195
  }, 100);
209
196
  };
210
197
  // 处理class
211
- var handClass = function handClass() {
212
- var str = "".concat($prefixCls, "-auto-box");
198
+ const handClass = () => {
199
+ let str = "".concat($prefixCls, "-auto-box");
213
200
  if (className) str += " ".concat(className);
214
201
  return str;
215
202
  };
216
203
  // 处理handClassPopover
217
- var handClassPopover = function handClassPopover() {
218
- var str = "".concat($prefixCls, "-auto-box-popover");
204
+ const handClassPopover = () => {
205
+ let str = "".concat($prefixCls, "-auto-box-popover");
219
206
  if (popoverClassName) str += " ".concat(popoverClassName);
220
207
  return str;
221
208
  };
222
209
  // 处理更多内容
223
- var handMoreDom = function handMoreDom() {
210
+ const handMoreDom = () => {
224
211
  return jsx("div", Object.assign({
225
212
  className: "auto-box-popover-content"
226
213
  }, {
227
- children: list && list.map(function (item, index) {
214
+ children: list && list.map((item, index) => {
228
215
  if (morePos !== null && morePos > index) return null;
229
216
  return jsx(Fragment$1, {
230
217
  children: item
@@ -233,9 +220,9 @@ var AutoBox = function AutoBox(props) {
233
220
  }));
234
221
  };
235
222
  /** 处理更多按钮 */
236
- var handMoreBtn = function handMoreBtn() {
223
+ const handMoreBtn = () => {
237
224
  if (morePos !== null && list.length > morePos && !hideMore) {
238
- var handContent = function handContent() {
225
+ const handContent = () => {
239
226
  if (moreCustomize) {
240
227
  if (typeof moreCustomize === 'function') {
241
228
  return moreCustomize(morePos);
@@ -262,7 +249,7 @@ var AutoBox = function AutoBox(props) {
262
249
  }
263
250
  };
264
251
  /** 自定义更多按钮 */
265
- var handCustomDialog = function handCustomDialog() {
252
+ const handCustomDialog = () => {
266
253
  if (anchorEl && openMoreCom) {
267
254
  return jsx(Protal, Object.assign({
268
255
  className: handClassPopover(),
@@ -278,7 +265,7 @@ var AutoBox = function AutoBox(props) {
278
265
  style: style,
279
266
  ref: comRef
280
267
  }, {
281
- children: [list.map(function (item, index) {
268
+ children: [list.map((item, index) => {
282
269
  if (morePos !== null && morePos <= index) return null;
283
270
  return jsx(Fragment$1, {
284
271
  children: item
package/AutoTips/index.js CHANGED
@@ -1,11 +1,9 @@
1
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
2
  import { useRef, useState, useEffect, useMemo } from 'react';
4
3
  import { Tooltip } from '../Tooltip/index.js';
5
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
4
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
6
5
  import { isIE } from '@paraview/lib';
7
6
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
8
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
9
7
  import '../_verture/tslib.es6-55ed4bd2.js';
10
8
  import 'rc-tooltip';
11
9
  import 'rc-tooltip/lib/placements';
@@ -15,60 +13,50 @@ import '@para-ui/icons/Forbid';
15
13
  var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-auto-tips-multiline {\n max-width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-auto-tips-multiline > .auto-tips-multiline-content-box {\n position: relative;\n}\n.paraui-v4-auto-tips-multiline > .auto-tips-multiline-content-box > .auto-tips-multiline-content > .last-line {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.paraui-v4-auto-tips-multiline > .auto-tips-multiline-content-box > .hidden {\n opacity: 0;\n visibility: hidden;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: -100000;\n}\n.paraui-v4-auto-tips-multiline.paraui-v4-auto-tips-multiline-safari > .auto-tips-multiline-content-box > .auto-tips-multiline-content > .last-line::before {\n content: \"\";\n display: block;\n}\n\n.paraui-v4-auto-tips-multiline-tooltip .component-tooltip-inner {\n max-height: calc(100vh - 25px);\n overflow: auto;\n}";
16
14
  styleInject(css_248z$1);
17
15
 
18
- var AutoTipsMultiline = function AutoTipsMultiline(props) {
19
- var children = props.children,
20
- _props$arrow = props.arrow,
21
- arrow = _props$arrow === void 0 ? false : _props$arrow,
22
- _props$placement = props.placement,
23
- placement = _props$placement === void 0 ? 'bottom-start' : _props$placement,
24
- _props$tips = props.tips,
25
- tips = _props$tips === void 0 ? '' : _props$tips,
26
- _props$className = props.className,
27
- className = _props$className === void 0 ? '' : _props$className,
28
- _props$interactive = props.interactive,
29
- interactive = _props$interactive === void 0 ? true : _props$interactive;
30
- props.tipMaxWidth;
31
- var _props$line = props.line,
32
- line = _props$line === void 0 ? 2 : _props$line,
33
- refresh = props.refresh,
34
- style = props.style;
35
- var boxRef = useRef(null);
36
- var singleWordRefs = useRef([]);
37
- var _useState = useState(),
38
- _useState2 = _slicedToArray(_useState, 2),
39
- lineClamp = _useState2[0],
40
- setLineClamp = _useState2[1];
41
- var constData = useRef({
42
- line: line,
43
- tips: tips
16
+ const AutoTipsMultiline = props => {
17
+ const {
18
+ children,
19
+ arrow = false,
20
+ placement = 'bottom-start',
21
+ tips = '',
22
+ className = '',
23
+ interactive = true,
24
+ tipMaxWidth,
25
+ line = 2,
26
+ refresh,
27
+ style
28
+ } = props;
29
+ const boxRef = useRef(null);
30
+ const singleWordRefs = useRef([]);
31
+ const [lineClamp, setLineClamp] = useState();
32
+ const constData = useRef({
33
+ line,
34
+ tips
44
35
  });
45
36
  constData.current.line = line;
46
37
  constData.current.tips = tips;
47
- var _useState3 = useState(''),
48
- _useState4 = _slicedToArray(_useState3, 2),
49
- tTips = _useState4[0],
50
- setTTips = _useState4[1];
51
- useEffect(function () {
38
+ const [tTips, setTTips] = useState('');
39
+ useEffect(() => {
52
40
  window.addEventListener('resize', calcLine);
53
- return function () {
41
+ return () => {
54
42
  window.removeEventListener('resize', calcLine);
55
43
  };
56
44
  }, []);
57
- useEffect(function () {
45
+ useEffect(() => {
58
46
  calcLine();
59
47
  }, [children, refresh]);
60
48
  // 计算行数
61
- var calcLine = function calcLine() {
49
+ const calcLine = () => {
62
50
  var _a;
63
51
  if (!children) return;
64
- var lineArr = [];
65
- var showTooltip = false;
66
- var boxRefWidth = ((_a = boxRef === null || boxRef === void 0 ? void 0 : boxRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
67
- var addWidth = 0;
68
- var linePos = 0;
69
- for (var i = 0; i < singleWordRefs.current.length; i++) {
70
- var dom = singleWordRefs.current[i];
71
- var offsetWidth = dom.offsetWidth;
52
+ const lineArr = [];
53
+ let showTooltip = false;
54
+ const boxRefWidth = ((_a = boxRef === null || boxRef === void 0 ? void 0 : boxRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
55
+ let addWidth = 0;
56
+ let linePos = 0;
57
+ for (let i = 0; i < singleWordRefs.current.length; i++) {
58
+ const dom = singleWordRefs.current[i];
59
+ const offsetWidth = dom.offsetWidth;
72
60
  addWidth += offsetWidth;
73
61
  // 累计宽度超出了一行宽度
74
62
  if (addWidth > boxRefWidth) {
@@ -91,39 +79,35 @@ var AutoTipsMultiline = function AutoTipsMultiline(props) {
91
79
  }
92
80
  }
93
81
  setLineClamp({
94
- lineArr: lineArr,
95
- showTooltip: showTooltip
82
+ lineArr,
83
+ showTooltip
96
84
  });
97
85
  };
98
86
  /**
99
87
  * 描述文字span包裹
100
88
  */
101
- var descriptionRender = useMemo(function () {
89
+ const descriptionRender = useMemo(() => {
102
90
  singleWordRefs.current = [];
103
91
  return jsx("div", Object.assign({
104
92
  className: 'hidden'
105
93
  }, {
106
- children: children === null || children === void 0 ? void 0 : children.split('').map(function (word, wIdx) {
107
- return jsx("span", Object.assign({
108
- ref: function ref(dom) {
109
- return dom && singleWordRefs.current.push(dom);
110
- }
111
- }, {
112
- children: word
113
- }), wIdx);
114
- })
94
+ children: children === null || children === void 0 ? void 0 : children.split('').map((word, wIdx) => jsx("span", Object.assign({
95
+ ref: dom => dom && singleWordRefs.current.push(dom)
96
+ }, {
97
+ children: word
98
+ }), wIdx))
115
99
  }));
116
100
  }, [children]);
117
101
  // 判断浏览器是否是safari
118
- var isSafari = function isSafari() {
119
- var userAgent = navigator.userAgent;
102
+ const isSafari = () => {
103
+ const userAgent = navigator.userAgent;
120
104
  if (userAgent.indexOf('Safari') > -1) {
121
105
  return true;
122
106
  }
123
107
  };
124
108
  // 处理class
125
- var handClass = function handClass() {
126
- var str = "".concat($prefixCls, "-auto-tips-multiline");
109
+ const handClass = () => {
110
+ let str = "".concat($prefixCls, "-auto-tips-multiline");
127
111
  if (isSafari()) str += " ".concat($prefixCls, "-auto-tips-multiline-safari");
128
112
  if (className) str += " ".concat(className);
129
113
  return str;
@@ -147,8 +131,8 @@ var AutoTipsMultiline = function AutoTipsMultiline(props) {
147
131
  children: [jsx("div", Object.assign({
148
132
  className: 'auto-tips-multiline-content'
149
133
  }, {
150
- children: lineClamp === null || lineClamp === void 0 ? void 0 : lineClamp.lineArr.map(function (line, lIdx) {
151
- var str = 'line-text';
134
+ children: lineClamp === null || lineClamp === void 0 ? void 0 : lineClamp.lineArr.map((line, lIdx) => {
135
+ let str = 'line-text';
152
136
  if (lIdx === lineClamp.lineArr.length - 1) str += ' last-line';
153
137
  return jsx("div", Object.assign({
154
138
  className: str
@@ -165,37 +149,30 @@ var AutoTipsMultiline = function AutoTipsMultiline(props) {
165
149
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-auto-tips {\n max-width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-auto-tips > .auto-tips-content {\n display: inline;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-auto-tips.paraui-v4-auto-tips-safari > .auto-tips-content::before {\n content: \"\";\n display: block;\n}\n\n.paraui-v4-auto-tips-tooltip .component-tooltip-inner {\n max-height: calc(100vh - 25px);\n overflow: auto;\n}";
166
150
  styleInject(css_248z);
167
151
 
168
- var AutoTips = function AutoTips(props) {
169
- var children = props.children,
170
- _props$arrow = props.arrow,
171
- arrow = _props$arrow === void 0 ? false : _props$arrow,
172
- _props$placement = props.placement,
173
- placement = _props$placement === void 0 ? 'bottom-start' : _props$placement,
174
- _props$tips = props.tips,
175
- tips = _props$tips === void 0 ? '' : _props$tips,
176
- _props$className = props.className,
177
- className = _props$className === void 0 ? '' : _props$className,
178
- _props$beyondText = props.beyondText,
179
- beyondText = _props$beyondText === void 0 ? true : _props$beyondText,
180
- _props$interactive = props.interactive,
181
- interactive = _props$interactive === void 0 ? true : _props$interactive,
182
- tipMaxWidth = props.tipMaxWidth,
183
- style = props.style;
184
- var tipsElm = useRef();
185
- var textElm = useRef();
186
- var _useState = useState(''),
187
- _useState2 = _slicedToArray(_useState, 2),
188
- tTips = _useState2[0],
189
- setTTips = _useState2[1];
190
- useEffect(function () {
152
+ const AutoTips = props => {
153
+ const {
154
+ children,
155
+ arrow = false,
156
+ placement = 'bottom-start',
157
+ tips = '',
158
+ className = '',
159
+ beyondText = true,
160
+ interactive = true,
161
+ tipMaxWidth,
162
+ style
163
+ } = props;
164
+ const tipsElm = useRef();
165
+ const textElm = useRef();
166
+ const [tTips, setTTips] = useState('');
167
+ useEffect(() => {
191
168
  setTTips(tips);
192
169
  }, [tips]);
193
170
  // 鼠标移入事件
194
- var mouseHover = function mouseHover() {
195
- var val = '';
196
- var tipsEle = tipsElm.current;
197
- var tipsEleRect = tipsEle.getBoundingClientRect();
198
- var textEleRect = textElm.current.getBoundingClientRect();
171
+ const mouseHover = () => {
172
+ let val = '';
173
+ const tipsEle = tipsElm.current;
174
+ const tipsEleRect = tipsEle.getBoundingClientRect();
175
+ const textEleRect = textElm.current.getBoundingClientRect();
199
176
  if (tipsElm.current) {
200
177
  if (isIE()) {
201
178
  if (tipsEleRect.width > textEleRect.width) {
@@ -225,15 +202,15 @@ var AutoTips = function AutoTips(props) {
225
202
  return tipsElm && tipsElm.current ? tipsElm.current.offsetWidth : 0;
226
203
  }*/
227
204
  // 判断浏览器是否是safari
228
- var isSafari = function isSafari() {
229
- var userAgent = navigator.userAgent;
205
+ const isSafari = () => {
206
+ const userAgent = navigator.userAgent;
230
207
  if (/^((?!chrome|android).)*safari/i.test(userAgent)) {
231
208
  return true;
232
209
  }
233
210
  };
234
211
  // 处理class
235
- var handClass = function handClass() {
236
- var str = "".concat($prefixCls, "-auto-tips");
212
+ const handClass = () => {
213
+ let str = "".concat($prefixCls, "-auto-tips");
237
214
  if (isSafari()) str += " ".concat($prefixCls, "-auto-tips-safari");
238
215
  if (className) str += " ".concat(className);
239
216
  return str;
package/Badge/index.js CHANGED
@@ -1,34 +1,35 @@
1
- import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
2
1
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
2
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
4
3
  import clsx from 'clsx';
5
4
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
6
5
 
7
6
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-badge {\n display: inline-block;\n line-height: 1;\n position: relative;\n}\n.paraui-v4-badge > .pos-box {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n transform-origin: 100% 0%;\n height: 12px;\n display: inline-block;\n background-color: rgb(244, 66, 66);\n color: rgb(255, 255, 255);\n}\n.paraui-v4-badge > .pos-box.dot {\n border-radius: 50%;\n width: 8px;\n height: 8px;\n}\n.paraui-v4-badge > .pos-box.number, .paraui-v4-badge > .pos-box.text {\n border-radius: 8px;\n font-size: 12px;\n min-width: 12px;\n text-align: center;\n line-height: 12px;\n padding: 0 3px;\n max-width: 60px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-badge > .pos-box.number > span, .paraui-v4-badge > .pos-box.text > span {\n transform: scale(0.8);\n display: inline-block;\n}";
8
7
  styleInject(css_248z);
9
8
 
10
- var Badge = function Badge(props) {
11
- var className = props.className,
12
- style = props.style,
13
- children = props.children,
14
- sign = props.sign,
15
- backgroundColor = props.backgroundColor,
16
- color = props.color;
9
+ const Badge = props => {
10
+ const {
11
+ className,
12
+ style,
13
+ children,
14
+ sign,
15
+ backgroundColor,
16
+ color
17
+ } = props;
17
18
  // 判断数据类型
18
- var handleType = function handleType() {
19
- var type = _typeof(sign);
19
+ const handleType = () => {
20
+ const type = typeof sign;
20
21
  if (type === 'undefined') return 'dot';
21
22
  if (type === 'number') return 'number';
22
23
  return 'text';
23
24
  };
24
- var type = handleType();
25
+ const type = handleType();
25
26
  // 标记内容
26
- var handleSign = function handleSign() {
27
+ const handleSign = () => {
27
28
  return jsxs("span", Object.assign({
28
29
  className: "pos-box ".concat(type),
29
30
  style: {
30
- backgroundColor: backgroundColor,
31
- color: color
31
+ backgroundColor,
32
+ color
32
33
  }
33
34
  }, {
34
35
  children: [type === 'number' && jsx("span", {
@@ -39,7 +40,7 @@ var Badge = function Badge(props) {
39
40
  }));
40
41
  };
41
42
  // 处理number
42
- var handleNumber = function handleNumber() {
43
+ const handleNumber = () => {
43
44
  if (Number(sign) > 999) return '999+';
44
45
  return sign;
45
46
  };