@douyinfe/semi-ui 2.10.0 → 2.10.2-alpha.1

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.
@@ -171,6 +171,7 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
171
171
  const { isCardType, isPureCardType } = this.context.checkboxGroup;
172
172
  props.isCardType = isCardType;
173
173
  props.isPureCardType = isPureCardType;
174
+ props['name'] = this.context.checkboxGroup.name;
174
175
  }
175
176
 
176
177
  const prefix = prefixCls || css.PREFIX;
@@ -192,8 +193,6 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
192
193
  [`${prefix}-cardType_extra_noChildren`]: props.isCardType && !children,
193
194
  });
194
195
 
195
- const name = inGroup && this.context.checkboxGroup.name;
196
-
197
196
  const renderContent = () => (
198
197
  <>
199
198
  {children ? <span id={this.addonId} className={`${prefix}-addon`}>{children}</span> : null}
@@ -220,7 +219,6 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
220
219
  {...props}
221
220
  addonId={children && this.addonId}
222
221
  extraId={extra && this.extraId}
223
- name={name}
224
222
  isPureCardType={props.isPureCardType}
225
223
  ref={ref => {
226
224
  this.checkboxEntity = ref;
@@ -81,26 +81,31 @@ class CheckboxInner extends PureComponent<CheckboxInnerProps> {
81
81
  <IconCheckboxIndeterminate />
82
82
  ) : null;
83
83
 
84
+ const inputProps: React.InputHTMLAttributes<HTMLInputElement> = {
85
+ type: "checkbox",
86
+ 'aria-label': this.props['aria-label'],
87
+ 'aria-disabled': disabled,
88
+ 'aria-checked': checked,
89
+ 'aria-labelledby': addonId,
90
+ 'aria-describedby':extraId || this.props['aria-describedby'],
91
+ 'aria-invalid': this.props['aria-invalid'],
92
+ 'aria-errormessage': this.props['aria-errormessage'],
93
+ 'aria-required': this.props['aria-required'],
94
+ className: css.INPUT,
95
+ onChange: noop,
96
+ checked: checked,
97
+ disabled: disabled,
98
+ };
99
+
100
+ name && (inputProps['name'] = name);
101
+
84
102
  return (
85
103
  <span className={wrapper}>
86
104
  <input
87
- type="checkbox"
88
- aria-label={this.props['aria-label']}
89
- aria-disabled={disabled}
90
- aria-checked={checked}
91
- aria-labelledby={addonId}
92
- aria-describedby={extraId || this.props['aria-describedby']}
93
- aria-invalid={this.props['aria-invalid']}
94
- aria-errormessage={this.props['aria-errormessage']}
95
- aria-required={this.props['aria-required']}
105
+ {...inputProps}
96
106
  ref={ref => {
97
107
  this.inputEntity = ref;
98
108
  }}
99
- className={css.INPUT}
100
- onChange={noop}
101
- checked={checked}
102
- disabled={disabled}
103
- name={name}
104
109
  />
105
110
  <span className={inner}>{icon}</span>
106
111
  </span>
package/dist/css/semi.css CHANGED
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  /* shadow */
2
3
  /* sizing */
3
4
  /* spacing */