Skip to content

Commit fdbfe38

Browse files
committed
chore(platform): add scss file of table
1 parent 4cc7bea commit fdbfe38

4 files changed

Lines changed: 49 additions & 13 deletions

File tree

packages/platform/src/app/components/table/Table.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,7 @@ export function AppTable<T = any>(props: AppTableProps<T>): JSX.Element | null {
208208
</table>
209209
</DTable>
210210
<div className={getClassName('d-md-none', className)}>
211-
{aName && (
212-
<h2 className="app-title text-center" style={{ margin: '0 0 8px', paddingBottom: 4 }}>
213-
{aName}
214-
</h2>
215-
)}
211+
{aName && <h2 className="app-table__title">{aName}</h2>}
216212
{aData.length === 0 ? (
217213
<DEmpty
218214
dIcon={
@@ -233,6 +229,7 @@ export function AppTable<T = any>(props: AppTableProps<T>): JSX.Element | null {
233229
<DCard key={id} className="mb-3">
234230
{(titleIndex !== -1 || aColumns[0].checkbox) && (
235231
<DCard.Header
232+
className="app-table__card-header"
236233
dAction={
237234
aActions
238235
? (() => {
@@ -281,10 +278,10 @@ export function AppTable<T = any>(props: AppTableProps<T>): JSX.Element | null {
281278
const content = titleIndex !== -1 && columns[titleIndex].td;
282279

283280
return (
284-
<div className="d-inline-flex align-items-center">
281+
<>
285282
{checkbox && checkbox(data, index)}
286-
{content && <div className="ms-2">{isString(content) ? get(data, content) : content(data, index)}</div>}
287-
</div>
283+
{content && <span>{isString(content) ? get(data, content) : content(data, index)}</span>}
284+
</>
288285
);
289286
})()}
290287
</DCard.Header>
@@ -359,13 +356,12 @@ export function AppTable<T = any>(props: AppTableProps<T>): JSX.Element | null {
359356
}
360357
})()}
361358
{expandNode !== false && (
362-
<div className="app-border-top">
359+
<div className="app-table__expand">
363360
{expands.has(id) && <div style={{ padding: 16 }}>{expandNode}</div>}
364361
<div
365-
className={getClassName('d-flex justify-content-center align-items-center', {
366-
'app-border-top': expands.has(id),
362+
className={getClassName('app-table__expand-button', {
363+
'is-expand': expands.has(id),
367364
})}
368-
style={{ height: 36 }}
369365
onClick={() => {
370366
setExpands((draft) => {
371367
if (draft.has(id)) {

packages/platform/src/styles/components/list.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
}
1010

1111
@include e(avatar) {
12-
flex: 0 0 auto;
1312
margin-right: 12px;
1413
}
1514

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@include b(table) {
2+
@include e(title) {
3+
margin: 0 0 8px;
4+
font-size: 1.1em;
5+
font-weight: 500;
6+
text-align: center;
7+
}
8+
9+
@include e(card-header) {
10+
.#{$rd-prefix}card__header-title {
11+
display: flex;
12+
align-items: center;
13+
14+
& > .#{$rd-prefix}checkbox {
15+
margin-right: 8px;
16+
}
17+
18+
& > span {
19+
@include utils-ellipsis;
20+
21+
flex: 1 0 0;
22+
}
23+
}
24+
}
25+
26+
@include e(expand) {
27+
border-top: 1px solid var(--#{$rd-prefix}color-border);
28+
}
29+
30+
@include e(expand-button) {
31+
display: flex;
32+
align-items: center;
33+
justify-content: center;
34+
height: 38px;
35+
36+
@include when(expand) {
37+
border-top: 1px solid var(--#{$rd-prefix}color-border);
38+
}
39+
}
40+
}

packages/platform/src/styles/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
@import 'components/route-header';
1717
@import 'components/status-dot';
1818
@import 'components/table-filter';
19+
@import 'components/table';

0 commit comments

Comments
 (0)