@douyinfe/semi-ui 2.19.0-alpha.5 → 2.19.0-alpha.6
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/button/buttonGroup.tsx +4 -38
- package/dist/css/semi.css +24 -123
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +25 -67
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +0 -1
- package/lib/cjs/button/buttonGroup.js +3 -56
- package/lib/cjs/radio/radio.js +21 -13
- package/lib/cjs/radio/radioGroup.js +1 -1
- package/lib/es/button/buttonGroup.d.ts +0 -1
- package/lib/es/button/buttonGroup.js +3 -53
- package/lib/es/radio/radio.js +21 -13
- package/lib/es/radio/radioGroup.js +1 -1
- package/package.json +7 -7
- package/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +20 -19
- package/radio/radioGroup.tsx +1 -1
package/dist/umd/semi-ui.js
CHANGED
|
@@ -39146,11 +39146,6 @@ button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.pr
|
|
|
39146
39146
|
|
|
39147
39147
|
|
|
39148
39148
|
|
|
39149
|
-
|
|
39150
|
-
|
|
39151
|
-
|
|
39152
|
-
|
|
39153
|
-
|
|
39154
39149
|
var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
39155
39150
|
var t = {};
|
|
39156
39151
|
|
|
@@ -39171,49 +39166,6 @@ var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
39171
39166
|
const buttonGroup_prefixCls = button_constants_cssClasses.PREFIX;
|
|
39172
39167
|
const buttonGroup_btnSizes = button_constants_strings.sizes;
|
|
39173
39168
|
class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
39174
|
-
getInnerWithLine(inner) {
|
|
39175
|
-
const innerWithLine = [];
|
|
39176
|
-
let lineCls = "".concat(buttonGroup_prefixCls, "-group-line");
|
|
39177
|
-
|
|
39178
|
-
if (inner.length > 1) {
|
|
39179
|
-
var _context;
|
|
39180
|
-
|
|
39181
|
-
for_each_default()(_context = slice_default()(inner).call(inner, 0, -1)).call(_context, item => {
|
|
39182
|
-
var _context2;
|
|
39183
|
-
|
|
39184
|
-
const isButtonType = includes_default()(_context2 = [get_default()(item, 'type.displayName'), get_default()(item, 'type.name')]).call(_context2, 'Button');
|
|
39185
|
-
|
|
39186
|
-
const buttonProps = get_default()(item, 'props');
|
|
39187
|
-
|
|
39188
|
-
if (buttonProps) {
|
|
39189
|
-
var _context3, _context4;
|
|
39190
|
-
|
|
39191
|
-
const {
|
|
39192
|
-
type,
|
|
39193
|
-
theme,
|
|
39194
|
-
disabled
|
|
39195
|
-
} = buttonProps;
|
|
39196
|
-
lineCls = classnames_default()("".concat(buttonGroup_prefixCls, "-group-line"), concat_default()(_context3 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context3, theme !== null && theme !== void 0 ? theme : 'light'), concat_default()(_context4 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context4, type !== null && type !== void 0 ? type : 'primary'), {
|
|
39197
|
-
["".concat(buttonGroup_prefixCls, "-group-line-disabled")]: disabled
|
|
39198
|
-
});
|
|
39199
|
-
}
|
|
39200
|
-
|
|
39201
|
-
if (isButtonType) {
|
|
39202
|
-
innerWithLine.push(item, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
39203
|
-
className: lineCls
|
|
39204
|
-
}));
|
|
39205
|
-
} else {
|
|
39206
|
-
innerWithLine.push(item);
|
|
39207
|
-
}
|
|
39208
|
-
});
|
|
39209
|
-
|
|
39210
|
-
innerWithLine.push(slice_default()(inner).call(inner, -1));
|
|
39211
|
-
return innerWithLine;
|
|
39212
|
-
} else {
|
|
39213
|
-
return inner;
|
|
39214
|
-
}
|
|
39215
|
-
}
|
|
39216
|
-
|
|
39217
39169
|
render() {
|
|
39218
39170
|
const _a = this.props,
|
|
39219
39171
|
{
|
|
@@ -39227,27 +39179,25 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
39227
39179
|
rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
39228
39180
|
|
|
39229
39181
|
let inner;
|
|
39230
|
-
let innerWithLine = [];
|
|
39231
39182
|
const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
|
|
39232
39183
|
|
|
39233
39184
|
if (children) {
|
|
39234
|
-
var
|
|
39185
|
+
var _context;
|
|
39235
39186
|
|
|
39236
|
-
inner = map_default()(
|
|
39187
|
+
inner = map_default()(_context = is_array_default()(children) ? children : [children]).call(_context, (itm, index) => /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(itm) ? /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["cloneElement"])(itm, assign_default()(assign_default()(assign_default()({
|
|
39237
39188
|
disabled,
|
|
39238
39189
|
size,
|
|
39239
39190
|
type
|
|
39240
39191
|
}, itm.props), rest), {
|
|
39241
39192
|
key: index
|
|
39242
39193
|
})) : itm);
|
|
39243
|
-
innerWithLine = this.getInnerWithLine(inner);
|
|
39244
39194
|
}
|
|
39245
39195
|
|
|
39246
39196
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
39247
39197
|
className: cls,
|
|
39248
39198
|
role: "group",
|
|
39249
39199
|
"aria-label": ariaLabel
|
|
39250
|
-
},
|
|
39200
|
+
}, inner);
|
|
39251
39201
|
}
|
|
39252
39202
|
|
|
39253
39203
|
}
|
|
@@ -84210,16 +84160,26 @@ class radio_Radio extends baseComponent_BaseComponent {
|
|
|
84210
84160
|
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
84211
84161
|
}, addonClassName);
|
|
84212
84162
|
|
|
84213
|
-
const renderContent = () =>
|
|
84214
|
-
|
|
84215
|
-
|
|
84216
|
-
|
|
84217
|
-
|
|
84218
|
-
|
|
84219
|
-
|
|
84220
|
-
|
|
84221
|
-
|
|
84222
|
-
|
|
84163
|
+
const renderContent = () => {
|
|
84164
|
+
if (!children && !extra) {
|
|
84165
|
+
return null;
|
|
84166
|
+
}
|
|
84167
|
+
|
|
84168
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
84169
|
+
className: classnames_default()(["".concat(prefix, "-content"), {
|
|
84170
|
+
["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
|
|
84171
|
+
}])
|
|
84172
|
+
}, children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
84173
|
+
className: addonCls,
|
|
84174
|
+
style: addonStyle,
|
|
84175
|
+
id: addonId,
|
|
84176
|
+
"x-semi-prop": "children"
|
|
84177
|
+
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
84178
|
+
className: "".concat(prefix, "-extra"),
|
|
84179
|
+
id: extraId,
|
|
84180
|
+
"x-semi-prop": "extra"
|
|
84181
|
+
}, extra) : null);
|
|
84182
|
+
};
|
|
84223
84183
|
|
|
84224
84184
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("label", {
|
|
84225
84185
|
style: style,
|
|
@@ -84240,9 +84200,7 @@ class radio_Radio extends baseComponent_BaseComponent {
|
|
|
84240
84200
|
focusInner: focusVisible && !focusOuter,
|
|
84241
84201
|
onInputFocus: this.handleFocusVisible,
|
|
84242
84202
|
onInputBlur: this.handleBlur
|
|
84243
|
-
})),
|
|
84244
|
-
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
84245
|
-
}, renderContent()) : renderContent());
|
|
84203
|
+
})), renderContent());
|
|
84246
84204
|
}
|
|
84247
84205
|
|
|
84248
84206
|
}
|
|
@@ -84305,7 +84263,7 @@ class radioGroup_RadioGroup extends baseComponent_BaseComponent {
|
|
|
84305
84263
|
this.getFormatName = () => this.props.name || 'default';
|
|
84306
84264
|
|
|
84307
84265
|
this.state = {
|
|
84308
|
-
value:
|
|
84266
|
+
value: props.value || props.defaultValue
|
|
84309
84267
|
};
|
|
84310
84268
|
this.foundation = new radioGroupFoundation_RadioGroupFoundation(this.adapter);
|
|
84311
84269
|
}
|