@kdcloudjs/kdesign 1.8.8 → 1.8.10

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.
@@ -237,7 +237,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
237
237
  max = inputNumberProps.max,
238
238
  onBlur = inputNumberProps.onBlur;
239
239
  var _inputValue = inputValue;
240
- if (_inputValue === '-') {
240
+ if (_inputValue === '-' || _inputValue === '.') {
241
241
  _inputValue = '';
242
242
  }
243
243
  var bigValue = new Big(Number(_inputValue));
@@ -42,10 +42,13 @@ var InternalSearch = function InternalSearch(props, ref) {
42
42
  children = searchProps.children,
43
43
  type = searchProps.type,
44
44
  placeholder = searchProps.placeholder,
45
+ value = searchProps.value,
46
+ defaultValue = searchProps.defaultValue,
47
+ allowClear = searchProps.allowClear,
45
48
  onSearch = searchProps.onSearch,
46
49
  onFocus = searchProps.onFocus,
47
50
  onBlur = searchProps.onBlur,
48
- restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "onSearch", "onFocus", "onBlur"]);
51
+ restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "value", "defaultValue", "allowClear", "onSearch", "onFocus", "onBlur"]);
49
52
  devWarning(SearchSizeTypes.indexOf(size) === -1, 'search', "cannot found search size '".concat(size, "'"));
50
53
  devWarning(BorderTypes.indexOf(borderType) === -1, 'search', "cannot found search borderType '".concat(borderType, "'"));
51
54
  devWarning(SearchTypes.indexOf(type) === -1, 'search', "cannot found search Search type '".concat(type, "'"));
@@ -110,10 +113,13 @@ var InternalSearch = function InternalSearch(props, ref) {
110
113
  prefixCls: searchPrefixCls
111
114
  }));
112
115
  }
