@douyinfe/semi-ui 2.17.0 → 2.19.0-alpha.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 (179) hide show
  1. package/anchor/index.tsx +1 -1
  2. package/anchor/link.tsx +3 -4
  3. package/autoComplete/__test__/autoComplete.test.js +6 -6
  4. package/autoComplete/index.tsx +3 -1
  5. package/autoComplete/option.tsx +164 -0
  6. package/calendar/__test__/calendar.test.js +21 -2
  7. package/calendar/_story/calendar.stories.js +31 -0
  8. package/calendar/index.tsx +3 -1
  9. package/calendar/interface.ts +2 -1
  10. package/carousel/index.tsx +5 -5
  11. package/checkbox/checkbox.tsx +10 -2
  12. package/dist/css/semi.css +174 -29
  13. package/dist/css/semi.min.css +1 -1
  14. package/dist/umd/semi-ui.js +4190 -5430
  15. package/dist/umd/semi-ui.js.map +1 -1
  16. package/dist/umd/semi-ui.min.js +1 -1
  17. package/dist/umd/semi-ui.min.js.map +1 -1
  18. package/form/_story/FieldProps/labelOptional.jsx +30 -0
  19. package/form/_story/form.stories.js +7 -0
  20. package/form/hoc/withField.tsx +1 -0
  21. package/form/label.tsx +21 -7
  22. package/gulpfile.js +3 -1
  23. package/lib/cjs/_base/base.css +35 -0
  24. package/lib/cjs/anchor/index.js +2 -1
  25. package/lib/cjs/anchor/link.d.ts +1 -1
  26. package/lib/cjs/anchor/link.js +9 -5
  27. package/lib/cjs/autoComplete/index.d.ts +1 -1
  28. package/lib/cjs/autoComplete/index.js +6 -3
  29. package/lib/cjs/autoComplete/option.d.ts +50 -0
  30. package/lib/cjs/autoComplete/option.js +218 -0
  31. package/lib/cjs/calendar/index.d.ts +2 -0
  32. package/lib/cjs/calendar/index.js +3 -1
  33. package/lib/cjs/calendar/interface.d.ts +2 -1
  34. package/lib/cjs/carousel/index.js +2 -2
  35. package/lib/cjs/checkbox/checkbox.d.ts +4 -0
  36. package/lib/cjs/checkbox/checkbox.js +9 -3
  37. package/lib/cjs/form/hoc/withField.js +2 -1
  38. package/lib/cjs/form/label.d.ts +8 -5
  39. package/lib/cjs/form/label.js +15 -4
  40. package/lib/cjs/locale/interface.d.ts +3 -0
  41. package/lib/cjs/locale/source/ar.js +3 -0
  42. package/lib/cjs/locale/source/de.js +3 -0
  43. package/lib/cjs/locale/source/en_GB.js +3 -0
  44. package/lib/cjs/locale/source/en_US.js +3 -0
  45. package/lib/cjs/locale/source/es.js +3 -0
  46. package/lib/cjs/locale/source/fr.js +3 -0
  47. package/lib/cjs/locale/source/id_ID.js +3 -0
  48. package/lib/cjs/locale/source/it.js +3 -0
  49. package/lib/cjs/locale/source/ja_JP.js +3 -0
  50. package/lib/cjs/locale/source/ko_KR.js +3 -0
  51. package/lib/cjs/locale/source/ms_MY.js +3 -0
  52. package/lib/cjs/locale/source/pt_BR.js +3 -0
  53. package/lib/cjs/locale/source/ru_RU.js +3 -0
  54. package/lib/cjs/locale/source/th_TH.js +3 -0
  55. package/lib/cjs/locale/source/tr_TR.js +3 -0
  56. package/lib/cjs/locale/source/vi_VN.js +3 -0
  57. package/lib/cjs/locale/source/zh_CN.js +3 -0
  58. package/lib/cjs/locale/source/zh_TW.js +3 -0
  59. package/lib/cjs/modal/Modal.js +0 -8
  60. package/lib/cjs/modal/ModalContent.js +4 -1
  61. package/lib/cjs/radio/radio.d.ts +2 -0
  62. package/lib/cjs/radio/radio.js +33 -8
  63. package/lib/cjs/table/ColumnFilter.js +4 -2
  64. package/lib/cjs/table/ColumnSorter.d.ts +1 -0
  65. package/lib/cjs/table/ColumnSorter.js +9 -6
  66. package/lib/cjs/table/Table.js +11 -4
  67. package/lib/cjs/tag/group.d.ts +3 -0
  68. package/lib/cjs/tag/group.js +24 -6
  69. package/lib/cjs/tag/index.d.ts +2 -1
  70. package/lib/cjs/tag/index.js +7 -5
  71. package/lib/cjs/tag/interface.d.ts +2 -1
  72. package/lib/cjs/tree/index.d.ts +3 -1
  73. package/lib/cjs/tree/index.js +23 -0
  74. package/lib/cjs/tree/interface.d.ts +4 -0
  75. package/lib/cjs/tree/treeNode.d.ts +4 -1
  76. package/lib/cjs/tree/treeNode.js +13 -4
  77. package/lib/es/_base/base.css +35 -0
  78. package/lib/es/anchor/index.js +2 -1
  79. package/lib/es/anchor/link.d.ts +1 -1
  80. package/lib/es/anchor/link.js +9 -5
  81. package/lib/es/autoComplete/index.d.ts +1 -1
  82. package/lib/es/autoComplete/index.js +6 -3
  83. package/lib/es/autoComplete/option.d.ts +50 -0
  84. package/lib/es/autoComplete/option.js +188 -0
  85. package/lib/es/calendar/index.d.ts +2 -0
  86. package/lib/es/calendar/index.js +3 -1
  87. package/lib/es/calendar/interface.d.ts +2 -1
  88. package/lib/es/carousel/index.js +2 -2
  89. package/lib/es/checkbox/checkbox.d.ts +4 -0
  90. package/lib/es/checkbox/checkbox.js +10 -4
  91. package/lib/es/form/hoc/withField.js +2 -1
  92. package/lib/es/form/label.d.ts +8 -5
  93. package/lib/es/form/label.js +13 -4
  94. package/lib/es/locale/interface.d.ts +3 -0
  95. package/lib/es/locale/source/ar.js +3 -0
  96. package/lib/es/locale/source/de.js +3 -0
  97. package/lib/es/locale/source/en_GB.js +3 -0
  98. package/lib/es/locale/source/en_US.js +3 -0
  99. package/lib/es/locale/source/es.js +3 -0
  100. package/lib/es/locale/source/fr.js +3 -0
  101. package/lib/es/locale/source/id_ID.js +3 -0
  102. package/lib/es/locale/source/it.js +3 -0
  103. package/lib/es/locale/source/ja_JP.js +3 -0
  104. package/lib/es/locale/source/ko_KR.js +3 -0
  105. package/lib/es/locale/source/ms_MY.js +3 -0
  106. package/lib/es/locale/source/pt_BR.js +3 -0
  107. package/lib/es/locale/source/ru_RU.js +3 -0
  108. package/lib/es/locale/source/th_TH.js +3 -0
  109. package/lib/es/locale/source/tr_TR.js +3 -0
  110. package/lib/es/locale/source/vi_VN.js +3 -0
  111. package/lib/es/locale/source/zh_CN.js +3 -0
  112. package/lib/es/locale/source/zh_TW.js +3 -0
  113. package/lib/es/modal/Modal.js +0 -8
  114. package/lib/es/modal/ModalContent.js +4 -1
  115. package/lib/es/radio/radio.d.ts +2 -0
  116. package/lib/es/radio/radio.js +31 -8
  117. package/lib/es/table/ColumnFilter.js +4 -2
  118. package/lib/es/table/ColumnSorter.d.ts +1 -0
  119. package/lib/es/table/ColumnSorter.js +9 -6
  120. package/lib/es/table/Table.js +10 -4
  121. package/lib/es/tag/group.d.ts +3 -0
  122. package/lib/es/tag/group.js +24 -6
  123. package/lib/es/tag/index.d.ts +2 -1
  124. package/lib/es/tag/index.js +7 -5
  125. package/lib/es/tag/interface.d.ts +2 -1
  126. package/lib/es/tree/index.d.ts +3 -1
  127. package/lib/es/tree/index.js +22 -0
  128. package/lib/es/tree/interface.d.ts +4 -0
  129. package/lib/es/tree/treeNode.d.ts +4 -1
  130. package/lib/es/tree/treeNode.js +13 -4
  131. package/locale/interface.ts +3 -0
  132. package/locale/source/ar.ts +3 -0
  133. package/locale/source/de.ts +3 -0
  134. package/locale/source/en_GB.ts +3 -0
  135. package/locale/source/en_US.ts +3 -0
  136. package/locale/source/es.ts +3 -0
  137. package/locale/source/fr.ts +3 -0
  138. package/locale/source/id_ID.ts +3 -0
  139. package/locale/source/it.ts +3 -0
  140. package/locale/source/ja_JP.ts +3 -0
  141. package/locale/source/ko_KR.ts +3 -0
  142. package/locale/source/ms_MY.ts +3 -0
  143. package/locale/source/pt_BR.ts +3 -0
  144. package/locale/source/ru_RU.ts +3 -0
  145. package/locale/source/th_TH.ts +3 -0
  146. package/locale/source/tr_TR.ts +4 -1
  147. package/locale/source/vi_VN.ts +3 -0
  148. package/locale/source/zh_CN.ts +3 -0
  149. package/locale/source/zh_TW.ts +3 -0
  150. package/modal/Modal.tsx +0 -6
  151. package/modal/ModalContent.tsx +4 -1
  152. package/modal/__test__/modal.test.js +1 -1
  153. package/modal/_story/__snapshots__/modal.stories.tsx.snap +203 -0
  154. package/package.json +7 -7
  155. package/radio/_story/radio.stories.js +2 -2
  156. package/radio/radio.tsx +27 -5
  157. package/rating/__test__/rating.test.js +1 -1
  158. package/select/__test__/select.test.js +11 -17
  159. package/select/_story/select.stories.js +6 -6
  160. package/steps/_story/steps.stories.js +3 -3
  161. package/switch/_story/switch.stories.js +4 -4
  162. package/switch/_story/switch.stories.tsx +4 -4
  163. package/table/ColumnFilter.tsx +2 -1
  164. package/table/ColumnSorter.tsx +16 -10
  165. package/table/Table.tsx +7 -4
  166. package/table/_story/v2/FixedFilter/index.tsx +106 -0
  167. package/table/_story/v2/FixedSorter/index.tsx +102 -0
  168. package/table/_story/v2/index.js +4 -2
  169. package/tag/_story/tag.stories.js +57 -1
  170. package/tag/group.tsx +20 -3
  171. package/tag/index.tsx +6 -5
  172. package/tag/interface.ts +2 -1
  173. package/transfer/_story/transfer.stories.js +2 -2
  174. package/tree/_story/tree.stories.js +152 -3
  175. package/tree/index.tsx +16 -1
  176. package/tree/interface.ts +6 -0
  177. package/tree/treeNode.tsx +11 -5
  178. package/upload/_story/upload.stories.js +2 -2
  179. package/webpack.config.js +13 -3
