@kdcloudjs/kdesign 1.7.23 → 1.7.25
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/CHANGELOG.md +64 -0
- package/dist/kdesign-complete.less +31 -18
- package/dist/kdesign.css +59 -18
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +522 -213
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +4 -4
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/usePopper.d.ts +1 -0
- package/es/_utils/usePopper.js +40 -21
- package/es/city-picker/city-picker.js +36 -25
- package/es/city-picker/interface.d.ts +1 -0
- package/es/city-picker/option.js +2 -2
- package/es/city-picker/style/index.css +14 -10
- package/es/city-picker/style/index.less +9 -6
- package/es/city-picker/style/token.less +4 -5
- package/es/input-number/inputNumber.js +20 -5
- package/es/input-number/useSelectionRange.d.ts +4 -0
- package/es/input-number/useSelectionRange.js +22 -0
- package/es/locale/locale.d.ts +4 -4
- package/es/locale/zh-CN.d.ts +4 -2
- package/es/locale/zh-CN.js +4 -2
- package/es/radio/style/index.css +2 -0
- package/es/radio/style/index.less +2 -0
- package/es/search/search.js +2 -1
- package/es/select/select.js +6 -5
- package/es/select/style/index.css +6 -3
- package/es/select/style/index.less +10 -4
- package/es/select/style/token.less +1 -1
- package/es/style/core/motion/slide.less +5 -2
- package/es/style/index.css +36 -4
- package/es/table/api.js +19 -3
- package/lib/_utils/usePopper.d.ts +1 -0
- package/lib/_utils/usePopper.js +40 -21
- package/lib/city-picker/city-picker.js +36 -25
- package/lib/city-picker/interface.d.ts +1 -0
- package/lib/city-picker/option.js +2 -2
- package/lib/city-picker/style/index.css +14 -10
- package/lib/city-picker/style/index.less +9 -6
- package/lib/city-picker/style/token.less +4 -5
- package/lib/input-number/inputNumber.js +19 -4
- package/lib/input-number/useSelectionRange.d.ts +4 -0
- package/lib/input-number/useSelectionRange.js +29 -0
- package/lib/locale/locale.d.ts +4 -4
- package/lib/locale/zh-CN.d.ts +4 -2
- package/lib/locale/zh-CN.js +4 -2
- package/lib/radio/style/index.css +2 -0
- package/lib/radio/style/index.less +2 -0
- package/lib/search/search.js +2 -1
- package/lib/select/select.js +6 -5
- package/lib/select/style/index.css +6 -3
- package/lib/select/style/index.less +10 -4
- package/lib/select/style/token.less +1 -1
- package/lib/style/core/motion/slide.less +5 -2
- package/lib/style/index.css +36 -4
- package/lib/table/api.js +19 -3
- package/package.json +2 -2
|
@@ -159,6 +159,11 @@
|
|
|
159
159
|
&-type-line {
|
|
160
160
|
padding: 0 12px;
|
|
161
161
|
font-size: 12px;
|
|
162
|
+
|
|
163
|
+
.@{kd-prefix}-tab-pane-text {
|
|
164
|
+
.over();
|
|
165
|
+
width: 100%;
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
169
|
}
|
|
@@ -200,17 +205,14 @@
|
|
|
200
205
|
padding: 8px 0;
|
|
201
206
|
max-height: 320px;
|
|
202
207
|
overflow-y: auto;
|
|
208
|
+
box-sizing: content-box;
|
|
203
209
|
|
|
204
210
|
// 下拉列表选项
|
|
205
211
|
&-item {
|
|
212
|
+
.over();
|
|
206
213
|
.item();
|
|
207
|
-
display: flex;
|
|
208
214
|
cursor: pointer;
|
|
209
215
|
|
|
210
|
-
&-content {
|
|
211
|
-
.over();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
216
|
&-info {
|
|
215
217
|
color: @city-picker-placeholder-color;
|
|
216
218
|
white-space: nowrap;
|
|
@@ -222,6 +224,7 @@
|
|
|
222
224
|
|
|
223
225
|
&-selected:not(&-disabled) {
|
|
224
226
|
background-color: @city-picker-item-selected-bg;
|
|
227
|
+
color: @city-picker-list-item-color-selected;
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
&-disabled {
|
|
@@ -233,7 +236,7 @@
|
|
|
233
236
|
}
|
|
234
237
|
|
|
235
238
|
&-highlight {
|
|
236
|
-
color:
|
|
239
|
+
color: @city-picker-highlight-color;
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
// 选择器框大小
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@city-picker-dropdown-bg: var(~'@{city-picker-custom-prefix}-dropdown-color-background', @color-background);
|
|
7
7
|
@city-picker-disabled-option-bg: var(~'@{city-picker-custom-prefix}-item-color-background-disabled', #fff);
|
|
8
8
|
@city-picker-item-active-bg: var(~'@{city-picker-custom-prefix}-color-background', #f5f5f5);
|
|
9
|
-
@city-picker-item-selected-bg: var(~'@{city-picker-custom-prefix}-color-background-selected',
|
|
9
|
+
@city-picker-item-selected-bg: var(~'@{city-picker-custom-prefix}-color-background-selected', @color-theme-3);
|
|
10
10
|
@city-picker-g-color-border: var(~'@{city-picker-custom-prefix}-color-border', @color-input);
|
|
11
11
|
@city-picker-g-color-border-foucs: var(~'@{city-picker-custom-prefix}-color-border-foucs', @color-theme);
|
|
12
12
|
@city-picker-g-color-border-hover: var(~'@{city-picker-custom-prefix}-color-border-hover', @color-theme);
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
@city-picker-g-item-text-color-disabled: var(~'@{city-picker-custom-prefix}-item-color-text-disabled', @color-disabled);
|
|
17
17
|
@city-picker-color-background-disabled: var(~'@{city-picker-custom-prefix}-color-background-disabled', #fff);
|
|
18
18
|
@city-picker-color-text-disabled: var(~'@{city-picker-custom-prefix}-color-text-disabled', @color-disabled);
|
|
19
|
-
@city-picker-arrow-icon-color-text-disabled: var(
|
|
20
|
-
~'@{city-picker-custom-prefix}-arrow-icon-color-text-disabled',
|
|
21
|
-
#b2b2b2
|
|
22
|
-
);
|
|
19
|
+
@city-picker-arrow-icon-color-text-disabled: var(~'@{city-picker-custom-prefix}-arrow-icon-color-text-disabled', #b2b2b2);
|
|
23
20
|
@city-picker-clear-color: var(~'@{city-picker-custom-prefix}-icon-clear-color-text', #d9d9d9);
|
|
24
21
|
@city-picker-clear-color-hover: var(~'@{city-picker-custom-prefix}-icon-clear-color-text-hover', #999);
|
|
22
|
+
@city-picker-list-item-color-selected: var(~'@{city-picker-custom-prefix}-list-item-color-text-selected', @color-theme);
|
|
23
|
+
@city-picker-highlight-color: var(~'@{city-picker-custom-prefix}-highlight-color-text', @color-theme);
|
|
25
24
|
|
|
26
25
|
// font
|
|
27
26
|
@city-picker-list-font-size: var(~'@{city-picker-custom-prefix}-dropdown-font-size', 12px); // 下拉列表文字大小
|
|
@@ -22,6 +22,7 @@ var _formatUtil = require("../_utils/formatUtil");
|
|
|
22
22
|
var _devwarning = _interopRequireDefault(require("../_utils/devwarning"));
|
|
23
23
|
var _big = _interopRequireDefault(require("big.js"));
|
|
24
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
+
var _useSelectionRange = _interopRequireDefault(require("./useSelectionRange"));
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
27
28
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
@@ -33,6 +34,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
33
34
|
return t;
|
|
34
35
|
};
|
|
35
36
|
var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
37
|
+
var _a;
|
|
36
38
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
37
39
|
userDefaultProps = _useContext.compDefaultProps,
|
|
38
40
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -61,7 +63,8 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
61
63
|
suffix = inputNumberProps.suffix,
|
|
62
64
|
formatter = inputNumberProps.formatter,
|
|
63
65
|
className = inputNumberProps.className,
|
|
64
|
-
|
|
66
|
+
onKeyDown = inputNumberProps.onKeyDown,
|
|
67
|
+
others = __rest(inputNumberProps, ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className", "onKeyDown"]);
|
|
65
68
|
var initVal = value === undefined ? defaultValue : value;
|
|
66
69
|
var _useState = (0, _react.useState)((0, _numberUtil.serialization)(initVal !== undefined ? initVal + '' : '')),
|
|
67
70
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -121,6 +124,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
121
124
|
if (legalNumber === false) {
|
|
122
125
|
return false;
|
|
123
126
|
}
|
|
127
|
+
updateSelectionRangePosition(event);
|
|
124
128
|
value === undefined && setInputValue(legalNumber);
|
|
125
129
|
onChange && onChange(handleEventAttachValue(event, numberMode ? Number(legalNumber) : legalNumber));
|
|
126
130
|
};
|
|
@@ -185,12 +189,13 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
185
189
|
return resultNumerical;
|
|
186
190
|
};
|
|
187
191
|
var handleStepChang = function handleStepChang(type) {
|
|
192
|
+
var _a, _b;
|
|
188
193
|
var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
|
|
189
194
|
if (typeof step !== 'number') {
|
|
190
195
|
(0, _devwarning.default)(true, 'inputNumber', "stepOption.step\u5FC5\u987B\u4E3A\u4E00\u4E2A\u6570\u503C");
|
|
191
196
|
return false;
|
|
192
197
|
}
|
|
193
|
-
var startingNumber = parseFloat(inputNumberRef.current.value) || 0;
|
|
198
|
+
var startingNumber = parseFloat((_b = (_a = inputNumberRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value) || 0;
|
|
194
199
|
var calculationResults = new _big.default(startingNumber)[type](step).valueOf();
|
|
195
200
|
var legalNumber = verifiValue(calculationResults);
|
|
196
201
|
if (legalNumber === false) {
|
|
@@ -205,6 +210,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
205
210
|
};
|
|
206
211
|
var handleKeyDown = function handleKeyDown(event) {
|
|
207
212
|
var _context11;
|
|
213
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
208
214
|
if (!stepOption || props.disabled || props.readOnly) {
|
|
209
215
|
return;
|
|
210
216
|
}
|
|
@@ -234,10 +240,12 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
234
240
|
// 还原最小值
|
|
235
241
|
if (typeof min === 'number' && bigValue.lt(min)) {
|
|
236
242
|
_inputValue = min.toString();
|
|
243
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(handleEventAttachValue(event, numberMode ? Number(_inputValue) : _inputValue));
|
|
237
244
|
}
|
|
238
245
|
// 还原最大值
|
|
239
|
-
if (typeof
|
|
246
|
+
if (typeof max === 'number' && bigValue.gt(max)) {
|
|
240
247
|
_inputValue = max.toString();
|
|
248
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(handleEventAttachValue(event, numberMode ? Number(_inputValue) : _inputValue));
|
|
241
249
|
}
|
|
242
250
|
// 超过精度位数直接截断
|
|
243
251
|
_inputValue = handleNumericalAccuracy(_inputValue);
|
|
@@ -309,9 +317,16 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
309
317
|
}
|
|
310
318
|
};
|
|
311
319
|
});
|
|
320
|
+
var displayedInputValue = (0, _react.useMemo)(function () {
|
|
321
|
+
return formatter ? formatter(inputValue) : inputValue;
|
|
322
|
+
}, [inputValue, formatter]);
|
|
323
|
+
var updateSelectionRangePosition = (0, _useSelectionRange.default)({
|
|
324
|
+
inputElement: (_a = inputNumberRef.current) === null || _a === void 0 ? void 0 : _a.input,
|
|
325
|
+
inputValue: displayedInputValue
|
|
326
|
+
});
|
|
312
327
|
return /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({}, others, {
|
|
313
328
|
ref: inputNumberRef,
|
|
314
|
-
value:
|
|
329
|
+
value: displayedInputValue,
|
|
315
330
|
prefix: prefix,
|
|
316
331
|
suffix: suffix,
|
|
317
332
|
onChange: handleChange,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = useSelectionRange;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
10
|
+
function useSelectionRange(_ref) {
|
|
11
|
+
var inputElement = _ref.inputElement,
|
|
12
|
+
inputValue = _ref.inputValue;
|
|
13
|
+
var refSelectionPosition = (0, _react.useRef)();
|
|
14
|
+
(0, _react.useLayoutEffect)(function () {
|
|
15
|
+
var position = refSelectionPosition.current;
|
|
16
|
+
if (inputElement && inputValue && (0, _isNumber.default)(position)) {
|
|
17
|
+
var start = Math.max(0, inputValue.length - position);
|
|
18
|
+
inputElement.setSelectionRange(start, start);
|
|
19
|
+
}
|
|
20
|
+
}, [inputValue]);
|
|
21
|
+
return function (event) {
|
|
22
|
+
var _event$target = event.target,
|
|
23
|
+
end = _event$target.selectionEnd,
|
|
24
|
+
value = _event$target.value;
|
|
25
|
+
if ((0, _isNumber.default)(end)) {
|
|
26
|
+
refSelectionPosition.current = value.length - end;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
package/lib/locale/locale.d.ts
CHANGED
|
@@ -61,11 +61,11 @@ declare class LocaleCache {
|
|
|
61
61
|
'QuickSearch.emptyTip': string;
|
|
62
62
|
'QuickSearch.or': string;
|
|
63
63
|
'CityPicker.domestic': string;
|
|
64
|
-
'CityPicker.internation': string;
|
|
65
64
|
'CityPicker.common': string;
|
|
66
|
-
'CityPicker.
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
'CityPicker.emptyText': string;
|
|
66
|
+
'CityPicker.commonEmptyText': string;
|
|
67
|
+
'CityPicker.tabsDomestic': string;
|
|
68
|
+
'CityPicker.tabsInternation': string;
|
|
69
69
|
'ColorPicker.followFunctionalColor': string;
|
|
70
70
|
'Search.placeholder': string;
|
|
71
71
|
'Search.desc': string[];
|
package/lib/locale/zh-CN.d.ts
CHANGED
|
@@ -35,9 +35,11 @@ declare const locale: {
|
|
|
35
35
|
'QuickSearch.emptyTip': string;
|
|
36
36
|
'QuickSearch.or': string;
|
|
37
37
|
'CityPicker.domestic': string;
|
|
38
|
-
'CityPicker.internation': string;
|
|
39
38
|
'CityPicker.common': string;
|
|
40
|
-
'CityPicker.
|
|
39
|
+
'CityPicker.emptyText': string;
|
|
40
|
+
'CityPicker.commonEmptyText': string;
|
|
41
|
+
'CityPicker.tabsDomestic': string;
|
|
42
|
+
'CityPicker.tabsInternation': string;
|
|
41
43
|
'ColorPicker.followFunctionalColor': string;
|
|
42
44
|
'Search.placeholder': string;
|
|
43
45
|
'Search.desc': string[];
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -46,9 +46,11 @@ var locale = (0, _extends2.default)((0, _extends2.default)({
|
|
|
46
46
|
'QuickSearch.emptyTip': '暂无数据',
|
|
47
47
|
'QuickSearch.or': '或',
|
|
48
48
|
'CityPicker.domestic': '国内',
|
|
49
|
-
'CityPicker.internation': '国际',
|
|
50
49
|
'CityPicker.common': '常用',
|
|
51
|
-
'CityPicker.
|
|
50
|
+
'CityPicker.emptyText': '暂无数据',
|
|
51
|
+
'CityPicker.commonEmptyText': '无常用城市',
|
|
52
|
+
'CityPicker.tabsDomestic': '国内',
|
|
53
|
+
'CityPicker.tabsInternation': '国际/中国港澳台',
|
|
52
54
|
'ColorPicker.followFunctionalColor': '跟随功能色',
|
|
53
55
|
'Search.placeholder': '请输入需要搜索的内容',
|
|
54
56
|
'Search.desc': ['空格代表"或",回车代表"且"'],
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
font-size: var(--kd-c-radio-font-size, var(--kd-g-font-size-small, 12px));
|
|
128
128
|
max-width: var(--kd-c-radio-default-label-max-width);
|
|
129
129
|
overflow: hidden;
|
|
130
|
+
min-height: var(--kd-c-radio-square-sizing-width-height, 14px);
|
|
130
131
|
}
|
|
131
132
|
.kd-radio::before {
|
|
132
133
|
position: absolute;
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
.kd-radio-input {
|
|
169
170
|
position: absolute;
|
|
170
171
|
opacity: 0;
|
|
172
|
+
left: 0;
|
|
171
173
|
}
|
|
172
174
|
.kd-radio > span {
|
|
173
175
|
padding: 0 6px 0 var(--kd-c-radio-spacing-padding-left, 4px);
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
font-size: @radio-font-size;
|
|
25
25
|
max-width: @radio-default-label-max-width;
|
|
26
26
|
overflow: hidden;
|
|
27
|
+
min-height: @radio-circle-size;
|
|
27
28
|
|
|
28
29
|
&::before {
|
|
29
30
|
position: absolute;
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
&-input {
|
|
60
61
|
position: absolute;
|
|
61
62
|
opacity: 0;
|
|
63
|
+
left: 0;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
&>span {
|
package/lib/search/search.js
CHANGED
|
@@ -71,7 +71,8 @@ var InternalSearch = function InternalSearch(props, ref) {
|
|
|
71
71
|
onSearch && (onSearch === null || onSearch === void 0 ? void 0 : onSearch(event));
|
|
72
72
|
}, [onSearch]);
|
|
73
73
|
var handlePressEnter = (0, _react.useCallback)(function (_, event) {
|
|
74
|
-
|
|
74
|
+
var _a, _b;
|
|
75
|
+
onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter((_b = (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, event));
|
|
75
76
|
}, [onPressEnter, searchRef]);
|
|
76
77
|
var handleFocus = (0, _react.useCallback)(function (event) {
|
|
77
78
|
setFocused(true);
|
package/lib/select/select.js
CHANGED
|
@@ -34,7 +34,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
|
|
|
34
34
|
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; }
|
|
35
35
|
var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
|
|
36
36
|
var InternalSelect = function InternalSelect(props, ref) {
|
|
37
|
-
var _context, _classNames6, _classNames12;
|
|
37
|
+
var _context, _classNames6, _classNames12, _context5;
|
|
38
38
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
39
39
|
getPrefixCls = _useContext.getPrefixCls,
|
|
40
40
|
prefixCls = _useContext.prefixCls,
|
|
@@ -778,7 +778,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
778
778
|
// open
|
|
779
779
|
if (which === _KeyCode.default.ENTER || which === _KeyCode.default.UP || which === _KeyCode.default.DOWN) {
|
|
780
780
|
e.preventDefault();
|
|
781
|
-
|
|
781
|
+
handleVisibleChange(true);
|
|
782
782
|
}
|
|
783
783
|
// backspace
|
|
784
784
|
var _multipleRef$current5 = multipleRef.current,
|
|
@@ -806,6 +806,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
806
806
|
offset = 1;
|
|
807
807
|
} else if (which === _KeyCode.default.ENTER) {
|
|
808
808
|
var item = filledOptions[activeIndex];
|
|
809
|
+
if (!item) return;
|
|
809
810
|
var key = ((_a = item.props) === null || _a === void 0 ? void 0 : _a.value) || item.value;
|
|
810
811
|
var label = ((_b = item.props) === null || _b === void 0 ? void 0 : _b.children) || item.label;
|
|
811
812
|
handleOption(key, label, true);
|
|
@@ -821,10 +822,10 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
821
822
|
}));
|
|
822
823
|
}
|
|
823
824
|
if (!isMultiple) {
|
|
824
|
-
|
|
825
|
+
handleVisibleChange(false);
|
|
825
826
|
}
|
|
826
827
|
} else if (which === _KeyCode.default.ESC) {
|
|
827
|
-
|
|
828
|
+
handleVisibleChange(false);
|
|
828
829
|
}
|
|
829
830
|
if (offset !== 0) {
|
|
830
831
|
var nextActiveIndex = getActiveIndex(activeIndex + offset, offset);
|
|
@@ -881,7 +882,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
881
882
|
}
|
|
882
883
|
};
|
|
883
884
|
var popperProps = (0, _extends2.default)((0, _extends2.default)({}, selectProps), {
|
|
884
|
-
prefixCls: selectPrefixCls,
|
|
885
|
+
prefixCls: (0, _concat.default)(_context5 = "".concat(selectPrefixCls, "-dropdown-panel")).call(_context5, isMultiple ? " ".concat(selectPrefixCls, "-multiple-dropdown-panel") : ''),
|
|
885
886
|
placement: 'bottomLeft',
|
|
886
887
|
popperStyle: catchStyle(),
|
|
887
888
|
defaultVisible: optionShow,
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
z-index: var(--kd-c-select-z-index, var(--kd-g-z-index-popper, 1050));
|
|
360
360
|
-webkit-box-sizing: border-box;
|
|
361
361
|
box-sizing: border-box;
|
|
362
|
-
padding: 8px 0;
|
|
362
|
+
padding: var(--kd-c-select-dropdown-spacing-padding-vertical, 8px) 0;
|
|
363
363
|
margin: 0;
|
|
364
364
|
overflow: auto;
|
|
365
365
|
font-size: var(--kd-c-select-dropdown-font-size, 12px);
|
|
@@ -382,6 +382,9 @@
|
|
|
382
382
|
.kd-select-dropdown-search-hidden {
|
|
383
383
|
display: none;
|
|
384
384
|
}
|
|
385
|
+
.kd-select-multiple-dropdown-panel .kd-select-dropdown {
|
|
386
|
+
padding-bottom: 0;
|
|
387
|
+
}
|
|
385
388
|
.kd-select-item {
|
|
386
389
|
position: relative;
|
|
387
390
|
display: block;
|
|
@@ -648,8 +651,8 @@
|
|
|
648
651
|
align-items: center;
|
|
649
652
|
width: 100%;
|
|
650
653
|
padding: 0 12px;
|
|
651
|
-
height:
|
|
652
|
-
line-height:
|
|
654
|
+
height: 40px;
|
|
655
|
+
line-height: 40px;
|
|
653
656
|
border-top: 1px solid #d9d9d9;
|
|
654
657
|
-webkit-box-sizing: border-box;
|
|
655
658
|
box-sizing: border-box;
|
|
@@ -132,10 +132,10 @@
|
|
|
132
132
|
left: 0;
|
|
133
133
|
z-index: @select-z-index;
|
|
134
134
|
box-sizing: border-box;
|
|
135
|
-
padding:
|
|
135
|
+
padding: @select-dropdown-padding-vertical 0;
|
|
136
136
|
margin: 0;
|
|
137
137
|
overflow: auto;
|
|
138
|
-
font-size: @select-list-font-size;
|
|
138
|
+
font-size: @select-list-font-size;
|
|
139
139
|
font-variant: initial;
|
|
140
140
|
background-color: @select-dropdown-bg;
|
|
141
141
|
border-radius: @select-g-radius-border;
|
|
@@ -159,6 +159,12 @@
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
&-multiple-dropdown-panel {
|
|
163
|
+
.@{select-prefix-cls}-dropdown {
|
|
164
|
+
padding-bottom: 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
162
168
|
// 下拉列表选项
|
|
163
169
|
&-item {
|
|
164
170
|
.item();
|
|
@@ -404,8 +410,8 @@
|
|
|
404
410
|
align-items: center;
|
|
405
411
|
width: 100%;
|
|
406
412
|
padding: 0 12px;
|
|
407
|
-
height:
|
|
408
|
-
line-height:
|
|
413
|
+
height: 40px;
|
|
414
|
+
line-height: 40px;
|
|
409
415
|
border-top: 1px solid #d9d9d9;
|
|
410
416
|
box-sizing: border-box;
|
|
411
417
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
@select-custom-prefix: ~'--@{kd-prefix}-c-select';
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
// color
|
|
7
6
|
@select-dropdown-bg: var(~'@{select-custom-prefix}-dropdown-color-background', @color-background);
|
|
8
7
|
@select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled', #fff);
|
|
@@ -45,6 +44,7 @@
|
|
|
45
44
|
// spacing
|
|
46
45
|
@select-bordered: var(~'@{select-custom-prefix}-bordered-spacing-padding-left', 8px);
|
|
47
46
|
@select-wrapper-padding: var(~'@{select-custom-prefix}-wrapper-spacing-padding', 1px 28px 1px 0);
|
|
47
|
+
@select-dropdown-padding-vertical: var(~'@{select-custom-prefix}-dropdown-spacing-padding-vertical', 8px);
|
|
48
48
|
|
|
49
49
|
// radius
|
|
50
50
|
@select-g-radius-border: var(~'@{select-custom-prefix}-radius-border', @radius-border);
|
|
@@ -31,12 +31,15 @@
|
|
|
31
31
|
.slide-motion(topLeft, kdSlideDown, kd-cascader-menus);
|
|
32
32
|
.slide-motion(bottomLeft, kdSlideUp, kd-cascader-menus);
|
|
33
33
|
|
|
34
|
-
.slide-motion(topLeft, kdSlideDown, kd-select);
|
|
35
|
-
.slide-motion(bottomLeft, kdSlideUp, kd-select);
|
|
34
|
+
.slide-motion(topLeft, kdSlideDown, kd-select-dropdown-panel);
|
|
35
|
+
.slide-motion(bottomLeft, kdSlideUp, kd-select-dropdown-panel);
|
|
36
36
|
|
|
37
37
|
.slide-motion(topLeft, kdSlideDown, kd-date-picker-panel);
|
|
38
38
|
.slide-motion(bottomLeft, kdSlideUp, kd-date-picker-panel);
|
|
39
39
|
|
|
40
|
+
.slide-motion(topLeft, kdSlideDown, kd-city-picker-dropdown);
|
|
41
|
+
.slide-motion(bottomLeft, kdSlideUp, kd-city-picker-dropdown);
|
|
42
|
+
|
|
40
43
|
@keyframes kdSlideCenterIn {
|
|
41
44
|
0% {
|
|
42
45
|
opacity: 0;
|
package/lib/style/index.css
CHANGED
|
@@ -1361,7 +1361,7 @@
|
|
|
1361
1361
|
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1362
1362
|
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1363
1363
|
}
|
|
1364
|
-
.kd-select.topLeft-active {
|
|
1364
|
+
.kd-select-dropdown-panel.topLeft-active {
|
|
1365
1365
|
-webkit-animation-name: kdSlideDownIn;
|
|
1366
1366
|
animation-name: kdSlideDownIn;
|
|
1367
1367
|
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
@@ -1369,7 +1369,7 @@
|
|
|
1369
1369
|
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1370
1370
|
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1371
1371
|
}
|
|
1372
|
-
.kd-select.topLeft.hidden {
|
|
1372
|
+
.kd-select-dropdown-panel.topLeft.hidden {
|
|
1373
1373
|
-webkit-animation-name: kdSlideDownOut;
|
|
1374
1374
|
animation-name: kdSlideDownOut;
|
|
1375
1375
|
-webkit-animation-duration: 0.1s;
|
|
@@ -1377,7 +1377,7 @@
|
|
|
1377
1377
|
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1378
1378
|
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1379
1379
|
}
|
|
1380
|
-
.kd-select.bottomLeft-active {
|
|
1380
|
+
.kd-select-dropdown-panel.bottomLeft-active {
|
|
1381
1381
|
-webkit-animation-name: kdSlideUpIn;
|
|
1382
1382
|
animation-name: kdSlideUpIn;
|
|
1383
1383
|
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1386
1386
|
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1387
1387
|
}
|
|
1388
|
-
.kd-select.bottomLeft.hidden {
|
|
1388
|
+
.kd-select-dropdown-panel.bottomLeft.hidden {
|
|
1389
1389
|
-webkit-animation-name: kdSlideUpOut;
|
|
1390
1390
|
animation-name: kdSlideUpOut;
|
|
1391
1391
|
-webkit-animation-duration: 0.1s;
|
|
@@ -1425,6 +1425,38 @@
|
|
|
1425
1425
|
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1426
1426
|
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1427
1427
|
}
|
|
1428
|
+
.kd-city-picker-dropdown.topLeft-active {
|
|
1429
|
+
-webkit-animation-name: kdSlideDownIn;
|
|
1430
|
+
animation-name: kdSlideDownIn;
|
|
1431
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
1432
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
1433
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1434
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1435
|
+
}
|
|
1436
|
+
.kd-city-picker-dropdown.topLeft.hidden {
|
|
1437
|
+
-webkit-animation-name: kdSlideDownOut;
|
|
1438
|
+
animation-name: kdSlideDownOut;
|
|
1439
|
+
-webkit-animation-duration: 0.1s;
|
|
1440
|
+
animation-duration: 0.1s;
|
|
1441
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1442
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1443
|
+
}
|
|
1444
|
+
.kd-city-picker-dropdown.bottomLeft-active {
|
|
1445
|
+
-webkit-animation-name: kdSlideUpIn;
|
|
1446
|
+
animation-name: kdSlideUpIn;
|
|
1447
|
+
-webkit-animation-duration: calc(0.3s - 0.1s);
|
|
1448
|
+
animation-duration: calc(0.3s - 0.1s);
|
|
1449
|
+
-webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1450
|
+
animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
|
|
1451
|
+
}
|
|
1452
|
+
.kd-city-picker-dropdown.bottomLeft.hidden {
|
|
1453
|
+
-webkit-animation-name: kdSlideUpOut;
|
|
1454
|
+
animation-name: kdSlideUpOut;
|
|
1455
|
+
-webkit-animation-duration: 0.1s;
|
|
1456
|
+
animation-duration: 0.1s;
|
|
1457
|
+
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1458
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
|
|
1459
|
+
}
|
|
1428
1460
|
@-webkit-keyframes kdSlideCenterIn {
|
|
1429
1461
|
0% {
|
|
1430
1462
|
opacity: 0;
|
package/lib/table/api.js
CHANGED
|
@@ -84,7 +84,7 @@ function getApi(pipelineRef) {
|
|
|
84
84
|
* @returns
|
|
85
85
|
*/
|
|
86
86
|
function ensureColumnVisible(code) {
|
|
87
|
-
var _a, _b;
|
|
87
|
+
var _a, _b, _c, _d;
|
|
88
88
|
var pipeline = pipelineRef.current;
|
|
89
89
|
var tableBodyContainer = (_a = pipeline.ref) === null || _a === void 0 ? void 0 : _a.current.domHelper.tableBody;
|
|
90
90
|
var tableScroll = (_b = pipeline.ref) === null || _b === void 0 ? void 0 : _b.current.domHelper.stickyScroll;
|
|
@@ -100,14 +100,30 @@ function getApi(pipelineRef) {
|
|
|
100
100
|
var colLeft = (0, _slice.default)(columnNodes).call(columnNodes, 0, index).reduce(function (acc, col) {
|
|
101
101
|
return acc + col.width;
|
|
102
102
|
}, 0);
|
|
103
|
+
var lockColumnLeft = 0;
|
|
104
|
+
var lockColumnRight = 0;
|
|
105
|
+
for (var i = 0; i < columnNodes.length; i++) {
|
|
106
|
+
if ((_c = columnNodes[i]) === null || _c === void 0 ? void 0 : _c.lock) {
|
|
107
|
+
lockColumnLeft += columnNodes[i].width;
|
|
108
|
+
} else {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (var _i = columnNodes.length - 1; _i >= 0; _i--) {
|
|
113
|
+
if ((_d = columnNodes[_i]) === null || _d === void 0 ? void 0 : _d.lock) {
|
|
114
|
+
lockColumnRight += columnNodes[_i].width;
|
|
115
|
+
} else {
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
103
119
|
var colLeftPixel = colLeft; // 目标列前面列宽总和
|
|
104
120
|
var colRightPixel = colLeftPixel + column.width;
|
|
105
121
|
var viewportWidth = tableBodyContainer.clientWidth; // 表体容器的宽度
|
|
106
122
|
var scrollPosition = tableScroll.scrollLeft; // 滚动条滚动的距离
|
|
107
123
|
var vScrollLeft = scrollPosition;
|
|
108
124
|
var vScrollRight = scrollPosition + viewportWidth;
|
|
109
|
-
var pxLeft = colLeftPixel;
|
|
110
|
-
var pxRight = colRightPixel - viewportWidth;
|
|
125
|
+
var pxLeft = colLeftPixel - lockColumnLeft;
|
|
126
|
+
var pxRight = colRightPixel - viewportWidth + lockColumnRight;
|
|
111
127
|
var colBeforeViewport = vScrollLeft > colLeftPixel; // 滚动距离大于目标列前面列宽总和,说明目标列在视口之前
|
|
112
128
|
var colPastViewport = vScrollRight < colRightPixel; // 目标列是视口之后
|
|
113
129
|
var colToSmallForViewport = viewportWidth < column.width;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/kdesign",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.25",
|
|
4
4
|
"description": "KDesign 金蝶前端react 组件库",
|
|
5
5
|
"title": "kdesign",
|
|
6
6
|
"keywords": [
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@babel/runtime-corejs3": "^7.11.2",
|
|
79
79
|
"@babel/standalone": "^7.14.3",
|
|
80
80
|
"@kdcloudjs/kdesign-icons": "^1.0.0",
|
|
81
|
-
"@kdcloudjs/table": "1.
|
|
81
|
+
"@kdcloudjs/table": "1.2.0-canary.1",
|
|
82
82
|
"@popperjs/core": "^2.5.4",
|
|
83
83
|
"@types/js-cookie": "^3.0.3",
|
|
84
84
|
"async-validator": "^3.5.1",
|