@douyinfe/semi-ui 2.10.1 → 2.10.2-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.
package/form/baseForm.tsx CHANGED
@@ -151,7 +151,6 @@ class Form extends BaseComponent<BaseFormProps, BaseFormState> {
151
151
 
152
152
  componentWillUnmount() {
153
153
  this.foundation.destroy();
154
- this.foundation = null;
155
154
  this.formApi = null;
156
155
  }
157
156
 
@@ -150,6 +150,7 @@ class Checkbox extends _baseComponent.default {
150
150
  } = this.context.checkboxGroup;
151
151
  props.isCardType = isCardType;
152
152
  props.isPureCardType = isPureCardType;
153
+ props['name'] = this.context.checkboxGroup.name;
153
154
  }
154
155
 
155
156
  const prefix = prefixCls || _constants.checkboxClasses.PREFIX;
@@ -168,7 +169,6 @@ class Checkbox extends _baseComponent.default {
168
169
  const extraCls = (0, _classnames.default)("".concat(prefix, "-extra"), {
169
170
  ["".concat(prefix, "-cardType_extra_noChildren")]: props.isCardType && !children
170
171
  });
171
- const name = inGroup && this.context.checkboxGroup.name;
172
172
 
173
173
  const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
174
174
  id: this.addonId,
@@ -196,7 +196,6 @@ class Checkbox extends _baseComponent.default {
196
196
  }, /*#__PURE__*/_react.default.createElement(_checkboxInner.default, (0, _assign.default)({}, this.props, props, {
197
197
  addonId: children && this.addonId,
198
198
  extraId: extra && this.extraId,
199
- name: name,
200
199
  isPureCardType: props.isPureCardType,
201
200
  ref: ref => {
202
201
  this.checkboxEntity = ref;
@@ -14,6 +14,8 @@ _Object$defineProperty(exports, "__esModule", {
14
14
 
15
15
  exports.default = void 0;
16
16
 
17
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
18
+
17
19
  var _noop2 = _interopRequireDefault(require("lodash/noop"));
18
20
 
19
21
  var _react = _interopRequireWildcard(require("react"));
@@ -63,27 +65,29 @@ class CheckboxInner extends _react.PureComponent {
63
65
  ["".concat(prefix, "-inner-display")]: true
64
66
  });
65
67
  const icon = checked ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconCheckboxTick, null) : indeterminate ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconCheckboxIndeterminate, null) : null;
66
- return /*#__PURE__*/_react.default.createElement("span", {
67
- className: wrapper
68
- }, /*#__PURE__*/_react.default.createElement("input", {
68
+ const inputProps = {
69
69
  type: "checkbox",
70
- "aria-label": this.props['aria-label'],
71
- "aria-disabled": disabled,
72
- "aria-checked": checked,
73
- "aria-labelledby": addonId,
74
- "aria-describedby": extraId || this.props['aria-describedby'],
75
- "aria-invalid": this.props['aria-invalid'],
76
- "aria-errormessage": this.props['aria-errormessage'],
77
- "aria-required": this.props['aria-required'],
78
- ref: ref => {
79
- this.inputEntity = ref;
80
- },
70
+ 'aria-label': this.props['aria-label'],
71
+ 'aria-disabled': disabled,
72
+ 'aria-checked': checked,
73
+ 'aria-labelledby': addonId,
74
+ 'aria-describedby': extraId || this.props['aria-describedby'],
75
+ 'aria-invalid': this.props['aria-invalid'],
76
+ 'aria-errormessage': this.props['aria-errormessage'],
77
+ 'aria-required': this.props['aria-required'],
81
78
  className: _constants.checkboxClasses.INPUT,
82
79
  onChange: _noop2.default,
83
80
  checked: checked,
84
- disabled: disabled,
85
- name: name
86
- }), /*#__PURE__*/_react.default.createElement("span", {
81
+ disabled: disabled
82
+ };
83
+ name && (inputProps['name'] = name);
84
+ return /*#__PURE__*/_react.default.createElement("span", {
85
+ className: wrapper
86
+ }, /*#__PURE__*/_react.default.createElement("input", (0, _assign.default)({}, inputProps, {
87
+ ref: ref => {
88
+ this.inputEntity = ref;
89
+ }
90
+ })), /*#__PURE__*/_react.default.createElement("span", {
87
91
  className: inner
88
92
  }, icon));
89
93
  }
@@ -106,7 +106,6 @@ class Form extends _baseComponent.default {
106
106
 
107
107
  componentWillUnmount() {
108
108
  this.foundation.destroy();
109
- this.foundation = null;
110
109
  this.formApi = null;
111
110
  }
112
111
 
@@ -126,6 +126,7 @@ class Checkbox extends BaseComponent {
126
126
  } = this.context.checkboxGroup;
127
127
  props.isCardType = isCardType;
128
128
  props.isPureCardType = isPureCardType;
129
+ props['name'] = this.context.checkboxGroup.name;
129
130
  }
130
131
 
131
132
  const prefix = prefixCls || css.PREFIX;
@@ -144,7 +145,6 @@ class Checkbox extends BaseComponent {
144
145
  const extraCls = classnames("".concat(prefix, "-extra"), {
145
146
  ["".concat(prefix, "-cardType_extra_noChildren")]: props.isCardType && !children
146
147
  });
147
- const name = inGroup && this.context.checkboxGroup.name;
148
148
 
149
149
  const renderContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/React.createElement("span", {
150
150
  id: this.addonId,
@@ -172,7 +172,6 @@ class Checkbox extends BaseComponent {
172
172
  }, /*#__PURE__*/React.createElement(CheckboxInner, _Object$assign({}, this.props, props, {
173
173
  addonId: children && this.addonId,
174
174
  extraId: extra && this.extraId,
175
- name: name,
176
175
  isPureCardType: props.isPureCardType,
177
176
  ref: ref => {
178
177
  this.checkboxEntity = ref;
@@ -1,4 +1,5 @@
1
1
  import _noop from "lodash/noop";
2
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
2
3
 
3
4
  /* eslint-disable no-nested-ternary */
4
5
  import React, { PureComponent } from 'react';
@@ -38,27 +39,29 @@ class CheckboxInner extends PureComponent {
38
39
  ["".concat(prefix, "-inner-display")]: true
39
40
  });
40
41
  const icon = checked ? /*#__PURE__*/React.createElement(IconCheckboxTick, null) : indeterminate ? /*#__PURE__*/React.createElement(IconCheckboxIndeterminate, null) : null;
41
- return /*#__PURE__*/React.createElement("span", {
42
- className: wrapper
43
- }, /*#__PURE__*/React.createElement("input", {
42
+ const inputProps = {
44
43
  type: "checkbox",
45
- "aria-label": this.props['aria-label'],
46
- "aria-disabled": disabled,
47
- "aria-checked": checked,
48
- "aria-labelledby": addonId,
49
- "aria-describedby": extraId || this.props['aria-describedby'],
50
- "aria-invalid": this.props['aria-invalid'],
51
- "aria-errormessage": this.props['aria-errormessage'],
52
- "aria-required": this.props['aria-required'],
53
- ref: ref => {
54
- this.inputEntity = ref;
55
- },
44
+ 'aria-label': this.props['aria-label'],
45
+ 'aria-disabled': disabled,
46
+ 'aria-checked': checked,
47
+ 'aria-labelledby': addonId,
48
+ 'aria-describedby': extraId || this.props['aria-describedby'],
49
+ 'aria-invalid': this.props['aria-invalid'],
50
+ 'aria-errormessage': this.props['aria-errormessage'],
51
+ 'aria-required': this.props['aria-required'],
56
52
  className: css.INPUT,
57
53
  onChange: _noop,
58
54
  checked: checked,
59
- disabled: disabled,
60
- name: name
61
- }), /*#__PURE__*/React.createElement("span", {
55
+ disabled: disabled
56
+ };
57
+ name && (inputProps['name'] = name);
58
+ return /*#__PURE__*/React.createElement("span", {
59
+ className: wrapper
60
+ }, /*#__PURE__*/React.createElement("input", _Object$assign({}, inputProps, {
61
+ ref: ref => {
62
+ this.inputEntity = ref;
63
+ }
64
+ })), /*#__PURE__*/React.createElement("span", {
62
65
  className: inner
63
66
  }, icon));
64
67
  }
@@ -68,7 +68,6 @@ class Form extends BaseComponent {
68
68
 
69
69
  componentWillUnmount() {
70
70
  this.foundation.destroy();
71
- this.foundation = null;
72
71
  this.formApi = null;
73
72
  }
74
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.10.1",
3
+ "version": "2.10.2-alpha.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@babel/runtime-corejs3": "^7.15.4",
17
17
  "@douyinfe/semi-animation": "2.10.1",
18
- "@douyinfe/semi-animation-react": "2.10.1",
18
+ "@douyinfe/semi-animation-react": "2.10.2-alpha.0",
19
19
  "@douyinfe/semi-foundation": "2.10.1",
20
20
  "@douyinfe/semi-icons": "2.10.1",
21
21
  "@douyinfe/semi-illustrations": "2.10.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "1c84b585ff43db35b286e8c24f8333e4170d015c",
72
+ "gitHead": "0af26368c88d1654b57ca177c18ed1d92b1b8b61",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",