@@ -18,6 +18,7 @@ declare class Calendar extends BaseComponent<CalendarProps, {}> {
18
18
  }>[]>;
19
19
  mode: PropTypes.Requireable<string>;
20
20
  showCurrTime: PropTypes.Requireable<boolean>;
21
+ weekStartsOn: PropTypes.Requireable<number>;
21
22
  scrollTop: PropTypes.Requireable<number>;
22
23
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
23
24
  renderTimeDisplay: PropTypes.Requireable<(...args: any[]) => any>;
@@ -35,6 +36,7 @@ declare class Calendar extends BaseComponent<CalendarProps, {}> {
35
36
  markWeekend: boolean;
36
37
  height: number;
37
38
  scrollTop: number;
39
+ weekStartsOn: number;
38
40
  };
39
41
  render(): React.FunctionComponentElement<any>;
40
42
  }
@@ -54,6 +54,7 @@ Calendar.propTypes = {
54
54
  })),
55
55
  mode: PropTypes.string,
56
56
  showCurrTime: PropTypes.bool,
57
+ weekStartsOn: PropTypes.number,
57
58
  scrollTop: PropTypes.number,
58
59
  onClick: PropTypes.func,
59
60
  renderTimeDisplay: PropTypes.func,
@@ -70,6 +71,7 @@ Calendar.defaultProps = {
70
71
  mode: 'week',
71
72
  markWeekend: false,
72
73
  height: 600,
73
- scrollTop: 400
74
+ scrollTop: 400,
75
+ weekStartsOn: 0
74
76
  };
