uiw 4.18.1 → 4.19.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.css CHANGED
@@ -3867,8 +3867,7 @@ a.w-list-item:hover:not(.w-disabled) {
3867
3867
  .w-search-select-input-contents input {
3868
3868
  box-shadow: none;
3869
3869
  padding: 0px;
3870
- min-width: 50px;
3871
- height: 22px;
3870
+ height: 28px;
3872
3871
  }
3873
3872
  .w-search-select-input-contents .w-input-inner:hover {
3874
3873
  box-shadow: none !important;
@@ -3889,15 +3888,15 @@ a.w-list-item:hover:not(.w-disabled) {
3889
3888
  justify-content: space-between;
3890
3889
  outline: none;
3891
3890
  border: none;
3892
- align-items: center;
3893
3891
  border-radius: 3px;
3894
3892
  box-shadow: 0 0 0 0 rgba(19, 124, 189, 0), 0 0 0 0 rgba(19, 124, 189, 0), inset 0 0 0 1px rgba(16, 22, 26, 0.15), inset 0 1px 1px rgba(16, 22, 26, 0.2);
3895
3893
  box-sizing: border-box;
3896
3894
  background: #fff;
3897
3895
  margin: 0 !important;
3898
- padding: 3px 10px 3px 10px;
3896
+ padding: 1px 10px;
3899
3897
  vertical-align: middle;
3900
3898
  line-height: 30px;
3899
+ align-items: center;
3901
3900
  color: #393e48;
3902
3901
  font-weight: 400;
3903
3902
  font-size: inherit;
@@ -3937,6 +3936,15 @@ a.w-list-item:hover:not(.w-disabled) {
3937
3936
  .w-search-select-inner .w-input-large .w-input-inner {
3938
3937
  height: 28px;
3939
3938
  }
3939
+ .w-search-select-tag-content {
3940
+ display: flex;
3941
+ align-items: center;
3942
+ flex-flow: wrap;
3943
+ width: 100%;
3944
+ }
3945
+ .w-search-select-search-false {
3946
+ cursor: pointer;
3947
+ }
3940
3948
  .w-search-select-multiple-colse {
3941
3949
  left: 7px;
3942
3950
  font-size: 15px;
@@ -5071,7 +5079,6 @@ a.w-list-item:hover:not(.w-disabled) {
5071
5079
 
5072
5080
  .w-search-tree-input-contents {
5073
5081
  flex: 1 1;
5074
- min-width: 30px;
5075
5082
  top: 1px;
5076
5083
  }
5077
5084
  .w-search-tree-input-contents input {
package/dist/uiw.js CHANGED
@@ -346,6 +346,7 @@ __webpack_require__.d(__webpack_exports__, {
346
346
  "FormItem": () => (/* reexport */ FormItem),
347
347
  "Icon": () => (/* reexport */ Icon),
348
348
  "Input": () => (/* reexport */ react_input_esm),
349
+ "InputNumber": () => (/* reexport */ InputNumber),
349
350
  "Layout": () => (/* reexport */ react_layout_esm),
350
351
  "LayoutContent": () => (/* reexport */ LayoutContent),
351
352
  "LayoutContext": () => (/* reexport */ LayoutContext),
@@ -1562,7 +1563,8 @@ function Overlay(props) {
1562
1563
  } = props,
1563
1564
  otherProps = _objectWithoutPropertiesLoose(props, esm_excluded);
1564
1565
 
1565
- var [isOpen, setIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.isOpen || false);
1566
+ var [isOpen, setIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(); // const [isOpen, setIsOpen] = useState(props.isOpen || false);
1567
+
1566
1568
  var [visible, setVisible] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
1567
1569
  var container = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
1568
1570
  var overlay = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
@@ -1772,6 +1774,34 @@ var react_button_esm_excluded = ["prefixCls", "disabled", "active", "loading", "
1772
1774
  ;// CONCATENATED MODULE: ../react-modal/esm/style/index.css
1773
1775
  // extracted by mini-css-extract-plugin
1774
1776
  /* harmony default export */ const react_modal_esm_style = ({});
1777
+ ;// CONCATENATED MODULE: ../react-modal/esm/CallShow.js
1778
+
1779
+
1780
+ var CallShow_excluded = ["title", "children"];
1781
+
1782
+
1783
+
1784
+
1785
+ function CallShow(props) {
1786
+ var {
1787
+ title = '提示框',
1788
+ children
1789
+ } = props,
1790
+ other = _objectWithoutPropertiesLoose(props, CallShow_excluded);
1791
+
1792
+ var dv = document.createElement('div');
1793
+ dv.id = 'uiw-modal-call-show-element';
1794
+ document.body.appendChild(dv);
1795
+ external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().render( /*#__PURE__*/(0,jsx_runtime.jsx)(react_modal_esm, _extends({}, other, {
1796
+ title: title,
1797
+ isOpen: true,
1798
+ onClosed: () => {
1799
+ document.getElementById('uiw-modal-call-show-element').remove();
1800
+ },
1801
+ children: children
1802
+ })), document.getElementById('uiw-modal-call-show-element'));
1803
+ }
1804
+
1775
1805
  ;// CONCATENATED MODULE: ../react-modal/esm/index.js
1776
1806
 
1777
1807
 
@@ -1785,7 +1815,8 @@ var react_modal_esm_excluded = ["prefixCls", "className", "children", "useButton
1785
1815
 
1786
1816
 
1787
1817
 
1788
- /* harmony default export */ const react_modal_esm = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
1818
+
1819
+ var Modal = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
1789
1820
  var {
1790
1821
  prefixCls = 'w-modal',
1791
1822
  className,
@@ -1910,7 +1941,9 @@ var react_modal_esm_excluded = ["prefixCls", "className", "children", "useButton
1910
1941
  })
1911
1942
  })
1912
1943
  }));
1913
- }));
1944
+ });
1945
+ Modal.show = CallShow;
1946
+ /* harmony default export */ const react_modal_esm = (Modal);
1914
1947
 
1915
1948
  ;// CONCATENATED MODULE: ../react-alert/esm/style/index.css
1916
1949
  // extracted by mini-css-extract-plugin
@@ -3118,10 +3151,69 @@ Popover.defaultProps = {
3118
3151
  ;// CONCATENATED MODULE: ../react-input/esm/style/input.css
3119
3152
  // extracted by mini-css-extract-plugin
3120
3153
  /* harmony default export */ const input = ({});
3154
+ ;// CONCATENATED MODULE: ../react-input/esm/InputNumber.js
3155
+
3156
+
3157
+ var InputNumber_excluded = ["className", "min", "max", "step", "overLimitColor", "keyboard", "formatter", "prefixCls"];
3158
+
3159
+
3160
+
3161
+ /* harmony default export */ const InputNumber = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
3162
+ var {
3163
+ className,
3164
+ min,
3165
+ max,
3166
+ step,
3167
+ overLimitColor,
3168
+ keyboard = false,
3169
+ prefixCls = 'w-input-number'
3170
+ } = props,
3171
+ otherProps = _objectWithoutPropertiesLoose(props, InputNumber_excluded);
3172
+
3173
+ var value = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
3174
+ var _ref;
3175
+
3176
+ return Number.parseFloat((_ref = props.value || 0) == null ? void 0 : _ref.toString());
3177
+ }, [props.value]);
3178
+ var [isOverLimit, isOverLimitSet] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(overLimitComp(value));
3179
+
3180
+ function overLimitComp(value) {
3181
+ if (typeof min === 'number' && value < min) return true;
3182
+ if (typeof max === 'number' && value > max) return true;
3183
+ return false;
3184
+ }
3185
+
3186
+ var onChange = v => {
3187
+ var isOverLimit = overLimitComp(Number.parseFloat(v.target.value));
3188
+ isOverLimitSet(isOverLimit);
3189
+ props.onChange == null ? void 0 : props.onChange(v);
3190
+ };
3191
+
3192
+ var overLimitProps = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
3193
+ if (!overLimitColor) return {
3194
+ min,
3195
+ max
3196
+ };
3197
+ }, []);
3198
+ var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
3199
+ var inputStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => isOverLimit ? {
3200
+ color: overLimitColor == null ? void 0 : overLimitColor.toString()
3201
+ } : undefined, [isOverLimit]);
3202
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, _extends({}, otherProps, {
3203
+ className: cls,
3204
+ type: "number",
3205
+ inputStyle: inputStyle,
3206
+ onChange: onChange,
3207
+ step: step
3208
+ }, overLimitProps));
3209
+ }));
3210
+
3121
3211
  ;// CONCATENATED MODULE: ../react-input/esm/index.js
