uiw 4.13.9 → 4.13.12
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/dist/uiw.css +1 -0
- package/dist/uiw.js +67 -45
- package/dist/uiw.min.css +1 -1
- package/dist/uiw.min.js +1 -1
- package/package.json +57 -57
package/dist/uiw.css
CHANGED
package/dist/uiw.js
CHANGED
|
@@ -381,7 +381,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
381
381
|
"Steps": () => (/* reexport */ react_steps_esm),
|
|
382
382
|
"SubMenu": () => (/* reexport */ SubMenu),
|
|
383
383
|
"Switch": () => (/* reexport */ react_switch_esm),
|
|
384
|
-
"Table": () => (/* reexport */
|
|
384
|
+
"Table": () => (/* reexport */ Table),
|
|
385
385
|
"Tabs": () => (/* reexport */ Tabs),
|
|
386
386
|
"Tag": () => (/* reexport */ react_tag_esm),
|
|
387
387
|
"Textarea": () => (/* reexport */ react_textarea_esm),
|
|
@@ -3091,7 +3091,7 @@ class Popover extends (external_root_React_commonjs2_react_commonjs_react_amd_re
|
|
|
3091
3091
|
children: this.props.content
|
|
3092
3092
|
})]
|
|
3093
3093
|
}),
|
|
3094
|
-
children: typeof this.props.children === 'object' ? this.props.children : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
3094
|
+
children: typeof this.props.children === 'object' && this.props.children.type.name !== 'Icon' ? this.props.children : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
3095
3095
|
children: this.props.children
|
|
3096
3096
|
})
|
|
3097
3097
|
}));
|
|
@@ -3441,7 +3441,7 @@ function DayRect(props) {
|
|
|
3441
3441
|
}
|
|
3442
3442
|
}
|
|
3443
3443
|
|
|
3444
|
-
var cellDate =
|
|
3444
|
+
var cellDate = new Date(new Date(date).setDate(day));
|
|
3445
3445
|
|
|
3446
3446
|
if (today && today.toDateString() === cellDate.toDateString()) {
|
|
3447
3447
|
cls.today = true;
|
|
@@ -3734,7 +3734,7 @@ function DatePicker(props) {
|
|
|
3734
3734
|
|
|
3735
3735
|
setType(curType);
|
|
3736
3736
|
} else {
|
|
3737
|
-
var currentDate = new Date(
|
|
3737
|
+
var currentDate = new Date(selectPanelDate);
|
|
3738
3738
|
var month = currentDate.getMonth();
|
|
3739
3739
|
|
|
3740
3740
|
if (curType === 'prev') {
|
|
@@ -3752,7 +3752,7 @@ function DatePicker(props) {
|
|
|
3752
3752
|
}
|
|
3753
3753
|
|
|
3754
3754
|
setSelectPanelDate(curType === 'today' ? today : currentDate);
|
|
3755
|
-
|
|
3755
|
+
curType === 'today' && setSelectDate(today);
|
|
3756
3756
|
setType('day');
|
|
3757
3757
|
}
|
|
3758
3758
|
}
|
|
@@ -7848,17 +7848,23 @@ function SearchSelect(props) {
|
|
|
7848
7848
|
var [selectedValue, setSelectedValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
|
|
7849
7849
|
var [selectedLabel, setSelectedLabel] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
|
|
7850
7850
|
var [selectIconType, setSelectIconType] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
|
|
7851
|
+
var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
7851
7852
|
var omitTagCount = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => maxTagCount && selectedValue.length > maxTagCount ? selectedValue.length - maxTagCount : 0, [selectedValue.length]);
|
|
7852
7853
|
var divRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
7854
|
+
|
|
7855
|
+
var valueVerify = value => {
|
|
7856
|
+
return value !== undefined && value !== '';
|
|
7857
|
+
};
|
|
7858
|
+
|
|
7853
7859
|
var valueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
7854
7860
|
valueRef.current = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => selectedValue, [selectedValue]);
|
|
7855
7861
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
7856
|
-
if (value
|
|
7862
|
+
if (!valueVerify(value) && valueVerify(defaultValue)) {
|
|
7857
7863
|
selectedValueChange(defaultValue);
|
|
7858
7864
|
}
|
|
7859
7865
|
}, []);
|
|
7860
7866
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
7861
|
-
if (value
|
|
7867
|
+
if (valueVerify(value)) {
|
|
7862
7868
|
selectedValueChange(value);
|
|
7863
7869
|
}
|
|
7864
7870
|
}, [JSON.stringify(value)]);
|
|
@@ -7901,6 +7907,11 @@ function SearchSelect(props) {
|
|
|
7901
7907
|
return values;
|
|
7902
7908
|
}
|
|
7903
7909
|
|
|
7910
|
+
var selectedLabelChange = value => {
|
|
7911
|
+
setSelectedLabel(value);
|
|
7912
|
+
showSearch && (onSearch == null ? void 0 : onSearch(value));
|
|
7913
|
+
};
|
|
7914
|
+
|
|
7904
7915
|
function handleItemClick(item) {
|
|
7905
7916
|
setInnerIsOpen(false);
|
|
7906
7917
|
var values = [item];
|
|
@@ -7927,7 +7938,7 @@ function SearchSelect(props) {
|
|
|
7927
7938
|
function renderSelectIcon(type) {
|
|
7928
7939
|
var selectIconType;
|
|
7929
7940
|
|
|
7930
|
-
if (type === 'enter' && allowClear && selectedValue) {
|
|
7941
|
+
if (type === 'enter' && allowClear && (selectedValue.length > 0 || selectedLabel)) {
|
|
7931
7942
|
selectIconType = 'close';
|
|
7932
7943
|
} else {
|
|
7933
7944
|
selectIconType = '';
|
|
@@ -7937,20 +7948,23 @@ function SearchSelect(props) {
|
|
|
7937
7948
|
} // handle change
|
|
7938
7949
|
|
|
7939
7950
|
|
|
7940
|
-
function handleInputChange(
|
|
7941
|
-
var value = e.target.value;
|
|
7951
|
+
function handleInputChange(value) {
|
|
7942
7952
|
setInnerIsOpen(true);
|
|
7943
|
-
setSelectedLabel(value);
|
|
7944
|
-
|
|
7945
|
-
|
|
7953
|
+
setSelectIconType(showSearch && value ? 'loading' : ''); // setSelectedLabel(value);
|
|
7954
|
+
// showSearch && onSearch && onSearch(value);
|
|
7955
|
+
|
|
7956
|
+
selectedLabelChange(value);
|
|
7946
7957
|
} // 清除选中的值
|
|
7947
7958
|
|
|
7948
7959
|
|
|
7949
|
-
function resetSelectedValue() {
|
|
7950
|
-
|
|
7960
|
+
function resetSelectedValue(e) {
|
|
7961
|
+
var _inputRef$current;
|
|
7962
|
+
|
|
7963
|
+
e.stopPropagation();
|
|
7964
|
+
(_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
|
|
7951
7965
|
setSelectedValue([]);
|
|
7952
|
-
|
|
7953
|
-
|
|
7966
|
+
handleInputChange('');
|
|
7967
|
+
setInnerIsOpen(false);
|
|
7954
7968
|
handleSelectChange('', []);
|
|
7955
7969
|
}
|
|
7956
7970
|
|
|
@@ -7965,14 +7979,14 @@ function SearchSelect(props) {
|
|
|
7965
7979
|
}
|
|
7966
7980
|
}
|
|
7967
7981
|
|
|
7968
|
-
function onVisibleChange(
|
|
7969
|
-
|
|
7982
|
+
function onVisibleChange(isOpen) {
|
|
7983
|
+
var selectedValue = valueRef.current;
|
|
7984
|
+
setInnerIsOpen(isOpen);
|
|
7985
|
+
if (!isOpen) selectedLabelChange('');
|
|
7970
7986
|
|
|
7971
7987
|
if (!isMultiple && selectedValue.length > 0) {
|
|
7972
7988
|
setSelectedLabel(selectedValue[0].label);
|
|
7973
7989
|
}
|
|
7974
|
-
|
|
7975
|
-
setInnerIsOpen(open);
|
|
7976
7990
|
}
|
|
7977
7991
|
|
|
7978
7992
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
|
|
@@ -8013,6 +8027,11 @@ function SearchSelect(props) {
|
|
|
8013
8027
|
ref: divRef,
|
|
8014
8028
|
onMouseOver: () => renderSelectIcon('enter'),
|
|
8015
8029
|
onMouseLeave: () => renderSelectIcon('leave'),
|
|
8030
|
+
onClick: () => {
|
|
8031
|
+
var _inputRef$current2;
|
|
8032
|
+
|
|
8033
|
+
return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
|
|
8034
|
+
},
|
|
8016
8035
|
style: _extends({
|
|
8017
8036
|
width: '100%',
|
|
8018
8037
|
maxWidth: 'none'
|
|
@@ -8037,7 +8056,10 @@ function SearchSelect(props) {
|
|
|
8037
8056
|
color: "#393E48"
|
|
8038
8057
|
}, tagProps, {
|
|
8039
8058
|
closable: true,
|
|
8040
|
-
onClose:
|
|
8059
|
+
onClose: e => {
|
|
8060
|
+
e.stopPropagation();
|
|
8061
|
+
handleItemsClick(index, item);
|
|
8062
|
+
},
|
|
8041
8063
|
children: item.label
|
|
8042
8064
|
}), index);
|
|
8043
8065
|
}), !!omitTagCount && /*#__PURE__*/(0,jsx_runtime.jsxs)(react_tag_esm, {
|
|
@@ -8056,9 +8078,10 @@ function SearchSelect(props) {
|
|
|
8056
8078
|
className: prefixCls + "-input-contents",
|
|
8057
8079
|
readOnly: !showSearch,
|
|
8058
8080
|
size: size,
|
|
8081
|
+
ref: inputRef,
|
|
8059
8082
|
disabled: disabled,
|
|
8060
8083
|
onKeyDown: inputKeyDown,
|
|
8061
|
-
onChange: handleInputChange,
|
|
8084
|
+
onChange: e => handleInputChange(e.target.value),
|
|
8062
8085
|
value: selectedLabel,
|
|
8063
8086
|
placeholder: selectedValue.length ? '' : placeholder
|
|
8064
8087
|
})]
|
|
@@ -8070,8 +8093,9 @@ function SearchSelect(props) {
|
|
|
8070
8093
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
|
|
8071
8094
|
readOnly: !showSearch,
|
|
8072
8095
|
size: size,
|
|
8096
|
+
ref: inputRef,
|
|
8073
8097
|
disabled: disabled,
|
|
8074
|
-
onChange: handleInputChange,
|
|
8098
|
+
onChange: e => handleInputChange(e.target.value),
|
|
8075
8099
|
value: selectedLabel,
|
|
8076
8100
|
placeholder: placeholder,
|
|
8077
8101
|
addonAfter: (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
@@ -8836,7 +8860,7 @@ var Thead_excluded = ["prefixCls", "className", "data", "onCellHead"],
|
|
|
8836
8860
|
|
|
8837
8861
|
|
|
8838
8862
|
|
|
8839
|
-
|
|
8863
|
+
function TheadComponent(props) {
|
|
8840
8864
|
if (props === void 0) {
|
|
8841
8865
|
props = {};
|
|
8842
8866
|
}
|
|
@@ -8878,7 +8902,7 @@ var Thead_excluded = ["prefixCls", "className", "data", "onCellHead"],
|
|
|
8878
8902
|
})
|
|
8879
8903
|
}, rowNum))
|
|
8880
8904
|
}));
|
|
8881
|
-
}
|
|
8905
|
+
}
|
|
8882
8906
|
|
|
8883
8907
|
;// CONCATENATED MODULE: ../react-table/esm/util.js
|
|
8884
8908
|
/**
|
|
@@ -8940,7 +8964,7 @@ function getRowspanNum(data, child) {
|
|
|
8940
8964
|
* JSON Array => Array
|
|
8941
8965
|
* @param {Array} date
|
|
8942
8966
|
*/
|
|
8943
|
-
|
|
8967
|
+
function getLevelItems(data, result) {
|
|
8944
8968
|
if (!result) {
|
|
8945
8969
|
result = {
|
|
8946
8970
|
header: [],
|
|
@@ -9020,13 +9044,13 @@ var getLevelItems = (data, result) => {
|
|
|
9020
9044
|
}
|
|
9021
9045
|
|
|
9022
9046
|
return result;
|
|
9023
|
-
}
|
|
9047
|
+
}
|
|
9024
9048
|
/**
|
|
9025
9049
|
* Get all columns keys
|
|
9026
9050
|
* @param {Array} data
|
|
9027
9051
|
*/
|
|
9028
9052
|
|
|
9029
|
-
|
|
9053
|
+
function getAllColumnsKeys(data, keys) {
|
|
9030
9054
|
if (keys === void 0) {
|
|
9031
9055
|
keys = [];
|
|
9032
9056
|
}
|
|
@@ -9040,7 +9064,7 @@ var getAllColumnsKeys = function getAllColumnsKeys(data, keys) {
|
|
|
9040
9064
|
}
|
|
9041
9065
|
|
|
9042
9066
|
return keys;
|
|
9043
|
-
}
|
|
9067
|
+
}
|
|
9044
9068
|
|
|
9045
9069
|
;// CONCATENATED MODULE: ../react-table/esm/index.js
|
|
9046
9070
|
|
|
@@ -9054,7 +9078,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
|
|
|
9054
9078
|
|
|
9055
9079
|
|
|
9056
9080
|
|
|
9057
|
-
|
|
9081
|
+
function Table(props) {
|
|
9058
9082
|
if (props === void 0) {
|
|
9059
9083
|
props = {};
|
|
9060
9084
|
}
|
|
@@ -9093,7 +9117,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
|
|
|
9093
9117
|
} : {},
|
|
9094
9118
|
children: [title && /*#__PURE__*/(0,jsx_runtime.jsx)("caption", {
|
|
9095
9119
|
children: title
|
|
9096
|
-
}), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(
|
|
9120
|
+
}), columns && columns.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(TheadComponent, {
|
|
9097
9121
|
onCellHead: onCellHead,
|
|
9098
9122
|
data: header
|
|
9099
9123
|
}), data && data.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
|
|
@@ -9154,7 +9178,7 @@ var react_table_esm_excluded = ["prefixCls", "className", "columns", "data", "ti
|
|
|
9154
9178
|
children: footer
|
|
9155
9179
|
})]
|
|
9156
9180
|
});
|
|
9157
|
-
}
|
|
9181
|
+
}
|
|
9158
9182
|
|
|
9159
9183
|
;// CONCATENATED MODULE: ../react-tabs/esm/Pane.js
|
|
9160
9184
|
|
|
@@ -9851,8 +9875,6 @@ function TreeChecked(_ref) {
|
|
|
9851
9875
|
;// CONCATENATED MODULE: ../react-search-tree/esm/SearchTagInput.js
|
|
9852
9876
|
|
|
9853
9877
|
|
|
9854
|
-
var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowClear", "loading", "selectCloseDrop", "className", "style", "placeholder", "content", "options", "values", "onChange", "onSearch", "emptyOption"];
|
|
9855
|
-
|
|
9856
9878
|
|
|
9857
9879
|
|
|
9858
9880
|
|
|
@@ -9866,7 +9888,6 @@ var SearchTagInput_excluded = ["prefixCls", "mode", "size", "disabled", "allowCl
|
|
|
9866
9888
|
function SearchTagInput(props) {
|
|
9867
9889
|
var {
|
|
9868
9890
|
prefixCls = 'w-search-tree',
|
|
9869
|
-
mode = 'single',
|
|
9870
9891
|
size = 'default',
|
|
9871
9892
|
disabled = false,
|
|
9872
9893
|
allowClear = false,
|
|
@@ -9880,12 +9901,10 @@ function SearchTagInput(props) {
|
|
|
9880
9901
|
values,
|
|
9881
9902
|
onChange,
|
|
9882
9903
|
onSearch,
|
|
9883
|
-
emptyOption
|
|
9884
|
-
} = props,
|
|
9885
|
-
others = _objectWithoutPropertiesLoose(props, SearchTagInput_excluded);
|
|
9886
|
-
|
|
9887
|
-
var cls = [prefixCls, className].filter(Boolean).join(' ').trim(); // const isMultiple = useMemo(() => mode === 'multiple', [mode]);
|
|
9904
|
+
emptyOption // ...others
|
|
9888
9905
|
|
|
9906
|
+
} = props;
|
|
9907
|
+
var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
|
|
9889
9908
|
var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
9890
9909
|
var [selectedOption, setSelectedOption] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(values);
|
|
9891
9910
|
var optionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
@@ -9932,10 +9951,13 @@ function SearchTagInput(props) {
|
|
|
9932
9951
|
|
|
9933
9952
|
|
|
9934
9953
|
function resetSelectedValue(e) {
|
|
9954
|
+
var _inputRef$current;
|
|
9955
|
+
|
|
9935
9956
|
e.stopPropagation();
|
|
9957
|
+
(_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
|
|
9958
|
+
handleInputChange('');
|
|
9936
9959
|
setInnerIsOpen(false);
|
|
9937
9960
|
setSelectedOption([]);
|
|
9938
|
-
handleInputChange('');
|
|
9939
9961
|
handleSelectChange([]);
|
|
9940
9962
|
}
|
|
9941
9963
|
|
|
@@ -9988,9 +10010,9 @@ function SearchTagInput(props) {
|
|
|
9988
10010
|
onMouseOver: () => renderSelectIcon('enter'),
|
|
9989
10011
|
onMouseLeave: () => renderSelectIcon('leave'),
|
|
9990
10012
|
onClick: () => {
|
|
9991
|
-
var _inputRef$
|
|
10013
|
+
var _inputRef$current2;
|
|
9992
10014
|
|
|
9993
|
-
return (_inputRef$
|
|
10015
|
+
return (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();
|
|
9994
10016
|
},
|
|
9995
10017
|
style: _extends({
|
|
9996
10018
|
minWidth: 200,
|
|
@@ -10230,7 +10252,7 @@ function SearchTree(props) {
|
|
|
10230
10252
|
selectedOptionSet([...options]);
|
|
10231
10253
|
var isEmpt = true;
|
|
10232
10254
|
options.forEach(opt => isEmpt = isEmpt && !!opt.hideNode);
|
|
10233
|
-
isEmptySet(isEmpt);
|
|
10255
|
+
isEmptySet(typeof emptyOption === 'boolean' && isEmpt ? isEmpt : emptyOption);
|
|
10234
10256
|
};
|
|
10235
10257
|
|
|
10236
10258
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_SearchTagInput, _extends({}, other, {
|