75
77
  export default Calendar;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { EventObject } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
2
+ import { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
3
3
  import { strings } from '@douyinfe/semi-foundation/lib/es/calendar/constants';
4
4
  import { ArrayElement } from '../_base/base';
5
5
  import { BaseProps } from '../_base/baseComponent';
@@ -10,6 +10,7 @@ export interface CalendarProps extends BaseProps {
10
10
  events?: EventObject[];
11
11
  mode?: ArrayElement<typeof strings.MODE>;
12
12
  showCurrTime?: boolean;
13
+ weekStartsOn?: weeekStartsOnEnum;
13
14
  scrollTop?: number;
14
15
  onClick?: (e: React.MouseEvent, value: Date) => void;
15
16
  onClose?: (e: React.MouseEvent) => void;
@@ -41,7 +41,7 @@ class Carousel extends BaseComponent {
41
41
  };
42
42
 
43
43
  this.handleAutoPlay = () => {
44
- if (!this.foundation.getIsControledComponent()) {
44
+ if (!this.foundation.getIsControlledComponent()) {
45
45
  this.foundation.handleAutoPlay();
46
46
  }
47
47
  };
@@ -61,7 +61,7 @@ class Carousel extends BaseComponent {
61
61
  autoPlay
62
62
  } = this.props;
63
63
 
64
- if ((typeof autoPlay !== 'object' || autoPlay.hoverToPause) && !this.foundation.getIsControledComponent()) {
64
+ if ((typeof autoPlay !== 'object' || autoPlay.hoverToPause) && !this.foundation.getIsControlledComponent()) {
65
65
  this.foundation.handleAutoPlay();
66
66
  }
67
67
  };
@@ -5,6 +5,7 @@ import CheckboxInner from './checkboxInner';
5
5
  import BaseComponent from '../_base/baseComponent';
6
6
  import '@douyinfe/semi-foundation/lib/es/checkbox/checkbox.css';
7
7
  import { CheckboxContextType } from './context';
8
+ import { CheckboxType } from './checkboxGroup';
8
9
  export declare type CheckboxEvent = BasicCheckboxEvent;
9
10
  export declare type TargetObject = BasicTargetObject;
10
11
  export interface CheckboxProps extends BaseCheckboxProps {
@@ -24,6 +25,7 @@ export interface CheckboxProps extends BaseCheckboxProps {
24
25
  tabIndex?: number;
25
26
  addonId?: string;
26
27
  extraId?: string;
28
+ type?: CheckboxType;
27
29
  }
28
30
  interface CheckboxState {
29
31
  checked: boolean;
@@ -55,6 +57,7 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
55
57
  'aria-label': PropTypes.Requireable<string>;
56
58
  tabIndex: PropTypes.Requireable<number>;
57
59
  preventScroll: PropTypes.Requireable<boolean>;
60
+ type: PropTypes.Requireable<string>;
58
61
  };
59
62
  static defaultProps: {
60
63
  defaultChecked: boolean;
@@ -62,6 +65,7 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
62
65
  onChange: (...args: any[]) => void;
63
66
  onMouseEnter: (...args: any[]) => void;
64
67
  onMouseLeave: (...args: any[]) => void;
68
+ type: string;
65
69
  };
66
70
  checkboxEntity: CheckboxInner;
67
71
  context: CheckboxContextType;
@@ -8,7 +8,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
8
8
  import React from 'react';
9
9
  import PropTypes from 'prop-types';
10
10
  import classnames from 'classnames';
11
- import { checkboxClasses as css } from '@douyinfe/semi-foundation/lib/es/checkbox/constants';
11
+ import { checkboxClasses as css, strings } from '@douyinfe/semi-foundation/lib/es/checkbox/constants';
12
12
  import CheckboxFoundation from '@douyinfe/semi-foundation/lib/es/checkbox/checkboxFoundation';
13
13
  import CheckboxInner from './checkboxInner';
14
14
  import BaseComponent from '../_base/baseComponent';
@@ -126,7 +126,8 @@ class Checkbox extends BaseComponent {
126
126
  value,
127
127
  role,
128
128
  tabIndex,
129
- id
129
+ id,
130
+ type
130
131
  } = this.props;
131
132
  const {
132
133
  checked,
@@ -160,6 +161,9 @@ class Checkbox extends BaseComponent {
160
161
  props.isCardType = isCardType;
161
162
  props.isPureCardType = isPureCardType;
162
163
  props['name'] = this.context.checkboxGroup.name;
164
+ } else {
165
+ props.isPureCardType = type === strings.TYPE_PURECARD;
166
+ props.isCardType = type === strings.TYPE_CARD || props.isPureCardType;
163
167
  }
164
168
 
165
169
  const prefix = prefixCls || css.PREFIX;
@@ -250,13 +254,15 @@ Checkbox.propTypes = {
250
254
  index: PropTypes.number,
251
255
  'aria-label': PropTypes.string,
252
256
  tabIndex: PropTypes.number,
253
- preventScroll: PropTypes.bool
257
+ preventScroll: PropTypes.bool,
258
+ type: PropTypes.string
254
259
  };
255
260
  Checkbox.defaultProps = {
256
261
  defaultChecked: false,
257
262
  indeterminate: false,
258
263
  onChange: _noop,
259
264
  onMouseEnter: _noop,
260
- onMouseLeave: _noop
265
+ onMouseLeave: _noop,
266
+ type: 'default'
261
267
  };
262
268
  export default Checkbox;
@@ -99,7 +99,8 @@ function withField(Component, opts) {
99
99
  if (arrayFieldState) {
100
100
  initVal = arrayFieldState.shouldUseInitValue && typeof initValue !== 'undefined' ? initValue : initValueInFormOpts;
101
101
  }
102
- } catch (err) {}
102
+ } catch (err) {} // FIXME typeof initVal
103
+
103
104
 
104
105
  const [value, setValue, getVal] = useStateWithGetter(typeof initVal !== undefined ? initVal : null);
105
106
 
@@ -1,22 +1,23 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  export interface LabelProps {
4
+ /** text-align of label */
5
+ align?: string;
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ disabled?: boolean;
4
9
  id?: string;
5
10
  /** Whether to display the required * symbol */
6
11
  required?: boolean;
7
12
  /** Content of label */
8
13
  text?: React.ReactNode;
9
- disabled?: boolean;
10
14
  /** Used to configure the htmlFor attribute of the label tag */
11
15
  name?: string;
12
- /** text-align of label */
13
- align?: string;
14
16
  /** width of label */
15
17
  width?: number | string;
16
18
  style?: React.CSSProperties;
17
- className?: string;
18
- children?: React.ReactNode;
19
19
  extra?: React.ReactNode;
20
+ optional?: boolean;
20
21
  }
21
22
  export default class Label extends PureComponent<LabelProps> {
22
23
  static defaultProps: {
@@ -24,6 +25,7 @@ export default class Label extends PureComponent<LabelProps> {
24
25
  name: string;
25
26
  align: string;
26
27
  className: string;
28
+ optional: boolean;
27
29
  };
28
30
  static propTypes: {
29
31
  id: PropTypes.Requireable<string>;
@@ -37,6 +39,7 @@ export default class Label extends PureComponent<LabelProps> {
37
39
  style: PropTypes.Requireable<object>;
38
40
  className: PropTypes.Requireable<string>;
39
41
  extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
42
+ optional: PropTypes.Requireable<boolean>;
40
43
  };
41
44
  render(): JSX.Element;
42
45
  }
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import { cssClasses } from '@douyinfe/semi-foundation/lib/es/form/constants';
5
+ import LocaleConsumer from '../locale/localeConsumer';
5
6
  const prefixCls = cssClasses.PREFIX;
6
7
  export default class Label extends PureComponent {
7
8
  render() {
@@ -16,7 +17,8 @@ export default class Label extends PureComponent {
16
17
  style,
17
18
  className,
18
19
  extra,
19
- id
20
+ id,
21
+ optional
20
22
  } = this.props;
21
23
  const labelCls = classNames(className, {
22
24
  ["".concat(prefixCls, "-field-label")]: true,
@@ -28,10 +30,15 @@ export default class Label extends PureComponent {
28
30
  });
29
31
  const labelStyle = style ? style : {};
30
32
  width ? labelStyle.width = width : null;
33
+ const optionalText = /*#__PURE__*/React.createElement(LocaleConsumer, {
34
+ componentName: "Form"
35
+ }, locale => /*#__PURE__*/React.createElement("span", {
36
+ className: "".concat(prefixCls, "-field-label-optional-text")
37
+ }, locale.optional));
31
38
  const textContent = /*#__PURE__*/React.createElement("div", {
32
39
  className: "".concat(prefixCls, "-field-label-text"),
33
40
  "x-semi-prop": "label"
34
- }, typeof text !== 'undefined' ? text : children);
41
+ }, typeof text !== 'undefined' ? text : children, optional ? optionalText : null);
35
42
  const contentWithExtra = /*#__PURE__*/React.createElement(React.Fragment, null, textContent, /*#__PURE__*/React.createElement("div", {
36
43
  className: "".concat(prefixCls, "-field-label-extra")
37
44
  }, extra));
@@ -48,7 +55,8 @@ Label.defaultProps = {
48
55
  required: false,
49
56
  name: '',
50
57
  align: 'left',
51
- className: ''
58
+ className: '',
59
+ optional: false
52
60
  };
53
61
  Label.propTypes = {
54
62
  id: PropTypes.string,
@@ -61,5 +69,6 @@ Label.propTypes = {
61
69
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
62
70
  style: PropTypes.object,
63
71
  className: PropTypes.string,
64
- extra: PropTypes.node
72
+ extra: PropTypes.node,
73
+ optional: PropTypes.bool
65
74
  };
@@ -148,4 +148,7 @@ export interface Locale {
148
148
  total: string;
149
149
  selected: string;
150
150
  };
151
+ Form: {
152
+ optional: string;
153
+ };
151
154
  }
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'إلغاء تحديد الكل',
148
148
  total: 'مجموع ${total} العناصر',
149
149
  selected: '${total} العناصر المحدد'
150
+ },
151
+ Form: {
152
+ optional: '(اختياري)'
150
153
  }
151
154
  }; // [i18n-Arabic]
152
155
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Alles abwählen',
148
148
  total: 'Gesamt ${total} Artikel',
149
149
  selected: '${total} ausgewählte Artikel'
150
+ },
151
+ Form: {
152
+ optional: '(Optional)'
150
153
  }
151
154
  }; // [i18n-German]
152
155
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Unselect all',
148
148
  total: 'Total ${total} items',
149
149
  selected: '${total} items selected'
150
+ },
151
+ Form: {
152
+ optional: '(optional)'
150
153
  }
151
154
  }; // [i18n-English(GB)]
152
155
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Unselect all',
148
148
  total: 'Total ${total} items',
149
149
  selected: '${total} items selected'
150
+ },
151
+ Form: {
152
+ optional: '(optional)'
150
153
  }
