@kdcloudjs/kdesign 1.5.8 → 1.5.11

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/default-theme.js +1 -1
  3. package/dist/kdesign-complete.less +156 -114
  4. package/dist/kdesign.css +122 -101
  5. package/dist/kdesign.css.map +1 -1
  6. package/dist/kdesign.js +1083 -321
  7. package/dist/kdesign.js.map +1 -1
  8. package/dist/kdesign.min.css +3 -3
  9. package/dist/kdesign.min.js +8 -8
  10. package/dist/kdesign.min.js.map +1 -1
  11. package/es/_utils/KeyCode.d.ts +436 -0
  12. package/es/_utils/KeyCode.js +623 -0
  13. package/es/_utils/hooks.d.ts +1 -0
  14. package/es/_utils/hooks.js +51 -1
  15. package/es/_utils/usePopper.js +2 -2
  16. package/es/alert/style/index.css +0 -1
  17. package/es/alert/style/index.less +0 -1
  18. package/es/button/style/index.css +3 -0
  19. package/es/button/style/mixin.less +3 -0
  20. package/es/carousel/slidebar.d.ts +1 -0
  21. package/es/checkbox/checkbox.d.ts +1 -0
  22. package/es/checkbox/checkbox.js +21 -3
  23. package/es/city-picker/no-data.d.ts +1 -0
  24. package/es/config-provider/compDefaultProps.d.ts +1 -0
  25. package/es/config-provider/compDefaultProps.js +2 -1
  26. package/es/date-picker/calendar.d.ts +1 -0
  27. package/es/date-picker/date-picker.js +15 -14
  28. package/es/date-picker/hooks/use-picker-input.js +44 -38
  29. package/es/date-picker/panel/month/month.d.ts +1 -0
  30. package/es/date-picker/panel/quarter/quarter.d.ts +1 -0
  31. package/es/date-picker/panel/time/time.d.ts +1 -0
  32. package/es/date-picker/panel/week/week.d.ts +1 -0
  33. package/es/date-picker/panel/year/year.d.ts +1 -0
  34. package/es/date-picker/range-picker.js +24 -13
  35. package/es/date-picker/utils/get-ranges.d.ts +1 -0
  36. package/es/drawer/drawer.d.ts +1 -0
  37. package/es/drawer/drawer.js +6 -3
  38. package/es/dropdown/dropdown.js +1 -1
  39. package/es/empty/defaultEmptyImg.d.ts +1 -0
  40. package/es/empty/illustrationEmptyImg.d.ts +1 -0
  41. package/es/modal/style/index.css +1 -7
  42. package/es/modal/style/index.less +1 -7
  43. package/es/modal/style/token.less +7 -4
  44. package/es/notification-base/notification.js +4 -4
  45. package/es/pagination/style/index.css +1 -3
  46. package/es/pagination/style/index.less +1 -3
  47. package/es/progress/progress.js +1 -1
  48. package/es/progress/style/index.css +18 -5
  49. package/es/progress/style/index.less +19 -5
  50. package/es/progress/style/token.less +5 -1
  51. package/es/slider/track.d.ts +1 -0
  52. package/es/style/themes/default.less +1 -1
  53. package/es/table/table.d.ts +1 -0
  54. package/es/tabs/style/index.css +79 -74
  55. package/es/tabs/style/index.less +76 -73
  56. package/es/tabs/style/mixin.less +0 -6
  57. package/es/tabs/style/token.less +8 -3
  58. package/es/transfer/style/index.css +0 -3
  59. package/es/transfer/style/index.less +0 -3
  60. package/es/tree/style/index.css +2 -1
  61. package/es/tree/style/index.less +5 -4
  62. package/es/tree/style/token.less +2 -1
  63. package/es/tree/treeNode.js +4 -1
  64. package/es/upload/style/index.css +17 -6
  65. package/es/upload/style/index.less +18 -5
  66. package/es/upload/style/token.less +11 -0
  67. package/es/upload/upload.js +6 -4
  68. package/lib/_utils/KeyCode.d.ts +436 -0
  69. package/lib/_utils/KeyCode.js +631 -0
  70. package/lib/_utils/hooks.d.ts +1 -0
  71. package/lib/_utils/hooks.js +54 -1
  72. package/lib/_utils/usePopper.js +2 -2
  73. package/lib/alert/style/index.css +0 -1
  74. package/lib/alert/style/index.less +0 -1
  75. package/lib/button/style/index.css +3 -0
  76. package/lib/button/style/mixin.less +3 -0
  77. package/lib/carousel/slidebar.d.ts +1 -0
  78. package/lib/checkbox/checkbox.d.ts +1 -0
  79. package/lib/checkbox/checkbox.js +23 -4
  80. package/lib/city-picker/no-data.d.ts +1 -0
  81. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  82. package/lib/config-provider/compDefaultProps.js +2 -1
  83. package/lib/date-picker/calendar.d.ts +1 -0
  84. package/lib/date-picker/date-picker.js +15 -15
  85. package/lib/date-picker/hooks/use-picker-input.js +45 -37
  86. package/lib/date-picker/panel/month/month.d.ts +1 -0
  87. package/lib/date-picker/panel/quarter/quarter.d.ts +1 -0
  88. package/lib/date-picker/panel/time/time.d.ts +1 -0
  89. package/lib/date-picker/panel/week/week.d.ts +1 -0
  90. package/lib/date-picker/panel/year/year.d.ts +1 -0
  91. package/lib/date-picker/range-picker.js +24 -14
  92. package/lib/date-picker/utils/get-ranges.d.ts +1 -0
  93. package/lib/drawer/drawer.d.ts +1 -0
  94. package/lib/drawer/drawer.js +5 -2
  95. package/lib/dropdown/dropdown.js +1 -1
  96. package/lib/empty/defaultEmptyImg.d.ts +1 -0
  97. package/lib/empty/illustrationEmptyImg.d.ts +1 -0
  98. package/lib/modal/style/index.css +1 -7
  99. package/lib/modal/style/index.less +1 -7
  100. package/lib/modal/style/token.less +7 -4
  101. package/lib/notification-base/notification.js +4 -3
  102. package/lib/pagination/style/index.css +1 -3
  103. package/lib/pagination/style/index.less +1 -3
  104. package/lib/progress/progress.js +1 -1
  105. package/lib/progress/style/index.css +18 -5
  106. package/lib/progress/style/index.less +19 -5
  107. package/lib/progress/style/token.less +5 -1
  108. package/lib/slider/track.d.ts +1 -0
  109. package/lib/style/themes/default.less +1 -1
  110. package/lib/table/table.d.ts +1 -0
  111. package/lib/tabs/style/index.css +79 -74
  112. package/lib/tabs/style/index.less +76 -73
  113. package/lib/tabs/style/mixin.less +0 -6
  114. package/lib/tabs/style/token.less +8 -3
  115. package/lib/transfer/style/index.css +0 -3
  116. package/lib/transfer/style/index.less +0 -3
  117. package/lib/tree/style/index.css +2 -1
  118. package/lib/tree/style/index.less +5 -4
  119. package/lib/tree/style/token.less +2 -1
  120. package/lib/tree/treeNode.js +4 -1
  121. package/lib/upload/style/index.css +17 -6
  122. package/lib/upload/style/index.less +18 -5
  123. package/lib/upload/style/token.less +11 -0
  124. package/lib/upload/upload.js +6 -4
  125. package/package.json +2 -2
