@enyxs/wikex-components 0.11.30 → 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/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 import_material2 = require("@mui/material");
40
+ var import_material3 = require("@mui/material");
41
41
 
42
42
  // src/wikex/fees-table.tsx
43
- var import_jsx_runtime6 = require("react/jsx-runtime");
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"));
@@ -63,6 +63,7 @@ var import_material = require("@mui/material");
63
63
  var FEES_FONT_SIZE_MIN = 8;
64
64
  var FEES_FONT_SIZE_MAX = 32;
65
65
  var FEES_FONT_WEIGHTS = [400, 500, 600, 700, 800];
66
+ var FEES_TEXT_ALIGNS = ["left", "center", "right"];
66
67
  var FEES_PAGE_SIZE = 25;
67
68
  function normalizeFeesSearch(value) {
68
69
  return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/đ/g, "d").replace(/Đ/g, "D").toLowerCase().trim();
@@ -71,6 +72,15 @@ function filterFeesRows(data, search, tag) {
71
72
  const query = normalizeFeesSearch(search);
72
73
  return data.rows.filter((row) => (!tag || row.tags.includes(tag)) && (!query || Object.values(row.cells).some((cell) => normalizeFeesSearch(cell).includes(query))));
73
74
  }
75
+ function sortFeesRowsByName(rows, language = "vi") {
76
+ const collator = new Intl.Collator(language, { sensitivity: "base", numeric: true });
77
+ return [...rows].sort((a, b) => {
78
+ const left = (a.cells.name ?? "").trim();
79
+ const right = (b.cells.name ?? "").trim();
80
+ if (!left || !right) return left ? -1 : right ? 1 : 0;
81
+ return collator.compare(left, right);
82
+ });
83
+ }
74
84
  function paginateFeesRows(rows, requestedPage, pageSize = FEES_PAGE_SIZE) {
75
85
  const size = pageSize === -1 ? Math.max(1, rows.length) : Number.isInteger(pageSize) && pageSize > 0 ? pageSize : FEES_PAGE_SIZE;
76
86
  const pageCount = Math.max(1, Math.ceil(rows.length / size));
@@ -84,6 +94,24 @@ function moveFeesItem(items, from, to) {
84
94
  next.splice(to, 0, item);
85
95
  return next;
86
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
+ }
87
115
 
88
116
  // src/wikex/fees-typography-controls.tsx
89
117
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -128,15 +156,21 @@ function FontSizeInput({ label, value, onChange }) {
128
156
  }
129
157
  function FeesTypographyControls({ value, onChange }) {
130
158
  const root = (0, import_react.useRef)(null);
131
- const update = (part, patch) => onChange({ ...value, [part]: { ...value?.[part], ...patch } });
159
+ const update = (part, patch) => {
160
+ const style = Object.fromEntries(Object.entries({ ...value?.[part], ...patch }).filter(([, setting]) => setting !== void 0));
161
+ const next = { ...value };
162
+ if (Object.keys(style).length) next[part] = style;
163
+ else delete next[part];
164
+ onChange(Object.keys(next).length ? next : void 0);
165
+ };
132
166
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { ref: root, role: "group", "aria-label": "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF b\u1EA3ng ph\xED", sx: { mt: 2, p: { xs: 2, sm: 2.5 }, border: "1px solid", borderColor: "divider", borderRadius: 1.5 }, children: [
133
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: [
134
168
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { children: [
135
169
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF" }),
136
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: "\xC1p d\u1EE5ng cho to\xE0n b\u1EA3ng, theo ng\xF4n ng\u1EEF \u0111ang ch\u1ECDn. Xem thay \u0111\u1ED5i ngay b\xEAn d\u01B0\u1EDBi." })
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." })
137
171
  ] }),
138
172
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", gap: 1, flexShrink: 0, children: [
139
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { size: "small", variant: "outlined", onClick: () => onChange({ thead: { fontSize: 14, fontWeight: 700 }, tbody: { fontSize: 14, fontWeight: 500 } }), children: "D\u1EC5 \u0111\u1ECDc" }),
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" }),
140
174
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { size: "small", color: "inherit", disabled: !value, onClick: () => onChange(void 0), children: "M\u1EB7c \u0111\u1ECBnh" })
141
175
  ] })
142
176
  ] }),
@@ -172,6 +206,58 @@ function FeesTypographyControls({ value, onChange }) {
172
206
  ] });
173
207
  }
174
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
+
175
261
  // src/commodity-original/styles/colors.ts