151
154
  }; // [i18n-English(US)]
152
155
 
@@ -152,6 +152,9 @@ const locale = {
152
152
  clearSelectAll: 'Deseleccionar todo',
153
153
  total: 'Total ${total} objetos',
154
154
  selected: '${total} objetos seleccionados'
155
+ },
156
+ Form: {
157
+ optional: '(opcional)'
155
158
  }
156
159
  };
157
160
  export default locale;
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Désélectionner tout',
148
148
  total: 'Totale ${total} articles',
149
149
  selected: '${total} articles sélectionnés'
150
+ },
151
+ Form: {
152
+ optional: '(optionnel)'
150
153
  }
151
154
  }; // [i18n-French]
152
155
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Nyahpilih Semua',
148
148
  total: 'Total ${total} proyek',
149
149
  selected: '${total} item dipilih'
150
+ },
151
+ Form: {
152
+ optional: '(opsional)'
150
153
  }
151
154
  }; // [i18n-Indonesia(ID)]
152
155
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Deseleziona tutto',
148
148
  total: 'Totale ${total} elementi',
149
149
  selected: '${total} elementi selezionati'
150
+ },
151
+ Form: {
152
+ optional: '(opzionale)'
150
153
  }
151
154
  }; // [i18n-Italian]
152
155
 
