@dss-kit/ui-kit 1.0.1 → 1.0.2
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/README.md +29 -29
- package/dist/components/builders/Table/Table.js +169 -165
- package/dist/components/builders/Table/Table.types.d.ts +5 -1
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.d.ts +5 -0
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.js +23 -9
- package/dist/components/builders/Table/TablePlaceholder/TablePlaceholder.js +22 -22
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
- package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
- package/dist/styles/utils/breakpoints/base.scss +11 -11
- package/dist/styles/utils/breakpoints/index.scss +3 -3
- package/dist/styles/utils/breakpoints/screen.scss +61 -61
- package/dist/styles/utils/breakpoints/semantic.scss +31 -31
- package/dist/styles/utils/fonts/font-family.scss +3 -3
- package/dist/styles/utils/fonts/index.scss +1 -1
- package/dist/styles/utils/index.scss +5 -5
- package/dist/styles/utils/size/index.scss +1 -1
- package/dist/styles/utils/size/modifiers.scss +40 -40
- package/dist/styles/utils/style/index.scss +1 -1
- package/dist/styles/utils/style/variants.scss +34 -34
- package/dist/styles/utils/typography/_font-weight.scss +33 -33
- package/dist/styles/utils/typography/_variants.scss +85 -85
- package/dist/styles/utils/typography/index.scss +2 -2
- package/dist/ui-kit.cjs +8 -8
- package/package.json +94 -94
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Storybook
|
|
2
|
-
|
|
3
|
-
Storybook для библиотеки React-компонентов **UI Kit** (`@dss-kit/ui-kit`) с дизайн-системой.
|
|
4
|
-
Репозиторий хранит исходники компонентов и их Storybook, собирает контейнерный образ и
|
|
5
|
-
разворачивает Storybook в Kubernetes.
|
|
6
|
-
|
|
7
|
-
## Включает:
|
|
8
|
-
|
|
9
|
-
- React компоненты и дизайн-систему (CSS переменные и токены, SCSS утилиты, TypeScript типы, SVG иконки)
|
|
10
|
-
- Провайдеры тем (ThemeProviderScoped)
|
|
11
|
-
- Storybook как витрину компонентов
|
|
12
|
-
- CI/CD для сборки образа и деплоя в Kubernetes
|
|
13
|
-
|
|
14
|
-
## Деплой
|
|
15
|
-
|
|
16
|
-
- **Stable** — на merge в `main` создаётся релизный тег, собирается образ
|
|
17
|
-
`harbor.infra.dssnet.tech/dssnet/storybook` и разворачивается через ArgoCD.
|
|
18
|
-
- **Trial-превью** — кнопка в CI (`deploy:trial`) на любой ветке кроме `main` публикует Storybook
|
|
19
|
-
этой ветки на `storybook-trials-<id>.staging.dssnet.tech` (живёт 7 дней, продлевается при
|
|
20
|
-
повторном деплое).
|
|
21
|
-
|
|
22
|
-
## Документация
|
|
23
|
-
|
|
24
|
-
Ссылки на более подробную документацию по разделам
|
|
25
|
-
|
|
26
|
-
- **[Сборка](./docs/build/index.md)** — команды сборки, конфигурации Vite и т.д.
|
|
27
|
-
- **[Использование](./docs/usage/index.md)** — подключение стилей, примеры компонентов
|
|
28
|
-
- **[Стили](./docs/styles/index.md)** — подключение шрифтов, CSS переменных, базовые стили и миксины
|
|
29
|
-
- **[Утилиты](./docs/utils/index.md)** — функции хелперы
|
|
1
|
+
# Storybook
|
|
2
|
+
|
|
3
|
+
Storybook для библиотеки React-компонентов **UI Kit** (`@dss-kit/ui-kit`) с дизайн-системой.
|
|
4
|
+
Репозиторий хранит исходники компонентов и их Storybook, собирает контейнерный образ и
|
|
5
|
+
разворачивает Storybook в Kubernetes.
|
|
6
|
+
|
|
7
|
+
## Включает:
|
|
8
|
+
|
|
9
|
+
- React компоненты и дизайн-систему (CSS переменные и токены, SCSS утилиты, TypeScript типы, SVG иконки)
|
|
10
|
+
- Провайдеры тем (ThemeProviderScoped)
|
|
11
|
+
- Storybook как витрину компонентов
|
|
12
|
+
- CI/CD для сборки образа и деплоя в Kubernetes
|
|
13
|
+
|
|
14
|
+
## Деплой
|
|
15
|
+
|
|
16
|
+
- **Stable** — на merge в `main` создаётся релизный тег, собирается образ
|
|
17
|
+
`harbor.infra.dssnet.tech/dssnet/storybook` и разворачивается через ArgoCD.
|
|
18
|
+
- **Trial-превью** — кнопка в CI (`deploy:trial`) на любой ветке кроме `main` публикует Storybook
|
|
19
|
+
этой ветки на `storybook-trials-<id>.staging.dssnet.tech` (живёт 7 дней, продлевается при
|
|
20
|
+
повторном деплое).
|
|
21
|
+
|
|
22
|
+
## Документация
|
|
23
|
+
|
|
24
|
+
Ссылки на более подробную документацию по разделам
|
|
25
|
+
|
|
26
|
+
- **[Сборка](./docs/build/index.md)** — команды сборки, конфигурации Vite и т.д.
|
|
27
|
+
- **[Использование](./docs/usage/index.md)** — подключение стилей, примеры компонентов
|
|
28
|
+
- **[Стили](./docs/styles/index.md)** — подключение шрифтов, CSS переменных, базовые стили и миксины
|
|
29
|
+
- **[Утилиты](./docs/utils/index.md)** — функции хелперы
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { cx as h, css as u } from "@emotion/css";
|
|
3
|
+
import { useReactTable as ve, getPaginationRowModel as Pe, getSortedRowModel as Me, getCoreRowModel as Ee, flexRender as v, createColumnHelper as Ie } from "@tanstack/react-table";
|
|
4
|
+
import { useMemo as ke, useImperativeHandle as ze } from "react";
|
|
5
|
+
import De from "../../../assets/svg/table/search.svg.js";
|
|
6
6
|
import { typography as Le } from "../../../styles/utils/typography.js";
|
|
7
|
-
import { useControllableState as
|
|
8
|
-
import { getColumnPinningStyles as
|
|
9
|
-
import { TablePlaceholder as
|
|
10
|
-
import { TableWrapper as
|
|
11
|
-
import { TableHeadRow as
|
|
12
|
-
import { TablePagination as
|
|
13
|
-
import { TableHeadCell as
|
|
14
|
-
import { TableBodyCell as
|
|
7
|
+
import { useControllableState as r } from "./Table.hooks.js";
|
|
8
|
+
import { getColumnPinningStyles as b } from "./Table.utils.js";
|
|
9
|
+
import { TablePlaceholder as Ve } from "./TablePlaceholder/TablePlaceholder.js";
|
|
10
|
+
import { TableWrapper as We } from "./TableWrapper/TableWrapper.js";
|
|
11
|
+
import { TableHeadRow as Be } from "./TableHeadRow/TableHeadRow.js";
|
|
12
|
+
import { TablePagination as Fe } from "./TablePagination/TablePagination.js";
|
|
13
|
+
import { TableHeadCell as $e } from "./TableHeadCell/TableHeadCell.js";
|
|
14
|
+
import { TableBodyCell as je } from "./TableBodyCell/TableBodyCell.js";
|
|
15
15
|
import { TableBodyRow as Ae } from "./TableBodyRow/TableBodyRow.js";
|
|
16
|
-
import { TableBodyCellContent as
|
|
16
|
+
import { TableBodyCellContent as E } from "./TableBodyCellContent/TableBodyCellContent.js";
|
|
17
17
|
import { Skeleton as Ke } from "../../shared/Skeleton/Skeleton.js";
|
|
18
18
|
import { TableHeadCellContent as Oe } from "./TableHeadCellContent/TableHeadCellContent.js";
|
|
19
|
-
import { TableHeadCellContentSortable as
|
|
20
|
-
import { theme as
|
|
21
|
-
import { Box as
|
|
22
|
-
const { spacing:
|
|
19
|
+
import { TableHeadCellContentSortable as Ge } from "./TableHeadCellContentSortable/TableHeadCellContentSortable.js";
|
|
20
|
+
import { theme as Ue } from "../../../utils/theme/index.js";
|
|
21
|
+
import { Box as qe } from "../Box/Box.js";
|
|
22
|
+
const { spacing: P, color: n } = Ue, Je = u({
|
|
23
23
|
...Le.body2,
|
|
24
24
|
fontWeight: 500,
|
|
25
25
|
width: "100%",
|
|
@@ -27,36 +27,36 @@ const { spacing: M, color: l } = qe, Je = b({
|
|
|
27
27
|
minWidth: "max-content",
|
|
28
28
|
borderCollapse: "collapse",
|
|
29
29
|
borderSpacing: 0,
|
|
30
|
-
backgroundColor:
|
|
31
|
-
}), Qe =
|
|
32
|
-
backgroundColor:
|
|
33
|
-
color:
|
|
34
|
-
}),
|
|
30
|
+
backgroundColor: n.fill.bg_primary
|
|
31
|
+
}), Qe = u({
|
|
32
|
+
backgroundColor: n.fill.bg_secondary,
|
|
33
|
+
color: n.text.tertiary
|
|
34
|
+
}), Xe = u({
|
|
35
35
|
pointerEvents: "none",
|
|
36
36
|
userSelect: "none"
|
|
37
|
-
}),
|
|
38
|
-
ref:
|
|
39
|
-
data:
|
|
40
|
-
columns:
|
|
41
|
-
showBorders:
|
|
42
|
-
enableSorting:
|
|
43
|
-
enablePagination:
|
|
44
|
-
enableRowSelection:
|
|
45
|
-
enableMultiRowSelection:
|
|
46
|
-
enableColumnPinning:
|
|
37
|
+
}), M = ["70%", "55%", "80%", "60%"], Ye = `linear-gradient(${n.fill.accent_tint_low}, ${n.fill.accent_tint_low}), ${n.fill.bg_primary}`, m = ({
|
|
38
|
+
ref: I,
|
|
39
|
+
data: C,
|
|
40
|
+
columns: S,
|
|
41
|
+
showBorders: c = !0,
|
|
42
|
+
enableSorting: k = !1,
|
|
43
|
+
enablePagination: y = !1,
|
|
44
|
+
enableRowSelection: z = !1,
|
|
45
|
+
enableMultiRowSelection: D = !1,
|
|
46
|
+
enableColumnPinning: g = !1,
|
|
47
47
|
columnPinning: L,
|
|
48
|
-
onColumnPinningChange:
|
|
49
|
-
sorting:
|
|
50
|
-
onSortingChange:
|
|
51
|
-
manualSorting:
|
|
52
|
-
columnFilters:
|
|
53
|
-
onColumnFiltersChange:
|
|
48
|
+
onColumnPinningChange: V,
|
|
49
|
+
sorting: W,
|
|
50
|
+
onSortingChange: B,
|
|
51
|
+
manualSorting: F,
|
|
52
|
+
columnFilters: $,
|
|
53
|
+
onColumnFiltersChange: j,
|
|
54
54
|
columnVisibility: A,
|
|
55
55
|
onColumnVisibilityChange: K,
|
|
56
56
|
pagination: O,
|
|
57
|
-
onPaginationChange:
|
|
58
|
-
rowSelection:
|
|
59
|
-
onRowSelectionChange:
|
|
57
|
+
onPaginationChange: G,
|
|
58
|
+
rowSelection: U,
|
|
59
|
+
onRowSelectionChange: q,
|
|
60
60
|
totalCount: s,
|
|
61
61
|
loading: i = !1,
|
|
62
62
|
loadingRowCount: J = 10,
|
|
@@ -65,199 +65,203 @@ const { spacing: M, color: l } = qe, Je = b({
|
|
|
65
65
|
description: "Try adjusting your search or filters",
|
|
66
66
|
action: "Reset"
|
|
67
67
|
},
|
|
68
|
-
className:
|
|
69
|
-
containerClassName:
|
|
70
|
-
theadClassName:
|
|
71
|
-
tbodyClassName:
|
|
72
|
-
emptyStateClassName:
|
|
73
|
-
emptyStateTitleClassName:
|
|
74
|
-
emptyStateDescriptionClassName:
|
|
68
|
+
className: X,
|
|
69
|
+
containerClassName: w,
|
|
70
|
+
theadClassName: Y,
|
|
71
|
+
tbodyClassName: Z,
|
|
72
|
+
emptyStateClassName: ee,
|
|
73
|
+
emptyStateTitleClassName: oe,
|
|
74
|
+
emptyStateDescriptionClassName: te,
|
|
75
75
|
paginationClassName: ne,
|
|
76
|
-
tableOptions:
|
|
77
|
-
onRowClick:
|
|
78
|
-
getRowId:
|
|
79
|
-
headCellComponent:
|
|
80
|
-
bodyCellComponent:
|
|
81
|
-
headRowComponent:
|
|
82
|
-
bodyRowComponent:
|
|
83
|
-
onReset:
|
|
76
|
+
tableOptions: le = {},
|
|
77
|
+
onRowClick: R,
|
|
78
|
+
getRowId: ie,
|
|
79
|
+
headCellComponent: ae = $e,
|
|
80
|
+
bodyCellComponent: T = je,
|
|
81
|
+
headRowComponent: re = Be,
|
|
82
|
+
bodyRowComponent: x = Ae,
|
|
83
|
+
onReset: se,
|
|
84
84
|
paginationVariant: me,
|
|
85
|
-
paginationLabels:
|
|
86
|
-
renderPageSizeSelectorDropdownItem:
|
|
87
|
-
renderPageSizeSelectorInputItem:
|
|
85
|
+
paginationLabels: ce,
|
|
86
|
+
renderPageSizeSelectorDropdownItem: ge,
|
|
87
|
+
renderPageSizeSelectorInputItem: de
|
|
88
88
|
}) => {
|
|
89
|
-
const [
|
|
90
|
-
|
|
91
|
-
F,
|
|
92
|
-
[]
|
|
93
|
-
), [he, Ce] = m(
|
|
89
|
+
const [pe, he] = r(
|
|
90
|
+
W,
|
|
94
91
|
B,
|
|
95
|
-
D,
|
|
96
92
|
[]
|
|
97
|
-
), [
|
|
93
|
+
), [Ce, fe] = r(
|
|
94
|
+
$,
|
|
95
|
+
j,
|
|
96
|
+
[]
|
|
97
|
+
), [be, ue] = r(
|
|
98
98
|
A,
|
|
99
99
|
K,
|
|
100
100
|
{}
|
|
101
|
-
), [a,
|
|
101
|
+
), [a, f] = r(
|
|
102
102
|
O,
|
|
103
|
-
|
|
103
|
+
G,
|
|
104
104
|
{ pageIndex: 0, pageSize: 10 }
|
|
105
|
-
), [
|
|
105
|
+
), [Se, ye] = r(U, q, {}), [we, Re] = r(
|
|
106
106
|
L,
|
|
107
|
-
|
|
107
|
+
V,
|
|
108
108
|
{ left: [], right: [] }
|
|
109
|
-
),
|
|
110
|
-
() =>
|
|
109
|
+
), _ = F ?? !!s, Te = ke(
|
|
110
|
+
() => S.map((e) => ({
|
|
111
111
|
enableSorting: !1,
|
|
112
112
|
...e
|
|
113
113
|
})),
|
|
114
|
-
[
|
|
115
|
-
),
|
|
116
|
-
data:
|
|
117
|
-
columns:
|
|
114
|
+
[S]
|
|
115
|
+
), l = ve({
|
|
116
|
+
data: C,
|
|
117
|
+
columns: Te,
|
|
118
118
|
state: {
|
|
119
|
-
sorting:
|
|
120
|
-
columnFilters:
|
|
121
|
-
columnVisibility:
|
|
119
|
+
sorting: pe,
|
|
120
|
+
columnFilters: Ce,
|
|
121
|
+
columnVisibility: be,
|
|
122
122
|
pagination: a,
|
|
123
|
-
rowSelection:
|
|
124
|
-
columnPinning:
|
|
123
|
+
rowSelection: Se,
|
|
124
|
+
columnPinning: we
|
|
125
125
|
},
|
|
126
|
-
onSortingChange:
|
|
127
|
-
onColumnFiltersChange:
|
|
128
|
-
onColumnVisibilityChange:
|
|
129
|
-
onPaginationChange:
|
|
130
|
-
onRowSelectionChange:
|
|
131
|
-
onColumnPinningChange:
|
|
132
|
-
getCoreRowModel:
|
|
133
|
-
getSortedRowModel:
|
|
134
|
-
getPaginationRowModel:
|
|
135
|
-
enableRowSelection:
|
|
136
|
-
enableMultiRowSelection:
|
|
137
|
-
enableColumnPinning:
|
|
138
|
-
getRowId:
|
|
139
|
-
manualSorting:
|
|
126
|
+
onSortingChange: he,
|
|
127
|
+
onColumnFiltersChange: fe,
|
|
128
|
+
onColumnVisibilityChange: ue,
|
|
129
|
+
onPaginationChange: f,
|
|
130
|
+
onRowSelectionChange: ye,
|
|
131
|
+
onColumnPinningChange: Re,
|
|
132
|
+
getCoreRowModel: Ee(),
|
|
133
|
+
getSortedRowModel: k && !_ ? Me() : void 0,
|
|
134
|
+
getPaginationRowModel: y ? Pe() : void 0,
|
|
135
|
+
enableRowSelection: z,
|
|
136
|
+
enableMultiRowSelection: D,
|
|
137
|
+
enableColumnPinning: g,
|
|
138
|
+
getRowId: ie,
|
|
139
|
+
manualSorting: _,
|
|
140
140
|
manualPagination: !!s,
|
|
141
141
|
pageCount: s ? Math.ceil(s / a.pageSize) : void 0,
|
|
142
|
-
...
|
|
142
|
+
...le
|
|
143
143
|
});
|
|
144
|
-
|
|
145
|
-
const { rows:
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
|
|
144
|
+
ze(I, () => l);
|
|
145
|
+
const { rows: H } = l.getRowModel(), xe = (e, t) => {
|
|
146
|
+
R && R(e.original, t);
|
|
147
|
+
}, _e = (e) => /* @__PURE__ */ o(
|
|
148
|
+
ae,
|
|
149
149
|
{
|
|
150
150
|
style: {
|
|
151
151
|
width: e.getSize(),
|
|
152
|
-
...
|
|
153
|
-
|
|
152
|
+
...g && b(
|
|
153
|
+
l,
|
|
154
154
|
e.column,
|
|
155
|
-
|
|
155
|
+
n.fill.bg_secondary
|
|
156
156
|
)
|
|
157
157
|
},
|
|
158
158
|
onClick: i ? void 0 : e.column.getToggleSortingHandler(),
|
|
159
|
-
children: e.isPlaceholder ? null :
|
|
160
|
-
},
|
|
161
|
-
e.id
|
|
162
|
-
), ve = (e, n) => /* @__PURE__ */ o(
|
|
163
|
-
R,
|
|
164
|
-
{
|
|
165
|
-
showBorders: g,
|
|
166
|
-
onClick: () => Re(e, n),
|
|
167
|
-
children: e.getVisibleCells().map((r) => /* @__PURE__ */ o(
|
|
168
|
-
x,
|
|
169
|
-
{
|
|
170
|
-
style: d ? f(
|
|
171
|
-
t,
|
|
172
|
-
r.column,
|
|
173
|
-
l.fill.bg_primary
|
|
174
|
-
) : void 0,
|
|
175
|
-
children: P(r.column.columnDef.cell, r.getContext())
|
|
176
|
-
},
|
|
177
|
-
r.id
|
|
178
|
-
))
|
|
159
|
+
children: e.isPlaceholder ? null : v(e.column.columnDef.header, e.getContext())
|
|
179
160
|
},
|
|
180
161
|
e.id
|
|
181
|
-
), He = (e) =>
|
|
182
|
-
|
|
162
|
+
), He = (e, t) => {
|
|
163
|
+
const d = e.getIsSelected();
|
|
164
|
+
return /* @__PURE__ */ o(
|
|
165
|
+
x,
|
|
166
|
+
{
|
|
167
|
+
showBorders: c,
|
|
168
|
+
selected: d,
|
|
169
|
+
onClick: () => xe(e, t),
|
|
170
|
+
children: e.getVisibleCells().map((p) => /* @__PURE__ */ o(
|
|
171
|
+
T,
|
|
172
|
+
{
|
|
173
|
+
style: g ? b(
|
|
174
|
+
l,
|
|
175
|
+
p.column,
|
|
176
|
+
d ? Ye : n.fill.bg_primary
|
|
177
|
+
) : void 0,
|
|
178
|
+
children: v(p.column.columnDef.cell, p.getContext())
|
|
179
|
+
},
|
|
180
|
+
p.id
|
|
181
|
+
))
|
|
182
|
+
},
|
|
183
|
+
e.id
|
|
184
|
+
);
|
|
185
|
+
}, Ne = (e) => /* @__PURE__ */ o(
|
|
186
|
+
x,
|
|
183
187
|
{
|
|
184
|
-
showBorders:
|
|
185
|
-
children:
|
|
186
|
-
|
|
188
|
+
showBorders: c,
|
|
189
|
+
children: l.getVisibleLeafColumns().map((t, d) => /* @__PURE__ */ o(
|
|
190
|
+
T,
|
|
187
191
|
{
|
|
188
|
-
style:
|
|
189
|
-
children: /* @__PURE__ */ o(
|
|
192
|
+
style: g ? b(l, t, n.fill.bg_primary) : void 0,
|
|
193
|
+
children: /* @__PURE__ */ o(E, { children: /* @__PURE__ */ o(
|
|
190
194
|
Ke,
|
|
191
195
|
{
|
|
192
196
|
variant: "text",
|
|
193
197
|
height: 16,
|
|
194
|
-
width:
|
|
198
|
+
width: M[d % M.length]
|
|
195
199
|
}
|
|
196
200
|
) })
|
|
197
201
|
},
|
|
198
|
-
|
|
202
|
+
t.id
|
|
199
203
|
))
|
|
200
204
|
},
|
|
201
205
|
`skeleton-row-${e}`
|
|
202
206
|
);
|
|
203
|
-
return !i && !
|
|
204
|
-
|
|
207
|
+
return !i && !H.length ? /* @__PURE__ */ o(
|
|
208
|
+
Ve,
|
|
205
209
|
{
|
|
206
210
|
icon: /* @__PURE__ */ o(
|
|
207
|
-
|
|
211
|
+
De,
|
|
208
212
|
{
|
|
209
213
|
width: 24,
|
|
210
214
|
height: 24,
|
|
211
|
-
style: { color:
|
|
215
|
+
style: { color: n.icon.tertiary, marginBottom: P.sm }
|
|
212
216
|
}
|
|
213
217
|
),
|
|
214
218
|
labels: Q,
|
|
215
|
-
onReset:
|
|
216
|
-
className:
|
|
217
|
-
titleClassName:
|
|
218
|
-
descriptionClassName:
|
|
219
|
+
onReset: se,
|
|
220
|
+
className: h(w, ee),
|
|
221
|
+
titleClassName: oe,
|
|
222
|
+
descriptionClassName: te
|
|
219
223
|
}
|
|
220
|
-
) : /* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */ o(
|
|
224
|
+
) : /* @__PURE__ */ N(qe, { w: "full", gap: P.xl, className: h(w), children: [
|
|
225
|
+
/* @__PURE__ */ o(We, { data: C, showBorders: c, children: /* @__PURE__ */ N("table", { className: h(Je, X), children: [
|
|
222
226
|
/* @__PURE__ */ o(
|
|
223
227
|
"thead",
|
|
224
228
|
{
|
|
225
|
-
className:
|
|
229
|
+
className: h(
|
|
226
230
|
Qe,
|
|
227
|
-
{ [
|
|
228
|
-
|
|
231
|
+
{ [Xe]: i },
|
|
232
|
+
Y
|
|
229
233
|
),
|
|
230
234
|
"aria-busy": i,
|
|
231
|
-
children:
|
|
235
|
+
children: l.getHeaderGroups().map((e) => /* @__PURE__ */ o(re, { showBorders: c, children: e.headers.map(_e) }, e.id))
|
|
232
236
|
}
|
|
233
237
|
),
|
|
234
|
-
/* @__PURE__ */ o("tbody", { className:
|
|
238
|
+
/* @__PURE__ */ o("tbody", { className: Z, children: i ? Array.from(
|
|
235
239
|
{ length: J },
|
|
236
|
-
(e,
|
|
237
|
-
) :
|
|
240
|
+
(e, t) => Ne(t)
|
|
241
|
+
) : H.map((e, t) => He(e, t)) })
|
|
238
242
|
] }) }),
|
|
239
|
-
|
|
240
|
-
|
|
243
|
+
y && !i && /* @__PURE__ */ o(
|
|
244
|
+
Fe,
|
|
241
245
|
{
|
|
242
246
|
pageIndex: a.pageIndex,
|
|
243
247
|
pageSize: a.pageSize,
|
|
244
|
-
totalCount: s ||
|
|
248
|
+
totalCount: s || C.length,
|
|
245
249
|
variant: me,
|
|
246
|
-
labels:
|
|
247
|
-
renderPageSizeSelectorDropdownItem:
|
|
248
|
-
renderPageSizeSelectorInputItem:
|
|
249
|
-
onPageChange: (e) =>
|
|
250
|
-
onPageSizeChange: (e) =>
|
|
250
|
+
labels: ce,
|
|
251
|
+
renderPageSizeSelectorDropdownItem: ge,
|
|
252
|
+
renderPageSizeSelectorInputItem: de,
|
|
253
|
+
onPageChange: (e) => f({ ...a, pageIndex: e }),
|
|
254
|
+
onPageSizeChange: (e) => f({ ...a, pageSize: e, pageIndex: 0 }),
|
|
251
255
|
className: ne
|
|
252
256
|
}
|
|
253
257
|
)
|
|
254
258
|
] });
|
|
255
259
|
};
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
m.displayName = "Table";
|
|
261
|
+
m.HeadCellContent = Oe;
|
|
262
|
+
m.BodyCellContent = E;
|
|
263
|
+
m.HeadCellContentSortable = Ge;
|
|
264
|
+
m.createColumnHelper = Ie;
|
|
261
265
|
export {
|
|
262
|
-
|
|
266
|
+
m as Table
|
|
263
267
|
};
|
|
@@ -128,7 +128,11 @@ export interface TableProps<TData> {
|
|
|
128
128
|
bodyCellComponent?: ComponentType<TableBodyCellProps>;
|
|
129
129
|
/** Компонент для строки заголовка */
|
|
130
130
|
headRowComponent?: ComponentType<TableHeadRowProps>;
|
|
131
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Компонент для строки тела. Выбранные строки (`row.getIsSelected()`)
|
|
133
|
+
* подсвечиваются автоматически; в кастомный компонент признак выбранной
|
|
134
|
+
* строки приходит пропсом `selected`.
|
|
135
|
+
*/
|
|
132
136
|
bodyRowComponent?: ComponentType<TableBodyRowProps>;
|
|
133
137
|
/** Callback при сбросе фильтров */
|
|
134
138
|
onReset?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
@@ -4,5 +4,10 @@ export interface TableBodyRowProps extends React.HTMLAttributes<HTMLTableRowElem
|
|
|
4
4
|
* @default false
|
|
5
5
|
*/
|
|
6
6
|
showBorders?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Подсвечивать ли строку как выбранную
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
selected?: boolean;
|
|
7
12
|
}
|
|
8
13
|
export declare const TableBodyRow: import('react').ForwardRefExoticComponent<TableBodyRowProps & import('react').RefAttributes<HTMLTableRowElement>>;
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { css as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { theme as
|
|
5
|
-
const { color: o } =
|
|
6
|
-
({ children:
|
|
7
|
-
const
|
|
8
|
-
borderBottom:
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { css as e, cx as m } from "@emotion/css";
|
|
3
|
+
import { forwardRef as f } from "react";
|
|
4
|
+
import { theme as b } from "../../../../utils/theme/index.js";
|
|
5
|
+
const { color: o } = b, p = f(
|
|
6
|
+
({ children: t, className: l, showBorders: a = !1, selected: r = !1, ...n }, s) => {
|
|
7
|
+
const c = e({
|
|
8
|
+
borderBottom: a ? `1px solid ${o.border.neutral_alpha_low}` : "none",
|
|
9
9
|
transition: "background-color 0.15s ease-in-out",
|
|
10
10
|
"&:hover": {
|
|
11
11
|
backgroundColor: o.fill.neutral_primary_hover
|
|
12
12
|
}
|
|
13
|
+
}), i = e({
|
|
14
|
+
backgroundColor: o.fill.accent_tint_low,
|
|
15
|
+
"&:hover": {
|
|
16
|
+
backgroundColor: o.fill.accent_tint
|
|
17
|
+
}
|
|
13
18
|
});
|
|
14
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ d(
|
|
20
|
+
"tr",
|
|
21
|
+
{
|
|
22
|
+
ref: s,
|
|
23
|
+
"data-selected": r || void 0,
|
|
24
|
+
className: m(c, { [i]: r }, l),
|
|
25
|
+
...n,
|
|
26
|
+
children: t
|
|
27
|
+
}
|
|
28
|
+
);
|
|
15
29
|
}
|
|
16
30
|
);
|
|
17
31
|
p.displayName = "TableBodyRow";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cx as s, css as l } from "@emotion/css";
|
|
3
|
+
import { Button as p } from "../../../controls/Button/Button.js";
|
|
4
|
+
import { Box as h } from "../../Box/Box.js";
|
|
5
|
+
import { theme as f } from "../../../../utils/theme/index.js";
|
|
5
6
|
import { Text as r } from "../../Text/Text.js";
|
|
6
|
-
const { spacing:
|
|
7
|
+
const { spacing: o, cornerRadius: x } = f, u = ({
|
|
7
8
|
icon: i,
|
|
8
9
|
labels: t,
|
|
9
|
-
onReset:
|
|
10
|
-
className:
|
|
10
|
+
onReset: c,
|
|
11
|
+
className: n,
|
|
11
12
|
titleClassName: m,
|
|
12
13
|
descriptionClassName: a
|
|
13
14
|
}) => /* @__PURE__ */ d(
|
|
14
|
-
|
|
15
|
+
h,
|
|
15
16
|
{
|
|
16
17
|
w: "full",
|
|
17
|
-
borderRadius:
|
|
18
|
-
py:
|
|
19
|
-
px: e["10xl"],
|
|
18
|
+
borderRadius: x.md,
|
|
19
|
+
py: o["5xl"],
|
|
20
20
|
alignItems: "center",
|
|
21
|
-
className:
|
|
21
|
+
className: n,
|
|
22
22
|
children: [
|
|
23
23
|
i,
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ e(
|
|
25
25
|
r,
|
|
26
26
|
{
|
|
27
|
-
mb:
|
|
27
|
+
mb: o.xs,
|
|
28
28
|
variant: "title-3",
|
|
29
29
|
fontWeight: "semibold",
|
|
30
30
|
className: m,
|
|
@@ -32,23 +32,23 @@ const { spacing: e, cornerRadius: h } = p, f = ({
|
|
|
32
32
|
children: t.title
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
36
|
r,
|
|
37
37
|
{
|
|
38
|
-
mb:
|
|
38
|
+
mb: o.md,
|
|
39
39
|
colorName: "tertiary",
|
|
40
40
|
variant: "body-1",
|
|
41
41
|
fontWeight: "medium",
|
|
42
|
-
className: a,
|
|
42
|
+
className: s(l({ maxWidth: 400 }), a),
|
|
43
43
|
center: !0,
|
|
44
44
|
children: t.description
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
typeof t.action == "string" ? /* @__PURE__ */
|
|
48
|
-
|
|
47
|
+
typeof t.action == "string" ? /* @__PURE__ */ e(
|
|
48
|
+
p,
|
|
49
49
|
{
|
|
50
50
|
width: "auto",
|
|
51
|
-
onClick:
|
|
51
|
+
onClick: c,
|
|
52
52
|
intensity: "secondary",
|
|
53
53
|
color: "accent",
|
|
54
54
|
children: t.action
|
|
@@ -57,7 +57,7 @@ const { spacing: e, cornerRadius: h } = p, f = ({
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
|
-
|
|
60
|
+
u.displayName = "TablePlaceholder";
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
u as TablePlaceholder
|
|
63
63
|
};
|