@douyinfe/semi-foundation 2.40.0-alpha.0 → 2.40.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.
Files changed (225) hide show
  1. package/anchor/foundation.ts +0 -2
  2. package/anchor/linkFoundation.ts +0 -1
  3. package/autoComplete/foundation.ts +0 -1
  4. package/autoComplete/optionFoundation.ts +0 -2
  5. package/avatar/constants.ts +21 -4
  6. package/avatar/foundation.ts +3 -3
  7. package/base/foundation.ts +0 -1
  8. package/breadcrumb/foundation.ts +0 -1
  9. package/button/button.scss +0 -1
  10. package/calendar/eventUtil.ts +0 -2
  11. package/calendar/foundation.ts +0 -1
  12. package/cascader/foundation.ts +0 -5
  13. package/checkbox/checkbox.scss +0 -1
  14. package/checkbox/checkboxFoundation.ts +1 -2
  15. package/checkbox/checkboxGroupFoundation.ts +0 -1
  16. package/datePicker/foundation.ts +1 -4
  17. package/datePicker/inputFoundation.ts +0 -3
  18. package/datePicker/monthFoundation.ts +0 -1
  19. package/datePicker/monthsGridFoundation.ts +0 -2
  20. package/datePicker/yearAndMonthFoundation.ts +0 -2
  21. package/form/foundation.ts +12 -10
  22. package/form/interface.ts +4 -5
  23. package/form/utils.ts +0 -3
  24. package/image/image.scss +8 -4
  25. package/image/previewImageFoundation.ts +1 -1
  26. package/image/previewInnerFoundation.ts +11 -7
  27. package/image/variables.scss +1 -1
  28. package/input/foundation.ts +0 -2
  29. package/input/textareaFoundation.ts +0 -2
  30. package/inputNumber/foundation.ts +0 -5
  31. package/lib/cjs/anchor/foundation.js +0 -2
  32. package/lib/cjs/anchor/linkFoundation.js +0 -1
  33. package/lib/cjs/autoComplete/foundation.js +0 -2
  34. package/lib/cjs/autoComplete/optionFoundation.js +0 -2
  35. package/lib/cjs/avatar/constants.js +0 -1
  36. package/lib/cjs/avatar/foundation.js +2 -2
  37. package/lib/cjs/breadcrumb/foundation.js +0 -2
  38. package/lib/cjs/button/button.css +0 -1
  39. package/lib/cjs/button/button.scss +0 -1
  40. package/lib/cjs/calendar/eventUtil.js +0 -2
  41. package/lib/cjs/calendar/foundation.js +0 -1
  42. package/lib/cjs/cascader/foundation.js +0 -5
  43. package/lib/cjs/checkbox/checkbox.css +0 -1
  44. package/lib/cjs/checkbox/checkbox.scss +0 -1
  45. package/lib/cjs/checkbox/checkboxFoundation.js +0 -1
  46. package/lib/cjs/checkbox/checkboxGroupFoundation.js +0 -1
  47. package/lib/cjs/datePicker/foundation.js +0 -5
  48. package/lib/cjs/datePicker/inputFoundation.js +0 -4
  49. package/lib/cjs/datePicker/monthFoundation.js +0 -1
  50. package/lib/cjs/datePicker/monthsGridFoundation.js +0 -3
  51. package/lib/cjs/datePicker/yearAndMonthFoundation.js +0 -2
  52. package/lib/cjs/form/foundation.d.ts +4 -4
  53. package/lib/cjs/form/foundation.js +9 -8
  54. package/lib/cjs/form/interface.d.ts +4 -4
  55. package/lib/cjs/form/utils.js +0 -3
  56. package/lib/cjs/image/image.css +3 -1
  57. package/lib/cjs/image/image.scss +8 -4
  58. package/lib/cjs/image/previewInnerFoundation.d.ts +4 -2
  59. package/lib/cjs/image/previewInnerFoundation.js +2 -1
  60. package/lib/cjs/image/variables.scss +1 -1
  61. package/lib/cjs/input/foundation.js +0 -2
  62. package/lib/cjs/input/textareaFoundation.js +0 -2
  63. package/lib/cjs/inputNumber/foundation.js +0 -6
  64. package/lib/cjs/navigation/NavItem.js +0 -2
  65. package/lib/cjs/navigation/foundation.js +1 -4
  66. package/lib/cjs/navigation/itemFoundation.js +0 -1
  67. package/lib/cjs/navigation/subNavFoundation.js +1 -2
  68. package/lib/cjs/notification/notificationListFoundation.js +0 -2
  69. package/lib/cjs/pagination/foundation.d.ts +2 -0
  70. package/lib/cjs/pagination/foundation.js +16 -4
  71. package/lib/cjs/popconfirm/popconfirmFoundation.js +0 -2
  72. package/lib/cjs/radio/radio.css +1 -0
  73. package/lib/cjs/radio/radio.scss +1 -0
  74. package/lib/cjs/radio/radioGroupFoundation.js +0 -1
  75. package/lib/cjs/radio/radioInnerFoundation.js +0 -1
  76. package/lib/cjs/radio/variables.scss +1 -0
  77. package/lib/cjs/rating/foundation.js +0 -2
  78. package/lib/cjs/select/foundation.js +0 -5
  79. package/lib/cjs/select/optionFoundation.js +0 -2
  80. package/lib/cjs/select/select.css +0 -35
  81. package/lib/cjs/select/select.scss +11 -63
  82. package/lib/cjs/select/variables.scss +0 -10
  83. package/lib/cjs/skeleton/skeleton.css +2 -2
  84. package/lib/cjs/skeleton/variables.scss +2 -2
  85. package/lib/cjs/slider/foundation.js +0 -8
  86. package/lib/cjs/switch/foundation.js +0 -1
  87. package/lib/cjs/table/bodyFoundation.js +0 -1
  88. package/lib/cjs/table/constants.js +0 -2
  89. package/lib/cjs/table/foundation.js +0 -9
  90. package/lib/cjs/table/tableRowFoundation.js +0 -1
  91. package/lib/cjs/table/utils.js +0 -4
  92. package/lib/cjs/tag/constants.js +0 -2
  93. package/lib/cjs/tagInput/foundation.js +0 -2
  94. package/lib/cjs/timePicker/foundation.js +6 -8
  95. package/lib/cjs/timePicker/inputFoundation.js +0 -2
  96. package/lib/cjs/timePicker/utils/index.js +2 -2
  97. package/lib/cjs/tooltip/foundation.js +0 -11
  98. package/lib/cjs/transfer/foundation.js +0 -1
  99. package/lib/cjs/tree/foundation.js +0 -1
  100. package/lib/cjs/tree/treeUtil.js +0 -9
  101. package/lib/cjs/treeSelect/foundation.js +0 -1
  102. package/lib/cjs/upload/foundation.js +3 -1
  103. package/lib/cjs/utils/Event.js +0 -1
  104. package/lib/cjs/utils/date-fns-extra.js +0 -3
  105. package/lib/cjs/utils/function.js +0 -1
  106. package/lib/cjs/utils/object.js +0 -4
  107. package/lib/es/anchor/foundation.js +0 -2
  108. package/lib/es/anchor/linkFoundation.js +0 -1
  109. package/lib/es/autoComplete/foundation.js +0 -1
  110. package/lib/es/autoComplete/optionFoundation.js +0 -2
  111. package/lib/es/avatar/constants.js +0 -1
  112. package/lib/es/avatar/foundation.js +2 -2
  113. package/lib/es/breadcrumb/foundation.js +0 -1
  114. package/lib/es/button/button.css +0 -1
  115. package/lib/es/button/button.scss +0 -1
  116. package/lib/es/calendar/eventUtil.js +0 -2
  117. package/lib/es/calendar/foundation.js +0 -1
  118. package/lib/es/cascader/foundation.js +0 -5
  119. package/lib/es/checkbox/checkbox.css +0 -1
  120. package/lib/es/checkbox/checkbox.scss +0 -1
  121. package/lib/es/checkbox/checkboxFoundation.js +0 -1
  122. package/lib/es/checkbox/checkboxGroupFoundation.js +0 -1
  123. package/lib/es/datePicker/foundation.js +0 -4
  124. package/lib/es/datePicker/inputFoundation.js +0 -3
  125. package/lib/es/datePicker/monthFoundation.js +0 -1
  126. package/lib/es/datePicker/monthsGridFoundation.js +0 -2
  127. package/lib/es/datePicker/yearAndMonthFoundation.js +0 -2
  128. package/lib/es/form/foundation.d.ts +4 -4
  129. package/lib/es/form/foundation.js +9 -7
  130. package/lib/es/form/interface.d.ts +4 -4
  131. package/lib/es/form/utils.js +0 -3
  132. package/lib/es/image/image.css +3 -1
  133. package/lib/es/image/image.scss +8 -4
  134. package/lib/es/image/previewInnerFoundation.d.ts +4 -2
  135. package/lib/es/image/previewInnerFoundation.js +2 -1
  136. package/lib/es/image/variables.scss +1 -1
  137. package/lib/es/input/foundation.js +0 -2
  138. package/lib/es/input/textareaFoundation.js +0 -2
  139. package/lib/es/inputNumber/foundation.js +0 -5
  140. package/lib/es/navigation/NavItem.js +0 -2
  141. package/lib/es/navigation/foundation.js +1 -3
  142. package/lib/es/navigation/itemFoundation.js +0 -1
  143. package/lib/es/navigation/subNavFoundation.js +1 -2
  144. package/lib/es/notification/notificationListFoundation.js +0 -1
  145. package/lib/es/pagination/foundation.d.ts +2 -0
  146. package/lib/es/pagination/foundation.js +16 -3
  147. package/lib/es/popconfirm/popconfirmFoundation.js +0 -1
  148. package/lib/es/radio/radio.css +1 -0
  149. package/lib/es/radio/radio.scss +1 -0
  150. package/lib/es/radio/radioGroupFoundation.js +0 -1
  151. package/lib/es/radio/radioInnerFoundation.js +0 -1
  152. package/lib/es/radio/variables.scss +1 -0
  153. package/lib/es/rating/foundation.js +0 -1
  154. package/lib/es/select/foundation.js +0 -5
  155. package/lib/es/select/optionFoundation.js +0 -2
  156. package/lib/es/select/select.css +0 -35
  157. package/lib/es/select/select.scss +11 -63
  158. package/lib/es/select/variables.scss +0 -10
  159. package/lib/es/skeleton/skeleton.css +2 -2
  160. package/lib/es/skeleton/variables.scss +2 -2
  161. package/lib/es/slider/foundation.js +0 -7
  162. package/lib/es/switch/foundation.js +0 -1
  163. package/lib/es/table/bodyFoundation.js +0 -1
  164. package/lib/es/table/constants.js +0 -1
  165. package/lib/es/table/foundation.js +0 -8
  166. package/lib/es/table/tableRowFoundation.js +0 -1
  167. package/lib/es/table/utils.js +0 -3
  168. package/lib/es/tag/constants.js +0 -1
  169. package/lib/es/tagInput/foundation.js +0 -2
  170. package/lib/es/timePicker/foundation.js +6 -7
  171. package/lib/es/timePicker/inputFoundation.js +0 -2
  172. package/lib/es/timePicker/utils/index.js +2 -1
  173. package/lib/es/tooltip/foundation.js +0 -10
  174. package/lib/es/transfer/foundation.js +0 -1
  175. package/lib/es/tree/foundation.js +0 -1
  176. package/lib/es/tree/treeUtil.js +0 -9
  177. package/lib/es/treeSelect/foundation.js +0 -1
  178. package/lib/es/upload/foundation.js +3 -1
  179. package/lib/es/utils/Event.js +0 -1
  180. package/lib/es/utils/date-fns-extra.js +0 -2
  181. package/lib/es/utils/function.js +0 -1
  182. package/lib/es/utils/object.js +0 -3
  183. package/modal/modalFoundation.ts +3 -4
  184. package/navigation/NavItem.ts +0 -2
  185. package/navigation/foundation.ts +1 -3
  186. package/navigation/itemFoundation.ts +0 -1
  187. package/navigation/subNavFoundation.ts +1 -2
  188. package/notification/notificationListFoundation.ts +0 -2
  189. package/package.json +3 -3
  190. package/pagination/foundation.ts +13 -3
  191. package/popconfirm/popconfirmFoundation.ts +0 -1
  192. package/radio/radio.scss +1 -0
  193. package/radio/radioGroupFoundation.ts +0 -1
  194. package/radio/radioInnerFoundation.ts +0 -1
  195. package/radio/variables.scss +1 -0
  196. package/rating/foundation.ts +0 -1
  197. package/select/foundation.ts +0 -5
  198. package/select/optionFoundation.ts +0 -2
  199. package/select/select.scss +11 -63
  200. package/select/variables.scss +0 -10
  201. package/skeleton/variables.scss +2 -2
  202. package/slider/foundation.ts +0 -7
  203. package/switch/foundation.ts +0 -1
  204. package/table/bodyFoundation.ts +0 -1
  205. package/table/constants.ts +0 -1
  206. package/table/foundation.ts +0 -8
  207. package/table/tableRowFoundation.ts +0 -1
  208. package/table/utils.ts +0 -3
  209. package/tag/constants.ts +19 -2
  210. package/tagInput/foundation.ts +0 -2
  211. package/timePicker/foundation.ts +7 -8
  212. package/timePicker/inputFoundation.ts +0 -2
  213. package/timePicker/utils/index.ts +2 -1
  214. package/toast/toastFoundation.ts +1 -4
  215. package/toast/toastListFoundation.ts +0 -1
  216. package/tooltip/foundation.ts +0 -10
  217. package/transfer/foundation.ts +0 -1
  218. package/tree/foundation.ts +0 -1
  219. package/tree/treeUtil.ts +1 -10
  220. package/treeSelect/foundation.ts +0 -1
  221. package/upload/foundation.ts +3 -1
  222. package/utils/Event.ts +0 -1
  223. package/utils/date-fns-extra.ts +0 -2
  224. package/utils/function.ts +0 -1
  225. package/utils/object.ts +0 -3
