@kdcloudjs/kdesign 1.5.11 → 1.6.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.
@@ -124,7 +124,7 @@
124
124
  font-size: var(--kd-c-avatar-font-size-base, 22px);
125
125
  }
126
126
  .kd-avatar.kd-avatar-icon > .kdicon {
127
- vertical-align: unset !important;
127
+ vertical-align: top;
128
128
  }
129
129
  .kd-avatar-lg {
130
130
  width: var(--kd-c-avatar-size-large, 60px);
@@ -142,7 +142,7 @@
142
142
  font-size: var(--kd-c-avatar-font-size-large, 36px);
143
143
  }
144
144
  .kd-avatar-lg.kd-avatar-icon > .kdicon {
145
- vertical-align: unset !important;
145
+ vertical-align: top;
146
146
  }
147
147
  .kd-avatar-sm {
148
148
  width: var(--kd-c-avatar-size-small, 32px);
@@ -160,7 +160,7 @@
160
160
  font-size: var(--kd-c-avatar-font-size-small, 18px);
161
161
  }
162
162
  .kd-avatar-sm.kd-avatar-icon > .kdicon {
163
- vertical-align: unset !important;
163
+ vertical-align: top;
164
164
  }
165
165
  .kd-avatar-xs {
166
166
  width: var(--kd-c-avatar-size-x-small, 24px);
@@ -178,7 +178,7 @@
178
178
  font-size: var(--kd-c-avatar-font-size-x-small, 14px);
179
179
  }
180
180
  .kd-avatar-xs.kd-avatar-icon > .kdicon {
181
- vertical-align: unset !important;
181
+ vertical-align: top;
182
182
  }
183
183
  .kd-avatar-square {
184
184
  border-radius: var(--kd-c-avatar-border-radius, 2px);
@@ -16,7 +16,7 @@
16
16
  font-size: @font-size;
17
17
 
18
18
  & > .@{icon-prefix-cls} {
19
- vertical-align: unset !important;
19
+ vertical-align: top;
20
20
  }
21
21
  }
22
22
  }
@@ -6,7 +6,7 @@ interface ClearableInputProps {
6
6
  prefixCls: string;
7
7
  inputType: typeof ClearableInputType[number];
8
8
  value?: any;
9
- allowClear?: boolean;
9
+ allowClear?: boolean | React.ReactNode;
10
10
  element: React.ReactElement;
11
11
  handleReset?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
12
12
  className?: string;
@@ -40,13 +40,13 @@ var ClearableInput = function ClearableInput(props) {
40
40
  return /*#__PURE__*/React.createElement("span", {
41
41
  onClick: handleReset,
42
42
  className: clearIconclasses
43
- }, /*#__PURE__*/React.createElement(Icon, {
43
+ }, typeof allowClear === 'boolean' ? /*#__PURE__*/React.createElement(Icon, {
44
44
  type: "close"
45
- }));
45
+ }) : allowClear);
46
46
  };
47
47
 