3122
3212
 
3123
3213
 
3124
- var react_input_esm_excluded = ["prefixCls", "className", "style", "size", "type", "preIcon", "addonAfter"];
3214
+ var react_input_esm_excluded = ["prefixCls", "className", "style", "size", "type", "preIcon", "addonAfter", "inputStyle"];
3215
+
3216
+
3125
3217
 
3126
3218
 
3127
3219
 
@@ -3135,7 +3227,8 @@ var react_input_esm_excluded = ["prefixCls", "className", "style", "size", "type
3135
3227
  size = 'default',
3136
3228
  type = 'text',
3137
3229
  preIcon = null,
3138
- addonAfter
3230
+ addonAfter,
3231
+ inputStyle
3139
3232
  } = props,
3140
3233
  otherProps = _objectWithoutPropertiesLoose(props, react_input_esm_excluded);
3141
3234
 
@@ -3164,6 +3257,7 @@ var react_input_esm_excluded = ["prefixCls", "className", "style", "size", "type
3164
3257
  type: type,
3165
3258
  autoComplete: "off"
3166
3259
  }, otherProps, {
3260
+ style: inputStyle,
3167
3261
  className: prefixCls + "-inner"
3168
3262
  })), addonAfter && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
3169
3263
  className: prefixCls + "-addon-after",
