@douyinfe/semi-ui 2.1.6-alpha.0 → 2.2.0-beta.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/_base/_story/a11y.jsx +1302 -0
- package/_base/_story/a11y.scss +49 -0
- package/_base/_story/index.stories.js +3 -1
- package/_utils/index.ts +2 -1
- package/cascader/__test__/cascader.test.js +221 -0
- package/cascader/_story/cascader.stories.js +138 -0
- package/cascader/index.tsx +37 -21
- package/cascader/item.tsx +4 -2
- package/datePicker/__test__/datePicker.test.js +67 -2
- package/datePicker/_story/datePicker.stories.js +3 -1
- package/datePicker/_story/v2/YearButton.jsx +17 -0
- package/datePicker/_story/v2/index.js +1 -0
- package/datePicker/monthsGrid.tsx +12 -1
- package/datePicker/navigation.tsx +55 -29
- package/descriptions/__test__/descriptions.test.js +27 -1
- package/descriptions/_story/descriptions.stories.js +52 -2
- package/descriptions/item.tsx +1 -1
- package/dist/css/semi.css +38 -20
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +699 -160
- 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/_utils/index.d.ts +1 -0
- package/lib/cjs/_utils/index.js +3 -2
- package/lib/cjs/cascader/index.d.ts +7 -0
- package/lib/cjs/cascader/index.js +35 -22
- package/lib/cjs/cascader/item.d.ts +2 -0
- package/lib/cjs/cascader/item.js +4 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGrid.js +6 -0
- package/lib/cjs/datePicker/navigation.js +47 -7
- package/lib/cjs/descriptions/item.js +1 -1
- package/lib/cjs/form/baseForm.d.ts +6 -1
- package/lib/cjs/form/field.d.ts +6 -1
- package/lib/cjs/locale/source/es.d.ts +7 -0
- package/lib/cjs/locale/source/es.js +168 -0
- package/lib/cjs/rating/item.js +1 -1
- package/lib/cjs/select/index.d.ts +9 -0
- package/lib/cjs/select/index.js +10 -8
- package/lib/cjs/timeline/item.d.ts +3 -0
- package/lib/cjs/timeline/item.js +10 -4
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/fileCard.d.ts +2 -0
- package/lib/cjs/upload/fileCard.js +70 -45
- package/lib/cjs/upload/index.d.ts +23 -2
- package/lib/cjs/upload/index.js +133 -25
- package/lib/cjs/upload/interface.d.ts +3 -0
- package/lib/es/_utils/index.d.ts +1 -0
- package/lib/es/_utils/index.js +3 -2
- package/lib/es/cascader/index.d.ts +7 -0
- package/lib/es/cascader/index.js +34 -25
- package/lib/es/cascader/item.d.ts +2 -0
- package/lib/es/cascader/item.js +4 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -0
- package/lib/es/datePicker/monthsGrid.js +6 -0
- package/lib/es/datePicker/navigation.js +48 -8
- package/lib/es/descriptions/item.js +1 -1
- package/lib/es/form/baseForm.d.ts +6 -1
- package/lib/es/form/field.d.ts +6 -1
- package/lib/es/locale/source/es.d.ts +7 -0
- package/lib/es/locale/source/es.js +157 -0
- package/lib/es/rating/item.js +1 -1
- package/lib/es/select/index.d.ts +9 -0
- package/lib/es/select/index.js +14 -8
- package/lib/es/timeline/item.d.ts +3 -0
- package/lib/es/timeline/item.js +9 -4
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/fileCard.d.ts +2 -0
- package/lib/es/upload/fileCard.js +69 -44
- package/lib/es/upload/index.d.ts +23 -2
- package/lib/es/upload/index.js +133 -24
- package/lib/es/upload/interface.d.ts +3 -0
- package/locale/source/es.ts +160 -0
- package/package.json +8 -8
- package/popover/Arrow.tsx +1 -1
- package/rating/item.tsx +1 -1
- package/select/_story/select.stories.js +25 -0
- package/select/index.tsx +17 -6
- package/timeline/_story/timeline.stories.js +50 -0
- package/timeline/item.tsx +7 -2
- package/upload/__test__/upload.test.js +50 -1
- package/upload/fileCard.tsx +110 -95
- package/upload/index.tsx +147 -53
- package/upload/interface.ts +3 -0
|
@@ -280,10 +280,12 @@ describe(`DatePicker`, () => {
|
|
|
280
280
|
const rightPanel = document.querySelector(`.${BASE_CLASS_PREFIX}-datepicker-month-grid-right`);
|
|
281
281
|
const rightNavBtns = rightPanel.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-navigation .${BASE_CLASS_PREFIX}-button`);
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
// 点击右边面板下一月
|
|
284
|
+
_.get(rightNavBtns, 2).click();
|
|
284
285
|
await sleep();
|
|
285
286
|
|
|
286
|
-
|
|
287
|
+
// 点击左边面板上一月
|
|
288
|
+
_.times(leftPrevClickTimes).forEach(() => _.get(leftNavBtns, 1).click());
|
|
287
289
|
|
|
288
290
|
const leftSecondWeek = leftPanel.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-week`)[1];
|
|
289
291
|
const leftSecondWeekDays = leftSecondWeek.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-day`);
|
|
@@ -870,4 +872,67 @@ describe(`DatePicker`, () => {
|
|
|
870
872
|
expect(allSeparators[0].textContent.trim()).toBe(rangeSeparator);
|
|
871
873
|
expect(allSeparators[1].textContent.trim()).toBe(rangeSeparator);
|
|
872
874
|
});
|
|
875
|
+
|
|
876
|
+
it('test click next/prev year buttons', () => {
|
|
877
|
+
let props = {
|
|
878
|
+
type: 'dateRange',
|
|
879
|
+
motion: false,
|
|
880
|
+
style: { width: 300 },
|
|
881
|
+
defaultPickerValue: new Date('2021-12-01'),
|
|
882
|
+
defaultOpen: true,
|
|
883
|
+
};
|
|
884
|
+
const elem = mount(<DatePicker {...props} />);
|
|
885
|
+
|
|
886
|
+
const leftPanel = document.querySelector(`.semi-datepicker-month-grid-left`);
|
|
887
|
+
const leftNavBtns = leftPanel.querySelector(`.semi-datepicker-navigation`).children;
|
|
888
|
+
const rightPanel = document.querySelector(`.semi-datepicker-month-grid-right`);
|
|
889
|
+
const rightNavBtns = rightPanel.querySelector(`.semi-datepicker-navigation`).children;
|
|
890
|
+
|
|
891
|
+
// 点击左边面板上一年
|
|
892
|
+
_.get(leftNavBtns, 0).click();
|
|
893
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-left .semi-datepicker-navigation-month`).textContent).toBe('2020年 12月');
|
|
894
|
+
// 点击左边面板下一年
|
|
895
|
+
_.get(leftNavBtns, 4).click();
|
|
896
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-left .semi-datepicker-navigation-month`).textContent).toBe('2021年 12月');
|
|
897
|
+
|
|
898
|
+
// 点击右边面板下一年
|
|
899
|
+
_.get(rightNavBtns, 4).click();
|
|
900
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-right .semi-datepicker-navigation-month`).textContent).toBe('2023年 1月');
|
|
901
|
+
// 点击右边面板上一年
|
|
902
|
+
_.get(rightNavBtns, 0).click();
|
|
903
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-right .semi-datepicker-navigation-month`).textContent).toBe('2022年 1月');
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
const testMonthSyncChange = type => {
|
|
907
|
+
let props = {
|
|
908
|
+
type,
|
|
909
|
+
motion: false,
|
|
910
|
+
style: { width: 300 },
|
|
911
|
+
defaultPickerValue: new Date('2021-12-01'),
|
|
912
|
+
defaultOpen: true,
|
|
913
|
+
};
|
|
914
|
+
const elem = mount(<DatePicker {...props} />);
|
|
915
|
+
|
|
916
|
+
const leftPanel = document.querySelector(`.semi-datepicker-month-grid-left`);
|
|
917
|
+
const leftNavBtns = leftPanel.querySelector(`.semi-datepicker-navigation`).children;
|
|
918
|
+
const rightPanel = document.querySelector(`.semi-datepicker-month-grid-right`);
|
|
919
|
+
const rightNavBtns = rightPanel.querySelector(`.semi-datepicker-navigation`).children;
|
|
920
|
+
|
|
921
|
+
// 点击左边面板下一月,自动切换右面板
|
|
922
|
+
_.get(leftNavBtns, 3).click();
|
|
923
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-left .semi-datepicker-navigation-month`).textContent).toBe('2022年 1月');
|
|
924
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-right .semi-datepicker-navigation-month`).textContent).toBe('2022年 2月');
|
|
925
|
+
// 点击右边面板上一月,自动切换左面板
|
|
926
|
+
_.get(rightNavBtns, 1).click();
|
|
927
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-left .semi-datepicker-navigation-month`).textContent).toBe('2021年 12月');
|
|
928
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-right .semi-datepicker-navigation-month`).textContent).toBe('2022年 1月');
|
|
929
|
+
|
|
930
|
+
// 点击左边面板上一月,不需要自动切换右面板
|
|
931
|
+
_.get(leftNavBtns, 1).click();
|
|
932
|
+
expect(document.querySelector(`.semi-datepicker-month-grid-left .semi-datepicker-navigation-month`).textContent).toBe('2021年 11月');
|
|
933
|
+
elem.unmount();
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
it('test month sync change dateRange type', () => { testMonthSyncChange('dateRange') });
|
|
937
|
+
it('test month sync change dateTimeRange type', () => { testMonthSyncChange('dateTimeRange')});
|
|
873
938
|
});
|
|
@@ -36,6 +36,7 @@ import DatePickerSlot from './DatePickerSlot';
|
|
|
36
36
|
import DatePickerTimeZone from './DatePickerTimeZone';
|
|
37
37
|
import BetterRangePicker from './BetterRangePicker';
|
|
38
38
|
import SyncSwitchMonth from './SyncSwitchMonth';
|
|
39
|
+
import { YearButton } from './v2';
|
|
39
40
|
|
|
40
41
|
export default {
|
|
41
42
|
title: 'DatePicker',
|
|
@@ -65,7 +66,8 @@ export {
|
|
|
65
66
|
DatePickerSlot,
|
|
66
67
|
DatePickerTimeZone,
|
|
67
68
|
BetterRangePicker,
|
|
68
|
-
SyncSwitchMonth
|
|
69
|
+
SyncSwitchMonth,
|
|
70
|
+
YearButton
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
const demoDiv = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DatePicker } from '../../../index';
|
|
3
|
+
|
|
4
|
+
export default function App() {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<h4>type=date</h4>
|
|
8
|
+
<DatePicker />
|
|
9
|
+
<h4>type=dateRange</h4>
|
|
10
|
+
<DatePicker type="dateRange" defaultPickerValue="2021-12" />
|
|
11
|
+
<h4>type=dateTimeRange</h4>
|
|
12
|
+
<DatePicker type="dateTimeRange" />
|
|
13
|
+
<h4>type=dateRange + compact</h4>
|
|
14
|
+
<DatePicker type="dateRange" density="compact" />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as YearButton } from './YearButton';
|
|
@@ -446,6 +446,10 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
446
446
|
});
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
getYAMOpenType = () => {
|
|
450
|
+
return this.foundation.getYAMOpenType();
|
|
451
|
+
}
|
|
452
|
+
|
|
449
453
|
renderTimePicker(panelType: PanelType, panelDetail: MonthInfo) {
|
|
450
454
|
const { type, locale, format, hideDisabledOptions, timePickerOpts, dateFnsLocale } = this.props;
|
|
451
455
|
const { pickerDate } = panelDetail;
|
|
@@ -606,8 +610,15 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
606
610
|
} else if (type === 'year' || type === 'month') {
|
|
607
611
|
content = 'year month';
|
|
608
612
|
}
|
|
613
|
+
const yearOpenType = this.getYAMOpenType();
|
|
614
|
+
|
|
609
615
|
return (
|
|
610
|
-
<div
|
|
616
|
+
<div
|
|
617
|
+
className={monthGridCls}
|
|
618
|
+
x-type={type}
|
|
619
|
+
x-panel-yearandmonth-open-type={yearOpenType}
|
|
620
|
+
ref={current => this.cacheRefCurrent('monthGrid', current)}
|
|
621
|
+
>
|
|
611
622
|
{content}
|
|
612
623
|
</div>
|
|
613
624
|
);
|
|
@@ -6,7 +6,7 @@ import { noop } from 'lodash';
|
|
|
6
6
|
import IconButton from '../iconButton';
|
|
7
7
|
import Button from '../button';
|
|
8
8
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/datePicker/constants';
|
|
9
|
-
import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons';
|
|
9
|
+
import { IconChevronLeft, IconChevronRight, IconDoubleChevronLeft, IconDoubleChevronRight } from '@douyinfe/semi-icons';
|
|
10
10
|
import { PanelType } from '@douyinfe/semi-foundation/datePicker/monthsGridFoundation';
|
|
11
11
|
|
|
12
12
|
const prefixCls = cssClasses.NAVIGATION;
|
|
@@ -68,6 +68,8 @@ export default class Navigation extends PureComponent<NavigationProps> {
|
|
|
68
68
|
onMonthClick,
|
|
69
69
|
onNextMonth,
|
|
70
70
|
onPrevMonth,
|
|
71
|
+
onPrevYear,
|
|
72
|
+
onNextYear,
|
|
71
73
|
density,
|
|
72
74
|
shouldBimonthSwitch,
|
|
73
75
|
panelType
|
|
@@ -77,43 +79,67 @@ export default class Navigation extends PureComponent<NavigationProps> {
|
|
|
77
79
|
const iconBtnSize = density === 'compact' ? 'default' : 'large';
|
|
78
80
|
const btnNoHorizontalPadding = true;
|
|
79
81
|
const buttonSize = density === 'compact' ? 'small' : 'default';
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const isLeftPanel = panelType === strings.PANEL_TYPE_LEFT;
|
|
83
|
+
const isRightPanel = panelType === strings.PANEL_TYPE_RIGHT;
|
|
84
|
+
|
|
85
|
+
// syncSwitchMonth and the current panel is the left
|
|
86
|
+
const hiddenLeftPanelRightButtons = shouldBimonthSwitch && isLeftPanel;
|
|
87
|
+
// syncSwitchMonth and the current panel is the right
|
|
88
|
+
const hiddenRightPanelLeftButtons = shouldBimonthSwitch && isRightPanel;
|
|
89
|
+
// `visibility: hidden` will keep the icon in position
|
|
90
|
+
const leftButtonStyle: React.CSSProperties = {};
|
|
91
|
+
const rightButtonStyle: React.CSSProperties = {};
|
|
92
|
+
if (hiddenRightPanelLeftButtons) {
|
|
93
|
+
leftButtonStyle.visibility = 'hidden';
|
|
94
|
+
}
|
|
95
|
+
if (hiddenLeftPanelRightButtons) {
|
|
96
|
+
rightButtonStyle.visibility = 'hidden';
|
|
97
|
+
}
|
|
84
98
|
|
|
85
99
|
const ref = forwardRef || this.navRef;
|
|
86
100
|
return (
|
|
87
101
|
<div className={prefixCls} ref={ref}>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
<IconButton
|
|
103
|
+
key="double-chevron-left"
|
|
104
|
+
icon={<IconDoubleChevronLeft size={iconBtnSize}/>}
|
|
105
|
+
size={buttonSize}
|
|
106
|
+
theme={btnTheme}
|
|
107
|
+
noHorizontalPadding={btnNoHorizontalPadding}
|
|
108
|
+
onClick={onPrevYear}
|
|
109
|
+
style={leftButtonStyle}
|
|
110
|
+
/>
|
|
111
|
+
<IconButton
|
|
112
|
+
key="chevron-left"
|
|
113
|
+
icon={<IconChevronLeft size={iconBtnSize} />}
|
|
114
|
+
size={buttonSize}
|
|
115
|
+
onClick={onPrevMonth}
|
|
116
|
+
theme={btnTheme}
|
|
117
|
+
noHorizontalPadding={btnNoHorizontalPadding}
|
|
118
|
+
style={leftButtonStyle}
|
|
119
|
+
/>
|
|
100
120
|
<div className={`${prefixCls}-month`}>
|
|
101
121
|
<Button onClick={onMonthClick} theme={btnTheme} size={buttonSize}>
|
|
102
122
|
<span>{monthText}</span>
|
|
103
123
|
</Button>
|
|
104
124
|
</div>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
125
|
+
<IconButton
|
|
126
|
+
key="chevron-right"
|
|
127
|
+
icon={<IconChevronRight size={iconBtnSize} />}
|
|
128
|
+
size={buttonSize}
|
|
129
|
+
onClick={onNextMonth}
|
|
130
|
+
theme={btnTheme}
|
|
131
|
+
noHorizontalPadding={btnNoHorizontalPadding}
|
|
132
|
+
style={rightButtonStyle}
|
|
133
|
+
/>
|
|
134
|
+
<IconButton
|
|
135
|
+
key="double-chevron-right"
|
|
136
|
+
icon={<IconDoubleChevronRight size={iconBtnSize}/>}
|
|
137
|
+
size={buttonSize}
|
|
138
|
+
theme={btnTheme}
|
|
139
|
+
noHorizontalPadding={btnNoHorizontalPadding}
|
|
140
|
+
onClick={onNextYear}
|
|
141
|
+
style={rightButtonStyle}
|
|
142
|
+
/>
|
|
117
143
|
</div>
|
|
118
144
|
);
|
|
119
145
|
}
|
|
@@ -17,6 +17,14 @@ const dataWithHide = [
|
|
|
17
17
|
{ key: '认证状态', value: '未认证' },
|
|
18
18
|
];
|
|
19
19
|
|
|
20
|
+
const dataWithKeyIsNode = [
|
|
21
|
+
{ key: <strong>实际用户数量</strong>, value: '1,480,000' },
|
|
22
|
+
{ key: '7天留存', value: '98%' },
|
|
23
|
+
{ key: '安全等级', value: '3级' },
|
|
24
|
+
{ key: '垂类标签', value: <Tag>电商</Tag> },
|
|
25
|
+
{ key: '认证状态', value: '未认证' },
|
|
26
|
+
];
|
|
27
|
+
|
|
20
28
|
function renderDescriptions(props) {
|
|
21
29
|
const realProps = {
|
|
22
30
|
data,
|
|
@@ -134,7 +142,6 @@ describe('Descriptions', () => {
|
|
|
134
142
|
largeDesc.unmount();
|
|
135
143
|
});
|
|
136
144
|
|
|
137
|
-
|
|
138
145
|
it('Descriptions with jsx', () => {
|
|
139
146
|
const desc = mount(
|
|
140
147
|
<Descriptions>
|
|
@@ -164,4 +171,23 @@ describe('Descriptions', () => {
|
|
|
164
171
|
).toEqual('1,480,000');
|
|
165
172
|
desc.unmount();
|
|
166
173
|
});
|
|
174
|
+
|
|
175
|
+
it('Descriptions with key is node', () => {
|
|
176
|
+
const desc = renderDescriptions({ data: dataWithKeyIsNode });
|
|
177
|
+
expect(
|
|
178
|
+
desc
|
|
179
|
+
.find(`.${BASE_CLASS_PREFIX}-descriptions-key strong`)
|
|
180
|
+
.at(0)
|
|
181
|
+
.getDOMNode()
|
|
182
|
+
.textContent
|
|
183
|
+
).toEqual('实际用户数量');
|
|
184
|
+
expect(
|
|
185
|
+
desc
|
|
186
|
+
.find(`.${BASE_CLASS_PREFIX}-descriptions-key`)
|
|
187
|
+
.at(1)
|
|
188
|
+
.getDOMNode()
|
|
189
|
+
.textContent
|
|
190
|
+
).toEqual('7天留存');
|
|
191
|
+
desc.unmount();
|
|
192
|
+
});
|
|
167
193
|
})
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
// import { withKnobs, text, boolean } from '@storybook/addon-knobs';
|
|
3
|
-
|
|
4
2
|
import Descriptions from '../index';
|
|
3
|
+
import Tag from '../../tag';
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
title: 'Descriptions',
|
|
@@ -93,3 +92,54 @@ export const DescriptionsItem = () => (
|
|
|
93
92
|
</div>
|
|
94
93
|
);
|
|
95
94
|
|
|
95
|
+
export const DescriptionsKeyIsNode = () => {
|
|
96
|
+
const data = [
|
|
97
|
+
{ key: <strong style={{color: 'red'}}>实际用户数量</strong>, value: '1,480,000' },
|
|
98
|
+
{ key: '7天留存', value: '98%' },
|
|
99
|
+
{ key: '安全等级', value: '3级' },
|
|
100
|
+
{ key: '垂类标签', value: <Tag style={{ margin: 0 }}>电商</Tag> },
|
|
101
|
+
{ key: '认证状态', value: '未认证' },
|
|
102
|
+
];
|
|
103
|
+
const style = {
|
|
104
|
+
boxShadow: 'var(--shadow-elevated)',
|
|
105
|
+
backgroundColor: 'var(--color-bg-2)',
|
|
106
|
+
borderRadius: '4px',
|
|
107
|
+
padding: '10px',
|
|
108
|
+
margin: '10px',
|
|
109
|
+
width: '200px',
|
|
110
|
+
};
|
|
111
|
+
return (
|
|
112
|
+
<>
|
|
113
|
+
<div>data 传入的写法</div>
|
|
114
|
+
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
|
|
115
|
+
<Descriptions align="center" data={data} style={style} />
|
|
116
|
+
<Descriptions align="justify" data={data} style={style} />
|
|
117
|
+
<Descriptions align="left" data={data} style={style} />
|
|
118
|
+
<Descriptions align="plain" data={data} style={style} />
|
|
119
|
+
</div>
|
|
120
|
+
<div>JSX 写法</div>
|
|
121
|
+
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
|
|
122
|
+
<Descriptions style={style} align="center" >
|
|
123
|
+
<Descriptions.Item itemKey={<strong style={{ color: 'red' }}>实际用户数量</strong>}>1,480,000</Descriptions.Item>
|
|
124
|
+
<Descriptions.Item itemKey="7天留存">98%</Descriptions.Item>
|
|
125
|
+
<Descriptions.Item itemKey="认证状态">未认证</Descriptions.Item>
|
|
126
|
+
</Descriptions>
|
|
127
|
+
<Descriptions style={style} align="justify">
|
|
128
|
+
<Descriptions.Item itemKey={<strong style={{ color: 'red' }}>实际用户数量</strong>}>1,480,000</Descriptions.Item>
|
|
129
|
+
<Descriptions.Item itemKey="7天留存">98%</Descriptions.Item>
|
|
130
|
+
<Descriptions.Item itemKey="认证状态">未认证</Descriptions.Item>
|
|
131
|
+
</Descriptions>
|
|
132
|
+
<Descriptions style={style} align="left">
|
|
133
|
+
<Descriptions.Item itemKey={<strong style={{ color: 'red' }}>实际用户数量</strong>}>1,480,000</Descriptions.Item>
|
|
134
|
+
<Descriptions.Item itemKey="7天留存">98%</Descriptions.Item>
|
|
135
|
+
<Descriptions.Item itemKey="认证状态">未认证</Descriptions.Item>
|
|
136
|
+
</Descriptions>
|
|
137
|
+
<Descriptions style={style} align="plain">
|
|
138
|
+
<Descriptions.Item itemKey={<strong style={{ color: 'red' }}>实际用户数量</strong>}>1,480,000</Descriptions.Item>
|
|
139
|
+
<Descriptions.Item itemKey="7天留存">98%</Descriptions.Item>
|
|
140
|
+
<Descriptions.Item itemKey="认证状态">未认证</Descriptions.Item>
|
|
141
|
+
</Descriptions>
|
|
142
|
+
</div>
|
|
143
|
+
</>
|
|
144
|
+
);
|
|
145
|
+
};
|
package/descriptions/item.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export default class Item extends PureComponent<DescriptionsItemProps> {
|
|
|
36
36
|
<tr className={className} style={style}>
|
|
37
37
|
<td className={`${prefixCls}-item`}>
|
|
38
38
|
<span className={keyCls}>
|
|
39
|
-
{
|
|
39
|
+
{itemKey}:
|
|
40
40
|
</span>
|
|
41
41
|
<span className={valCls}>
|
|
42
42
|
{typeof children === 'function' ? children() : children}
|
package/dist/css/semi.css
CHANGED
|
@@ -2685,11 +2685,11 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
2685
2685
|
.semi-cascader-selection-tag:first-child {
|
|
2686
2686
|
margin-left: 0;
|
|
2687
2687
|
}
|
|
2688
|
-
.semi-cascader-selection-tag-disabled {
|
|
2688
|
+
.semi-cascader-selection-tag-disabled.semi-tag {
|
|
2689
2689
|
color: var(--semi-color-disabled-text);
|
|
2690
2690
|
cursor: not-allowed;
|
|
2691
2691
|
}
|
|
2692
|
-
.semi-cascader-selection-tag-disabled .semi-tag-close {
|
|
2692
|
+
.semi-cascader-selection-tag-disabled.semi-tag .semi-tag-close {
|
|
2693
2693
|
color: var(--semi-color-disabled-text);
|
|
2694
2694
|
cursor: not-allowed;
|
|
2695
2695
|
pointer-events: none;
|
|
@@ -3497,6 +3497,9 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
3497
3497
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
3498
3498
|
min-height: 24px;
|
|
3499
3499
|
}
|
|
3500
|
+
.semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
3501
|
+
min-height: 216px;
|
|
3502
|
+
}
|
|
3500
3503
|
.semi-datepicker-panel-yam {
|
|
3501
3504
|
max-width: 284px;
|
|
3502
3505
|
}
|
|
@@ -3986,6 +3989,9 @@ body[theme-mode=dark], body .semi-always-dark {
|
|
|
3986
3989
|
.semi-datepicker-compact .semi-datepicker-month-grid .semi-scrolllist-item-wheel .semi-scrolllist-shade-post {
|
|
3987
3990
|
margin-top: 17px;
|
|
3988
3991
|
}
|
|
3992
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
3993
|
+
min-height: 168px;
|
|
3994
|
+
}
|
|
3989
3995
|
.semi-datepicker-compact.semi-datepicker-panel-yam .semi-scrolllist {
|
|
3990
3996
|
font-size: 12px;
|
|
3991
3997
|
line-height: 16px;
|
|
@@ -19402,6 +19408,8 @@ p.semi-typography-extended,
|
|
|
19402
19408
|
display: flex;
|
|
19403
19409
|
flex-wrap: wrap;
|
|
19404
19410
|
flex-shrink: 0;
|
|
19411
|
+
gap: 8px;
|
|
19412
|
+
margin-bottom: 8px;
|
|
19405
19413
|
}
|
|
19406
19414
|
.semi-upload-file-list-main p {
|
|
19407
19415
|
display: flex;
|
|
@@ -19428,8 +19436,6 @@ p.semi-typography-extended,
|
|
|
19428
19436
|
justify-content: space-between;
|
|
19429
19437
|
height: 52px;
|
|
19430
19438
|
width: 250px;
|
|
19431
|
-
margin-right: 8px;
|
|
19432
|
-
margin-bottom: 8px;
|
|
19433
19439
|
background-color: var(--semi-color-fill-0);
|
|
19434
19440
|
cursor: pointer;
|
|
19435
19441
|
}
|
|
@@ -19564,16 +19570,16 @@ p.semi-typography-extended,
|
|
|
19564
19570
|
flex-direction: column;
|
|
19565
19571
|
}
|
|
19566
19572
|
.semi-upload-picture[x-prompt-pos=bottom] .semi-upload-prompt {
|
|
19567
|
-
order:
|
|
19573
|
+
order: 1;
|
|
19568
19574
|
}
|
|
19569
19575
|
.semi-upload-picture[x-prompt-pos=bottom] .semi-upload-add {
|
|
19570
|
-
order:
|
|
19576
|
+
order: 0;
|
|
19571
19577
|
}
|
|
19572
19578
|
.semi-upload-picture[x-prompt-pos=right] .semi-upload-prompt {
|
|
19573
|
-
order:
|
|
19579
|
+
order: 1;
|
|
19574
19580
|
}
|
|
19575
19581
|
.semi-upload-picture[x-prompt-pos=right] .semi-upload-add {
|
|
19576
|
-
order:
|
|
19582
|
+
order: 0;
|
|
19577
19583
|
}
|
|
19578
19584
|
.semi-upload-picture-add {
|
|
19579
19585
|
background-color: var(--semi-color-fill-0);
|
|
@@ -19610,11 +19616,14 @@ p.semi-typography-extended,
|
|
|
19610
19616
|
margin-bottom: 0;
|
|
19611
19617
|
}
|
|
19612
19618
|
.semi-upload-picture-file-card {
|
|
19619
|
+
display: flex;
|
|
19620
|
+
align-items: center;
|
|
19621
|
+
justify-content: center;
|
|
19613
19622
|
height: 96px;
|
|
19614
19623
|
width: 96px;
|
|
19624
|
+
border-radius: var(--semi-border-radius-small);
|
|
19615
19625
|
position: relative;
|
|
19616
|
-
|
|
19617
|
-
margin-bottom: 8px;
|
|
19626
|
+
overflow: hidden;
|
|
19618
19627
|
}
|
|
19619
19628
|
.semi-upload-picture-file-card img {
|
|
19620
19629
|
height: 96px;
|
|
@@ -19679,6 +19688,22 @@ p.semi-typography-extended,
|
|
|
19679
19688
|
color: var(--semi-color-white);
|
|
19680
19689
|
transform: translate3D(-50%, -50%, 0);
|
|
19681
19690
|
}
|
|
19691
|
+
.semi-upload-picture-file-card-pic-info {
|
|
19692
|
+
display: inline-flex;
|
|
19693
|
+
box-sizing: border-box;
|
|
19694
|
+
justify-content: space-between;
|
|
19695
|
+
align-items: center;
|
|
19696
|
+
position: absolute;
|
|
19697
|
+
width: 100%;
|
|
19698
|
+
height: 24px;
|
|
19699
|
+
padding: 0 10px;
|
|
19700
|
+
bottom: 0;
|
|
19701
|
+
left: 0;
|
|
19702
|
+
color: var(--semi-color-white);
|
|
19703
|
+
font-size: 12px;
|
|
19704
|
+
font-weight: 600;
|
|
19705
|
+
background: linear-gradient(0deg, rgba(22, 22, 26, 0.3) 0%, rgba(22, 22, 26, 0) 77.08%);
|
|
19706
|
+
}
|
|
19682
19707
|
.semi-upload-picture-file-card-icon-loading, .semi-upload-picture-file-card-icon-error {
|
|
19683
19708
|
position: absolute;
|
|
19684
19709
|
bottom: 6px;
|
|
@@ -19691,6 +19716,9 @@ p.semi-typography-extended,
|
|
|
19691
19716
|
.semi-upload-picture-file-card-show-pointer {
|
|
19692
19717
|
cursor: pointer;
|
|
19693
19718
|
}
|
|
19719
|
+
.semi-upload-picture-file-card-error {
|
|
19720
|
+
outline: 1px solid var(--semi-color-danger);
|
|
19721
|
+
}
|
|
19694
19722
|
.semi-upload-drag-area {
|
|
19695
19723
|
border-radius: var(--semi-border-radius-small);
|
|
19696
19724
|
border: 2px dashed var(--semi-color-border);
|
|
@@ -19771,11 +19799,6 @@ p.semi-typography-extended,
|
|
|
19771
19799
|
.semi-portal-rtl .semi-upload-file-list-title-clear {
|
|
19772
19800
|
display: inline-block;
|
|
19773
19801
|
}
|
|
19774
|
-
.semi-rtl .semi-upload-file-card,
|
|
19775
|
-
.semi-portal-rtl .semi-upload-file-card {
|
|
19776
|
-
margin-right: 0;
|
|
19777
|
-
margin-left: 8px;
|
|
19778
|
-
}
|
|
19779
19802
|
.semi-rtl .semi-upload-file-card-info-size,
|
|
19780
19803
|
.semi-portal-rtl .semi-upload-file-card-info-size {
|
|
19781
19804
|
margin-left: 0;
|
|
@@ -19792,11 +19815,6 @@ p.semi-typography-extended,
|
|
|
19792
19815
|
margin-right: 0;
|
|
19793
19816
|
margin-left: 2px;
|
|
19794
19817
|
}
|
|
19795
|
-
.semi-rtl .semi-upload-picture-file-card,
|
|
19796
|
-
.semi-portal-rtl .semi-upload-picture-file-card {
|
|
19797
|
-
margin-right: 0;
|
|
19798
|
-
margin-left: 8px;
|
|
19799
|
-
}
|
|
19800
19818
|
.semi-rtl .semi-upload-picture-file-card-close,
|
|
19801
19819
|
.semi-portal-rtl .semi-upload-picture-file-card-close {
|
|
19802
19820
|
right: auto;
|