@@ -148,6 +148,9 @@ const local = {
148
148
  clearSelectAll: 'すべてを選択解除',
149
149
  total: '合計 ${total} アイテム',
150
150
  selected: '選択済み ${total} アイテム'
151
+ },
152
+ Form: {
153
+ optional: '(オプション)'
151
154
  }
152
155
  }; // [i18n-Japan]
153
156
 
@@ -148,6 +148,9 @@ const local = {
148
148
  clearSelectAll: '모두 선택 취소',
149
149
  total: '총 {total} 개 항목',
150
150
  selected: '선택된 {Total} 개 항목'
151
+ },
152
+ Form: {
153
+ optional: '(선택 과목)'
151
154
  }
152
155
  }; // [i18n-Korea]
153
156
 
@@ -147,6 +147,9 @@ const local = {
147
147
  clearSelectAll: 'Nyahpilih semua',
148
148
  total: 'Jumlah ${total} item',
149
149
  selected: '${total} projek dipilih'
150
+ },
151
+ Form: {
152
+ optional: '(pilihan)'
150
153
  }
151
154
  }; // [i18n-Malaysia(MY)]
152
155
 
@@ -155,6 +155,9 @@ const local = {
155
155
  clearSelectAll: 'Cancelar selecionar tudo',
156
156
  total: 'Total de ${total} itens',
157
157
  selected: '${total} itens selecionados'
158
+ },
159
+ Form: {
160
+ optional: '(opcional)'
158
161
  }