@@ -4555,6 +4649,7 @@ function Cascader(props) {
4555
4649
  value,
4556
4650
  onChange,
4557
4651
  onSearch,
4652
+ expandTrigger = 'click',
4558
4653
  size,
4559
4654
  disabled,
4560
4655
  allowClear,
@@ -4646,6 +4741,7 @@ function Cascader(props) {
4646
4741
 
4647
4742
  var handleItemClick = (optionsItem, level) => {
4648
4743
  selectedValue.splice(level, selectedValue.length - level, optionsItem);
4744
+ if (!optionsItem.children) setInnerIsOpen(false);
4649
4745
  handelChange(true, selectedValue);
4650
4746
  };
4651
4747
 
@@ -4674,6 +4770,26 @@ function Cascader(props) {
4674
4770
  };
4675
4771
 
4676
4772
  var widths = (style == null ? void 0 : style.width) * 0.7 || undefined;
4773
+ var trigger = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
4774
+ return (cb, click) => {
4775
+ var triggers = {
4776
+ onClick: () => {},
4777
+ onMouseOver: () => {}
4778
+ };
4779
+
4780
+ var callback = () => {
4781
+ cb();
4782
+ };
4783
+
4784
+ if (expandTrigger === 'click' || click) {
4785
+ triggers.onClick = callback;
4786
+ } else if (expandTrigger === 'hover') {
4787
+ triggers.onMouseOver = callback;
4788
+ }
4789
+
4790
+ return triggers;
4791
+ };
4792
+ }, []);
4677
4793
 
