@douyinfe/semi-ui 2.19.0-alpha.4 → 2.19.0-alpha.7

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 (52) hide show
  1. package/button/buttonGroup.tsx +38 -4
  2. package/button/index.tsx +2 -0
  3. package/checkbox/_story/checkbox.stories.js +0 -2
  4. package/checkbox/checkbox.tsx +19 -22
  5. package/dist/css/semi.css +65 -94
  6. package/dist/css/semi.min.css +1 -1
  7. package/dist/umd/semi-ui.js +83 -35
  8. package/dist/umd/semi-ui.js.map +1 -1
  9. package/dist/umd/semi-ui.min.js +1 -1
  10. package/dist/umd/semi-ui.min.js.map +1 -1
  11. package/lib/cjs/button/buttonGroup.d.ts +1 -0
  12. package/lib/cjs/button/buttonGroup.js +52 -3
  13. package/lib/cjs/button/index.d.ts +1 -0
  14. package/lib/cjs/button/index.js +1 -0
  15. package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
  16. package/lib/cjs/carousel/index.d.ts +1 -1
  17. package/lib/cjs/checkbox/checkbox.js +10 -18
  18. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  19. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  20. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  21. package/lib/cjs/radio/radio.d.ts +1 -1
  22. package/lib/cjs/radio/radio.js +21 -13
  23. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  24. package/lib/cjs/radio/radioGroup.js +1 -1
  25. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  26. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  27. package/lib/cjs/timePicker/index.d.ts +2 -2
  28. package/lib/cjs/typography/title.d.ts +1 -1
  29. package/lib/cjs/upload/index.d.ts +1 -1
  30. package/lib/es/button/buttonGroup.d.ts +1 -0
  31. package/lib/es/button/buttonGroup.js +50 -3
  32. package/lib/es/button/index.d.ts +1 -0
  33. package/lib/es/button/index.js +1 -0
  34. package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
  35. package/lib/es/carousel/index.d.ts +1 -1
  36. package/lib/es/checkbox/checkbox.js +10 -18
  37. package/lib/es/datePicker/dateInput.d.ts +1 -1
  38. package/lib/es/datePicker/datePicker.d.ts +1 -1
  39. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  40. package/lib/es/radio/radio.d.ts +1 -1
  41. package/lib/es/radio/radio.js +21 -13
  42. package/lib/es/radio/radioGroup.d.ts +1 -1
  43. package/lib/es/radio/radioGroup.js +1 -1
  44. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  45. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  46. package/lib/es/timePicker/index.d.ts +2 -2
  47. package/lib/es/typography/title.d.ts +1 -1
  48. package/lib/es/upload/index.d.ts +1 -1
  49. package/package.json +7 -7
  50. package/radio/_story/radio.stories.js +5 -5
  51. package/radio/radio.tsx +20 -19
  52. package/radio/radioGroup.tsx +1 -1
@@ -48,7 +48,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
48
48
  disabled: PropTypes.Requireable<boolean>;
49
49
  name: PropTypes.Requireable<string>;
50
50
  options: PropTypes.Requireable<any[]>;
51
- buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
51
+ buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
52
52
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
53
53
  value: PropTypes.Requireable<any>;
54
54
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -22,7 +22,7 @@ class RadioGroup extends BaseComponent {
22
22
  this.getFormatName = () => this.props.name || 'default';
23
23
 
24
24
  this.state = {
25
- value: undefined
25
+ value: props.value || props.defaultValue
26
26
  };
27
27
  this.foundation = new RadioGroupFoundation(this.adapter);
28
28
  }
@@ -99,11 +99,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
99
99
  'aria-required': PropTypes.Requireable<boolean>;
100
100
  prefixCls: PropTypes.Requireable<string>;
101
101
  clearText: PropTypes.Requireable<string>;
102
- value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
102
+ value: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
103
103
  inputReadOnly: PropTypes.Requireable<boolean>;
104
104
  disabled: PropTypes.Requireable<boolean>;
105
105
  showClear: PropTypes.Requireable<boolean>;
106
- defaultValue: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
106
+ defaultValue: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
107
107
  open: PropTypes.Requireable<boolean>;
108
108
  defaultOpen: PropTypes.Requireable<boolean>;
109
109
  onOpenChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -6,5 +6,5 @@ import PropTypes from 'prop-types';
6
6
  * - \[12:00:12, 12:21:12]
7
7
  * - \[[12:00:12, 12:21:12], [12:11:12, 12:32:12]]
8
8
  */
9
- declare const TimeShape: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
9
+ declare const TimeShape: PropTypes.Requireable<string | number | string[] | Date | number[] | Date[]>;
10
10
  export { TimeShape };
@@ -19,11 +19,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
19
19
  'aria-required': import("prop-types").Requireable<boolean>;
20
20
  prefixCls: import("prop-types").Requireable<string>;
21
21
  clearText: import("prop-types").Requireable<string>;
22
- value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
22
+ value: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
23
23
  inputReadOnly: import("prop-types").Requireable<boolean>;
24
24
  disabled: import("prop-types").Requireable<boolean>;
25
25
  showClear: import("prop-types").Requireable<boolean>;
26
- defaultValue: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
26
+ defaultValue: import("prop-types").Requireable<string | number | string[] | Date | number[] | Date[]>;
27
27
  open: import("prop-types").Requireable<boolean>;
28
28
  defaultOpen: import("prop-types").Requireable<boolean>;
29
29
  onOpenChange: import("prop-types").Requireable<(...args: any[]) => any>;
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -140,7 +140,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
140
140
  style: PropTypes.Requireable<object>;
141
141
  timeout: PropTypes.Requireable<number>;
142
142
  transformFile: PropTypes.Requireable<(...args: any[]) => any>;