159
162
  }; // 葡萄牙语
160
163
 
@@ -150,6 +150,9 @@ const local = {
150
150
  clearSelectAll: 'Снять выделение',
151
151
  total: 'Всего ${total} элементов',
152
152
  selected: 'Выбрано ${total} элементов'
153
+ },
154
+ Form: {
155
+ optional: '(по желанию)'
153
156
  }
154
157
  }; // [i18n-Russia] 俄罗斯语
155
158
 
@@ -151,6 +151,9 @@ const local = {
151
151
  clearSelectAll: 'ยกเลิกการเลือกทั้งหมด',
152
152
  total: 'รวม ${total} รายการ',
153
153
  selected: 'เลือก ${total} รายการ'
154
+ },
155
+ Form: {
156
+ optional: '(ไม่จำเป็น)'
154
157
  }
155
158
  }; // [i18n-Thai]
156
159
 
@@ -150,6 +150,9 @@ const local = {
150
150
  clearSelectAll: 'Tümünün seçimini kaldır',
151
151
  total: 'Toplam ${total} öğe',
152
152
  selected: '${total} öğe seçildi'
153
+ },
154
+ Form: {
155
+ optional: '(isteğe bağlı)'
153
156
  }
154
157
  }; // [i18n-Turkish]
155
158
 
