@douyinfe/semi-ui 2.19.0-alpha.2 → 2.19.0-alpha.3
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/checkbox/checkbox.tsx +7 -7
- package/checkbox/checkboxGroup.tsx +2 -11
- package/dist/css/semi.css +16 -10
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +141 -119
- 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/form/baseForm.tsx +0 -1
- package/lib/cjs/checkbox/checkbox.js +8 -2
- package/lib/cjs/checkbox/checkboxGroup.js +8 -31
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/baseForm.js +0 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popconfirm/index.js +49 -31
- package/lib/cjs/radio/radioGroup.js +7 -34
- package/lib/cjs/table/ColumnFilter.js +4 -2
- package/lib/cjs/table/ColumnSorter.d.ts +1 -0
- package/lib/cjs/table/ColumnSorter.js +9 -6
- package/lib/cjs/table/Table.js +11 -4
- package/lib/cjs/tabs/TabBar.js +5 -1
- package/lib/cjs/transfer/index.js +7 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/checkbox/checkbox.js +8 -2
- package/lib/es/checkbox/checkboxGroup.js +6 -27
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popconfirm/index.js +49 -31
- package/lib/es/radio/radioGroup.js +5 -30
- package/lib/es/table/ColumnFilter.js +4 -2
- package/lib/es/table/ColumnSorter.d.ts +1 -0
- package/lib/es/table/ColumnSorter.js +9 -6
- package/lib/es/table/Table.js +10 -4
- package/lib/es/tabs/TabBar.js +5 -1
- package/lib/es/transfer/index.js +7 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
- package/popconfirm/_story/popconfirm.stories.js +37 -1
- package/popconfirm/index.tsx +14 -6
- package/radio/radioGroup.tsx +4 -15
- package/table/ColumnFilter.tsx +2 -1
- package/table/ColumnSorter.tsx +16 -10
- package/table/Table.tsx +7 -4
- package/tabs/TabBar.tsx +7 -1
- package/transfer/index.tsx +7 -2
- package/webpack.config.js +3 -1
package/checkbox/checkbox.tsx
CHANGED
|
@@ -235,8 +235,12 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
235
235
|
const name = inGroup && this.context.checkboxGroup.name;
|
|
236
236
|
const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
|
|
237
237
|
|
|
238
|
+
if (!children && !extra) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
|
|
238
242
|
const renderContent = () => (
|
|
239
|
-
|
|
243
|
+
<div className={`${prefix}-content`}>
|
|
240
244
|
{children ? (
|
|
241
245
|
<span id={addonId} className={`${prefix}-addon`} x-semi-prop={xSemiPropChildren}>
|
|
242
246
|
{children}
|
|
@@ -247,7 +251,7 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
247
251
|
{extra}
|
|
248
252
|
</div>
|
|
249
253
|
) : null}
|
|
250
|
-
|
|
254
|
+
</div>
|
|
251
255
|
);
|
|
252
256
|
return (
|
|
253
257
|
// label is better than span, however span is here which is to solve gitlab issue #364
|
|
@@ -276,11 +280,7 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
276
280
|
onInputFocus={this.handleFocusVisible}
|
|
277
281
|
onInputBlur={this.handleBlur}
|
|
278
282
|
/>
|
|
279
|
-
{
|
|
280
|
-
props.isCardType ?
|
|
281
|
-
<div>{renderContent()}</div> :
|
|
282
|
-
renderContent()
|
|
283
|
-
}
|
|
283
|
+
{renderContent()}
|
|
284
284
|
</span>
|
|
285
285
|
);
|
|
286
286
|
}
|
|
@@ -6,7 +6,7 @@ import { checkboxGroupClasses as css, strings } from '@douyinfe/semi-foundation/
|
|
|
6
6
|
import CheckboxGroupFoundation, { CheckboxGroupAdapter } from '@douyinfe/semi-foundation/checkbox/checkboxGroupFoundation';
|
|
7
7
|
import BaseComponent from '../_base/baseComponent';
|
|
8
8
|
import { Context } from './context';
|
|
9
|
-
import {
|
|
9
|
+
import { isEqual } from 'lodash';
|
|
10
10
|
import Checkbox, { CheckboxEvent } from './checkbox';
|
|
11
11
|
|
|
12
12
|
export type CheckboxDirection = 'horizontal' | 'vertical';
|
|
@@ -136,7 +136,6 @@ class CheckboxGroup extends BaseComponent<CheckboxGroupProps, CheckboxGroupState
|
|
|
136
136
|
disabled={this.props.disabled}
|
|
137
137
|
value={option}
|
|
138
138
|
prefixCls={prefixCls}
|
|
139
|
-
type={type}
|
|
140
139
|
>
|
|
141
140
|
{option}
|
|
142
141
|
</Checkbox>
|
|
@@ -153,7 +152,6 @@ class CheckboxGroup extends BaseComponent<CheckboxGroupProps, CheckboxGroupState
|
|
|
153
152
|
className={option.className}
|
|
154
153
|
style={option.style}
|
|
155
154
|
onChange={option.onChange}
|
|
156
|
-
type={type}
|
|
157
155
|
>
|
|
158
156
|
{option.label}
|
|
159
157
|
</Checkbox>
|
|
@@ -161,14 +159,7 @@ class CheckboxGroup extends BaseComponent<CheckboxGroupProps, CheckboxGroupState
|
|
|
161
159
|
}
|
|
162
160
|
});
|
|
163
161
|
} else if (children) {
|
|
164
|
-
inner = (React.Children.toArray(children) as React.ReactElement[]).map((itm, index) => {
|
|
165
|
-
const props: Record<string, any> = { key: index, role: 'listitem' };
|
|
166
|
-
const isCheckboxComp = ['Checkbox', 'CheckboxWithGroup'].some(comp => [get(itm, 'type.displayName'), get(itm, 'type.name')].includes(comp));
|
|
167
|
-
if (isCheckboxComp) {
|
|
168
|
-
props.type = type;
|
|
169
|
-
}
|
|
170
|
-
return React.cloneElement(itm, props);
|
|
171
|
-
});
|
|
162
|
+
inner = (React.Children.toArray(children) as React.ReactElement[]).map((itm, index) => React.cloneElement(itm, { key: index, role: 'listitem' }));
|
|
172
163
|
}
|
|
173
164
|
|
|
174
165
|
return (
|
package/dist/css/semi.css
CHANGED
|
@@ -3471,7 +3471,7 @@ body {
|
|
|
3471
3471
|
box-sizing: border-box;
|
|
3472
3472
|
position: relative;
|
|
3473
3473
|
display: flex;
|
|
3474
|
-
align-items:
|
|
3474
|
+
align-items: flex-start;
|
|
3475
3475
|
flex-wrap: wrap;
|
|
3476
3476
|
font-size: 14px;
|
|
3477
3477
|
line-height: 20px;
|
|
@@ -3479,6 +3479,7 @@ body {
|
|
|
3479
3479
|
cursor: pointer;
|
|
3480
3480
|
transition: background-color var(--semi-transition_duration-faster) var(--semi-transition_function-easeIn) var(--semi-transition_delay-fastest), border var(--semi-transition_duration-faster) var(--semi-transition_function-easeIn) var(--semi-transition_delay-fastest);
|
|
3481
3481
|
transform: scale(var(--semi-transform_scale-none));
|
|
3482
|
+
column-gap: 8px;
|
|
3482
3483
|
}
|
|
3483
3484
|
.semi-checkbox input[type=checkbox] {
|
|
3484
3485
|
position: absolute;
|
|
@@ -3489,11 +3490,16 @@ body {
|
|
|
3489
3490
|
margin: 0;
|
|
3490
3491
|
opacity: 0;
|
|
3491
3492
|
}
|
|
3493
|
+
.semi-checkbox-content {
|
|
3494
|
+
flex: 1;
|
|
3495
|
+
display: flex;
|
|
3496
|
+
flex-direction: column;
|
|
3497
|
+
row-gap: 4px;
|
|
3498
|
+
}
|
|
3492
3499
|
.semi-checkbox-addon {
|
|
3493
3500
|
display: flex;
|
|
3494
3501
|
flex: 1;
|
|
3495
3502
|
align-items: center;
|
|
3496
|
-
padding-left: 8px;
|
|
3497
3503
|
color: var(--semi-color-text-0);
|
|
3498
3504
|
line-height: 20px;
|
|
3499
3505
|
user-select: none;
|
|
@@ -3722,9 +3728,7 @@ body {
|
|
|
3722
3728
|
flex-grow: 1;
|
|
3723
3729
|
flex-basis: 100%;
|
|
3724
3730
|
box-sizing: border-box;
|
|
3725
|
-
padding-left: 24px;
|
|
3726
3731
|
color: var(--semi-color-text-2);
|
|
3727
|
-
margin-top: 4px;
|
|
3728
3732
|
}
|
|
3729
3733
|
.semi-checkbox-focus {
|
|
3730
3734
|
outline: 2px solid var(--semi-color-primary-light-active);
|
|
@@ -15309,7 +15313,6 @@ body {
|
|
|
15309
15313
|
.semi-select-option-icon {
|
|
15310
15314
|
width: 12px;
|
|
15311
15315
|
color: transparent;
|
|
15312
|
-
visibility: hidden;
|
|
15313
15316
|
margin-right: 8px;
|
|
15314
15317
|
display: flex;
|
|
15315
15318
|
justify-content: center;
|
|
@@ -15350,7 +15353,6 @@ body {
|
|
|
15350
15353
|
font-weight: 600;
|
|
15351
15354
|
}
|
|
15352
15355
|
.semi-select-option-selected .semi-select-option-icon {
|
|
15353
|
-
visibility: visible;
|
|
15354
15356
|
color: var(--semi-color-text-2);
|
|
15355
15357
|
}
|
|
15356
15358
|
.semi-select-option-focused {
|
|
@@ -17395,10 +17397,14 @@ body {
|
|
|
17395
17397
|
display: inline-block;
|
|
17396
17398
|
width: 16px;
|
|
17397
17399
|
height: 16px;
|
|
17398
|
-
cursor: pointer;
|
|
17399
17400
|
vertical-align: middle;
|
|
17400
17401
|
text-align: center;
|
|
17401
17402
|
}
|
|
17403
|
+
.semi-table .semi-table-column-sorter-wrapper {
|
|
17404
|
+
display: inline-flex;
|
|
17405
|
+
align-items: center;
|
|
17406
|
+
cursor: pointer;
|
|
17407
|
+
}
|
|
17402
17408
|
.semi-table .semi-table-column-sorter-up, .semi-table .semi-table-column-sorter-down {
|
|
17403
17409
|
height: 0;
|
|
17404
17410
|
display: block;
|
|
@@ -17421,11 +17427,11 @@ body {
|
|
|
17421
17427
|
display: inline-flex;
|
|
17422
17428
|
cursor: pointer;
|
|
17423
17429
|
color: var(--semi-color-text-2);
|
|
17424
|
-
|
|
17430
|
+
align-items: center;
|
|
17425
17431
|
}
|
|
17426
17432
|
.semi-table .semi-table-column-filter svg {
|
|
17427
|
-
width:
|
|
17428
|
-
height:
|
|
17433
|
+
width: 16px;
|
|
17434
|
+
height: 16px;
|
|
17429
17435
|
}
|
|
17430
17436
|
.semi-table .semi-table-column-filter.on {
|
|
17431
17437
|
color: var(--semi-color-primary);
|