176
262
  var lightColors = {
177
263
  background: {
@@ -387,7 +473,7 @@ function getTableFixedColumnOffset(columns, columnIndex) {
387
473
  }
388
474
 
389
475
  // src/commodity-original/components/Table/index.tsx
390
- var import_jsx_runtime2 = require("react/jsx-runtime");
476
+ var import_jsx_runtime3 = require("react/jsx-runtime");
391
477
  function getCellValue(column, record) {
392
478
  return column.dataIndex === void 0 ? void 0 : record[column.dataIndex];
393
479
  }
@@ -460,7 +546,7 @@ function Table({
460
546
  const nextSelectedRowKeys = event.target.checked ? [...selectedRowKeys, recordKey] : selectedRowKeys.filter((key) => key !== recordKey);
461
547
  emitSelectionChange(nextSelectedRowKeys);
462
548
  };
463
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableScrollContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
549
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableScrollContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
464
550
  TableRoot,
465
551
  {
466
552
  $minWidth: scroll?.x === void 0 ? void 0 : getTableColumnSize(scroll.x),
@@ -469,8 +555,8 @@ function Table({
469
555
  className,
470
556
  "data-size": size,
471
557
  children: [
472
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(TableHeaderRow, { children: [
473
- rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeaderCell, { scope: "col", children: selectionType === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
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)(
474
560
  TableSelectionInput,
475
561
  {
476
562
  checked: isAllSelected,
@@ -479,8 +565,8 @@ function Table({
479
565
  type: "checkbox"
480
566
  }
481
567
  ) : null }) : null,
482
- expandable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeaderCell, { scope: "col" }) : null,
483
- columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
568
+ expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableHeaderCell, { scope: "col" }) : null,
569
+ columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
484
570
  TableHeaderCell,
485
571
  {
486
572
  $fixed: column.fixed,
@@ -488,7 +574,7 @@ function Table({
488
574
  $width: column.width === void 0 ? void 0 : getTableColumnSize(column.width),
489
575
  "data-column-key": column.key,
490
576
  scope: "col",
491
- children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
577
+ children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
492
578
  TableSortButton,
493
579
  {
494
580
  "aria-pressed": sort?.field === column.key,
@@ -501,13 +587,13 @@ function Table({
501
587
  column.key
502
588
  ))
503
589
  ] }) }),
504
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { colSpan: columnCount, children: loadingContent }) }) : dataSource.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { colSpan: columnCount, children: empty }) }) : dataSource.map((record, index) => {
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) => {
505
591
  const recordKey = getRowKey(record);
506
592
  const selectionProps = rowSelection?.getCheckboxProps?.(record);
507
593
  const isExpanded = expandedRowKeySet.has(recordKey);
508
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.Fragment, { children: [
509
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(TableRow, { "data-row-key": recordKey, children: [
510
- rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
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)(
511
597
  TableSelectionInput,
512
598
  {
513
599
  checked: selectedRowKeySet.has(recordKey),
@@ -517,7 +603,7 @@ function Table({
517
603
  type: selectionType
518
604
  }
519
605
  ) }) : null,
520
- expandable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
606
+ expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
521
607
  TableExpandButton,
522
608
  {
523
609
  "aria-expanded": isExpanded,
@@ -528,7 +614,7 @@ function Table({
528
614
  ) }) : null,
529
615
  columns.map((column, columnIndex) => {
530
616
  const value = getCellValue(column, record);
531
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
617
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
532
618
  TableCell,
533
619
  {
534
620
  $fixed: column.fixed,
@@ -540,7 +626,7 @@ function Table({
540
626
  );
541
627
  })
542
628
  ] }),
543
- expandable?.render && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableExpandedCell, { colSpan: columnCount, children: expandable.render(record) }) }) : null
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
544
630
  ] }, recordKey);
545
631
  }) })
546
632
  ]
@@ -595,7 +681,7 @@ var PaginationArrow = import_styled_components2.styled.span.withConfig({
595
681
  ], chevron_right_default, chevron_right_default);
596
682
 
597
683
  // src/commodity-original/components/Pagination/index.tsx
598
- var import_jsx_runtime3 = require("react/jsx-runtime");
684
+ var import_jsx_runtime4 = require("react/jsx-runtime");
599
685
  function getPaginationItems(page, pageCount, siblingCount) {
600
686
  const maxVisibleItems = siblingCount * 2 + 5;
601
687
  if (pageCount <= maxVisibleItems) {
@@ -622,7 +708,7 @@ function Pagination({
622
708
  onPageChange,
623
709
  siblingCount = 1,
624
710
  ariaLabel,
625
- labels,
711
+ labels: labels2,
626
712
  className
627
713
  }) {
628
714
  const { t } = (0, import_react_i18next.useTranslation)();
@@ -631,43 +717,43 @@ function Pagination({
631
717
  const items = getPaginationItems(currentPage, safePageCount, siblingCount);
632
718
  const hasPreviousPage = currentPage > 1;
633
719
  const hasNextPage = currentPage < safePageCount;
634
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
720
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
635
721
  PaginationNav,
636
722
  {
637
723
  "aria-label": ariaLabel ?? t("pagination.navigation"),
638
724
  className,
639
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PaginationList, { children: [
640
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
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)(
641
727
  PaginationButton,
642
728
  {
643
- "aria-label": labels?.previous ?? t("pagination.previous"),
729
+ "aria-label": labels2?.previous ?? t("pagination.previous"),
644
730
  "data-control": "previous",
645
731
  disabled: !hasPreviousPage,
646
732
  onClick: () => onPageChange(currentPage - 1),
647
733
  type: "button",
648
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationArrow, { "data-direction": "previous" })
734
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "previous" })
649
735
  }
650
736
  ) }),
651
- items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationButton, { "aria-hidden": "true", disabled: true, tabIndex: -1, type: "button", children: "\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
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)(
652
738
  PaginationButton,
653
739
  {
654
740
  "aria-current": item === currentPage ? "page" : void 0,
655
- "aria-label": item === currentPage ? labels?.current(item) ?? t("pagination.current", { page: item }) : labels?.page(item) ?? t("pagination.page", { page: item }),
741
+ "aria-label": item === currentPage ? labels2?.current(item) ?? t("pagination.current", { page: item }) : labels2?.page(item) ?? t("pagination.page", { page: item }),
656
742
  "data-active": item === currentPage || void 0,
657
743
  onClick: () => onPageChange(item),
658
744
  type: "button",
659
745
  children: item
660
746
  }
661
747
  ) }, `${item}-${index}`)),
662
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
748
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
663
749
  PaginationButton,
664
750
  {
665
- "aria-label": labels?.next ?? t("pagination.next"),
751
+ "aria-label": labels2?.next ?? t("pagination.next"),
666
752
  "data-control": "next",
667
753
  disabled: !hasNextPage,
668
754
  onClick: () => onPageChange(currentPage + 1),
669
755
  type: "button",
670
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationArrow, { "data-direction": "next" })
756
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "next" })
671
757
  }
672
758
  ) })
673
759
  ] })
@@ -703,7 +789,7 @@ var InputAdornment = import_styled_components3.default.span.withConfig({
703
789
  ], ({ theme }) => theme.colors.text.secondary, InputCommonRoot, InputCommonRoot);
704
790
 
705
791
  // src/commodity-original/components/InputCommon/index.tsx
706
- var import_jsx_runtime4 = require("react/jsx-runtime");
792
+ var import_jsx_runtime5 = require("react/jsx-runtime");
707
793
  function InputCommon({
708
794
  leftIcon,
709
795
  rightIcon,
@@ -714,11 +800,11 @@ function InputCommon({
714
800
  onClear,
715
801
  ...inputProps
716
802
  }) {
717
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(InputCommonRoot, { "data-disabled": inputProps.disabled || void 0, "data-error": error || void 0, "data-size": size, children: [
718
- leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InputAdornment, { "aria-hidden": "true", children: leftIcon }) : null,
719
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InputCommonField, { ...inputProps }),
720
- clearable && inputProps.value ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { "aria-label": "X\xF3a n\u1ED9i dung", onClick: onClear, type: "button", children: "\xD7" }) : rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InputAdornment, { "aria-hidden": "true", children: rightIcon }) : null,
721
- errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { role: "alert", children: errorMessage }) : null
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
722
808
  ] });
