uiw 4.11.1 → 4.11.2
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/README.md +2 -1
- package/dist/uiw.css +56 -46
- package/dist/uiw.js +239 -127
- package/dist/uiw.min.css +1 -1
- package/dist/uiw.min.js +1 -1
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -100,7 +100,8 @@ Package | Version | Description
|
|
|
100
100
|
[`@uiw/react-descriptions`](/packages/react-descriptions)| [](https://www.npmjs.com/package/@uiw/react-descriptions) | -
|
|
101
101
|
[`@uiw/react-divider`](/packages/react-divider)| [](https://www.npmjs.com/package/@uiw/react-divider) | -
|
|
102
102
|
[`@uiw/react-drawer`](/packages/react-drawer)| [](https://www.npmjs.com/package/@uiw/react-drawer) | -
|
|
103
|
-
[`@uiw/react-dropdown`](/packages/react-dropdown)| [](https://www.npmjs.com/package/@uiw/react-dropdown)
|
|
103
|
+
[`@uiw/react-dropdown`](/packages/react-dropdown)| [](https://www.npmjs.com/package/@uiw/react-dropdown)
|
|
104
|
+
[`@uiw/react-empty`](/packages/react-empty)| [](https://www.npmjs.com/package/@uiw/react-empty) | -
|
|
104
105
|
[`@uiw/react-file-input`](/packages/react-file-input)| [](https://www.npmjs.com/package/@uiw/react-file-input) | -
|
|
105
106
|
[`@uiw/react-form`](/packages/react-form)| [](https://www.npmjs.com/package/@uiw/react-form) | -
|
|
106
107
|
[`@uiw/react-grid`](/packages/react-grid)| [](https://www.npmjs.com/package/@uiw/react-grid) | -
|
package/dist/uiw.css
CHANGED
|
@@ -3740,6 +3740,62 @@ a.w-list-item:hover:not(.w-disabled) {
|
|
|
3740
3740
|
width: 50%;
|
|
3741
3741
|
}
|
|
3742
3742
|
|
|
3743
|
+
.w-tag {
|
|
3744
|
+
border-radius: 2px;
|
|
3745
|
+
display: inline-block;
|
|
3746
|
+
-webkit-user-select: none;
|
|
3747
|
+
-moz-user-select: none;
|
|
3748
|
+
-ms-user-select: none;
|
|
3749
|
+
user-select: none;
|
|
3750
|
+
font-size: 12px;
|
|
3751
|
+
padding: 1px 5px;
|
|
3752
|
+
position: relative;
|
|
3753
|
+
white-space: nowrap;
|
|
3754
|
+
vertical-align: middle;
|
|
3755
|
+
}
|
|
3756
|
+
.w-tag + .w-tag {
|
|
3757
|
+
margin-left: 5px;
|
|
3758
|
+
}
|
|
3759
|
+
.w-tag.disabled {
|
|
3760
|
+
opacity: 0.75;
|
|
3761
|
+
cursor: not-allowed;
|
|
3762
|
+
}
|
|
3763
|
+
.w-tag-light .w-tag-close:hover {
|
|
3764
|
+
background-color: currentcolor;
|
|
3765
|
+
}
|
|
3766
|
+
.w-tag-light .w-tag-close:hover path {
|
|
3767
|
+
fill: #fff;
|
|
3768
|
+
}
|
|
3769
|
+
.w-tag-light .w-tag-close:active {
|
|
3770
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
3771
|
+
}
|
|
3772
|
+
.w-tag-close {
|
|
3773
|
+
vertical-align: bottom;
|
|
3774
|
+
margin: 0px -3px 0 2px;
|
|
3775
|
+
border-radius: 2px;
|
|
3776
|
+
position: relative;
|
|
3777
|
+
top: -1px;
|
|
3778
|
+
fill: currentcolor;
|
|
3779
|
+
transition: all 0.3s;
|
|
3780
|
+
cursor: pointer;
|
|
3781
|
+
}
|
|
3782
|
+
.w-tag-close:hover {
|
|
3783
|
+
background-color: rgba(0, 0, 0, 0.22);
|
|
3784
|
+
}
|
|
3785
|
+
.w-tag-close:active {
|
|
3786
|
+
background-color: rgba(0, 0, 0, 0.32);
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
.w-search-select-input-contents input {
|
|
3790
|
+
box-shadow: none;
|
|
3791
|
+
}
|
|
3792
|
+
.w-search-select-input-contents .w-input-inner:hover {
|
|
3793
|
+
box-shadow: none !important;
|
|
3794
|
+
}
|
|
3795
|
+
.w-search-select-input-contents .w-input-inner:focus {
|
|
3796
|
+
box-shadow: none !important;
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3743
3799
|
.w-split {
|
|
3744
3800
|
height: 100%;
|
|
3745
3801
|
display: flex;
|
|
@@ -4549,52 +4605,6 @@ a.w-list-item:hover:not(.w-disabled) {
|
|
|
4549
4605
|
z-index: 1;
|
|
4550
4606
|
}
|
|
4551
4607
|
|
|
4552
|
-
.w-tag {
|
|
4553
|
-
border-radius: 2px;
|
|
4554
|
-
display: inline-block;
|
|
4555
|
-
-webkit-user-select: none;
|
|
4556
|
-
-moz-user-select: none;
|
|
4557
|
-
-ms-user-select: none;
|
|
4558
|
-
user-select: none;
|
|
4559
|
-
font-size: 12px;
|
|
4560
|
-
padding: 1px 5px;
|
|
4561
|
-
position: relative;
|
|
4562
|
-
white-space: nowrap;
|
|
4563
|
-
vertical-align: middle;
|
|
4564
|
-
}
|
|
4565
|
-
.w-tag + .w-tag {
|
|
4566
|
-
margin-left: 5px;
|
|
4567
|
-
}
|
|
4568
|
-
.w-tag.disabled {
|
|
4569
|
-
opacity: 0.75;
|
|
4570
|
-
cursor: not-allowed;
|
|
4571
|
-
}
|
|
4572
|
-
.w-tag-light .w-tag-close:hover {
|
|
4573
|
-
background-color: currentcolor;
|
|
4574
|
-
}
|
|
4575
|
-
.w-tag-light .w-tag-close:hover path {
|
|
4576
|
-
fill: #fff;
|
|
4577
|
-
}
|
|
4578
|
-
.w-tag-light .w-tag-close:active {
|
|
4579
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
4580
|
-
}
|
|
4581
|
-
.w-tag-close {
|
|
4582
|
-
vertical-align: bottom;
|
|
4583
|
-
margin: 0px -3px 0 2px;
|
|
4584
|
-
border-radius: 2px;
|
|
4585
|
-
position: relative;
|
|
4586
|
-
top: -1px;
|
|
4587
|
-
fill: currentcolor;
|
|
4588
|
-
transition: all 0.3s;
|
|
4589
|
-
cursor: pointer;
|
|
4590
|
-
}
|
|
4591
|
-
.w-tag-close:hover {
|
|
4592
|
-
background-color: rgba(0, 0, 0, 0.22);
|
|
4593
|
-
}
|
|
4594
|
-
.w-tag-close:active {
|
|
4595
|
-
background-color: rgba(0, 0, 0, 0.32);
|
|
4596
|
-
}
|
|
4597
|
-
|
|
4598
4608
|
.w-textarea {
|
|
4599
4609
|
position: relative;
|
|
4600
4610
|
font-size: 14px;
|
package/dist/uiw.js
CHANGED
|
@@ -6822,7 +6822,7 @@ function Row_Row(props) {
|
|
|
6822
6822
|
|
|
6823
6823
|
|
|
6824
6824
|
|
|
6825
|
-
var FormItem_excluded = ["prefixCls", "className", "style", "label", "labelFor", "labelClassName", "labelStyle", "help", "inline", "initialValue", "validator", "hasError"];
|
|
6825
|
+
var FormItem_excluded = ["prefixCls", "className", "required", "style", "label", "labelFor", "labelClassName", "labelStyle", "help", "inline", "initialValue", "validator", "hasError"];
|
|
6826
6826
|
|
|
6827
6827
|
|
|
6828
6828
|
|
|
@@ -6846,6 +6846,7 @@ var FormItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
6846
6846
|
var _this$props = this.props,
|
|
6847
6847
|
prefixCls = _this$props.prefixCls,
|
|
6848
6848
|
className = _this$props.className,
|
|
6849
|
+
required = _this$props.required,
|
|
6849
6850
|
style = _this$props.style,
|
|
6850
6851
|
label = _this$props.label,
|
|
6851
6852
|
labelFor = _this$props.labelFor,
|
|
@@ -6865,14 +6866,19 @@ var FormItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
6865
6866
|
style: style
|
|
6866
6867
|
}, otherProps, {
|
|
6867
6868
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(Row_Row, {
|
|
6868
|
-
children: [/*#__PURE__*/(0,jsx_runtime.
|
|
6869
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(Col, {
|
|
6869
6870
|
fixed: true,
|
|
6870
6871
|
className: labelCls,
|
|
6871
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
6872
|
+
children: [required && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
6873
|
+
style: {
|
|
6874
|
+
color: 'red'
|
|
6875
|
+
},
|
|
6876
|
+
children: "*"
|
|
6877
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
6872
6878
|
style: labelStyle,
|
|
6873
6879
|
htmlFor: labelFor,
|
|
6874
6880
|
children: label
|
|
6875
|
-
})
|
|
6881
|
+
})]
|
|
6876
6882
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Col, {
|
|
6877
6883
|
className: "w-form-row",
|
|
6878
6884
|
children: this.props.children
|
|
@@ -6890,11 +6896,18 @@ var FormItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
6890
6896
|
className: cls,
|
|
6891
6897
|
style: style
|
|
6892
6898
|
}, otherProps, {
|
|
6893
|
-
children: [label && /*#__PURE__*/(0,jsx_runtime.
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6899
|
+
children: [label && /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
6900
|
+
children: [required && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
6901
|
+
style: {
|
|
6902
|
+
color: 'red'
|
|
6903
|
+
},
|
|
6904
|
+
children: "*"
|
|
6905
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
6906
|
+
className: labelCls,
|
|
6907
|
+
style: labelStyle,
|
|
6908
|
+
htmlFor: labelFor,
|
|
6909
|
+
children: label
|
|
6910
|
+
})]
|
|
6898
6911
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Col, {
|
|
6899
6912
|
className: "w-form-row",
|
|
6900
6913
|
children: this.props.children
|
|
@@ -7002,7 +7015,11 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
|
|
|
7002
7015
|
resetForm: handleReset,
|
|
7003
7016
|
getFieldValues: function getFieldValues() {
|
|
7004
7017
|
return data.current;
|
|
7005
|
-
}
|
|
7018
|
+
},
|
|
7019
|
+
getError: function getError() {
|
|
7020
|
+
return data.errors;
|
|
7021
|
+
},
|
|
7022
|
+
setFields: setFields
|
|
7006
7023
|
};
|
|
7007
7024
|
}, [data]);
|
|
7008
7025
|
var formUnits = {};
|
|
@@ -7032,6 +7049,11 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
|
|
|
7032
7049
|
})));
|
|
7033
7050
|
}
|
|
7034
7051
|
|
|
7052
|
+
function setFields(fields) {
|
|
7053
|
+
data.current = fields;
|
|
7054
|
+
setData(data);
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7035
7057
|
function handleChange(name, validator, element, cb) {
|
|
7036
7058
|
return function (env, list) {
|
|
7037
7059
|
var value = env && env.target && 'value' in env.target ? env.target.value : env; // 控件 Checkbox.Group 多选值的处理
|
|
@@ -7094,13 +7116,11 @@ function Form(_ref, ref //| React.RefObject<FormRefType>,
|
|
|
7094
7116
|
setData(_extends({}, data, nextState, {
|
|
7095
7117
|
errors: {}
|
|
7096
7118
|
}));
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
});
|
|
7103
|
-
};
|
|
7119
|
+
afterSubmit && afterSubmit({
|
|
7120
|
+
state: data,
|
|
7121
|
+
response: response,
|
|
7122
|
+
reset: handleReset
|
|
7123
|
+
});
|
|
7104
7124
|
};
|
|
7105
7125
|
|
|
7106
7126
|
try {
|
|
@@ -9286,11 +9306,95 @@ function Rate(props) {
|
|
|
9286
9306
|
})
|
|
9287
9307
|
}));
|
|
9288
9308
|
}
|
|
9309
|
+
;// CONCATENATED MODULE: ../react-tag/esm/style/index.css
|
|
9310
|
+
// extracted by mini-css-extract-plugin
|
|
9311
|
+
/* harmony default export */ var react_tag_esm_style = ({});
|
|
9312
|
+
;// CONCATENATED MODULE: ../react-tag/esm/index.js
|
|
9313
|
+
|
|
9314
|
+
|
|
9315
|
+
var react_tag_esm_excluded = ["prefixCls", "className", "style", "title", "children", "visible", "color", "disabled", "bordered", "closable", "light", "onClose"];
|
|
9316
|
+
|
|
9317
|
+
|
|
9318
|
+
|
|
9319
|
+
|
|
9320
|
+
/* harmony default export */ var react_tag_esm = (function (props) {
|
|
9321
|
+
if (props === void 0) {
|
|
9322
|
+
props = {};
|
|
9323
|
+
}
|
|
9324
|
+
|
|
9325
|
+
var _props = props,
|
|
9326
|
+
_props$prefixCls = _props.prefixCls,
|
|
9327
|
+
prefixCls = _props$prefixCls === void 0 ? 'w-tag' : _props$prefixCls,
|
|
9328
|
+
className = _props.className,
|
|
9329
|
+
style = _props.style,
|
|
9330
|
+
_props$title = _props.title,
|
|
9331
|
+
title = _props$title === void 0 ? '' : _props$title,
|
|
9332
|
+
children = _props.children,
|
|
9333
|
+
_props$visible = _props.visible,
|
|
9334
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
9335
|
+
_props$color = _props.color,
|
|
9336
|
+
color = _props$color === void 0 ? '#6E6E6E' : _props$color,
|
|
9337
|
+
_props$disabled = _props.disabled,
|
|
9338
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
9339
|
+
_props$bordered = _props.bordered,
|
|
9340
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
9341
|
+
closable = _props.closable,
|
|
9342
|
+
_props$light = _props.light,
|
|
9343
|
+
light = _props$light === void 0 ? false : _props$light,
|
|
9344
|
+
onClose = _props.onClose,
|
|
9345
|
+
other = _objectWithoutPropertiesLoose(props, react_tag_esm_excluded);
|
|
9346
|
+
|
|
9347
|
+
var cls = [prefixCls, className, light ? prefixCls + "-light" : null, disabled ? 'disabled' : null].filter(Boolean).join(' ').trim();
|
|
9348
|
+
|
|
9349
|
+
var styl = _extends({}, style);
|
|
9350
|
+
|
|
9351
|
+
if (!light) {
|
|
9352
|
+
styl.color = '#fff';
|
|
9353
|
+
styl.backgroundColor = color;
|
|
9354
|
+
} else {
|
|
9355
|
+
styl.color = color;
|
|
9356
|
+
styl.borderColor = color;
|
|
9357
|
+
|
|
9358
|
+
if (bordered && light) {
|
|
9359
|
+
styl.boxShadow = "inset 0 0 0 1px " + color;
|
|
9360
|
+
}
|
|
9361
|
+
}
|
|
9362
|
+
|
|
9363
|
+
if (!visible) {
|
|
9364
|
+
return null;
|
|
9365
|
+
}
|
|
9366
|
+
|
|
9367
|
+
var closeBtn = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
9368
|
+
return closable ? /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
|
|
9369
|
+
onClick: onClose,
|
|
9370
|
+
className: prefixCls + "-close",
|
|
9371
|
+
width: "15",
|
|
9372
|
+
height: "15",
|
|
9373
|
+
viewBox: "0 0 16 16",
|
|
9374
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
|
|
9375
|
+
d: "M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z"
|
|
9376
|
+
})
|
|
9377
|
+
}) : null;
|
|
9378
|
+
}, [closable]);
|
|
9379
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", _extends({
|
|
9380
|
+
className: cls,
|
|
9381
|
+
style: styl
|
|
9382
|
+
}, other, {
|
|
9383
|
+
children: [title || children, closeBtn]
|
|
9384
|
+
}));
|
|
9385
|
+
});
|
|
9386
|
+
;// CONCATENATED MODULE: ../react-search-select/esm/style/index.css
|
|
9387
|
+
// extracted by mini-css-extract-plugin
|
|
9388
|
+
/* harmony default export */ var react_search_select_esm_style = ({});
|
|
9289
9389
|
;// CONCATENATED MODULE: ../react-search-select/esm/index.js
|
|
9290
9390
|
|
|
9291
9391
|
|
|
9292
9392
|
|
|
9293
|
-
|
|
9393
|
+
|
|
9394
|
+
var react_search_select_esm_excluded = ["allowClear", "disabled", "size", "option", "loading", "prefixCls", "className", "mode", "style", "isOpen", "value", "defaultValue", "showSearch", "placeholder", "onSearch", "onChange", "onSelect"];
|
|
9395
|
+
|
|
9396
|
+
|
|
9397
|
+
|
|
9294
9398
|
|
|
9295
9399
|
|
|
9296
9400
|
|
|
@@ -9311,6 +9415,11 @@ function SearchSelect(props) {
|
|
|
9311
9415
|
option = _props$option === void 0 ? [] : _props$option,
|
|
9312
9416
|
_props$loading = props.loading,
|
|
9313
9417
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
9418
|
+
_props$prefixCls = props.prefixCls,
|
|
9419
|
+
prefixCls = _props$prefixCls === void 0 ? 'w-search-select' : _props$prefixCls,
|
|
9420
|
+
className = props.className,
|
|
9421
|
+
_props$mode = props.mode,
|
|
9422
|
+
mode = _props$mode === void 0 ? 'single' : _props$mode,
|
|
9314
9423
|
style = props.style,
|
|
9315
9424
|
value = props.value,
|
|
9316
9425
|
defaultValue = props.defaultValue,
|
|
@@ -9321,12 +9430,19 @@ function SearchSelect(props) {
|
|
|
9321
9430
|
onSelect = props.onSelect,
|
|
9322
9431
|
others = _objectWithoutPropertiesLoose(props, react_search_select_esm_excluded);
|
|
9323
9432
|
|
|
9433
|
+
var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
|
|
9434
|
+
var isMultiple = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
9435
|
+
return mode === 'multiple';
|
|
9436
|
+
}, [mode]);
|
|
9437
|
+
|
|
9324
9438
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
9325
9439
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9326
9440
|
innerIsOpen = _useState2[0],
|
|
9327
9441
|
setInnerIsOpen = _useState2[1];
|
|
9328
9442
|
|
|
9329
|
-
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
9443
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(option.filter(function (item) {
|
|
9444
|
+
return item.value === value;
|
|
9445
|
+
})),
|
|
9330
9446
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
9331
9447
|
selectedValue = _useState4[0],
|
|
9332
9448
|
setSelectedValue = _useState4[1];
|
|
@@ -9342,28 +9458,58 @@ function SearchSelect(props) {
|
|
|
9342
9458
|
setSelectIconType = _useState8[1];
|
|
9343
9459
|
|
|
9344
9460
|
var divRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
9461
|
+
var valueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
9462
|
+
valueRef.current = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
9463
|
+
return selectedValue;
|
|
9464
|
+
}, [selectedValue]);
|
|
9345
9465
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
9346
9466
|
if (defaultValue) {
|
|
9347
|
-
var defaultMenuItem = option.
|
|
9348
|
-
return
|
|
9467
|
+
var defaultMenuItem = option.filter(function (opt) {
|
|
9468
|
+
return opt.value === defaultValue;
|
|
9349
9469
|
});
|
|
9350
|
-
setSelectedValue(
|
|
9351
|
-
setSelectedLabel(defaultMenuItem ? defaultMenuItem.label : '');
|
|
9470
|
+
setSelectedValue(defaultMenuItem);
|
|
9352
9471
|
}
|
|
9353
9472
|
}, []);
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9473
|
+
|
|
9474
|
+
function removeSelectItem(index) {
|
|
9475
|
+
var selectedValue = valueRef.current;
|
|
9476
|
+
selectedValue.splice(index, 1);
|
|
9477
|
+
|
|
9478
|
+
var values = _toConsumableArray(selectedValue);
|
|
9479
|
+
|
|
9480
|
+
return values;
|
|
9481
|
+
}
|
|
9359
9482
|
|
|
9360
9483
|
function handleItemClick(item) {
|
|
9361
9484
|
setInnerIsOpen(false);
|
|
9362
|
-
|
|
9485
|
+
var values = [item];
|
|
9486
|
+
setSelectedValue(values);
|
|
9363
9487
|
setSelectedLabel(item.label);
|
|
9364
|
-
|
|
9488
|
+
var resultValue = item.value;
|
|
9489
|
+
onSelect && onSelect(resultValue); // 支持form组件
|
|
9490
|
+
|
|
9491
|
+
handleSelectChange(resultValue);
|
|
9492
|
+
}
|
|
9493
|
+
|
|
9494
|
+
function handleItemsClick(item) {
|
|
9495
|
+
var values = [];
|
|
9496
|
+
var index = selectedValue.findIndex(function (finds) {
|
|
9497
|
+
return finds.value === item.value;
|
|
9498
|
+
});
|
|
9365
9499
|
|
|
9366
|
-
|
|
9500
|
+
if (index !== -1) {
|
|
9501
|
+
values = removeSelectItem(index);
|
|
9502
|
+
} else {
|
|
9503
|
+
values = [].concat(_toConsumableArray(selectedValue), [item]);
|
|
9504
|
+
}
|
|
9505
|
+
|
|
9506
|
+
setSelectedValue(values);
|
|
9507
|
+
var resultValue = values.map(function (item) {
|
|
9508
|
+
return item.value;
|
|
9509
|
+
});
|
|
9510
|
+
onSelect && onSelect(resultValue); // // 支持form组件
|
|
9511
|
+
|
|
9512
|
+
handleSelectChange(resultValue);
|
|
9367
9513
|
} // 渲染icon
|
|
9368
9514
|
|
|
9369
9515
|
|
|
@@ -9385,14 +9531,13 @@ function SearchSelect(props) {
|
|
|
9385
9531
|
setInnerIsOpen(!!value);
|
|
9386
9532
|
setSelectedLabel(value);
|
|
9387
9533
|
setSelectIconType(showSearch && value ? 'loading' : '');
|
|
9388
|
-
showSearch && onSearch && onSearch(value);
|
|
9389
|
-
handleSelectChange(value);
|
|
9534
|
+
showSearch && onSearch && onSearch(value); // handleSelectChange(value);
|
|
9390
9535
|
} // 清除选中的值
|
|
9391
9536
|
|
|
9392
9537
|
|
|
9393
9538
|
function resetSelectedValue() {
|
|
9394
9539
|
setInnerIsOpen(false);
|
|
9395
|
-
setSelectedValue(
|
|
9540
|
+
setSelectedValue([]);
|
|
9396
9541
|
setSelectedLabel('');
|
|
9397
9542
|
setSelectIconType('');
|
|
9398
9543
|
handleSelectChange('');
|
|
@@ -9402,7 +9547,15 @@ function SearchSelect(props) {
|
|
|
9402
9547
|
onChange && onChange(value);
|
|
9403
9548
|
}
|
|
9404
9549
|
|
|
9550
|
+
function inputKeyDown(e) {
|
|
9551
|
+
if (selectedValue.length > 0 && !!selectedLabel && e.keyCode === 8) {
|
|
9552
|
+
var values = removeSelectItem(selectedValue.length - 1);
|
|
9553
|
+
setSelectedValue(values);
|
|
9554
|
+
}
|
|
9555
|
+
}
|
|
9556
|
+
|
|
9405
9557
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
|
|
9558
|
+
className: cls,
|
|
9406
9559
|
trigger: "focus",
|
|
9407
9560
|
style: {
|
|
9408
9561
|
marginTop: 5
|
|
@@ -9410,7 +9563,8 @@ function SearchSelect(props) {
|
|
|
9410
9563
|
disabled: option && option.length > 0 ? false : true
|
|
9411
9564
|
}, others, {
|
|
9412
9565
|
onVisibleChange: function onVisibleChange(open) {
|
|
9413
|
-
|
|
9566
|
+
if (!open && isMultiple) setSelectedLabel('');
|
|
9567
|
+
setInnerIsOpen(open);
|
|
9414
9568
|
},
|
|
9415
9569
|
isOpen: innerIsOpen,
|
|
9416
9570
|
menu: /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm, {
|
|
@@ -9418,6 +9572,7 @@ function SearchSelect(props) {
|
|
|
9418
9572
|
style: {
|
|
9419
9573
|
minHeight: 25,
|
|
9420
9574
|
maxHeight: 280,
|
|
9575
|
+
minWidth: (style == null ? void 0 : style.minWidth) || 200,
|
|
9421
9576
|
overflowY: 'scroll',
|
|
9422
9577
|
width: divRef.current ? divRef.current.offsetWidth : 'auto'
|
|
9423
9578
|
},
|
|
@@ -9428,12 +9583,14 @@ function SearchSelect(props) {
|
|
|
9428
9583
|
},
|
|
9429
9584
|
children: loading ? '正在加载数据...' : '没有数据'
|
|
9430
9585
|
}) : option.map(function (item, idx) {
|
|
9431
|
-
var active = selectedValue
|
|
9586
|
+
var active = !!selectedValue.find(function (finds) {
|
|
9587
|
+
return finds.value === item.value;
|
|
9588
|
+
});
|
|
9432
9589
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, {
|
|
9433
9590
|
active: active,
|
|
9434
9591
|
text: item.label,
|
|
9435
9592
|
onClick: function onClick() {
|
|
9436
|
-
return handleItemClick(item);
|
|
9593
|
+
return isMultiple ? handleItemsClick(item) : handleItemClick(item);
|
|
9437
9594
|
}
|
|
9438
9595
|
}, idx);
|
|
9439
9596
|
})
|
|
@@ -9446,19 +9603,51 @@ function SearchSelect(props) {
|
|
|
9446
9603
|
onMouseLeave: function onMouseLeave() {
|
|
9447
9604
|
return renderSelectIcon('leave');
|
|
9448
9605
|
},
|
|
9449
|
-
style:
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9606
|
+
style: _extends({
|
|
9607
|
+
width: 'auto',
|
|
9608
|
+
maxWidth: 'none'
|
|
9609
|
+
}, style),
|
|
9610
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
9611
|
+
style: isMultiple ? {
|
|
9612
|
+
display: 'flex',
|
|
9613
|
+
flexFlow: 'wrap',
|
|
9614
|
+
padding: 2,
|
|
9615
|
+
borderRadius: 3,
|
|
9616
|
+
boxShadow: '0px 0px 2px #333'
|
|
9617
|
+
} : undefined,
|
|
9618
|
+
children: [isMultiple && selectedValue.map(function (item, index) {
|
|
9619
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, {
|
|
9620
|
+
style: {
|
|
9621
|
+
margin: '0px 3px 3px 0px',
|
|
9622
|
+
display: 'flex',
|
|
9623
|
+
alignItems: 'center'
|
|
9624
|
+
},
|
|
9625
|
+
closable: true,
|
|
9626
|
+
onClose: function onClose() {
|
|
9627
|
+
return setSelectedValue(removeSelectItem(index));
|
|
9628
|
+
},
|
|
9629
|
+
color: "#ccc",
|
|
9630
|
+
children: item.label
|
|
9631
|
+
}, index);
|
|
9632
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
|
|
9633
|
+
style: {
|
|
9634
|
+
flex: 1,
|
|
9635
|
+
boxShadow: 'none'
|
|
9636
|
+
},
|
|
9637
|
+
className: isMultiple ? prefixCls + "-input-contents" : undefined,
|
|
9638
|
+
readOnly: !showSearch,
|
|
9639
|
+
size: size,
|
|
9640
|
+
disabled: disabled,
|
|
9641
|
+
onKeyDown: inputKeyDown,
|
|
9642
|
+
onChange: handleInputChange,
|
|
9643
|
+
value: selectedLabel,
|
|
9644
|
+
placeholder: placeholder,
|
|
9645
|
+
addonAfter: (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
9646
|
+
type: selectIconType,
|
|
9647
|
+
spin: loading && selectIconType === 'loading',
|
|
9648
|
+
onClick: resetSelectedValue
|
|
9649
|
+
})
|
|
9650
|
+
})]
|
|
9462
9651
|
})
|
|
9463
9652
|
})
|
|
9464
9653
|
}));
|
|
@@ -10702,83 +10891,6 @@ function Tabs(props) {
|
|
|
10702
10891
|
})]
|
|
10703
10892
|
}));
|
|
10704
10893
|
}
|
|
10705
|
-
;// CONCATENATED MODULE: ../react-tag/esm/style/index.css
|
|
10706
|
-
// extracted by mini-css-extract-plugin
|
|
10707
|
-
/* harmony default export */ var react_tag_esm_style = ({});
|
|
10708
|
-
;// CONCATENATED MODULE: ../react-tag/esm/index.js
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
var react_tag_esm_excluded = ["prefixCls", "className", "style", "title", "children", "visible", "color", "disabled", "bordered", "closable", "light", "onClose"];
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
/* harmony default export */ var react_tag_esm = (function (props) {
|
|
10717
|
-
if (props === void 0) {
|
|
10718
|
-
props = {};
|
|
10719
|
-
}
|
|
10720
|
-
|
|
10721
|
-
var _props = props,
|
|
10722
|
-
_props$prefixCls = _props.prefixCls,
|
|
10723
|
-
prefixCls = _props$prefixCls === void 0 ? 'w-tag' : _props$prefixCls,
|
|
10724
|
-
className = _props.className,
|
|
10725
|
-
style = _props.style,
|
|
10726
|
-
_props$title = _props.title,
|
|
10727
|
-
title = _props$title === void 0 ? '' : _props$title,
|
|
10728
|
-
children = _props.children,
|
|
10729
|
-
_props$visible = _props.visible,
|
|
10730
|
-
visible = _props$visible === void 0 ? true : _props$visible,
|
|
10731
|
-
_props$color = _props.color,
|
|
10732
|
-
color = _props$color === void 0 ? '#6E6E6E' : _props$color,
|
|
10733
|
-
_props$disabled = _props.disabled,
|
|
10734
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
10735
|
-
_props$bordered = _props.bordered,
|
|
10736
|
-
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
10737
|
-
closable = _props.closable,
|
|
10738
|
-
_props$light = _props.light,
|
|
10739
|
-
light = _props$light === void 0 ? false : _props$light,
|
|
10740
|
-
onClose = _props.onClose,
|
|
10741
|
-
other = _objectWithoutPropertiesLoose(props, react_tag_esm_excluded);
|
|
10742
|
-
|
|
10743
|
-
var cls = [prefixCls, className, light ? prefixCls + "-light" : null, disabled ? 'disabled' : null].filter(Boolean).join(' ').trim();
|
|
10744
|
-
|
|
10745
|
-
var styl = _extends({}, style);
|
|
10746
|
-
|
|
10747
|
-
if (!light) {
|
|
10748
|
-
styl.color = '#fff';
|
|
10749
|
-
styl.backgroundColor = color;
|
|
10750
|
-
} else {
|
|
10751
|
-
styl.color = color;
|
|
10752
|
-
styl.borderColor = color;
|
|
10753
|
-
|
|
10754
|
-
if (bordered && light) {
|
|
10755
|
-
styl.boxShadow = "inset 0 0 0 1px " + color;
|
|
10756
|
-
}
|
|
10757
|
-
}
|
|
10758
|
-
|
|
10759
|
-
if (!visible) {
|
|
10760
|
-
return null;
|
|
10761
|
-
}
|
|
10762
|
-
|
|
10763
|
-
var closeBtn = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
10764
|
-
return closable ? /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
|
|
10765
|
-
onClick: onClose,
|
|
10766
|
-
className: prefixCls + "-close",
|
|
10767
|
-
width: "15",
|
|
10768
|
-
height: "15",
|
|
10769
|
-
viewBox: "0 0 16 16",
|
|
10770
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
|
|
10771
|
-
d: "M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z"
|
|
10772
|
-
})
|
|
10773
|
-
}) : null;
|
|
10774
|
-
}, [closable]);
|
|
10775
|
-
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", _extends({
|
|
10776
|
-
className: cls,
|
|
10777
|
-
style: styl
|
|
10778
|
-
}, other, {
|
|
10779
|
-
children: [title || children, closeBtn]
|
|
10780
|
-
}));
|
|
10781
|
-
});
|
|
10782
10894
|
;// CONCATENATED MODULE: ../react-textarea/esm/style/index.css
|
|
10783
10895
|
// extracted by mini-css-extract-plugin
|
|
10784
10896
|
/* harmony default export */ var react_textarea_esm_style = ({});
|