@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
@@ -8,9 +8,6 @@ exports.isValidTimezoneIANAString = isValidTimezoneIANAString;
8
8
  exports.zonedTimeToUtc = exports.utcToZonedTime = exports.toIANA = exports.parse = void 0;
9
9
  var _dateFnsTz = require("date-fns-tz");
10
10
  var _dateFns = require("date-fns");
11
- /* eslint-disable max-len */
12
- /* eslint-disable eqeqeq */
13
-
14
11
  /**
15
12
  * Need to be IANA logo without daylight saving time
16
13
  */
@@ -7,5 +7,4 @@ exports.noop = noop;
7
7
  /**
8
8
  * no operation
9
9
  */
10
- // eslint-disable-next-line @typescript-eslint/no-empty-function
11
10
  function noop() {}
@@ -18,9 +18,6 @@ var _has2 = _interopRequireDefault(require("lodash/has"));
18
18
  var _set2 = _interopRequireDefault(require("lodash/set"));
19
19
  var _get2 = _interopRequireDefault(require("lodash/get"));
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
- /* eslint-disable max-len */
22
- /* argus-disable unPkgSensitiveInfo */
23
-
24
21
  const pathToArrayElem = path => {
25
22
  const pathArray = (0, _toPath2.default)(path);
26
23
  // internal-issues:673
@@ -67,7 +64,6 @@ function cleanup(obj, path) {
67
64
  // lodashRemove(target, (value, index, array) => index > lastIndex);
68
65
  // }
69
66
  // Delete object if its empty
70
- // eslint-disable-next-line
71
67
  if (Array.isArray(target) && target.every(e => e == null)) {
72
68
  (0, _unset2.default)(obj, path);
73
69
  } else if (isEmptyObject(target)) {
@@ -7,11 +7,9 @@ const prefixCls = cssClasses.PREFIX;
7
7
  export default class AnchorFoundation extends BaseFoundation {
8
8
  constructor(adapter) {
9
9
  var _this;
10
- // eslint-disable-next-line @typescript-eslint/no-empty-function
11
10
  super(Object.assign(Object.assign({}, AnchorFoundation.defaultAdapter), adapter));
12
11
  _this = this;
13
12
  this.init = () => {};
14
- // eslint-disable-next-line @typescript-eslint/no-empty-function
15
13
  this.destroy = () => {};
16
14
  this.addLink = link => {
17
15
  this._adapter.addLink(link);
@@ -6,7 +6,6 @@ export default class LinkFoundation extends BaseFoundation {
6
6
  init() {
7
7
  // this.setInitValue();
8
8
  }
9
- // eslint-disable-next-line @typescript-eslint/no-empty-function
10
9
  destroy() {}
11
10
  handleAddLink() {
12
11
  const href = this._adapter.getProp('href');
@@ -2,7 +2,6 @@ import _isObject from "lodash/isObject";
2
2
  import _isUndefined from "lodash/isUndefined";
3
3
  import _isNumber from "lodash/isNumber";
4
4
  import _isString from "lodash/isString";
5
- /* eslint-disable prefer-const, max-len */
6
5
  import BaseFoundation from '../base/foundation';
7
6
  import warning from '../utils/warning';
8
7
  import KeyCode from '../utils/keyCode';
@@ -3,9 +3,7 @@ export default class OptionFoundation extends BaseFoundation {
3
3
  constructor(adapter) {
4
4
  super(Object.assign({}, adapter));
5
5
  }
6
- // eslint-disable-next-line @typescript-eslint/no-empty-function
7
6
  init() {}
8
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9
7
  destroy() {}
10
8
  onOptionClick(option) {
11
9
  const isDisabled = this._isDisabled();
@@ -5,7 +5,6 @@ const cssClasses = {
5
5
  const strings = {
6
6
  SHAPE: ['circle', 'square'],
7
7
  SIZE: ['extra-extra-small', 'extra-small', 'small', 'default', 'medium', 'large', 'extra-large'],
8
- // eslint-disable-next-line max-len
9
8
  COLOR: ['grey', 'red', 'pink', 'purple', 'violet', 'indigo', 'blue', 'light-blue', 'cyan', 'teal', 'green', 'light-green', 'lime', 'yellow', 'amber', 'orange', 'white'],
10
9
  OVERLAP_FROM: ['start', 'end']
11
10
  };
@@ -19,8 +19,8 @@ export default class AvatarFoundation extends BaseFoundation {
19
19
  this._adapter.setFocusVisible(false);
20
20
  };
21
21
  }
22
- init() {} // eslint-disable-line
23
- destroy() {} // eslint-disable-line
22
+ init() {}
23
+ destroy() {}
24
24
  handleImgLoadError() {
25
25
  const {
26
26
  onError
@@ -1,4 +1,3 @@
1
- /* eslint-disable prefer-const */
2
1
  import BaseFoundation from '../base/foundation';
3
2
  import isEnterPress from '../utils/isEnterPress';
4
3
  export default class BreadcrumbFoundation extends BaseFoundation {
@@ -30,7 +30,6 @@
30
30
  display: inline-flex;
31
31
  align-items: center;
32
32
  justify-content: center;
33
- margin: 0;
34
33
  cursor: pointer;
35
34
  user-select: none;
36
35
  border: 0 transparent solid;
@@ -11,7 +11,6 @@ $module: #{$prefix}-button;
11
11
  display: inline-flex;
12
12
  align-items: center;
13
13
  justify-content: center;
14
- margin: 0;
15
14
  cursor: pointer;
16
15
  user-select: none;
17
16
  border: $width-button-border $color-button_primary-border-default solid;
@@ -218,7 +218,6 @@ export const filterEvents = (events, start, end) => {
218
218
  * @returns {arr}
219
219
  * filter out event that is not in the week range
220
220
  */
221
- // eslint-disable-next-line max-len
222
221
  export const filterWeeklyEvents = (events, weekStart, weekStartsOn) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart, {
223
222
  weekStartsOn
224
223
  }), 1));
@@ -282,7 +281,6 @@ export const collectDailyEvents = events => {
282
281
  return collections;
283
282
  };
284
283
  export const renderDailyEvent = event => {
285
- // eslint-disable-next-line prefer-const
286
284
  let {
287
285
  start,
288
286
  end,
@@ -5,7 +5,6 @@ export default class CalendarFoundation extends BaseFoundation {
5
5
  constructor(adapter) {
6
6
  super(Object.assign({}, adapter));
7
7
  }
8
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9
8
  init() {}
10
9
  destroy() {
11
10
  this.raf && cancelAnimationFrame(this.raf);
@@ -13,7 +13,6 @@ import { filter, findAncestorKeys, calcCheckedKeysForUnchecked, calcCheckedKeysF
13
13
  import { convertDataToEntities, findKeysForValues, normalizedArr, isValid, calcMergeType } from './util';
14
14
  import { strings } from './constants';
15
15
  import isEnterPress from '../utils/isEnterPress';
16
- // eslint-disable-next-line max-len
17
16
  export default class CascaderFoundation extends BaseFoundation {
18
17
  constructor(adapter) {
19
18
  super(Object.assign({}, adapter));
@@ -48,7 +47,6 @@ export default class CascaderFoundation extends BaseFoundation {
48
47
  const valueProp = onChangeWithObject ? [] : 'value';
49
48
  if (multiple) {
50
49
  const valuePath = [];
51
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
52
50
  // @ts-ignore
53
51
  item.forEach(checkedKey => {
54
52
  const valuePathItem = this.getItemPropPath(checkedKey, valueProp);
@@ -115,9 +113,7 @@ export default class CascaderFoundation extends BaseFoundation {
115
113
  if (_isEmpty(keyEntities[selectedKey])) {
116
114
  if (_includes(selectedKey, 'not-exist-')) {
117
115
  /* Get the value behind not-exist- */
118
- // eslint-disable-next-line prefer-destructuring
119
116
  const targetValue = selectedKey.match(/not-exist-(\S*)/)[1];
120
- // eslint-disable-next-line max-depth
121
117
  if (_isEmpty(keyEntities[targetValue])) {
122
118
  cacheValue = targetValue;
123
119
  } else {
@@ -805,7 +801,6 @@ export default class CascaderFoundation extends BaseFoundation {
805
801
  return this.getFilteredData();
806
802
  }
807
803
  return Object.values(keyEntities).filter(item => item.parentKey === null && !item._notExist)
808
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
809
804
  // @ts-ignore
810
805
  .sort((a, b) => parseInt(a.ind, 10) - parseInt(b.ind, 10));
811
806
  }
@@ -6,7 +6,6 @@
6
6
  position: relative;
7
7
  display: flex;
8
8
  align-items: flex-start;
9
- flex-wrap: wrap;
10
9
  font-size: 14px;
11
10
  line-height: 20px;
12
11
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
@@ -12,7 +12,6 @@ $module: #{$prefix}-checkbox;
12
12
  position: relative;
13
13
  display: flex;
14
14
  align-items: flex-start;
15
- flex-wrap: wrap;
16
15
  @include font-size-regular;
17
16
  cursor: pointer;
18
17
  transition: background-color $transition_duration-checkbox-bg $transition_function-checkbox-bg $transition_delay-checkbox-bg,
@@ -89,7 +89,6 @@ class CheckboxFoundation extends BaseFoundation {
89
89
  setChecked(checked) {
90
90
  this._adapter.setNativeControlChecked(checked);
91
91
  }
92
- // eslint-disable-next-line @typescript-eslint/no-empty-function
93
92
  destroy() {}
94
93
  }
95
94
  export default CheckboxFoundation;
@@ -59,7 +59,6 @@ class CheckboxGroupFoundation extends BaseFoundation {
59
59
  warning(true, 'Warning: [Semi CheckboxGroup] value should be an Array');
60
60
  }
61
61
  }
62
- // eslint-disable-next-line @typescript-eslint/no-empty-function
63
62
  destroy() {}
64
63
  }
65
64
  export default CheckboxGroupFoundation;
@@ -3,8 +3,6 @@ import _isEqual from "lodash/isEqual";
3
3
  import _isString from "lodash/isString";
4
4
  import _isObject from "lodash/isObject";
5
5
  import _get from "lodash/get";
6
- /* eslint-disable no-nested-ternary */
7
- /* eslint-disable max-len, max-depth, */
8
6
  import { format, isValid, isSameSecond, isEqual as isDateEqual, isDate } from 'date-fns';
9
7
  import BaseFoundation from '../base/foundation';
10
8
  import { isValidDate, isTimestamp } from './_utils/index';
@@ -380,7 +378,6 @@ export default class DatePickerFoundation extends BaseFoundation {
380
378
  * @param {String} input
381
379
  * @param {Event} e
382
380
  */
383
- // eslint-disable-next-line @typescript-eslint/no-empty-function
384
381
  handleInputBlur() {
385
382
  let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
386
383
  let e = arguments.length > 1 ? arguments[1] : undefined;
@@ -433,7 +430,6 @@ export default class DatePickerFoundation extends BaseFoundation {
433
430
  this._adapter.setRangeInputFocus(false);
434
431
  this._adapter.notifyClear(e);
435
432
  }
436
- // eslint-disable-next-line @typescript-eslint/no-empty-function
437
433
  handleRangeInputBlur(value, e) {}
438
434
  // Parses input only after user returns
439
435
  handleInputComplete() {
@@ -2,7 +2,6 @@ import _get from "lodash/get";
2
2
  import _set from "lodash/set";
3
3
  import _isObject from "lodash/isObject";
4
4
  import _cloneDeep from "lodash/cloneDeep";
5
- /* eslint-disable max-len */
6
5
  import { format as formatFn } from 'date-fns';
7
6
  import BaseFoundation from '../base/foundation';
8
7
  import { formatDateValues } from './_utils/formatter';
@@ -19,9 +18,7 @@ export default class InputFoundation extends BaseFoundation {
19
18
  constructor(adapter) {
20
19
  super(Object.assign({}, adapter));
21
20
  }
22
- // eslint-disable-next-line @typescript-eslint/no-empty-function
23
21
  init() {}
24
- // eslint-disable-next-line @typescript-eslint/no-empty-function
25
22
  destroy() {}
26
23
  handleClick(e) {
27
24
  this._adapter.notifyClick(e);
@@ -44,7 +44,6 @@ export default class CalendarMonthFoundation extends BaseFoundation {
44
44
  });
45
45
  this._adapter.setWeekDays(weekdays);
46
46
  }
47
- // eslint-disable-next-line @typescript-eslint/no-empty-function
48
47
  destroy() {}
49
48
  handleClick(day) {
50
49
  this._adapter.notifyDayClick(day);
@@ -1,7 +1,6 @@
1
1
  import _isEqual from "lodash/isEqual";
2
2
  import _isSet from "lodash/isSet";
3
3
  import _includes from "lodash/includes";
4
- /* eslint-disable max-len */
5
4
  import BaseFoundation from '../base/foundation';
6
5
  import { strings } from './constants';
7
6
  import { format, set, addMonths, subMonths, subYears, addYears, differenceInCalendarMonths, differenceInCalendarYears, isSameDay, parseISO } from 'date-fns';
@@ -181,7 +180,6 @@ export default class MonthsGridFoundation extends BaseFoundation {
181
180
  _initDateTimeRangePickerFormValue(values) {
182
181
  this._initDateRangePickerFromValue(values, true);
183
182
  }
184
- // eslint-disable-next-line @typescript-eslint/no-empty-function
185
183
  destroy() {}
186
184
  /**
187
185
  * sync change another panel month when change months from the else yam panel
@@ -6,9 +6,7 @@ export default class YearAndMonthFoundation extends BaseFoundation {
6
6
  constructor(adapter) {
7
7
  super(Object.assign({}, adapter));
8
8
  }
9
- // eslint-disable-next-line @typescript-eslint/no-empty-function
10
9
  init() {}
11
- // eslint-disable-next-line @typescript-eslint/no-empty-function
12
10
  destroy() {}
13
11
  selectYear(item, panelType) {
14
12
  // const year = item.value;
@@ -1,5 +1,5 @@
1
1
  import BaseFoundation from '../base/foundation';
2
- import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
2
+ import { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
4
4
  export type { BaseFormAdapter };
5
5
  export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
@@ -19,7 +19,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
19
19
  validate(fieldPaths?: Array<string>): Promise<unknown>;
20
20
  _formValidate(): Promise<unknown>;
21
21
  _fieldsValidate(fieldPaths: Array<string>): Promise<unknown>;
22
- submit(): void;
22
+ submit(e?: any): void;
23
23
  /**
24
24
  * Case A:
25
25
  * All fields: a[0]、a[1]、b.type、b.name[2]、b.name[0]
@@ -95,6 +95,6 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
95
95
  getFormProps(keys?: Array<string>): ComponentProps;
96
96
  getFieldExist(field: string): boolean;
97
97
  _autoScroll(timeout?: boolean | number): void;
98
- _getErrorFieldAndScroll(scrollOpts?: scrollIntoViewOptions | boolean): void;
99
- scrollToField(field: string, scrollOpts?: scrollIntoViewOptions<any>): void;
98
+ _getErrorFieldAndScroll(scrollOpts?: ScrollIntoViewOptions | boolean): void;
99
+ scrollToField(field: string, scrollOpts?: ScrollIntoViewOptions<any>): void;
100
100
  }
@@ -1,7 +1,6 @@
1
1
  import _toPath from "lodash/toPath";
2
2
  import _isFunction from "lodash/isFunction";
3
3
  import _isUndefined from "lodash/isUndefined";
4
- /* eslint-disable prefer-const, max-len */
5
4
  import BaseFoundation from '../base/foundation';
6
5
  import * as ObjectUtil from '../utils/object';
7
6
  import isPromise from '../utils/isPromise';
@@ -153,13 +152,15 @@ export default class FormFoundation extends BaseFoundation {
153
152
  maybePromisedErrors = errors;
154
153
  }
155
154
  if (!maybePromisedErrors) {
156
- resolve(values);
155
+ const _values = this._adapter.cloneDeep(values);
156
+ resolve(_values);
157
157
  this.injectErrorToField({});
158
158
  } else if (isPromise(maybePromisedErrors)) {
159
159
  maybePromisedErrors.then(result => {
160
160
  // validate success,clear error
161
161
  if (!result) {
162
- resolve(values);
162
+ const _values = this._adapter.cloneDeep(values);
163
+ resolve(_values);
163
164
  this.injectErrorToField({});
164
165
  } else {
165
166
  this.data.errors = result;
@@ -213,7 +214,8 @@ export default class FormFoundation extends BaseFoundation {
213
214
  this._adapter.forceUpdate();
214
215
  const errors = this.getError();
215
216
  if (this._isValid(targetFields)) {
216
- resolve(values);
217
+ const _values = this._adapter.cloneDeep(values);
218
+ resolve(_values);
217
219
  } else {
218
220
  this._autoScroll();
219
221
  reject(errors);
@@ -221,7 +223,7 @@ export default class FormFoundation extends BaseFoundation {
221
223
  });
222
224
  });
223
225
  }
224
- submit() {
226
+ submit(e) {
225
227
  const {
226
228
  values
227
229
  } = this.data;
@@ -229,11 +231,11 @@ export default class FormFoundation extends BaseFoundation {
229
231
  this.validate().then(resolveValues => {
230
232
  // if valid do submit
231
233
  const _values = this._adapter.cloneDeep(resolveValues);
232
- this._adapter.notifySubmit(_values);
234
+ this._adapter.notifySubmit(_values, e);
233
235
  }).catch(errors => {
234
236
  const _errors = this._adapter.cloneDeep(errors);
235
237
  const _values = this._adapter.cloneDeep(values);
236
- this._adapter.notifySubmitFail(_errors, _values);
238
+ this._adapter.notifySubmitFail(_errors, _values, e);
237
239
  });
238
240
  }
239
241
  /**
@@ -1,13 +1,13 @@
1
1
  import { DefaultAdapter } from '../base/foundation';
2
- import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
2
+ import { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
3
3
  export type BasicTriggerType = 'blur' | 'change' | 'custom' | 'mount';
4
4
  export type FieldValidateTriggerType = BasicTriggerType | Array<BasicTriggerType>;
5
5
  export type CommonFieldError = boolean | string | Array<any> | undefined | unknown;
6
6
  export type BasicFieldError = Array<any>;
7
7
  export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any>, Values extends object = any> extends DefaultAdapter<P, S> {
8
8
  cloneDeep: (val: any, ...rest: any[]) => any;
9
- notifySubmit: (values: any) => void;
10
- notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>) => void;
9
+ notifySubmit: (values: any, e?: any) => void;
10
+ notifySubmitFail: (errors: Record<keyof Values, BasicFieldError>, values: Partial<Values>, e?: any) => void;
11
11
  forceUpdate: (callback?: () => void) => void;
12
12
  notifyChange: (formState: FormState) => void;
13
13
  notifyValueChange: (values: any, changedValues: any) => void;
@@ -61,7 +61,7 @@ export interface BaseFormApi<T extends object = any> {
61
61
  getValues: () => T;
62
62
  /** set value of multiple fields */
63
63
  setValues: (fieldsValue: Partial<T>, config?: setValuesConfig) => void;
64
- scrollToField: <K extends keyof T>(field: K, scrollConfig?: scrollIntoViewOptions) => void;
64
+ scrollToField: <K extends keyof T>(field: K, scrollConfig?: ScrollIntoViewOptions) => void;
65
65
  }
66
66
  export interface CallOpts {
67
67
  [x: string]: any;
@@ -7,9 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
7
7
  }
8
8
  return t;
9
9
  };
10
- /* eslint-disable prefer-destructuring */
11
- /* eslint-disable prefer-const */
12
- /* eslint-disable @typescript-eslint/no-unused-vars */
13
10
  import AsyncValidator from 'async-validator';
14
11
  /**
15
12
  *
@@ -109,9 +109,11 @@
109
109
  .semi-image-preview-footer {
110
110
  display: flex;
111
111
  align-items: center;
112
+ }
113
+ .semi-image-preview-footer-content {
112
114
  padding: 0 16px;
113
115
  background: rgba(0, 0, 0, 0.75);
114
- border-radius: 6px;
116
+ border-radius: var(--semi-border-radius-medium);
115
117
  height: 48px;
116
118
  }
117
119
  .semi-image-preview-footer-wrapper {
@@ -123,10 +123,14 @@ $module: #{$prefix}-image;
123
123
  &-footer {
124
124
  display: flex;
125
125
  align-items: center;
126
- padding: $spacing-image_preview_footer-paddingY $spacing-image_preview_footer-paddingX;
127
- background: $color-image_preview_footer-bg;
128
- border-radius: $radius-image_preview_footer;
129
- height: $height-image_preview_footer;
126
+
127
+ &-content {
128
+ padding: $spacing-image_preview_footer-paddingY $spacing-image_preview_footer-paddingX;
129
+ background: $color-image_preview_footer-bg;
130
+ border-radius: $radius-image_preview_footer;
131
+ height: $height-image_preview_footer;
132
+ }
133
+
130
134
 
131
135
  &-wrapper {
132
136
  position: absolute;
@@ -1,11 +1,12 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../base/foundation";
2
+ export type RatioType = "adaptation" | "realSize";
2
3
  export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
3
4
  getIsInGroup: () => boolean;
4
5
  notifyChange: (index: number, direction: string) => void;
5
6
  notifyZoom: (zoom: number, increase: boolean) => void;
6
7
  notifyClose: () => void;
7
8
  notifyVisibleChange: (visible: boolean) => void;
8
- notifyRatioChange: (type: string) => void;
9
+ notifyRatioChange: (type: RatioType) => void;
9
10
  notifyRotateChange: (angle: number) => void;
10
11
  notifyDownload: (src: string, index: number) => void;
11
12
  registerKeyDownListener: () => void;
@@ -21,6 +22,7 @@ export interface PreviewInnerAdapter<P = Record<string, any>, S = Record<string,
21
22
  setMouseActiveTime: (time: number) => void;
22
23
  disabledBodyScroll: () => void;
23
24
  enabledBodyScroll: () => void;
25
+ getSetDownloadFunc: () => (src: string) => string;
24
26
  }
25
27
  export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<PreviewInnerAdapter<P, S>, P, S> {
26
28
  constructor(adapter: PreviewInnerAdapter<P, S>);
@@ -35,7 +37,7 @@ export default class PreviewInnerFoundation<P = Record<string, any>, S = Record<
35
37
  handleSwitchImage: (direction: string) => void;
36
38
  handleDownload: () => void;
37
39
  handlePreviewClose: () => void;
38
- handleAdjustRatio: (type: string) => void;
40
+ handleAdjustRatio: (type: RatioType) => void;
39
41
  handleRotateImage: (direction: string) => void;
40
42
  handleZoomImage: (newZoom: number) => void;
41
43
  preloadGapImage: () => void;
@@ -108,8 +108,9 @@ export default class PreviewInnerFoundation extends BaseFoundation {
108
108
  currentIndex,
109
109
  imgSrc
110
110
  } = this.getStates();
111
+ const setDownloadName = this._adapter.getSetDownloadFunc();
111
112
  const downloadSrc = imgSrc[currentIndex];
112
- const downloadName = downloadSrc.slice(downloadSrc.lastIndexOf("/") + 1);
113
+ const downloadName = setDownloadName ? setDownloadName(downloadSrc) : downloadSrc.slice(downloadSrc.lastIndexOf("/") + 1);
113
114
  downloadImage(downloadSrc, downloadName);
114
115
  this._adapter.notifyDownload(downloadSrc, currentIndex);
115
116
  };
@@ -27,7 +27,7 @@ $height-image_preview_icon: 40px; // 图像预览footer操作区icon高度
27
27
  $height-image_preview_header_close: 30px; // 图像预览header部分的关闭热区高度
28
28
 
29
29
  $radius-image: var(--semi-border-radius-small); // 图像圆角
30
- $radius-image_preview_footer: 6px; // 图像预览footer操作区圆角
30
+ $radius-image_preview_footer: var(--semi-border-radius-medium); // 图像预览footer操作区圆角
31
31
 
32
32
  $color-image_mask-bg: var(--semi-color-overlay-bg); // 图像蒙层背景色
33
33
  $color-image_mask_info_text: var(--semi-color-white); // 图像蒙层文字颜色
@@ -27,7 +27,6 @@ class InputFoundation extends BaseFoundation {
27
27
  this._timer = null;
28
28
  }
29
29
  }
30
- // eslint-disable-next-line
31
30
  setDisable() {}
32
31
  _setInitValue() {
33
32
  const {
@@ -107,7 +106,6 @@ class InputFoundation extends BaseFoundation {
107
106
  if (_isNumber(maxLength) && maxLength >= 0 && _isFunction(getValueLength) && _isString(value)) {
108
107
  const valueLength = getValueLength(value);
109
108
  if (valueLength > maxLength) {
110
- // eslint-disable-next-line max-len
111
109
  console.warn('[Semi Input] The input character is truncated because the input length exceeds the maximum length limit');
112
110
  const truncatedValue = this.handleTruncateValue(value, maxLength);
113
111
  return truncatedValue;
@@ -48,7 +48,6 @@ export default class TextAreaFoundation extends BaseFoundation {
48
48
  init() {
49
49
  this.setInitValue();
50
50
  }
51
- // eslint-disable-next-line
52
51
  destroy() {}
53
52
  setInitValue() {
54
53
  const {
@@ -120,7 +119,6 @@ export default class TextAreaFoundation extends BaseFoundation {
120
119
  if (_isNumber(maxLength) && maxLength >= 0 && _isFunction(getValueLength) && _isString(value)) {
121
120
  const valueLength = getValueLength(value);
122
121
  if (valueLength > maxLength) {
123
- // eslint-disable-next-line max-len
124
122
  console.warn('[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit');
125
123
  const truncatedValue = this.handleTruncateValue(value, maxLength);
126
124
  return truncatedValue;
@@ -2,9 +2,6 @@ import _isString from "lodash/isString";
2
2
  import _get from "lodash/get";
3
3
  import _toString from "lodash/toString";
4
4
  import _toNumber from "lodash/toNumber";
5
- /* eslint-disable max-len */
6
- /* eslint-disable no-param-reassign */
7
- /* eslint-disable eqeqeq */
8
5
  import BaseFoundation from '../base/foundation';
9
6
  import keyCode from '../utils/keyCode';
10
7
  import { numbers } from './constants';
@@ -131,7 +128,6 @@ class InputNumberFoundation extends BaseFoundation {
131
128
  const dotBeginStr = dotIndex > -1 ? valueAfterParser.slice(dotIndex) : '';
132
129
  formattedNum += dotBeginStr;
133
130
  } else if (precLength < lengthAfterDot) {
134
- // eslint-disable-next-line max-depth
135
131
  for (let i = 0; i < lengthAfterDot - precLength; i++) {
136
132
  formattedNum += '0';
137
133
  }
@@ -199,7 +195,6 @@ class InputNumberFoundation extends BaseFoundation {
199
195
  }
200
196
 
201
197
  if (willSetNum != null) {
202
- // eslint-disable-next-line max-depth
203
198
  if (!this._isControlledComponent('value')) {
204
199
  this._adapter.setNumber(willSetNum);
205
200
  }
@@ -6,9 +6,7 @@ export const DEFAULT_TOGGLE_ICON = {
6
6
  export default class NavItem {
7
7
  constructor() {
8
8
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
- // eslint-disable-next-line eqeqeq
10
9
  if (options == null || typeof options !== 'object') {
11
- // eslint-disable-next-line no-param-reassign
12
10
  options = {
13
11
  text: options,
14
12
  itemKey: options,
@@ -1,6 +1,4 @@
1
1
  import _get from "lodash/get";
2
- /* eslint-disable max-depth */
3
- /* eslint-disable max-len */
4
2
  import BaseFoundation from '../base/foundation';
5
3
  import NavItem from './NavItem';
6
4
  import { strings } from './constants';
@@ -158,7 +156,7 @@ export default class NavigationFoundation extends BaseFoundation {
158
156
  }
159
157
  return [...willOpenKeySet];
160
158
  }
161
- destroy() {} // eslint-disable-line
159
+ destroy() {}
162
160
  selectLevelZeroParentKeys(itemKeysMap) {
163
161
  const _itemKeysMap = isNullOrUndefined(itemKeysMap) ? this.getState('itemKeysMap') : itemKeysMap;
164
162
  // console.log(itemKeysMap);
@@ -14,7 +14,6 @@ export default class ItemFoundation extends BaseFoundation {
14
14
  this._mounted = false;
15
15
  }
16
16
  isValidKey(itemKey) {
17
- // eslint-disable-next-line eqeqeq
18
17
  return itemKey != null && (typeof itemKey === 'string' || typeof itemKey === 'number');
19
18
  }
20
19
  handleClick(e) {
@@ -26,7 +26,7 @@ export default class SubNavFoundation extends BaseFoundation {
26
26
  // this.log('invoke SubNavFoundation init()');
27
27
  this._timer = null;
28
28
  }
29
- destroy() {} // eslint-disable-line
29
+ destroy() {}
30
30
  clearDelayTimer() {
31
31
  if (this._timer) {
32
32
  clearTimeout(this._timer);
@@ -34,7 +34,6 @@ export default class SubNavFoundation extends BaseFoundation {
34
34
  }
35
35
  }
36
36
  isValidKey(itemKey) {
37
- // eslint-disable-next-line eqeqeq
38
37
  return itemKey != null && (typeof itemKey === 'number' || typeof itemKey === 'string');
39
38
  }
40
39
  handleDropdownVisibleChange(visible) {
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-useless-constructor */
2
1
  import BaseFoundation from '../base/foundation';
3
2
  export default class NotificationListFoundation extends BaseFoundation {
4
3
  addNotice(opts) {