723
809
  }
724
810
 
@@ -750,7 +836,7 @@ var TabLine = import_styled_components4.default.span.withConfig({
750
836
  ], ({ theme }) => theme.colors.accent.primary, TabCommonList, TabCommonList);
751
837
 
752
838
  // src/commodity-original/components/TabCommon/index.tsx
753
- var import_jsx_runtime5 = require("react/jsx-runtime");
839
+ var import_jsx_runtime6 = require("react/jsx-runtime");
754
840
  function TabCommon({
755
841
  items,
756
842
  value,
@@ -759,7 +845,7 @@ function TabCommon({
759
845
  className,
760
846
  size = "md"
761
847
  }) {
762
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
848
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
763
849
  TabCommonList,
764
850
  {
765
851
  "aria-label": ariaLabel,
@@ -768,7 +854,7 @@ function TabCommon({
768
854
  role: "tablist",
769
855
  children: items.map((item) => {
770
856
  const isActive = item.id === value;
771
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
857
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
772
858
  TabButton,
773
859
  {
774
860
  "aria-selected": isActive,
@@ -779,7 +865,7 @@ function TabCommon({
779
865
  type: "button",
780
866
  children: [
781
867
  item.label,
782
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TabLine, { "aria-hidden": "true" })
868
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabLine, { "aria-hidden": "true" })
783
869
  ]
784
870
  },
785
871
  item.id
@@ -886,32 +972,32 @@ var feesTheme = {
886
972
  ]))
887
973
  };
888
974
  var EditorActions = import_styled_components6.default.div.withConfig({
889
- componentId: "sc-a5657aea-0"
975
+ componentId: "sc-3c959c0c-0"
890
976
  })([
891
977
  `display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;`
892
978
  ]);
893
979
  var EditGroup = import_styled_components6.default.div.withConfig({
894
- componentId: "sc-a5657aea-1"
980
+ componentId: "sc-3c959c0c-1"
895
981
  })([
896
982
  `display:flex;flex-direction:column;gap:6px;`
897
983
  ]);
898
984
  var HeaderGroup = (0, import_styled_components6.default)(EditGroup).withConfig({
899
- componentId: "sc-a5657aea-2"
985
+ componentId: "sc-3c959c0c-2"
900
986
  })([
901
987
  `gap:8px;`
902
988
  ]);
903
989
  var HeaderTitle = import_styled_components6.default.div.withConfig({
904
- componentId: "sc-a5657aea-3"
990
+ componentId: "sc-3c959c0c-3"
905
991
  })([
906
992
  `display:flex;align-items:flex-start;min-height:var(--fees-header-title-height,36px);`
907
993
  ]);
908
994
  var HeaderActions = import_styled_components6.default.div.withConfig({
909
- componentId: "sc-a5657aea-4"
995
+ componentId: "sc-3c959c0c-4"
910
996
  })([
911
997
  `display:flex;align-items:center;min-height:24px;`
912
998
  ]);
913
999
  var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable).withConfig({
914
- componentId: "sc-a5657aea-5"
1000
+ componentId: "sc-3c959c0c-5"
915
1001
  })([
916
1002
  `&[data-editable] th{vertical-align:top;}--fees-row-background:`,
917
1003
  `;--fees-stripe-background:`,
@@ -922,9 +1008,11 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
922
1008
  `;}&&& thead > tr > th{height:52px;padding:11.5px 8px;color:`,
923
1009
  `;font-size:`,
924
1010
  `px;font-weight:`,
1011
+ `;text-align:`,
925
1012
  `;line-height:`,
926
1013
  `;white-space:pre-line;}tbody > tr{background:var(--fees-row-background);}tbody > tr:nth-child(even){background:var(--fees-stripe-background);}&&& tbody > tr > td{height:32px;padding:7.5px 8px;background:inherit;color:var(--fees-text);font-size:`,
927
1014
  `px;font-weight:`,
1015
+ `;text-align:`,
928
1016
  `;line-height:`,
929
1017
  `;}thead > tr > th:first-child,tbody > tr > td:first-child{padding-left:16px;}@media (max-width:767px){&&:not([data-editable]){table{min-width:100%;width:`,
930
1018
  `px;table-layout:fixed;}`,
@@ -932,9 +1020,9 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
932
1020
  `px;line-height:`,
933
1021
  `;}tbody > tr > td{height:40px;padding-top:5.5px;padding-bottom:5.5px;font-size:`,
934
1022
  `px;line-height:`,
935
- `;}thead > tr > th:last-child,tbody > tr > td:last-child{padding-right:12px;}th > span,td > span{text-align:left;}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:`,
936
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);}}}`
937
- ], ({ 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?.fontSize ? 1.4 : "14px", ({ $typography }) => $typography?.tbody?.fontSize ?? 12, ({ $typography }) => $typography?.tbody?.fontWeight ?? 500, ({ $typography }) => $typography?.tbody?.fontSize ? 1.4 : "16px", ({ $mobileColumnWidths }) => $mobileColumnWidths.reduce((sum, width) => sum + width, 0), ({ $mobileColumnWidths }) => $mobileColumnWidths.map((width, index) => `
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) => `
938
1026
  th:nth-child(${index + 1}), td:nth-child(${index + 1}) {
939
1027
  width: ${width}px;
940
1028
  min-width: ${width}px;
@@ -942,13 +1030,14 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
942
1030
  }
943
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);
944
1032
  var FeesCellContent = import_styled_components6.default.span.withConfig({
945
- componentId: "sc-a5657aea-6"
1033
+ componentId: "sc-3c959c0c-6"
946
1034
  })([
947
1035
  `display:block;text-align:`,
948
- `;`
949
- ], ({ $alignRight }) => $alignRight ? "right" : "left");
1036
+ `;@media (max-width:767px){text-align:`,
1037
+ `;}`
1038
+ ], ({ $align, $alignRight }) => $align ?? ($alignRight ? "right" : "left"), ({ $align }) => $align ?? "left");
950
1039
  var EditorButton = import_styled_components6.default.button.withConfig({
951
- componentId: "sc-a5657aea-7"
1040
+ componentId: "sc-3c959c0c-7"
952
1041
  })([
953
1042
  `padding:7px 12px;border:1px solid `,
954
1043
  `;border-radius:6px;background:`,
@@ -957,17 +1046,17 @@ var EditorButton = import_styled_components6.default.button.withConfig({
957
1046
  `;}&:disabled{cursor:default;opacity:.4;}`
958
1047
  ], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
959
1048
  var OrderActions = import_styled_components6.default.div.withConfig({
960
- componentId: "sc-a5657aea-8"
1049
+ componentId: "sc-3c959c0c-8"
961
1050
  })([
962
1051
  `display:flex;gap:6px;align-items:center;flex-wrap:wrap;`
963
1052
  ]);
964
1053
  var PositionLabel = import_styled_components6.default.label.withConfig({
965
- componentId: "sc-a5657aea-9"
1054
+ componentId: "sc-3c959c0c-9"
966
1055
  })([
967
1056
  `display:inline-flex;align-items:center;gap:6px;font-size:12px;`
968
1057
  ]);
969
1058
  var PositionInput = import_styled_components6.default.input.withConfig({
970
- componentId: "sc-a5657aea-10"
1059
+ componentId: "sc-3c959c0c-10"
971
1060
  })([
972
1061
  `width:56px;padding:5px;border:1px solid `,
973
1062
  `;border-radius:4px;background:`,
@@ -976,26 +1065,26 @@ var PositionInput = import_styled_components6.default.input.withConfig({
976
1065
  `;}`
977
1066
  ], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
978
1067
  var ColumnRow = import_styled_components6.default.div.withConfig({
979
- componentId: "sc-a5657aea-11"
1068
+ componentId: "sc-3c959c0c-11"
980
1069
  })([
981
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;}`
982
1071
  ]);