143
- uploadTrigger: PropTypes.Requireable<"auto" | "custom">;
143
+ uploadTrigger: PropTypes.Requireable<"custom" | "auto">;
144
144
  validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
145
145
  validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
146
146
  withCredentials: PropTypes.Requireable<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.19.0-alpha.4",
3
+ "version": "2.19.0-alpha.7",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -15,11 +15,11 @@
15
15
  "dependencies": {
16
16
  "@babel/runtime-corejs3": "^7.15.4",
17
17
  "@douyinfe/semi-animation": "2.12.0",
18
- "@douyinfe/semi-animation-react": "2.19.0-alpha.4",
19
- "@douyinfe/semi-foundation": "2.19.0-alpha.4",
20
- "@douyinfe/semi-icons": "2.19.0-alpha.4",
18
+ "@douyinfe/semi-animation-react": "2.19.0-alpha.7",
19
+ "@douyinfe/semi-foundation": "2.19.0-alpha.7",
20
+ "@douyinfe/semi-icons": "2.19.0-alpha.7",
21
21
  "@douyinfe/semi-illustrations": "2.15.0",
22
- "@douyinfe/semi-theme-default": "2.19.0-alpha.4",
22
+ "@douyinfe/semi-theme-default": "2.19.0-alpha.7",
23
23
  "async-validator": "^3.5.0",
24
24
  "classnames": "^2.2.6",
25
25
  "copy-text-to-clipboard": "^2.1.1",
@@ -66,13 +66,13 @@
66
66
  ],
67
67
  "author": "",
68
68
  "license": "MIT",
69
- "gitHead": "44b673969b77694badbba8e8648d1431d64a3b01",
69
+ "gitHead": "e4926d98b1e98ec52a3bc8b7c29a51bf223b8208",
70
70
  "devDependencies": {
71
71
  "@babel/plugin-proposal-decorators": "^7.15.8",
72
72
  "@babel/plugin-transform-runtime": "^7.15.8",
73
73
  "@babel/preset-env": "^7.15.8",
74
74
  "@babel/preset-react": "^7.14.5",
75
- "@douyinfe/semi-scss-compile": "2.19.0-alpha.4",
75
+ "@douyinfe/semi-scss-compile": "2.19.0-alpha.7",
76
76
  "@storybook/addon-knobs": "^6.3.1",
77
77
  "@types/lodash": "^4.14.176",
78
78
  "@types/react": ">=16.0.0",
@@ -254,18 +254,18 @@ _RadioGroup.story = {
254
254
 
255
255
  export const RadioWithVertical = () => {
256
256
  return (
257
- <Radio.Group>
258
- <Radio value="A" displayMode="vertical">
257
+ <Radio.Group direction="vertical">
258
+ <Radio value="A">
259
259
  无限长的一串字The Storybook webapp UI can be customised with this addon. It can be used to
260
260
  change the header, show/hide various UI elements and to enable full-screen mode by default.
261
261
  </Radio>
262
- <Radio value="C" displayMode="vertical">
262
+ <Radio value="C">
263
263
  C
264
264
  </Radio>
265
- <Radio value="D" displayMode="vertical">
265
+ <Radio value="D">
266
266
  D
267
267
  </Radio>
268
- <Radio value="E" displayMode="vertical">
268
+ <Radio value="E">
269
269
  E
270
270
  </Radio>
271
271
  </Radio.Group>
package/radio/radio.tsx CHANGED
@@ -268,20 +268,25 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
268
268
  [`${prefix}-addon-buttonRadio-${buttonSize}`]: isButtonRadio && buttonSize,
269
269
  [`${prefix}-focus`]: focusVisible && isButtonRadio,
270
270
  }, addonClassName);
271
- const renderContent = () => (
272
- <>
273
- {children ? (
274
- <span className={addonCls} style={addonStyle} id={addonId} x-semi-prop="children">
275
- {children}
276
- </span>
277
- ) : null}
278
- {extra && !isButtonRadio ? (
279
- <div className={`${prefix}-extra`} id={extraId} x-semi-prop="extra">
280
- {extra}
281
- </div>
282
- ) : null}
283
- </>
284
- );
271
+ const renderContent = () => {
272
+ if (!children && !extra) {
273
+ return null;
274
+ }
275
+ return (
276
+ <div className={cls([`${prefix}-content`, { [`${prefix}-isCardRadioGroup_content`]: isCardRadioGroup }])}>
277
+ {children ? (
278
+ <span className={addonCls} style={addonStyle} id={addonId} x-semi-prop="children">
279
+ {children}
280
+ </span>
281
+ ) : null}
282
+ {extra && !isButtonRadio ? (
283
+ <div className={`${prefix}-extra`} id={extraId} x-semi-prop="extra">
284
+ {extra}
285
+ </div>
286
+ ) : null}
287
+ </div>
288
+ );
289
+ };
285
290
 
286
291
  return (
287
292
  <label
@@ -307,11 +312,7 @@ class Radio extends BaseComponent<RadioProps, RadioState> {
307
312
  onInputFocus={this.handleFocusVisible}
308
313
  onInputBlur={this.handleBlur}
309
314
  />
310
- {
311
- isCardRadioGroup ?
312
- <div className={`${prefix}-isCardRadioGroup_content`}>{renderContent()}</div> :
313
- renderContent()
314
- }
315
+ {renderContent()}
315
316
  </label>
316
317
  );
317
318
  }
@@ -88,7 +88,7 @@ class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState> {
88
88
  constructor(props: RadioGroupProps) {
89
89
  super(props);
90
90
  this.state = {
91
- value: undefined,
91
+ value: props.value || props.defaultValue,
92
92
  };
93
93
  this.foundation = new RadioGroupFoundation(this.adapter);
94
94
  }