@enyxs/wikex-components 0.11.31 → 0.11.33
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 +10 -6
- package/dist/fees-model.d.mts +14 -1
- package/dist/fees-model.d.ts +14 -1
- package/dist/fees-model.js +55 -4
- package/dist/fees-model.js.map +1 -1
- package/dist/fees-model.mjs +53 -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 +345 -234
- package/dist/fees.js.map +1 -1
- package/dist/fees.mjs +258 -147
- 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 +1208 -1086
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +974 -852
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/fees.js
CHANGED
|
@@ -37,11 +37,11 @@ __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
|
|
44
|
-
var
|
|
43
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
44
|
+
var import_react4 = require("react");
|
|
45
45
|
var import_styled_components6 = __toESM(require("styled-components"));
|
|
46
46
|
var import_TextField = __toESM(require("@mui/material/TextField"));
|
|
47
47
|
var import_Dialog = __toESM(require("@mui/material/Dialog"));
|
|
@@ -94,11 +94,28 @@ function moveFeesItem(items, from, to) {
|
|
|
94
94
|
next.splice(to, 0, item);
|
|
95
95
|
return next;
|
|
96
96
|
}
|
|
97
|
+
function setFeesColumnAlignment(table, columnKey, textAlign) {
|
|
98
|
+
if (!table.columns.some((column) => column.key === columnKey)) return table;
|
|
99
|
+
return {
|
|
100
|
+
...table,
|
|
101
|
+
columns: table.columns.map((column) => {
|
|
102
|
+
if (column.key !== columnKey) return column;
|
|
103
|
+
const { textAlign: _previous, ...rest } = column;
|
|
104
|
+
return { ...rest, ...textAlign ? { textAlign } : {} };
|
|
105
|
+
}),
|
|
106
|
+
rows: table.rows.map((row) => {
|
|
107
|
+
if (!row.cellAlignments || !Object.prototype.hasOwnProperty.call(row.cellAlignments, columnKey)) return row;
|
|
108
|
+
const { cellAlignments, ...rest } = row;
|
|
109
|
+
const alignments = { ...cellAlignments };
|
|
110
|
+
delete alignments[columnKey];
|
|
111
|
+
return { ...rest, ...Object.keys(alignments).length ? { cellAlignments: alignments } : {} };
|
|
112
|
+
})
|
|
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. Ch\u1ECDn c\u1ED9t trong m\u1EE5c C\u0103n l\u1EC1 theo c\u1ED9t \u0111\u1EC3 ch\u1EC9nh ti\xEAu \u0111\u1EC1 v\xE0 to\xE0n b\u1ED9 gi\xE1 tr\u1ECB c\u1EE7a c\u1ED9t." })
|
|
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,89 @@ 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-column-alignment-controls.tsx
|
|
210
|
+
var import_react2 = require("react");
|
|
211
|
+
var import_material2 = require("@mui/material");
|
|
212
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
213
|
+
var labels = { left: "C\u0103n tr\xE1i", center: "C\u0103n gi\u1EEFa", right: "C\u0103n ph\u1EA3i" };
|
|
214
|
+
var englishLabels = { left: "Align left", center: "Align center", right: "Align right" };
|
|
215
|
+
function FeesColumnAlignmentControls({ columns, columnKey, english, onSelectColumn, onChange }) {
|
|
216
|
+
const root = (0, import_react2.useRef)(null);
|
|
217
|
+
const column = columns.find((item) => item.key === columnKey);
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
219
|
+
import_material2.Stack,
|
|
220
|
+
{
|
|
221
|
+
ref: root,
|
|
222
|
+
role: "group",
|
|
223
|
+
"aria-label": english ? "Column alignment" : "C\u0103n l\u1EC1 theo c\u1ED9t",
|
|
224
|
+
spacing: 1.5,
|
|
225
|
+
sx: { my: 2, p: 1.5, border: "1px solid", borderColor: "divider", borderRadius: 1.5 },
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "subtitle2", children: english ? "Column alignment" : "C\u0103n l\u1EC1 theo c\u1ED9t" }),
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1.5, alignItems: { sm: "center" }, children: [
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
230
|
+
import_material2.TextField,
|
|
231
|
+
{
|
|
232
|
+
select: true,
|
|
233
|
+
size: "small",
|
|
234
|
+
label: english ? "Column to align" : "C\u1ED9t c\u1EA7n c\u0103n l\u1EC1",
|
|
235
|
+
value: column?.key ?? "",
|
|
236
|
+
sx: { flex: 1, minWidth: 0 },
|
|
237
|
+
slotProps: { inputLabel: { shrink: true }, select: {
|
|
238
|
+
displayEmpty: true,
|
|
239
|
+
SelectDisplayProps: { "aria-labelledby": void 0 },
|
|
240
|
+
inputProps: { "aria-label": english ? "Column to align" : "C\u1ED9t c\u1EA7n c\u0103n l\u1EC1" },
|
|
241
|
+
MenuProps: { container: () => root.current?.ownerDocument.body ?? document.body }
|
|
242
|
+
} },
|
|
243
|
+
onChange: (event) => onSelectColumn(event.target.value),
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.MenuItem, { value: "", disabled: true, children: english ? "Select a column" : "Ch\u1ECDn c\u1ED9t" }),
|
|
246
|
+
columns.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.MenuItem, { value: item.key, children: [
|
|
247
|
+
index + 1,
|
|
248
|
+
". ",
|
|
249
|
+
item.title || (english ? "Untitled column" : "C\u1ED9t ch\u01B0a c\xF3 ti\xEAu \u0111\u1EC1")
|
|
250
|
+
] }, item.key))
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Stack, { direction: "row", spacing: 0.5, flexWrap: "wrap", useFlexGap: true, children: [
|
|
255
|
+
FEES_TEXT_ALIGNS.map((align) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
256
|
+
import_material2.Button,
|
|
257
|
+
{
|
|
258
|
+
size: "small",
|
|
259
|
+
disabled: !column,
|
|
260
|
+
variant: column?.textAlign === align ? "contained" : "outlined",
|
|
261
|
+
"aria-pressed": column?.textAlign === align,
|
|
262
|
+
onClick: () => onChange(align),
|
|
263
|
+
children: (english ? englishLabels : labels)[align]
|
|
264
|
+
},
|
|
265
|
+
align
|
|
266
|
+
)),
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
268
|
+
import_material2.Button,
|
|
269
|
+
{
|
|
270
|
+
size: "small",
|
|
271
|
+
color: "inherit",
|
|
272
|
+
disabled: !column,
|
|
273
|
+
"aria-label": english ? "Reset selected column alignment" : "C\u0103n l\u1EC1 m\u1EB7c \u0111\u1ECBnh cho c\u1ED9t \u0111ang ch\u1ECDn",
|
|
274
|
+
onClick: () => onChange(void 0),
|
|
275
|
+
children: english ? "Default" : "M\u1EB7c \u0111\u1ECBnh"
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
] })
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "caption", color: "text.secondary", children: english ? "Applies to the header and all values in the selected column, including filtered rows and other pages." : "\xC1p d\u1EE5ng cho ti\xEAu \u0111\u1EC1 v\xE0 to\xE0n b\u1ED9 gi\xE1 tr\u1ECB c\u1EE7a c\u1ED9t \u0111\xE3 ch\u1ECDn, k\u1EC3 c\u1EA3 c\xE1c d\xF2ng \u0111ang l\u1ECDc v\xE0 \u1EDF trang kh\xE1c." })
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
209
286
|
// src/commodity-original/styles/colors.ts
|
|
210
287
|
var lightColors = {
|
|
211
288
|
background: {
|
|
@@ -304,7 +381,7 @@ var appTheme = {
|
|
|
304
381
|
};
|
|
305
382
|
|
|
306
383
|
// src/commodity-original/components/Table/index.tsx
|
|
307
|
-
var
|
|
384
|
+
var import_react3 = require("react");
|
|
308
385
|
|
|
309
386
|
// src/commodity-original/components/Table/style.ts
|
|
310
387
|
var import_styled_components = __toESM(require("styled-components"));
|
|
@@ -421,7 +498,7 @@ function getTableFixedColumnOffset(columns, columnIndex) {
|
|
|
421
498
|
}
|
|
422
499
|
|
|
423
500
|
// src/commodity-original/components/Table/index.tsx
|
|
424
|
-
var
|
|
501
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
425
502
|
function getCellValue(column, record) {
|
|
426
503
|
return column.dataIndex === void 0 ? void 0 : record[column.dataIndex];
|
|
427
504
|
}
|
|
@@ -494,7 +571,7 @@ function Table({
|
|
|
494
571
|
const nextSelectedRowKeys = event.target.checked ? [...selectedRowKeys, recordKey] : selectedRowKeys.filter((key) => key !== recordKey);
|
|
495
572
|
emitSelectionChange(nextSelectedRowKeys);
|
|
496
573
|
};
|
|
497
|
-
return /* @__PURE__ */ (0,
|
|
574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableScrollContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
498
575
|
TableRoot,
|
|
499
576
|
{
|
|
500
577
|
$minWidth: scroll?.x === void 0 ? void 0 : getTableColumnSize(scroll.x),
|
|
@@ -503,8 +580,8 @@ function Table({
|
|
|
503
580
|
className,
|
|
504
581
|
"data-size": size,
|
|
505
582
|
children: [
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
rowSelection ? /* @__PURE__ */ (0,
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TableHeaderRow, { children: [
|
|
584
|
+
rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableHeaderCell, { scope: "col", children: selectionType === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
508
585
|
TableSelectionInput,
|
|
509
586
|
{
|
|
510
587
|
checked: isAllSelected,
|
|
@@ -513,8 +590,8 @@ function Table({
|
|
|
513
590
|
type: "checkbox"
|
|
514
591
|
}
|
|
515
592
|
) : null }) : null,
|
|
516
|
-
expandable ? /* @__PURE__ */ (0,
|
|
517
|
-
columns.map((column, columnIndex) => /* @__PURE__ */ (0,
|
|
593
|
+
expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableHeaderCell, { scope: "col" }) : null,
|
|
594
|
+
columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
518
595
|
TableHeaderCell,
|
|
519
596
|
{
|
|
520
597
|
$fixed: column.fixed,
|
|
@@ -522,7 +599,7 @@ function Table({
|
|
|
522
599
|
$width: column.width === void 0 ? void 0 : getTableColumnSize(column.width),
|
|
523
600
|
"data-column-key": column.key,
|
|
524
601
|
scope: "col",
|
|
525
|
-
children: column.sortable ? /* @__PURE__ */ (0,
|
|
602
|
+
children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
526
603
|
TableSortButton,
|
|
527
604
|
{
|
|
528
605
|
"aria-pressed": sort?.field === column.key,
|
|
@@ -535,13 +612,13 @@ function Table({
|
|
|
535
612
|
column.key
|
|
536
613
|
))
|
|
537
614
|
] }) }),
|
|
538
|
-
/* @__PURE__ */ (0,
|
|
615
|
+
/* @__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
616
|
const recordKey = getRowKey(record);
|
|
540
617
|
const selectionProps = rowSelection?.getCheckboxProps?.(record);
|
|
541
618
|
const isExpanded = expandedRowKeySet.has(recordKey);
|
|
542
|
-
return /* @__PURE__ */ (0,
|
|
543
|
-
/* @__PURE__ */ (0,
|
|
544
|
-
rowSelection ? /* @__PURE__ */ (0,
|
|
619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react3.Fragment, { children: [
|
|
620
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TableRow, { "data-row-key": recordKey, children: [
|
|
621
|
+
rowSelection ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
545
622
|
TableSelectionInput,
|
|
546
623
|
{
|
|
547
624
|
checked: selectedRowKeySet.has(recordKey),
|
|
@@ -551,7 +628,7 @@ function Table({
|
|
|
551
628
|
type: selectionType
|
|
552
629
|
}
|
|
553
630
|
) }) : null,
|
|
554
|
-
expandable ? /* @__PURE__ */ (0,
|
|
631
|
+
expandable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
555
632
|
TableExpandButton,
|
|
556
633
|
{
|
|
557
634
|
"aria-expanded": isExpanded,
|
|
@@ -562,7 +639,7 @@ function Table({
|
|
|
562
639
|
) }) : null,
|
|
563
640
|
columns.map((column, columnIndex) => {
|
|
564
641
|
const value = getCellValue(column, record);
|
|
565
|
-
return /* @__PURE__ */ (0,
|
|
642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
566
643
|
TableCell,
|
|
567
644
|
{
|
|
568
645
|
$fixed: column.fixed,
|
|
@@ -574,7 +651,7 @@ function Table({
|
|
|
574
651
|
);
|
|
575
652
|
})
|
|
576
653
|
] }),
|
|
577
|
-
expandable?.render && isExpanded ? /* @__PURE__ */ (0,
|
|
654
|
+
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
655
|
] }, recordKey);
|
|
579
656
|
}) })
|
|
580
657
|
]
|
|
@@ -629,7 +706,7 @@ var PaginationArrow = import_styled_components2.styled.span.withConfig({
|
|
|
629
706
|
], chevron_right_default, chevron_right_default);
|
|
630
707
|
|
|
631
708
|
// src/commodity-original/components/Pagination/index.tsx
|
|
632
|
-
var
|
|
709
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
633
710
|
function getPaginationItems(page, pageCount, siblingCount) {
|
|
634
711
|
const maxVisibleItems = siblingCount * 2 + 5;
|
|
635
712
|
if (pageCount <= maxVisibleItems) {
|
|
@@ -656,7 +733,7 @@ function Pagination({
|
|
|
656
733
|
onPageChange,
|
|
657
734
|
siblingCount = 1,
|
|
658
735
|
ariaLabel,
|
|
659
|
-
labels,
|
|
736
|
+
labels: labels2,
|
|
660
737
|
className
|
|
661
738
|
}) {
|
|
662
739
|
const { t } = (0, import_react_i18next.useTranslation)();
|
|
@@ -665,43 +742,43 @@ function Pagination({
|
|
|
665
742
|
const items = getPaginationItems(currentPage, safePageCount, siblingCount);
|
|
666
743
|
const hasPreviousPage = currentPage > 1;
|
|
667
744
|
const hasNextPage = currentPage < safePageCount;
|
|
668
|
-
return /* @__PURE__ */ (0,
|
|
745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
669
746
|
PaginationNav,
|
|
670
747
|
{
|
|
671
748
|
"aria-label": ariaLabel ?? t("pagination.navigation"),
|
|
672
749
|
className,
|
|
673
|
-
children: /* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(PaginationList, { children: [
|
|
751
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
675
752
|
PaginationButton,
|
|
676
753
|
{
|
|
677
|
-
"aria-label":
|
|
754
|
+
"aria-label": labels2?.previous ?? t("pagination.previous"),
|
|
678
755
|
"data-control": "previous",
|
|
679
756
|
disabled: !hasPreviousPage,
|
|
680
757
|
onClick: () => onPageChange(currentPage - 1),
|
|
681
758
|
type: "button",
|
|
682
|
-
children: /* @__PURE__ */ (0,
|
|
759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "previous" })
|
|
683
760
|
}
|
|
684
761
|
) }),
|
|
685
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
762
|
+
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
763
|
PaginationButton,
|
|
687
764
|
{
|
|
688
765
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
689
|
-
"aria-label": item === currentPage ?
|
|
766
|
+
"aria-label": item === currentPage ? labels2?.current(item) ?? t("pagination.current", { page: item }) : labels2?.page(item) ?? t("pagination.page", { page: item }),
|
|
690
767
|
"data-active": item === currentPage || void 0,
|
|
691
768
|
onClick: () => onPageChange(item),
|
|
692
769
|
type: "button",
|
|
693
770
|
children: item
|
|
694
771
|
}
|
|
695
772
|
) }, `${item}-${index}`)),
|
|
696
|
-
/* @__PURE__ */ (0,
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
697
774
|
PaginationButton,
|
|
698
775
|
{
|
|
699
|
-
"aria-label":
|
|
776
|
+
"aria-label": labels2?.next ?? t("pagination.next"),
|
|
700
777
|
"data-control": "next",
|
|
701
778
|
disabled: !hasNextPage,
|
|
702
779
|
onClick: () => onPageChange(currentPage + 1),
|
|
703
780
|
type: "button",
|
|
704
|
-
children: /* @__PURE__ */ (0,
|
|
781
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PaginationArrow, { "data-direction": "next" })
|
|
705
782
|
}
|
|
706
783
|
) })
|
|
707
784
|
] })
|
|
@@ -737,7 +814,7 @@ var InputAdornment = import_styled_components3.default.span.withConfig({
|
|
|
737
814
|
], ({ theme }) => theme.colors.text.secondary, InputCommonRoot, InputCommonRoot);
|
|
738
815
|
|
|
739
816
|
// src/commodity-original/components/InputCommon/index.tsx
|
|
740
|
-
var
|
|
817
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
741
818
|
function InputCommon({
|
|
742
819
|
leftIcon,
|
|
743
820
|
rightIcon,
|
|
@@ -748,11 +825,11 @@ function InputCommon({
|
|
|
748
825
|
onClear,
|
|
749
826
|
...inputProps
|
|
750
827
|
}) {
|
|
751
|
-
return /* @__PURE__ */ (0,
|
|
752
|
-
leftIcon ? /* @__PURE__ */ (0,
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
754
|
-
clearable && inputProps.value ? /* @__PURE__ */ (0,
|
|
755
|
-
errorMessage ? /* @__PURE__ */ (0,
|
|
828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(InputCommonRoot, { "data-disabled": inputProps.disabled || void 0, "data-error": error || void 0, "data-size": size, children: [
|
|
829
|
+
leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputAdornment, { "aria-hidden": "true", children: leftIcon }) : null,
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputCommonField, { ...inputProps }),
|
|
831
|
+
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,
|
|
832
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { role: "alert", children: errorMessage }) : null
|
|
756
833
|
] });
|
|
757
834
|
}
|
|
758
835
|
|
|
@@ -784,7 +861,7 @@ var TabLine = import_styled_components4.default.span.withConfig({
|
|
|
784
861
|
], ({ theme }) => theme.colors.accent.primary, TabCommonList, TabCommonList);
|
|
785
862
|
|
|
786
863
|
// src/commodity-original/components/TabCommon/index.tsx
|
|
787
|
-
var
|
|
864
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
788
865
|
function TabCommon({
|
|
789
866
|
items,
|
|
790
867
|
value,
|
|
@@ -793,7 +870,7 @@ function TabCommon({
|
|
|
793
870
|
className,
|
|
794
871
|
size = "md"
|
|
795
872
|
}) {
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
797
874
|
TabCommonList,
|
|
798
875
|
{
|
|
799
876
|
"aria-label": ariaLabel,
|
|
@@ -802,7 +879,7 @@ function TabCommon({
|
|
|
802
879
|
role: "tablist",
|
|
803
880
|
children: items.map((item) => {
|
|
804
881
|
const isActive = item.id === value;
|
|
805
|
-
return /* @__PURE__ */ (0,
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
806
883
|
TabButton,
|
|
807
884
|
{
|
|
808
885
|
"aria-selected": isActive,
|
|
@@ -813,7 +890,7 @@ function TabCommon({
|
|
|
813
890
|
type: "button",
|
|
814
891
|
children: [
|
|
815
892
|
item.label,
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabLine, { "aria-hidden": "true" })
|
|
817
894
|
]
|
|
818
895
|
},
|
|
819
896
|
item.id
|
|
@@ -920,32 +997,32 @@ var feesTheme = {
|
|
|
920
997
|
]))
|
|
921
998
|
};
|
|
922
999
|
var EditorActions = import_styled_components6.default.div.withConfig({
|
|
923
|
-
componentId: "sc-
|
|
1000
|
+
componentId: "sc-a4d52175-0"
|
|
924
1001
|
})([
|
|
925
1002
|
`display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;`
|
|
926
1003
|
]);
|
|
927
1004
|
var EditGroup = import_styled_components6.default.div.withConfig({
|
|
928
|
-
componentId: "sc-
|
|
1005
|
+
componentId: "sc-a4d52175-1"
|
|
929
1006
|
})([
|
|
930
1007
|
`display:flex;flex-direction:column;gap:6px;`
|
|
931
1008
|
]);
|
|
932
1009
|
var HeaderGroup = (0, import_styled_components6.default)(EditGroup).withConfig({
|
|
933
|
-
componentId: "sc-
|
|
1010
|
+
componentId: "sc-a4d52175-2"
|
|
934
1011
|
})([
|
|
935
1012
|
`gap:8px;`
|
|
936
1013
|
]);
|
|
937
1014
|
var HeaderTitle = import_styled_components6.default.div.withConfig({
|
|
938
|
-
componentId: "sc-
|
|
1015
|
+
componentId: "sc-a4d52175-3"
|
|
939
1016
|
})([
|
|
940
1017
|
`display:flex;align-items:flex-start;min-height:var(--fees-header-title-height,36px);`
|
|
941
1018
|
]);
|
|
942
1019
|
var HeaderActions = import_styled_components6.default.div.withConfig({
|
|
943
|
-
componentId: "sc-
|
|
1020
|
+
componentId: "sc-a4d52175-4"
|
|
944
1021
|
})([
|
|
945
1022
|
`display:flex;align-items:center;min-height:24px;`
|
|
946
1023
|
]);
|
|
947
1024
|
var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable).withConfig({
|
|
948
|
-
componentId: "sc-
|
|
1025
|
+
componentId: "sc-a4d52175-5"
|
|
949
1026
|
})([
|
|
950
1027
|
`&[data-editable] th{vertical-align:top;}--fees-row-background:`,
|
|
951
1028
|
`;--fees-stripe-background:`,
|
|
@@ -968,9 +1045,7 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
|
|
|
968
1045
|
`px;line-height:`,
|
|
969
1046
|
`;}tbody > tr > td{height:40px;padding-top:5.5px;padding-bottom:5.5px;font-size:`,
|
|
970
1047
|
`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:`,
|
|
1048
|
+
`;}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
1049
|
`;}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
1050
|
], ({ 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
1051
|
th:nth-child(${index + 1}), td:nth-child(${index + 1}) {
|
|
@@ -978,15 +1053,16 @@ var AlignedFeesTable = (0, import_styled_components6.default)(FeesAndMarginTable
|
|
|
978
1053
|
min-width: ${width}px;
|
|
979
1054
|
max-width: ${width}px;
|
|
980
1055
|
}
|
|
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", ({
|
|
1056
|
+
`).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
1057
|
var FeesCellContent = import_styled_components6.default.span.withConfig({
|
|
983
|
-
componentId: "sc-
|
|
1058
|
+
componentId: "sc-a4d52175-6"
|
|
984
1059
|
})([
|
|
985
1060
|
`display:block;text-align:`,
|
|
986
|
-
|
|
987
|
-
|
|
1061
|
+
`;@media (max-width:767px){text-align:`,
|
|
1062
|
+
`;}`
|
|
1063
|
+
], ({ $align, $alignRight }) => $align ?? ($alignRight ? "right" : "left"), ({ $align }) => $align ?? "left");
|
|
988
1064
|
var EditorButton = import_styled_components6.default.button.withConfig({
|
|
989
|
-
componentId: "sc-
|
|
1065
|
+
componentId: "sc-a4d52175-7"
|
|
990
1066
|
})([
|
|
991
1067
|
`padding:7px 12px;border:1px solid `,
|
|
992
1068
|
`;border-radius:6px;background:`,
|
|
@@ -995,17 +1071,17 @@ var EditorButton = import_styled_components6.default.button.withConfig({
|
|
|
995
1071
|
`;}&:disabled{cursor:default;opacity:.4;}`
|
|
996
1072
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
997
1073
|
var OrderActions = import_styled_components6.default.div.withConfig({
|
|
998
|
-
componentId: "sc-
|
|
1074
|
+
componentId: "sc-a4d52175-8"
|
|
999
1075
|
})([
|
|
1000
1076
|
`display:flex;gap:6px;align-items:center;flex-wrap:wrap;`
|
|
1001
1077
|
]);
|
|
1002
1078
|
var PositionLabel = import_styled_components6.default.label.withConfig({
|
|
1003
|
-
componentId: "sc-
|
|
1079
|
+
componentId: "sc-a4d52175-9"
|
|
1004
1080
|
})([
|
|
1005
1081
|
`display:inline-flex;align-items:center;gap:6px;font-size:12px;`
|
|
1006
1082
|
]);
|
|
1007
1083
|
var PositionInput = import_styled_components6.default.input.withConfig({
|
|
1008
|
-
componentId: "sc-
|
|
1084
|
+
componentId: "sc-a4d52175-10"
|
|
1009
1085
|
})([
|
|
1010
1086
|
`width:56px;padding:5px;border:1px solid `,
|
|
1011
1087
|
`;border-radius:4px;background:`,
|
|
@@ -1014,26 +1090,26 @@ var PositionInput = import_styled_components6.default.input.withConfig({
|
|
|
1014
1090
|
`;}`
|
|
1015
1091
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
1016
1092
|
var ColumnRow = import_styled_components6.default.div.withConfig({
|
|
1017
|
-
componentId: "sc-
|
|
1093
|
+
componentId: "sc-a4d52175-11"
|
|
1018
1094
|
})([
|
|
1019
1095
|
`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
1096
|
]);
|
|
1021
1097
|
var PaginationControls = (0, import_styled_components6.default)(FeesAndMarginPagination).withConfig({
|
|
1022
|
-
componentId: "sc-
|
|
1098
|
+
componentId: "sc-a4d52175-12"
|
|
1023
1099
|
})([
|
|
1024
1100
|
`align-items:center;flex-wrap:wrap;gap:16px 24px;`
|
|
1025
1101
|
]);
|
|
1026
1102
|
var PageSizeLabel = import_styled_components6.default.div.withConfig({
|
|
1027
|
-
componentId: "sc-
|
|
1103
|
+
componentId: "sc-a4d52175-13"
|
|
1028
1104
|
})([
|
|
1029
1105
|
`display:inline-flex;align-items:center;gap:8px;color:`,
|
|
1030
1106
|
`;font:inherit;font-size:13px;`
|
|
1031
1107
|
], ({ theme }) => theme.colors.text.primary);
|
|
1032
1108
|
function Position({ value, max, label, onMove }) {
|
|
1033
|
-
return /* @__PURE__ */ (0,
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PositionLabel, {
|
|
1034
1110
|
children: [
|
|
1035
1111
|
"V\u1ECB tr\xED",
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PositionInput, {
|
|
1037
1113
|
"aria-label": label,
|
|
1038
1114
|
type: "number",
|
|
1039
1115
|
min: 1,
|
|
@@ -1052,19 +1128,20 @@ function Position({ value, max, label, onMove }) {
|
|
|
1052
1128
|
});
|
|
1053
1129
|
}
|
|
1054
1130
|
var DeleteButton = (0, import_styled_components6.default)(EditorButton).withConfig({
|
|
1055
|
-
componentId: "sc-
|
|
1131
|
+
componentId: "sc-a4d52175-14"
|
|
1056
1132
|
})([
|
|
1057
1133
|
`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
1134
|
]);
|
|
1059
1135
|
var CellEditorInput = import_styled_components6.default.textarea.withConfig({
|
|
1060
|
-
componentId: "sc-
|
|
1136
|
+
componentId: "sc-a4d52175-15"
|
|
1061
1137
|
})([
|
|
1062
1138
|
`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
1139
|
`;}&:focus{outline:1px solid `,
|
|
1140
|
+
`;}&[data-fees-column-selected="true"]{border-color:`,
|
|
1064
1141
|
`;}`
|
|
1065
|
-
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.accent.primary);
|
|
1142
|
+
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.accent.primary, ({ theme }) => theme.colors.accent.primary);
|
|
1066
1143
|
function CellEditor({ onInput, ...props }) {
|
|
1067
|
-
const ref = (0,
|
|
1144
|
+
const ref = (0, import_react4.useRef)(null);
|
|
1068
1145
|
const fit = () => {
|
|
1069
1146
|
const element = ref.current;
|
|
1070
1147
|
if (!element) return;
|
|
@@ -1073,8 +1150,8 @@ function CellEditor({ onInput, ...props }) {
|
|
|
1073
1150
|
const border = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
|
|
1074
1151
|
element.style.height = `${element.scrollHeight + border}px`;
|
|
1075
1152
|
};
|
|
1076
|
-
(0,
|
|
1077
|
-
(0,
|
|
1153
|
+
(0, import_react4.useLayoutEffect)(fit);
|
|
1154
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
1078
1155
|
const element = ref.current;
|
|
1079
1156
|
if (!element) return;
|
|
1080
1157
|
let width = element.getBoundingClientRect().width;
|
|
@@ -1095,7 +1172,7 @@ function CellEditor({ onInput, ...props }) {
|
|
|
1095
1172
|
observer.disconnect();
|
|
1096
1173
|
};
|
|
1097
1174
|
}, []);
|
|
1098
|
-
return /* @__PURE__ */ (0,
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditorInput, {
|
|
1099
1176
|
...props,
|
|
1100
1177
|
ref,
|
|
1101
1178
|
rows: 1,
|
|
@@ -1106,11 +1183,11 @@ function CellEditor({ onInput, ...props }) {
|
|
|
1106
1183
|
});
|
|
1107
1184
|
}
|
|
1108
1185
|
function RowTagSelect({ selected, options, onChange }) {
|
|
1109
|
-
const selectRoot = (0,
|
|
1110
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
-
children: /* @__PURE__ */ (0,
|
|
1186
|
+
const selectRoot = (0, import_react4.useRef)(null);
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditGroup, {
|
|
1188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1112
1189
|
ref: selectRoot,
|
|
1113
|
-
children: /* @__PURE__ */ (0,
|
|
1190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
|
|
1114
1191
|
multiple: true,
|
|
1115
1192
|
fullWidth: true,
|
|
1116
1193
|
size: "small",
|
|
@@ -1131,10 +1208,10 @@ function RowTagSelect({ selected, options, onChange }) {
|
|
|
1131
1208
|
fontSize: 13
|
|
1132
1209
|
},
|
|
1133
1210
|
children: [
|
|
1134
|
-
options.map((item) => /* @__PURE__ */ (0,
|
|
1211
|
+
options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_MenuItem.default, {
|
|
1135
1212
|
value: item,
|
|
1136
1213
|
children: [
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Checkbox.default, {
|
|
1138
1215
|
size: "small",
|
|
1139
1216
|
checked: selected.includes(item),
|
|
1140
1217
|
tabIndex: -1,
|
|
@@ -1143,7 +1220,7 @@ function RowTagSelect({ selected, options, onChange }) {
|
|
|
1143
1220
|
item
|
|
1144
1221
|
]
|
|
1145
1222
|
}, item)),
|
|
1146
|
-
!options.length && /* @__PURE__ */ (0,
|
|
1223
|
+
!options.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1147
1224
|
disabled: true,
|
|
1148
1225
|
children: "Ch\u01B0a c\xF3 tag \u2014 d\xF9ng n\xFAt Th\xEAm tag ph\xEDa tr\xEAn"
|
|
1149
1226
|
})
|
|
@@ -1192,17 +1269,18 @@ var rightAlignedColumns = /* @__PURE__ */ new Set([
|
|
|
1192
1269
|
"priceUnit",
|
|
1193
1270
|
"unit"
|
|
1194
1271
|
]);
|
|
1195
|
-
function FeesTable({ value, editable = false, onChange, labels, size = "md", tagOrder = [], language = "vi" }) {
|
|
1196
|
-
const [search, setSearch] = (0,
|
|
1197
|
-
const [tag, setTag] = (0,
|
|
1198
|
-
const [page, setPage] = (0,
|
|
1199
|
-
const [pageSize, setPageSize] = (0,
|
|
1200
|
-
const [columnsOpen, setColumnsOpen] = (0,
|
|
1201
|
-
const [typographyOpen, setTypographyOpen] = (0,
|
|
1272
|
+
function FeesTable({ value, editable = false, onChange, labels: labels2, size = "md", tagOrder = [], language = "vi" }) {
|
|
1273
|
+
const [search, setSearch] = (0, import_react4.useState)("");
|
|
1274
|
+
const [tag, setTag] = (0, import_react4.useState)("");
|
|
1275
|
+
const [page, setPage] = (0, import_react4.useState)(1);
|
|
1276
|
+
const [pageSize, setPageSize] = (0, import_react4.useState)(FEES_PAGE_SIZE);
|
|
1277
|
+
const [columnsOpen, setColumnsOpen] = (0, import_react4.useState)(false);
|
|
1278
|
+
const [typographyOpen, setTypographyOpen] = (0, import_react4.useState)(false);
|
|
1279
|
+
const [selectedColumnKey, setSelectedColumnKey] = (0, import_react4.useState)("");
|
|
1202
1280
|
const english = language === "en";
|
|
1203
1281
|
const canEdit = editable && Boolean(onChange);
|
|
1204
|
-
const tableRoot = (0,
|
|
1205
|
-
(0,
|
|
1282
|
+
const tableRoot = (0, import_react4.useRef)(null);
|
|
1283
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
1206
1284
|
const root = tableRoot.current;
|
|
1207
1285
|
if (!root || !canEdit) return;
|
|
1208
1286
|
const editors = [
|
|
@@ -1220,11 +1298,11 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1220
1298
|
canEdit,
|
|
1221
1299
|
value.columns
|
|
1222
1300
|
]);
|
|
1223
|
-
const dialogId = (0,
|
|
1301
|
+
const dialogId = (0, import_react4.useId)();
|
|
1224
1302
|
const mobileFontScale = Math.max(1, (value.typography?.thead?.fontSize ?? 8) / 8, (value.typography?.tbody?.fontSize ?? 10) / 10);
|
|
1225
|
-
const [createTagOpen, setCreateTagOpen] = (0,
|
|
1226
|
-
const [tagDraft, setTagDraft] = (0,
|
|
1227
|
-
const [deleteTarget, setDeleteTarget] = (0,
|
|
1303
|
+
const [createTagOpen, setCreateTagOpen] = (0, import_react4.useState)(false);
|
|
1304
|
+
const [tagDraft, setTagDraft] = (0, import_react4.useState)("");
|
|
1305
|
+
const [deleteTarget, setDeleteTarget] = (0, import_react4.useState)(null);
|
|
1228
1306
|
const confirmDelete = () => {
|
|
1229
1307
|
if (!deleteTarget || !canEdit) return;
|
|
1230
1308
|
if (deleteTarget.kind === "row") {
|
|
@@ -1236,10 +1314,17 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1236
1314
|
onChange?.({
|
|
1237
1315
|
...value,
|
|
1238
1316
|
columns: value.columns.filter((column) => column.key !== deleteTarget.id),
|
|
1239
|
-
rows: value.rows.map((row) =>
|
|
1240
|
-
...row
|
|
1241
|
-
|
|
1242
|
-
|
|
1317
|
+
rows: value.rows.map((row) => {
|
|
1318
|
+
const { cellAlignments, ...rest } = row;
|
|
1319
|
+
const alignments = Object.fromEntries(Object.entries(cellAlignments ?? {}).filter(([key]) => key !== deleteTarget.id));
|
|
1320
|
+
return {
|
|
1321
|
+
...rest,
|
|
1322
|
+
cells: Object.fromEntries(Object.entries(row.cells).filter(([key]) => key !== deleteTarget.id)),
|
|
1323
|
+
...Object.keys(alignments).length ? {
|
|
1324
|
+
cellAlignments: alignments
|
|
1325
|
+
} : {}
|
|
1326
|
+
};
|
|
1327
|
+
})
|
|
1243
1328
|
});
|
|
1244
1329
|
}
|
|
1245
1330
|
setDeleteTarget(null);
|
|
@@ -1272,6 +1357,13 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1272
1357
|
const filtered = filterFeesRows(value, search, activeTag);
|
|
1273
1358
|
const displayedRows = canEdit ? filtered : sortFeesRowsByName(filtered, language);
|
|
1274
1359
|
const pagination = paginateFeesRows(displayedRows, page, pageSize);
|
|
1360
|
+
const selectedColumn = value.columns.find((column) => column.key === selectedColumnKey);
|
|
1361
|
+
(0, import_react4.useLayoutEffect)(() => {
|
|
1362
|
+
if (selectedColumnKey && !selectedColumn) setSelectedColumnKey("");
|
|
1363
|
+
}, [
|
|
1364
|
+
selectedColumnKey,
|
|
1365
|
+
selectedColumn
|
|
1366
|
+
]);
|
|
1275
1367
|
const moveColumn = (from, to) => onChange?.({
|
|
1276
1368
|
...value,
|
|
1277
1369
|
columns: moveFeesItem(value.columns, from, to)
|
|
@@ -1317,13 +1409,17 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1317
1409
|
key: column.key,
|
|
1318
1410
|
width: canEdit ? columnWidths[column.key] ?? 140 : index === 0 ? 178 : 170,
|
|
1319
1411
|
fixed: index === 0 ? "left" : void 0,
|
|
1320
|
-
title: canEdit ? /* @__PURE__ */ (0,
|
|
1412
|
+
title: canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
|
|
1321
1413
|
children: [
|
|
1322
|
-
/* @__PURE__ */ (0,
|
|
1323
|
-
children: /* @__PURE__ */ (0,
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
|
|
1415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1324
1416
|
rows: 2,
|
|
1325
1417
|
value: column.title,
|
|
1326
1418
|
"aria-label": `Ti\xEAu \u0111\u1EC1 c\u1ED9t ${index + 1}`,
|
|
1419
|
+
style: {
|
|
1420
|
+
textAlign: column.textAlign ?? value.typography?.thead?.textAlign ?? "left"
|
|
1421
|
+
},
|
|
1422
|
+
"data-fees-column-selected": selectedColumnKey === column.key,
|
|
1327
1423
|
onChange: (event) => onChange?.({
|
|
1328
1424
|
...value,
|
|
1329
1425
|
columns: value.columns.map((item) => item.key === column.key ? {
|
|
@@ -1333,8 +1429,8 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1333
1429
|
})
|
|
1334
1430
|
})
|
|
1335
1431
|
}),
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1337
|
-
children: column.key !== "name" && /* @__PURE__ */ (0,
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {
|
|
1433
|
+
children: column.key !== "name" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1338
1434
|
type: "button",
|
|
1339
1435
|
onClick: () => {
|
|
1340
1436
|
setDeleteTarget({
|
|
@@ -1347,61 +1443,67 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1347
1443
|
})
|
|
1348
1444
|
})
|
|
1349
1445
|
]
|
|
1350
|
-
}) : /* @__PURE__ */ (0,
|
|
1351
|
-
$align: value.typography?.thead?.textAlign
|
|
1446
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
|
|
1447
|
+
$align: column.textAlign ?? value.typography?.thead?.textAlign,
|
|
1448
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
1352
1449
|
children: column.title
|
|
1353
1450
|
}),
|
|
1354
|
-
render: (_unused, row) => canEdit ? /* @__PURE__ */ (0,
|
|
1451
|
+
render: (_unused, row) => canEdit ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1355
1452
|
rows: Math.max(2, (row.cells[column.key] ?? "").split("\n").length),
|
|
1356
1453
|
value: row.cells[column.key] ?? "",
|
|
1357
1454
|
"aria-label": `${column.title} \u2014 ${row.cells.name || "H\xE0ng m\u1EDBi"}`,
|
|
1455
|
+
style: {
|
|
1456
|
+
textAlign: column.textAlign ?? row.cellAlignments?.[column.key] ?? value.typography?.tbody?.textAlign ?? "left"
|
|
1457
|
+
},
|
|
1458
|
+
"data-fees-column-selected": selectedColumnKey === column.key,
|
|
1358
1459
|
onChange: (event) => changeRow(row.id, {
|
|
1359
1460
|
cells: {
|
|
1360
1461
|
...row.cells,
|
|
1361
1462
|
[column.key]: event.target.value
|
|
1362
1463
|
}
|
|
1363
1464
|
})
|
|
1364
|
-
}) : /* @__PURE__ */ (0,
|
|
1365
|
-
$align:
|
|
1465
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesCellContent, {
|
|
1466
|
+
$align: column.textAlign ?? row.cellAlignments?.[column.key] ?? value.typography?.tbody?.textAlign,
|
|
1467
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
1366
1468
|
children: row.cells[column.key] ?? ""
|
|
1367
1469
|
})
|
|
1368
1470
|
}));
|
|
1369
1471
|
if (canEdit) columns.push({
|
|
1370
1472
|
key: "__tags",
|
|
1371
|
-
title: /* @__PURE__ */ (0,
|
|
1473
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(HeaderGroup, {
|
|
1372
1474
|
children: [
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderTitle, {
|
|
1374
1476
|
children: "Tag & th\u1EE9 t\u1EF1 d\xF2ng"
|
|
1375
1477
|
}),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1478
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderActions, {})
|
|
1377
1479
|
]
|
|
1378
1480
|
}),
|
|
1379
1481
|
width: 300,
|
|
1380
|
-
render: (_unused, row) => /* @__PURE__ */ (0,
|
|
1482
|
+
render: (_unused, row) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditGroup, {
|
|
1381
1483
|
children: [
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowTagSelect, {
|
|
1383
1485
|
selected: row.tags,
|
|
1384
1486
|
options: tags,
|
|
1385
1487
|
onChange: (next) => changeRow(row.id, {
|
|
1386
1488
|
tags: next
|
|
1387
1489
|
})
|
|
1388
1490
|
}),
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
|
|
1390
1492
|
children: [
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
|
|
1392
1494
|
value: value.rows.findIndex((item) => item.id === row.id),
|
|
1393
1495
|
max: value.rows.length,
|
|
1394
1496
|
label: `V\u1ECB tr\xED d\xF2ng ${row.cells.name}`,
|
|
1395
1497
|
onMove: (to) => moveRow(row.id, to)
|
|
1396
1498
|
}),
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1398
1500
|
type: "button",
|
|
1399
1501
|
"aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} l\xEAn`,
|
|
1400
1502
|
disabled: value.rows[0]?.id === row.id,
|
|
1401
1503
|
onClick: () => moveRow(row.id, value.rows.findIndex((item) => item.id === row.id) - 1),
|
|
1402
1504
|
children: "\u2191"
|
|
1403
1505
|
}),
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1405
1507
|
type: "button",
|
|
1406
1508
|
"aria-label": `\u0110\u01B0a d\xF2ng ${row.cells.name} xu\u1ED1ng`,
|
|
1407
1509
|
disabled: value.rows[value.rows.length - 1]?.id === row.id,
|
|
@@ -1410,7 +1512,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1410
1512
|
})
|
|
1411
1513
|
]
|
|
1412
1514
|
}),
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1414
1516
|
type: "button",
|
|
1415
1517
|
onClick: () => {
|
|
1416
1518
|
setDeleteTarget({
|
|
@@ -1424,30 +1526,30 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1424
1526
|
]
|
|
1425
1527
|
})
|
|
1426
1528
|
});
|
|
1427
|
-
return /* @__PURE__ */ (0,
|
|
1529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_styled_components6.ThemeProvider, {
|
|
1428
1530
|
theme: feesTheme,
|
|
1429
|
-
children: /* @__PURE__ */ (0,
|
|
1531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
1430
1532
|
ref: tableRoot,
|
|
1431
1533
|
"data-cms-table-editor": true,
|
|
1432
1534
|
onClick: (event) => {
|
|
1433
1535
|
if (canEdit) event.stopPropagation();
|
|
1434
1536
|
},
|
|
1435
1537
|
children: [
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesAndMarginToolbar, {
|
|
1437
1539
|
"aria-label": "L\u1ECDc b\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
|
|
1438
|
-
children: /* @__PURE__ */ (0,
|
|
1540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(FeesAndMarginToolbarInner, {
|
|
1439
1541
|
children: [
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1441
1543
|
style: {
|
|
1442
1544
|
minWidth: 0
|
|
1443
1545
|
},
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TabCommon, {
|
|
1445
1547
|
ariaLabel: "L\u1ECDc theo tag",
|
|
1446
1548
|
size,
|
|
1447
1549
|
items: [
|
|
1448
1550
|
{
|
|
1449
1551
|
id: "",
|
|
1450
|
-
label:
|
|
1552
|
+
label: labels2?.all ?? "T\u1EA5t c\u1EA3"
|
|
1451
1553
|
},
|
|
1452
1554
|
...tags.map((item) => ({
|
|
1453
1555
|
id: item,
|
|
@@ -1461,12 +1563,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1461
1563
|
}
|
|
1462
1564
|
})
|
|
1463
1565
|
}),
|
|
1464
|
-
/* @__PURE__ */ (0,
|
|
1465
|
-
children: /* @__PURE__ */ (0,
|
|
1466
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesAndMarginSearch, {
|
|
1567
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputCommon, {
|
|
1568
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesSearchIcon, {}),
|
|
1467
1569
|
size: "sm",
|
|
1468
|
-
"aria-label":
|
|
1469
|
-
placeholder:
|
|
1570
|
+
"aria-label": labels2?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
|
|
1571
|
+
placeholder: labels2?.search ?? "T\xECm t\xEAn h\xE0ng h\xF3a ho\u1EB7c m\xE3",
|
|
1470
1572
|
value: search,
|
|
1471
1573
|
onChange: (event) => {
|
|
1472
1574
|
setSearch(event.target.value);
|
|
@@ -1477,9 +1579,9 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1477
1579
|
]
|
|
1478
1580
|
})
|
|
1479
1581
|
}),
|
|
1480
|
-
canEdit && /* @__PURE__ */ (0,
|
|
1582
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorActions, {
|
|
1481
1583
|
children: [
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1584
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1483
1585
|
type: "button",
|
|
1484
1586
|
onClick: () => {
|
|
1485
1587
|
onChange?.({
|
|
@@ -1490,7 +1592,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1490
1592
|
},
|
|
1491
1593
|
children: english ? "Sort names A\u2013Z" : "S\u1EAFp x\u1EBFp t\xEAn A\u2013Z"
|
|
1492
1594
|
}),
|
|
1493
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1494
1596
|
type: "button",
|
|
1495
1597
|
onClick: () => {
|
|
1496
1598
|
const row = {
|
|
@@ -1514,12 +1616,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1514
1616
|
},
|
|
1515
1617
|
children: "+ Th\xEAm h\xE0ng"
|
|
1516
1618
|
}),
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1518
1620
|
type: "button",
|
|
1519
1621
|
onClick: addColumn,
|
|
1520
1622
|
children: "+ Th\xEAm c\u1ED9t"
|
|
1521
1623
|
}),
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(EditorButton, {
|
|
1523
1625
|
type: "button",
|
|
1524
1626
|
onClick: () => setColumnsOpen(true),
|
|
1525
1627
|
children: [
|
|
@@ -1528,14 +1630,14 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1528
1630
|
")"
|
|
1529
1631
|
]
|
|
1530
1632
|
}),
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1532
1634
|
type: "button",
|
|
1533
1635
|
"aria-expanded": typographyOpen,
|
|
1534
1636
|
"aria-controls": `${dialogId}-typography`,
|
|
1535
1637
|
onClick: () => setTypographyOpen((open) => !open),
|
|
1536
1638
|
children: "\u0110\u1ECBnh d\u1EA1ng ch\u1EEF"
|
|
1537
1639
|
}),
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1539
1641
|
type: "button",
|
|
1540
1642
|
onClick: () => {
|
|
1541
1643
|
setTagDraft("");
|
|
@@ -1545,12 +1647,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1545
1647
|
})
|
|
1546
1648
|
]
|
|
1547
1649
|
}),
|
|
1548
|
-
canEdit && /* @__PURE__ */ (0,
|
|
1650
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Collapse.default, {
|
|
1549
1651
|
in: typographyOpen,
|
|
1550
1652
|
unmountOnExit: true,
|
|
1551
|
-
children: /* @__PURE__ */ (0,
|
|
1653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1552
1654
|
id: `${dialogId}-typography`,
|
|
1553
|
-
children: /* @__PURE__ */ (0,
|
|
1655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesTypographyControls, {
|
|
1554
1656
|
value: value.typography,
|
|
1555
1657
|
onChange: (typography) => {
|
|
1556
1658
|
const { typography: _previous, ...data } = value;
|
|
@@ -1564,31 +1666,40 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1564
1666
|
})
|
|
1565
1667
|
})
|
|
1566
1668
|
}),
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1669
|
+
canEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FeesColumnAlignmentControls, {
|
|
1670
|
+
columns: value.columns,
|
|
1671
|
+
columnKey: selectedColumnKey,
|
|
1672
|
+
english,
|
|
1673
|
+
onSelectColumn: setSelectedColumnKey,
|
|
1674
|
+
onChange: (textAlign) => {
|
|
1675
|
+
if (selectedColumn) onChange?.(setFeesColumnAlignment(value, selectedColumn.key, textAlign));
|
|
1676
|
+
}
|
|
1677
|
+
}),
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AlignedFeesTable, {
|
|
1568
1679
|
$typography: value.typography,
|
|
1569
1680
|
$mobileColumnWidths: columns.map((column) => Math.ceil((mobileColumnWidths[column.key] ?? 88) * mobileFontScale)),
|
|
1570
1681
|
"data-editable": canEdit || void 0,
|
|
1571
|
-
children: /* @__PURE__ */ (0,
|
|
1682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Table, {
|
|
1572
1683
|
ariaLabel: english ? "Fees and margin table" : "B\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
|
|
1573
1684
|
columns,
|
|
1574
1685
|
dataSource: pagination.rows,
|
|
1575
1686
|
rowKey: "id",
|
|
1576
1687
|
size,
|
|
1577
|
-
empty:
|
|
1688
|
+
empty: labels2?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
|
|
1578
1689
|
scroll: {
|
|
1579
1690
|
x: canEdit ? Math.max(1440, value.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + 300) : value.columns.length * 170 + 8
|
|
1580
1691
|
}
|
|
1581
1692
|
})
|
|
1582
1693
|
}),
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PaginationControls, {
|
|
1584
1695
|
children: [
|
|
1585
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PageSizeLabel, {
|
|
1586
1697
|
children: [
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {
|
|
1588
1699
|
id: `${dialogId}-page-size-label`,
|
|
1589
1700
|
children: english ? "Rows per page:" : "S\u1ED1 d\xF2ng m\u1ED7i trang:"
|
|
1590
1701
|
}),
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Select.default, {
|
|
1592
1703
|
size: "small",
|
|
1593
1704
|
value: pageSize,
|
|
1594
1705
|
labelId: `${dialogId}-page-size-label`,
|
|
@@ -1614,11 +1725,11 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1614
1725
|
25,
|
|
1615
1726
|
50,
|
|
1616
1727
|
100
|
|
1617
|
-
].map((size2) => /* @__PURE__ */ (0,
|
|
1728
|
+
].map((size2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1618
1729
|
value: size2,
|
|
1619
1730
|
children: size2
|
|
1620
1731
|
}, size2)),
|
|
1621
|
-
/* @__PURE__ */ (0,
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MenuItem.default, {
|
|
1622
1733
|
value: -1,
|
|
1623
1734
|
children: english ? "All" : "T\u1EA5t c\u1EA3"
|
|
1624
1735
|
})
|
|
@@ -1626,7 +1737,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1626
1737
|
})
|
|
1627
1738
|
]
|
|
1628
1739
|
}),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", {
|
|
1630
1741
|
"aria-live": "polite",
|
|
1631
1742
|
style: {
|
|
1632
1743
|
fontSize: 13
|
|
@@ -1639,7 +1750,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1639
1750
|
filtered.length
|
|
1640
1751
|
]
|
|
1641
1752
|
}),
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1753
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pagination, {
|
|
1643
1754
|
page: pagination.page,
|
|
1644
1755
|
pageCount: pagination.pageCount,
|
|
1645
1756
|
onPageChange: setPage,
|
|
@@ -1653,7 +1764,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1653
1764
|
})
|
|
1654
1765
|
]
|
|
1655
1766
|
}),
|
|
1656
|
-
/* @__PURE__ */ (0,
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1657
1768
|
open: columnsOpen && canEdit,
|
|
1658
1769
|
onClose: () => setColumnsOpen(false),
|
|
1659
1770
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1661,18 +1772,18 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1661
1772
|
fullWidth: true,
|
|
1662
1773
|
maxWidth: "md",
|
|
1663
1774
|
children: [
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
|
|
1665
1776
|
id: `${dialogId}-columns-title`,
|
|
1666
1777
|
children: "Qu\u1EA3n l\xFD c\u1ED9t"
|
|
1667
1778
|
}),
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogContent.default, {
|
|
1669
1780
|
children: [
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1781
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
|
|
1671
1782
|
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
1783
|
}),
|
|
1673
|
-
value.columns.map((column, index) => /* @__PURE__ */ (0,
|
|
1784
|
+
value.columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ColumnRow, {
|
|
1674
1785
|
children: [
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CellEditor, {
|
|
1676
1787
|
"aria-label": `Ti\xEAu \u0111\u1EC1 c\u1ED9t ${index + 1}`,
|
|
1677
1788
|
value: column.title,
|
|
1678
1789
|
onChange: (event) => onChange?.({
|
|
@@ -1683,29 +1794,29 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1683
1794
|
} : item)
|
|
1684
1795
|
})
|
|
1685
1796
|
}),
|
|
1686
|
-
/* @__PURE__ */ (0,
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(OrderActions, {
|
|
1687
1798
|
children: [
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Position, {
|
|
1689
1800
|
value: index,
|
|
1690
1801
|
max: value.columns.length,
|
|
1691
1802
|
label: `V\u1ECB tr\xED c\u1ED9t ${column.title}`,
|
|
1692
1803
|
onMove: (to) => moveColumn(index, to)
|
|
1693
1804
|
}),
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1695
1806
|
type: "button",
|
|
1696
1807
|
"aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} l\xEAn`,
|
|
1697
1808
|
disabled: index === 0,
|
|
1698
1809
|
onClick: () => moveColumn(index, index - 1),
|
|
1699
1810
|
children: "\u2191"
|
|
1700
1811
|
}),
|
|
1701
|
-
/* @__PURE__ */ (0,
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1702
1813
|
type: "button",
|
|
1703
1814
|
"aria-label": `\u0110\u01B0a c\u1ED9t ${column.title} xu\u1ED1ng`,
|
|
1704
1815
|
disabled: index === value.columns.length - 1,
|
|
1705
1816
|
onClick: () => moveColumn(index, index + 1),
|
|
1706
1817
|
children: "\u2193"
|
|
1707
1818
|
}),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DeleteButton, {
|
|
1709
1820
|
type: "button",
|
|
1710
1821
|
disabled: column.key === "name",
|
|
1711
1822
|
onClick: () => setDeleteTarget({
|
|
@@ -1719,15 +1830,15 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1719
1830
|
})
|
|
1720
1831
|
]
|
|
1721
1832
|
}, column.key)),
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditorButton, {
|
|
1723
1834
|
type: "button",
|
|
1724
1835
|
onClick: addColumn,
|
|
1725
1836
|
children: "+ Th\xEAm c\u1ED9t"
|
|
1726
1837
|
})
|
|
1727
1838
|
]
|
|
1728
1839
|
}),
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1730
|
-
children: /* @__PURE__ */ (0,
|
|
1840
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogActions.default, {
|
|
1841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1731
1842
|
variant: "contained",
|
|
1732
1843
|
onClick: () => setColumnsOpen(false),
|
|
1733
1844
|
children: "Xong"
|
|
@@ -1735,7 +1846,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1735
1846
|
})
|
|
1736
1847
|
]
|
|
1737
1848
|
}),
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1739
1850
|
open: createTagOpen && canEdit,
|
|
1740
1851
|
onClose: () => setCreateTagOpen(false),
|
|
1741
1852
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1743,12 +1854,12 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1743
1854
|
fullWidth: true,
|
|
1744
1855
|
maxWidth: "xs",
|
|
1745
1856
|
children: [
|
|
1746
|
-
/* @__PURE__ */ (0,
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogTitle.default, {
|
|
1747
1858
|
id: `${dialogId}-create-tag-title`,
|
|
1748
1859
|
children: "T\u1EA1o tag m\u1EDBi"
|
|
1749
1860
|
}),
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1751
|
-
children: /* @__PURE__ */ (0,
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
|
|
1862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_TextField.default, {
|
|
1752
1863
|
autoFocus: true,
|
|
1753
1864
|
fullWidth: true,
|
|
1754
1865
|
margin: "dense",
|
|
@@ -1765,13 +1876,13 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1765
1876
|
}
|
|
1766
1877
|
})
|
|
1767
1878
|
}),
|
|
1768
|
-
/* @__PURE__ */ (0,
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
|
|
1769
1880
|
children: [
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1771
1882
|
onClick: () => setCreateTagOpen(false),
|
|
1772
1883
|
children: "H\u1EE7y"
|
|
1773
1884
|
}),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1775
1886
|
variant: "contained",
|
|
1776
1887
|
disabled: !newTagName || duplicateTag,
|
|
1777
1888
|
onClick: createTag,
|
|
@@ -1781,7 +1892,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1781
1892
|
})
|
|
1782
1893
|
]
|
|
1783
1894
|
}),
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Dialog.default, {
|
|
1785
1896
|
open: Boolean(deleteTarget) && canEdit,
|
|
1786
1897
|
onClose: () => setDeleteTarget(null),
|
|
1787
1898
|
container: () => tableRoot.current?.ownerDocument.body ?? document.body,
|
|
@@ -1790,7 +1901,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1790
1901
|
fullWidth: true,
|
|
1791
1902
|
maxWidth: "xs",
|
|
1792
1903
|
children: [
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
1904
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogTitle.default, {
|
|
1794
1905
|
id: `${dialogId}-title`,
|
|
1795
1906
|
children: [
|
|
1796
1907
|
"X\xF3a ",
|
|
@@ -1798,20 +1909,20 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1798
1909
|
"?"
|
|
1799
1910
|
]
|
|
1800
1911
|
}),
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1802
|
-
children: /* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContent.default, {
|
|
1913
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_DialogContentText.default, {
|
|
1803
1914
|
id: `${dialogId}-description`,
|
|
1804
1915
|
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
1916
|
})
|
|
1806
1917
|
}),
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_DialogActions.default, {
|
|
1808
1919
|
children: [
|
|
1809
|
-
/* @__PURE__ */ (0,
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Button.default, {
|
|
1810
1921
|
autoFocus: true,
|
|
1811
1922
|
onClick: () => setDeleteTarget(null),
|
|
1812
1923
|
children: "H\u1EE7y"
|
|
1813
1924
|
}),
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_Button.default, {
|
|
1815
1926
|
color: "error",
|
|
1816
1927
|
variant: "contained",
|
|
1817
1928
|
onClick: confirmDelete,
|
|
@@ -1830,7 +1941,7 @@ function FeesTable({ value, editable = false, onChange, labels, size = "md", tag
|
|
|
1830
1941
|
}
|
|
1831
1942
|
|
|
1832
1943
|
// src/wikex/fees-manager.tsx
|
|
1833
|
-
var
|
|
1944
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1834
1945
|
function FeesManager({
|
|
1835
1946
|
entries,
|
|
1836
1947
|
selectedId,
|
|
@@ -1850,16 +1961,16 @@ function FeesManager({
|
|
|
1850
1961
|
}) {
|
|
1851
1962
|
const entry = entries.find((item) => item.id === selectedId);
|
|
1852
1963
|
const key = `${selectedId}:${language}`;
|
|
1853
|
-
return /* @__PURE__ */ (0,
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
1855
|
-
/* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
/* @__PURE__ */ (0,
|
|
1964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 3, sx: { minWidth: 0, width: 1 }, children: [
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: { xs: "column", md: "row" }, justifyContent: "space-between", alignItems: { md: "center" }, gap: 2.5, children: [
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 1, sx: { minWidth: 0, maxWidth: 720 }, children: [
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "h4", children: "Ph\xED & k\xFD qu\u1EF9" }),
|
|
1968
|
+
/* @__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
1969
|
] }),
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
1860
|
-
dirtyKeys.includes(key) && /* @__PURE__ */ (0,
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1862
|
-
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", spacing: 1.5, alignItems: "center", flexShrink: 0, children: [
|
|
1971
|
+
dirtyKeys.includes(key) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", color: "warning", label: "Ch\u01B0a l\u01B0u" }),
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1973
|
+
import_material3.Button,
|
|
1863
1974
|
{
|
|
1864
1975
|
variant: "contained",
|
|
1865
1976
|
loading: saving,
|
|
@@ -1871,17 +1982,17 @@ function FeesManager({
|
|
|
1871
1982
|
)
|
|
1872
1983
|
] })
|
|
1873
1984
|
] }),
|
|
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,
|
|
1985
|
+
!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." }),
|
|
1986
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: notice.severity, onClose: onDismissNotice, children: notice.message }),
|
|
1987
|
+
!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: [
|
|
1988
|
+
/* @__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: [
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 1.5, flexWrap: "wrap", children: [
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "subtitle1", children: "B\u1EA3ng \u0111ang qu\u1EA3n l\xFD" }),
|
|
1991
|
+
/* @__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
1992
|
] }),
|
|
1882
|
-
/* @__PURE__ */ (0,
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
1884
|
-
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: { xs: "column", md: "row" }, spacing: 2.5, alignItems: { md: "flex-end" }, children: [
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1995
|
+
import_material3.TextField,
|
|
1885
1996
|
{
|
|
1886
1997
|
select: true,
|
|
1887
1998
|
size: "small",
|
|
@@ -1891,7 +2002,7 @@ function FeesManager({
|
|
|
1891
2002
|
fullWidth: true,
|
|
1892
2003
|
sx: { flex: 1, minWidth: 0 },
|
|
1893
2004
|
onChange: (event) => onSelectEntry(event.target.value),
|
|
1894
|
-
children: entries.map((item, index) => /* @__PURE__ */ (0,
|
|
2005
|
+
children: entries.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.MenuItem, { value: item.id, children: [
|
|
1895
2006
|
item.pageTitle,
|
|
1896
2007
|
" \xB7 /",
|
|
1897
2008
|
item.slug,
|
|
@@ -1901,10 +2012,10 @@ function FeesManager({
|
|
|
1901
2012
|
] }, item.id))
|
|
1902
2013
|
}
|
|
1903
2014
|
),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
|
|
2015
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 1, sx: { width: { xs: 1, md: 240 }, flexShrink: 0 }, children: [
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "caption", color: "text.secondary", children: "Ng\xF4n ng\u1EEF n\u1ED9i dung" }),
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2018
|
+
import_material3.ToggleButtonGroup,
|
|
1908
2019
|
{
|
|
1909
2020
|
size: "small",
|
|
1910
2021
|
exclusive: true,
|
|
@@ -1916,11 +2027,11 @@ function FeesManager({
|
|
|
1916
2027
|
if (next === "vi" || next === "en") onSelectLanguage(next);
|
|
1917
2028
|
},
|
|
1918
2029
|
children: [
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "vi", children: [
|
|
1920
2031
|
"Ti\u1EBFng Vi\u1EC7t",
|
|
1921
2032
|
dirtyKeys.includes(`${selectedId}:vi`) ? " \u2022" : ""
|
|
1922
2033
|
] }),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.ToggleButton, { value: "en", children: [
|
|
1924
2035
|
"English",
|
|
1925
2036
|
dirtyKeys.includes(`${selectedId}:en`) ? " \u2022" : ""
|
|
1926
2037
|
] })
|
|
@@ -1930,22 +2041,22 @@ function FeesManager({
|
|
|
1930
2041
|
] })
|
|
1931
2042
|
] })
|
|
1932
2043
|
] }) }),
|
|
1933
|
-
parseError && /* @__PURE__ */ (0,
|
|
1934
|
-
table && /* @__PURE__ */ (0,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
2044
|
+
parseError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Alert, { severity: "error", children: parseError }),
|
|
2045
|
+
table && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Card, { inert: saving, "aria-busy": saving, sx: { minWidth: 0, opacity: saving ? 0.65 : 1 }, children: [
|
|
2046
|
+
/* @__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: [
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { spacing: 0.5, children: [
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Typography, { variant: "subtitle1", children: "D\u1EEF li\u1EC7u ph\xED & k\xFD qu\u1EF9" }),
|
|
2049
|
+
/* @__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
2050
|
] }),
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2051
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Stack, { direction: "row", spacing: 1, flexShrink: 0, children: [
|
|
2052
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", variant: "outlined", label: `${table.rows.length} d\xF2ng` }),
|
|
2053
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Chip, { size: "small", variant: "outlined", label: `${table.columns.length} c\u1ED9t` })
|
|
1943
2054
|
] })
|
|
1944
2055
|
] }),
|
|
1945
|
-
/* @__PURE__ */ (0,
|
|
1946
|
-
/* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material3.Divider, {}),
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material3.Box, { sx: { p: { xs: 2.5, md: 3 }, minWidth: 0 }, children: [
|
|
2058
|
+
/* @__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." }),
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FeesTable, { value: table, language, editable: canWrite, onChange: canWrite && !saving ? onChange : void 0 }, key)
|
|
1949
2060
|
] })
|
|
1950
2061
|
] })
|
|
1951
2062
|
] })
|