983
1072
  var PaginationControls = (0, import_styled_components6.default)(FeesAndMarginPagination).withConfig({
984
- componentId: "sc-a5657aea-12"
1073
+ componentId: "sc-3c959c0c-12"
985
1074
  })([
986
1075
  `align-items:center;flex-wrap:wrap;gap:16px 24px;`
987
1076
  ]);
988
1077
  var PageSizeLabel = import_styled_components6.default.div.withConfig({
989
- componentId: "sc-a5657aea-13"
1078
+ componentId: "sc-3c959c0c-13"
990
1079
  })([
991
1080
  `display:inline-flex;align-items:center;gap:8px;color:`,
992
1081
  `;font:inherit;font-size:13px;`
993
1082
  ], ({ theme }) => theme.colors.text.primary);
994
1083
  function Position({ value, max, label, onMove }) {
995
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PositionLabel, {
1084
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PositionLabel, {
996
1085
  children: [
997
1086
  "V\u1ECB tr\xED",
998
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PositionInput, {
1087
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PositionInput, {
999
1088
  "aria-label": label,
1000
1089
  type: "number",
1001
1090
  min: 1,
@@ -1014,17 +1103,18 @@ function Position({ value, max, label, onMove }) {
1014
1103
  });
1015
1104
  }
1016
1105
  var DeleteButton = (0, import_styled_components6.default)(EditorButton).withConfig({
1017
- componentId: "sc-a5657aea-14"
1106
+ componentId: "sc-3c959c0c-14"
1018
1107
  })([
1019
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;}`
1020
1109
  ]);
1021
1110
  var CellEditorInput = import_styled_components6.default.textarea.withConfig({
1022
- componentId: "sc-a5657aea-15"
1111
+ componentId: "sc-3c959c0c-15"
1023
1112
  })([
1024
- `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;resize:none;overflow:hidden;&:hover{border-color:`,
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:`,
1025
1114
  `;}&:focus{outline:1px solid `,
1115
+ `;}&[data-fees-cell-selected="true"]{border-color:`,
1026
1116
  `;}`
1027
- ], ({ 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);
1028
1118
  function CellEditor({ onInput, ...props }) {
1029
1119
  const ref = (0, import_react3.useRef)(null);
1030
1120
  const fit = () => {
@@ -1057,7 +1147,7 @@ function CellEditor({ onInput, ...props }) {
1057
1147
  observer.disconnect();
1058
1148
  };
1059
1149
  }, []);
1060
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CellEditorInput, {
1150
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditorInput, {
1061
1151
  ...props,
1062
1152
  ref,
1063
1153
  rows: 1,
@@ -1069,10 +1159,10 @@ function CellEditor({ onInput, ...props }) {
1069
1159
  }
1070
1160
  function RowTagSelect({ selected, options, onChange }) {
1071
1161
  const selectRoot = (0, import_react3.useRef)(null);
1072
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditGroup, {
1073
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
1162
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditGroup, {
1163
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
1074
1164
  ref: selectRoot,
1075
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Select.default, {
1165
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
1076
1166
  multiple: true,
1077
1167
  fullWidth: true,
1078
1168
  size: "small",
@@ -1093,10 +1183,10 @@ function RowTagSelect({ selected, options, onChange }) {
1093
1183
  fontSize: 13
1094
1184
  },
1095
1185
  children: [
1096
- options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_MenuItem.default, {
1186
+ options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_MenuItem.default, {
1097
1187
  value: item,
1098
1188
  children: [
1099
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Checkbox.default, {
1189
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Checkbox.default, {
1100
1190
  size: "small",
1101
1191
  checked: selected.includes(item),
1102
1192
  tabIndex: -1,
@@ -1105,7 +1195,7 @@ function RowTagSelect({ selected, options, onChange }) {
1105
1195
  item
1106
1196
  ]
1107
1197
  }, item)),
1108
- !options.length && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_MenuItem.default, {
1198
+ !options.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
1109
1199
  disabled: true,
1110
1200
  children: "Ch\u01B0a c\xF3 tag \u2014 d\xF9ng n\xFAt Th\xEAm tag ph\xEDa tr\xEAn"
1111
1201
  })
@@ -1154,13 +1244,14 @@ var rightAlignedColumns = /* @__PURE__ */ new Set([
1154
1244
  "priceUnit",
1155
1245
  "unit"
1156
1246
  ]);
1157
- 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" }) {
1158
1248
  const [search, setSearch] = (0, import_react3.useState)("");
1159
1249
  const [tag, setTag] = (0, import_react3.useState)("");
1160
1250
  const [page, setPage] = (0, import_react3.useState)(1);
1161
1251
  const [pageSize, setPageSize] = (0, import_react3.useState)(FEES_PAGE_SIZE);
1162
1252
  const [columnsOpen, setColumnsOpen] = (0, import_react3.useState)(false);
1163
1253
  const [typographyOpen, setTypographyOpen] = (0, import_react3.useState)(false);
1254
+ const [selectedCell, setSelectedCell] = (0, import_react3.useState)(null);
1164
1255
  const english = language === "en";
1165
1256
  const canEdit = editable && Boolean(onChange);
1166
1257
  const tableRoot = (0, import_react3.useRef)(null);
@@ -1198,10 +1289,17 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1198
1289
  onChange?.({
1199
1290
  ...value,
1200
1291
  columns: value.columns.filter((column) => column.key !== deleteTarget.id),
1201
- rows: value.rows.map((row) => ({
1202
- ...row,
1203
- cells: Object.fromEntries(Object.entries(row.cells).filter(([key]) => key !== deleteTarget.id))
1204
- }))
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
+ })
1205
1303
  });
1206
1304
  }
1207
1305
  setDeleteTarget(null);
@@ -1232,7 +1330,19 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1232
1330
  };
1233
1331
  const activeTag = tags.includes(tag) ? tag : "";
1234
1332
  const filtered = filterFeesRows(value, search, activeTag);
1235
- const pagination = paginateFeesRows(filtered, page, pageSize);
1333
+ const displayedRows = canEdit ? filtered : sortFeesRowsByName(filtered, language);
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
+ ]);
1236
1346
  const moveColumn = (from, to) => onChange?.({
1237
1347
  ...value,
1238
1348
  columns: moveFeesItem(value.columns, from, to)
@@ -1278,13 +1388,21 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1278
1388
  key: column.key,
1279
1389
  width: canEdit ? columnWidths[column.key] ?? 140 : index === 0 ? 178 : 170,
1280
1390
  fixed: index === 0 ? "left" : void 0,
1281
- title: canEdit ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(HeaderGroup, {
1391
+ title: canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
1282
1392
  children: [
1283
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderTitle, {
1284
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CellEditor, {
1393
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
1394
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
1285
1395
  rows: 2,
1286
1396
  value: column.title,
1287
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
+ }),
1288
1406
  onChange: (event) => onChange?.({
1289
1407
  ...value,
1290
1408
  columns: value.columns.map((item) => item.key === column.key ? {
@@ -1294,8 +1412,8 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1294
1412
  })
1295
1413
  })
1296
1414
  }),
1297
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderActions, {
1298
- children: column.key !== "name" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DeleteButton, {
1415
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {
1416
+ children: column.key !== "name" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
1299
1417
  type: "button",
1300
1418
  onClick: () => {
1301
1419
  setDeleteTarget({
@@ -1308,61 +1426,72 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1308
1426
  })
1309
1427
  })
1310
1428
  ]
1311
- }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesCellContent, {
1429
+ }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
1430
+ $align: column.textAlign ?? value.typography?.thead?.textAlign,
1312
1431
  $alignRight: rightAlignedColumns.has(column.key),
1313
1432
  children: column.title
1314
1433
  }),
1315
- render: (_unused, row) => canEdit ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CellEditor, {
1434
+ render: (_unused, row) => canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
1316
1435
  rows: Math.max(2, (row.cells[column.key] ?? "").split("\n").length),
1317
1436
  value: row.cells[column.key] ?? "",
1318
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
+ }),
1319
1447
  onChange: (event) => changeRow(row.id, {
1320
1448
  cells: {
1321
1449
  ...row.cells,
1322
1450
  [column.key]: event.target.value
1323
1451
  }
1324
1452
  })
1325
- }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesCellContent, {
1453
+ }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
1454
+ $align: row.cellAlignments?.[column.key] ?? value.typography?.tbody?.textAlign,
1326
1455
  $alignRight: rightAlignedColumns.has(column.key),
1327
1456
  children: row.cells[column.key] ?? ""
1328
1457
  })
1329
1458
  }));
1330
1459
  if (canEdit) columns.push({
1331
1460
  key: "__tags",
1332
- title: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(HeaderGroup, {
1461
+ title: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
1333
1462
  children: [
1334
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderTitle, {
1463
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
1335
1464
  children: "Tag & th\u1EE9 t\u1EF1 d\xF2ng"
1336
1465
  }),
1337
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderActions, {})
1466
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {})
1338
1467
  ]
1339
1468
  }),
1340
1469
  width: 300,
1341
- render: (_unused, row) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(EditGroup, {
1470
+ render: (_unused, row) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditGroup, {
1342
1471
  children: [
1343
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RowTagSelect, {
1472
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowTagSelect, {
1344
1473
  selected: row.tags,
1345
1474
  options: tags,
1346
1475
  onChange: (next) => changeRow(row.id, {
1347
1476
  tags: next
1348
1477
  })
1349
1478
  }),
1350
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(OrderActions, {
1479
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
1351
1480
  children: [
1352
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Position, {
1481
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
1353
1482
  value: value.rows.findIndex((item) => item.id === row.id),
1354
1483
  max: value.rows.length,
1355
1484
  label: `V\u1ECB tr\xED d\xF2ng ${row.cells.name}`,
1356
1485
  onMove: (to) => moveRow(row.id, to)
1357
1486
  }),
1358
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1487
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1359
1488
  type: "button",
1360
1489
  "aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} l\xEAn`,
1361
1490
  disabled: value.rows[0]?.id === row.id,
1362
1491
  onClick: () => moveRow(row.id, value.rows.findIndex((item) => item.id === row.id) - 1),
1363
1492
  children: "\u2191"
1364
1493
  }),
1365
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1494
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1366
1495
  type: "button",
1367
1496
  "aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} xu\u1ED1ng`,
1368
1497
  disabled: value.rows[value.rows.length - 1]?.id === row.id,
@@ -1371,7 +1500,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1371
1500
  })
1372
1501
  ]
1373
1502
  }),