@@ -150,6 +150,9 @@ const local = {
150
150
  clearSelectAll: 'Bỏ chọn tất cả',
151
151
  total: 'Tổng số ${total} mặt hàng',
152
152
  selected: '${total} mục được chọn'
153
+ },
154
+ Form: {
155
+ optional: '(không bắt buộc)'
153
156
  }
154
157
  }; // [i18n-Vietnam] 越南语
155
158
 
@@ -148,6 +148,9 @@ const local = {
148
148
  clearSelectAll: '取消全选',
149
149
  total: '共 ${total} 项',
150
150
  selected: '已选 ${total} 项'
151
+ },
152
+ Form: {
153
+ optional: '(可选)'
151
154
  }
152
155
  }; // 中文
153
156
 
@@ -148,6 +148,9 @@ const local = {
148
148
  clearSelectAll: '取消全選',
149
149
  total: '共 ${total} 項',
150
150
  selected: '已選 ${total} 項'
151
+ },
152
+ Form: {
153
+ optional: '(可選)'
151
154
  }
152
155
  }; // 中文
153
156
 
@@ -125,14 +125,6 @@ class Modal extends BaseComponent {
125
125
  let style = styleFromProps;
126
126
  const maskStyle = maskStyleFromProps;
127
127
  const renderFooter = 'footer' in this.props ? footer : this.renderFooter();
128
-
129
- if (this.props.centered) {
130
- style = _Object$assign({
131
- transform: 'translateY(-50%)',
132
- top: '50%'
133
- }, style);
134
- }
135
-
136
128
  let wrapperStyle = {
137
129
  zIndex
138
130
  };
@@ -342,7 +342,10 @@ export default class ModalContent extends BaseComponent {
342
342
  }, this.getMaskElement(), /*#__PURE__*/React.createElement("div", {
343
343
  role: "none",
344
344
  tabIndex: -1,
345
- className: "".concat(cssClasses.DIALOG, "-wrap"),
345
+ className: cls({
346
+ ["".concat(cssClasses.DIALOG, "-wrap")]: true,
347
+ ["".concat(cssClasses.DIALOG, "-wrap-center")]: this.props.centered
348
+ }),
346
349
  onClick: maskClosable ? this.onMaskClick : null,
347
350
  onMouseUp: maskClosable ? this.onMaskMouseUp : null
348
351
  }, this.getDialogElement())); // eslint-disable-next-line max-len
@@ -39,6 +39,7 @@ export interface RadioState {
39
39
  addonId?: string;
40
40
  extraId?: string;
41
41
  focusVisible?: boolean;
42
+ checked?: boolean;
42
43
  }
43
44
  export { RadioChangeEvent };