4678
4794
  var OptionIter = function OptionIter(option, level) {
4679
4795
  if (level === void 0) {
@@ -4696,17 +4812,18 @@ function Cascader(props) {
4696
4812
  },
4697
4813
  children: '没有数据'
4698
4814
  }) : option.map((opt, index) => {
4699
- var _selectedValue$level;
4815
+ var _selectedValue$level, _opt$children;
4700
4816
 
4701
4817
  var active = ((_selectedValue$level = selectedValue[level]) == null ? void 0 : _selectedValue$level.value) === opt.value;
4702
- return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, {
4818
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, _extends({
4703
4819
  active: active,
4704
4820
  text: opt.label,
4705
4821
  addonAfter: opt.children ? /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
4706
4822
  type: "right"
4707
- }) : undefined,
4708
- onClick: () => handleItemClick(opt, level)
4709
- }, index);
4823
+ }) : undefined
4824
+ }, trigger(() => {
4825
+ handleItemClick(opt, level);
4826
+ }, !((_opt$children = opt.children) != null && _opt$children.length))), index);
4710
4827
  })
4711
4828
  }, level);
4712
4829
  };
@@ -4755,8 +4872,7 @@ function Cascader(props) {
4755
4872
  }) : searchOption.filter(opt => opt.label.includes(searchText.trim())).map((opt, index) => {
4756
4873
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, {
4757
4874
  text: opt.label,
4758
- onClick: () => searchItemClick(opt.options) //
4759
-
4875
+ onClick: () => searchItemClick(opt.options)
4760
4876
  }, index);
4761
4877
  })
4762
4878
  }),
@@ -8343,7 +8459,7 @@ function SearchSelect(props) {
8343
8459
  style,
8344
8460
  value,
8345
8461
  defaultValue,
8346
- showSearch,
8462
+ showSearch = false,
8347
8463
  tagProps = {},
8348
8464
  placeholder,
8349
8465
  onSearch,
@@ -8555,13 +8671,10 @@ function SearchSelect(props) {
8555
8671
  maxWidth: 'none'
8556
8672
  }, style),
8557
8673
  children: isMultiple ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8558
- className: [prefixCls + "-inner", prefixCls + "-" + size].filter(Boolean).join(' ').trim(),
8674
+ className: [prefixCls + "-inner", prefixCls + "-search-" + showSearch, prefixCls + "-" + size].filter(Boolean).join(' ').trim(),
8559
8675
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8560
- style: {
8561
- display: 'flex',
8562
- flexFlow: 'wrap',
8563
- width: '100%'
8564
- },
8676
+ className: prefixCls + "-tag-content",
8677
+ style: {},
8565
8678
  children: [isMultiple && selectedValue.slice(0, maxTagCount).map((item, index) => {
8566
8679
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react_tag_esm, _extends({
8567
8680
  style: _extends({
@@ -8591,7 +8704,8 @@ function SearchSelect(props) {
8591
8704
  children: ["+", omitTagCount, " \u2026", ' ']
8592
8705
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
8593
8706
  style: {
8594
- flex: 1
8707
+ flex: 1,
8708
+ width: showSearch ? 0 : 50
8595
8709
  },
8596
8710
  className: prefixCls + "-input-contents",
8597
8711
  readOnly: !showSearch,
@@ -8610,6 +8724,7 @@ function SearchSelect(props) {
8610
8724
  onClick: resetSelectedValue
8611
8725
  })]
8612
8726
  }) : /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
8727
+ className: prefixCls + "-search-" + showSearch,
8613
8728
  readOnly: !showSearch,
8614
8729
  size: size,
8615
8730
  ref: inputRef,
@@ -11024,7 +11139,6 @@ function SearchTagInput(props) {
11024
11139
  }), index);
11025
11140
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
11026
11141
  ref: inputRef,
11027
- style: {},
11028
11142
  className: prefixCls + "-input-contents",
11029
11143
  size: size,
11030
11144
  disabled: disabled,