48
48
  var renderSuffix = function renderSuffix() {
49
- if (suffix || !disabled && allowClear) {
49
+ if (suffix || !disabled && !!allowClear) {
50
50
  return /*#__PURE__*/React.createElement("span", {
51
51
  className: "".concat(prefixCls, "-suffix")
52
52
  }, renderClearIcon(), suffix);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { InputSiteType, BorderType } from './input';
3
3
  export interface textAreaProps extends React.TextareaHTMLAttributes<HTMLInputElement> {
4
- allowClear?: boolean;
4
+ allowClear?: boolean | React.ReactNode;
5
5
  borderType?: BorderType;
6
6
  defaultValue?: string;
7
7
  count?: boolean;
@@ -194,8 +194,8 @@ var InternalTextarea = function InternalTextarea(props, ref) {
194
194
  var textarea = /*#__PURE__*/React.createElement("textarea", _extends({
195
195
  ref: textareaRef,
196
196
  disabled: disabled,
197
- style: _extends({}, textareaStyles, hadCount || allowClear ? otherStyles : style),
198
- className: classNames("".concat(prefixCls, "-textarea"), (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames, "".concat(prefixCls, "-allowClear-spacing"), allowClear), _classNames), _defineProperty({}, className, className && !allowClear && !hadCount)),
197
+ style: _extends({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
198
+ className: classNames("".concat(prefixCls, "-textarea"), (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _classNames), _defineProperty({}, className, className && !allowClear && !hadCount)),
199
199
  onChange: handleChange,
200
200
  onFocus: !disabled ? handleFocus : undefined,
201
201
  onBlur: !disabled ? handleBlur : undefined,
@@ -10,7 +10,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
10
10
  size?: InputSiteType;
11
11
  defaultValue?: string;
12
12
  disabled?: boolean;
13
- allowClear?: boolean;
13
+ allowClear?: boolean | React.ReactNode;
14
14
  placeholderTobeValue?: boolean;
15
15
  addonAfter?: React.ReactNode;
16
16
  addonBefore?: React.ReactNode;
@@ -265,7 +265,7 @@ var InteranalSlider = function InteranalSlider(props, ref) {
265
265
  }), /*#__PURE__*/React.createElement(SliderTooltip, {
266
266
  ref: handleRef,
267
267
  placement: tooltipPlacement,
268
- tip: tipFormatter || value,
268
+ tip: tipFormatter === null || tipFormatter === void 0 ? void 0 : tipFormatter(value),
269
269
  visible: disabled ? false : tooltipVisible,
270
270
  prefixCls: sliderPrefixCls,
271
271
  vertical: vertical,
@@ -28,7 +28,8 @@ var SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
28
  min = props.min,
29
29
  max = props.max,
30
30
  bound = props.bound,
31
- others = __rest(props, ["visible", "prefixCls", "reverse", "vertical", "min", "max", "bound"]);
31
+ tip = props.tip,
32
+ others = __rest(props, ["visible", "prefixCls", "reverse", "vertical", "min", "max", "bound", "tip"]);
32
33
 
33
34
  var thisTooltipRef = useRef(null);
34
35
  var tooltipRef = ref || thisTooltipRef;
@@ -40,8 +41,8 @@ var SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
40
41
  return /*#__PURE__*/React.createElement(Tooltip, _extends({
41
42
  ref: tooltipRef
42
43
  }, others, {
43
- tip: bound,
44
- visible: visible,
44
+ tip: tip || bound,
45
+ visible: tip !== null && visible,
45
46
  placement: placement
46
47
  }), /*#__PURE__*/React.createElement("div", {
47
48
  className: sliderHandleClass,
package/es/steps/Steps.js CHANGED
@@ -107,7 +107,6 @@ var Steps = function Steps(props) {
107
107
  }
108
108
  }
109
109
 
110
- childProps.active = stepNumber === current;
111
110
  return /*#__PURE__*/cloneElement(child, childProps);
112
111
  }));
113
112
  };
@@ -131,7 +131,7 @@
131
131
  flex-grow: 1;
132
132
  font-size: var(--kd-c-tree-font-size, var(--kd-g-font-size-small, 12px));
133
133
  color: var(--kd-c-tree-color-text, var(--kd-g-color-text-primary, #212121));
134
- margin-left: var(--kd-c-tree-spacing-margin-left, 16px);
134
+ margin-left: var(--kd-c-tree-spacing-margin-left, 0px);
135
135
  }
136
136
  .kd-tree-root {
137
137
  min-width: 100%;
@@ -22,7 +22,7 @@
22
22
  @tree-expand-icon-loading-width: var(~'@{tree-prefix}-expand-icon-loading-sizing-width', 16px);
23
23
  @tree-node-icon-height: var(~'@{tree-prefix}-node-icon-sizing-height', 16px);
24
24
  @tree-node-icon-width: var(~'@{tree-prefix}-node-icon-sizing-width', 16px);
25
- @tree-margin-left: var(~'@{tree-prefix}-spacing-margin-left', 16px);
25
+ @tree-margin-left: var(~'@{tree-prefix}-spacing-margin-left', 0px);
26
26
 
27
27
  // font
28
28
  @tree-font-size: var(~'@{tree-prefix}-font-size', @font-size-small);
@@ -124,7 +124,7 @@
124
124
  font-size: var(--kd-c-avatar-font-size-base, 22px);
125
125
  }
126
126
  .kd-avatar.kd-avatar-icon > .kdicon {
127
- vertical-align: unset !important;
127
+ vertical-align: top;
128
128
  }
129
129
  .kd-avatar-lg {
130
130
  width: var(--kd-c-avatar-size-large, 60px);
@@ -142,7 +142,7 @@
142
142
  font-size: var(--kd-c-avatar-font-size-large, 36px);
143
143
  }
144
144
  .kd-avatar-lg.kd-avatar-icon > .kdicon {
145
- vertical-align: unset !important;
145
+ vertical-align: top;
146
146
  }
147
147
  .kd-avatar-sm {
148
148
  width: var(--kd-c-avatar-size-small, 32px);
@@ -160,7 +160,7 @@
160
160
  font-size: var(--kd-c-avatar-font-size-small, 18px);
161
161
  }
162
162
  .kd-avatar-sm.kd-avatar-icon > .kdicon {
163
- vertical-align: unset !important;
163
+ vertical-align: top;
164
164
  }
165
165
  .kd-avatar-xs {
166
166
  width: var(--kd-c-avatar-size-x-small, 24px);
@@ -178,7 +178,7 @@
178
178
  font-size: var(--kd-c-avatar-font-size-x-small, 14px);
179
179
  }
180
180
  .kd-avatar-xs.kd-avatar-icon > .kdicon {
181
- vertical-align: unset !important;
181
+ vertical-align: top;
182
182
  }
183
183
  .kd-avatar-square {
184
184
  border-radius: var(--kd-c-avatar-border-radius, 2px);
@@ -16,7 +16,7 @@
16
16
  font-size: @font-size;
17
17
 
18
18
  & > .@{icon-prefix-cls} {
19
- vertical-align: unset !important;
19
+ vertical-align: top;
20
20
  }
21
21
  }
22
22
  }
@@ -6,7 +6,7 @@ interface ClearableInputProps {
6
6
  prefixCls: string;
7
7
  inputType: typeof ClearableInputType[number];
8
8
  value?: any;
9
- allowClear?: boolean;
9
+ allowClear?: boolean | React.ReactNode;
10
10
  element: React.ReactElement;
11
11
  handleReset?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
12
12
  className?: string;
@@ -57,13 +57,13 @@ var ClearableInput = function ClearableInput(props) {
57
57
  return /*#__PURE__*/_react.default.createElement("span", {
58
58
  onClick: handleReset,
59
59
  className: clearIconclasses
60
- }, /*#__PURE__*/_react.default.createElement(_index.Icon, {
60
+ }, typeof allowClear === 'boolean' ? /*#__PURE__*/_react.default.createElement(_index.Icon, {
61
61
  type: "close"
62
- }));
62
+ }) : allowClear);
63
63
  };
64
64
 
65
65
  var renderSuffix = function renderSuffix() {
66
- if (suffix || !disabled && allowClear) {
66
+ if (suffix || !disabled && !!allowClear) {
67
67
  return /*#__PURE__*/_react.default.createElement("span", {
68
68
  className: "".concat(prefixCls, "-suffix")
69
69
  }, renderClearIcon(), suffix);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { InputSiteType, BorderType } from './input';
3
3
  export interface textAreaProps extends React.TextareaHTMLAttributes<HTMLInputElement> {
4
- allowClear?: boolean;
4
+ allowClear?: boolean | React.ReactNode;
5
5
  borderType?: BorderType;
6
6
  defaultValue?: string;
7
7
  count?: boolean;
@@ -226,8 +226,8 @@ var InternalTextarea = function InternalTextarea(props, ref) {
226
226
  var textarea = /*#__PURE__*/_react.default.createElement("textarea", (0, _extends2.default)({
227
227
  ref: textareaRef,
228
228
  disabled: disabled,
229
- style: (0, _extends2.default)({}, textareaStyles, hadCount || allowClear ? otherStyles : style),
230
- className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-allowClear-spacing"), allowClear), _classNames), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
229
+ style: (0, _extends2.default)({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
230
+ className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _classNames), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
231
231
  onChange: handleChange,
232
232
  onFocus: !disabled ? handleFocus : undefined,
233
233
  onBlur: !disabled ? handleBlur : undefined,
@@ -10,7 +10,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
10
10
  size?: InputSiteType;
11
11
  defaultValue?: string;
12
12
  disabled?: boolean;
13
- allowClear?: boolean;
13
+ allowClear?: boolean | React.ReactNode;
14
14
  placeholderTobeValue?: boolean;
15
15
  addonAfter?: React.ReactNode;
16
16
  addonBefore?: React.ReactNode;
@@ -297,7 +297,7 @@ var InteranalSlider = function InteranalSlider(props, ref) {
297
297
  }), /*#__PURE__*/_react.default.createElement(_sliderTooltip.default, {
298
298
  ref: handleRef,
299
299
  placement: tooltipPlacement,
300
- tip: tipFormatter || value,
300
+ tip: tipFormatter === null || tipFormatter === void 0 ? void 0 : tipFormatter(value),
301
301
  visible: disabled ? false : tooltipVisible,
302
302
  prefixCls: sliderPrefixCls,
303
303
  vertical: vertical,
@@ -52,7 +52,8 @@ var SliderTooltip = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
52
52
  min = props.min,
53
53
  max = props.max,
54
54
  bound = props.bound,
55
- others = __rest(props, ["visible", "prefixCls", "reverse", "vertical", "min", "max", "bound"]);
55
+ tip = props.tip,
56
+ others = __rest(props, ["visible", "prefixCls", "reverse", "vertical", "min", "max", "bound", "tip"]);
56
57
 
57
58
  var thisTooltipRef = (0, _react.useRef)(null);
58
59
  var tooltipRef = ref || thisTooltipRef;
@@ -64,8 +65,8 @@ var SliderTooltip = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
64
65
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, (0, _extends2.default)({
65
66
  ref: tooltipRef
66
67
  }, others, {
67
- tip: bound,
68
- visible: visible,
68
+ tip: tip || bound,
69
+ visible: tip !== null && visible,
69
70
  placement: placement
70
71
  }), /*#__PURE__*/_react.default.createElement("div", {
71
72
  className: sliderHandleClass,
@@ -136,7 +136,6 @@ var Steps = function Steps(props) {
136
136
  }
137
137
  }
138
138
 
139
- childProps.active = stepNumber === current;
140
139
  return /*#__PURE__*/(0, _react.cloneElement)(child, childProps);
141
140
  }));
142
141
  };
@@ -131,7 +131,7 @@
131
131
  flex-grow: 1;
132
132
  font-size: var(--kd-c-tree-font-size, var(--kd-g-font-size-small, 12px));
133
133
  color: var(--kd-c-tree-color-text, var(--kd-g-color-text-primary, #212121));
134
- margin-left: var(--kd-c-tree-spacing-margin-left, 16px);
134
+ margin-left: var(--kd-c-tree-spacing-margin-left, 0px);
135
135
  }
136
136
  .kd-tree-root {
137
137
  min-width: 100%;
@@ -22,7 +22,7 @@
22
22
  @tree-expand-icon-loading-width: var(~'@{tree-prefix}-expand-icon-loading-sizing-width', 16px);
23
23
  @tree-node-icon-height: var(~'@{tree-prefix}-node-icon-sizing-height', 16px);
24
24
  @tree-node-icon-width: var(~'@{tree-prefix}-node-icon-sizing-width', 16px);
25
- @tree-margin-left: var(~'@{tree-prefix}-spacing-margin-left', 16px);
25
+ @tree-margin-left: var(~'@{tree-prefix}-spacing-margin-left', 0px);
26
26
 
27
27
  // font
28
28
  @tree-font-size: var(~'@{tree-prefix}-font-size', @font-size-small);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.5.11",
3
+ "version": "1.6.0",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [
@@ -84,7 +84,7 @@
84
84
  "classnames": "^2.2.6",
85
85
  "copy-to-clipboard": "^3.3.1",
86
86
  "cropperjs": "^1.5.12",
87
- "date-fns": "^2.16.1",
87
+ "date-fns": "2.28.0",
88
88
  "lodash": "^4.17.20",
89
89
  "react-draggable": "^4.4.3",
90
90
  "react-popper": "^2.2.3",