1374
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DeleteButton, {
1503
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
1375
1504
  type: "button",
1376
1505
  onClick: () => {
1377
1506
  setDeleteTarget({
@@ -1385,30 +1514,30 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1385
1514
  ]
1386
1515
  })
1387
1516
  });
1388
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_styled_components6.ThemeProvider, {
1517
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_styled_components6.ThemeProvider, {
1389
1518
  theme: feesTheme,
1390
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
1519
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
1391
1520
  ref: tableRoot,
1392
1521
  "data-cms-table-editor": true,
1393
1522
  onClick: (event) => {
1394
1523
  if (canEdit) event.stopPropagation();
1395
1524
  },
1396
1525
  children: [
1397
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesAndMarginToolbar, {
1526
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesAndMarginToolbar, {
1398
1527
  "aria-label": "L\u1ECDc b\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
1399
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(FeesAndMarginToolbarInner, {
1528
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(FeesAndMarginToolbarInner, {
1400
1529
  children: [
1401
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
1530
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
1402
1531
  style: {
1403
1532
  minWidth: 0
1404
1533
  },
1405
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabCommon, {
1534
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TabCommon, {
1406
1535
  ariaLabel: "L\u1ECDc theo tag",
1407
1536
  size,
1408
1537
  items: [
1409
1538
  {
1410
1539
  id: "",
1411
- label: labels?.all ?? "T\u1EA5t c\u1EA3"
1540
+ label: labels2?.all ?? "T\u1EA5t c\u1EA3"
1412
1541
  },
1413
1542
  ...tags.map((item) => ({
1414
1543
  id: item,
@@ -1422,12 +1551,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1422
1551
  }
1423
1552
  })
1424
1553
  }),
1425
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesAndMarginSearch, {
1426
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(InputCommon, {
1427
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesSearchIcon, {}),
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, {}),
1428
1557
  size: "sm",
1429
- "aria-label": labels?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
1430
- placeholder: labels?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
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",
1431
1560
  value: search,
1432
1561
  onChange: (event) => {
1433
1562
  setSearch(event.target.value);
@@ -1438,9 +1567,20 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1438
1567
  ]
1439
1568
  })
1440
1569
  }),
1441
- canEdit && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(EditorActions, {
1570
+ canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorActions, {
1442
1571
  children: [
1443
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1572
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1573
+ type: "button",
1574
+ onClick: () => {
1575
+ onChange?.({
1576
+ ...value,
1577
+ rows: sortFeesRowsByName(value.rows, language)
1578
+ });
1579
+ setPage(1);
1580
+ },
1581
+ children: english ? "Sort names A\u2013Z" : "S\u1EAFp x\u1EBFp t\xEAn A\u2013Z"
1582
+ }),
1583
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1444
1584
  type: "button",
1445
1585
  onClick: () => {
1446
1586
  const row = {
@@ -1464,12 +1604,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1464
1604
  },
1465
1605
  children: "+ Th\xEAm h\xE0ng"
1466
1606
  }),
1467
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1607
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1468
1608
  type: "button",
1469
1609
  onClick: addColumn,
1470
1610
  children: "+ Th\xEAm c\u1ED9t"
1471
1611
  }),
1472
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(EditorButton, {
1612
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorButton, {
1473
1613
  type: "button",
1474
1614
  onClick: () => setColumnsOpen(true),
1475
1615
  children: [
@@ -1478,14 +1618,14 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1478
1618
  ")"
1479
1619
  ]
1480
1620
  }),
1481
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1621
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1482
1622
  type: "button",
1483
1623
  "aria-expanded": typographyOpen,
1484
1624
  "aria-controls": `${dialogId}-typography`,
1485
1625
  onClick: () => setTypographyOpen((open) => !open),
1486
1626
  children: "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF"
1487
1627
  }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1628
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1489
1629
  type: "button",
1490
1630
  onClick: () => {
1491
1631
  setTagDraft("");
@@ -1495,12 +1635,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1495
1635
  })
1496
1636
  ]
1497
1637
  }),
1498
- canEdit && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Collapse.default, {
1638
+ canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Collapse.default, {
1499
1639
  in: typographyOpen,
1500
1640
  unmountOnExit: true,
1501
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
1641
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
1502
1642
  id: `${dialogId}-typography`,
1503
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FeesTypographyControls, {
1643
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesTypographyControls, {
1504
1644
  value: value.typography,
1505
1645
  onChange: (typography) => {
1506
1646
  const { typography: _previous, ...data } = value;
@@ -1514,31 +1654,39 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1514
1654
  })
1515
1655
  })
1516
1656
  }),
1517
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AlignedFeesTable, {
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, {
1518
1666
  $typography: value.typography,
1519
1667
  $mobileColumnWidths: columns.map((column) => Math.ceil((mobileColumnWidths[column.key] ?? 88) * mobileFontScale)),
1520
1668
  "data-editable": canEdit || void 0,
1521
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Table, {
1669
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Table, {
1522
1670
  ariaLabel: english ? "Fees and margin table" : "B\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
1523
1671
  columns,
1524
1672
  dataSource: pagination.rows,
1525
1673
  rowKey: "id",
1526
1674
  size,
1527
- empty: labels?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
1675
+ empty: labels2?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
1528
1676
  scroll: {
1529
1677
  x: canEdit ? Math.max(1440, value.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + 300) : value.columns.length * 170 + 8
1530
1678
  }
1531
1679
  })
1532
1680
  }),
1533
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PaginationControls, {
1681
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PaginationControls, {
1534
1682
  children: [
1535
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PageSizeLabel, {
1683
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PageSizeLabel, {
1536
1684
  children: [
1537
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
1685
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {
1538
1686
  id: `${dialogId}-page-size-label`,
1539
1687
  children: english ? "Rows per page:" : "S\u1ED1 d\xF2ng m\u1ED7i trang:"
1540
1688
  }),
1541
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Select.default, {
1689
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
1542
1690
  size: "small",
1543
1691
  value: pageSize,
1544
1692
  labelId: `${dialogId}-page-size-label`,
@@ -1564,11 +1712,11 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1564
1712
  25,
1565
1713
  50,
1566
1714
  100
1567
- ].map((size2) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_MenuItem.default, {
1715
+ ].map((size2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
1568
1716
  value: size2,
1569
1717
  children: size2
1570
1718
  }, size2)),
1571
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_MenuItem.default, {
1719
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
1572
1720
  value: -1,
1573
1721
  children: english ? "All" : "T\u1EA5t c\u1EA3"
1574
1722
  })
@@ -1576,7 +1724,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1576
1724
  })
1577
1725
  ]
1578
1726
  }),
1579
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", {
1727
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", {
1580
1728
  "aria-live": "polite",
1581
1729
  style: {
1582
1730
  fontSize: 13
@@ -1589,7 +1737,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1589
1737
  filtered.length
1590
1738
  ]
1591
1739
  }),