@@ -118,6 +118,9 @@
118
118
  text-align: center;
119
119
  background-color: transparent;
120
120
  cursor: pointer;
121
+ white-space: nowrap;
122
+ overflow: hidden;
123
+ text-overflow: ellipsis;
121
124
  -webkit-transition: color 0.3s, background-color 0.3s, border-color 0.3s;
122
125
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
123
126
  }
@@ -14,6 +14,9 @@
14
14
  text-align: center;
15
15
  background-color: transparent;
16
16
  cursor: pointer;
17
+ white-space: nowrap;
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
17
20
  &,
18
21
  &:active,
19
22
  &:focus {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface slideProps {
2
3
  currentIndex: number;
3
4
  dotPosition?: string;
@@ -16,6 +16,7 @@ export interface CheckboxProps {
16
16
  disabled?: boolean;
17
17
  children?: React.ReactNode;
18
18
  name?: string;
19
+ onClick?: (e: React.MouseEvent) => void;
19
20
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
20
21
  }
21
22
  declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<unknown>>;
@@ -1,6 +1,22 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
1
2
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
2
3
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
4
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
5
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
6
+
7
+ var __rest = this && this.__rest || function (s, e) {
8
+ var t = {};
9
+
10
+ for (var p in s) {
11
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
12
+ }
13
+
14
+ if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
15
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
16
+ }
17
+ return t;
18
+ };
19
+
4
20
  import React, { useCallback, useContext, useEffect, useState, useRef } from 'react';
5
21
  import classNames from 'classnames';
6
22
  import ConfigContext from '../config-provider/ConfigContext';
@@ -21,6 +37,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
21
37
  userDefaultProps = _useContext.compDefaultProps;
22
38
 
23
39
  var CheckboxProps = getCompProps('Checkbox', userDefaultProps, props);
40
+
24
41
  var checkboxType = CheckboxProps.checkboxType,
25
42
  className = CheckboxProps.className,
26
43
  customPrefixcls = CheckboxProps.prefixCls,
@@ -33,7 +50,8 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
33
50
  style = CheckboxProps.style,
34
51
  value = CheckboxProps.value,
35
52
  indeterminate = CheckboxProps.indeterminate,
36
- name = CheckboxProps.name;
53
+ name = CheckboxProps.name,
54
+ rest = __rest(CheckboxProps, ["checkboxType", "className", "prefixCls", "defaultChecked", "checked", "size", "onChange", "disabled", "children", "style", "value", "indeterminate", "name"]);
37
55
 
38
56
  var getChecked = function getChecked() {
39
57
  return isBoolean(checked) ? checked : defaultChecked;
@@ -97,11 +115,11 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
97
115
  return (
98
116
  /*#__PURE__*/
99
117
  // eslint-disable-next-line
100
- React.createElement("label", {
118
+ React.createElement("label", _extends({
101
119
  className: getRootClassName,
102
120
  style: style,
103
121
  ref: labelRef
104
- }, /*#__PURE__*/React.createElement("span", {
122
+ }, rest), /*#__PURE__*/React.createElement("span", {
105
123
  className: checkedWrapperClassName
106
124
  }, selected && /*#__PURE__*/React.createElement("span", {
107
125
  className: innerIconClassName
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const NoData: () => JSX.Element;
2
3
  export default NoData;
@@ -106,6 +106,7 @@ declare const compDefaultProps: {
106
106
  placement: string;
107
107
  width: number;
108
108
  zIndex: number;
109
+ disableScroll: boolean;
109
110
  };
110
111
  Empty: {};
111
112
  Filter: {
@@ -111,7 +111,8 @@ var compDefaultProps = {
111
111
  maskClosable: true,
112
112
  placement: 'right',
113
113
  width: 320,
114
- zIndex: 1050
114
+ zIndex: 1050,
115
+ disableScroll: true
115
116
  },
116
117
  Empty: {},
117
118
  Filter: {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType, PickerMode, SharedTimeProps } from './interface';
2
3
  import { RangeShowTimeObject } from './range-picker';
3
4
  export interface CalendarProps {
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
3
3
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
4
4
  import React, { useContext, useEffect } from 'react';
5
5
  import classnames from 'classnames';
6
- import parse from 'date-fns/parse';
7
6
  import ConfigContext from '../config-provider/ConfigContext';
8
7
  import { useMergedState, useOnClickOutside } from '../_utils/hooks';
9
8
  import { getCompProps } from '../_utils';
@@ -168,19 +167,21 @@ function DatePicker(props) {
168
167
  var _useTextValueMapping = useTextValueMapping({
169
168
  valueText: valueText,
170
169
  onTextChange: function onTextChange(newText) {
171
- // if (typeof _format !== 'function') {
172
- var inputDate;
173
-
174
- if (picker !== 'year') {
175
- inputDate = parseDate(newText, _format);
176
- } else {
177
- var year = parse(newText, _format, newDate());
178
- inputDate = isValid(year) ? year : null;
179
- }
180
-
181
- if (inputDate && (!disabledDate || !disabledDate(inputDate))) {
182
- setSelectedValue(inputDate);
183
- setViewDate(inputDate);
170
+ if (newText === '') {
171
+ setSelectedValue(null);
172
+ setDateValue(null);
173
+ } else if (newText && newText.length === _format.length) {
174
+ var inputTempDate = parseDate(newText, _format);
175
+
176
+ if (inputTempDate && (!disabledDate || !disabledDate(inputTempDate))) {
177
+ if (picker !== 'year') {
178
+ setSelectedValue(inputTempDate);
179
+ setDateValue(inputTempDate);
180
+ } else if (isValid(inputTempDate)) {
181
+ setSelectedValue(inputTempDate);
182
+ setDateValue(inputTempDate);
183
+ }
184
+ }
184
185
  }
185
186
  }
186
187
  }),
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
2
- import { useState, useEffect, useRef } from 'react'; // import KeyCode from '../../_utils/KeyCode'
3
-
2
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
3
+ import { useState, useEffect, useRef } from 'react';
4
+ import KeyCode from '../../_utils/KeyCode';
4
5
  export default function usePickerInput(_ref) {
5
6
  var preventBlurRef = _ref.preventBlurRef,
6
7
  open = _ref.open,
@@ -29,42 +30,47 @@ export default function usePickerInput(_ref) {
29
30
  setTyping(true);
30
31
  triggerOpen(true);
31
32
  },
32
- // onKeyDown: (e) => {
33
- // switch (e.which) {
34
- // case KeyCode.ENTER: {
35
- // if (!open) {
36
- // triggerOpen(true)
37
- // } else if (onSubmit() !== false) {
38
- // setTyping(true)
39
- // }
40
- // e.preventDefault()
41
- // return
42
- // }
43
- // case KeyCode.TAB: {
44
- // if (typing && open && !e.shiftKey) {
45
- // setTyping(false)
46
- // e.preventDefault()
47
- // } else if (!typing && open) {
48
- // if (!forwardKeyDown(e) && e.shiftKey) {
49
- // setTyping(true)
50
- // e.preventDefault()
51
- // }
52
- // }
53
- // return
54
- // }
55
- // case KeyCode.ESC: {
56
- // setTyping(true)
57
- // onCancel()
58
- // return
59
- // }
60
- // }
61
- // if (!open && ![KeyCode.SHIFT].includes(e.which)) {
62
- // triggerOpen(true)
63
- // } else if (!typing) {
64
- // // Let popup panel handle keyboard
65
- // forwardKeyDown(e)
66
- // }
67
- // },
33
+ onKeyDown: function onKeyDown(e) {
34
+ var _context;
35
+
36
+ setTyping(true);
37
+ triggerOpen(true);
38
+
39
+ switch (e.which) {
40
+ case KeyCode.ENTER:
41
+ {
42
+ if (!open) {
43
+ triggerOpen(true);
44
+ } else if (onSubmit() !== false) {
45
+ setTyping(true);
46
+ }
47
+
48
+ e.preventDefault();
49
+ return;
50
+ }
51
+
52
+ case KeyCode.TAB:
53
+ {
54
+ if (typing && open && !e.shiftKey) {
55
+ setTyping(false);
56
+ e.preventDefault();
57
+ }
58
+
59
+ return;
60
+ }
61
+
62
+ case KeyCode.ESC:
63
+ {
64
+ setTyping(true);
65
+ onCancel();
66
+ return;
67
+ }
68
+ }
69
+
70
+ if (!open && !_includesInstanceProperty(_context = [KeyCode.SHIFT]).call(_context, e.which)) {
71
+ triggerOpen(true);
72
+ }
73
+ },
68
74
  onFocus: function onFocus(e) {
69
75
  setTyping(true);
70
76
  setFocused(true);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType } from '../../interface';
2
3
  export declare const monthsNumToText: string[];
3
4
  export interface MonthProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType } from '../../interface';
2
3
  interface QuarterProps {
3
4
  disabledDate?: (date: DateType) => boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType, DisabledTimes, PanelSharedProps, PickerMode } from '../../interface';
2
3
  export interface SharedTimeProps extends DisabledTimes {
3
4
  format?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType, PickerMode } from '../../interface';
2
3
  export interface WeekProps {
3
4
  day: DateType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DateType } from '../../interface';
2
3
  export interface YearProps {
3
4
  yearItemNumber: number;
@@ -6,7 +6,6 @@ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
6
6
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
7
7
  import React, { useContext, useEffect } from 'react';
8
8
  import isSameWeek from 'date-fns/isSameWeek';
9
- import parse from 'date-fns/parse';
10
9
  import ConfigContext from '../config-provider/ConfigContext';
11
10
  import { useMergedState, useOnClickOutside } from '../_utils/hooks';
12
11
  import { getCompProps } from '../_utils';
@@ -249,20 +248,32 @@ function DatePicker(props) {
249
248
  });
250
249
 
251
250
  var _onTextChange = function onTextChange(newText, index) {
252
- var inputDate;
251
+ var inputTempDate;
253
252
 
254
- if (picker !== 'year') {
255
- inputDate = parseDate(newText, _format);
256
- } else {
257
- var year = parse(newText, _format, newDate());
258
- inputDate = isValid(year) ? year : null;
259
- }
260
-
261
- var disabledFunc = index === 0 ? disabledStartDate : disabledEndDate;
253
+ if (newText === '') {
254
+ if (index === 0 && selectedValue && selectedValue.length === 2) {
255
+ inputTempDate = selectedValue[1];
256
+ } else if (index === 1 && selectedValue && selectedValue.length === 2) {
257
+ inputTempDate = selectedValue[0];
258
+ }
262
259
 
263
- if (inputDate && (!disabledFunc || !disabledFunc(inputDate))) {
264
- setSelectedValue(updateValues(selectedValue, inputDate, index));
265
- setViewDate(inputDate, index);
260
+ if (inputTempDate) {
261
+ setSelectedValue(updateValues(selectedValue, inputTempDate, index));
262
+ setViewDate(inputTempDate, index);
263
+ }
264
+ } else if (newText && newText.length === _format.length) {
265
+ inputTempDate = parseDate(newText, _format);
266
+ var disabledFunc = index === 0 ? disabledStartDate : disabledEndDate;
267
+
268
+ if (inputTempDate && (!disabledFunc || !disabledFunc(inputTempDate))) {
269
+ if (picker !== 'year') {
270
+ setSelectedValue(updateValues(selectedValue, inputTempDate, index));
271
+ setViewDate(inputTempDate, index);
272
+ } else if (isValid(inputTempDate)) {
273
+ setSelectedValue(updateValues(selectedValue, inputTempDate, index));
274
+ setViewDate(inputTempDate, index);
275
+ }
276
+ }
266
277
  }
267
278
  }; // input 展示
268
279
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Components, RangeList, InnerLocale } from '../interface';
2
3
  export interface RangesProps {
3
4
  prefixCls: string;
@@ -36,6 +36,7 @@ export interface IDrawerProps {
36
36
  width?: string | number;
37
37
  height?: string | number;
38
38
  zIndex?: string | number;
39
+ disableScroll?: boolean;
39
40
  }
40
41
  declare const Drawer: React.ForwardRefExoticComponent<IDrawerProps & React.RefAttributes<unknown>>;
41
42
  export default Drawer;
@@ -12,7 +12,7 @@ import classNames from 'classnames';
12
12
  import ConfigContext from '../config-provider/ConfigContext';
13
13
  import { getCompProps } from '../_utils';
14
14
  import devWarning from '../_utils/devwarning';
15
- import { useResizeObserver, useHideDocumentScrollBar } from '../_utils/hooks'; // import { usePrevious } from '../_utils/hooks'
15
+ import { useResizeObserver, useOverflowHidden } from '../_utils/hooks'; // import { usePrevious } from '../_utils/hooks'
16
16
 
17
17
  import { toArray } from '../_utils/react-children';
18
18
  export var PlacementTypes = tuple('top', 'right', 'bottom', 'left');
@@ -37,6 +37,8 @@ var documentBody = document.body; // function transformSize(size: string | numbe
37
37
  var InternalDrawer = function InternalDrawer(props, ref) {
38
38
  var _classNames, _context2, _context3, _classNames2;
39
39
 
40
+ var _a;
41
+
40
42
  var _useContext = useContext(ConfigContext),
41
43
  getPrefixCls = _useContext.getPrefixCls,
42
44
  prefixCls = _useContext.prefixCls,
@@ -70,7 +72,8 @@ var InternalDrawer = function InternalDrawer(props, ref) {
70
72
  getContainer = drawerProps.getContainer,
71
73
  forceRender = drawerProps.forceRender,
72
74
  destroyOnClose = drawerProps.destroyOnClose,
73
- customPrefixcls = drawerProps.prefixCls;
75
+ customPrefixcls = drawerProps.prefixCls,
76
+ disableScroll = drawerProps.disableScroll;
74
77
  var drawerPrefixCls = getPrefixCls(prefixCls, 'drawer', customPrefixcls);
75
78
 
76
79
  var _useState = useState(false),
@@ -138,7 +141,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
138
141
 
139
142
  return drawerContainer || ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.parentNode);
140
143
  }, handleContainerResize);
141
- useHideDocumentScrollBar(!!visible, isBody, !!mask); // 为了单测
144
+ useOverflowHidden(drawerContainer || ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.parentNode), visible && mask, disableScroll); // 为了单测
142
145
 
143
146
  useEffect(function () {
144
147
  setCurrentWidth(width);
@@ -9,7 +9,7 @@ import { Menu, Item } from './menu';
9
9
  import usePopper from '../_utils/usePopper';
10
10
 
11
11
  var findItem = function findItem(element) {
12
- var isItem = element.className === 'kd-dropdown-menu-item';
12
+ var isItem = /kd-dropdown-menu-item/.test(element.className);
13
13
 
14
14
  if (isItem) {
15
15
  return element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function DefaultEmptyImg(): JSX.Element;
2
3
  export default DefaultEmptyImg;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function IllustrationEmptyImg(): JSX.Element;
2
3
  export default IllustrationEmptyImg;
@@ -236,14 +236,8 @@
236
236
  font-size: var(--kd-c-modal-footer-font-size, 14px);
237
237
  color: var(--kd-c-modal-footer-text-color, var(--kd-g-color-text-secondary, #666));
238
238
  }
239
- .kd-modal-ok-btn,
240
- .kd-modal-cancel-btn {
241
- min-width: 88px;
242
- min-height: 32px;
243
- font-size: var(--kd-c-modal-footer-font-size, 14px);
244
- }
245
239
  .kd-modal-margin-btn {
246
- margin-right: 20px;
240
+ margin-right: var(--kd-c-modal-footer-button-spacing, 12px);
247
241
  }
248
242
  .kd-modal-showline .kd-modal-header {
249
243
  border-bottom: var(--kd-c-modal-sizing-border, 1px) solid var(--kd-c-modal-color-border, var(--kd-g-color-border-strong-2, #d9d9d9));
@@ -113,14 +113,8 @@
113
113
  // });
114
114
  }
115
115
 
116
- &-ok-btn,
117
- &-cancel-btn {
118
- min-width: 88px;
119
- min-height: 32px;
120
- font-size: @modal-footer-font-size;
121
- }
122
116
  &-margin-btn {
123
- margin-right: 20px;
117
+ margin-right: @modal-footer-button-spacing;
124
118
  }
125
119
  }
126
120
 
@@ -38,9 +38,12 @@
38
38
  @icon-circle-radiu: var(~'@{modal-prefix}-icon-circle-sizing', 6px);
39
39
  @modal-border-width: var(~'@{modal-prefix}-sizing-border', 1px);
40
40
  @modal-close-icon-size: var(~'@{modal-prefix}-close-icon-font-size', 16px);
41
- @modal-header-sizing-padding-horizontal: var(~'@{modal-prefix}-header-sizing-padding-horizontal', 20px);
42
- @modal-header-sizing-padding-vertical: var(~'@{modal-prefix}-header-sizing-padding-vertical', 0px);
43
41
  @modal-header-sizing-height: var(~'@{modal-prefix}-header-sizing-height', 50px);
44
- @modal-body-sizing-padding: var(~'@{modal-prefix}-body-sizing-padding', 20px);
45
42
  @modal-footer-sizing-height: var(~'@{modal-prefix}-footer-sizing-height', 50px);
46
- @modal-title-icon-sizing-margin-right: var(~'@{modal-prefix}-title-icon-sizing-margin-right', 8px);
43
+
44
+ // spacing
45
+ @modal-footer-button-spacing: var(~'@{modal-prefix}-footer-button-spacing', 12px);
46
+ @modal-title-icon-sizing-margin-right: var(~'@{modal-prefix}-title-icon-sizing-margin-right', 8px);
47
+ @modal-header-sizing-padding-horizontal: var(~'@{modal-prefix}-header-sizing-padding-horizontal', 20px);
48
+ @modal-header-sizing-padding-vertical: var(~'@{modal-prefix}-header-sizing-padding-vertical', 0px);
49
+ @modal-body-sizing-padding: var(~'@{modal-prefix}-body-sizing-padding', 20px);
@@ -60,11 +60,11 @@ var Notification = /*#__PURE__*/React.forwardRef(function (props, ref) {
60
60
  };
61
61
 
62
62
  var remove = function remove(key) {
63
- var filter = _filterInstanceProperty(notices).call(notices, function (notice) {
64
- return notice.key !== key;
63
+ setNotices(function (preNotices) {
64
+ return _filterInstanceProperty(preNotices).call(preNotices, function (notice) {
65
+ return notice.key !== key;
66
+ });
65
67
  });
66
-
67
- setNotices(filter);
68
68
  };
69
69
 
70
70
  var _onClose = function onClose(notice) {
@@ -430,9 +430,7 @@
430
430
  }
431
431
  .kd-pagination.less .kd-pagination-pages-item:hover button,
432
432
  .kd-pagination.less .kd-pagination-pages-item:active button,
433
- .kd-pagination.less .kd-pagination-pages-item.active button,
434
- .kd-pagination.less .kd-pagination-pages-item:first-child button,
435
- .kd-pagination.less .kd-pagination-pages-item:last-child button {
433
+ .kd-pagination.less .kd-pagination-pages-item.active button {
436
434
  color: var(--kd-g-color-theme, #5582f3);
437
435
  }
438
436
  .kd-pagination.less .kd-pagination-pages-item:first-child button,
@@ -314,9 +314,7 @@
314
314
 
315
315
  &:hover,
316
316
  &:active,
317
- &.active,
318
- &:first-child,
319
- &:last-child {
317
+ &.active {
320
318
  button {
321
319
  color: @color-theme;
322
320
  }
@@ -57,7 +57,7 @@ var Progress = function Progress(props) {
57
57
 
58
58
  var progressStatus = getProgressStatus(progressProps);
59
59
  var progressPrefixCls = getPrefixCls(prefixCls, 'progress', customPrefixcls);
60
- var progressClasses = classNames(progressPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(progressPrefixCls, "-type-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(progressPrefixCls, "-status-")).call(_context2, progressStatus), true), _defineProperty(_classNames, "".concat(progressPrefixCls, "-show-info"), showInfo), _classNames));
60
+ var progressClasses = classNames(progressPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(progressPrefixCls, "-type-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(progressPrefixCls, "-status-")).call(_context2, progressStatus), true), _defineProperty(_classNames, "".concat(progressPrefixCls, "-show-info"), showInfo), _defineProperty(_classNames, "".concat(progressPrefixCls, "-position-bottom"), progressProps.infoPosition !== 'right' && progressStatus === 'normal'), _classNames));
61
61
 
62
62
  var renderProgressInfo = function renderProgressInfo(prefixCls, progressStatus, props) {
63
63
  var _props$type = props.type,
@@ -115,9 +115,19 @@
115
115
  }
116
116
  .kd-progress-type-line {
117
117
  width: 100%;
118
+ color: var(--kd-c-progress-line-color-font, #212121);
119
+ }
120
+ .kd-progress-type-line .kd-progress-special-text {
121
+ margin-top: var(--kd-c-progress-line-text-spacing-margin-top, 12px);
122
+ line-height: 24px;
123
+ }
124
+ .kd-progress-type-circle {
125
+ color: var(--kd-c-progress-circle-color-font, #666);
118
126
  }
119
127
  .kd-progress-type-circle .kd-progress-special-text {
128
+ margin-top: var(--kd-c-progress-circle-text-spacing-margin-top, 8px);
120
129
  padding: 0;
130
+ line-height: 24px;
121
131
  }
122
132
  .kd-progress-outer {
123
133
  display: inline-block;
@@ -129,9 +139,9 @@
129
139
  padding-right: 0;
130
140
  font-size: 0;
131
141
  }
132
- .kd-progress-show-info .kd-progress-outer {
133
- margin-right: calc(-1 * var(--kd-c-progress-line-text-font-size, 16px) * 3 - 8px);
134
- padding-right: calc(var(--kd-c-progress-line-text-font-size, 16px) * 3 + 8px);
142
+ .kd-progress-show-info:not(.kd-progress-position-bottom) .kd-progress-outer {
143
+ margin-right: calc(-1 * var(--kd-c-progress-line-text-font-size, 16px) * 2 - 8px);
144
+ padding-right: calc(var(--kd-c-progress-line-text-font-size, 16px) * 2 + 8px);
135
145
  }
136
146
  .kd-progress-inner {
137
147
  position: relative;
@@ -165,7 +175,7 @@
165
175
  display: inline-block;
166
176
  -webkit-box-sizing: border-box;
167
177
  box-sizing: border-box;
168
- width: calc(var(--kd-c-progress-line-text-font-size, 16px)*3);
178
+ width: calc(var(--kd-c-progress-line-text-font-size, 16px)*2);
169
179
  margin-left: var(--kd-c-progress-line-text-spacing-margin-left, 8px);
170
180
  white-space: nowrap;
171
181
  text-align: left;
@@ -176,7 +186,10 @@
176
186
  font-size: var(--kd-c-progress-line-special-text-font-size, 16px);
177
187
  text-align: center;
178
188
  overflow: hidden;
179
- padding-right: calc(var(--kd-c-progress-line-text-font-size, 16px)*3 + 8px);
189
+ padding-right: calc(var(--kd-c-progress-line-text-font-size, 16px)*2 + 8px);
190
+ }
191
+ .kd-progress-position-bottom .kd-progress-special-text {
192
+ padding-right: 0;
180
193
  }
181
194
  .kd-progress-status-success .kd-progress-bg {
182
195
  background-color: var(--kd-c-progress-color-success, var(--kd-g-color-success, #1ba854));
@@ -14,11 +14,21 @@
14
14
 
15
15
  &-type-line {
16
16
  width: 100%;
17
+ color: @progress-line-font-color;
18
+
19
+ .@{progress-prefix-cls}-special-text {
20
+ margin-top: @progress-line-text-margin-top;
21
+ line-height: 24px;
22
+ }
17
23
  }
18
24
 
19
25
  &-type-circle {
26
+ color: @progress-circle-font-color;
27
+
20
28
  .@{progress-prefix-cls}-special-text {
29
+ margin-top: @progress-circle-text-margin-top;
21
30
  padding: 0;
31
+ line-height: 24px;
22
32
  }
23
33
  }
24
34
 
@@ -31,9 +41,9 @@
31
41
  padding-right: 0;
32
42
  font-size: 0;
33
43
 
34
- .@{progress-prefix-cls}-show-info & {
35
- margin-right: calc(-1 * @progress-line-text-font-size * 3 - 8px);
36
- padding-right: calc(@progress-line-text-font-size * 3 + 8px);
44
+ .@{progress-prefix-cls}-show-info:not(.@{progress-prefix-cls}-position-bottom) & {
45
+ margin-right: calc(-1 * @progress-line-text-font-size * 2 - 8px);
46
+ padding-right: calc(@progress-line-text-font-size * 2 + 8px);
37
47
  }
38
48
  }
39
49
 
@@ -71,7 +81,7 @@
71
81
  &-text {
72
82
  display: inline-block;
73
83
  box-sizing: border-box;
74
- width: calc(@progress-line-text-font-size*3);
84
+ width: calc(@progress-line-text-font-size*2);
75
85
  margin-left: @progress-line-text-margin-left;
76
86
  // font-size: @progress-line-text-font-size;
77
87
  // line-height: 1;
@@ -85,7 +95,11 @@
85
95
  font-size: @progress-line-special-text-font-size;
86
96
  text-align: center;
87
97
  overflow: hidden;
88
- padding-right: calc(@progress-line-text-font-size*3 + 8px);
98
+ padding-right: calc(@progress-line-text-font-size*2 + 8px);
99
+
100
+ .@{progress-prefix-cls}-position-bottom & {
101
+ padding-right: 0;
102
+ }
89
103
  }
90
104
 
91
105
  &-status-success {