113
- return /*#__PURE__*/React.createElement("div", {
116
+ return /*#__PURE__*/React.createElement("div", _extends({
114
117
  className: searchCls,
115
118
  style: style
116
- }, /*#__PURE__*/React.createElement(Input, {
119
+ }, restProps), /*#__PURE__*/React.createElement(Input, {
120
+ value: value,
121
+ defaultValue: defaultValue,
122
+ allowClear: allowClear,
117
123
  ref: searchRef,
118
124
  size: size,
119
125
  disabled: disabled,
@@ -687,20 +687,6 @@
687
687
  display: -ms-flexbox;
688
688
  display: flex;
689
689
  }
690
- .kd-search-panel .kd-input-clear-icon {
691
- display: inline-block;
692
- width: 18px;
693
- height: 18px;
694
- border-radius: 50%;
695
- background: var(--kd-c-search-color-end, var(--kd-g-color-end, #666));
696
- position: relative;
697
- }
698
- .kd-search-panel .kd-input-clear-icon .kdicon {
699
- position: absolute;
700
- right: 2.5px;
701
- top: -2px;
702
- color: #fff;
703
- }
704
690
  .kd-search-panel-tooltip::before {
705
691
  display: none;
706
692
  }
@@ -455,21 +455,6 @@
455
455
  }
456
456
  }
457
457
 
458
- .@{kd-prefix}-input-clear-icon {
459
- display: inline-block;
460
- width: 18px;
461
- height: 18px;
462
- border-radius: 50%;
463
- background: @search-end-color;
464
- position: relative;
465
-
466
- .@{kd-prefix}icon {
467
- position: absolute;
468
- right: 2.5px;
469
- top: -2px;
470
- color: @white;
471
- }
472
- }
473
458
  }
474
459
 
475
460
  .@{search-panel-prefix-cls}-tooltip::before {
package/es/tree/tree.js CHANGED
@@ -185,8 +185,14 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
185
185
  var node = wrapperDom ? (_a = wrapperDom === null || wrapperDom === void 0 ? void 0 : wrapperDom.children[0]) === null || _a === void 0 ? void 0 : _a.children[scrollIndex] : null;
186
186
  if (node && wrapperDom) {
187
187
  var containerHeight = wrapperDom.clientHeight;
188
+ var containerTop = wrapperDom.scrollTop;
189
+ var containerBottom = containerTop + containerHeight;
188
190
  var targetHeight = node.clientHeight;
189
- var scrollPosition = node.offsetTop + targetHeight - containerHeight;
191
+ var targetTop = node.offsetTop;
192
+ var targetBottom = targetTop + targetHeight;
193
+ var isInView = targetTop >= containerTop && targetBottom <= containerBottom;
194
+ if (isInView) return;
195
+ var scrollPosition = targetTop + targetHeight - containerHeight;
190
196
  wrapperDom.scrollTop = scrollPosition;
191
197
  }
192
198
  }
@@ -209,7 +209,7 @@ var TreeNode = /*#__PURE__*/React.forwardRef(function (props) {
209
209
  className: classNames("".concat(treeNodePrefixCls, "-drag-line-top"))
210
210
  }), checkable ? /*#__PURE__*/React.createElement(Checkbox, {
211
211
  onChange: handleOnchange,
212
- checked: checked,
212
+ checked: !disabled && checked,
213
213
  indeterminate: !disabled && indeterminate,
214
214
  disabled: disabled,
215
215
  onClick: function onClick(e) {
@@ -543,7 +543,7 @@ export var getDataCheckededState = function getDataCheckededState(data, checkedK
543
543
  };
544
544
  };
545
545
  export var getDataCheckededStateStrictly = function getDataCheckededStateStrictly(checkedKeys) {
546
- var _checkedKeys = _toConsumableArray(checkedKeys);
546
+ var _checkedKeys = _toConsumableArray(checkedKeys || []);
547
547
  return {
548
548
  checkedKeys: _Array$from(new _Set(_checkedKeys)),
549
549
  halfCheckedKeys: []
@@ -249,7 +249,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
249
249
  max = inputNumberProps.max,
250
250
  onBlur = inputNumberProps.onBlur;
251
251
  var _inputValue = inputValue;
252
- if (_inputValue === '-') {
252
+ if (_inputValue === '-' || _inputValue === '.') {
253
253
  _inputValue = '';
254
254
  }
255
255
  var bigValue = new _big.default(Number(_inputValue));
@@ -54,10 +54,13 @@ var InternalSearch = function InternalSearch(props, ref) {
54
54
  children = searchProps.children,
55
55
  type = searchProps.type,
56
56
  placeholder = searchProps.placeholder,
57
+ value = searchProps.value,
58
+ defaultValue = searchProps.defaultValue,
59
+ allowClear = searchProps.allowClear,
57
60
  onSearch = searchProps.onSearch,
58
61
  onFocus = searchProps.onFocus,
59
62
  onBlur = searchProps.onBlur,
60
- restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "onSearch", "onFocus", "onBlur"]);
63
+ restProps = __rest(searchProps, ["prefixCls", "className", "style", "size", "disabled", "onPressEnter", "prefix", "suffix", "borderType", "children", "type", "placeholder", "value", "defaultValue", "allowClear", "onSearch", "onFocus", "onBlur"]);
61
64
  (0, _devwarning.default)(_interface.SearchSizeTypes.indexOf(size) === -1, 'search', "cannot found search size '".concat(size, "'"));
62
65
  (0, _devwarning.default)(_interface.BorderTypes.indexOf(borderType) === -1, 'search', "cannot found search borderType '".concat(borderType, "'"));
63
66
  (0, _devwarning.default)(_interface.SearchTypes.indexOf(type) === -1, 'search', "cannot found search Search type '".concat(type, "'"));
@@ -122,10 +125,13 @@ var InternalSearch = function InternalSearch(props, ref) {
122
125
  prefixCls: searchPrefixCls
123
126
  }));
124
127
  }
125
- return /*#__PURE__*/_react.default.createElement("div", {
128
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
126
129
  className: searchCls,
127
130
  style: style
128
- }, /*#__PURE__*/_react.default.createElement(_index.Input, {
131
+ }, restProps), /*#__PURE__*/_react.default.createElement(_index.Input, {
132
+ value: value,
133
+ defaultValue: defaultValue,
134
+ allowClear: allowClear,
129
135
  ref: searchRef,
130
136
  size: size,
131
137
  disabled: disabled,
@@ -687,20 +687,6 @@
687
687
  display: -ms-flexbox;
688
688
  display: flex;
689
689
  }
690
- .kd-search-panel .kd-input-clear-icon {
691
- display: inline-block;
692
- width: 18px;
693
- height: 18px;
694
- border-radius: 50%;
695
- background: var(--kd-c-search-color-end, var(--kd-g-color-end, #666));
696
- position: relative;
697
- }
698
- .kd-search-panel .kd-input-clear-icon .kdicon {
699
- position: absolute;
700
- right: 2.5px;
701
- top: -2px;
702
- color: #fff;
703
- }
704
690
  .kd-search-panel-tooltip::before {
705
691
  display: none;
706
692
  }
@@ -455,21 +455,6 @@
455
455
  }
456
456
  }
457
457
 
458
- .@{kd-prefix}-input-clear-icon {
459
- display: inline-block;
460
- width: 18px;
461
- height: 18px;
462
- border-radius: 50%;
463
- background: @search-end-color;
464
- position: relative;
465
-
466
- .@{kd-prefix}icon {
467
- position: absolute;
468
- right: 2.5px;
469
- top: -2px;
470
- color: @white;
471
- }
472
- }
473
458
  }
474
459
 
475
460
  .@{search-panel-prefix-cls}-tooltip::before {
package/lib/tree/tree.js CHANGED
@@ -197,8 +197,14 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
197
197
  var node = wrapperDom ? (_a = wrapperDom === null || wrapperDom === void 0 ? void 0 : wrapperDom.children[0]) === null || _a === void 0 ? void 0 : _a.children[scrollIndex] : null;
198
198
  if (node && wrapperDom) {
199
199
  var containerHeight = wrapperDom.clientHeight;
200
+ var containerTop = wrapperDom.scrollTop;
201
+ var containerBottom = containerTop + containerHeight;
200
202
  var targetHeight = node.clientHeight;
201
- var scrollPosition = node.offsetTop + targetHeight - containerHeight;
203
+ var targetTop = node.offsetTop;
204
+ var targetBottom = targetTop + targetHeight;
205
+ var isInView = targetTop >= containerTop && targetBottom <= containerBottom;
206
+ if (isInView) return;
207
+ var scrollPosition = targetTop + targetHeight - containerHeight;
202
208
  wrapperDom.scrollTop = scrollPosition;
203
209
  }
204
210
  }
@@ -221,7 +221,7 @@ var TreeNode = /*#__PURE__*/_react.default.forwardRef(function (props) {
221
221
  className: (0, _classnames.default)("".concat(treeNodePrefixCls, "-drag-line-top"))
222
222
  }), checkable ? /*#__PURE__*/_react.default.createElement(_checkbox.default, {
223
223
  onChange: handleOnchange,
224
- checked: checked,
224
+ checked: !disabled && checked,
225
225
  indeterminate: !disabled && indeterminate,
226
226
  disabled: disabled,
227
227
  onClick: function onClick(e) {
@@ -574,7 +574,7 @@ var getDataCheckededState = function getDataCheckededState(data, checkedKeys, ha
574
574
  };
575
575
  exports.getDataCheckededState = getDataCheckededState;
576
576
  var getDataCheckededStateStrictly = function getDataCheckededStateStrictly(checkedKeys) {
577
- var _checkedKeys = (0, _toConsumableArray2.default)(checkedKeys);
577
+ var _checkedKeys = (0, _toConsumableArray2.default)(checkedKeys || []);
578
578
  return {
579
579
  checkedKeys: (0, _from.default)(new _set.default(_checkedKeys)),
580
580
  halfCheckedKeys: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.8.8",
3
+ "version": "1.8.10",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [
@@ -59,7 +59,7 @@
59
59
  "test:coverage": "npm run test -- --coverage",
60
60
  "test:update": "jest --cache=false -u",
61
61
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && node scripts/filter-changelog.js",
62
- "pub": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --no-tests",
62
+ "pub": "npm run test:all && cross-env PUB_ENV=pub np --no-publish --no-tests --no-cleanup && npm run build && cross-env PUB_ENV=pub np --no-cleanup --yolo",
63
63
  "pub:beta": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=beta",
64
64
  "pub:usePopper": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=usePopper",
65
65
  "prepublishOnly": "node scripts/guard.js",