1592
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pagination, {
1740
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pagination, {
1593
1741
  page: pagination.page,
1594
1742
  pageCount: pagination.pageCount,
1595
1743
  onPageChange: setPage,
@@ -1603,7 +1751,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1603
1751
  })
1604
1752
  ]
1605
1753
  }),
1606
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, {
1754
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
1607
1755
  open: columnsOpen && canEdit,
1608
1756
  onClose: () => setColumnsOpen(false),
1609
1757
  container: () => tableRoot.current?.ownerDocument.body ?? document.body,
@@ -1611,18 +1759,18 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1611
1759
  fullWidth: true,
1612
1760
  maxWidth: "md",
1613
1761
  children: [
1614
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, {
1762
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
1615
1763
  id: `${dialogId}-columns-title`,
1616
1764
  children: "Qu\u1EA3n l\xFD c\u1ED9t"
1617
1765
  }),
1618
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogContent.default, {
1766
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogContent.default, {
1619
1767
  children: [
1620
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContentText.default, {
1768
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
1621
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."
1622
1770
  }),
1623
- value.columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ColumnRow, {
1771
+ value.columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ColumnRow, {
1624
1772
  children: [
1625
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CellEditor, {
1773
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
1626
1774
  "aria-label": `Ti\xEAu \u0111\u1EC1 c\u1ED9t ${index + 1}`,
1627
1775
  value: column.title,
1628
1776
  onChange: (event) => onChange?.({
@@ -1633,29 +1781,29 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1633
1781
  } : item)
1634
1782
  })
1635
1783
  }),
1636
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(OrderActions, {
1784
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
1637
1785
  children: [
1638
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Position, {
1786
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
1639
1787
  value: index,
1640
1788
  max: value.columns.length,
1641
1789
  label: `V\u1ECB tr\xED c\u1ED9t ${column.title}`,
1642
1790
  onMove: (to) => moveColumn(index, to)
1643
1791
  }),
1644
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1792
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1645
1793
  type: "button",
1646
1794
  "aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} l\xEAn`,
1647
1795
  disabled: index === 0,
1648
1796
  onClick: () => moveColumn(index, index - 1),
1649
1797
  children: "\u2191"
1650
1798
  }),
1651
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1799
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1652
1800
  type: "button",
1653
1801
  "aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} xu\u1ED1ng`,
1654
1802
  disabled: index === value.columns.length - 1,
1655
1803
  onClick: () => moveColumn(index, index + 1),
1656
1804
  children: "\u2193"
1657
1805
  }),
1658
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DeleteButton, {
1806
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
1659
1807
  type: "button",
1660
1808
  disabled: column.key === "name",
1661
1809
  onClick: () => setDeleteTarget({
@@ -1669,15 +1817,15 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1669
1817
  })
1670
1818
  ]
1671
1819
  }, column.key)),
