uiw 4.16.2 → 4.17.0

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.js CHANGED
@@ -4552,6 +4552,7 @@ function Cascader(props) {
4552
4552
  value,
4553
4553
  onChange,
4554
4554
  onSearch,
4555
+ disabled,
4555
4556
  allowClear,
4556
4557
  placeholder,
4557
4558
  prefixCls = 'w-cascader',
@@ -4667,7 +4668,7 @@ function Cascader(props) {
4667
4668
  onSearch && handelSearch(value);
4668
4669
  };
4669
4670
 
4670
- var widths = (style == null ? void 0 : style.width) * 0.5 || undefined;
4671
+ var widths = (style == null ? void 0 : style.width) * 0.7 || undefined;
4671
4672
 
4672
4673
  var OptionIter = function OptionIter(option, level) {
4673
4674
  if (level === void 0) {
@@ -4717,7 +4718,8 @@ function Cascader(props) {
4717
4718
  }, style),
4718
4719
  overlayStyl: {
4719
4720
  width: 100
4720
- }
4721
+ },
4722
+ disabled: disabled
4721
4723
  }, others, {
4722
4724
  onVisibleChange: onVisibleChange,
4723
4725
  isOpen: innerIsOpen,
@@ -4759,6 +4761,7 @@ function Cascader(props) {
4759
4761
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
4760
4762
  value: searchOn ? searchText : inputValue,
4761
4763
  onChange: inputChange,
4764
+ disabled: disabled,
4762
4765
  placeholder: searchOn ? inputValue : placeholder,
4763
4766
  style: {
4764
4767
  width: style == null ? void 0 : style.width
@@ -4770,7 +4773,7 @@ function Cascader(props) {
4770
4773
  style: {
4771
4774
  width: 'auto'
4772
4775
  },
4773
- children: selectIconType === 'close' && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
4776
+ children: !disabled && selectIconType === 'close' && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
4774
4777
  type: selectIconType,
4775
4778
  onClick: onClear,
4776
4779
  className: prefixCls + "-close"
@@ -8227,7 +8230,7 @@ var react_tag_esm_excluded = ["prefixCls", "className", "style", "title", "child
8227
8230
  ;// CONCATENATED MODULE: ../react-search-select/esm/index.js
8228
8231
 
8229
8232
 
8230
- var react_search_select_esm_excluded = ["allowClear", "disabled", "size", "maxTagCount", "option", "loading", "labelInValue", "prefixCls", "className", "mode", "style", "isOpen", "value", "defaultValue", "showSearch", "tagProps", "placeholder", "onSearch", "onChange", "onSelect"];
8233
+ var react_search_select_esm_excluded = ["allowClear", "disabled", "valueAmount", "size", "option", "maxTagCount", "loading", "labelInValue", "prefixCls", "className", "mode", "style", "isOpen", "value", "defaultValue", "showSearch", "tagProps", "placeholder", "onSearch", "onChange", "onSelect"];
8231
8234
 
8232
8235
 
8233
8236
 
@@ -8246,9 +8249,10 @@ function SearchSelect(props) {
8246
8249
  var {
8247
8250
  allowClear = false,
8248
8251
  disabled = false,
8252
+ valueAmount,
8249
8253
  size = 'default',
8250
- maxTagCount,
8251
8254
  option = [],
8255
+ maxTagCount,
8252
8256
  loading = false,
8253
8257
  labelInValue = false,
8254
8258
  prefixCls = 'w-search-select',
@@ -8326,7 +8330,7 @@ function SearchSelect(props) {
8326
8330
  }
8327
8331
 
8328
8332
  if (!isMultiple && opts.length > 0) setSelectedLabel(opts[0].label || '');
8329
- setSelectedValue(opts);
8333
+ setSelectedValue(opts.slice(0, valueAmount));
8330
8334
  }
8331
8335
 
8332
8336
  function removeSelectItem(index) {
@@ -8350,7 +8354,7 @@ function SearchSelect(props) {
8350
8354
  }
8351
8355
 
8352
8356
  function handleItemsClick(index, item) {
8353
- var values = index !== -1 ? removeSelectItem(index) : [...selectedValue, item];
8357
+ var values = index !== -1 ? removeSelectItem(index) : [...selectedValue.slice(0, valueAmount ? valueAmount - 1 : undefined), item];
8354
8358
  var resultValue = values.map(item => item.value);
8355
8359
  handleChange(resultValue, values);
8356
8360
  }