@dss-kit/ui-kit 0.3.1 → 0.3.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/dist/components/builders/Table/Table.d.ts +1 -1
- package/dist/components/builders/Table/Table.js +192 -173
- package/dist/components/builders/Table/Table.types.d.ts +17 -8
- package/dist/components/builders/Table/TablePlaceholder/TablePlaceholder.js +16 -14
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
- package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
- package/dist/ui-kit.cjs.js +8 -21
- package/package.json +1 -1
- package/dist/assets/svg/table/loading.svg.js +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
2
|
import { TableProps } from './Table.types';
|
|
3
3
|
declare const Table: {
|
|
4
|
-
<TData>({ ref, data, columns, showBorders, enableSorting, enablePagination, enableRowSelection, enableMultiRowSelection, enableColumnPinning, columnPinning: controlledColumnPinning, onColumnPinningChange, sorting: controlledSorting, onSortingChange, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, pagination: controlledPagination, onPaginationChange, rowSelection: controlledRowSelection, onRowSelectionChange, totalCount, loading,
|
|
4
|
+
<TData>({ ref, data, columns, showBorders, enableSorting, enablePagination, enableRowSelection, enableMultiRowSelection, enableColumnPinning, columnPinning: controlledColumnPinning, onColumnPinningChange, sorting: controlledSorting, onSortingChange, manualSorting, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, pagination: controlledPagination, onPaginationChange, rowSelection: controlledRowSelection, onRowSelectionChange, totalCount, loading, loadingRowCount, emptyLabels, className, containerClassName, theadClassName, tbodyClassName, emptyStateClassName, emptyStateTitleClassName, emptyStateDescriptionClassName, paginationClassName, tableOptions, onRowClick, getRowId, headCellComponent: HeadCellComponent, bodyCellComponent: BodyCellComponent, headRowComponent: HeadRowComponent, bodyRowComponent: BodyRowComponent, onReset, paginationVariant, paginationLabels, renderPageSizeSelectorDropdownItem, renderPageSizeSelectorInputItem, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
HeadCellContent: import('react').ForwardRefExoticComponent<Omit<import('../Box').BoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
7
|
BodyCellContent: import('react').ForwardRefExoticComponent<Omit<import('../Box').BoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,229 +1,248 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useImperativeHandle as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { TableHeadCellContentSortable as
|
|
20
|
-
import { theme as
|
|
21
|
-
import { Box as
|
|
22
|
-
const { spacing:
|
|
1
|
+
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { cx as p, css as b } from "@emotion/css";
|
|
3
|
+
import { useReactTable as He, getPaginationRowModel as ve, getSortedRowModel as Ne, getCoreRowModel as Me, flexRender as H, createColumnHelper as ke } from "@tanstack/react-table";
|
|
4
|
+
import { useImperativeHandle as Ie } from "react";
|
|
5
|
+
import ze from "../../../assets/svg/table/search.svg.js";
|
|
6
|
+
import { styles as Ve } from "./styles.js";
|
|
7
|
+
import { useControllableState as m } from "./Table.hooks.js";
|
|
8
|
+
import { getColumnPinningStyles as f } from "./Table.utils.js";
|
|
9
|
+
import { TablePlaceholder as Le } from "./TablePlaceholder/TablePlaceholder.js";
|
|
10
|
+
import { TableWrapper as Ee } from "./TableWrapper/TableWrapper.js";
|
|
11
|
+
import { TableHeadRow as Fe } from "./TableHeadRow/TableHeadRow.js";
|
|
12
|
+
import { TablePagination as We } from "./TablePagination/TablePagination.js";
|
|
13
|
+
import { TableHeadCell as je } from "./TableHeadCell/TableHeadCell.js";
|
|
14
|
+
import { TableBodyCell as Be } from "./TableBodyCell/TableBodyCell.js";
|
|
15
|
+
import { TableBodyRow as De } from "./TableBodyRow/TableBodyRow.js";
|
|
16
|
+
import { TableBodyCellContent as M } from "./TableBodyCellContent/TableBodyCellContent.js";
|
|
17
|
+
import { Skeleton as _e } from "../../shared/Skeleton/Skeleton.js";
|
|
18
|
+
import { TableHeadCellContent as Ae } from "./TableHeadCellContent/TableHeadCellContent.js";
|
|
19
|
+
import { TableHeadCellContentSortable as Ke } from "./TableHeadCellContentSortable/TableHeadCellContentSortable.js";
|
|
20
|
+
import { theme as Oe } from "../../../utils/theme/index.js";
|
|
21
|
+
import { Box as $e } from "../Box/Box.js";
|
|
22
|
+
const { spacing: v, color: n } = Oe, qe = b({
|
|
23
23
|
width: "100%",
|
|
24
24
|
maxWidth: "100%",
|
|
25
25
|
minWidth: "max-content",
|
|
26
26
|
borderCollapse: "collapse",
|
|
27
27
|
borderSpacing: 0,
|
|
28
|
-
backgroundColor:
|
|
29
|
-
}), Ge =
|
|
30
|
-
backgroundColor:
|
|
31
|
-
color:
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
backgroundColor: n.fill.bgPrimary
|
|
29
|
+
}), Ge = b({
|
|
30
|
+
backgroundColor: n.fill.bgSecondary,
|
|
31
|
+
color: n.text.tertiary
|
|
32
|
+
}), Je = b({
|
|
33
|
+
pointerEvents: "none",
|
|
34
|
+
userSelect: "none"
|
|
35
|
+
}), N = ["70%", "55%", "80%", "60%"], c = ({
|
|
36
|
+
ref: k,
|
|
37
|
+
data: h,
|
|
38
|
+
columns: I,
|
|
39
|
+
showBorders: g = !0,
|
|
40
|
+
enableSorting: z = !1,
|
|
41
|
+
enablePagination: S = !1,
|
|
39
42
|
enableRowSelection: V = !1,
|
|
40
|
-
enableMultiRowSelection:
|
|
41
|
-
enableColumnPinning:
|
|
42
|
-
columnPinning:
|
|
43
|
-
onColumnPinningChange:
|
|
44
|
-
sorting:
|
|
45
|
-
onSortingChange:
|
|
43
|
+
enableMultiRowSelection: L = !1,
|
|
44
|
+
enableColumnPinning: d = !1,
|
|
45
|
+
columnPinning: E,
|
|
46
|
+
onColumnPinningChange: F,
|
|
47
|
+
sorting: W,
|
|
48
|
+
onSortingChange: j,
|
|
49
|
+
manualSorting: B,
|
|
46
50
|
columnFilters: D,
|
|
47
|
-
onColumnFiltersChange:
|
|
51
|
+
onColumnFiltersChange: _,
|
|
48
52
|
columnVisibility: A,
|
|
49
|
-
onColumnVisibilityChange:
|
|
50
|
-
pagination:
|
|
51
|
-
onPaginationChange:
|
|
52
|
-
rowSelection:
|
|
53
|
-
onRowSelectionChange:
|
|
53
|
+
onColumnVisibilityChange: K,
|
|
54
|
+
pagination: O,
|
|
55
|
+
onPaginationChange: $,
|
|
56
|
+
rowSelection: q,
|
|
57
|
+
onRowSelectionChange: G,
|
|
54
58
|
totalCount: s,
|
|
55
|
-
loading:
|
|
59
|
+
loading: i = !1,
|
|
60
|
+
loadingRowCount: J = 10,
|
|
56
61
|
emptyLabels: Q = {
|
|
57
62
|
title: "Nothing found",
|
|
58
|
-
description: "
|
|
63
|
+
description: "Try adjusting your search or filters",
|
|
59
64
|
action: "Reset"
|
|
60
65
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
onReset: x,
|
|
82
|
-
paginationVariant: ie,
|
|
83
|
-
paginationLabels: ae,
|
|
84
|
-
renderPageSizeSelectorDropdownItem: re,
|
|
85
|
-
renderPageSizeSelectorInputItem: me
|
|
66
|
+
className: U,
|
|
67
|
+
containerClassName: u,
|
|
68
|
+
theadClassName: X,
|
|
69
|
+
tbodyClassName: Y,
|
|
70
|
+
emptyStateClassName: Z,
|
|
71
|
+
emptyStateTitleClassName: ee,
|
|
72
|
+
emptyStateDescriptionClassName: oe,
|
|
73
|
+
paginationClassName: te,
|
|
74
|
+
tableOptions: le = {},
|
|
75
|
+
onRowClick: y,
|
|
76
|
+
getRowId: ne,
|
|
77
|
+
headCellComponent: ie = je,
|
|
78
|
+
bodyCellComponent: w = Be,
|
|
79
|
+
headRowComponent: ae = Fe,
|
|
80
|
+
bodyRowComponent: x = De,
|
|
81
|
+
onReset: re,
|
|
82
|
+
paginationVariant: me,
|
|
83
|
+
paginationLabels: se,
|
|
84
|
+
renderPageSizeSelectorDropdownItem: ce,
|
|
85
|
+
renderPageSizeSelectorInputItem: ge
|
|
86
86
|
}) => {
|
|
87
|
-
const [
|
|
87
|
+
const [de, pe] = m(
|
|
88
|
+
W,
|
|
88
89
|
j,
|
|
89
|
-
L,
|
|
90
90
|
[]
|
|
91
|
-
), [
|
|
91
|
+
), [he, Ce] = m(
|
|
92
92
|
D,
|
|
93
|
-
|
|
93
|
+
_,
|
|
94
94
|
[]
|
|
95
|
-
), [
|
|
95
|
+
), [fe, be] = m(
|
|
96
96
|
A,
|
|
97
|
-
|
|
97
|
+
K,
|
|
98
98
|
{}
|
|
99
|
-
), [
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
), [a, C] = m(
|
|
100
|
+
O,
|
|
101
|
+
$,
|
|
102
102
|
{ pageIndex: 0, pageSize: 10 }
|
|
103
|
-
), [
|
|
103
|
+
), [Se, ue] = m(q, G, {}), [ye, we] = m(
|
|
104
|
+
E,
|
|
104
105
|
F,
|
|
105
|
-
W,
|
|
106
106
|
{ left: [], right: [] }
|
|
107
|
-
),
|
|
108
|
-
data:
|
|
109
|
-
columns:
|
|
107
|
+
), R = B ?? !!s, l = He({
|
|
108
|
+
data: h,
|
|
109
|
+
columns: I,
|
|
110
110
|
state: {
|
|
111
|
-
sorting:
|
|
112
|
-
columnFilters:
|
|
113
|
-
columnVisibility:
|
|
114
|
-
pagination:
|
|
115
|
-
rowSelection:
|
|
116
|
-
columnPinning:
|
|
111
|
+
sorting: de,
|
|
112
|
+
columnFilters: he,
|
|
113
|
+
columnVisibility: fe,
|
|
114
|
+
pagination: a,
|
|
115
|
+
rowSelection: Se,
|
|
116
|
+
columnPinning: ye
|
|
117
117
|
},
|
|
118
|
-
onSortingChange:
|
|
119
|
-
onColumnFiltersChange:
|
|
120
|
-
onColumnVisibilityChange:
|
|
121
|
-
onPaginationChange:
|
|
122
|
-
onRowSelectionChange:
|
|
123
|
-
onColumnPinningChange:
|
|
124
|
-
getCoreRowModel:
|
|
125
|
-
getSortedRowModel:
|
|
126
|
-
getPaginationRowModel:
|
|
118
|
+
onSortingChange: pe,
|
|
119
|
+
onColumnFiltersChange: Ce,
|
|
120
|
+
onColumnVisibilityChange: be,
|
|
121
|
+
onPaginationChange: C,
|
|
122
|
+
onRowSelectionChange: ue,
|
|
123
|
+
onColumnPinningChange: we,
|
|
124
|
+
getCoreRowModel: Me(),
|
|
125
|
+
getSortedRowModel: z && !R ? Ne() : void 0,
|
|
126
|
+
getPaginationRowModel: S ? ve() : void 0,
|
|
127
127
|
enableRowSelection: V,
|
|
128
|
-
enableMultiRowSelection:
|
|
129
|
-
enableColumnPinning:
|
|
130
|
-
getRowId:
|
|
128
|
+
enableMultiRowSelection: L,
|
|
129
|
+
enableColumnPinning: d,
|
|
130
|
+
getRowId: ne,
|
|
131
|
+
manualSorting: R,
|
|
131
132
|
manualPagination: !!s,
|
|
132
|
-
pageCount: s ? Math.ceil(s /
|
|
133
|
-
|
|
133
|
+
pageCount: s ? Math.ceil(s / a.pageSize) : void 0,
|
|
134
|
+
...le
|
|
134
135
|
});
|
|
135
|
-
|
|
136
|
-
const { rows:
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
136
|
+
Ie(k, () => l);
|
|
137
|
+
const { rows: T } = l.getRowModel(), xe = (e, t) => {
|
|
138
|
+
y && y(e.original, t);
|
|
139
|
+
}, Re = (e) => /* @__PURE__ */ o(
|
|
140
|
+
ie,
|
|
140
141
|
{
|
|
141
142
|
style: {
|
|
142
143
|
width: e.getSize(),
|
|
143
|
-
...
|
|
144
|
+
...d && f(l, e.column, n.fill.bgSecondary)
|
|
144
145
|
},
|
|
145
|
-
onClick: e.column.getToggleSortingHandler(),
|
|
146
|
+
onClick: i ? void 0 : e.column.getToggleSortingHandler(),
|
|
146
147
|
children: e.isPlaceholder ? null : H(e.column.columnDef.header, e.getContext())
|
|
147
148
|
},
|
|
148
149
|
e.id
|
|
149
|
-
),
|
|
150
|
-
|
|
150
|
+
), Te = (e, t) => /* @__PURE__ */ o(
|
|
151
|
+
x,
|
|
151
152
|
{
|
|
152
|
-
showBorders:
|
|
153
|
+
showBorders: g,
|
|
153
154
|
isSelected: e.getIsSelected(),
|
|
154
|
-
onClick: () =>
|
|
155
|
-
children: e.getVisibleCells().map((
|
|
156
|
-
|
|
155
|
+
onClick: () => xe(e, t),
|
|
156
|
+
children: e.getVisibleCells().map((r) => /* @__PURE__ */ o(
|
|
157
|
+
w,
|
|
157
158
|
{
|
|
158
|
-
style:
|
|
159
|
-
children: H(
|
|
159
|
+
style: d ? f(l, r.column, n.fill.bgPrimary) : void 0,
|
|
160
|
+
children: H(r.column.columnDef.cell, r.getContext())
|
|
160
161
|
},
|
|
161
|
-
|
|
162
|
+
r.id
|
|
162
163
|
))
|
|
163
164
|
},
|
|
164
165
|
e.id
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
v,
|
|
166
|
+
), Pe = (e) => /* @__PURE__ */ o(
|
|
167
|
+
x,
|
|
168
168
|
{
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
showBorders: g,
|
|
170
|
+
children: l.getVisibleLeafColumns().map((t, r) => /* @__PURE__ */ o(
|
|
171
|
+
w,
|
|
171
172
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Ve,
|
|
190
|
-
{
|
|
191
|
-
pageIndex: n.pageIndex,
|
|
192
|
-
pageSize: n.pageSize,
|
|
193
|
-
totalCount: s || g.length,
|
|
194
|
-
variant: ie,
|
|
195
|
-
labels: ae,
|
|
196
|
-
renderPageSizeSelectorDropdownItem: re,
|
|
197
|
-
renderPageSizeSelectorInputItem: me,
|
|
198
|
-
onPageChange: (e) => h({ ...n, pageIndex: e }),
|
|
199
|
-
onPageSizeChange: (e) => h({ ...n, pageSize: e, pageIndex: 0 }),
|
|
200
|
-
className: _
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
] }) : /* @__PURE__ */ o(
|
|
204
|
-
v,
|
|
173
|
+
style: d ? f(l, t, n.fill.bgPrimary) : void 0,
|
|
174
|
+
children: /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
175
|
+
_e,
|
|
176
|
+
{
|
|
177
|
+
variant: "text",
|
|
178
|
+
height: 16,
|
|
179
|
+
width: N[r % N.length]
|
|
180
|
+
}
|
|
181
|
+
) })
|
|
182
|
+
},
|
|
183
|
+
t.id
|
|
184
|
+
))
|
|
185
|
+
},
|
|
186
|
+
`skeleton-row-${e}`
|
|
187
|
+
);
|
|
188
|
+
return !i && !T.length ? /* @__PURE__ */ o(
|
|
189
|
+
Le,
|
|
205
190
|
{
|
|
206
191
|
icon: /* @__PURE__ */ o(
|
|
207
|
-
|
|
192
|
+
ze,
|
|
208
193
|
{
|
|
209
194
|
width: 24,
|
|
210
195
|
height: 24,
|
|
211
|
-
style: { color:
|
|
196
|
+
style: { color: n.icon.tertiary, marginBottom: v.sm }
|
|
212
197
|
}
|
|
213
198
|
),
|
|
214
199
|
labels: Q,
|
|
215
|
-
onReset:
|
|
216
|
-
className:
|
|
217
|
-
titleClassName:
|
|
218
|
-
descriptionClassName:
|
|
200
|
+
onReset: re,
|
|
201
|
+
className: p(u, Z),
|
|
202
|
+
titleClassName: ee,
|
|
203
|
+
descriptionClassName: oe
|
|
219
204
|
}
|
|
220
|
-
)
|
|
205
|
+
) : /* @__PURE__ */ P($e, { w: "full", gap: v.xl, className: p(u), children: [
|
|
206
|
+
/* @__PURE__ */ o(Ee, { data: h, showBorders: g, children: /* @__PURE__ */ P("table", { className: p(qe, Ve.table, U), children: [
|
|
207
|
+
/* @__PURE__ */ o(
|
|
208
|
+
"thead",
|
|
209
|
+
{
|
|
210
|
+
className: p(
|
|
211
|
+
Ge,
|
|
212
|
+
{ [Je]: i },
|
|
213
|
+
X
|
|
214
|
+
),
|
|
215
|
+
"aria-busy": i,
|
|
216
|
+
children: l.getHeaderGroups().map((e) => /* @__PURE__ */ o(ae, { showBorders: g, children: e.headers.map(Re) }, e.id))
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ o("tbody", { className: Y, children: i ? Array.from(
|
|
220
|
+
{ length: J },
|
|
221
|
+
(e, t) => Pe(t)
|
|
222
|
+
) : T.map((e, t) => Te(e, t)) })
|
|
223
|
+
] }) }),
|
|
224
|
+
S && !i && /* @__PURE__ */ o(
|
|
225
|
+
We,
|
|
226
|
+
{
|
|
227
|
+
pageIndex: a.pageIndex,
|
|
228
|
+
pageSize: a.pageSize,
|
|
229
|
+
totalCount: s || h.length,
|
|
230
|
+
variant: me,
|
|
231
|
+
labels: se,
|
|
232
|
+
renderPageSizeSelectorDropdownItem: ce,
|
|
233
|
+
renderPageSizeSelectorInputItem: ge,
|
|
234
|
+
onPageChange: (e) => C({ ...a, pageIndex: e }),
|
|
235
|
+
onPageSizeChange: (e) => C({ ...a, pageSize: e, pageIndex: 0 }),
|
|
236
|
+
className: te
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] });
|
|
221
240
|
};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
241
|
+
c.displayName = "Table";
|
|
242
|
+
c.HeadCellContent = Ae;
|
|
243
|
+
c.BodyCellContent = M;
|
|
244
|
+
c.HeadCellContentSortable = Ke;
|
|
245
|
+
c.createColumnHelper = ke;
|
|
227
246
|
export {
|
|
228
|
-
|
|
247
|
+
c as Table
|
|
229
248
|
};
|
|
@@ -32,6 +32,17 @@ export interface TableProps<TData> {
|
|
|
32
32
|
sorting?: SortingState;
|
|
33
33
|
/** Callback при изменении сортировки */
|
|
34
34
|
onSortingChange?: (sorting: SortingState) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Серверная (manual) сортировка. Когда `true`, таблица не сортирует данные
|
|
37
|
+
* на клиенте — она лишь сообщает о смене состояния через `onSortingChange`,
|
|
38
|
+
* а отсортированные данные должен вернуть бэкенд. Используйте вместе с
|
|
39
|
+
* контролируемым `sorting`, чтобы отображать активную колонку и направление.
|
|
40
|
+
*
|
|
41
|
+
* По умолчанию включается автоматически, когда задан `totalCount`
|
|
42
|
+
* (признак серверной пагинации).
|
|
43
|
+
* @default Boolean(totalCount)
|
|
44
|
+
*/
|
|
45
|
+
manualSorting?: boolean;
|
|
35
46
|
/** Состояние фильтров (контролируемое) */
|
|
36
47
|
columnFilters?: ColumnFiltersState;
|
|
37
48
|
/** Callback при изменении фильтров */
|
|
@@ -71,20 +82,18 @@ export interface TableProps<TData> {
|
|
|
71
82
|
/** Загружается ли таблица */
|
|
72
83
|
/** @default false */
|
|
73
84
|
loading?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Количество строк-скелетонов, отображаемых во время загрузки (`loading`).
|
|
87
|
+
* @default 10
|
|
88
|
+
*/
|
|
89
|
+
loadingRowCount?: number;
|
|
74
90
|
/** Сообщение при отсутствии данных */
|
|
75
|
-
/** @default { title: "Nothing found", description: "
|
|
91
|
+
/** @default { title: "Nothing found", description: "Try adjusting your search or filters", action: "Reset" } */
|
|
76
92
|
emptyLabels?: {
|
|
77
93
|
title: string;
|
|
78
94
|
description: string;
|
|
79
95
|
action: string | React.ReactNode;
|
|
80
96
|
};
|
|
81
|
-
/** Сообщение при загрузке данных */
|
|
82
|
-
/** @default { title: "Loading...", description: "Please wait or reset your promt", action: "Reset" } */
|
|
83
|
-
loadingLabels?: {
|
|
84
|
-
title: string;
|
|
85
|
-
description: string;
|
|
86
|
-
action: string | React.ReactNode;
|
|
87
|
-
};
|
|
88
97
|
/** Кастомный класс для таблицы */
|
|
89
98
|
className?: string;
|
|
90
99
|
/** Кастомный класс для контейнера таблицы */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Button as l } from "../../../controls/Button/Button.js";
|
|
3
3
|
import { Box as s } from "../../Box/Box.js";
|
|
4
4
|
import { theme as p } from "../../../../utils/theme/index.js";
|
|
5
|
-
import { Text as
|
|
6
|
-
const { spacing:
|
|
7
|
-
icon:
|
|
5
|
+
import { Text as r } from "../../Text/Text.js";
|
|
6
|
+
const { spacing: e, cornerRadius: h } = p, f = ({
|
|
7
|
+
icon: i,
|
|
8
8
|
labels: t,
|
|
9
9
|
onReset: n,
|
|
10
10
|
className: c,
|
|
@@ -15,34 +15,36 @@ const { spacing: o, cornerRadius: h } = p, f = ({
|
|
|
15
15
|
{
|
|
16
16
|
w: "full",
|
|
17
17
|
borderRadius: h.md,
|
|
18
|
-
py:
|
|
19
|
-
px:
|
|
18
|
+
py: e["5xl"],
|
|
19
|
+
px: e["10xl"],
|
|
20
20
|
alignItems: "center",
|
|
21
21
|
className: c,
|
|
22
22
|
children: [
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
23
|
+
i,
|
|
24
|
+
/* @__PURE__ */ o(
|
|
25
|
+
r,
|
|
26
26
|
{
|
|
27
|
-
mb:
|
|
27
|
+
mb: e.xs,
|
|
28
28
|
variant: "title-3",
|
|
29
29
|
fontWeight: "semibold",
|
|
30
30
|
className: m,
|
|
31
|
+
center: !0,
|
|
31
32
|
children: t.title
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
35
|
+
/* @__PURE__ */ o(
|
|
36
|
+
r,
|
|
36
37
|
{
|
|
37
|
-
mb:
|
|
38
|
+
mb: e.md,
|
|
38
39
|
colorName: "tertiary",
|
|
39
40
|
variant: "body-1",
|
|
40
41
|
fontWeight: "medium",
|
|
41
42
|
className: a,
|
|
43
|
+
center: !0,
|
|
42
44
|
children: t.description
|
|
43
45
|
}
|
|
44
46
|
),
|
|
45
|
-
typeof t.action == "string" ? /* @__PURE__ */
|
|
47
|
+
typeof t.action == "string" ? /* @__PURE__ */ o(
|
|
46
48
|
l,
|
|
47
49
|
{
|
|
48
50
|
width: "auto",
|
|
@@ -8,10 +8,10 @@ import { MarkdownShortcutPlugin as U } from "@lexical/react/LexicalMarkdownShort
|
|
|
8
8
|
import { OnChangePlugin as W } from "@lexical/react/LexicalOnChangePlugin";
|
|
9
9
|
import { TablePlugin as H } from "@lexical/react/LexicalTablePlugin";
|
|
10
10
|
import { useState as u, useMemo as a, useCallback as p } from "react";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { getEditorConfig as K } from "./configs/editor.config.js";
|
|
12
|
+
import { MARKDOWN_TOOLBAR_DEFAULT_ACTIONS as q } from "./MarkdownTextEditor.const.js";
|
|
13
|
+
import { MarkdownTextEditorLocaleProvider as z } from "./MarkdownTextEditor.locale.js";
|
|
13
14
|
import { EDITOR_TRANSFORMERS as g } from "./transformers/index.js";
|
|
14
|
-
import { getEditorConfig as z } from "./configs/editor.config.js";
|
|
15
15
|
import { EditorStateContext as G } from "./contexts/EditorStateContext/EditorStateContext.js";
|
|
16
16
|
import { ToolbarContext as J } from "./contexts/ToolbarContext/ToolbarContext.js";
|
|
17
17
|
import { EditorToolbar as Q } from "./components/EditorToolbar/EditorToolbar.js";
|
|
@@ -40,7 +40,7 @@ function No({
|
|
|
40
40
|
fieldClassName: R,
|
|
41
41
|
previewClassName: v
|
|
42
42
|
}) {
|
|
43
|
-
const [d, A] = u(""), [i, N] = u(!1), { availableActions: s, onImagesUpload: O } = P || {}, I = a(() =>
|
|
43
|
+
const [d, A] = u(""), [i, N] = u(!1), { availableActions: s, onImagesUpload: O } = P || {}, I = a(() => K(), []), L = a(
|
|
44
44
|
() => ({
|
|
45
45
|
isEditable: !m,
|
|
46
46
|
isPreviewMode: i,
|
|
@@ -49,7 +49,7 @@ function No({
|
|
|
49
49
|
}),
|
|
50
50
|
[m, i, d]
|
|
51
51
|
), F = a(() => ({
|
|
52
|
-
availableActions: s ||
|
|
52
|
+
availableActions: s || q
|
|
53
53
|
}), [s]), f = p(
|
|
54
54
|
(t) => {
|
|
55
55
|
A(t), r.onMarkdownChange && r.onMarkdownChange(t);
|
|
@@ -64,7 +64,7 @@ function No({
|
|
|
64
64
|
},
|
|
65
65
|
[f, r]
|
|
66
66
|
);
|
|
67
|
-
return /* @__PURE__ */ o(
|
|
67
|
+
return /* @__PURE__ */ o(z, { locale: M, children: /* @__PURE__ */ o(D, { initialConfig: I, children: /* @__PURE__ */ o(G.Provider, { value: L, children: /* @__PURE__ */ c(J.Provider, { value: F, children: [
|
|
68
68
|
/* @__PURE__ */ c(
|
|
69
69
|
h,
|
|
70
70
|
{
|
|
@@ -6,11 +6,11 @@ import { ContentEditable as f } from "@lexical/react/LexicalContentEditable";
|
|
|
6
6
|
import { LexicalErrorBoundary as c } from "@lexical/react/LexicalErrorBoundary";
|
|
7
7
|
import { RichTextPlugin as p } from "@lexical/react/LexicalRichTextPlugin";
|
|
8
8
|
import { useMemo as s } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { getEditorConfig as u } from "../../controls/MarkdownTextEditor/configs/editor.config.js";
|
|
10
|
+
import { EDITOR_TRANSFORMERS as x } from "../../controls/MarkdownTextEditor/transformers/index.js";
|
|
11
|
+
import { markdownTextStyle as w } from "./MarkdownText.styles.js";
|
|
12
|
+
import { Text as E } from "../../builders/Text/Text.js";
|
|
13
|
+
import { EditorStateContext as k } from "../../controls/MarkdownTextEditor/contexts/EditorStateContext/EditorStateContext.js";
|
|
14
14
|
function F({
|
|
15
15
|
markdown: t,
|
|
16
16
|
className: i,
|
|
@@ -27,15 +27,15 @@ function F({
|
|
|
27
27
|
}),
|
|
28
28
|
[r]
|
|
29
29
|
);
|
|
30
|
-
return r ? /* @__PURE__ */ o(
|
|
30
|
+
return r ? /* @__PURE__ */ o(k.Provider, { value: a, children: /* @__PURE__ */ o(
|
|
31
31
|
d,
|
|
32
32
|
{
|
|
33
33
|
initialConfig: {
|
|
34
|
-
...
|
|
34
|
+
...u(),
|
|
35
35
|
editable: !1,
|
|
36
36
|
namespace: "ui-kit-markdown-text-viewer",
|
|
37
37
|
editorState: () => {
|
|
38
|
-
l(r,
|
|
38
|
+
l(r, x);
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
children: /* @__PURE__ */ o(
|
|
@@ -44,7 +44,7 @@ function F({
|
|
|
44
44
|
contentEditable: /* @__PURE__ */ o(
|
|
45
45
|
f,
|
|
46
46
|
{
|
|
47
|
-
className: m(
|
|
47
|
+
className: m(w, i),
|
|
48
48
|
"aria-placeholder": "markdown text",
|
|
49
49
|
placeholder: () => null
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ function F({
|
|
|
56
56
|
},
|
|
57
57
|
r
|
|
58
58
|
) }) : typeof e == "string" ? /* @__PURE__ */ o(
|
|
59
|
-
|
|
59
|
+
E,
|
|
60
60
|
{
|
|
61
61
|
variant: "body-2",
|
|
62
62
|
colorName: "tertiary",
|