44
45
  declare class Radio extends BaseComponent<RadioProps, RadioState> {
@@ -71,6 +72,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
71
72
  addonId: string;
72
73
  extraId: string;
73
74
  constructor(props: RadioProps);
75
+ componentDidUpdate(prevProps: RadioProps): void;
74
76
  get adapter(): RadioAdapter;
75
77
  isInGroup(): {
76
78
  value?: string | number;
@@ -1,3 +1,5 @@
1
+ import _isBoolean from "lodash/isBoolean";
2
+ import _isUndefined from "lodash/isUndefined";
1
3
  import _noop from "lodash/noop";
2
4
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
3
5
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
@@ -30,6 +32,7 @@ class Radio extends BaseComponent {
30
32
  radioGroup.onChange && radioGroup.onChange(e);
31
33
  }
32
34
 
35
+ !('checked' in this.props) && this.foundation.setChecked(e.target.checked);
33
36
  onChange && onChange(e);
34
37
  };
35
38
 
@@ -54,12 +57,23 @@ class Radio extends BaseComponent {
54
57
  this.state = {
55
58
  hover: false,
56
59
  addonId: props.addonId,
57
- extraId: props.extraId
60
+ extraId: props.extraId,
61
+ checked: props.checked || props.defaultChecked || false
58
62
  };
59
63
  this.foundation = new RadioFoundation(this.adapter);
60
64
  this.radioEntity = null;
61
65
  }
62
66
 
67
+ componentDidUpdate(prevProps) {
68
+ if (this.props.checked !== prevProps.checked) {
69
+ if (_isUndefined(this.props.checked)) {
70
+ this.foundation.setChecked(false);
71
+ } else if (_isBoolean(this.props.checked)) {
72
+ this.foundation.setChecked(this.props.checked);
73
+ }
74
+ }
75
+ }
76
+
63
77
  get adapter() {
64
78
  return _Object$assign(_Object$assign({}, super.adapter), {
65
79
  setHover: hover => {
@@ -74,6 +88,11 @@ class Radio extends BaseComponent {
74
88
  })
75
89
  });
76
90
  },
91
+ setChecked: checked => {
92
+ this.setState({
93
+ checked
94
+ });
95
+ },
77
96
  setExtraId: () => {
78
97
  this.setState({
79
98
  extraId: getUuidShort({
@@ -108,7 +127,6 @@ class Radio extends BaseComponent {
108
127
  const {
109
128
  addonClassName,
110
129
  addonStyle,
111
- checked,
112
130
  disabled,
113
131
  style,
114
132
  className,
@@ -126,9 +144,13 @@ class Radio extends BaseComponent {
126
144
  hover: isHover,
127
145
  addonId,
128
146
  extraId,
129
- focusVisible
147
+ focusVisible,
148
+ checked
130
149
  } = this.state;
131
- let props = {};
150
+ const props = {
151
+ checked,
152
+ disabled
153
+ };
132
154
 
133
155
  if (this.isInGroup()) {
134
156
  realChecked = this.context.radioGroup.value === propValue;
@@ -139,16 +161,17 @@ class Radio extends BaseComponent {
139
161
  isPureCardRadioGroup = this.context.radioGroup.isPureCardRadio;
140
162
  buttonSize = this.context.radioGroup.buttonSize;
141
163
  realPrefixCls = prefixCls || this.context.radioGroup.prefixCls;
142
- props = {
143
- checked: realChecked,
144
- disabled: isDisabled
145
- };
164
+ props.checked = realChecked;
165
+ props.disabled = isDisabled;
146
166
  } else {
147
167
  realChecked = checked;
148
168
  isDisabled = disabled;
149
169
  realMode = mode;
150
170
  isButtonRadioComponent = type === 'button';
151
171
  realPrefixCls = prefixCls;
172
+ isButtonRadioGroup = type === strings.TYPE_BUTTON;
173
+ isPureCardRadioGroup = type === strings.TYPE_PURECARD;
174
+ isCardRadioGroup = type === strings.TYPE_CARD || isPureCardRadioGroup;
152
175
  }
153
176
 
154
177
  const isButtonRadio = typeof isButtonRadioGroup === 'undefined' ? isButtonRadioComponent : isButtonRadioGroup;
@@ -153,12 +153,14 @@ export default function ColumnFilter() {
153
153
  } else {
154
154
  iconElem = /*#__PURE__*/React.createElement("div", {
155
155
  className: finalCls
156
- }, /*#__PURE__*/React.createElement(IconFilter, {
156
+ }, '\u200b'
157
+ /* ZWSP(zero-width space) */
158
+ , /*#__PURE__*/React.createElement(IconFilter, {
157
159
  role: "button",
158
160
  "aria-label": "Filter data with this column",
159
161
  "aria-haspopup": "listbox",
160
162
  tabIndex: -1,
161
- size: "small"
163
+ size: "default"
162
164
  }));
163
165
  }
164
166
 
@@ -7,6 +7,7 @@ export interface ColumnSorterProps {
7
7
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
8
8
  prefixCls?: string;
9
9
  sortOrder?: SortOrder;
10
+ title?: React.ReactNode;
10
11
  }
11
12
  export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
12
13
  static propTypes: {