@para-ui/core 3.0.28 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/InputLang/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useEffect, useMemo } from 'react';
|
|
5
5
|
import { TextField } from '../TextField/index.js';
|
|
@@ -8,7 +8,7 @@ import { MultiBox } from '../MultiBox/index.js';
|
|
|
8
8
|
import { Popover } from '../Popover/index.js';
|
|
9
9
|
import Application from '@para-ui/icons/Application';
|
|
10
10
|
import { GetLanguage, ArrayToObject } from '@paraview/lib';
|
|
11
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
11
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
13
|
import '../_verture/typeof-498dd2b1.js';
|
|
14
14
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -25,70 +25,63 @@ import '@para-ui/icons/CloseCircle';
|
|
|
25
25
|
import '../AutoTips/index.js';
|
|
26
26
|
import '../Loading/index.js';
|
|
27
27
|
import '@para-ui/icons/LoadingF';
|
|
28
|
-
import '../_verture/useGlobalProps-
|
|
28
|
+
import '../_verture/useGlobalProps-1b846a65.js';
|
|
29
29
|
import '@para-ui/core/GlobalContext';
|
|
30
|
-
import '../_verture/index-
|
|
30
|
+
import '../_verture/index-be4faaee.js';
|
|
31
31
|
import 'rc-dropdown';
|
|
32
|
-
import '../_verture/usePopupContainer-
|
|
32
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
33
33
|
import 'dayjs';
|
|
34
34
|
import '@para-ui/icons/Delete';
|
|
35
35
|
import '@para-ui/icons/PlusCircleF';
|
|
36
|
-
import '../_verture/useFormatMessage-
|
|
36
|
+
import '../_verture/useFormatMessage-703f8b20.js';
|
|
37
37
|
|
|
38
38
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-input-lang {\n display: inline-block;\n width: 100%;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n}\n.paraui-v3-input-lang .input-lang-text-field > .text-field-content > .text-field-content-after {\n cursor: pointer;\n}\n.paraui-v3-input-lang .input-lang-text-field > .text-field-content > .text-field-content-after .lang-list-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.paraui-v3-input-lang-popover > .component-popover-content > .component-popover-inner {\n padding: 12px;\n width: 300px;\n line-height: 0;\n}\n.paraui-v3-input-lang-popover > .component-popover-content > .component-popover-inner .input-lang-multi-box {\n padding-bottom: 0;\n}";
|
|
39
39
|
styleInject(css_248z);
|
|
40
40
|
|
|
41
41
|
var InputLang = function InputLang(props) {
|
|
42
42
|
var _props$className = props.className,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
43
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
44
|
+
style = props.style,
|
|
45
|
+
_props$label = props.label,
|
|
46
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
47
|
+
labelTooltip = props.labelTooltip,
|
|
48
|
+
_props$size = props.size,
|
|
49
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
50
|
+
_props$placeholder = props.placeholder,
|
|
51
|
+
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|
|
52
|
+
_props$placeholderKey = props.placeholderKey,
|
|
53
|
+
placeholderKey = _props$placeholderKey === void 0 ? '' : _props$placeholderKey,
|
|
54
|
+
_props$placeholderVal = props.placeholderValue,
|
|
55
|
+
placeholderValue = _props$placeholderVal === void 0 ? '' : _props$placeholderVal,
|
|
56
|
+
_props$error = props.error,
|
|
57
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
58
|
+
hideErrorDom = props.hideErrorDom,
|
|
59
|
+
_props$helperText = props.helperText,
|
|
60
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
61
|
+
_props$required = props.required,
|
|
62
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
63
|
+
popoverClassName = props.popoverClassName,
|
|
64
|
+
value = props.value,
|
|
65
|
+
onChange = props.onChange,
|
|
66
|
+
_props$langList = props.langList,
|
|
67
|
+
langList = _props$langList === void 0 ? ['zh', 'en'] : _props$langList,
|
|
68
|
+
_props$disabled = props.disabled,
|
|
69
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
71
70
|
var _useState = useState(false),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
open = _useState2[0],
|
|
73
|
+
setOpen = _useState2[1]; // 打开弹窗
|
|
77
74
|
var _useState3 = useState(GetLanguage() || 'zh'),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
76
|
+
lang = _useState4[0]; // 当前语言
|
|
82
77
|
var _useState5 = useState({}),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
79
|
+
valueCom = _useState6[0],
|
|
80
|
+
setValueCom = _useState6[1];
|
|
87
81
|
var _useState7 = useState([]),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
83
|
+
valueListLang = _useState8[0],
|
|
84
|
+
setValueListLang = _useState8[1];
|
|
92
85
|
useEffect(function () {
|
|
93
86
|
if (props.defaultValue !== undefined) {
|
|
94
87
|
handValue(props.defaultValue);
|
|
@@ -102,13 +95,11 @@ var InputLang = function InputLang(props) {
|
|
|
102
95
|
/**
|
|
103
96
|
* 处理值
|
|
104
97
|
*/
|
|
105
|
-
|
|
106
98
|
var handValue = function handValue(val) {
|
|
107
99
|
var valueHand = Object.assign({}, val);
|
|
108
100
|
if (valueHand[lang] === undefined) valueHand[lang] = '';
|
|
109
101
|
var keyArr = Object.keys(valueHand);
|
|
110
102
|
var arr = [];
|
|
111
|
-
|
|
112
103
|
for (var i = 0, l = keyArr.length; i < l; i++) {
|
|
113
104
|
var key = keyArr[i];
|
|
114
105
|
var _val = valueHand[key];
|
|
@@ -117,7 +108,6 @@ var InputLang = function InputLang(props) {
|
|
|
117
108
|
value: _val
|
|
118
109
|
});
|
|
119
110
|
}
|
|
120
|
-
|
|
121
111
|
setValueListLang(arr);
|
|
122
112
|
setValueCom(valueHand);
|
|
123
113
|
};
|
|
@@ -125,8 +115,6 @@ var InputLang = function InputLang(props) {
|
|
|
125
115
|
* 改变当前语言
|
|
126
116
|
* @param event
|
|
127
117
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
118
|
var changeValue = function changeValue(event) {
|
|
131
119
|
valueCom[lang] = event.target.value;
|
|
132
120
|
var val = Object.assign({}, valueCom);
|
|
@@ -137,18 +125,13 @@ var InputLang = function InputLang(props) {
|
|
|
137
125
|
* 改变弹窗语言值
|
|
138
126
|
* @param val
|
|
139
127
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
128
|
var changeListLang = function changeListLang(val) {
|
|
143
129
|
setValueListLang(_toConsumableArray(val));
|
|
144
130
|
};
|
|
145
131
|
/** 模糊搜索 */
|
|
146
|
-
|
|
147
|
-
|
|
148
132
|
var fetchSuggestionsKey = function fetchSuggestionsKey(val, cb) {
|
|
149
133
|
var arr = [];
|
|
150
134
|
var jsonMapping = ArrayToObject('label', valueListLang);
|
|
151
|
-
|
|
152
135
|
for (var i = 0, l = langList.length; i < l; i++) {
|
|
153
136
|
var item = langList[i];
|
|
154
137
|
if (!jsonMapping[item] && item !== lang) arr.push({
|
|
@@ -156,43 +139,33 @@ var InputLang = function InputLang(props) {
|
|
|
156
139
|
value: item
|
|
157
140
|
});
|
|
158
141
|
}
|
|
159
|
-
|
|
160
142
|
cb(arr);
|
|
161
143
|
};
|
|
162
144
|
/** 点击国际化图标 */
|
|
163
|
-
|
|
164
|
-
|
|
165
145
|
var clickAfter = function clickAfter() {
|
|
166
146
|
setOpen(true);
|
|
167
147
|
};
|
|
168
148
|
/** 关闭弹窗 */
|
|
169
|
-
|
|
170
|
-
|
|
171
149
|
var handleClose = function handleClose(bol) {
|
|
172
150
|
if (bol) return;
|
|
173
|
-
setOpen(false);
|
|
174
|
-
|
|
151
|
+
setOpen(false);
|
|
152
|
+
// 向外抛值
|
|
175
153
|
var json = {};
|
|
176
154
|
json[lang] = valueCom[lang];
|
|
177
|
-
|
|
178
155
|
for (var i = 0, l = valueListLang.length; i < l; i++) {
|
|
179
156
|
var item = valueListLang[i];
|
|
180
157
|
if (item.label) json[item.label] = item.value || '';
|
|
181
158
|
}
|
|
182
|
-
|
|
183
159
|
if (props.value === undefined) setValueCom(Object.assign({}, json));
|
|
184
160
|
onChange && onChange(Object.assign({}, json));
|
|
185
161
|
};
|
|
186
162
|
/** 当前语言 */
|
|
187
|
-
|
|
188
|
-
|
|
189
163
|
var AddonBeforeMemo = useMemo(function () {
|
|
190
164
|
return jsx("div", {
|
|
191
165
|
children: lang
|
|
192
166
|
});
|
|
193
167
|
}, [lang]);
|
|
194
168
|
/** 加载更多语言 */
|
|
195
|
-
|
|
196
169
|
var AddonAfterMemo = useMemo(function () {
|
|
197
170
|
return jsx("div", Object.assign({
|
|
198
171
|
className: "lang-list-icon"
|
|
@@ -201,15 +174,12 @@ var InputLang = function InputLang(props) {
|
|
|
201
174
|
}));
|
|
202
175
|
}, []);
|
|
203
176
|
/** 处理弹出框className */
|
|
204
|
-
|
|
205
177
|
var popoverHandClass = function popoverHandClass() {
|
|
206
178
|
var str = $prefixCls + '-input-lang-popover';
|
|
207
179
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
208
180
|
return str;
|
|
209
181
|
};
|
|
210
182
|
/** 弹窗列表内容 */
|
|
211
|
-
|
|
212
|
-
|
|
213
183
|
var langListPopoverContent = function langListPopoverContent() {
|
|
214
184
|
return jsx("div", Object.assign({
|
|
215
185
|
className: "input-lang-list"
|
|
@@ -230,8 +200,6 @@ var InputLang = function InputLang(props) {
|
|
|
230
200
|
* 处理class
|
|
231
201
|
* @return {string}
|
|
232
202
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
203
|
var handClass = function handClass() {
|
|
236
204
|
var str = $prefixCls + '-input-lang';
|
|
237
205
|
if (size) str += " ".concat($prefixCls, "-input-lang-").concat(size);
|
|
@@ -239,7 +207,6 @@ var InputLang = function InputLang(props) {
|
|
|
239
207
|
if (className) str += ' ' + className;
|
|
240
208
|
return str;
|
|
241
209
|
};
|
|
242
|
-
|
|
243
210
|
return jsxs("div", Object.assign({
|
|
244
211
|
className: handClass(),
|
|
245
212
|
style: style
|
package/InputNumber/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
@@ -9,7 +9,7 @@ import Minus from '@para-ui/icons/Minus';
|
|
|
9
9
|
import Plus from '@para-ui/icons/Plus';
|
|
10
10
|
import Label from '../Label/index.js';
|
|
11
11
|
import HelperText from '../HelperText/index.js';
|
|
12
|
-
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-
|
|
12
|
+
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
13
13
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
14
14
|
import '../Help/index.js';
|
|
15
15
|
import '../Tooltip/index.js';
|
|
@@ -23,135 +23,114 @@ styleInject(css_248z);
|
|
|
23
23
|
|
|
24
24
|
var InputNumber = function InputNumber(props) {
|
|
25
25
|
var className = props.className,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
26
|
+
style = props.style,
|
|
27
|
+
step = props.step,
|
|
28
|
+
min = props.min,
|
|
29
|
+
max = props.max,
|
|
30
|
+
_props$size = props.size,
|
|
31
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
32
|
+
_props$placeholder = props.placeholder,
|
|
33
|
+
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|
|
34
|
+
_props$label = props.label,
|
|
35
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
36
|
+
labelTooltip = props.labelTooltip,
|
|
37
|
+
_props$labelMode = props.labelMode,
|
|
38
|
+
labelMode = _props$labelMode === void 0 ? 'outside' : _props$labelMode,
|
|
39
|
+
labelSign = props.labelSign,
|
|
40
|
+
_props$btnMode = props.btnMode,
|
|
41
|
+
btnMode = _props$btnMode === void 0 ? 'tb' : _props$btnMode,
|
|
42
|
+
_props$disabled = props.disabled,
|
|
43
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
44
|
+
_props$readOnly = props.readOnly,
|
|
45
|
+
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
|
|
46
|
+
_props$disabledAdd = props.disabledAdd,
|
|
47
|
+
disabledAdd = _props$disabledAdd === void 0 ? false : _props$disabledAdd,
|
|
48
|
+
_props$disabledReduce = props.disabledReduce,
|
|
49
|
+
disabledReduce = _props$disabledReduce === void 0 ? false : _props$disabledReduce,
|
|
50
|
+
_props$required = props.required,
|
|
51
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
52
|
+
_props$error = props.error,
|
|
53
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
54
|
+
hideErrorDom = props.hideErrorDom,
|
|
55
|
+
_props$helperText = props.helperText,
|
|
56
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
57
|
+
_props$keyboard = props.keyboard,
|
|
58
|
+
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
|
59
|
+
_props$autoFocus = props.autoFocus,
|
|
60
|
+
autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus,
|
|
61
|
+
formatter = props.formatter,
|
|
62
|
+
parser = props.parser,
|
|
63
|
+
value = props.value,
|
|
64
|
+
onChange = props.onChange,
|
|
65
|
+
onEnter = props.onEnter,
|
|
66
|
+
onBlur = props.onBlur,
|
|
67
|
+
onFocus = props.onFocus,
|
|
68
|
+
otherProps = __rest(props, ["className", "style", "step", "min", "max", "size", "placeholder", "label", "labelTooltip", "labelMode", "labelSign", "btnMode", "disabled", "readOnly", "disabledAdd", "disabledReduce", "required", "error", "hideErrorDom", "helperText", "keyboard", "autoFocus", "formatter", "parser", "value", "onChange", "onEnter", "onBlur", "onFocus"]);
|
|
70
69
|
var _useState = useState(false),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
+
focus = _useState2[0],
|
|
72
|
+
setFocus = _useState2[1]; // 是否获取焦点
|
|
76
73
|
var _useState3 = useState(),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
75
|
+
valueCom = _useState4[0],
|
|
76
|
+
setValueCom = _useState4[1];
|
|
81
77
|
var inputRef = useRef(null);
|
|
82
78
|
useEffect(function () {
|
|
83
79
|
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
84
|
-
}, []);
|
|
85
|
-
|
|
80
|
+
}, []);
|
|
81
|
+
// 监听value
|
|
86
82
|
useEffect(function () {
|
|
87
83
|
if (value !== undefined) {
|
|
88
84
|
setValueCom(value);
|
|
89
85
|
}
|
|
90
86
|
}, [value]);
|
|
91
|
-
|
|
92
87
|
var handValue = function handValue() {
|
|
93
88
|
if (props.value === undefined) return valueCom;
|
|
94
89
|
return value;
|
|
95
90
|
};
|
|
96
|
-
|
|
97
91
|
var add = function add(e) {
|
|
98
92
|
if (disabled || disabledAdd || readOnly) {
|
|
99
93
|
e.stopPropagation();
|
|
100
94
|
}
|
|
101
95
|
};
|
|
102
|
-
|
|
103
96
|
var reduce = function reduce(e) {
|
|
104
97
|
if (disabled || disabledReduce || readOnly) {
|
|
105
98
|
e.stopPropagation();
|
|
106
99
|
}
|
|
107
100
|
};
|
|
108
|
-
|
|
109
101
|
var clickPlaceholder = function clickPlaceholder() {
|
|
110
102
|
if (disabled || readOnly) return;
|
|
111
103
|
var dom = inputRef && inputRef.current;
|
|
112
104
|
dom.focus();
|
|
113
105
|
};
|
|
114
106
|
/** 得到焦点 */
|
|
115
|
-
|
|
116
|
-
|
|
117
107
|
var onFocusCom = function onFocusCom(event) {
|
|
118
108
|
setFocus(true);
|
|
119
109
|
onFocus && onFocus(event);
|
|
120
110
|
};
|
|
121
111
|
/** 失去焦点 */
|
|
122
|
-
|
|
123
|
-
|
|
124
112
|
var onBlurCom = function onBlurCom(event) {
|
|
125
113
|
setFocus(false);
|
|
126
114
|
onBlur && onBlur(event);
|
|
127
115
|
};
|
|
128
116
|
/** 改变事件 */
|
|
129
|
-
|
|
130
|
-
|
|
131
117
|
var onChangeCom = function onChangeCom(val) {
|
|
132
118
|
if (props.value === undefined) {
|
|
133
119
|
setValueCom(val);
|
|
134
120
|
}
|
|
135
|
-
|
|
136
121
|
onChange && onChange(val);
|
|
137
122
|
};
|
|
138
123
|
/** 外标题 */
|
|
139
|
-
|
|
140
|
-
|
|
141
124
|
var outSideMemo = useMemo(function () {
|
|
142
125
|
var showTag = Boolean(required || labelSign || label);
|
|
143
|
-
|
|
144
126
|
if (labelMode === 'outside' && showTag) {
|
|
145
127
|
var handLabelClass = function handLabelClass() {
|
|
146
128
|
var str = 'input-number-label';
|
|
147
|
-
|
|
148
129
|
if (labelTooltip && labelTooltip.className) {
|
|
149
130
|
str += ' ' + labelTooltip.className;
|
|
150
131
|
}
|
|
151
|
-
|
|
152
132
|
return str;
|
|
153
133
|
};
|
|
154
|
-
|
|
155
134
|
return jsx(Label, Object.assign({
|
|
156
135
|
label: label,
|
|
157
136
|
required: required,
|
|
@@ -160,18 +139,14 @@ var InputNumber = function InputNumber(props) {
|
|
|
160
139
|
className: handLabelClass()
|
|
161
140
|
}));
|
|
162
141
|
}
|
|
163
|
-
|
|
164
142
|
return null;
|
|
165
143
|
}, [labelMode, label, labelSign, required]);
|
|
166
144
|
/** 处理placeholder, 内标题 */
|
|
167
|
-
|
|
168
145
|
var handPlaceholderLabel = function handPlaceholderLabel() {
|
|
169
146
|
var val = handValue();
|
|
170
147
|
if (focus || val !== undefined && val !== null) return undefined; // 得到焦点不显示 或者 (存在val值)
|
|
171
|
-
|
|
172
148
|
var handPlaceholderCom = function handPlaceholderCom() {
|
|
173
149
|
if (labelMode === 'outside') return placeholder; // 外标题只返回placeholder
|
|
174
|
-
|
|
175
150
|
return jsxs(Fragment, {
|
|
176
151
|
children: [label || placeholder, required && jsx("span", Object.assign({
|
|
177
152
|
className: "input-number-required"
|
|
@@ -182,19 +157,17 @@ var InputNumber = function InputNumber(props) {
|
|
|
182
157
|
})]
|
|
183
158
|
});
|
|
184
159
|
};
|
|
185
|
-
|
|
186
160
|
return jsx("span", Object.assign({
|
|
187
161
|
className: "input-number-label-placeholder",
|
|
188
162
|
onClick: clickPlaceholder
|
|
189
163
|
}, {
|
|
190
164
|
children: handPlaceholderCom()
|
|
191
165
|
}));
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
|
|
166
|
+
};
|
|
167
|
+
// 后
|
|
195
168
|
var addonAfterDom = function addonAfterDom(bol) {
|
|
196
|
-
if (disabled || readOnly) return undefined;
|
|
197
|
-
|
|
169
|
+
if (disabled || readOnly) return undefined;
|
|
170
|
+
// 上下
|
|
198
171
|
if (btnMode === 'tb') {
|
|
199
172
|
if (bol) return jsx("span", Object.assign({
|
|
200
173
|
className: "tb-btn-bottom",
|
|
@@ -205,9 +178,8 @@ var InputNumber = function InputNumber(props) {
|
|
|
205
178
|
return jsx("div", {
|
|
206
179
|
className: "input-number-content-after"
|
|
207
180
|
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
181
|
+
}
|
|
182
|
+
// 左右
|
|
211
183
|
if (btnMode === 'lr') {
|
|
212
184
|
if (bol) return jsx("span", Object.assign({
|
|
213
185
|
className: "reduce-btn",
|
|
@@ -219,14 +191,12 @@ var InputNumber = function InputNumber(props) {
|
|
|
219
191
|
className: "input-number-content-after"
|
|
220
192
|
});
|
|
221
193
|
}
|
|
222
|
-
|
|
223
194
|
return undefined;
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
|
|
195
|
+
};
|
|
196
|
+
// 前
|
|
227
197
|
var addonBeforeDom = function addonBeforeDom(bol) {
|
|
228
|
-
if (disabled || readOnly) return undefined;
|
|
229
|
-
|
|
198
|
+
if (disabled || readOnly) return undefined;
|
|
199
|
+
// 上下
|
|
230
200
|
if (btnMode === 'tb') {
|
|
231
201
|
if (bol) return jsx("span", Object.assign({
|
|
232
202
|
className: "tb-btn-top",
|
|
@@ -235,9 +205,8 @@ var InputNumber = function InputNumber(props) {
|
|
|
235
205
|
children: jsx(ExpandLess, {})
|
|
236
206
|
}));
|
|
237
207
|
return undefined;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
208
|
+
}
|
|
209
|
+
// 左右
|
|
241
210
|
if (btnMode === 'lr') {
|
|
242
211
|
if (bol) return jsx("span", Object.assign({
|
|
243
212
|
className: "add-btn",
|
|
@@ -249,12 +218,9 @@ var InputNumber = function InputNumber(props) {
|
|
|
249
218
|
className: "input-number-content-before"
|
|
250
219
|
});
|
|
251
220
|
}
|
|
252
|
-
|
|
253
221
|
return undefined;
|
|
254
222
|
};
|
|
255
223
|
/** 处理class */
|
|
256
|
-
|
|
257
|
-
|
|
258
224
|
var handClass = function handClass() {
|
|
259
225
|
var str = $prefixCls + '-input-number';
|
|
260
226
|
if (className) str += ' ' + className;
|
|
@@ -267,7 +233,6 @@ var InputNumber = function InputNumber(props) {
|
|
|
267
233
|
if (error) str += " ".concat($prefixCls, "-input-number-error");
|
|
268
234
|
return str;
|
|
269
235
|
};
|
|
270
|
-
|
|
271
236
|
return jsxs("div", Object.assign({
|
|
272
237
|
className: handClass(),
|
|
273
238
|
style: style
|
package/Label/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Help from '../Help/index.js';
|
|
3
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
3
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
4
4
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
5
5
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
6
6
|
import '../Tooltip/index.js';
|
|
7
|
-
import '../_verture/slicedToArray-
|
|
7
|
+
import '../_verture/slicedToArray-77980792.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'rc-tooltip';
|
|
10
10
|
import 'rc-tooltip/lib/placements';
|
|
@@ -16,19 +16,19 @@ styleInject(css_248z);
|
|
|
16
16
|
|
|
17
17
|
var Label = function Label(props) {
|
|
18
18
|
var className = props.className,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
helpClassName = props.helpClassName,
|
|
20
|
+
style = props.style,
|
|
21
|
+
label = props.label,
|
|
22
|
+
labelSign = props.labelSign,
|
|
23
|
+
_props$required = props.required,
|
|
24
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
25
|
+
tooltip = props.tooltip,
|
|
26
|
+
_props$tooltipType = props.tooltipType,
|
|
27
|
+
tooltipType = _props$tooltipType === void 0 ? 'icon' : _props$tooltipType,
|
|
28
|
+
placement = props.placement,
|
|
29
|
+
arrow = props.arrow,
|
|
30
|
+
tooltipIcon = props.tooltipIcon;
|
|
31
|
+
// 处理class
|
|
32
32
|
var handClass = function handClass() {
|
|
33
33
|
var str = $prefixCls + '-label';
|
|
34
34
|
if (tooltipType) str += " ".concat($prefixCls, "-label-").concat(tooltipType);
|
|
@@ -36,7 +36,6 @@ var Label = function Label(props) {
|
|
|
36
36
|
if (className) str += ' ' + className;
|
|
37
37
|
return str;
|
|
38
38
|
};
|
|
39
|
-
|
|
40
39
|
return jsxs(Fragment, {
|
|
41
40
|
children: [tooltipType === 'icon' && jsxs("label", Object.assign({
|
|
42
41
|
className: handClass(),
|
package/Loading/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
import LoadingOutlined from '@para-ui/icons/LoadingF';
|
|
4
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
4
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
5
5
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-loading {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n@keyframes rotateLoading {\n 0% {\n transformOrigin: 50% 50%;\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.paraui-v3-loading .loading-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: white;\n z-index: 100;\n}\n.paraui-v3-loading .loading-box {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 101;\n}\n.paraui-v3-loading .loading-box > svg {\n transition: all 0.3s ease-in-out;\n animation: rotateLoading 1s infinite linear;\n font-size: 20px;\n}";
|
|
@@ -9,9 +9,9 @@ styleInject(css_248z);
|
|
|
9
9
|
|
|
10
10
|
var Loading = function Loading(props) {
|
|
11
11
|
var className = props.className,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
style = props.style,
|
|
13
|
+
_props$opacity = props.opacity,
|
|
14
|
+
opacity = _props$opacity === void 0 ? 0.7 : _props$opacity;
|
|
15
15
|
var dom = useRef(null);
|
|
16
16
|
useEffect(function () {
|
|
17
17
|
if (dom && dom.current && dom.current.parentNode) {
|
|
@@ -19,14 +19,13 @@ var Loading = function Loading(props) {
|
|
|
19
19
|
dom.current.parentNode.style.position = 'relative';
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
22
|
+
}, []);
|
|
23
|
+
// 处理class
|
|
24
24
|
var handClass = function handClass() {
|
|
25
25
|
var str = "".concat($prefixCls, "-loading");
|
|
26
26
|
if (className) str += ' ' + className;
|
|
27
27
|
return str;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
29
|
return jsxs("div", Object.assign({
|
|
31
30
|
className: handClass(),
|
|
32
31
|
style: style,
|