@enyxs/wikex-components 0.11.31 → 0.11.32
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 +8 -6
- package/dist/fees-model.d.mts +12 -1
- package/dist/fees-model.d.ts +12 -1
- package/dist/fees-model.js +35 -4
- package/dist/fees-model.js.map +1 -1
- package/dist/fees-model.mjs +34 -4
- package/dist/fees-model.mjs.map +1 -1
- package/dist/fees.d.mts +1 -1
- package/dist/fees.d.ts +1 -1
- package/dist/fees.js +314 -216
- package/dist/fees.js.map +1 -1
- package/dist/fees.mjs +233 -135
- package/dist/fees.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1061 -952
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +914 -805
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/fees.js
CHANGED
|
@@ -37,10 +37,10 @@ __export(fees_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(fees_exports);
|
|
38
38
|
|
|
39
39
|
// src/wikex/fees-manager.tsx
|
|
40
|
-
var
|
|
40
|
+
var import_material3 = require("@mui/material");
|
|
41
41
|
|
|
42
42
|
// src/wikex/fees-table.tsx
|
|
43
|
-
var
|
|
43
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
44
44
|
var import_react3 = require("react");
|
|
45
45
|
var import_styled_components6 = __toESM(require("styled-components"));
|
|
46
46
|
var import_TextField = __toESM(require("@mui/material/TextField"));
|
|
@@ -94,11 +94,28 @@ function moveFeesItem(items, from, to) {
|
|
|
94
94
|
next.splice(to, 0, item);
|
|
95
95
|
return next;
|
|
96
96
|
}
|
|
97
|
+
function setFeesCellAlignment(table, target, textAlign) {
|
|
98
|
+
if (!table.columns.some((column) => column.key === target.columnKey)) return table;
|
|
99
|
+
if (target.part === "thead") {
|
|
100
|
+
return { ...table, columns: table.columns.map((column) => {
|
|
101
|
+
if (column.key !== target.columnKey) return column;
|
|
102
|
+
const { textAlign: _previous, ...rest } = column;
|
|
103
|
+
return { ...rest, ...textAlign ? { textAlign } : {} };
|
|
104
|
+
}) };
|
|
105
|
+
}
|
|
106
|
+
if (!table.rows.some((row) => row.id === target.rowId)) return table;
|
|
107
|
+
return { ...table, rows: table.rows.map((row) => {
|
|
108
|
+
if (row.id !== target.rowId) return row;
|
|
109
|
+
const { cellAlignments: _previous, ...rest } = row;
|
|
110
|
+
const alignments = { ...row.cellAlignments, ...textAlign ? { [target.columnKey]: textAlign } : {} };
|
|
111
|
+
if (!textAlign) delete alignments[target.columnKey];
|
|
112
|
+
return { ...rest, ...Object.keys(alignments).length ? { cellAlignments: alignments } : {} };
|
|
113
|
+
}) };
|
|
114
|
+
}
|
|
97
115
|
|
|
98
116
|
// src/wikex/fees-typography-controls.tsx
|
|
99
117
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
100
118
|
var weightLabels = { 400: "Th\u01B0\u1EDDng", 500: "V\u1EEBa", 600: "H\u01A1i \u0111\u1EADm", 700: "\u0110\u1EADm", 800: "R\u1EA5t \u0111\u1EADm" };
|
|
101
|
-
var alignLabels = { left: "C\u0103n tr\xE1i", center: "C\u0103n gi\u1EEFa", right: "C\u0103n ph\u1EA3i" };
|
|
102
119
|
function FontSizeInput({ label, value, onChange }) {
|
|
103
120
|
const [draft, setDraft] = (0, import_react.useState)(String(value));
|
|
104
121
|
const [error, setError] = (0, import_react.useState)(false);
|
|
@@ -150,7 +167,7 @@ function FeesTypographyControls({ value, onChange }) {
|
|
|
150
167
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: { xs: "column", sm: "row" }, gap: 1.5, justifyContent: "space-between", alignItems: { sm: "center" }, sx: { mb: 2 }, children: [
|
|
151
168
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { children: [
|
|
152
169
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF" }),
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: "\
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: "C\u1EE1 ch\u1EEF v\xE0 \u0111\u1ED9 \u0111\u1EADm \xE1p d\u1EE5ng cho to\xE0n b\u1EA3ng, theo ng\xF4n ng\u1EEF \u0111ang ch\u1ECDn. C\u0103n l\u1EC1 \u0111\u01B0\u1EE3c ch\u1EC9nh ri\xEAng b\u1EB1ng c\xE1ch ch\u1ECDn t\u1EEBng \xF4." })
|
|
154
171
|
] }),
|
|
155
172
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", gap: 1, flexShrink: 0, children: [
|
|
156
173
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { size: "small", variant: "outlined", onClick: () => onChange({ thead: { ...value?.thead, fontSize: 14, fontWeight: 700 }, tbody: { ...value?.tbody, fontSize: 14, fontWeight: 500 } }), children: "D\u1EC5 \u0111\u1ECDc" }),
|
|
@@ -183,29 +200,64 @@ function FeesTypographyControls({ value, onChange }) {
|
|
|
183
200
|
] }, weight))
|
|
184
201
|
}
|
|
185
202
|
)
|
|
186
|
-
] })
|
|
187
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
188
|
-
import_material.TextField,
|
|
189
|
-
{
|
|
190
|
-
select: true,
|
|
191
|
-
fullWidth: true,
|
|
192
|
-
size: "small",
|
|
193
|
-
label: "C\u0103n l\u1EC1",
|
|
194
|
-
value: value?.[part]?.textAlign ?? "",
|
|
195
|
-
slotProps: { select: { displayEmpty: true, SelectDisplayProps: { "aria-labelledby": void 0 }, MenuProps: { container: () => root.current?.ownerDocument.body ?? document.body }, inputProps: { "aria-label": `C\u0103n l\u1EC1 ${title.toLocaleLowerCase("vi")}` } }, inputLabel: { shrink: true } },
|
|
196
|
-
helperText: "\xC1p d\u1EE5ng cho t\u1EA5t c\u1EA3 \xF4, c\u1EA3 tr\xEAn \u0111i\u1EC7n tho\u1EA1i",
|
|
197
|
-
onChange: (event) => update(part, { textAlign: event.target.value ? event.target.value : void 0 }),
|
|
198
|
-
children: [
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.MenuItem, { value: "", children: "Theo m\u1EB7c \u0111\u1ECBnh" }),
|
|
200
|
-
FEES_TEXT_ALIGNS.map((align) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.MenuItem, { value: align, children: alignLabels[align] }, align))
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
)
|
|
203
|
+
] })
|
|
204
204
|
] }, part)) }),
|
|
205
205
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", sx: { display: "block", mt: 1 }, children: "C\u1EE1 ch\u1EEF t\xF9y ch\u1EC9nh \xE1p d\u1EE5ng c\u1EA3 tr\xEAn \u0111i\u1EC7n tho\u1EA1i; b\u1EA3ng c\xF3 th\u1EC3 vu\u1ED1t ngang. \u201CM\u1EB7c \u0111\u1ECBnh\u201D kh\xF4i ph\u1EE5c c\u1EE1 ch\u1EEF t\u1EF1 th\xEDch \u1EE9ng theo m\xE0n h\xECnh." })
|
|
206
206
|
] });
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
// src/wikex/fees-cell-alignment-controls.tsx
|
|
210
|
+
var import_material2 = require("@mui/material");
|
|
211
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
212
|
+
var labels = { left: "C\u0103n tr\xE1i", center: "C\u0103n gi\u1EEFa", right: "C\u0103n ph\u1EA3i" };
|
|
213
|
+
var englishLabels = { left: "Align left", center: "Align center", right: "Align right" };
|
|
214
|
+
function FeesCellAlignmentControls({ label, value, english, onChange }) {
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
216
|
+
import_material2.Stack,
|
|
217
|
+
{
|
|
218
|
+
role: "group",
|
|
219
|
+
"aria-label": english ? "Selected cell alignment" : "C\u0103n l\u1EC1 \xF4 \u0111ang ch\u1ECDn",
|
|
220
|
+
direction: { xs: "column", sm: "row" },
|
|
221
|
+
spacing: 1.5,
|
|
222
|
+
alignItems: { sm: "center" },
|
|
223
|
+
sx: { my: 2, p: 1.5, border: "1px solid", borderColor: "divider", borderRadius: 1.5 },
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Stack, { spacing: 0.5, sx: { flex: 1, minWidth: 0 }, children: [
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "subtitle2", children: english ? "Selected cell alignment" : "C\u0103n l\u1EC1 \xF4 \u0111ang ch\u1ECDn" }),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "caption", color: "text.secondary", title: label, noWrap: true, "aria-live": "polite", children: label ?? (english ? "Select a header or value cell to align it." : "B\u1EA5m v\xE0o \xF4 ti\xEAu \u0111\u1EC1 ho\u1EB7c \xF4 gi\xE1 tr\u1ECB c\u1EA7n c\u0103n l\u1EC1.") })
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Stack, { direction: "row", spacing: 0.5, flexWrap: "wrap", useFlexGap: true, children: [
|
|
230
|
+
FEES_TEXT_ALIGNS.map((align) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
231
|
+
import_material2.Button,
|
|
232
|
+
{
|
|
233
|
+
size: "small",
|
|
234
|
+
disabled: !label,
|
|
235
|
+
variant: value === align ? "contained" : "outlined",
|
|
236
|
+
"aria-pressed": value === align,
|
|
237
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
238
|
+
onClick: () => onChange(align),
|
|
239
|
+
children: (english ? englishLabels : labels)[align]
|
|
240
|
+
},
|
|
241
|
+
align
|
|
242
|
+
)),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
244
|
+
import_material2.Button,
|
|
245
|
+
{
|
|
246
|
+
size: "small",
|
|
247
|
+
color: "inherit",
|
|
248
|
+
disabled: !label || value === void 0,
|
|
249
|
+
"aria-label": english ? "Reset selected cell alignment" : "C\u0103n l\u1EC1 m\u1EB7c \u0111\u1ECBnh cho \xF4 \u0111ang ch\u1ECDn",
|
|
250
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
251
|
+
onClick: () => onChange(void 0),
|
|
252
|
+
children: english ? "Default" : "M\u1EB7c \u0111\u1ECBnh"
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] })
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
209
261
|
// src/commodity-original/styles/colors.ts
|
|
210
262
|
var lightColors = {
|
|
211
263
|
background: {
|
|
@@ -421,7 +473,7 @@ function getTableFixedColumnOffset(columns, columnIndex) {
|
|
|
421
473
|
}
|
|
422
474
|
|
|
423
475
|
// src/commodity-original/components/Table/index.tsx
|
|
424
|
-
var
|
|
476
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
425
477
|
function getCellValue(column, record) {
|
|
426
478
|
return column.dataIndex === void 0 ? void 0 : record[column.dataIndex];
|
|
427
479
|
}
|
|
@@ -494,7 +546,7 @@ function Table({
|
|
|
494
546
|
const nextSelectedRowKeys = event.target.checked ? [...selectedRowKeys, recordKey] : selectedRowKeys.filter((key) => key !== recordKey);
|
|
495
547
|
emitSelectionChange(nextSelectedRowKeys);
|
|
496
548
|
};
|
|
497
|
-
return /* @__PURE__ */ (0,
|
|
549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableScrollContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
498
550
|
TableRoot,
|
|
499
551
|
{
|
|
500
552
|
$minWidth: scroll?.x === void 0 ? void 0 : getTableColumnSize(scroll.x),
|
|
@@ -503,8 +555,8 @@ function Table({
|
|
|
503
555
|
className,
|
|
504
556
|
"data-size": size,
|
|
505
557
|
children: [
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
rowSelection ? /* @__PURE__ */ (0,
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TableHeaderRow, { children: [
|
|
559
|
+
rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableHeaderCell, { scope: "col", children: selectionType === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
508
560
|
TableSelectionInput,
|
|
509
561
|
{
|
|
510
562
|
checked: isAllSelected,
|
|
@@ -513,8 +565,8 @@ function Table({
|
|
|
513
565
|
type: "checkbox"
|
|
514
566
|
}
|
|
515
567
|
) : null }) : null,
|
|
516
|
-
expandable ? /* @__PURE__ */ (0,
|
|
517
|
-
columns.map((column, columnIndex) => /* @__PURE__ */ (0,
|
|
568
|
+
expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableHeaderCell, { scope: "col" }) : null,
|
|
569
|
+
columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
518
570
|
TableHeaderCell,
|
|
519
571
|
{
|
|
520
572
|
$fixed: column.fixed,
|
|
@@ -522,7 +574,7 @@ function Table({
|
|
|
522
574
|
$width: column.width === void 0 ? void 0 : getTableColumnSize(column.width),
|
|
523
575
|
"data-column-key": column.key,
|
|
524
576
|
scope: "col",
|
|
525
|
-
children: column.sortable ? /* @__PURE__ */ (0,
|
|
577
|
+
children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
526
578
|
TableSortButton,
|
|
527
579
|
{
|
|
528
580
|
"aria-pressed": sort?.field === column.key,
|
|
@@ -535,13 +587,13 @@ function Table({
|
|
|
535
587
|
column.key
|
|
536
588
|
))
|
|
537
589
|
] }) }),
|
|
538
|
-
/* @__PURE__ */ (0,
|
|
590
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tbody", { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { colSpan: columnCount, children: loadingContent }) }) : dataSource.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { colSpan: columnCount, children: empty }) }) : dataSource.map((record, index) => {
|
|
539
591
|
const recordKey = getRowKey(record);
|
|
540
592
|
const selectionProps = rowSelection?.getCheckboxProps?.(record);
|
|
541
593
|
const isExpanded = expandedRowKeySet.has(recordKey);
|
|
542
|
-
return /* @__PURE__ */ (0,
|
|
543
|
-
/* @__PURE__ */ (0,
|
|
544
|
-
rowSelection ? /* @__PURE__ */ (0,
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react2.Fragment, { children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TableRow, { "data-row-key": recordKey, children: [
|
|
596
|
+
rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
545
597
|
TableSelectionInput,
|
|
546
598
|
{
|
|
547
599
|
checked: selectedRowKeySet.has(recordKey),
|
|
@@ -551,7 +603,7 @@ function Table({
|
|
|
551
603
|
type: selectionType
|
|
552
604
|
}
|
|
553
605
|
) }) : null,
|
|
554
|
-
expandable ? /* @__PURE__ */ (0,
|
|
606
|
+
expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
555
607
|
TableExpandButton,
|
|
556
608
|
{
|
|
557
609
|
"aria-expanded": isExpanded,
|
|
@@ -562,7 +614,7 @@ function Table({
|
|
|
562
614
|
) }) : null,
|
|
563
615
|
columns.map((column, columnIndex) => {
|
|
564
616
|
const value = getCellValue(column, record);
|
|
565
|
-
return /* @__PURE__ */ (0,
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
566
618
|
TableCell,
|
|
567
619
|
{
|
|
568
620
|
$fixed: column.fixed,
|
|
@@ -574,7 +626,7 @@ function Table({
|
|
|
574
626
|
);
|
|
575
627
|
})
|
|
576
628
|
] }),
|
|
577
|
-
expandable?.render && isExpanded ? /* @__PURE__ */ (0,
|
|
629
|
+
expandable?.render && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableExpandedCell, { colSpan: columnCount, children: expandable.render(record) }) }) : null
|
|
578
630
|
] }, recordKey);
|
|
579
631
|
}) })
|
|
580
632
|
]
|
|
@@ -629,7 +681,7 @@ var PaginationArrow = import_styled_components2.styled.span.withConfig({
|
|
|
629
681
|
], chevron_right_default, chevron_right_default);
|
|
630
682
|
|
|
631
683
|
// src/commodity-original/components/Pagination/index.tsx
|
|
632
|
-
var
|
|
684
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
633
685
|
function getPaginationItems(page, pageCount, siblingCount) {
|
|
634
686
|
const maxVisibleItems = siblingCount * 2 + 5;
|
|
635
687
|
if (pageCount <= maxVisibleItems) {
|
|
@@ -656,7 +708,7 @@ function Pagination({
|
|
|
656
708
|
onPageChange,
|
|
657
709
|
siblingCount = 1,
|
|
658
710
|
ariaLabel,
|
|
659
|
-
labels,
|
|
711
|
+
labels: labels2,
|
|
660
712
|
className
|
|
661
713
|
}) {
|
|
662
714
|
const { t } = (0, import_react_i18next.useTranslation)();
|
|
@@ -665,43 +717,43 @@ function Pagination({
|
|
|
665
717
|
const items = getPaginationItems(currentPage, safePageCount, siblingCount);
|
|
666
718
|
const hasPreviousPage = currentPage > 1;
|
|
667
719
|
const hasNextPage = currentPage < safePageCount;
|
|
668
|
-
return /* @__PURE__ */ (0,
|
|
720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
669
721
|
PaginationNav,
|
|
670
722
|
{
|
|
671
723
|
"aria-label": ariaLabel ?? t("pagination.navigation"),
|
|
672
724
|
className,
|
|
673
|
-
children: /* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(PaginationList, { children: [
|
|
726
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
675
727
|
PaginationButton,
|
|
676
728
|
{
|
|
677
|
-
"aria-label":
|
|
729
|
+
"aria-label": labels2?.previous ?? t("pagination.previous"),
|
|
678
730
|
"data-control": "previous",
|
|
679
731
|
disabled: !hasPreviousPage,
|
|
680
732
|
onClick: () => onPageChange(currentPage - 1),
|
|
681
733
|
type: "button",
|
|
682
|
-
children: /* @__PURE__ */ (0,
|
|
734
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "previous" })
|
|
683
735
|
}
|
|
684
736
|
) }),
|
|
685
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
737
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationButton, { "aria-hidden": "true", disabled: true, tabIndex: -1, type: "button", children: "\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
686
738
|
PaginationButton,
|
|
687
739
|
{
|
|
688
740
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
689
|
-
"aria-label": item === currentPage ?
|
|
741
|
+
"aria-label": item === currentPage ? labels2?.current(item) ?? t("pagination.current", { page: item }) : labels2?.page(item) ?? t("pagination.page", { page: item }),
|
|
690
742
|
"data-active": item === currentPage || void 0,
|
|
691
743
|
onClick: () => onPageChange(item),
|
|
692
744
|
type: "button",
|
|
693
745
|
children: item
|
|
694
746
|
}
|
|
695
747
|
) }, `${item}-${index}`)),
|
|
696
|
-
/* @__PURE__ */ (0,
|
|
748
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
697
749
|
PaginationButton,
|
|
698
750
|
{
|
|
699
|
-
"aria-label":
|
|
751
|
+
"aria-label": labels2?.next ?? t("pagination.next"),
|
|
700
752
|
"data-control": "next",
|
|
701
753
|
disabled: !hasNextPage,
|
|
702
754
|
onClick: () => onPageChange(currentPage + 1),
|
|
703
755
|
type: "button",
|
|
704
|
-
children: /* @__PURE__ */ (0,
|
|
756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "next" })
|
|
705
757
|
}
|
|
706
758
|
) })
|
|
707
759
|
] })
|
|
@@ -737,7 +789,7 @@ var InputAdornment = import_styled_components3.default.span.withConfig({
|
|
|
737
789
|
], ({ theme }) => theme.colors.text.secondary, InputCommonRoot, InputCommonRoot);
|
|
738
790
|
|
|
739
791
|
// src/commodity-original/components/InputCommon/index.tsx
|
|
740
|
-
var
|
|
792
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
741
793
|
function InputCommon({
|
|
742
794
|
leftIcon,
|
|
743
795
|
rightIcon,
|
|
@@ -748,11 +800,11 @@ function InputCommon({
|
|
|
748
800
|
onClear,
|
|
749
801
|
...inputProps
|
|
750
802
|
}) {
|
|
751
|
-
return /* @__PURE__ */ (0,
|
|
752
|
-
leftIcon ? /* @__PURE__ */ (0,
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
754
|
-
clearable && inputProps.value ? /* @__PURE__ */ (0,
|
|
755
|
-
errorMessage ? /* @__PURE__ */ (0,
|
|
803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(InputCommonRoot, { "data-disabled": inputProps.disabled || void 0, "data-error": error || void 0, "data-size": size, children: [
|
|
804
|
+
leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputAdornment, { "aria-hidden": "true", children: leftIcon }) : null,
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputCommonField, { ...inputProps }),
|
|
806
|
+
clearable && inputProps.value ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { "aria-label": "X\xF3a n\u1ED9i dung", onClick: onClear, type: "button", children: "\xD7" }) : rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputAdornment, { "aria-hidden": "true", children: rightIcon }) : null,
|
|
807
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "alert", children: errorMessage }) : null
|
|
756
808
|
] });
|
|
757
809
|
}
|
|
758
810
|
|
|
@@ -784,7 +836,7 @@ var TabLine = import_styled_components4.default.span.withConfig({
|
|
|
784
836
|
], ({ theme }) => theme.colors.accent.primary, TabCommonList, TabCommonList);
|
|
785
837
|
|
|
786
838
|
// src/commodity-original/components/TabCommon/index.tsx
|
|
787
|
-
var
|
|
839
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
788
840
|
function TabCommon({
|
|
789
841
|
items,
|
|
790
842
|
value,
|
|
@@ -793,7 +845,7 @@ function TabCommon({
|
|
|
793
845
|
className,
|
|
794
846
|
size = "md"
|
|
795
847
|
}) {
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
797
849
|
TabCommonList,
|
|
798
850
|
{
|
|
799
851
|
"aria-label": ariaLabel,
|
|
@@ -802,7 +854,7 @@ function TabCommon({
|
|
|
802
854
|
role: "tablist",
|
|
803
855
|
children: items.map((item) => {
|
|
804
856
|
const isActive = item.id === value;
|
|
805
|
-
return /* @__PURE__ */ (0,
|
|
857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
806
858
|
TabButton,
|
|
807
859
|
{
|
|
808
860
|
"aria-selected": isActive,
|
|
@@ -813,7 +865,7 @@ function TabCommon({
|
|
|
813
865
|
type: "button",
|
|
814
866
|
children: [
|
|
815
867
|
item.label,
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabLine, { "aria-hidden": "true" })
|
|
817
869
|
]
|
|
818
870
|
},
|
|
819
871
|
item.id
|
|
@@ -920,32 +972,32 @@ var feesTheme = {
|
|
|
920
972
|
]))
|
|
921
973
|
};
|
|
922
974
|
var EditorActions = import_styled_components6.default.div.withConfig({
|
|
923
|
-
componentId: "sc-
|
|
975
|
+
componentId: "sc-3c959c0c-0"
|
|
924
976
|
})([
|
|
925
977
|
`display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;`
|
|
926
978
|
]);
|
|
927
979
|
var EditGroup = import_styled_components6.default.div.withConfig({
|
|
928
|
-
componentId: "sc-
|
|
980
|
+
componentId: "sc-3c959c0c-1"
|
|
929
981
|
})([
|
|
930
982
|
`display:flex;flex-direction:column;gap:6px;`
|
|
931
983
|
]);
|
|
932
984
|
var HeaderGroup = (0, import_styled_components6.default)(EditGroup).withConfig({
|
|
933
|
-
componentId: "sc-
|
|
985
|
+
componentId: "sc-3c959c0c-2"
|
|
934
986
|
})([
|
|
935
987
|
`gap:8px;`
|
|
936
988
|
]);
|
|
937
989
|
var HeaderTitle = import_styled_components6.default.div.withConfig({
|
|
938
|
-
componentId: "sc-
|
|
990
|
+
componentId: "sc-3c959c0c-3"
|
|
939
991
|
})([
|
|
940
992
|
`display:flex;align-items:flex-start;min-height:var(--fees-header-title-height,36px);`
|
|
941
993
|
]);
|
|
942
994
|
var HeaderActions = import_styled_components6.default.div.withConfig({
|
|
943
|
-
componentId: "sc-
|
|
995
|
+
componentId: "sc-3c959c0c-4"
|
|
944
996
|
})([
|
|
945
997
|
`display:flex;align-items:center;min-height:24px;`
|
|
946
998
|
]);
|
|
947
999
|
var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable).withConfig({
|
|
948
|
-
componentId: "sc-
|
|
1000
|
+
componentId: "sc-3c959c0c-5"
|
|
949
1001
|
})([
|
|
950
1002
|
`&[data-editable] th{vertical-align:top;}--fees-row-background:`,
|
|
951
1003
|
`;--fees-stripe-background:`,
|
|
@@ -968,9 +1020,7 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
|
|
|
968
1020
|
`px;line-height:`,
|
|
969
1021
|
`;}tbody > tr > td{height:40px;padding-top:5.5px;padding-bottom:5.5px;font-size:`,
|
|
970
1022
|
`px;line-height:`,
|
|
971
|
-
`;}thead > tr > th:last-child,tbody > tr > td:last-child{padding-right:12px;}th >
|
|
972
|
-
`;}td > span{text-align:`,
|
|
973
|
-
`;}thead > tr > th:first-child,tbody > tr > td:first-child{position:sticky;left:0;padding-left:12px;}thead > tr > th:first-child{z-index:3;background:`,
|
|
1023
|
+
`;}thead > tr > th:last-child,tbody > tr > td:last-child{padding-right:12px;}thead > tr > th:first-child,tbody > tr > td:first-child{position:sticky;left:0;padding-left:12px;}thead > tr > th:first-child{z-index:3;background:`,
|
|
974
1024
|
`;}tbody > tr > td:first-child{z-index:2;background:var(--fees-row-background);}tbody > tr:nth-child(even) > td:first-child{background:var(--fees-stripe-background);}}}`
|
|
975
1025
|
], ({ theme }) => theme.colors.background.deep, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.accent.foreground, ({ theme }) => theme.colors.background.card, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary, ({ theme }) => theme.colors.accent.foreground, ({ $typography }) => $typography?.thead?.fontSize ?? 10, ({ $typography }) => $typography?.thead?.fontWeight ?? 600, ({ $typography }) => $typography?.thead?.textAlign ?? "left", ({ $typography }) => $typography?.thead?.fontSize ? 1.4 : "14px", ({ $typography }) => $typography?.tbody?.fontSize ?? 12, ({ $typography }) => $typography?.tbody?.fontWeight ?? 500, ({ $typography }) => $typography?.tbody?.textAlign ?? "left", ({ $typography }) => $typography?.tbody?.fontSize ? 1.4 : "16px", ({ $mobileColumnWidths }) => $mobileColumnWidths.reduce((sum, width) => sum + width, 0), ({ $mobileColumnWidths }) => $mobileColumnWidths.map((width, index) => `
|
|
976
1026
|
th:nth-child(${index + 1}), td:nth-child(${index + 1}) {
|
|
@@ -978,15 +1028,16 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
|
|
|
978
1028
|
min-width: ${width}px;
|
|
979
1029
|
max-width: ${width}px;
|
|
980
1030
|
}
|
|
981
|
-
`).join(""), ({ $typography }) => $typography?.thead?.fontSize ?? 8, ({ $typography }) => $typography?.thead?.fontSize ? 1.4 : "10px", ({ $typography }) => $typography?.tbody?.fontSize ?? 10, ({ $typography }) => $typography?.tbody?.fontSize ? 1.4 : "14px", ({
|
|
1031
|
+
`).join(""), ({ $typography }) => $typography?.thead?.fontSize ?? 8, ({ $typography }) => $typography?.thead?.fontSize ? 1.4 : "10px", ({ $typography }) => $typography?.tbody?.fontSize ?? 10, ({ $typography }) => $typography?.tbody?.fontSize ? 1.4 : "14px", ({ theme }) => theme.colors.accent.primary);
|
|
982
1032
|
var FeesCellContent = import_styled_components6.default.span.withConfig({
|
|
983
|
-
componentId: "sc-
|
|
1033
|
+
componentId: "sc-3c959c0c-6"
|
|
984
1034
|
})([
|
|
985
1035
|
`display:block;text-align:`,
|
|
986
|
-
|
|
987
|
-
|
|
1036
|
+
`;@media (max-width:767px){text-align:`,
|
|
1037
|
+
`;}`
|
|
1038
|
+
], ({ $align, $alignRight }) => $align ?? ($alignRight ? "right" : "left"), ({ $align }) => $align ?? "left");
|
|
988
1039
|
var EditorButton = import_styled_components6.default.button.withConfig({
|
|
989
|
-
componentId: "sc-
|
|
1040
|
+
componentId: "sc-3c959c0c-7"
|
|
990
1041
|
})([
|
|
991
1042
|
`padding:7px 12px;border:1px solid `,
|
|
992
1043
|
`;border-radius:6px;background:`,
|
|
@@ -995,17 +1046,17 @@ var EditorButton = import_styled_components6.default.button.withConfig({
|
|
|
995
1046
|
`;}&:disabled{cursor:default;opacity:.4;}`
|
|
996
1047
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
997
1048
|
var OrderActions = import_styled_components6.default.div.withConfig({
|
|
998
|
-
componentId: "sc-
|
|
1049
|
+
componentId: "sc-3c959c0c-8"
|
|
999
1050
|
})([
|
|
1000
1051
|
`display:flex;gap:6px;align-items:center;flex-wrap:wrap;`
|
|
1001
1052
|
]);
|
|
1002
1053
|
var PositionLabel = import_styled_components6.default.label.withConfig({
|
|
1003
|
-
componentId: "sc-
|
|
1054
|
+
componentId: "sc-3c959c0c-9"
|
|
1004
1055
|
})([
|
|
1005
1056
|
`display:inline-flex;align-items:center;gap:6px;font-size:12px;`
|
|
1006
1057
|
]);
|
|
1007
1058
|
var PositionInput = import_styled_components6.default.input.withConfig({
|
|
1008
|
-
componentId: "sc-
|
|
1059
|
+
componentId: "sc-3c959c0c-10"
|
|
1009
1060
|
})([
|
|
1010
1061
|
`width:56px;padding:5px;border:1px solid `,
|
|
1011
1062
|
`;border-radius:4px;background:`,
|
|
@@ -1014,26 +1065,26 @@ var PositionInput = import_styled_components6.default.input.withConfig({
|
|
|
1014
1065
|
`;}`
|
|
1015
1066
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
1016
1067
|
var ColumnRow = import_styled_components6.default.div.withConfig({
|
|
1017
|
-
componentId: "sc-
|
|
1068
|
+
componentId: "sc-3c959c0c-11"
|
|
1018
1069
|
})([
|
|
1019
1070
|
`display:flex;gap:12px;align-items:center;margin:16px 0;> textarea{flex:1;min-width:120px;}@media (max-width:600px){align-items:stretch;flex-direction:column;}`
|
|
1020
1071
|
]);
|
|
1021
1072
|
var PaginationControls = (0, import_styled_components6.default)(FeesAndMarginPagination).withConfig({
|
|
1022
|
-
componentId: "sc-
|
|
1073
|
+
componentId: "sc-3c959c0c-12"
|
|
1023
1074
|
})([
|
|
1024
1075
|
`align-items:center;flex-wrap:wrap;gap:16px 24px;`
|
|
1025
1076
|
]);
|
|
1026
1077
|
var PageSizeLabel = import_styled_components6.default.div.withConfig({
|
|
1027
|
-
componentId: "sc-
|
|
1078
|
+
componentId: "sc-3c959c0c-13"
|
|
1028
1079
|
})([
|
|
1029
1080
|
`display:inline-flex;align-items:center;gap:8px;color:`,
|
|
1030
1081
|
`;font:inherit;font-size:13px;`
|
|
1031
1082
|
], ({ theme }) => theme.colors.text.primary);
|
|
1032
1083
|
function Position({ value, max, label, onMove }) {
|
|
1033
|
-
return /* @__PURE__ */ (0,
|
|
1084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PositionLabel, {
|
|
1034
1085
|
children: [
|
|
1035
1086
|
"V\u1ECB tr\xED",
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PositionInput, {
|
|
1037
1088
|
"aria-label": label,
|
|
1038
1089
|
type: "number",
|
|
1039
1090
|
min: 1,
|
|
@@ -1052,17 +1103,18 @@ function Position({ value, max, label, onMove }) {
|
|
|
1052
1103
|
});
|
|
1053
1104
|
}
|
|
1054
1105
|
var DeleteButton = (0, import_styled_components6.default)(EditorButton).withConfig({
|
|
1055
|
-
componentId: "sc-
|
|
1106
|
+
componentId: "sc-3c959c0c-14"
|
|
1056
1107
|
})([
|
|
1057
1108
|
`align-self:flex-start;padding:4px 8px;border:0;border-radius:4px;background:#d32f2f;color:#fff;font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;text-decoration:none;&:hover{background:#b71c1c;}&:focus-visible{outline:2px solid #d32f2f;outline-offset:2px;}`
|
|
1058
1109
|
]);
|
|
1059
1110
|
var CellEditorInput = import_styled_components6.default.textarea.withConfig({
|
|
1060
|
-
componentId: "sc-
|
|
1111
|
+
componentId: "sc-3c959c0c-15"
|
|
1061
1112
|
})([
|
|
1062
1113
|
`display:block;box-sizing:border-box;width:100%;min-width:0;padding:3px;border:1px solid transparent;border-radius:3px;color:inherit;background:transparent;font:inherit;line-height:inherit;text-align:inherit;resize:none;overflow:hidden;&:hover{border-color:`,
|
|
1063
1114
|
`;}&:focus{outline:1px solid `,
|
|
1115
|
+
`;}&[data-fees-cell-selected="true"]{border-color:`,
|
|
1064
1116
|
`;}`
|
|
1065
|
-
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.accent.primary);
|
|
1117
|
+
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.accent.primary, ({ theme }) => theme.colors.accent.primary);
|
|
1066
1118
|
function CellEditor({ onInput, ...props }) {
|
|
1067
1119
|
const ref = (0, import_react3.useRef)(null);
|
|
1068
1120
|
const fit = () => {
|
|
@@ -1095,7 +1147,7 @@ function CellEditor({ onInput, ...props }) {
|
|
|
1095
1147
|
observer.disconnect();
|
|
1096
1148
|
};
|
|
1097
1149
|
}, []);
|
|
1098
|
-
return /* @__PURE__ */ (0,
|
|
1150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditorInput, {
|
|
1099
1151
|
...props,
|
|
1100
1152
|
ref,
|
|
1101
1153
|
rows: 1,
|
|
@@ -1107,10 +1159,10 @@ function CellEditor({ onInput, ...props }) {
|
|
|
1107
1159
|
}
|
|
1108
1160
|
function RowTagSelect({ selected, options, onChange }) {
|
|
1109
1161
|
const selectRoot = (0, import_react3.useRef)(null);
|
|
1110
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
-
children: /* @__PURE__ */ (0,
|
|
1162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditGroup, {
|
|
1163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1112
1164
|
ref: selectRoot,
|
|
1113
|
-
children: /* @__PURE__ */ (0,
|
|
1165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
|
|
1114
1166
|
multiple: true,
|
|
1115
1167
|
fullWidth: true,
|
|
1116
1168
|
size: "small",
|
|
@@ -1131,10 +1183,10 @@ function RowTagSelect({ selected, options, onChange }) {
|
|
|
1131
1183
|
fontSize: 13
|
|
1132
1184
|
},
|
|
1133
1185
|
children: [
|
|
1134
|
-
options.map((item) => /* @__PURE__ */ (0,
|
|
1186
|
+
options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_MenuItem.default, {
|
|
1135
1187
|
value: item,
|
|
1136
1188
|
children: [
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1189
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Checkbox.default, {
|
|
1138
1190
|
size: "small",
|
|
1139
1191
|
checked: selected.includes(item),
|
|
1140
1192
|
tabIndex: -1,
|
|
@@ -1143,7 +1195,7 @@ function RowTagSelect({ selected, options, onChange }) {
|
|
|
1143
1195
|
item
|
|
1144
1196
|
]
|
|
1145
1197
|
}, item)),
|
|
1146
|
-
!options.length && /* @__PURE__ */ (0,
|
|
1198
|
+
!options.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1147
1199
|
disabled: true,
|
|
1148
1200
|
children: "Ch\u01B0a c\xF3 tag \u2014 d\xF9ng n\xFAt Th\xEAm tag ph\xEDa tr\xEAn"
|
|
1149
1201
|
})
|
|
@@ -1192,13 +1244,14 @@ var rightAlignedColumns = /* @__PURE__ */ new Set([
|
|
|
1192
1244
|
"priceUnit",
|
|
1193
1245
|
"unit"
|
|
1194
1246
|
]);
|
|
1195
|
-
function FeesTable({ value, editable = false, onChange, labels, size = "md", tagOrder = [], language = "vi" }) {
|
|
1247
|
+
function FeesTable({ value, editable = false, onChange, labels: labels2, size = "md", tagOrder = [], language = "vi" }) {
|
|
1196
1248
|
const [search, setSearch] = (0, import_react3.useState)("");
|
|
1197
1249
|
const [tag, setTag] = (0, import_react3.useState)("");
|
|
1198
1250
|
const [page, setPage] = (0, import_react3.useState)(1);
|
|
1199
1251
|
const [pageSize, setPageSize] = (0, import_react3.useState)(FEES_PAGE_SIZE);
|
|
1200
1252
|
const [columnsOpen, setColumnsOpen] = (0, import_react3.useState)(false);
|
|
1201
1253
|
const [typographyOpen, setTypographyOpen] = (0, import_react3.useState)(false);
|
|
1254
|
+
const [selectedCell, setSelectedCell] = (0, import_react3.useState)(null);
|
|
1202
1255
|
const english = language === "en";
|
|
1203
1256
|
const canEdit = editable && Boolean(onChange);
|
|
1204
1257
|
const tableRoot = (0, import_react3.useRef)(null);
|
|
@@ -1236,10 +1289,17 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1236
1289
|
onChange?.({
|
|
1237
1290
|
...value,
|
|
1238
1291
|
columns: value.columns.filter((column) => column.key !== deleteTarget.id),
|
|
1239
|
-
rows: value.rows.map((row) =>
|
|
1240
|
-
...row
|
|
1241
|
-
|
|
1242
|
-
|
|
1292
|
+
rows: value.rows.map((row) => {
|
|
1293
|
+
const { cellAlignments, ...rest } = row;
|
|
1294
|
+
const alignments = Object.fromEntries(Object.entries(cellAlignments ?? {}).filter(([key]) => key !== deleteTarget.id));
|
|
1295
|
+
return {
|
|
1296
|
+
...rest,
|
|
1297
|
+
cells: Object.fromEntries(Object.entries(row.cells).filter(([key]) => key !== deleteTarget.id)),
|
|
1298
|
+
...Object.keys(alignments).length ? {
|
|
1299
|
+
cellAlignments: alignments
|
|
1300
|
+
} : {}
|
|
1301
|
+
};
|
|
1302
|
+
})
|
|
1243
1303
|
});
|
|
1244
1304
|
}
|
|
1245
1305
|
setDeleteTarget(null);
|
|
@@ -1272,6 +1332,17 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1272
1332
|
const filtered = filterFeesRows(value, search, activeTag);
|
|
1273
1333
|
const displayedRows = canEdit ? filtered : sortFeesRowsByName(filtered, language);
|
|
1274
1334
|
const pagination = paginateFeesRows(displayedRows, page, pageSize);
|
|
1335
|
+
const selectedColumn = selectedCell && value.columns.find((column) => column.key === selectedCell.columnKey);
|
|
1336
|
+
const selectedRow = selectedCell?.part === "tbody" ? pagination.rows.find((row) => row.id === selectedCell.rowId) : void 0;
|
|
1337
|
+
const selectedTarget = canEdit && selectedColumn && (selectedCell?.part === "thead" || selectedRow) ? selectedCell : null;
|
|
1338
|
+
const selectedAlign = selectedTarget?.part === "thead" ? selectedColumn?.textAlign : selectedRow?.cellAlignments?.[selectedTarget?.columnKey ?? ""];
|
|
1339
|
+
const selectedLabel = selectedTarget ? selectedTarget.part === "thead" ? `${english ? "Header" : "Ti\xEAu \u0111\u1EC1"}: ${selectedColumn?.title}` : `${selectedColumn?.title} \u2014 ${selectedRow?.cells.name || (english ? "New row" : "H\xE0ng m\u1EDBi")}` : void 0;
|
|
1340
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
1341
|
+
if (selectedCell && !selectedTarget) setSelectedCell(null);
|
|
1342
|
+
}, [
|
|
1343
|
+
selectedCell,
|
|
1344
|
+
selectedTarget
|
|
1345
|
+
]);
|
|
1275
1346
|
const moveColumn = (from, to) => onChange?.({
|
|
1276
1347
|
...value,
|
|
1277
1348
|
columns: moveFeesItem(value.columns, from, to)
|
|
@@ -1317,13 +1388,21 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1317
1388
|
key: column.key,
|
|
1318
1389
|
width: canEdit ? columnWidths[column.key] ?? 140 : index === 0 ? 178 : 170,
|
|
1319
1390
|
fixed: index === 0 ? "left" : void 0,
|
|
1320
|
-
title: canEdit ? /* @__PURE__ */ (0,
|
|
1391
|
+
title: canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
|
|
1321
1392
|
children: [
|
|
1322
|
-
/* @__PURE__ */ (0,
|
|
1323
|
-
children: /* @__PURE__ */ (0,
|
|
1393
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
|
|
1394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1324
1395
|
rows: 2,
|
|
1325
1396
|
value: column.title,
|
|
1326
1397
|
"aria-label": `Ti\xEAu \u0111\u1EC1 c\u1ED9t ${index + 1}`,
|
|
1398
|
+
style: {
|
|
1399
|
+
textAlign: column.textAlign ?? value.typography?.thead?.textAlign ?? "left"
|
|
1400
|
+
},
|
|
1401
|
+
"data-fees-cell-selected": selectedTarget?.part === "thead" && selectedTarget.columnKey === column.key,
|
|
1402
|
+
onFocus: () => setSelectedCell({
|
|
1403
|
+
part: "thead",
|
|
1404
|
+
columnKey: column.key
|
|
1405
|
+
}),
|
|
1327
1406
|
onChange: (event) => onChange?.({
|
|
1328
1407
|
...value,
|
|
1329
1408
|
columns: value.columns.map((item) => item.key === column.key ? {
|
|
@@ -1333,8 +1412,8 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1333
1412
|
})
|
|
1334
1413
|
})
|
|
1335
1414
|
}),
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1337
|
-
children: column.key !== "name" && /* @__PURE__ */ (0,
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {
|
|
1416
|
+
children: column.key !== "name" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1338
1417
|
type: "button",
|
|
1339
1418
|
onClick: () => {
|
|
1340
1419
|
setDeleteTarget({
|
|
@@ -1347,61 +1426,72 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1347
1426
|
})
|
|
1348
1427
|
})
|
|
1349
1428
|
]
|
|
1350
|
-
}) : /* @__PURE__ */ (0,
|
|
1351
|
-
$align: value.typography?.thead?.textAlign
|
|
1429
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
|
|
1430
|
+
$align: column.textAlign ?? value.typography?.thead?.textAlign,
|
|
1431
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
1352
1432
|
children: column.title
|
|
1353
1433
|
}),
|
|
1354
|
-
render: (_unused, row) => canEdit ? /* @__PURE__ */ (0,
|
|
1434
|
+
render: (_unused, row) => canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1355
1435
|
rows: Math.max(2, (row.cells[column.key] ?? "").split("\n").length),
|
|
1356
1436
|
value: row.cells[column.key] ?? "",
|
|
1357
1437
|
"aria-label": `${column.title} \u2014 ${row.cells.name || "H\xE0ng m\u1EDBi"}`,
|
|
1438
|
+
style: {
|
|
1439
|
+
textAlign: row.cellAlignments?.[column.key] ?? value.typography?.tbody?.textAlign ?? "left"
|
|
1440
|
+
},
|
|
1441
|
+
"data-fees-cell-selected": selectedTarget?.part === "tbody" && selectedTarget.rowId === row.id && selectedTarget.columnKey === column.key,
|
|
1442
|
+
onFocus: () => setSelectedCell({
|
|
1443
|
+
part: "tbody",
|
|
1444
|
+
rowId: row.id,
|
|
1445
|
+
columnKey: column.key
|
|
1446
|
+
}),
|
|
1358
1447
|
onChange: (event) => changeRow(row.id, {
|
|
1359
1448
|
cells: {
|
|
1360
1449
|
...row.cells,
|
|
1361
1450
|
[column.key]: event.target.value
|
|
1362
1451
|
}
|
|
1363
1452
|
})
|
|
1364
|
-
}) : /* @__PURE__ */ (0,
|
|
1365
|
-
$align: value.typography?.tbody?.textAlign
|
|
1453
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
|
|
1454
|
+
$align: row.cellAlignments?.[column.key] ?? value.typography?.tbody?.textAlign,
|
|
1455
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
1366
1456
|
children: row.cells[column.key] ?? ""
|
|
1367
1457
|
})
|
|
1368
1458
|
}));
|
|
1369
1459
|
if (canEdit) columns.push({
|
|
1370
1460
|
key: "__tags",
|
|
1371
|
-
title: /* @__PURE__ */ (0,
|
|
1461
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
|
|
1372
1462
|
children: [
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
|
|
1374
1464
|
children: "Tag & th\u1EE9 t\u1EF1 d\xF2ng"
|
|
1375
1465
|
}),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {})
|
|
1377
1467
|
]
|
|
1378
1468
|
}),
|
|
1379
1469
|
width: 300,
|
|
1380
|
-
render: (_unused, row) => /* @__PURE__ */ (0,
|
|
1470
|
+
render: (_unused, row) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditGroup, {
|
|
1381
1471
|
children: [
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowTagSelect, {
|
|
1383
1473
|
selected: row.tags,
|
|
1384
1474
|
options: tags,
|
|
1385
1475
|
onChange: (next) => changeRow(row.id, {
|
|
1386
1476
|
tags: next
|
|
1387
1477
|
})
|
|
1388
1478
|
}),
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
|
|
1390
1480
|
children: [
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
|
|
1392
1482
|
value: value.rows.findIndex((item) => item.id === row.id),
|
|
1393
1483
|
max: value.rows.length,
|
|
1394
1484
|
label: `V\u1ECB tr\xED d\xF2ng ${row.cells.name}`,
|
|
1395
1485
|
onMove: (to) => moveRow(row.id, to)
|
|
1396
1486
|
}),
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1398
1488
|
type: "button",
|
|
1399
1489
|
"aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} l\xEAn`,
|
|
1400
1490
|
disabled: value.rows[0]?.id === row.id,
|
|
1401
1491
|
onClick: () => moveRow(row.id, value.rows.findIndex((item) => item.id === row.id) - 1),
|
|
1402
1492
|
children: "\u2191"
|
|
1403
1493
|
}),
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1405
1495
|
type: "button",
|
|
1406
1496
|
"aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} xu\u1ED1ng`,
|
|
1407
1497
|
disabled: value.rows[value.rows.length - 1]?.id === row.id,
|
|
@@ -1410,7 +1500,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1410
1500
|
})
|
|
1411
1501
|
]
|
|
1412
1502
|
}),
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1414
1504
|
type: "button",
|
|
1415
1505
|
onClick: () => {
|
|
1416
1506
|
setDeleteTarget({
|
|
@@ -1424,30 +1514,30 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1424
1514
|
]
|
|
1425
1515
|
})
|
|
1426
1516
|
});
|
|
1427
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_styled_components6.ThemeProvider, {
|
|
1428
1518
|
theme: feesTheme,
|
|
1429
|
-
children: /* @__PURE__ */ (0,
|
|
1519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
1430
1520
|
ref: tableRoot,
|
|
1431
1521
|
"data-cms-table-editor": true,
|
|
1432
1522
|
onClick: (event) => {
|
|
1433
1523
|
if (canEdit) event.stopPropagation();
|
|
1434
1524
|
},
|
|
1435
1525
|
children: [
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1526
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesAndMarginToolbar, {
|
|
1437
1527
|
"aria-label": "L\u1ECDc b\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
|
|
1438
|
-
children: /* @__PURE__ */ (0,
|
|
1528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(FeesAndMarginToolbarInner, {
|
|
1439
1529
|
children: [
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1441
1531
|
style: {
|
|
1442
1532
|
minWidth: 0
|
|
1443
1533
|
},
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1534
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TabCommon, {
|
|
1445
1535
|
ariaLabel: "L\u1ECDc theo tag",
|
|
1446
1536
|
size,
|
|
1447
1537
|
items: [
|
|
1448
1538
|
{
|
|
1449
1539
|
id: "",
|
|
1450
|
-
label:
|
|
1540
|
+
label: labels2?.all ?? "T\u1EA5t c\u1EA3"
|
|
1451
1541
|
},
|
|
1452
1542
|
...tags.map((item) => ({
|
|
1453
1543
|
id: item,
|
|
@@ -1461,12 +1551,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1461
1551
|
}
|
|
1462
1552
|
})
|
|
1463
1553
|
}),
|
|
1464
|
-
/* @__PURE__ */ (0,
|
|
1465
|
-
children: /* @__PURE__ */ (0,
|
|
1466
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesAndMarginSearch, {
|
|
1555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputCommon, {
|
|
1556
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesSearchIcon, {}),
|
|
1467
1557
|
size: "sm",
|
|
1468
|
-
"aria-label":
|
|
1469
|
-
placeholder:
|
|
1558
|
+
"aria-label": labels2?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
|
|
1559
|
+
placeholder: labels2?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
|
|
1470
1560
|
value: search,
|
|
1471
1561
|
onChange: (event) => {
|
|
1472
1562
|
setSearch(event.target.value);
|
|
@@ -1477,9 +1567,9 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1477
1567
|
]
|
|
1478
1568
|
})
|
|
1479
1569
|
}),
|
|
1480
|
-
canEdit && /* @__PURE__ */ (0,
|
|
1570
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorActions, {
|
|
1481
1571
|
children: [
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1572
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1483
1573
|
type: "button",
|
|
1484
1574
|
onClick: () => {
|
|
1485
1575
|
onChange?.({
|
|
@@ -1490,7 +1580,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1490
1580
|
},
|
|
1491
1581
|
children: english ? "Sort names A\u2013Z" : "S\u1EAFp x\u1EBFp t\xEAn A\u2013Z"
|
|
1492
1582
|
}),
|
|
1493
|
-
/* @__PURE__ */ (0,
|
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1494
1584
|
type: "button",
|
|
1495
1585
|
onClick: () => {
|
|
1496
1586
|
const row = {
|
|
@@ -1514,12 +1604,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1514
1604
|
},
|
|
1515
1605
|
children: "+ Th\xEAm h\xE0ng"
|
|
1516
1606
|
}),
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1607
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1518
1608
|
type: "button",
|
|
1519
1609
|
onClick: addColumn,
|
|
1520
1610
|
children: "+ Th\xEAm c\u1ED9t"
|
|
1521
1611
|
}),
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorButton, {
|
|
1523
1613
|
type: "button",
|
|
1524
1614
|
onClick: () => setColumnsOpen(true),
|
|
1525
1615
|
children: [
|
|
@@ -1528,14 +1618,14 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1528
1618
|
")"
|
|
1529
1619
|
]
|
|
1530
1620
|
}),
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1532
1622
|
type: "button",
|
|
1533
1623
|
"aria-expanded": typographyOpen,
|
|
1534
1624
|
"aria-controls": `${dialogId}-typography`,
|
|
1535
1625
|
onClick: () => setTypographyOpen((open) => !open),
|
|
1536
1626
|
children: "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF"
|
|
1537
1627
|
}),
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1539
1629
|
type: "button",
|
|
1540
1630
|
onClick: () => {
|
|
1541
1631
|
setTagDraft("");
|
|
@@ -1545,12 +1635,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1545
1635
|
})
|
|
1546
1636
|
]
|
|
1547
1637
|
}),
|
|
1548
|
-
canEdit && /* @__PURE__ */ (0,
|
|
1638
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Collapse.default, {
|
|
1549
1639
|
in: typographyOpen,
|
|
1550
1640
|
unmountOnExit: true,
|
|
1551
|
-
children: /* @__PURE__ */ (0,
|
|
1641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1552
1642
|
id: `${dialogId}-typography`,
|
|
1553
|
-
children: /* @__PURE__ */ (0,
|
|
1643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesTypographyControls, {
|
|
1554
1644
|
value: value.typography,
|
|
1555
1645
|
onChange: (typography) => {
|
|
1556
1646
|
const { typography: _previous, ...data } = value;
|
|
@@ -1564,31 +1654,39 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1564
1654
|
})
|
|
1565
1655
|
})
|
|
1566
1656
|
}),
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1657
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellAlignmentControls, {
|
|
1658
|
+
label: selectedLabel,
|
|
1659
|
+
value: selectedAlign,
|
|
1660
|
+
english,
|
|
1661
|
+
onChange: (textAlign) => {
|
|
1662
|
+
if (selectedTarget) onChange?.(setFeesCellAlignment(value, selectedTarget, textAlign));
|
|
1663
|
+
}
|
|
1664
|
+
}),
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AlignedFeesTable, {
|
|
1568
1666
|
$typography: value.typography,
|
|
1569
1667
|
$mobileColumnWidths: columns.map((column) => Math.ceil((mobileColumnWidths[column.key] ?? 88) * mobileFontScale)),
|
|
1570
1668
|
"data-editable": canEdit || void 0,
|
|
1571
|
-
children: /* @__PURE__ */ (0,
|
|
1669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Table, {
|
|
1572
1670
|
ariaLabel: english ? "Fees and margin table" : "B\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
|
|
1573
1671
|
columns,
|
|
1574
1672
|
dataSource: pagination.rows,
|
|
1575
1673
|
rowKey: "id",
|
|
1576
1674
|
size,
|
|
1577
|
-
empty:
|
|
1675
|
+
empty: labels2?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
|
|
1578
1676
|
scroll: {
|
|
1579
1677
|
x: canEdit ? Math.max(1440, value.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + 300) : value.columns.length * 170 + 8
|
|
1580
1678
|
}
|
|
1581
1679
|
})
|
|
1582
1680
|
}),
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PaginationControls, {
|
|
1584
1682
|
children: [
|
|
1585
|
-
/* @__PURE__ */ (0,
|
|
1683
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PageSizeLabel, {
|
|
1586
1684
|
children: [
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1685
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {
|
|
1588
1686
|
id: `${dialogId}-page-size-label`,
|
|
1589
1687
|
children: english ? "Rows per page:" : "S\u1ED1 d\xF2ng m\u1ED7i trang:"
|
|
1590
1688
|
}),
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
|
|
1592
1690
|
size: "small",
|
|
1593
1691
|
value: pageSize,
|
|
1594
1692
|
labelId: `${dialogId}-page-size-label`,
|
|
@@ -1614,11 +1712,11 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1614
1712
|
25,
|
|
1615
1713
|
50,
|
|
1616
1714
|
100
|
|
1617
|
-
].map((size2) => /* @__PURE__ */ (0,
|
|
1715
|
+
].map((size2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1618
1716
|
value: size2,
|
|
1619
1717
|
children: size2
|
|
1620
1718
|
}, size2)),
|
|
1621
|
-
/* @__PURE__ */ (0,
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1622
1720
|
value: -1,
|
|
1623
1721
|
children: english ? "All" : "T\u1EA5t c\u1EA3"
|
|
1624
1722
|
})
|
|
@@ -1626,7 +1724,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1626
1724
|
})
|
|
1627
1725
|
]
|
|
1628
1726
|
}),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", {
|
|
1630
1728
|
"aria-live": "polite",
|
|
1631
1729
|
style: {
|
|
1632
1730
|
fontSize: 13
|
|
@@ -1639,7 +1737,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1639
1737
|
filtered.length
|
|
1640
1738
|
]
|
|
1641
1739
|
}),
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pagination, {
|
|
1643
1741
|
page: pagination.page,
|
|
1644
1742
|
pageCount: pagination.pageCount,
|
|
1645
1743
|
onPageChange: setPage,
|
|
@@ -1653,7 +1751,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1653
1751
|
})
|
|
1654
1752
|
]
|
|
1655
1753
|
}),
|
|
1656
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1657
1755
|
open: columnsOpen && canEdit,
|
|
1658
1756
|
onClose: () => setColumnsOpen(false),
|
|
1659
1757
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1661,18 +1759,18 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1661
1759
|
fullWidth: true,
|
|
1662
1760
|
maxWidth: "md",
|
|
1663
1761
|
children: [
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
|
|
1665
1763
|
id: `${dialogId}-columns-title`,
|
|
1666
1764
|
children: "Qu\u1EA3n l\xFD c\u1ED9t"
|
|
1667
1765
|
}),
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogContent.default, {
|
|
1669
1767
|
children: [
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
|
|
1671
1769
|
children: "\u0110\u1ED5i ti\xEAu \u0111\u1EC1 v\xE0 v\u1ECB tr\xED c\u1ED9t. V\u1ECB tr\xED d\xF2ng/c\u1ED9t \u0111\u01B0\u1EE3c t\xEDnh trong to\xE0n b\u1EA3ng, k\u1EC3 c\u1EA3 c\xE1c d\xF2ng \u0111ang \u1EA9n b\u1EDFi b\u1ED9 l\u1ECDc."
|
|
1672
1770
|
}),
|
|
1673
|
-
value.columns.map((column, index) => /* @__PURE__ */ (0,
|
|
1771
|
+
value.columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ColumnRow, {
|
|
1674
1772
|
children: [
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1676
1774
|
"aria-label": `Ti\xEAu \u0111\u1EC1 c\u1ED9t ${index + 1}`,
|
|
1677
1775
|
value: column.title,
|
|
1678
1776
|
onChange: (event) => onChange?.({
|
|
@@ -1683,29 +1781,29 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1683
1781
|
} : item)
|
|
1684
1782
|
})
|
|
1685
1783
|
}),
|
|
1686
|
-
/* @__PURE__ */ (0,
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
|
|
1687
1785
|
children: [
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
|
|
1689
1787
|
value: index,
|
|
1690
1788
|
max: value.columns.length,
|
|
1691
1789
|
label: `V\u1ECB tr\xED c\u1ED9t ${column.title}`,
|
|
1692
1790
|
onMove: (to) => moveColumn(index, to)
|
|
1693
1791
|
}),
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1792
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1695
1793
|
type: "button",
|
|
1696
1794
|
"aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} l\xEAn`,
|
|
1697
1795
|
disabled: index === 0,
|
|
1698
1796
|
onClick: () => moveColumn(index, index - 1),
|
|
1699
1797
|
children: "\u2191"
|
|
1700
1798
|
}),
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1702
1800
|
type: "button",
|
|
1703
1801
|
"aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} xu\u1ED1ng`,
|
|
1704
1802
|
disabled: index === value.columns.length - 1,
|
|
1705
1803
|
onClick: () => moveColumn(index, index + 1),
|
|
1706
1804
|
children: "\u2193"
|
|
1707
1805
|
}),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1806
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1709
1807
|
type: "button",
|
|
1710
1808
|
disabled: column.key === "name",
|
|
1711
1809
|
onClick: () => setDeleteTarget({
|
|
@@ -1719,15 +1817,15 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1719
1817
|
})
|
|
1720
1818
|
]
|
|
1721
1819
|
}, column.key)),
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1723
1821
|
type: "button",
|
|
1724
1822
|
onClick: addColumn,
|
|
1725
1823
|
children: "+ Th\xEAm c\u1ED9t"
|
|
1726
1824
|
})
|
|
1727
1825
|
]
|
|
1728
1826
|
}),
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1730
|
-
children: /* @__PURE__ */ (0,
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogActions.default, {
|
|
1828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1731
1829
|
variant: "contained",
|
|
1732
1830
|
onClick: () => setColumnsOpen(false),
|
|
1733
1831
|
children: "Xong"
|
|
@@ -1735,7 +1833,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1735
1833
|
})
|
|
1736
1834
|
]
|
|
1737
1835
|
}),
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1739
1837
|
open: createTagOpen && canEdit,
|
|
1740
1838
|
onClose: () => setCreateTagOpen(false),
|
|
1741
1839
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1743,12 +1841,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1743
1841
|
fullWidth: true,
|
|
1744
1842
|
maxWidth: "xs",
|
|
1745
1843
|
children: [
|
|
1746
|
-
/* @__PURE__ */ (0,
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
|
|
1747
1845
|
id: `${dialogId}-create-tag-title`,
|
|
1748
1846
|
children: "T\u1EA1o tag m\u1EDBi"
|
|
1749
1847
|
}),
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1751
|
-
children: /* @__PURE__ */ (0,
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
|
|
1849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_TextField.default, {
|
|
1752
1850
|
autoFocus: true,
|
|
1753
1851
|
fullWidth: true,
|
|
1754
1852
|
margin: "dense",
|
|
@@ -1765,13 +1863,13 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1765
1863
|
}
|
|
1766
1864
|
})
|
|
1767
1865
|
}),
|
|
1768
|
-
/* @__PURE__ */ (0,
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
|
|
1769
1867
|
children: [
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1868
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1771
1869
|
onClick: () => setCreateTagOpen(false),
|
|
1772
1870
|
children: "H\u1EE7y"
|
|
1773
1871
|
}),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1775
1873
|
variant: "contained",
|
|
1776
1874
|
disabled: !newTagName || duplicateTag,
|
|
1777
1875
|
onClick: createTag,
|
|
@@ -1781,7 +1879,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1781
1879
|
})
|
|
1782
1880
|
]
|
|
1783
1881
|
}),
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1882
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1785
1883
|
open: Boolean(deleteTarget) && canEdit,
|
|
1786
1884
|
onClose: () => setDeleteTarget(null),
|
|
1787
1885
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1790,7 +1888,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1790
1888
|
fullWidth: true,
|
|
1791
1889
|
maxWidth: "xs",
|
|
1792
1890
|
children: [
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogTitle.default, {
|
|
1794
1892
|
id: `${dialogId}-title`,
|
|
1795
1893
|
children: [
|
|
1796
1894
|
"X\xF3a ",
|
|
@@ -1798,20 +1896,20 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1798
1896
|
"?"
|
|
1799
1897
|
]
|
|
1800
1898
|
}),
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1802
|
-
children: /* @__PURE__ */ (0,
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
|
|
1900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
|
|
1803
1901
|
id: `${dialogId}-description`,
|
|
1804
1902
|
children: deleteTarget?.kind === "column" ? `B\u1EA1n c\xF3 mu\u1ED1n x\xF3a c\u1ED9t \u201C${deleteTarget.label}\u201D v\xE0 to\xE0n b\u1ED9 n\u1ED9i dung trong c\u1ED9t n\xE0y?` : `B\u1EA1n c\xF3 mu\u1ED1n x\xF3a h\xE0ng \u201C${deleteTarget?.label ?? ""}\u201D?`
|
|
1805
1903
|
})
|
|
1806
1904
|
}),
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1905
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
|
|
1808
1906
|
children: [
|
|
1809
|
-
/* @__PURE__ */ (0,
|
|
1907
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1810
1908
|
autoFocus: true,
|
|
1811
1909
|
onClick: () => setDeleteTarget(null),
|
|
1812
1910
|
children: "H\u1EE7y"
|
|
1813
1911
|
}),
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Button.default, {
|
|
1815
1913
|
color: "error",
|
|
1816
1914
|
variant: "contained",
|
|
1817
1915
|
onClick: confirmDelete,
|
|
@@ -1830,7 +1928,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1830
1928
|
}
|
|
1831
1929
|
|
|
1832
1930
|
// src/wikex/fees-manager.tsx
|
|
1833
|
-
var
|
|
1931
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1834
1932
|
function FeesManager({
|
|
1835
1933
|
entries,
|
|
1836
1934
|
selectedId,
|
|
@@ -1850,16 +1948,16 @@ function FeesManager({
|
|
|
1850
1948
|
}) {
|
|
1851
1949
|
const entry = entries.find((item) => item.id === selectedId);
|
|
1852
1950
|
const key = `${selectedId}:${language}`;
|
|
1853
|
-
return /* @__PURE__ */ (0,
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
1855
|
-
/* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 3, sx: { minWidth: 0, width: 1 }, children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: { xs: "column", md: "row" }, justifyContent: "space-between", alignItems: { md: "center" }, gap: 2.5, children: [
|
|
1953
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 1, sx: { minWidth: 0, maxWidth: 720 }, children: [
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "h4", children: "Ph\xED & k\xFD qu\u1EF9" }),
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "body2", color: "text.secondary", children: "Qu\u1EA3n l\xFD d\u1EEF li\u1EC7u, tag v\xE0 th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB. B\u1ED1 c\u1EE5c v\xE0 n\u1ED9i dung gi\u1EDBi thi\u1EC7u \u0111\u01B0\u1EE3c ch\u1EC9nh trong Layout trang t\u0129nh." })
|
|
1858
1956
|
] }),
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1860
|
-
dirtyKeys.includes(key) && /* @__PURE__ */ (0,
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1862
|
-
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", spacing: 1.5, alignItems: "center", flexShrink: 0, children: [
|
|
1958
|
+
dirtyKeys.includes(key) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", color: "warning", label: "Ch\u01B0a l\u01B0u" }),
|
|
1959
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1960
|
+
import_material3.Button,
|
|
1863
1961
|
{
|
|
1864
1962
|
variant: "contained",
|
|
1865
1963
|
loading: saving,
|
|
@@ -1871,17 +1969,17 @@ function FeesManager({
|
|
|
1871
1969
|
)
|
|
1872
1970
|
] })
|
|
1873
1971
|
] }),
|
|
1874
|
-
!canWrite && /* @__PURE__ */ (0,
|
|
1875
|
-
notice && /* @__PURE__ */ (0,
|
|
1876
|
-
!entries.length ? /* @__PURE__ */ (0,
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
1880
|
-
/* @__PURE__ */ (0,
|
|
1972
|
+
!canWrite && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: "info", children: "B\u1EA1n c\xF3 quy\u1EC1n xem b\u1EA3ng ph\xED. C\u1EA7n quy\u1EC1n s\u1EEDa n\u1ED9i dung \u0111\u1EC3 thay \u0111\u1ED5i d\u1EEF li\u1EC7u." }),
|
|
1973
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: notice.severity, onClose: onDismissNotice, children: notice.message }),
|
|
1974
|
+
!entries.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: "info", children: "Ch\u01B0a c\xF3 b\u1EA3ng ph\xED. Th\xEAm component B\u1EA3ng ph\xED & K\xFD qu\u1EF9 v\xE0o m\u1ED9t trang trong Layout trang t\u0129nh \u0111\u1EC3 b\u1EAFt \u0111\u1EA7u." }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Card, { variant: "outlined", sx: { p: { xs: 2.5, md: 3 }, boxShadow: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 2.5, children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 1.5, flexWrap: "wrap", children: [
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "subtitle1", children: "B\u1EA3ng \u0111ang qu\u1EA3n l\xFD" }),
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", variant: statusChipVariant, label: entry?.status === "published" ? "Trang \u0111\xE3 xu\u1EA5t b\u1EA3n" : "Trang b\u1EA3n nh\xE1p", color: entry?.status === "published" ? "success" : "default" })
|
|
1881
1979
|
] }),
|
|
1882
|
-
/* @__PURE__ */ (0,
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
1884
|
-
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: { xs: "column", md: "row" }, spacing: 2.5, alignItems: { md: "flex-end" }, children: [
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1982
|
+
import_material3.TextField,
|
|
1885
1983
|
{
|
|
1886
1984
|
select: true,
|
|
1887
1985
|
size: "small",
|
|
@@ -1891,7 +1989,7 @@ function FeesManager({
|
|
|
1891
1989
|
fullWidth: true,
|
|
1892
1990
|
sx: { flex: 1, minWidth: 0 },
|
|
1893
1991
|
onChange: (event) => onSelectEntry(event.target.value),
|
|
1894
|
-
children: entries.map((item, index) => /* @__PURE__ */ (0,
|
|
1992
|
+
children: entries.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuItem, { value: item.id, children: [
|
|
1895
1993
|
item.pageTitle,
|
|
1896
1994
|
" \xB7 /",
|
|
1897
1995
|
item.slug,
|
|
@@ -1901,10 +1999,10 @@ function FeesManager({
|
|
|
1901
1999
|
] }, item.id))
|
|
1902
2000
|
}
|
|
1903
2001
|
),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 1, sx: { width: { xs: 1, md: 240 }, flexShrink: 0 }, children: [
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "caption", color: "text.secondary", children: "Ng\xF4n ng\u1EEF n\u1ED9i dung" }),
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2005
|
+
import_material3.ToggleButtonGroup,
|
|
1908
2006
|
{
|
|
1909
2007
|
size: "small",
|
|
1910
2008
|
exclusive: true,
|
|
@@ -1916,11 +2014,11 @@ function FeesManager({
|
|
|
1916
2014
|
if (next === "vi" || next === "en") onSelectLanguage(next);
|
|
1917
2015
|
},
|
|
1918
2016
|
children: [
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "vi", children: [
|
|
1920
2018
|
"Ti\u1EBFng Vi\u1EC7t",
|
|
1921
2019
|
dirtyKeys.includes(`${selectedId}:vi`) ? " \u2022" : ""
|
|
1922
2020
|
] }),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
2021
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "en", children: [
|
|
1924
2022
|
"English",
|
|
1925
2023
|
dirtyKeys.includes(`${selectedId}:en`) ? " \u2022" : ""
|
|
1926
2024
|
] })
|
|
@@ -1930,22 +2028,22 @@ function FeesManager({
|
|
|
1930
2028
|
] })
|
|
1931
2029
|
] })
|
|
1932
2030
|
] }) }),
|
|
1933
|
-
parseError && /* @__PURE__ */ (0,
|
|
1934
|
-
table && /* @__PURE__ */ (0,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
2031
|
+
parseError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: "error", children: parseError }),
|
|
2032
|
+
table && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Card, { inert: saving, "aria-busy": saving, sx: { minWidth: 0, opacity: saving ? 0.65 : 1 }, children: [
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: { xs: "column", sm: "row" }, spacing: 2, justifyContent: "space-between", alignItems: { sm: "center" }, sx: { px: { xs: 2.5, md: 3 }, py: 2.5 }, children: [
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 0.5, children: [
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "subtitle1", children: "D\u1EEF li\u1EC7u ph\xED & k\xFD qu\u1EF9" }),
|
|
2036
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "body2", color: "text.secondary", children: canWrite ? "S\u1EEDa tr\u1EF1c ti\u1EBFp trong \xF4. D\xF9ng Qu\u1EA3n l\xFD c\u1ED9t ho\u1EB7c V\u1ECB tr\xED \u0111\u1EC3 \u0111\u1ED5i th\u1EE9 t\u1EF1." : "Tra c\u1EE9u d\u1EEF li\u1EC7u v\xE0 l\u1ECDc theo nh\xF3m h\xE0ng h\xF3a." })
|
|
1939
2037
|
] }),
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2038
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", spacing: 1, flexShrink: 0, children: [
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", variant: "outlined", label: `${table.rows.length} d\xF2ng` }),
|
|
2040
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", variant: "outlined", label: `${table.columns.length} c\u1ED9t` })
|
|
1943
2041
|
] })
|
|
1944
2042
|
] }),
|
|
1945
|
-
/* @__PURE__ */ (0,
|
|
1946
|
-
/* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Divider, {}),
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Box, { sx: { p: { xs: 2.5, md: 3 }, minWidth: 0 }, children: [
|
|
2045
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "caption", color: "text.secondary", sx: { display: { xs: "block", md: "none" }, mb: 2 }, children: "Vu\u1ED1t ngang trong b\u1EA3ng \u0111\u1EC3 xem th\xEAm c\xE1c c\u1ED9t." }),
|
|
2046
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FeesTable, { value: table, language, editable: canWrite, onChange: canWrite && !saving ? onChange : void 0 }, key)
|
|
1949
2047
|
] })
|
|
1950
2048
|
] })
|
|
1951
2049
|
] })
|