@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.
- package/button/buttonGroup.tsx +38 -4
- package/button/index.tsx +2 -0
- package/checkbox/_story/checkbox.stories.js +0 -2
- package/checkbox/checkbox.tsx +19 -22
- package/dist/css/semi.css +65 -94
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +83 -35
- 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 +1 -0
- package/lib/cjs/button/buttonGroup.js +52 -3
- package/lib/cjs/button/index.d.ts +1 -0
- package/lib/cjs/button/index.js +1 -0
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/checkbox/checkbox.js +10 -18
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radio.js +21 -13
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.js +1 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +2 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -0
- package/lib/es/button/buttonGroup.js +50 -3
- package/lib/es/button/index.d.ts +1 -0
- package/lib/es/button/index.js +1 -0
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/checkbox/checkbox.js +10 -18
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radio.js +21 -13
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/radio/radioGroup.js +1 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +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
|
@@ -39138,6 +39138,7 @@ class button_Button extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
39138
39138
|
}
|
|
39139
39139
|
|
|
39140
39140
|
button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.propTypes), iconButton_0.propTypes);
|
|
39141
|
+
button_Button.elementType = 'Button';
|
|
39141
39142
|
/* harmony default export */ var button_0 = (button_Button);
|
|
39142
39143
|
// CONCATENATED MODULE: ./button/buttonGroup.tsx
|
|
39143
39144
|
|
|
@@ -39146,6 +39147,10 @@ button_Button.propTypes = assign_default()(assign_default()({}, Button_Button.pr
|
|
|
39146
39147
|
|
|
39147
39148
|
|
|
39148
39149
|
|
|
39150
|
+
|
|
39151
|
+
|
|
39152
|
+
|
|
39153
|
+
|
|
39149
39154
|
var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
39150
39155
|
var t = {};
|
|
39151
39156
|
|
|
@@ -39166,6 +39171,47 @@ var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
39166
39171
|
const buttonGroup_prefixCls = button_constants_cssClasses.PREFIX;
|
|
39167
39172
|
const buttonGroup_btnSizes = button_constants_strings.sizes;
|
|
39168
39173
|
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
|
+
const isButtonType = get_default()(item, 'type.elementType') === 'Button';
|
|
39183
|
+
|
|
39184
|
+
const buttonProps = get_default()(item, 'props');
|
|
39185
|
+
|
|
39186
|
+
if (buttonProps) {
|
|
39187
|
+
var _context2, _context3;
|
|
39188
|
+
|
|
39189
|
+
const {
|
|
39190
|
+
type,
|
|
39191
|
+
theme,
|
|
39192
|
+
disabled
|
|
39193
|
+
} = buttonProps;
|
|
39194
|
+
lineCls = classnames_default()("".concat(buttonGroup_prefixCls, "-group-line"), concat_default()(_context2 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context2, theme !== null && theme !== void 0 ? theme : 'light'), concat_default()(_context3 = "".concat(buttonGroup_prefixCls, "-group-line-")).call(_context3, type !== null && type !== void 0 ? type : 'primary'), {
|
|
39195
|
+
["".concat(buttonGroup_prefixCls, "-group-line-disabled")]: disabled
|
|
39196
|
+
});
|
|
39197
|
+
}
|
|
39198
|
+
|
|
39199
|
+
if (isButtonType) {
|
|
39200
|
+
innerWithLine.push(item, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
39201
|
+
className: lineCls
|
|
39202
|
+
}));
|
|
39203
|
+
} else {
|
|
39204
|
+
innerWithLine.push(item);
|
|
39205
|
+
}
|
|
39206
|
+
});
|
|
39207
|
+
|
|
39208
|
+
innerWithLine.push(slice_default()(inner).call(inner, -1));
|
|
39209
|
+
return innerWithLine;
|
|
39210
|
+
} else {
|
|
39211
|
+
return inner;
|
|
39212
|
+
}
|
|
39213
|
+
}
|
|
39214
|
+
|
|
39169
39215
|
render() {
|
|
39170
39216
|
const _a = this.props,
|
|
39171
39217
|
{
|
|
@@ -39179,25 +39225,27 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
39179
39225
|
rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
39180
39226
|
|
|
39181
39227
|
let inner;
|
|
39228
|
+
let innerWithLine = [];
|
|
39182
39229
|
const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
|
|
39183
39230
|
|
|
39184
39231
|
if (children) {
|
|
39185
|
-
var
|
|
39232
|
+
var _context4;
|
|
39186
39233
|
|
|
39187
|
-
inner = map_default()(
|
|
39234
|
+
inner = map_default()(_context4 = is_array_default()(children) ? children : [children]).call(_context4, (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()({
|
|
39188
39235
|
disabled,
|
|
39189
39236
|
size,
|
|
39190
39237
|
type
|
|
39191
39238
|
}, itm.props), rest), {
|
|
39192
39239
|
key: index
|
|
39193
39240
|
})) : itm);
|
|
39241
|
+
innerWithLine = this.getInnerWithLine(inner);
|
|
39194
39242
|
}
|
|
39195
39243
|
|
|
39196
39244
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
39197
39245
|
className: cls,
|
|
39198
39246
|
role: "group",
|
|
39199
39247
|
"aria-label": ariaLabel
|
|
39200
|
-
},
|
|
39248
|
+
}, innerWithLine);
|
|
39201
39249
|
}
|
|
39202
39250
|
|
|
39203
39251
|
}
|
|
@@ -49066,23 +49114,15 @@ class checkbox_Checkbox extends baseComponent_BaseComponent {
|
|
|
49066
49114
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
49067
49115
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
49068
49116
|
|
|
49069
|
-
const renderContent = () => {
|
|
49070
|
-
|
|
49071
|
-
|
|
49072
|
-
|
|
49073
|
-
|
|
49074
|
-
|
|
49075
|
-
|
|
49076
|
-
|
|
49077
|
-
|
|
49078
|
-
className: "".concat(prefix, "-addon"),
|
|
49079
|
-
"x-semi-prop": xSemiPropChildren
|
|
49080
|
-
}, children) : null, extra ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
49081
|
-
id: extraId,
|
|
49082
|
-
className: extraCls,
|
|
49083
|
-
"x-semi-prop": "extra"
|
|
49084
|
-
}, extra) : null);
|
|
49085
|
-
};
|
|
49117
|
+
const renderContent = () => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
49118
|
+
id: addonId,
|
|
49119
|
+
className: "".concat(prefix, "-addon"),
|
|
49120
|
+
"x-semi-prop": xSemiPropChildren
|
|
49121
|
+
}, children) : null, extra ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
49122
|
+
id: extraId,
|
|
49123
|
+
className: extraCls,
|
|
49124
|
+
"x-semi-prop": "extra"
|
|
49125
|
+
}, extra) : null);
|
|
49086
49126
|
|
|
49087
49127
|
return (
|
|
49088
49128
|
/*#__PURE__*/
|
|
@@ -49108,7 +49148,7 @@ class checkbox_Checkbox extends baseComponent_BaseComponent {
|
|
|
49108
49148
|
focusInner: focusVisible && !focusOuter,
|
|
49109
49149
|
onInputFocus: this.handleFocusVisible,
|
|
49110
49150
|
onInputBlur: this.handleBlur
|
|
49111
|
-
})), renderContent())
|
|
49151
|
+
})), props.isCardType ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", null, renderContent()) : renderContent())
|
|
49112
49152
|
);
|
|
49113
49153
|
}
|
|
49114
49154
|
|
|
@@ -84220,16 +84260,26 @@ class radio_Radio extends baseComponent_BaseComponent {
|
|
|
84220
84260
|
["".concat(prefix, "-focus")]: focusVisible && isButtonRadio
|
|
84221
84261
|
}, addonClassName);
|
|
84222
84262
|
|
|
84223
|
-
const renderContent = () =>
|
|
84224
|
-
|
|
84225
|
-
|
|
84226
|
-
|
|
84227
|
-
|
|
84228
|
-
|
|
84229
|
-
|
|
84230
|
-
|
|
84231
|
-
|
|
84232
|
-
|
|
84263
|
+
const renderContent = () => {
|
|
84264
|
+
if (!children && !extra) {
|
|
84265
|
+
return null;
|
|
84266
|
+
}
|
|
84267
|
+
|
|
84268
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
84269
|
+
className: classnames_default()(["".concat(prefix, "-content"), {
|
|
84270
|
+
["".concat(prefix, "-isCardRadioGroup_content")]: isCardRadioGroup
|
|
84271
|
+
}])
|
|
84272
|
+
}, children ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
84273
|
+
className: addonCls,
|
|
84274
|
+
style: addonStyle,
|
|
84275
|
+
id: addonId,
|
|
84276
|
+
"x-semi-prop": "children"
|
|
84277
|
+
}, children) : null, extra && !isButtonRadio ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
84278
|
+
className: "".concat(prefix, "-extra"),
|
|
84279
|
+
id: extraId,
|
|
84280
|
+
"x-semi-prop": "extra"
|
|
84281
|
+
}, extra) : null);
|
|
84282
|
+
};
|
|
84233
84283
|
|
|
84234
84284
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("label", {
|
|
84235
84285
|
style: style,
|
|
@@ -84250,9 +84300,7 @@ class radio_Radio extends baseComponent_BaseComponent {
|
|
|
84250
84300
|
focusInner: focusVisible && !focusOuter,
|
|
84251
84301
|
onInputFocus: this.handleFocusVisible,
|
|
84252
84302
|
onInputBlur: this.handleBlur
|
|
84253
|
-
})),
|
|
84254
|
-
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
84255
|
-
}, renderContent()) : renderContent());
|
|
84303
|
+
})), renderContent());
|
|
84256
84304
|
}
|
|
84257
84305
|
|
|
84258
84306
|
}
|
|
@@ -84315,7 +84363,7 @@ class radioGroup_RadioGroup extends baseComponent_BaseComponent {
|
|
|
84315
84363
|
this.getFormatName = () => this.props.name || 'default';
|
|
84316
84364
|
|
|
84317
84365
|
this.state = {
|
|
84318
|
-
value:
|
|
84366
|
+
value: props.value || props.defaultValue
|
|
84319
84367
|
};
|
|
84320
84368
|
this.foundation = new radioGroupFoundation_RadioGroupFoundation(this.adapter);
|
|
84321
84369
|
}
|