1672
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditorButton, {
1820
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
1673
1821
  type: "button",
1674
1822
  onClick: addColumn,
1675
1823
  children: "+ Th\xEAm c\u1ED9t"
1676
1824
  })
1677
1825
  ]
1678
1826
  }),
1679
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogActions.default, {
1680
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, {
1827
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogActions.default, {
1828
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
1681
1829
  variant: "contained",
1682
1830
  onClick: () => setColumnsOpen(false),
1683
1831
  children: "Xong"
@@ -1685,7 +1833,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1685
1833
  })
1686
1834
  ]
1687
1835
  }),
1688
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, {
1836
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
1689
1837
  open: createTagOpen && canEdit,
1690
1838
  onClose: () => setCreateTagOpen(false),
1691
1839
  container: () => tableRoot.current?.ownerDocument.body ?? document.body,
@@ -1693,12 +1841,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1693
1841
  fullWidth: true,
1694
1842
  maxWidth: "xs",
1695
1843
  children: [
1696
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, {
1844
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
1697
1845
  id: `${dialogId}-create-tag-title`,
1698
1846
  children: "T\u1EA1o tag m\u1EDBi"
1699
1847
  }),
1700
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, {
1701
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_TextField.default, {
1848
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
1849
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_TextField.default, {
1702
1850
  autoFocus: true,
1703
1851
  fullWidth: true,
1704
1852
  margin: "dense",
@@ -1715,13 +1863,13 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1715
1863
  }
1716
1864
  })
1717
1865
  }),
1718
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogActions.default, {
1866
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
1719
1867
  children: [
1720
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, {
1868
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
1721
1869
  onClick: () => setCreateTagOpen(false),
1722
1870
  children: "H\u1EE7y"
1723
1871
  }),
1724
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, {
1872
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
1725
1873
  variant: "contained",
1726
1874
  disabled: !newTagName || duplicateTag,
1727
1875
  onClick: createTag,
@@ -1731,7 +1879,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1731
1879
  })
1732
1880
  ]
1733
1881
  }),