@@ -25,7 +25,6 @@ function isValid(val) {
25
25
  * @param filteredShownKeys
26
26
  * need expanded keys, provides `true` means all expanded
27
27
  */
28
- // eslint-disable-next-line max-len
29
28
  export function flattenTreeData(treeNodeList, expandedKeys) {
30
29
  let filteredShownKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
31
30
  const flattenList = [];
@@ -48,7 +47,6 @@ export function flattenTreeData(treeNodeList, expandedKeys) {
48
47
  flattenList.push(flattenNode);
49
48
  }
50
49
  // Loop treeNode children
51
- // eslint-disable-next-line max-len
52
50
  if (expandedKeys.has(mergedKey) && (!filterSearch || !isBooleanFilteredShownKeys && filteredShownKeys.has(mergedKey))) {
53
51
  flattenNode.children = flatten(treeNode.children || [], flattenNode);
54
52
  } else {
@@ -345,7 +343,6 @@ export function calcExpandedKeys() {
345
343
  return new Set(keyList);
346
344
  }
347
345
  /* Calculate the expanded node by value */
348
- // eslint-disable-next-line max-len
349
346
  export function calcExpandedKeysForValues(value, keyEntities, isMultiple, valueEntities) {
350
347
  const keys = findKeysForValues(value, valueEntities, isMultiple);
351
348
  return new Set(findAncestorKeys(keys, keyEntities, false));
@@ -453,7 +450,6 @@ export function getMotionKeys(eventKey, expandedKeys, keyEntities) {
453
450
  getChild(eventKey);
454
451
  return res;
455
452
  }
456
- // eslint-disable-next-line max-len
457
453
  export function calcCheckedKeysForChecked(key, keyEntities, checkedKeys, halfCheckedKeys) {
458
454
  const descendantKeys = findDescendantKeys([key], keyEntities, true);
459
455
  const nodeItem = keyEntities[key];
@@ -462,12 +458,10 @@ export function calcCheckedKeysForChecked(key, keyEntities, checkedKeys, halfChe
462
458
  if (!node.parent) {
463
459
  return;
464
460
  }
465
- // eslint-disable-next-line @typescript-eslint/no-shadow
466
461
  const {
467
462
  key
468
463
  } = node;
469
464
  const siblingKeys = findSiblingKeys([key], keyEntities);
470
- // eslint-disable-next-line @typescript-eslint/no-shadow
471
465
  const allChecked = siblingKeys.every(key => checkedKeys.has(key));
472
466
  if (!allChecked) {
473
467
  const ancestorKeys = findAncestorKeys([key], keyEntities, false);
@@ -484,7 +478,6 @@ export function calcCheckedKeysForChecked(key, keyEntities, checkedKeys, halfChe
484
478
  halfCheckedKeys
485
479
  };
486
480
  }
487
- // eslint-disable-next-line max-len
488
481
  export function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedKeys) {
489
482
  const descendantKeys = findDescendantKeys([key], keyEntities, true);
490
483
  const nodeItem = keyEntities[key];
@@ -507,12 +500,10 @@ export function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfC
507
500
  return;
508
501
  }
509
502
  // Has a parent node, and the parent node is checked or halfChecked
510
- // eslint-disable-next-line @typescript-eslint/no-shadow
511
503
  const {
512
504
  key
513
505
  } = node;
514
506
  const siblingKeys = findSiblingKeys([key], keyEntities);
515
- // eslint-disable-next-line @typescript-eslint/no-shadow
516
507
  const anyChecked = siblingKeys.some(key => checkedKeys.has(key) || halfCheckedKeys.has(key));
517
508
  const ancestorKeys = findAncestorKeys([key], keyEntities, false);
518
509
  // If there is checked or halfChecked in the sibling node, you need to change the parent node to halfChecked
@@ -10,7 +10,6 @@ import { strings } from '../treeSelect/constants';
10
10
  import BaseFoundation from '../base/foundation';
11
11
  import { flattenTreeData, findDescendantKeys, findAncestorKeys, filter, normalizedArr, normalizeKeyList, getMotionKeys, calcCheckedKeysForChecked, calcCheckedKeys, calcCheckedKeysForUnchecked, getValueOrKey } from '../tree/treeUtil';
12
12
  import isEnterPress from '../utils/isEnterPress';
13
- // eslint-disable-next-line max-len
14
13
  export default class TreeSelectFoundation extends BaseFoundation {
15
14
  constructor(adapter) {
16
15
  super(Object.assign({}, adapter));
@@ -223,7 +223,9 @@ class UploadFoundation extends BaseFoundation {
223
223
  });
224
224
  this._adapter.updateFileList(newFileList, () => {
225
225
  this._adapter.resetReplaceInput();
226
- this.upload(newFileItem);
226
+ if (!newFileItem._sizeInvalid) {
227
+ this.upload(newFileItem);
228
+ }
227
229
  });
228
230
  }
229
231
  buildFileItem(fileInstance, uploadTrigger) {
@@ -26,7 +26,6 @@ export default class Event {
26
26
  const callbacks = this._eventMap.get(event);
27
27
  if (Array.isArray(callbacks) && callbacks.length) {
28
28
  let index = -1;
29
- // eslint-disable-next-line max-depth
30
29
  while ((index = callbacks.findIndex(cb => cb === callback)) > -1) {
31
30
  callbacks.splice(index, 1);
32
31
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable max-len */
2
- /* eslint-disable eqeqeq */
3
1
  import { toDate, format as dateFnsFormat, utcToZonedTime as dateFnsUtcToZonedTime, zonedTimeToUtc as dateFnsZonedTimeToUtc } from 'date-fns-tz';
4
2
  import { parse as dateFnsParse } from 'date-fns';
5
3
  /**
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * no operation
3
3
  */
4
- // eslint-disable-next-line @typescript-eslint/no-empty-function
5
4
  export function noop() {}
@@ -6,8 +6,6 @@ import _toPath from "lodash/toPath";
6
6
  import _has from "lodash/has";
7
7
  import _set from "lodash/set";
8
8
  import _get from "lodash/get";
9
- /* eslint-disable max-len */
10
- /* argus-disable unPkgSensitiveInfo */
11
9
  const pathToArrayElem = path => {
12
10
  const pathArray = _toPath(path);
13
11
  // internal-issues:673
@@ -54,7 +52,6 @@ function cleanup(obj, path) {
54
52
  // lodashRemove(target, (value, index, array) => index > lastIndex);
55
53
  // }
56
54
  // Delete object if its empty
57
- // eslint-disable-next-line
58
55
  if (Array.isArray(target) && target.every(e => e == null)) {
59
56
  _unset(obj, path);
60
57
  } else if (isEmptyObject(target)) {
@@ -60,8 +60,8 @@ export interface ModalProps {
60
60
  export interface ModalState {
61
61
  displayNone: boolean;
62
62
  isFullScreen: boolean;
63
- onOKReturnPromiseStatus?:"pending"|"fulfilled"|"rejected";
64
- onCancelReturnPromiseStatus?:"pending"|"fulfilled"|"rejected"
63
+ onOKReturnPromiseStatus?: "pending"|"fulfilled"|"rejected";
64
+ onCancelReturnPromiseStatus?: "pending"|"fulfilled"|"rejected"
65
65
  }
66
66
 
67
67
  export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
@@ -91,7 +91,7 @@ export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
91
91
 
92
92
  handleOk(e: any) {
93
93
  const result = this._adapter.notifyOk(e);
94
- if (isPromise(result)){
94
+ if (isPromise(result)) {
95
95
  this._adapter.setState({ onOKReturnPromiseStatus: "pending" });
96
96
  (result as Promise<any>)?.then(()=>{
97
97
  this._adapter.setState({ onOKReturnPromiseStatus: "fulfilled" });
@@ -121,7 +121,6 @@ export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
121
121
  };
122
122
 
123
123
 
124
- // // eslint-disable-next-line max-len
125
124
  // mergeMotionProp = (motion: Motion, prop: string, cb: () => void) => {
126
125
  // const mergedMotion = typeof (motion) === 'undefined' || motion ? {
127
126
  // ...(motion as { [key: string]: (() => void) | boolean }),
@@ -9,9 +9,7 @@ export default class NavItem {
9
9
  items: any[];
10
10
  toggleIcon: any;
11
11
  constructor(options: any = {}) {
12
- // eslint-disable-next-line eqeqeq
13
12
  if (options == null || typeof options !== 'object') {
14
- // eslint-disable-next-line no-param-reassign
15
13
  options = {
16
14
  text: options,
17
15
  itemKey: options,
@@ -1,5 +1,3 @@
1
- /* eslint-disable max-depth */
2
- /* eslint-disable max-len */
3
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
4
2
  import NavItem from './NavItem';
5
3
  import { ItemProps } from './itemFoundation';
@@ -199,7 +197,7 @@ export default class NavigationFoundation<P = Record<string, any>, S = Record<st
199
197
  return [...willOpenKeySet];
200
198
  }
201
199
 
202
- destroy() {} // eslint-disable-line
200
+ destroy() {}
203
201
 
204
202
  selectLevelZeroParentKeys(itemKeysMap: ItemKey2ParentKeysMap, ...itemKeys: (string | number)[]) {
205
203
  const _itemKeysMap = isNullOrUndefined(itemKeysMap) ? this.getState('itemKeysMap') : itemKeysMap;
@@ -60,7 +60,6 @@ export default class ItemFoundation<P = Record<string, any>, S = Record<string,
60
60
  }
61
61
 
62
62
  isValidKey(itemKey: string) {
63
- // eslint-disable-next-line eqeqeq
64
63
  return itemKey != null && (typeof itemKey === 'string' || typeof itemKey === 'number');
65
64
  }
66
65
 
@@ -52,7 +52,7 @@ export default class SubNavFoundation<P = Record<string, any>, S = Record<string
52
52
  this._timer = null;
53
53
  }
54
54
 
55
- destroy() {} // eslint-disable-line
55
+ destroy() {}
56
56
 
57
57
  clearDelayTimer() {
58
58
  if (this._timer) {
@@ -62,7 +62,6 @@ export default class SubNavFoundation<P = Record<string, any>, S = Record<string
62
62
  }
63
63
 
64
64
  isValidKey(itemKey: string | number) {
65
- // eslint-disable-next-line eqeqeq
66
65
  return itemKey != null && (typeof itemKey === 'number' || typeof itemKey === 'string');
67
66
  }
68
67
 
@@ -1,10 +1,8 @@
1
- /* eslint-disable no-useless-constructor */
2
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
3
2
  import { NoticeInstance, NoticePosition, NoticeProps } from '../notification/notificationFoundation';
4
3
  import { strings } from './constants';
5
4
 
6
5
 
7
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
8
6
  export interface NotificationListProps {
9
7
 
10
8
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.40.0-alpha.0",
3
+ "version": "2.40.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.40.0-alpha.0",
10
+ "@douyinfe/semi-animation": "2.40.0",
11
11
  "async-validator": "^3.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "date-fns": "^2.29.3",
@@ -23,7 +23,7 @@
23
23
  "*.scss",
24
24
  "*.css"
25
25
  ],
26
- "gitHead": "3c30c680ff8335f275dce40e16c8994af178ca78",
26
+ "gitHead": "d73b400df9309f0c545a82da4534ce5a7a311a92",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -1,5 +1,3 @@
1
- /* eslint-disable max-len */
2
- /* eslint-disable no-param-reassign */
3
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
4
2
  import { numbers } from './constants';
5
3
 
@@ -9,6 +7,7 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
9
7
  updateTotal: (total: number) => void;
10
8
  updatePageSize: (pageSize: number) => void;
11
9
  updateQuickJumpPage: (quickJumpPage: string | number) => void;
10
+ updateAllPageNumbers: (allPageNumbers: number[]) => void;
12
11
  setCurrentPage: (pageIndex: number) => void;
13
12
  registerKeyDownHandler: (handler: KeyDownHandler) => void;
14
13
  unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
@@ -104,6 +103,18 @@ class PaginationFoundation<P = Record<string, any>, S = Record<string, any>> ext
104
103
  this._adapter.updatePageSize(pageSize);
105
104
  }
106
105
 
106
+ updateAllPageNumbers(total: number, pageSize: number) {
107
+ // only need to update in small size
108
+
109
+ const { size, hoverShowPageSelect, disabled } = this.getProps();
110
+ if (size !== 'small' || !hoverShowPageSelect || disabled) {
111
+ return;
112
+ } else {
113
+ const pageNumbers = Array.from({ length: Math.ceil(total / pageSize) }, (v, i) => i + 1);
114
+ this._adapter.updateAllPageNumbers(pageNumbers);
115
+ }
116
+ }
117
+
107
118
  goPrev() {
108
119
  const { currentPage } = this.getStates();
109
120
  if (currentPage > 1) {
@@ -203,7 +214,6 @@ class PaginationFoundation<P = Record<string, any>, S = Record<string, any>> ext
203
214
  }
204
215
 
205
216
  // TODO handle tab/enter events
206
- // eslint-disable-next-line @typescript-eslint/no-empty-function
207
217
  handleKeyDown() {
208
218
  }
209
219
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-empty-function */
2
1
 
3
2
  import { get } from 'lodash';
4
3
 
package/radio/radio.scss CHANGED
@@ -241,6 +241,7 @@ $inner-width: $width-icon-medium;
241
241
  &-content {
242
242
  display: flex;
243
243
  flex-direction: column;
244
+ row-gap: $spacing-radio_content-rowGap;
244
245
  }
245
246
 
246
247
  &:hover {
@@ -69,6 +69,5 @@ export default class RadioGroupFoundation extends BaseFoundation<RadioGroupAdapt
69
69
  this._adapter.setValue(value);
70
70
  }
71
71
 
72
- // eslint-disable-next-line @typescript-eslint/no-empty-function
73
72
  destroy() {}
74
73
  }
@@ -60,6 +60,5 @@ export default class RadioInnerFoundation extends BaseFoundation<RadioInnerAdapt
60
60
  }
61
61
  }
62
62
 
63
- // eslint-disable-next-line @typescript-eslint/no-empty-function
64
63
  destroy() {}
65
64
  }
@@ -77,6 +77,7 @@ $spacing-radio_addon_buttonRadio_middle-paddingX: $spacing-base; // 中尺寸按
77
77
  $spacing-radio_addon_buttonRadio_middle-paddingY: $spacing-extra-tight; // 中尺寸按钮式单选按钮垂直内边距
78
78
  $spacing-radio_addon_buttonRadio_marginLeft: $spacing-none; // 按钮式单选按钮左侧外边距
79
79
  $spacing-radio_extra-paddingLeft: $width-radio_inner + $spacing-tight; // 单选副标题左侧内边距
80
+ $spacing-radio_content-rowGap: 4px; // 内容行间距
80
81
 
81
82
  $spacing-radio_group_vertical-marginBottom: $spacing-base-tight; // 垂直布局单选框组底部外边距
82
83
  $spacing-radio_card_group_vertical-marginBottom: $spacing-base; // 垂直布局卡片式单选框组底部外边距
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
3
2
  import warning from '../utils/warning';
4
3
 
@@ -1,5 +1,3 @@
1
- /* argus-disable unPkgSensitiveInfo */
2
- /* eslint-disable max-len */
3
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
4
2
  import { isNumber, isString, isEqual, omit } from 'lodash';
5
3
  import KeyCode, { ENTER_KEY } from '../utils/keyCode';
@@ -66,7 +64,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
66
64
  }
67
65
 
68
66
  // keyboard event listner
69
- // eslint-disable-next-line @typescript-eslint/member-ordering
70
67
  _keydownHandler: (...arg: any[]) => void | null = null;
71
68
 
72
69
  init() {
@@ -896,7 +893,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
896
893
  index = index - 1;
897
894
  targetLabel = keys[index];
898
895
  targetItem = selections.get(targetLabel);
899
- // eslint-disable-next-line
900
896
  if (index == 0 && targetItem.disabled) {
901
897
  isAllDisabled = true;
902
898
  }
@@ -938,7 +934,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
938
934
  }
939
935
 
940
936
  _removeInternalKey(option: BasicOptionProps) {
941
- // eslint-disable-next-line
942
937
  let newOption = { ...option };
943
938
  delete newOption._parentGroup;
944
939
  delete newOption._show;
@@ -22,10 +22,8 @@ export default class OptionFoundation extends BaseFoundation<OptionDefaultAdapte
22
22
  super({ ...adapter });
23
23
  }
24
24
 
25
- // eslint-disable-next-line @typescript-eslint/no-empty-function
26
25
  init() {}
27
26
 
28
- // eslint-disable-next-line @typescript-eslint/no-empty-function
29
27
  destroy() {}
30
28
 
31
29
  onOptionClick(option: BasicOptionProps) {
@@ -40,7 +40,7 @@ $overflowList: #{$prefix}-overflow-list;
40
40
  outline: 0;
41
41
  }
42
42
 
43
- &:active {
43
+ &:active{
44
44
  background-color: $color-select-bg-active;
45
45
  }
46
46
 
@@ -52,7 +52,6 @@ $overflowList: #{$prefix}-overflow-list;
52
52
  &-large {
53
53
  min-height: $height-select_large;
54
54
  line-height: $height-select_large;
55
-
56
55
  .#{$module}-selection {
57
56
  @include font-size-header-6;
58
57
  }
@@ -197,7 +196,6 @@ $overflowList: #{$prefix}-overflow-list;
197
196
 
198
197
  .#{$prefix}-tag-group {
199
198
  height: inherit;
200
-
201
199
  .#{$prefix}-tag {
202
200
  @include select-tag-margin;
203
201
  }
@@ -328,7 +326,6 @@ $overflowList: #{$prefix}-overflow-list;
328
326
  width: $width-select_clear-icon;
329
327
  color: $color-select_clearBtn-text-default;
330
328
  flex-shrink: 0;
331
-
332
329
  &:hover {
333
330
  color: $color-select_clearBtn-text-hover;
334
331
  }
@@ -438,7 +435,6 @@ $overflowList: #{$prefix}-overflow-list;
438
435
  .#{$module}-option-list {
439
436
  overflow-x: hidden;
440
437
  overflow-y: auto;
441
-
442
438
  &-chosen {
443
439
  .#{$module}-option-icon {
444
440
  display: flex;
@@ -479,84 +475,36 @@ $overflowList: #{$prefix}-overflow-list;
479
475
 
480
476
  .#{$module}-borderless {
481
477
 
482
- &:not(:focus-within):not(:hover) {
483
- background-color: $color-select_borderless-bg-default;
484
- border-color: $color-select_borderless-border-default;
485
-
478
+ &:not(:focus-within):not(:hover){
479
+ background-color:transparent;
480
+ border-color: transparent;
486
481
  .#{$module}-arrow {
487
482
  opacity: 0;
488
483
  }
489
-
490
- &.#{$module}-borderless-arrow {
491
- .#{$module}-arrow {
492
- opacity: 1;
493
- }
494
- }
495
484
  }
496
485
 
497
- &:hover {
498
- background-color: $color-select_borderless-bg-hover;
499
- border: $width-select-border-hover solid $color-select_borderless-border-hover;
500
- }
501
-
502
- &:focus {
503
- border: $width-select-border-focus solid $color-select_borderless-border-focus;
504
- background-color: $color-select_borderless-bg-focus;
505
- outline: 0;
506
- }
507
-
508
- &:active {
509
- background-color: $color-select_borderless-bg-active;
510
- }
511
-
512
- &:focus-within:not(:active) {
513
- background-color: transparent;
514
- }
515
-
516
- &.#{$module}-disabled {
517
- background-color: $color-select_borderless_input_disabled-bg;
518
-
519
- &:hover {
520
- background-color: $color-select_borderless_input_disabled-bg;
521
- }
522
-
523
- .#{$module}-selection,
524
- .#{$module}-selection-placeholder {
525
- color: $color-select_borderless_input_disabled-text;
526
- }
527
-
528
- .#{$module}-prefix,
529
- .#{$module}-suffix {
530
- color: $color-select_borderless_input_disabled-text;
531
- }
532
-
533
- .#{$module}-arrow {
534
- color: $color-select_borderless_input_disabled-text;
535
- }
536
-
537
- .#{$prefix}-tag {
538
- color: $color-select_borderless_input_disabled-text;
539
- }
486
+ &:focus-within:not(:active){
487
+ background-color:transparent;
540
488
  }
541
489
 
542
490
  // split style into not and normal to avoid style override
543
- &.#{$module}-error:not(:focus-within) {
491
+ &.#{$module}-error:not(:focus-within){
544
492
  border-color: $color-select_danger-border-focus;
545
493
  }
546
494
 
547
- &.#{$module}-warning:not(:focus-within) {
495
+ &.#{$module}-warning:not(:focus-within){
548
496
  border-color: $color-select_warning-border-focus;
549
497
  }
550
498
 
551
- &.#{$module}-error:focus-within {
499
+ &.#{$module}-error:focus-within{
552
500
  border-color: $color-select_danger-border-focus;
553
501
  }
554
502
 
555
- &.#{$module}-warning:focus-within {
503
+ &.#{$module}-warning:focus-within{
556
504
  border-color: $color-select_warning-border-focus;
557
505
  }
558
506
 
559
507
  }
560
508
 
561
509
 
562
- @import './rtl.scss';
510
+ @import './rtl.scss';
@@ -47,16 +47,6 @@ $color-select_option-border-default: var(--semi-color-border); // 分组选择
47
47
  $color-select_inset_label-text: var(--semi-color-text-2); // 分组选择器菜单项辅助文本颜色
48
48
  $color-select_create_tips-text: var(--semi-color-text-2); // 分组选择器菜单项提示文本颜色
49
49
  $color-select_group-text: var(--semi-color-text-2); // 分组选择器菜单项分组标题文本颜色
50
- $color-select_borderless-bg-default: transparent; // borderless 选择器输入框背景色 - 默认态
51
- $color-select_borderless-bg-hover: var(--semi-color-fill-1); // borderless 选择器输入框背景色 - 悬停态
52
- $color-select_borderless-bg-active: var(--semi-color-fill-2); // borderless 选择器输入框背景色 - 按下态
53
- $color-select_borderless-bg-focus: var(--semi-color-fill-0); // borderless 选择器输入框背景色 - 聚焦态
54
- $color-select_borderless-border-default: transparent; // borderless 选择器输入框边框颜色 - 默认态
55
- $color-select_borderless-border-hover: $color-select-border-default; // borderless 选择器输入框边框颜色 - 悬停态
56
- $color-select_borderless-border-active: var(--semi-color-focus-border); // borderless 选择器输入框边框颜色 - 按下态
57
- $color-select_borderless-border-focus: $color-select-border-active; // borderless 选择器输入框边框颜色 - 聚焦态
58
- $color-select_borderless_input_disabled-text: var(--semi-color-disabled-text); // borderless 选择器输入框文本颜色 - 禁用态
59
- $color-select_borderless_input_disabled-bg: var(--semi-color-disabled-fill); // borderless 禁用选择器输入框背景色 - 禁用态
60
50
 
61
51
  // Width/Height
62
52
  $width-select_icon_right: ($width-icon-medium + $spacing-tight * 2); // 选择器右侧图标大小
@@ -15,6 +15,6 @@ $height-skeleton_button: $height-control-default; // 按钮骨架屏高度
15
15
 
16
16
  $spacing-skeleton_li-marginBottom: 10px; // 按钮骨架屏高度
17
17
 
18
- $radius-skeleton_item: 4px; // 骨架屏圆角
19
- $radius-skeleton_li: 4px; // 骨架屏圆角
18
+ $radius-skeleton_item: var(--semi-border-radius-small); // 骨架屏圆角
19
+ $radius-skeleton_li: var(--semi-border-radius-small); // 骨架屏圆角
20
20
 
@@ -1,6 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
- /* eslint-disable max-len */
3
- /* eslint-disable no-nested-ternary */
4
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
5
2
  import touchEventPolyfill from '../utils/touchPolyfill';
6
3
  import warning from '../utils/warning';
@@ -269,7 +266,6 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
269
266
  startPos = vertical ? sliderY : sliderX;
270
267
  }
271
268
  // startPos = chooseMovePos === 'max' && isDrag ? currentPos[0] : startPos;
272
- // eslint-disable-next-line one-var
273
269
  let endPos;
274
270
  if (vertical && verticalReverse) {
275
271
  endPos = sliderY;
@@ -314,8 +310,6 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
314
310
  } else {
315
311
  stepValue = ((pos - startPos) / len) * (max - min) + min;
316
312
  }
317
- // debugger
318
- // eslint-disable-next-line one-var
319
313
  let compareValue;
320
314
  if (range) {
321
315
  compareValue = isMin ? currentValue[0] : currentValue[1];
@@ -680,7 +674,6 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
680
674
  }
681
675
  }
682
676
 
683
- // eslint-disable-next-line @typescript-eslint/no-empty-function
684
677
  onFocus = (e: any, handler: 'min'| 'max') => {
685
678
  handlePrevent(e);
686
679
  const { target } = e;
@@ -53,6 +53,5 @@ export default class SwitchFoundation<P = Record<string, any>, S = Record<string
53
53
  this._adapter.setFocusVisible(false);
54
54
  }
55
55
 
56
- // eslint-disable-next-line @typescript-eslint/no-empty-function
57
56
  destroy(): void {}
58
57
  }
@@ -32,7 +32,6 @@ export default class TableBodyFoundation<P = Record<string, any>, S = Record<str
32
32
 
33
33
  if (!isObject(newExpandRelatedProps) && !newExpandRelatedProps) {
34
34
  const expandRelatedProps = strings.EXPAND_RELATED_PROPS;
35
- // eslint-disable-next-line no-param-reassign
36
35
  newExpandRelatedProps = expandRelatedProps.map(key => get(props, key, undefined));
37
36
  }
38
37
  this._adapter.setCachedExpandRelatedProps(newExpandRelatedProps);
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-len */
2
1
  import { BASE_CLASS_PREFIX } from '../base/constants';
3
2
 
4
3
  const cssClasses = {
@@ -1,10 +1,3 @@
1
- /* eslint-disable prefer-destructuring */
2
- /* eslint-disable max-depth */
3
- /* eslint-disable max-nested-callbacks */
4
- /* eslint-disable max-len */
5
- /* eslint-disable no-param-reassign */
6
- /* eslint-disable eqeqeq */
7
- /* eslint-disable @typescript-eslint/no-empty-function */
8
1
  import {
9
2
  get,
10
3
  merge,
@@ -1040,7 +1033,6 @@ class TableFoundation<RecordType> extends BaseFoundation<TableAdapter<RecordType
1040
1033
  let filterObj: BaseColumnProps<RecordType> = this.getQuery(dataIndex);
1041
1034
  const filterDropdownVisible = visible;
1042
1035
 
1043
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1044
1036
  filterObj = { ...filterObj, filterDropdownVisible };
1045
1037
 
1046
1038
  if (!this._filterShowIsControlled()) {
@@ -8,7 +8,6 @@ export interface TableRowAdapter<P = Record<string, any>, S = Record<string, any
8
8
  notifyMouseLeave: (record: Record<string, any>, e: any) => void
9
9
  }
10
10
 
11
- // eslint-disable-next-line max-len
12
11
  export default class TableRowFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TableRowAdapter<P, S>, P, S> {
13
12
  handleClick(e: any) {
14
13
  const { expanded, rowKey } = this.getProps();
package/table/utils.ts CHANGED
@@ -1,6 +1,3 @@
1
- /* eslint-disable max-len */
2
- /* eslint-disable no-param-reassign */
3
- /* eslint-disable eqeqeq */
4
1
  import {
5
2
  isEqualWith,
6
3
  get,