@kdcloudjs/kdesign 1.7.12 → 1.7.13
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/kdesign-complete.less +11 -5
- package/dist/kdesign.css +4 -2
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +34 -20
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +5 -5
- package/dist/kdesign.min.js.map +1 -1
- package/es/anchor/style/index.css +2 -0
- package/es/anchor/style/index.less +4 -2
- package/es/color-picker/style/index.css +1 -1
- package/es/color-picker/style/index.less +1 -1
- package/es/color-picker/style/token.less +6 -3
- package/es/modal/modal.js +3 -2
- package/es/stepper/stepper.js +23 -9
- package/es/tabs/tabs.js +0 -3
- package/es/tree/tree.js +2 -2
- package/es/tree-select/tree-select.js +4 -2
- package/lib/anchor/style/index.css +2 -0
- package/lib/anchor/style/index.less +4 -2
- package/lib/color-picker/style/index.css +1 -1
- package/lib/color-picker/style/index.less +1 -1
- package/lib/color-picker/style/token.less +6 -3
- package/lib/modal/modal.js +3 -2
- package/lib/stepper/stepper.js +23 -9
- package/lib/tabs/tabs.js +0 -3
- package/lib/tree/tree.js +1 -1
- package/lib/tree-select/tree-select.js +4 -2
- package/package.json +1 -1
|
@@ -108,6 +108,8 @@
|
|
|
108
108
|
padding-left: var(--kd-c-anchor-spacing-horizontal, 7px);
|
|
109
109
|
-webkit-box-sizing: border-box;
|
|
110
110
|
box-sizing: border-box;
|
|
111
|
+
background: var(--kd-c-anchor-color-background, var(--kd-g-color-background, #fff));
|
|
112
|
+
z-index: 1050;
|
|
111
113
|
}
|
|
112
114
|
.kd-anchor-wrapper {
|
|
113
115
|
overflow: auto;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
padding-left: @anchor-link-left;
|
|
8
8
|
box-sizing: border-box;
|
|
9
|
+
background: @anchor-bg;
|
|
10
|
+
z-index: @zIndex-popper;
|
|
9
11
|
|
|
10
12
|
&-wrapper {
|
|
11
13
|
overflow: auto;
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
&-link {
|
|
155
157
|
padding: @anchor-link-padding;
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
& > .@{anchor-prefix-cls}-link {
|
|
158
160
|
padding: @anchor-link-secondary-padding;
|
|
159
161
|
}
|
|
160
162
|
|
|
@@ -193,6 +195,6 @@
|
|
|
193
195
|
&.hidden {
|
|
194
196
|
opacity: 0;
|
|
195
197
|
visibility: hidden;
|
|
196
|
-
transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
|
|
198
|
+
transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
197
199
|
}
|
|
198
200
|
}
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
left: 8px;
|
|
296
296
|
}
|
|
297
297
|
.kd-color-picker-pop .kd-color-picker-panel-input .active-option {
|
|
298
|
-
background-color: #
|
|
298
|
+
background-color: var(--kd-c-color-picker-panel-option-color-background-selected, var(--kd-g-color-theme-3, #e3eeff));
|
|
299
299
|
}
|
|
300
300
|
.kd-color-picker-pop .kd-color-picker-panel-transparent {
|
|
301
301
|
width: 60px;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
@color-picker-custom-prefix: ~'--@{kd-prefix}-c-color-picker';
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
@color-picker-panel-
|
|
5
|
+
// color
|
|
6
|
+
@color-picker-panel-option-color-background: var(~'@{color-picker-custom-prefix}-panel-option-color-background-selected', @color-theme-3);
|
|
7
7
|
|
|
8
8
|
// font
|
|
9
9
|
@color-picker-input-font-size: var(~'@{color-picker-custom-prefix}-input-font-size', @font-size-middle);
|
|
@@ -19,4 +19,7 @@
|
|
|
19
19
|
@color-picker-panel-select-sizing-width: var(~'@{color-picker-custom-prefix}-panel-select-sizing-width', 212px);
|
|
20
20
|
@color-picker-panel-select-sizing-height: var(~'@{color-picker-custom-prefix}-panel-select-sizing-height', 28px);
|
|
21
21
|
@color-picker-panel-preset-sizing-width: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-width', 16px);
|
|
22
|
-
@color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
|
|
22
|
+
@color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
|
|
23
|
+
|
|
24
|
+
// z-index
|
|
25
|
+
@color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
|
package/es/modal/modal.js
CHANGED
|
@@ -54,6 +54,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
54
54
|
mask = modalProps.mask,
|
|
55
55
|
maskClosable = modalProps.maskClosable,
|
|
56
56
|
maskStyle = modalProps.maskStyle,
|
|
57
|
+
maskClassName = modalProps.maskClassName,
|
|
57
58
|
okButtonProps = modalProps.okButtonProps,
|
|
58
59
|
okText = modalProps.okText,
|
|
59
60
|
onCancel = modalProps.onCancel,
|
|
@@ -69,7 +70,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
69
70
|
onDrag = modalProps.onDrag,
|
|
70
71
|
onDragStop = modalProps.onDragStop,
|
|
71
72
|
bounds = modalProps.bounds,
|
|
72
|
-
others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
|
|
73
|
+
others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "maskClassName", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
|
|
73
74
|
var isForceController = visible !== undefined;
|
|
74
75
|
var _useState = useState(isForceController ? visible : true),
|
|
75
76
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -237,7 +238,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
237
238
|
className: modalClasses
|
|
238
239
|
}, others), mask && /*#__PURE__*/React.createElement("div", {
|
|
239
240
|
onClick: handleMaskClick,
|
|
240
|
-
className: "".concat(modalPrefixCls, "-mask"),
|
|
241
|
+
className: classNames(maskClassName, _defineProperty({}, "".concat(modalPrefixCls, "-mask"), true)),
|
|
241
242
|
style: maskStyle
|
|
242
243
|
}), /*#__PURE__*/React.createElement(Draggable, {
|
|
243
244
|
defaultPosition: defaultPosition,
|
package/es/stepper/stepper.js
CHANGED
|
@@ -14,6 +14,8 @@ import { tuple } from '../_utils/type';
|
|
|
14
14
|
import { omit } from '../_utils/omit';
|
|
15
15
|
import { useMergedState } from '../_utils/hooks';
|
|
16
16
|
import { isExp } from '../_utils/numberUtil';
|
|
17
|
+
Big.PE = 40;
|
|
18
|
+
Big.NE = -40;
|
|
17
19
|
export var StepTypes = tuple('embed', 'base');
|
|
18
20
|
var InternalStepper = function InternalStepper(props, ref) {
|
|
19
21
|
var _useContext = useContext(ConfigContext),
|
|
@@ -88,38 +90,50 @@ var InternalStepper = function InternalStepper(props, ref) {
|
|
|
88
90
|
type: "add"
|
|
89
91
|
}));
|
|
90
92
|
};
|
|
93
|
+
var isLegal = function isLegal(value) {
|
|
94
|
+
var reg = /^[0-9]*\.?[0-9]+$/;
|
|
95
|
+
return reg === null || reg === void 0 ? void 0 : reg.test(value);
|
|
96
|
+
};
|
|
91
97
|
var handleStepChang = function handleStepChang(type) {
|
|
92
98
|
var stepNum = parseFloat(step);
|
|
93
99
|
if (typeof stepNum !== 'number') {
|
|
94
100
|
return false;
|
|
95
101
|
}
|
|
96
|
-
var startingNumber = isExp(stepperrref.current.value) ? Big(stepperrref.current.value).valueOf() : stepperrref.current.value ||
|
|
97
|
-
var
|
|
102
|
+
var startingNumber = isExp(stepperrref.current.value) ? Big(stepperrref.current.value).valueOf() : stepperrref.current.value || inputNumberProps.min || 0;
|
|
103
|
+
var currentValue = new Big(startingNumber)[type](stepNum);
|
|
104
|
+
var calculationResults = currentValue.valueOf();
|
|
98
105
|
var legalNumber = stepperrref.current.verifiValue(calculationResults);
|
|
99
106
|
if (legalNumber === false) {
|
|
100
107
|
return false;
|
|
101
108
|
}
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
var nextPlus = new Big(calculationResults).plus(stepNum);
|
|
110
|
+
var nextMinus = new Big(calculationResults).minus(stepNum);
|
|
111
|
+
if (isLegal(max)) {
|
|
112
|
+
var maxBig = new Big(max);
|
|
113
|
+
if (nextPlus.cmp(maxBig) === 1) {
|
|
104
114
|
setMinusdisabled(true);
|
|
105
115
|
} else {
|
|
106
116
|
setMinusdisabled(false);
|
|
107
117
|
}
|
|
108
|
-
if (
|
|
118
|
+
if (currentValue.cmp(maxBig) === 1) {
|
|
109
119
|
return false;
|
|
110
120
|
}
|
|
121
|
+
} else {
|
|
122
|
+
setMinusdisabled(false);
|
|
111
123
|
}
|
|
112
|
-
if (
|
|
113
|
-
|
|
124
|
+
if (isLegal(min)) {
|
|
125
|
+
var minBig = new Big(min);
|
|
126
|
+
if (minBig.cmp(nextMinus) === 1) {
|
|
114
127
|
setPlusdisabled(true);
|
|
115
128
|
} else {
|
|
116
129
|
setPlusdisabled(false);
|
|
117
130
|
}
|
|
118
|
-
if (
|
|
131
|
+
if (minBig.cmp(currentValue) === 1) {
|
|
119
132
|
return false;
|
|
120
133
|
}
|
|
134
|
+
} else {
|
|
135
|
+
setPlusdisabled(false);
|
|
121
136
|
}
|
|
122
|
-
// props?.value === undefined && stepperrref.current.setValue(legalNumber)
|
|
123
137
|
(props === null || props === void 0 ? void 0 : props.value) === undefined && setValue(legalNumber);
|
|
124
138
|
onChange && onChange({
|
|
125
139
|
target: {
|
package/es/tabs/tabs.js
CHANGED
package/es/tree/tree.js
CHANGED
|
@@ -12,7 +12,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
12
12
|
import ConfigContext from '../config-provider/ConfigContext';
|
|
13
13
|
import { getCompProps } from '../_utils';
|
|
14
14
|
import TreeNode from './treeNode';
|
|
15
|
-
import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getAllCheckedKeys, getDataCheckededStateStrictly, getAllChildKeys, getPos,
|
|
15
|
+
import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getAllCheckedKeys, getDataCheckededStateStrictly, getAllChildKeys, getPos, calcDropPosition } from './utils/treeUtils';
|
|
16
16
|
import { useChecked, useExpand, usePlantomHeightEffect, useViewportHeight, useVisibleDataMemo, useScrollToKey, useSelect } from './treeHooks';
|
|
17
17
|
import isBoolean from 'lodash/isBoolean';
|
|
18
18
|
var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -388,7 +388,7 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
388
388
|
item.onDrop = handleDrop;
|
|
389
389
|
item.onSelect = handleSelect;
|
|
390
390
|
item.checked = checked;
|
|
391
|
-
item.selected =
|
|
391
|
+
item.selected = checkable ? false : Array.isArray(selectedKeys) ? (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0]) === item.key : selectedKeys === item.key;
|
|
392
392
|
item.indeterminate = indeterminate;
|
|
393
393
|
item.disabled = getDisabled(disabled, item.disabled);
|
|
394
394
|
item.showIcon = showIcon || false;
|
|
@@ -108,7 +108,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
108
108
|
_useState2 = _slicedToArray(_useState, 2),
|
|
109
109
|
expandedKeys = _useState2[0],
|
|
110
110
|
setExpandedKeys = _useState2[1];
|
|
111
|
-
var _useState3 = useState(
|
|
111
|
+
var _useState3 = useState(initValue),
|
|
112
112
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
113
113
|
selectedKeys = _useState4[0],
|
|
114
114
|
setSelectedKeys = _useState4[1];
|
|
@@ -254,7 +254,9 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
254
254
|
};
|
|
255
255
|
var handleCheck = function handleCheck(keys, state) {
|
|
256
256
|
onCheck === null || onCheck === void 0 ? void 0 : onCheck(keys, state);
|
|
257
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(keys)
|
|
257
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(keys, _mapInstanceProperty(keys).call(keys, function (key) {
|
|
258
|
+
return TreeMap.get(key);
|
|
259
|
+
}));
|
|
258
260
|
!Object.hasOwnProperty.call(treeSelectProps, 'value') && setInitValue(keys);
|
|
259
261
|
};
|
|
260
262
|
var handleExpand = function handleExpand(keys, state) {
|
|
@@ -108,6 +108,8 @@
|
|
|
108
108
|
padding-left: var(--kd-c-anchor-spacing-horizontal, 7px);
|
|
109
109
|
-webkit-box-sizing: border-box;
|
|
110
110
|
box-sizing: border-box;
|
|
111
|
+
background: var(--kd-c-anchor-color-background, var(--kd-g-color-background, #fff));
|
|
112
|
+
z-index: 1050;
|
|
111
113
|
}
|
|
112
114
|
.kd-anchor-wrapper {
|
|
113
115
|
overflow: auto;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
padding-left: @anchor-link-left;
|
|
8
8
|
box-sizing: border-box;
|
|
9
|
+
background: @anchor-bg;
|
|
10
|
+
z-index: @zIndex-popper;
|
|
9
11
|
|
|
10
12
|
&-wrapper {
|
|
11
13
|
overflow: auto;
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
&-link {
|
|
155
157
|
padding: @anchor-link-padding;
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
& > .@{anchor-prefix-cls}-link {
|
|
158
160
|
padding: @anchor-link-secondary-padding;
|
|
159
161
|
}
|
|
160
162
|
|
|
@@ -193,6 +195,6 @@
|
|
|
193
195
|
&.hidden {
|
|
194
196
|
opacity: 0;
|
|
195
197
|
visibility: hidden;
|
|
196
|
-
transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
|
|
198
|
+
transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
197
199
|
}
|
|
198
200
|
}
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
left: 8px;
|
|
296
296
|
}
|
|
297
297
|
.kd-color-picker-pop .kd-color-picker-panel-input .active-option {
|
|
298
|
-
background-color: #
|
|
298
|
+
background-color: var(--kd-c-color-picker-panel-option-color-background-selected, var(--kd-g-color-theme-3, #e3eeff));
|
|
299
299
|
}
|
|
300
300
|
.kd-color-picker-pop .kd-color-picker-panel-transparent {
|
|
301
301
|
width: 60px;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
@color-picker-custom-prefix: ~'--@{kd-prefix}-c-color-picker';
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
@color-picker-panel-
|
|
5
|
+
// color
|
|
6
|
+
@color-picker-panel-option-color-background: var(~'@{color-picker-custom-prefix}-panel-option-color-background-selected', @color-theme-3);
|
|
7
7
|
|
|
8
8
|
// font
|
|
9
9
|
@color-picker-input-font-size: var(~'@{color-picker-custom-prefix}-input-font-size', @font-size-middle);
|
|
@@ -19,4 +19,7 @@
|
|
|
19
19
|
@color-picker-panel-select-sizing-width: var(~'@{color-picker-custom-prefix}-panel-select-sizing-width', 212px);
|
|
20
20
|
@color-picker-panel-select-sizing-height: var(~'@{color-picker-custom-prefix}-panel-select-sizing-height', 28px);
|
|
21
21
|
@color-picker-panel-preset-sizing-width: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-width', 16px);
|
|
22
|
-
@color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
|
|
22
|
+
@color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
|
|
23
|
+
|
|
24
|
+
// z-index
|
|
25
|
+
@color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
|
package/lib/modal/modal.js
CHANGED
|
@@ -68,6 +68,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
68
68
|
mask = modalProps.mask,
|
|
69
69
|
maskClosable = modalProps.maskClosable,
|
|
70
70
|
maskStyle = modalProps.maskStyle,
|
|
71
|
+
maskClassName = modalProps.maskClassName,
|
|
71
72
|
okButtonProps = modalProps.okButtonProps,
|
|
72
73
|
okText = modalProps.okText,
|
|
73
74
|
onCancel = modalProps.onCancel,
|
|
@@ -83,7 +84,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
83
84
|
onDrag = modalProps.onDrag,
|
|
84
85
|
onDragStop = modalProps.onDragStop,
|
|
85
86
|
bounds = modalProps.bounds,
|
|
86
|
-
others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
|
|
87
|
+
others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "maskClassName", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
|
|
87
88
|
var isForceController = visible !== undefined;
|
|
88
89
|
var _useState = (0, _react.useState)(isForceController ? visible : true),
|
|
89
90
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -251,7 +252,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
251
252
|
className: modalClasses
|
|
252
253
|
}, others), mask && /*#__PURE__*/_react.default.createElement("div", {
|
|
253
254
|
onClick: handleMaskClick,
|
|
254
|
-
className: "".concat(modalPrefixCls, "-mask"),
|
|
255
|
+
className: (0, _classnames.default)(maskClassName, (0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-mask"), true)),
|
|
255
256
|
style: maskStyle
|
|
256
257
|
}), /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
|
|
257
258
|
defaultPosition: defaultPosition,
|
package/lib/stepper/stepper.js
CHANGED
|
@@ -26,6 +26,8 @@ var _hooks = require("../_utils/hooks");
|
|
|
26
26
|
var _numberUtil = require("../_utils/numberUtil");
|
|
27
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
_big.default.PE = 40;
|
|
30
|
+
_big.default.NE = -40;
|
|
29
31
|
var StepTypes = (0, _type.tuple)('embed', 'base');
|
|
30
32
|
exports.StepTypes = StepTypes;
|
|
31
33
|
var InternalStepper = function InternalStepper(props, ref) {
|
|
@@ -101,38 +103,50 @@ var InternalStepper = function InternalStepper(props, ref) {
|
|
|
101
103
|
type: "add"
|
|
102
104
|
}));
|
|
103
105
|
};
|
|
106
|
+
var isLegal = function isLegal(value) {
|
|
107
|
+
var reg = /^[0-9]*\.?[0-9]+$/;
|
|
108
|
+
return reg === null || reg === void 0 ? void 0 : reg.test(value);
|
|
109
|
+
};
|
|
104
110
|
var handleStepChang = function handleStepChang(type) {
|
|
105
111
|
var stepNum = parseFloat(step);
|
|
106
112
|
if (typeof stepNum !== 'number') {
|
|
107
113
|
return false;
|
|
108
114
|
}
|
|
109
|
-
var startingNumber = (0, _numberUtil.isExp)(stepperrref.current.value) ? (0, _big.default)(stepperrref.current.value).valueOf() : stepperrref.current.value ||
|
|
110
|
-
var
|
|
115
|
+
var startingNumber = (0, _numberUtil.isExp)(stepperrref.current.value) ? (0, _big.default)(stepperrref.current.value).valueOf() : stepperrref.current.value || inputNumberProps.min || 0;
|
|
116
|
+
var currentValue = new _big.default(startingNumber)[type](stepNum);
|
|
117
|
+
var calculationResults = currentValue.valueOf();
|
|
111
118
|
var legalNumber = stepperrref.current.verifiValue(calculationResults);
|
|
112
119
|
if (legalNumber === false) {
|
|
113
120
|
return false;
|
|
114
121
|
}
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
var nextPlus = new _big.default(calculationResults).plus(stepNum);
|
|
123
|
+
var nextMinus = new _big.default(calculationResults).minus(stepNum);
|
|
124
|
+
if (isLegal(max)) {
|
|
125
|
+
var maxBig = new _big.default(max);
|
|
126
|
+
if (nextPlus.cmp(maxBig) === 1) {
|
|
117
127
|
setMinusdisabled(true);
|
|
118
128
|
} else {
|
|
119
129
|
setMinusdisabled(false);
|
|
120
130
|
}
|
|
121
|
-
if (
|
|
131
|
+
if (currentValue.cmp(maxBig) === 1) {
|
|
122
132
|
return false;
|
|
123
133
|
}
|
|
134
|
+
} else {
|
|
135
|
+
setMinusdisabled(false);
|
|
124
136
|
}
|
|
125
|
-
if (
|
|
126
|
-
|
|
137
|
+
if (isLegal(min)) {
|
|
138
|
+
var minBig = new _big.default(min);
|
|
139
|
+
if (minBig.cmp(nextMinus) === 1) {
|
|
127
140
|
setPlusdisabled(true);
|
|
128
141
|
} else {
|
|
129
142
|
setPlusdisabled(false);
|
|
130
143
|
}
|
|
131
|
-
if (
|
|
144
|
+
if (minBig.cmp(currentValue) === 1) {
|
|
132
145
|
return false;
|
|
133
146
|
}
|
|
147
|
+
} else {
|
|
148
|
+
setPlusdisabled(false);
|
|
134
149
|
}
|
|
135
|
-
// props?.value === undefined && stepperrref.current.setValue(legalNumber)
|
|
136
150
|
(props === null || props === void 0 ? void 0 : props.value) === undefined && setValue(legalNumber);
|
|
137
151
|
onChange && onChange({
|
|
138
152
|
target: {
|
package/lib/tabs/tabs.js
CHANGED
|
@@ -375,9 +375,6 @@ var Tabs = function Tabs(props) {
|
|
|
375
375
|
}
|
|
376
376
|
carouselData.push(item);
|
|
377
377
|
});
|
|
378
|
-
if (effect !== 'none') {
|
|
379
|
-
console.log('effect', effect);
|
|
380
|
-
}
|
|
381
378
|
return /*#__PURE__*/_react.default.createElement(_carousel.default, {
|
|
382
379
|
ref: carouselRef,
|
|
383
380
|
dots: false,
|
package/lib/tree/tree.js
CHANGED
|
@@ -400,7 +400,7 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
400
400
|
item.onDrop = handleDrop;
|
|
401
401
|
item.onSelect = handleSelect;
|
|
402
402
|
item.checked = checked;
|
|
403
|
-
item.selected =
|
|
403
|
+
item.selected = checkable ? false : Array.isArray(selectedKeys) ? (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0]) === item.key : selectedKeys === item.key;
|
|
404
404
|
item.indeterminate = indeterminate;
|
|
405
405
|
item.disabled = getDisabled(disabled, item.disabled);
|
|
406
406
|
item.showIcon = showIcon || false;
|
|
@@ -120,7 +120,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
120
120
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
121
121
|
expandedKeys = _useState2[0],
|
|
122
122
|
setExpandedKeys = _useState2[1];
|
|
123
|
-
var _useState3 = (0, _react.useState)(
|
|
123
|
+
var _useState3 = (0, _react.useState)(initValue),
|
|
124
124
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
125
125
|
selectedKeys = _useState4[0],
|
|
126
126
|
setSelectedKeys = _useState4[1];
|
|
@@ -266,7 +266,9 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
266
266
|
};
|
|
267
267
|
var handleCheck = function handleCheck(keys, state) {
|
|
268
268
|
onCheck === null || onCheck === void 0 ? void 0 : onCheck(keys, state);
|
|
269
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(keys)
|
|
269
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(keys, (0, _map2.default)(keys).call(keys, function (key) {
|
|
270
|
+
return TreeMap.get(key);
|
|
271
|
+
}));
|
|
270
272
|
!Object.hasOwnProperty.call(treeSelectProps, 'value') && setInitValue(keys);
|
|
271
273
|
};
|
|
272
274
|
var handleExpand = function handleExpand(keys, state) {
|