@dss-kit/ui-kit 0.3.2 → 0.3.4
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 +191 -174
- package/dist/components/builders/Table/Table.types.d.ts +5 -7
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
- package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
- package/dist/index.js +57 -55
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.const.d.ts +1 -0
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.const.js +4 -0
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.d.ts +1 -1
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.js +30 -28
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.types.d.ts +5 -0
- package/dist/providers/ThemeProviderScoped/index.d.ts +1 -0
- package/dist/root.css +1 -1
- package/dist/ui-kit.cjs +38 -0
- package/package.json +3 -3
- package/dist/assets/svg/table/loading.svg.js +0 -18
- package/dist/ui-kit.cjs.js +0 -51
|
@@ -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, manualSorting, 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,231 +1,248 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useImperativeHandle as
|
|
5
|
-
import Be from "../../../assets/svg/table/loading.svg.js";
|
|
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";
|
|
6
5
|
import ze from "../../../assets/svg/table/search.svg.js";
|
|
7
|
-
import { styles as
|
|
8
|
-
import { useControllableState as
|
|
9
|
-
import { getColumnPinningStyles as
|
|
10
|
-
import { TablePlaceholder as
|
|
11
|
-
import { TableWrapper as
|
|
12
|
-
import { TableHeadRow as
|
|
13
|
-
import { TablePagination as
|
|
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";
|
|
14
13
|
import { TableHeadCell as je } from "./TableHeadCell/TableHeadCell.js";
|
|
15
|
-
import { TableBodyCell as
|
|
16
|
-
import { TableBodyRow as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
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
|
-
}),
|
|
30
|
-
backgroundColor:
|
|
31
|
-
color:
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
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,
|
|
35
38
|
columns: I,
|
|
36
|
-
showBorders:
|
|
37
|
-
enableSorting:
|
|
38
|
-
enablePagination:
|
|
39
|
-
enableRowSelection:
|
|
40
|
-
enableMultiRowSelection:
|
|
41
|
-
enableColumnPinning:
|
|
42
|
-
columnPinning:
|
|
43
|
-
onColumnPinningChange:
|
|
44
|
-
sorting:
|
|
45
|
-
onSortingChange:
|
|
46
|
-
manualSorting:
|
|
47
|
-
columnFilters:
|
|
48
|
-
onColumnFiltersChange:
|
|
49
|
-
columnVisibility:
|
|
50
|
-
onColumnVisibilityChange:
|
|
51
|
-
pagination:
|
|
52
|
-
onPaginationChange:
|
|
53
|
-
rowSelection:
|
|
54
|
-
onRowSelectionChange:
|
|
55
|
-
totalCount:
|
|
56
|
-
loading:
|
|
57
|
-
|
|
39
|
+
showBorders: g = !0,
|
|
40
|
+
enableSorting: z = !1,
|
|
41
|
+
enablePagination: S = !1,
|
|
42
|
+
enableRowSelection: V = !1,
|
|
43
|
+
enableMultiRowSelection: L = !1,
|
|
44
|
+
enableColumnPinning: d = !1,
|
|
45
|
+
columnPinning: E,
|
|
46
|
+
onColumnPinningChange: F,
|
|
47
|
+
sorting: W,
|
|
48
|
+
onSortingChange: j,
|
|
49
|
+
manualSorting: B,
|
|
50
|
+
columnFilters: D,
|
|
51
|
+
onColumnFiltersChange: _,
|
|
52
|
+
columnVisibility: A,
|
|
53
|
+
onColumnVisibilityChange: K,
|
|
54
|
+
pagination: O,
|
|
55
|
+
onPaginationChange: $,
|
|
56
|
+
rowSelection: q,
|
|
57
|
+
onRowSelectionChange: G,
|
|
58
|
+
totalCount: s,
|
|
59
|
+
loading: i = !1,
|
|
60
|
+
loadingRowCount: J = 10,
|
|
61
|
+
emptyLabels: Q = {
|
|
58
62
|
title: "Nothing found",
|
|
59
63
|
description: "Try adjusting your search or filters",
|
|
60
64
|
action: "Reset"
|
|
61
65
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
bodyRowComponent: ae = Le,
|
|
82
|
-
onReset: x,
|
|
83
|
-
paginationVariant: re,
|
|
84
|
-
paginationLabels: me,
|
|
85
|
-
renderPageSizeSelectorDropdownItem: se,
|
|
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,
|
|
86
85
|
renderPageSizeSelectorInputItem: ge
|
|
87
86
|
}) => {
|
|
88
|
-
const [
|
|
89
|
-
|
|
87
|
+
const [de, pe] = m(
|
|
88
|
+
W,
|
|
89
|
+
j,
|
|
90
|
+
[]
|
|
91
|
+
), [he, Ce] = m(
|
|
90
92
|
D,
|
|
93
|
+
_,
|
|
91
94
|
[]
|
|
92
|
-
), [
|
|
95
|
+
), [fe, be] = m(
|
|
93
96
|
A,
|
|
94
|
-
E,
|
|
95
|
-
[]
|
|
96
|
-
), [he, fe] = t(
|
|
97
|
-
G,
|
|
98
|
-
J,
|
|
99
|
-
{}
|
|
100
|
-
), [n, h] = t(
|
|
101
97
|
K,
|
|
98
|
+
{}
|
|
99
|
+
), [a, C] = m(
|
|
102
100
|
O,
|
|
101
|
+
$,
|
|
103
102
|
{ pageIndex: 0, pageSize: 10 }
|
|
104
|
-
), [
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
), [Se, ue] = m(q, G, {}), [ye, we] = m(
|
|
104
|
+
E,
|
|
105
|
+
F,
|
|
107
106
|
{ left: [], right: [] }
|
|
108
|
-
),
|
|
109
|
-
data:
|
|
107
|
+
), R = B ?? !!s, l = He({
|
|
108
|
+
data: h,
|
|
110
109
|
columns: I,
|
|
111
110
|
state: {
|
|
112
|
-
sorting:
|
|
113
|
-
columnFilters:
|
|
114
|
-
columnVisibility:
|
|
115
|
-
pagination:
|
|
116
|
-
rowSelection:
|
|
117
|
-
columnPinning:
|
|
111
|
+
sorting: de,
|
|
112
|
+
columnFilters: he,
|
|
113
|
+
columnVisibility: fe,
|
|
114
|
+
pagination: a,
|
|
115
|
+
rowSelection: Se,
|
|
116
|
+
columnPinning: ye
|
|
118
117
|
},
|
|
119
|
-
onSortingChange:
|
|
118
|
+
onSortingChange: pe,
|
|
120
119
|
onColumnFiltersChange: Ce,
|
|
121
|
-
onColumnVisibilityChange:
|
|
122
|
-
onPaginationChange:
|
|
120
|
+
onColumnVisibilityChange: be,
|
|
121
|
+
onPaginationChange: C,
|
|
123
122
|
onRowSelectionChange: ue,
|
|
124
|
-
onColumnPinningChange:
|
|
123
|
+
onColumnPinningChange: we,
|
|
125
124
|
getCoreRowModel: Me(),
|
|
126
|
-
getSortedRowModel:
|
|
127
|
-
getPaginationRowModel:
|
|
128
|
-
enableRowSelection:
|
|
129
|
-
enableMultiRowSelection:
|
|
130
|
-
enableColumnPinning:
|
|
131
|
-
getRowId:
|
|
132
|
-
manualSorting:
|
|
133
|
-
manualPagination: !!
|
|
134
|
-
pageCount:
|
|
135
|
-
...
|
|
125
|
+
getSortedRowModel: z && !R ? Ne() : void 0,
|
|
126
|
+
getPaginationRowModel: S ? ve() : void 0,
|
|
127
|
+
enableRowSelection: V,
|
|
128
|
+
enableMultiRowSelection: L,
|
|
129
|
+
enableColumnPinning: d,
|
|
130
|
+
getRowId: ne,
|
|
131
|
+
manualSorting: R,
|
|
132
|
+
manualPagination: !!s,
|
|
133
|
+
pageCount: s ? Math.ceil(s / a.pageSize) : void 0,
|
|
134
|
+
...le
|
|
136
135
|
});
|
|
137
|
-
|
|
138
|
-
const { rows: T } =
|
|
139
|
-
|
|
136
|
+
Ie(k, () => l);
|
|
137
|
+
const { rows: T } = l.getRowModel(), xe = (e, t) => {
|
|
138
|
+
y && y(e.original, t);
|
|
140
139
|
}, Re = (e) => /* @__PURE__ */ o(
|
|
141
|
-
|
|
140
|
+
ie,
|
|
142
141
|
{
|
|
143
142
|
style: {
|
|
144
143
|
width: e.getSize(),
|
|
145
|
-
...
|
|
144
|
+
...d && f(l, e.column, n.fill.bgSecondary)
|
|
146
145
|
},
|
|
147
|
-
onClick: e.column.getToggleSortingHandler(),
|
|
148
|
-
children: e.isPlaceholder ? null :
|
|
146
|
+
onClick: i ? void 0 : e.column.getToggleSortingHandler(),
|
|
147
|
+
children: e.isPlaceholder ? null : H(e.column.columnDef.header, e.getContext())
|
|
149
148
|
},
|
|
150
149
|
e.id
|
|
151
|
-
),
|
|
152
|
-
|
|
150
|
+
), Te = (e, t) => /* @__PURE__ */ o(
|
|
151
|
+
x,
|
|
153
152
|
{
|
|
154
|
-
showBorders:
|
|
153
|
+
showBorders: g,
|
|
155
154
|
isSelected: e.getIsSelected(),
|
|
156
|
-
onClick: () =>
|
|
157
|
-
children: e.getVisibleCells().map((
|
|
158
|
-
|
|
155
|
+
onClick: () => xe(e, t),
|
|
156
|
+
children: e.getVisibleCells().map((r) => /* @__PURE__ */ o(
|
|
157
|
+
w,
|
|
159
158
|
{
|
|
160
|
-
style:
|
|
161
|
-
children:
|
|
159
|
+
style: d ? f(l, r.column, n.fill.bgPrimary) : void 0,
|
|
160
|
+
children: H(r.column.columnDef.cell, r.getContext())
|
|
162
161
|
},
|
|
163
|
-
|
|
162
|
+
r.id
|
|
164
163
|
))
|
|
165
164
|
},
|
|
166
165
|
e.id
|
|
166
|
+
), Pe = (e) => /* @__PURE__ */ o(
|
|
167
|
+
x,
|
|
168
|
+
{
|
|
169
|
+
showBorders: g,
|
|
170
|
+
children: l.getVisibleLeafColumns().map((t, r) => /* @__PURE__ */ o(
|
|
171
|
+
w,
|
|
172
|
+
{
|
|
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}`
|
|
167
187
|
);
|
|
168
|
-
return
|
|
169
|
-
|
|
188
|
+
return !i && !T.length ? /* @__PURE__ */ o(
|
|
189
|
+
Le,
|
|
170
190
|
{
|
|
171
191
|
icon: /* @__PURE__ */ o(
|
|
172
|
-
|
|
192
|
+
ze,
|
|
173
193
|
{
|
|
174
|
-
width:
|
|
175
|
-
height:
|
|
176
|
-
style: { color:
|
|
194
|
+
width: 24,
|
|
195
|
+
height: 24,
|
|
196
|
+
style: { color: n.icon.tertiary, marginBottom: v.sm }
|
|
177
197
|
}
|
|
178
198
|
),
|
|
179
|
-
labels:
|
|
180
|
-
onReset:
|
|
181
|
-
className:
|
|
182
|
-
titleClassName:
|
|
183
|
-
descriptionClassName:
|
|
199
|
+
labels: Q,
|
|
200
|
+
onReset: re,
|
|
201
|
+
className: p(u, Z),
|
|
202
|
+
titleClassName: ee,
|
|
203
|
+
descriptionClassName: oe
|
|
184
204
|
}
|
|
185
|
-
) :
|
|
186
|
-
/* @__PURE__ */ o(
|
|
187
|
-
/* @__PURE__ */ o(
|
|
188
|
-
|
|
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)) })
|
|
189
223
|
] }) }),
|
|
190
|
-
|
|
191
|
-
|
|
224
|
+
S && !i && /* @__PURE__ */ o(
|
|
225
|
+
We,
|
|
192
226
|
{
|
|
193
|
-
pageIndex:
|
|
194
|
-
pageSize:
|
|
195
|
-
totalCount:
|
|
196
|
-
variant:
|
|
197
|
-
labels:
|
|
198
|
-
renderPageSizeSelectorDropdownItem:
|
|
227
|
+
pageIndex: a.pageIndex,
|
|
228
|
+
pageSize: a.pageSize,
|
|
229
|
+
totalCount: s || h.length,
|
|
230
|
+
variant: me,
|
|
231
|
+
labels: se,
|
|
232
|
+
renderPageSizeSelectorDropdownItem: ce,
|
|
199
233
|
renderPageSizeSelectorInputItem: ge,
|
|
200
|
-
onPageChange: (e) =>
|
|
201
|
-
onPageSizeChange: (e) =>
|
|
202
|
-
className:
|
|
234
|
+
onPageChange: (e) => C({ ...a, pageIndex: e }),
|
|
235
|
+
onPageSizeChange: (e) => C({ ...a, pageSize: e, pageIndex: 0 }),
|
|
236
|
+
className: te
|
|
203
237
|
}
|
|
204
238
|
)
|
|
205
|
-
] })
|
|
206
|
-
N,
|
|
207
|
-
{
|
|
208
|
-
icon: /* @__PURE__ */ o(
|
|
209
|
-
ze,
|
|
210
|
-
{
|
|
211
|
-
width: 24,
|
|
212
|
-
height: 24,
|
|
213
|
-
style: { color: l.icon.tertiary, marginBottom: f.sm }
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
labels: X,
|
|
217
|
-
onReset: x,
|
|
218
|
-
className: m(C, S),
|
|
219
|
-
titleClassName: y,
|
|
220
|
-
descriptionClassName: w
|
|
221
|
-
}
|
|
222
|
-
);
|
|
239
|
+
] });
|
|
223
240
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
241
|
+
c.displayName = "Table";
|
|
242
|
+
c.HeadCellContent = Ae;
|
|
243
|
+
c.BodyCellContent = M;
|
|
244
|
+
c.HeadCellContentSortable = Ke;
|
|
245
|
+
c.createColumnHelper = ke;
|
|
229
246
|
export {
|
|
230
|
-
|
|
247
|
+
c as Table
|
|
231
248
|
};
|
|
@@ -82,6 +82,11 @@ export interface TableProps<TData> {
|
|
|
82
82
|
/** Загружается ли таблица */
|
|
83
83
|
/** @default false */
|
|
84
84
|
loading?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Количество строк-скелетонов, отображаемых во время загрузки (`loading`).
|
|
87
|
+
* @default 10
|
|
88
|
+
*/
|
|
89
|
+
loadingRowCount?: number;
|
|
85
90
|
/** Сообщение при отсутствии данных */
|
|
86
91
|
/** @default { title: "Nothing found", description: "Try adjusting your search or filters", action: "Reset" } */
|
|
87
92
|
emptyLabels?: {
|
|
@@ -89,13 +94,6 @@ export interface TableProps<TData> {
|
|
|
89
94
|
description: string;
|
|
90
95
|
action: string | React.ReactNode;
|
|
91
96
|
};
|
|
92
|
-
/** Сообщение при загрузке данных */
|
|
93
|
-
/** @default { title: "Loading...", description: "Please wait or reset your promt", action: "Reset" } */
|
|
94
|
-
loadingLabels?: {
|
|
95
|
-
title: string;
|
|
96
|
-
description: string;
|
|
97
|
-
action: string | React.ReactNode;
|
|
98
|
-
};
|
|
99
97
|
/** Кастомный класс для таблицы */
|
|
100
98
|
className?: string;
|
|
101
99
|
/** Кастомный класс для контейнера таблицы */
|
|
@@ -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",
|