@para-ui/core 4.0.0-rc → 4.0.0-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.
- package/AutoBox/index.d.ts +1 -1
- package/AutoBox/index.js +12 -12
- package/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/AutoTips/index.d.ts +2 -2
- package/AutoTips/index.js +12 -12
- package/Badge/index.d.ts +23 -0
- package/Badge/index.js +54 -0
- package/Breadcrumbs/index.js +8 -8
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +3 -3
- package/Carousel/index.d.ts +6 -6
- package/Carousel/index.js +5 -5
- package/Cascader/Cascader.d.ts +10 -10
- package/Cascader/OptionList/Column.d.ts +3 -3
- package/Cascader/OptionList/index.d.ts +2 -2
- package/Cascader/index.d.ts +1 -1
- package/Cascader/index.js +4 -2
- package/Cascader/lang/en_US.d.ts +5 -0
- package/Cascader/lang/index.d.ts +11 -0
- package/Cascader/lang/zh_CN.d.ts +5 -0
- package/Cascader/utils/treeUtil.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/Checkbox/index.js +4 -4
- package/CheckboxGroup/index.d.ts +2 -2
- package/CheckboxGroup/index.js +3 -3
- package/Collapse/index.js +4 -4
- package/CollapseBox/index.js +12 -20
- package/CollapseLayout/index.js +20 -20
- package/ColorPicker/index.js +2 -2
- package/ComboSelect/index.js +43 -52
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.d.ts +3 -3
- package/Container/index.js +56 -56
- package/CopyText/index.d.ts +2 -2
- package/DatePicker/generatePicker/index.d.ts +22 -22
- package/DatePicker/index.js +8 -7
- package/DatePicker/util.d.ts +1 -1
- package/Desktop/index.d.ts +1 -1
- package/Desktop/index.js +18 -13
- package/DragVerify/index.d.ts +1 -1
- package/DragVerify/index.js +13 -13
- package/Drawer/index.js +29 -33
- package/Drawer/interface.d.ts +2 -2
- package/Dropdown/index.d.ts +1 -1
- package/DynamicMultiBox/formItem.d.ts +1 -1
- package/DynamicMultiBox/index.d.ts +1 -1
- package/DynamicMultiBox/index.js +38 -35
- package/DynamicMultiBox/interface.d.ts +8 -8
- package/DynamicMultiBox/rowForm.d.ts +3 -1
- package/Empty/index.d.ts +1 -1
- package/Empty/index.js +2 -2
- package/Form/index.d.ts +12 -13
- package/Form/index.js +10 -8
- package/FormItem/compoments/defaultCompoments/index.d.ts +4 -4
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +1 -1
- package/FormItem/compoments/formFile/index.d.ts +2 -2
- package/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/FormItem/compoments/formSelect/index.d.ts +7 -7
- package/FormItem/errorTips.d.ts +3 -3
- package/FormItem/index.d.ts +5 -5
- package/FormItem/index.js +3 -2
- package/FormItem/lang/en_US.d.ts +10 -0
- package/FormItem/lang/index.d.ts +21 -0
- package/FormItem/lang/zh_CN.d.ts +10 -0
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/dialog.d.ts +26 -26
- package/FunctionModal/index.d.ts +6 -6
- package/FunctionModal/index.js +6 -6
- package/FunctionModal/modalContext.d.ts +3 -3
- package/GlobalContext/componentsProps.d.ts +7 -7
- package/GlobalContext/index.d.ts +2 -2
- package/GlobalContext/useFormatMessage.d.ts +1 -1
- package/Help/index.js +1 -1
- package/HelperText/index.js +1 -1
- package/InputLang/index.d.ts +2 -2
- package/InputLang/index.js +8 -8
- package/InputNumber/index.d.ts +2 -2
- package/InputNumber/index.js +3 -3
- package/Label/index.js +2 -2
- package/Loading/index.js +1 -1
- package/Menu/index.js +14 -14
- package/Menu/interface.d.ts +1 -1
- package/Message/index.js +12 -12
- package/Modal/Confirm/index.d.ts +3 -3
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +5 -5
- package/MultiBox/index.d.ts +2 -2
- package/MultiBox/index.js +3 -3
- package/Notification/index.js +1 -1
- package/OperateBtn/index.d.ts +2 -2
- package/OperateBtn/index.js +40 -36
- package/PageHeader/index.js +30 -30
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +1 -1
- package/Pagination/index.js +17 -17
- package/PasswordRules/index.js +7 -7
- package/PopConfirm/index.js +3 -3
- package/Progress/Line.d.ts +10 -10
- package/Progress/Steps.d.ts +2 -2
- package/Progress/index.d.ts +12 -12
- package/Progress/index.js +40 -40
- package/Progress/utils.d.ts +4 -4
- package/Querying/index.d.ts +1 -1
- package/Querying/index.js +2 -2
- package/README.md +3 -0
- package/Radio/index.d.ts +1 -1
- package/Radio/index.js +4 -4
- package/RadioGroup/index.d.ts +2 -2
- package/RadioGroup/index.js +3 -3
- package/Search/index.js +1 -1
- package/Select/index.d.ts +3 -3
- package/Select/index.js +42 -42
- package/SelectInput/index.js +2 -2
- package/Selector/index.js +15 -15
- package/Selector/interface.d.ts +6 -6
- package/SelectorPicker/index.d.ts +4 -4
- package/SelectorPicker/index.js +9 -9
- package/SingleBox/index.d.ts +2 -2
- package/SingleBox/index.js +3 -3
- package/Slider/interface.d.ts +1 -1
- package/Status/index.d.ts +4 -4
- package/Status/index.js +4 -4
- package/Stepper/index.d.ts +5 -5
- package/Stepper/index.js +23 -23
- package/Switch/index.d.ts +7 -7
- package/Switch/index.js +23 -5
- package/Switch/lang/en_US.d.ts +4 -0
- package/Switch/lang/index.d.ts +9 -0
- package/Switch/lang/zh_CN.d.ts +4 -0
- package/Table/index.js +34 -34
- package/Table/interface.d.ts +4 -4
- package/Table/tableBodyElement/index.d.ts +1 -1
- package/Table/tableBodyInterface.d.ts +2 -2
- package/Table/tableContainer/index.d.ts +1 -1
- package/Table/tableElement/index.d.ts +1 -1
- package/Table/tableHeadElement/index.d.ts +1 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +6 -6
- package/Table/tdElement/index.d.ts +1 -1
- package/Table/thElement/index.d.ts +2 -2
- package/Table/trElement/index.d.ts +1 -1
- package/Table/util.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +25 -17
- package/Tag/TagGroup.d.ts +5 -5
- package/Tag/index.d.ts +7 -7
- package/Tag/index.js +25 -25
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +45 -27
- package/TextEditor/lang/en_US.d.ts +4 -0
- package/TextEditor/lang/index.d.ts +9 -0
- package/TextEditor/lang/zh_CN.d.ts +4 -0
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +13 -13
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +1 -1
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +14 -14
- package/Title/index.d.ts +4 -4
- package/Title/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.d.ts +5 -1
- package/ToggleButton/index.js +17 -10
- package/Transfer/box.d.ts +6 -6
- package/Transfer/index.js +21 -21
- package/Tree/OperateBar/index.d.ts +4 -4
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +2 -2
- package/Tree/interface.d.ts +4 -4
- package/Tree/utils/tools.d.ts +1 -1
- package/Upload/Dragger/index.d.ts +2 -2
- package/Upload/ErroTip/index.d.ts +1 -1
- package/Upload/index.d.ts +2 -2
- package/Upload/index.js +7 -7
- package/Upload/interface.d.ts +1 -1
- package/_verture/{index-8469865e.js → index-0f315bca.js} +2 -2
- package/_verture/{index-e1b800aa.js → index-92e406f4.js} +48 -24
- package/_verture/{index-47297a40.js → index-bc461491.js} +45 -45
- package/_verture/{index-1c8d3e94.js → index-d251967e.js} +101 -47
- package/_verture/{modalContext-670eab09.js → modalContext-9299acc9.js} +25 -25
- package/index.d.ts +2 -0
- package/index.js +8 -7
- package/locale/en-US.d.ts +19 -0
- package/locale/index.d.ts +38 -0
- package/locale/index.js +39 -1
- package/locale/zh-CN.d.ts +19 -0
- package/package.json +3 -1
- package/umd/AutoBox.js +1 -1
- package/umd/AutoTips.js +1 -1
- package/umd/Badge.js +1 -0
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +2 -2
- package/umd/ButtonGroup.js +2 -2
- package/umd/Cascader.js +5 -5
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/Collapse.js +1 -1
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ComboSelect.js +4 -4
- package/umd/CopyText.js +1 -1
- package/umd/DatePicker.js +2 -2
- package/umd/Desktop.js +2 -2
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +2 -2
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Form.js +4 -4
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +2 -2
- package/umd/Help.js +1 -1
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/Loading.js +1 -1
- package/umd/Menu.js +2 -2
- package/umd/Message.js +1 -1
- package/umd/Modal.js +2 -2
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +1 -1
- package/umd/OperateBtn.js +2 -2
- package/umd/PageHeader.js +2 -2
- package/umd/Pagination.js +4 -4
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +2 -2
- package/umd/Progress.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/Search.js +7 -7
- package/umd/Select.js +1 -1
- package/umd/SelectInput.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/SingleBox.js +1 -1
- package/umd/Stepper.js +1 -1
- package/umd/Switch.js +4 -4
- package/umd/Table.js +2 -2
- package/umd/Tabs.js +4 -4
- package/umd/Tag.js +1 -1
- package/umd/TextEditor.js +2 -2
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +2 -2
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +4 -4
- package/umd/Transfer.js +2 -2
- package/umd/Tree.js +1 -1
- package/umd/Upload.js +2 -2
- package/umd/locale.js +1 -1
|
@@ -21,6 +21,7 @@ import { Forbid } from '@para-ui/icons';
|
|
|
21
21
|
import { $ as $prefixCls } from './constant-0d9802f7.js';
|
|
22
22
|
import LoadingOutlined from '@para-ui/icons/LoadingF';
|
|
23
23
|
import AutoTips from '../AutoTips/index.js';
|
|
24
|
+
import { u as useFormatMessage } from './useFormatMessage-703f8b20.js';
|
|
24
25
|
import { UUID } from '@paraview/lib';
|
|
25
26
|
import { s as styleInject } from './style-inject.es-300983ab.js';
|
|
26
27
|
|
|
@@ -9743,7 +9744,22 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
9743
9744
|
CacheContent.displayName = 'CacheContent';
|
|
9744
9745
|
}
|
|
9745
9746
|
|
|
9746
|
-
var
|
|
9747
|
+
var en = {
|
|
9748
|
+
placeholder: 'Please Choose',
|
|
9749
|
+
disableTilte: 'Disable'
|
|
9750
|
+
};
|
|
9751
|
+
|
|
9752
|
+
var zh = {
|
|
9753
|
+
placeholder: '请选择',
|
|
9754
|
+
disableTilte: '禁用'
|
|
9755
|
+
};
|
|
9756
|
+
|
|
9757
|
+
var localeJson = {
|
|
9758
|
+
zh: zh,
|
|
9759
|
+
en: en
|
|
9760
|
+
};
|
|
9761
|
+
|
|
9762
|
+
var FIX_LABEL = '__cascader_fix_label__';
|
|
9747
9763
|
function Column(_ref) {
|
|
9748
9764
|
var prefixCls = _ref.prefixCls,
|
|
9749
9765
|
options = _ref.options,
|
|
@@ -9771,7 +9787,8 @@ function Column(_ref) {
|
|
|
9771
9787
|
menuMaxHight = _React$useContext.menuMaxHight,
|
|
9772
9788
|
menuWidth = _React$useContext.menuWidth,
|
|
9773
9789
|
loading = _React$useContext.loading;
|
|
9774
|
-
var hoverOpen = expandTrigger ===
|
|
9790
|
+
var hoverOpen = expandTrigger === 'hover';
|
|
9791
|
+
var intl = useFormatMessage('OptionList', localeJson);
|
|
9775
9792
|
// ============================ Option ============================
|
|
9776
9793
|
var optionInfoList = React$4.useMemo(function () {
|
|
9777
9794
|
return options.map(function (option) {
|
|
@@ -9860,19 +9877,21 @@ function Column(_ref) {
|
|
|
9860
9877
|
onSelect(fullPath, isMergedLeaf);
|
|
9861
9878
|
}
|
|
9862
9879
|
};
|
|
9863
|
-
if (typeof option.title ===
|
|
9880
|
+
if (typeof option.title === 'string') {
|
|
9864
9881
|
option.title;
|
|
9865
9882
|
}
|
|
9866
9883
|
var disabledTooltipTitle = function disabledTooltipTitle() {
|
|
9867
9884
|
var svgObj = {
|
|
9868
|
-
marginRight:
|
|
9869
|
-
fontSize:
|
|
9870
|
-
color:
|
|
9885
|
+
marginRight: '4px',
|
|
9886
|
+
fontSize: '11px',
|
|
9887
|
+
color: 'inherit'
|
|
9871
9888
|
};
|
|
9872
9889
|
return jsxs("span", {
|
|
9873
9890
|
children: [jsx(Forbid, {
|
|
9874
9891
|
style: svgObj
|
|
9875
|
-
}), disableTitle ||
|
|
9892
|
+
}), disableTitle || intl({
|
|
9893
|
+
id: 'disableTilte'
|
|
9894
|
+
})]
|
|
9876
9895
|
});
|
|
9877
9896
|
};
|
|
9878
9897
|
// >>>>> Render
|
|
@@ -9908,7 +9927,7 @@ function Column(_ref) {
|
|
|
9908
9927
|
}, {
|
|
9909
9928
|
children: [disabled ? jsx(Tooltip, Object.assign({
|
|
9910
9929
|
arrow: false,
|
|
9911
|
-
placement:
|
|
9930
|
+
placement: 'topLeft',
|
|
9912
9931
|
title: disabledTooltipTitle()
|
|
9913
9932
|
}, {
|
|
9914
9933
|
children: jsx("div", Object.assign({
|
|
@@ -9961,7 +9980,9 @@ var useActive = (function () {
|
|
|
9961
9980
|
setActiveValueCells(firstValueCells || []);
|
|
9962
9981
|
}
|
|
9963
9982
|
}, /* eslint-disable react-hooks/exhaustive-deps */
|
|
9964
|
-
[open]
|
|
9983
|
+
[open]
|
|
9984
|
+
/* eslint-enable react-hooks/exhaustive-deps */);
|
|
9985
|
+
|
|
9965
9986
|
return [activeValueCells, setActiveValueCells];
|
|
9966
9987
|
});
|
|
9967
9988
|
|
|
@@ -9977,7 +9998,7 @@ var RefOptionList = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
9977
9998
|
direction = _useBaseProps.direction,
|
|
9978
9999
|
open = _useBaseProps.open;
|
|
9979
10000
|
var containerRef = React$4.useRef();
|
|
9980
|
-
var rtl = direction ===
|
|
10001
|
+
var rtl = direction === 'rtl';
|
|
9981
10002
|
var _React$useContext = React$4.useContext(CascaderContext),
|
|
9982
10003
|
options = _React$useContext.options,
|
|
9983
10004
|
values = _React$useContext.values,
|
|
@@ -10060,7 +10081,7 @@ var RefOptionList = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10060
10081
|
var onPathSelect = function onPathSelect(valuePath, leaf) {
|
|
10061
10082
|
var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
10062
10083
|
onSelect(valuePath);
|
|
10063
|
-
if (!multiple && (leaf || changeOnSelect && (expandTrigger ===
|
|
10084
|
+
if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {
|
|
10064
10085
|
toggleOpen(false);
|
|
10065
10086
|
}
|
|
10066
10087
|
};
|
|
@@ -10110,7 +10131,7 @@ var RefOptionList = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10110
10131
|
// ========================== Render ==========================
|
|
10111
10132
|
// >>>>> Empty
|
|
10112
10133
|
var isEmpty = !((_b = (_a = optionColumns[0]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length);
|
|
10113
|
-
var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value,
|
|
10134
|
+
var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value, '__EMPTY__'), _defineProperty(_ref3, FIX_LABEL, notFoundContent), _defineProperty(_ref3, "disabled", true), _ref3)];
|
|
10114
10135
|
var columnProps = Object.assign(Object.assign({}, props), {
|
|
10115
10136
|
multiple: !isEmpty && multiple,
|
|
10116
10137
|
onSelect: onPathSelect,
|
|
@@ -10166,6 +10187,7 @@ function toRawValues(value) {
|
|
|
10166
10187
|
});
|
|
10167
10188
|
}
|
|
10168
10189
|
var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
10190
|
+
var intl = useFormatMessage('Cascader', localeJson);
|
|
10169
10191
|
var id = props.id,
|
|
10170
10192
|
_props$prefixCls = props.prefixCls,
|
|
10171
10193
|
prefixCls = _props$prefixCls === void 0 ? "".concat($prefixCls, "-cascader") : _props$prefixCls,
|
|
@@ -10194,13 +10216,15 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10194
10216
|
expandIcon = _props$expandIcon === void 0 ? jsx(Right, {}) : _props$expandIcon,
|
|
10195
10217
|
loadingIcon = props.loadingIcon,
|
|
10196
10218
|
_props$placeholder = props.placeholder,
|
|
10197
|
-
placeholder = _props$placeholder === void 0 ?
|
|
10219
|
+
placeholder = _props$placeholder === void 0 ? intl({
|
|
10220
|
+
id: 'placeholder'
|
|
10221
|
+
}) : _props$placeholder,
|
|
10198
10222
|
_props$allClear = props.allClear,
|
|
10199
10223
|
allClear = _props$allClear === void 0 ? true : _props$allClear,
|
|
10200
10224
|
_props$menuMaxHight = props.menuMaxHight,
|
|
10201
10225
|
menuMaxHight = _props$menuMaxHight === void 0 ? 158 : _props$menuMaxHight,
|
|
10202
10226
|
_props$expandJoin = props.expandJoin,
|
|
10203
|
-
expandJoin = _props$expandJoin === void 0 ?
|
|
10227
|
+
expandJoin = _props$expandJoin === void 0 ? '/' : _props$expandJoin,
|
|
10204
10228
|
_props$disabled = props.disabled,
|
|
10205
10229
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
10206
10230
|
loading = props.loading,
|
|
@@ -10251,7 +10275,7 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10251
10275
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
10252
10276
|
dropdownVisible = _React$useState4[0],
|
|
10253
10277
|
setDropdownVisible = _React$useState4[1]; // dropDown显示状态
|
|
10254
|
-
var _React$useState5 = React$4.useState(
|
|
10278
|
+
var _React$useState5 = React$4.useState('auto'),
|
|
10255
10279
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
10256
10280
|
menuWidth = _React$useState6[0],
|
|
10257
10281
|
setMenuWidth = _React$useState6[1]; //下拉框的宽度
|
|
@@ -10325,7 +10349,7 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10325
10349
|
});
|
|
10326
10350
|
// Display Value change logic
|
|
10327
10351
|
var onDisplayValuesChange = function onDisplayValuesChange(_, info) {
|
|
10328
|
-
if (info.type ===
|
|
10352
|
+
if (info.type === 'clear') {
|
|
10329
10353
|
triggerChange([]);
|
|
10330
10354
|
return;
|
|
10331
10355
|
}
|
|
@@ -10399,9 +10423,9 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10399
10423
|
}, [open, popupVisible]); // dropDownVisible
|
|
10400
10424
|
// 监听屏幕宽度
|
|
10401
10425
|
React$4.useEffect(function () {
|
|
10402
|
-
window.addEventListener(
|
|
10426
|
+
window.addEventListener('resize', handleCalcMenuWidth);
|
|
10403
10427
|
return function () {
|
|
10404
|
-
window.removeEventListener(
|
|
10428
|
+
window.removeEventListener('resize', handleCalcMenuWidth);
|
|
10405
10429
|
};
|
|
10406
10430
|
}, []);
|
|
10407
10431
|
React$4.useEffect(function () {
|
|
@@ -10411,7 +10435,7 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10411
10435
|
}, [options, loading]);
|
|
10412
10436
|
var handleClear = function handleClear(e) {
|
|
10413
10437
|
e.stopPropagation();
|
|
10414
|
-
setInputLable(
|
|
10438
|
+
setInputLable('');
|
|
10415
10439
|
onChange && onChange([], []);
|
|
10416
10440
|
setDropdownVisible(false);
|
|
10417
10441
|
cascaderContext.values = [];
|
|
@@ -10481,7 +10505,7 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10481
10505
|
var dropdownStyle =
|
|
10482
10506
|
// Empty keep the width
|
|
10483
10507
|
emptyOptions ? {} : {
|
|
10484
|
-
minWidth:
|
|
10508
|
+
minWidth: 'auto'
|
|
10485
10509
|
};
|
|
10486
10510
|
return jsx(CascaderContext.Provider, Object.assign({
|
|
10487
10511
|
value: cascaderContext
|
|
@@ -10496,9 +10520,9 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10496
10520
|
dropdownStyle: dropdownStyle,
|
|
10497
10521
|
// Search
|
|
10498
10522
|
showSearch: false,
|
|
10499
|
-
searchValue:
|
|
10523
|
+
searchValue: '',
|
|
10500
10524
|
onSearch: function onSearch() {
|
|
10501
|
-
console.log(
|
|
10525
|
+
console.log('not search');
|
|
10502
10526
|
},
|
|
10503
10527
|
// Value
|
|
10504
10528
|
displayValues: displayValues,
|
|
@@ -10518,8 +10542,8 @@ var Cascader = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
|
|
|
10518
10542
|
}))
|
|
10519
10543
|
}));
|
|
10520
10544
|
});
|
|
10521
|
-
if (process.env.NODE_ENV !==
|
|
10522
|
-
Cascader.displayName =
|
|
10545
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10546
|
+
Cascader.displayName = 'Cascader';
|
|
10523
10547
|
}
|
|
10524
10548
|
Cascader.SHOW_PARENT = SHOW_PARENT;
|
|
10525
10549
|
Cascader.SHOW_CHILD = SHOW_CHILD;
|
|
@@ -274,25 +274,25 @@ var getIconMap = function getIconMap(intl) {
|
|
|
274
274
|
add: {
|
|
275
275
|
icon: jsx(AddOutlinedIcon, {}),
|
|
276
276
|
text: intl({
|
|
277
|
-
id:
|
|
277
|
+
id: 'add'
|
|
278
278
|
})
|
|
279
279
|
},
|
|
280
280
|
edit: {
|
|
281
281
|
icon: jsx(EditOutlinedIcon, {}),
|
|
282
282
|
text: intl({
|
|
283
|
-
id:
|
|
283
|
+
id: 'edit'
|
|
284
284
|
})
|
|
285
285
|
},
|
|
286
286
|
enable: {
|
|
287
287
|
icon: jsx(Forbid, {}),
|
|
288
288
|
text: intl({
|
|
289
|
-
id:
|
|
289
|
+
id: 'disabled'
|
|
290
290
|
})
|
|
291
291
|
},
|
|
292
292
|
del: {
|
|
293
293
|
icon: jsx(Delete, {}),
|
|
294
294
|
text: intl({
|
|
295
|
-
id:
|
|
295
|
+
id: 'delete'
|
|
296
296
|
})
|
|
297
297
|
}
|
|
298
298
|
};
|
|
@@ -310,10 +310,10 @@ var toActionArr = function toActionArr(actions, nodeData, IconMap) {
|
|
|
310
310
|
var arr = [];
|
|
311
311
|
Object.keys(actions).forEach(function (k) {
|
|
312
312
|
var aItem = actions[k];
|
|
313
|
-
if (k !==
|
|
313
|
+
if (k !== 'customizeActions') {
|
|
314
314
|
//非自定义
|
|
315
|
-
if (_typeof(aItem) ===
|
|
316
|
-
if (typeof aItem.show ===
|
|
315
|
+
if (_typeof(aItem) === 'object') {
|
|
316
|
+
if (typeof aItem.show === 'function') {
|
|
317
317
|
if (aItem.show(nodeData)) arr.push(Object.assign(Object.assign(Object.assign({}, IconMap[k]), aItem), {
|
|
318
318
|
action: k
|
|
319
319
|
}));
|
|
@@ -322,7 +322,7 @@ var toActionArr = function toActionArr(actions, nodeData, IconMap) {
|
|
|
322
322
|
action: k
|
|
323
323
|
}));
|
|
324
324
|
}
|
|
325
|
-
} else if (typeof aItem ===
|
|
325
|
+
} else if (typeof aItem === 'function') {
|
|
326
326
|
if (aItem(nodeData)) {
|
|
327
327
|
arr.push(Object.assign(Object.assign({}, IconMap[k]), {
|
|
328
328
|
action: k
|
|
@@ -336,7 +336,7 @@ var toActionArr = function toActionArr(actions, nodeData, IconMap) {
|
|
|
336
336
|
} else if (Array.isArray(aItem) && aItem.length) {
|
|
337
337
|
//自定义按钮
|
|
338
338
|
aItem.forEach(function (_) {
|
|
339
|
-
if (typeof _.show ===
|
|
339
|
+
if (typeof _.show === 'function') {
|
|
340
340
|
if (_.show(nodeData)) {
|
|
341
341
|
arr.push(_);
|
|
342
342
|
}
|
|
@@ -354,7 +354,7 @@ var OperateBar = function OperateBar(props) {
|
|
|
354
354
|
showActions = props.showActions,
|
|
355
355
|
onRemove = props.onRemove;
|
|
356
356
|
var portalRef = useRef(null); //portal
|
|
357
|
-
var uidRef = useRef(UUID().replace(/-/g,
|
|
357
|
+
var uidRef = useRef(UUID().replace(/-/g, '')); //portal uid
|
|
358
358
|
var _useState = useState({}),
|
|
359
359
|
_useState2 = _slicedToArray(_useState, 2),
|
|
360
360
|
nodeData = _useState2[0],
|
|
@@ -368,11 +368,11 @@ var OperateBar = function OperateBar(props) {
|
|
|
368
368
|
hasPortal = _useState6[0],
|
|
369
369
|
setHasPortal = _useState6[1]; //创建插槽portal
|
|
370
370
|
var opRefCurrent = opRef.current;
|
|
371
|
-
var intl = useFormatMessage(
|
|
371
|
+
var intl = useFormatMessage('Tree', localeJson);
|
|
372
372
|
//扇形位置
|
|
373
373
|
var getPosition = function getPosition(length, deg) {
|
|
374
|
-
var left = Math.round(Math.sin(Math.PI / 180 * deg) * length)
|
|
375
|
-
var top = -Math.round(Math.cos(Math.PI / 180 * deg) * length + 12)
|
|
374
|
+
var left = "".concat(Math.round(Math.sin(Math.PI / 180 * deg) * length), "px");
|
|
375
|
+
var top = "".concat(-Math.round(Math.cos(Math.PI / 180 * deg) * length + 12), "px");
|
|
376
376
|
return {
|
|
377
377
|
left: left,
|
|
378
378
|
top: top
|
|
@@ -425,7 +425,7 @@ var OperateBar = function OperateBar(props) {
|
|
|
425
425
|
var sectorAndRotate = function sectorAndRotate() {
|
|
426
426
|
var _a;
|
|
427
427
|
var portal = document.getElementById(uidRef.current);
|
|
428
|
-
var container = (_a = portal === null || portal === void 0 ? void 0 : portal.getElementsByClassName(
|
|
428
|
+
var container = (_a = portal === null || portal === void 0 ? void 0 : portal.getElementsByClassName('sector-item-container')) === null || _a === void 0 ? void 0 : _a[0];
|
|
429
429
|
var items = (container === null || container === void 0 ? void 0 : container.childNodes) || [];
|
|
430
430
|
var parentContainer = container === null || container === void 0 ? void 0 : container.parentNode;
|
|
431
431
|
var r = calcRadius(items.length);
|
|
@@ -448,7 +448,7 @@ var OperateBar = function OperateBar(props) {
|
|
|
448
448
|
var sectorAndRotateReverse = function sectorAndRotateReverse() {
|
|
449
449
|
var _a, _b;
|
|
450
450
|
var portal = document.getElementById(uidRef.current);
|
|
451
|
-
var container = (_a = portal === null || portal === void 0 ? void 0 : portal.getElementsByClassName(
|
|
451
|
+
var container = (_a = portal === null || portal === void 0 ? void 0 : portal.getElementsByClassName('sector-item-container')) === null || _a === void 0 ? void 0 : _a[0];
|
|
452
452
|
var items = (container === null || container === void 0 ? void 0 : container.childNodes) || [];
|
|
453
453
|
for (var i = 0; i < items.length; i++) {
|
|
454
454
|
var item = items[i];
|
|
@@ -499,8 +499,8 @@ var OperateBar = function OperateBar(props) {
|
|
|
499
499
|
title: text
|
|
500
500
|
}, {
|
|
501
501
|
children: jsx("li", Object.assign({
|
|
502
|
-
className: clsx(
|
|
503
|
-
|
|
502
|
+
className: clsx('sector-item', {
|
|
503
|
+
'sector-item--del': action === 'del'
|
|
504
504
|
}),
|
|
505
505
|
onClick: function onClick(evt) {
|
|
506
506
|
return handleNodeActions(nodeData, action, evt);
|
|
@@ -523,10 +523,10 @@ var OperateBar = function OperateBar(props) {
|
|
|
523
523
|
var createPortal = function createPortal() {
|
|
524
524
|
var portal = document.getElementById(uidRef.current);
|
|
525
525
|
if (!portal) {
|
|
526
|
-
portal = document.createElement(
|
|
526
|
+
portal = document.createElement('div');
|
|
527
527
|
portal.id = uidRef.current;
|
|
528
|
-
portal.style.position =
|
|
529
|
-
portal.style.top =
|
|
528
|
+
portal.style.position = 'fixed';
|
|
529
|
+
portal.style.top = '-9999px';
|
|
530
530
|
portal.style.zIndex = 1500;
|
|
531
531
|
document.body.appendChild(portal);
|
|
532
532
|
setHasPortal(true);
|
|
@@ -571,17 +571,17 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
571
571
|
_props$params = props.params,
|
|
572
572
|
params = _props$params === void 0 ? null : _props$params,
|
|
573
573
|
_props$method = props.method,
|
|
574
|
-
method = _props$method === void 0 ?
|
|
574
|
+
method = _props$method === void 0 ? 'GET' : _props$method,
|
|
575
575
|
headers = props.headers,
|
|
576
576
|
requestCallback = props.requestCallback,
|
|
577
577
|
refresh = props.refresh,
|
|
578
578
|
_props$replaceFields = props.replaceFields,
|
|
579
579
|
replaceFields = _props$replaceFields === void 0 ? {
|
|
580
|
-
key:
|
|
581
|
-
parentId:
|
|
582
|
-
children:
|
|
583
|
-
title:
|
|
584
|
-
loadKey:
|
|
580
|
+
key: 'key',
|
|
581
|
+
parentId: 'parentId',
|
|
582
|
+
children: 'children',
|
|
583
|
+
title: 'title',
|
|
584
|
+
loadKey: 'key'
|
|
585
585
|
} : _props$replaceFields,
|
|
586
586
|
originTreeData = props.treeData,
|
|
587
587
|
className = props.className,
|
|
@@ -654,7 +654,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
654
654
|
var treeOriDataRef = useRef([]); //tree origin data
|
|
655
655
|
var nPageSize = Object.assign(Object.assign({}, defaultPageSize), pageSize);
|
|
656
656
|
var halfCheckedKeys = useRef([]); //半选keys
|
|
657
|
-
var intl = useFormatMessage(
|
|
657
|
+
var intl = useFormatMessage('Tree', localeJson);
|
|
658
658
|
var _useState7 = useState(false),
|
|
659
659
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
660
660
|
loading = _useState8[0],
|
|
@@ -701,7 +701,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
701
701
|
//加载更多节点
|
|
702
702
|
return jsx("span", Object.assign({
|
|
703
703
|
className: "".concat($prefixCls, "-tree-title-wrapper"),
|
|
704
|
-
title:
|
|
704
|
+
title: ''
|
|
705
705
|
}, {
|
|
706
706
|
children: jsx(AutoTips, Object.assign({
|
|
707
707
|
placement: "top-start",
|
|
@@ -716,13 +716,13 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
716
716
|
onMouseEnter: handleTreeNodeMEnter,
|
|
717
717
|
onMouseLeave: handleTreeNodeMLeave,
|
|
718
718
|
onClick: handleTreeNodeClick,
|
|
719
|
-
title: blockNode ?
|
|
719
|
+
title: blockNode ? '' : undefined
|
|
720
720
|
}, {
|
|
721
721
|
children: [jsx(AutoTips, Object.assign({
|
|
722
722
|
tipMaxWidth: tipMaxWidth,
|
|
723
723
|
placement: "top-start"
|
|
724
724
|
}, {
|
|
725
|
-
children: typeof titleRender ===
|
|
725
|
+
children: typeof titleRender === 'function' ? titleRender(nodeData) : nodeData.title
|
|
726
726
|
})), !!showActions && jsx("div", Object.assign({
|
|
727
727
|
className: "sector-anchor",
|
|
728
728
|
onMouseEnter: function onMouseEnter(evt) {
|
|
@@ -808,9 +808,9 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
808
808
|
var showSector = function showSector(anchorEl, nodeData) {
|
|
809
809
|
var _a, _b;
|
|
810
810
|
var portalRoot = document.getElementById(opRef.current.uid);
|
|
811
|
-
anchorEl.classList.add(
|
|
811
|
+
anchorEl.classList.add('sector-anchor--active');
|
|
812
812
|
if (portalRoot) {
|
|
813
|
-
var container = portalRoot.querySelector(
|
|
813
|
+
var container = portalRoot.querySelector('.sector-container');
|
|
814
814
|
if (container) {
|
|
815
815
|
(_b = (_a = opRef.current) === null || _a === void 0 ? void 0 : _a.onShowSector) === null || _b === void 0 ? void 0 : _b.call(_a, nodeData, true);
|
|
816
816
|
}
|
|
@@ -820,7 +820,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
820
820
|
var removeSector = function removeSector(anchorEl) {
|
|
821
821
|
var _a, _b;
|
|
822
822
|
if (anchorEl) {
|
|
823
|
-
anchorEl.classList.remove(
|
|
823
|
+
anchorEl.classList.remove('sector-anchor--active');
|
|
824
824
|
(_b = (_a = opRef.current) === null || _a === void 0 ? void 0 : _a.onShowSector) === null || _b === void 0 ? void 0 : _b.call(_a, {}, false);
|
|
825
825
|
}
|
|
826
826
|
};
|
|
@@ -852,7 +852,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
852
852
|
if (radioable) {
|
|
853
853
|
//单选
|
|
854
854
|
var node = e.node;
|
|
855
|
-
var key = (_a = replaceFields.key) !== null && _a !== void 0 ? _a :
|
|
855
|
+
var key = (_a = replaceFields.key) !== null && _a !== void 0 ? _a : 'key';
|
|
856
856
|
if (e.checked) temp = [node[key]];
|
|
857
857
|
} else if (checkStrictly) {
|
|
858
858
|
//严格模式
|
|
@@ -863,14 +863,14 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
863
863
|
temp = checkedKeys;
|
|
864
864
|
halfChecked = e.halfCheckedKeys;
|
|
865
865
|
}
|
|
866
|
-
if (!(
|
|
866
|
+
if (!('checkedKeys' in props)) {
|
|
867
867
|
setInCheckedKeys(temp);
|
|
868
868
|
}
|
|
869
869
|
onCheck === null || onCheck === void 0 ? void 0 : onCheck(temp, e, halfChecked);
|
|
870
870
|
};
|
|
871
871
|
//展开节点
|
|
872
872
|
var internalExpand = function internalExpand(expandedKeys, e) {
|
|
873
|
-
if (!(
|
|
873
|
+
if (!('expandedKeys' in props)) {
|
|
874
874
|
setInExpandedKeys(_toConsumableArray(expandedKeys));
|
|
875
875
|
}
|
|
876
876
|
onExpand === null || onExpand === void 0 ? void 0 : onExpand(expandedKeys, e);
|
|
@@ -896,7 +896,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
896
896
|
url: url,
|
|
897
897
|
ctx: ctx,
|
|
898
898
|
method: m
|
|
899
|
-
}, m ===
|
|
899
|
+
}, m === 'GET' ? 'params' : 'data', tParams || {});
|
|
900
900
|
if (headers) opts.headers = headers;
|
|
901
901
|
_context.next = 9;
|
|
902
902
|
return Request(opts);
|
|
@@ -925,7 +925,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
925
925
|
return {
|
|
926
926
|
key: String((Math.random() * 1000000 | 0) + Date.now()),
|
|
927
927
|
title: intl({
|
|
928
|
-
id:
|
|
928
|
+
id: 'loadMore'
|
|
929
929
|
}),
|
|
930
930
|
checkable: false,
|
|
931
931
|
disableCheckbox: true,
|
|
@@ -950,7 +950,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
950
950
|
//更新tree数据
|
|
951
951
|
var updateTreeData = function updateTreeData(list, key, children, moreFlag) {
|
|
952
952
|
//root节点
|
|
953
|
-
if (key ===
|
|
953
|
+
if (key === 'ROOT_KEY') {
|
|
954
954
|
list.pop(); //删除加载更多节点
|
|
955
955
|
return list.concat(children);
|
|
956
956
|
}
|
|
@@ -999,7 +999,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
999
999
|
case 3:
|
|
1000
1000
|
//当前节点key
|
|
1001
1001
|
tKey = key; //参数动态字段
|
|
1002
|
-
loadKey = (_a = replaceFields.loadKey) !== null && _a !== void 0 ? _a :
|
|
1002
|
+
loadKey = (_a = replaceFields.loadKey) !== null && _a !== void 0 ? _a : 'key'; //加载节点时参数
|
|
1003
1003
|
loadParams = Object.assign(_defineProperty({}, loadKey, tKey), params); //是否分页
|
|
1004
1004
|
if (pagination) {
|
|
1005
1005
|
if (moreFlag) {
|
|
@@ -1007,7 +1007,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1007
1007
|
tKey = parentId;
|
|
1008
1008
|
treeMapRef.current[tKey].page += 1;
|
|
1009
1009
|
loadParams[loadKey] = tKey;
|
|
1010
|
-
if (tKey ===
|
|
1010
|
+
if (tKey === 'ROOT_KEY') {
|
|
1011
1011
|
//根节点加载更多,不需要key
|
|
1012
1012
|
delete loadParams[loadKey];
|
|
1013
1013
|
}
|
|
@@ -1073,7 +1073,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1073
1073
|
//计算分页,是否显示加载更多
|
|
1074
1074
|
if (page * size < total) {
|
|
1075
1075
|
var loadMoreData = getLoadMoreData();
|
|
1076
|
-
loadMoreData.parentId = parentId ||
|
|
1076
|
+
loadMoreData.parentId = parentId || 'ROOT_KEY';
|
|
1077
1077
|
loadMoreData.title = renderLoadMoreNode(loadMoreData);
|
|
1078
1078
|
newTreeData.push(loadMoreData);
|
|
1079
1079
|
}
|
|
@@ -1236,7 +1236,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1236
1236
|
var searchKey = _ref2.searchKey,
|
|
1237
1237
|
searchValue = _ref2.searchValue;
|
|
1238
1238
|
if (!searchKey) return;
|
|
1239
|
-
if (searchValue ===
|
|
1239
|
+
if (searchValue === '') {
|
|
1240
1240
|
setTreeData(treeOriDataRef.current);
|
|
1241
1241
|
var tKeys = expandedKeys || defaultExpandedKeys;
|
|
1242
1242
|
setInExpandedKeys(_toConsumableArray(tKeys || []));
|
|
@@ -1276,7 +1276,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1276
1276
|
style: props.style
|
|
1277
1277
|
}, {
|
|
1278
1278
|
children: notFoundContent !== null && notFoundContent !== void 0 ? notFoundContent : jsx(Empty, Object.assign({
|
|
1279
|
-
size:
|
|
1279
|
+
size: 'small'
|
|
1280
1280
|
}, emptyProps))
|
|
1281
1281
|
}));
|
|
1282
1282
|
//tree memo
|
|
@@ -1316,7 +1316,7 @@ var Tree = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1316
1316
|
onExpand: internalExpand,
|
|
1317
1317
|
icon: function icon(nodeProps) {
|
|
1318
1318
|
if (_icon) {
|
|
1319
|
-
return typeof _icon ===
|
|
1319
|
+
return typeof _icon === 'function' ? _icon(nodeProps) : _icon;
|
|
1320
1320
|
}
|
|
1321
1321
|
if (nodeProps.checkable === false) return null;
|
|
1322
1322
|
if (!radioable) {
|