1734
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, {
1882
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
1735
1883
  open: Boolean(deleteTarget) && canEdit,
1736
1884
  onClose: () => setDeleteTarget(null),
1737
1885
  container: () => tableRoot.current?.ownerDocument.body ?? document.body,
@@ -1740,7 +1888,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1740
1888
  fullWidth: true,
1741
1889
  maxWidth: "xs",
1742
1890
  children: [
1743
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogTitle.default, {
1891
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogTitle.default, {
1744
1892
  id: `${dialogId}-title`,
1745
1893
  children: [
1746
1894
  "X\xF3a ",
@@ -1748,20 +1896,20 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1748
1896
  "?"
1749
1897
  ]
1750
1898
  }),
1751
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, {
1752
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContentText.default, {
1899
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
1900
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
1753
1901
  id: `${dialogId}-description`,
1754
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?`
1755
1903
  })
1756
1904
  }),
1757
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogActions.default, {
1905
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
1758
1906
  children: [
1759
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, {
1907
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
1760
1908
  autoFocus: true,
1761
1909
  onClick: () => setDeleteTarget(null),
1762
1910
  children: "H\u1EE7y"
1763
1911
  }),
1764
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Button.default, {
1912
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Button.default, {
1765
1913
  color: "error",
1766
1914
  variant: "contained",
1767
1915
  onClick: confirmDelete,
@@ -1780,7 +1928,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
1780
1928
  }
1781
1929
 
1782
1930
  // src/wikex/fees-manager.tsx
1783
- var import_jsx_runtime7 = require("react/jsx-runtime");
1931
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1784
1932
  function FeesManager({
1785
1933
  entries,
1786
1934
  selectedId,
@@ -1800,16 +1948,16 @@ function FeesManager({
1800
1948
  }) {
1801
1949
  const entry = entries.find((item) => item.id === selectedId);
1802
1950
  const key = `${selectedId}:${language}`;
1803
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { spacing: 3, sx: { minWidth: 0, width: 1 }, children: [
1804
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { direction: { xs: "column", md: "row" }, justifyContent: "space-between", alignItems: { md: "center" }, gap: 2.5, children: [
1805
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { spacing: 1, sx: { minWidth: 0, maxWidth: 720 }, children: [
1806
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Typography, { variant: "h4", children: "Ph\xED & k\xFD qu\u1EF9" }),
1807
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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." })
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." })
1808
1956
  ] }),
1809
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { direction: "row", spacing: 1.5, alignItems: "center", flexShrink: 0, children: [
1810
- dirtyKeys.includes(key) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Chip, { size: "small", color: "warning", label: "Ch\u01B0a l\u01B0u" }),
1811
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1812
- import_material2.Button,
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,
1813
1961
  {
1814
1962
  variant: "contained",
1815
1963
  loading: saving,
@@ -1821,17 +1969,17 @@ function FeesManager({
1821
1969
  )
1822
1970
  ] })
1823
1971
  ] }),
1824
- !canWrite && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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." }),
1825
- notice && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Alert, { severity: notice.severity, onClose: onDismissNotice, children: notice.message }),
1826
- !entries.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1827
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Card, { variant: "outlined", sx: { p: { xs: 2.5, md: 3 }, boxShadow: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { spacing: 2.5, children: [
1828
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 1.5, flexWrap: "wrap", children: [
1829
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Typography, { variant: "subtitle1", children: "B\u1EA3ng \u0111ang qu\u1EA3n l\xFD" }),
1830
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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" })
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" })
1831
1979
  ] }),
1832
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { direction: { xs: "column", md: "row" }, spacing: 2.5, alignItems: { md: "flex-end" }, children: [
1833
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1834
- import_material2.TextField,
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,
1835
1983
  {
1836
1984
  select: true,
1837
1985
  size: "small",
@@ -1841,7 +1989,7 @@ function FeesManager({
1841
1989
  fullWidth: true,
1842
1990
  sx: { flex: 1, minWidth: 0 },
1843
1991
  onChange: (event) => onSelectEntry(event.target.value),
1844
- children: entries.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.MenuItem, { value: item.id, children: [
1992
+ children: entries.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuItem, { value: item.id, children: [
1845
1993
  item.pageTitle,
1846
1994
  " \xB7 /",
1847
1995
  item.slug,
@@ -1851,10 +1999,10 @@ function FeesManager({
1851
1999
  ] }, item.id))
1852
2000
  }
1853
2001
  ),
1854
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { spacing: 1, sx: { width: { xs: 1, md: 240 }, flexShrink: 0 }, children: [
1855
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Typography, { variant: "caption", color: "text.secondary", children: "Ng\xF4n ng\u1EEF n\u1ED9i dung" }),
1856
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1857
- import_material2.ToggleButtonGroup,
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,
1858
2006
  {
1859
2007
  size: "small",
1860
2008
  exclusive: true,
@@ -1866,11 +2014,11 @@ function FeesManager({
1866
2014
  if (next === "vi" || next === "en") onSelectLanguage(next);
1867
2015
  },
1868
2016
  children: [
1869
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.ToggleButton, { value: "vi", children: [
2017
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "vi", children: [
1870
2018
  "Ti\u1EBFng Vi\u1EC7t",
1871
2019
  dirtyKeys.includes(`${selectedId}:vi`) ? " \u2022" : ""
1872
2020
  ] }),
1873
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.ToggleButton, { value: "en", children: [
2021
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "en", children: [
1874
2022
  "English",
1875
2023
  dirtyKeys.includes(`${selectedId}:en`) ? " \u2022" : ""
1876
2024
  ] })
@@ -1880,22 +2028,22 @@ function FeesManager({
1880
2028
  ] })
1881
2029
  ] })
1882
2030
  ] }) }),
1883
- parseError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Alert, { severity: "error", children: parseError }),
1884
- table && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Card, { inert: saving, "aria-busy": saving, sx: { minWidth: 0, opacity: saving ? 0.65 : 1 }, children: [
1885
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.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: [
1886
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { spacing: 0.5, children: [
1887
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Typography, { variant: "subtitle1", children: "D\u1EEF li\u1EC7u ph\xED & k\xFD qu\u1EF9" }),
1888
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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." })
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." })
1889
2037
  ] }),
1890
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Stack, { direction: "row", spacing: 1, flexShrink: 0, children: [
1891
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Chip, { size: "small", variant: "outlined", label: `${table.rows.length} d\xF2ng` }),
1892
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Chip, { size: "small", variant: "outlined", label: `${table.columns.length} c\u1ED9t` })
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` })
1893
2041
  ] })
1894
2042
  ] }),
1895
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.Divider, {}),
1896
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Box, { sx: { p: { xs: 2.5, md: 3 }, minWidth: 0 }, children: [
1897
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material2.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." }),
1898
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesTable, { value: table, language, editable: canWrite, onChange: canWrite && !saving ? onChange : void 0 }, key)
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)
1899
2047
  ] })
1900
2048
  ] })
1901
2049
  ] })