@enyxs/wikex-components 0.11.24 → 0.11.25
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 +75 -21
- package/dist/fees.js.map +1 -1
- package/dist/fees.mjs +75 -21
- package/dist/fees.mjs.map +1 -1
- package/dist/index.js +75 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8409,37 +8409,59 @@ var feesTheme = {
|
|
|
8409
8409
|
]))
|
|
8410
8410
|
};
|
|
8411
8411
|
var EditorActions = import_styled_components12.default.div.withConfig({
|
|
8412
|
-
componentId: "sc-
|
|
8412
|
+
componentId: "sc-ecbebe61-0"
|
|
8413
8413
|
})([
|
|
8414
8414
|
`display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;`
|
|
8415
8415
|
]);
|
|
8416
8416
|
var EditGroup = import_styled_components12.default.div.withConfig({
|
|
8417
|
-
componentId: "sc-
|
|
8417
|
+
componentId: "sc-ecbebe61-1"
|
|
8418
8418
|
})([
|
|
8419
8419
|
`display:flex;flex-direction:column;gap:6px;`
|
|
8420
8420
|
]);
|
|
8421
8421
|
var HeaderGroup = (0, import_styled_components12.default)(EditGroup).withConfig({
|
|
8422
|
-
componentId: "sc-
|
|
8422
|
+
componentId: "sc-ecbebe61-2"
|
|
8423
8423
|
})([
|
|
8424
8424
|
`gap:8px;`
|
|
8425
8425
|
]);
|
|
8426
8426
|
var HeaderTitle = import_styled_components12.default.div.withConfig({
|
|
8427
|
-
componentId: "sc-
|
|
8427
|
+
componentId: "sc-ecbebe61-3"
|
|
8428
8428
|
})([
|
|
8429
8429
|
`display:flex;align-items:flex-start;min-height:var(--fees-header-title-height,36px);`
|
|
8430
8430
|
]);
|
|
8431
8431
|
var HeaderActions = import_styled_components12.default.div.withConfig({
|
|
8432
|
-
componentId: "sc-
|
|
8432
|
+
componentId: "sc-ecbebe61-4"
|
|
8433
8433
|
})([
|
|
8434
8434
|
`display:flex;align-items:center;min-height:24px;`
|
|
8435
8435
|
]);
|
|
8436
8436
|
var AlignedFeesTable = (0, import_styled_components12.default)(FeesAndMarginTable).withConfig({
|
|
8437
|
-
componentId: "sc-
|
|
8437
|
+
componentId: "sc-ecbebe61-5"
|
|
8438
|
+
})([
|
|
8439
|
+
`&[data-editable] th{vertical-align:top;}--fees-row-background:`,
|
|
8440
|
+
`;--fees-stripe-background:`,
|
|
8441
|
+
`;--fees-text:`,
|
|
8442
|
+
`;:root[data-theme="dark"] &{--fees-row-background:#39393d;--fees-stripe-background:`,
|
|
8443
|
+
`;--fees-text:`,
|
|
8444
|
+
`;}&[data-editable] table{table-layout:auto;}table{table-layout:fixed;font-family:var(--font-manrope,Manrope),Arial,Helvetica,sans-serif;}th,td{box-sizing:border-box;overflow-wrap:anywhere;}thead > tr,thead > tr > th{background:`,
|
|
8445
|
+
`;}thead > tr > th{height:52px;padding:11.5px 8px;color:`,
|
|
8446
|
+
`;font-size:10px;font-weight:600;line-height:14px;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:12px;font-weight:500;line-height:16px;}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:`,
|
|
8447
|
+
`px;table-layout:fixed;}`,
|
|
8448
|
+
` thead > tr > th,tbody > tr > td{padding-left:6px;padding-right:6px;white-space:pre-line;overflow-wrap:anywhere;font-family:var(--font-inter,Inter),Arial,Helvetica,sans-serif;}thead > tr > th{height:40px;padding-top:9.5px;padding-bottom:9.5px;font-size:8px;line-height:10px;}tbody > tr > td{height:40px;padding-top:5.5px;padding-bottom:5.5px;font-size:10px;line-height:14px;}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:`,
|
|
8449
|
+
`;}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);}}}`
|
|
8450
|
+
], ({ 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, ({ $mobileColumnWidths }) => $mobileColumnWidths.reduce((sum, width) => sum + width, 0), ({ $mobileColumnWidths }) => $mobileColumnWidths.map((width, index) => `
|
|
8451
|
+
th:nth-child(${index + 1}), td:nth-child(${index + 1}) {
|
|
8452
|
+
width: ${width}px;
|
|
8453
|
+
min-width: ${width}px;
|
|
8454
|
+
max-width: ${width}px;
|
|
8455
|
+
}
|
|
8456
|
+
`).join(""), ({ theme }) => theme.colors.accent.primary);
|
|
8457
|
+
var FeesCellContent = import_styled_components12.default.span.withConfig({
|
|
8458
|
+
componentId: "sc-ecbebe61-6"
|
|
8438
8459
|
})([
|
|
8439
|
-
|
|
8440
|
-
|
|
8460
|
+
`display:block;text-align:`,
|
|
8461
|
+
`;`
|
|
8462
|
+
], ({ $alignRight }) => $alignRight ? "right" : "left");
|
|
8441
8463
|
var EditorButton = import_styled_components12.default.button.withConfig({
|
|
8442
|
-
componentId: "sc-
|
|
8464
|
+
componentId: "sc-ecbebe61-7"
|
|
8443
8465
|
})([
|
|
8444
8466
|
`padding:7px 12px;border:1px solid `,
|
|
8445
8467
|
`;border-radius:6px;background:`,
|
|
@@ -8448,17 +8470,17 @@ var EditorButton = import_styled_components12.default.button.withConfig({
|
|
|
8448
8470
|
`;}&:disabled{cursor:default;opacity:.4;}`
|
|
8449
8471
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
8450
8472
|
var OrderActions = import_styled_components12.default.div.withConfig({
|
|
8451
|
-
componentId: "sc-
|
|
8473
|
+
componentId: "sc-ecbebe61-8"
|
|
8452
8474
|
})([
|
|
8453
8475
|
`display:flex;gap:6px;align-items:center;flex-wrap:wrap;`
|
|
8454
8476
|
]);
|
|
8455
8477
|
var PositionLabel = import_styled_components12.default.label.withConfig({
|
|
8456
|
-
componentId: "sc-
|
|
8478
|
+
componentId: "sc-ecbebe61-9"
|
|
8457
8479
|
})([
|
|
8458
8480
|
`display:inline-flex;align-items:center;gap:6px;font-size:12px;`
|
|
8459
8481
|
]);
|
|
8460
8482
|
var PositionInput = import_styled_components12.default.input.withConfig({
|
|
8461
|
-
componentId: "sc-
|
|
8483
|
+
componentId: "sc-ecbebe61-10"
|
|
8462
8484
|
})([
|
|
8463
8485
|
`width:56px;padding:5px;border:1px solid `,
|
|
8464
8486
|
`;border-radius:4px;background:`,
|
|
@@ -8467,17 +8489,17 @@ var PositionInput = import_styled_components12.default.input.withConfig({
|
|
|
8467
8489
|
`;}`
|
|
8468
8490
|
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
8469
8491
|
var ColumnRow = import_styled_components12.default.div.withConfig({
|
|
8470
|
-
componentId: "sc-
|
|
8492
|
+
componentId: "sc-ecbebe61-11"
|
|
8471
8493
|
})([
|
|
8472
8494
|
`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;}`
|
|
8473
8495
|
]);
|
|
8474
8496
|
var PaginationControls = (0, import_styled_components12.default)(FeesAndMarginPagination).withConfig({
|
|
8475
|
-
componentId: "sc-
|
|
8497
|
+
componentId: "sc-ecbebe61-12"
|
|
8476
8498
|
})([
|
|
8477
8499
|
`align-items:center;flex-wrap:wrap;gap:16px 24px;`
|
|
8478
8500
|
]);
|
|
8479
8501
|
var PageSizeLabel = import_styled_components12.default.div.withConfig({
|
|
8480
|
-
componentId: "sc-
|
|
8502
|
+
componentId: "sc-ecbebe61-13"
|
|
8481
8503
|
})([
|
|
8482
8504
|
`display:inline-flex;align-items:center;gap:8px;color:`,
|
|
8483
8505
|
`;font:inherit;font-size:13px;`
|
|
@@ -8505,12 +8527,12 @@ function Position({ value: value4, max, label, onMove }) {
|
|
|
8505
8527
|
});
|
|
8506
8528
|
}
|
|
8507
8529
|
var DeleteButton = (0, import_styled_components12.default)(EditorButton).withConfig({
|
|
8508
|
-
componentId: "sc-
|
|
8530
|
+
componentId: "sc-ecbebe61-14"
|
|
8509
8531
|
})([
|
|
8510
8532
|
`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;}`
|
|
8511
8533
|
]);
|
|
8512
8534
|
var CellEditorInput = import_styled_components12.default.textarea.withConfig({
|
|
8513
|
-
componentId: "sc-
|
|
8535
|
+
componentId: "sc-ecbebe61-15"
|
|
8514
8536
|
})([
|
|
8515
8537
|
`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:`,
|
|
8516
8538
|
`;}&:focus{outline:1px solid `,
|
|
@@ -8623,6 +8645,31 @@ var columnWidths = {
|
|
|
8623
8645
|
tradingHours: 160,
|
|
8624
8646
|
priceRange: 112
|
|
8625
8647
|
};
|
|
8648
|
+
var mobileColumnWidths = {
|
|
8649
|
+
name: 88,
|
|
8650
|
+
code: 60,
|
|
8651
|
+
exchange: 60,
|
|
8652
|
+
initialMargin: 90,
|
|
8653
|
+
tradingFee: 64,
|
|
8654
|
+
tickSize: 54,
|
|
8655
|
+
margin: 70,
|
|
8656
|
+
priceUnit: 88,
|
|
8657
|
+
contractSize: 110,
|
|
8658
|
+
settlement: 92,
|
|
8659
|
+
deliveryDay: 90,
|
|
8660
|
+
tradingHours: 120,
|
|
8661
|
+
priceRange: 70
|
|
8662
|
+
};
|
|
8663
|
+
var rightAlignedColumns = /* @__PURE__ */ new Set([
|
|
8664
|
+
"initialMargin",
|
|
8665
|
+
"tradingFee",
|
|
8666
|
+
"tickSize",
|
|
8667
|
+
"margin",
|
|
8668
|
+
"settlement",
|
|
8669
|
+
"priceRange",
|
|
8670
|
+
"priceUnit",
|
|
8671
|
+
"unit"
|
|
8672
|
+
]);
|
|
8626
8673
|
function FeesTable({ value: value4, editable = false, onChange, labels, size = "md", tagOrder = [], language = "vi" }) {
|
|
8627
8674
|
const [search, setSearch] = (0, import_react18.useState)("");
|
|
8628
8675
|
const [tag, setTag] = (0, import_react18.useState)("");
|
|
@@ -8743,7 +8790,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
|
|
|
8743
8790
|
});
|
|
8744
8791
|
const columns = value4.columns.map((column, index) => ({
|
|
8745
8792
|
key: column.key,
|
|
8746
|
-
width: columnWidths[column.key] ?? 140,
|
|
8793
|
+
width: canEdit ? columnWidths[column.key] ?? 140 : index === 0 ? 178 : 170,
|
|
8747
8794
|
fixed: index === 0 ? "left" : void 0,
|
|
8748
8795
|
title: canEdit ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(HeaderGroup, {
|
|
8749
8796
|
children: [
|
|
@@ -8775,7 +8822,10 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
|
|
|
8775
8822
|
})
|
|
8776
8823
|
})
|
|
8777
8824
|
]
|
|
8778
|
-
}) :
|
|
8825
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeesCellContent, {
|
|
8826
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
8827
|
+
children: column.title
|
|
8828
|
+
}),
|
|
8779
8829
|
render: (_unused, row) => canEdit ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CellEditor, {
|
|
8780
8830
|
rows: Math.max(2, (row.cells[column.key] ?? "").split("\n").length),
|
|
8781
8831
|
value: row.cells[column.key] ?? "",
|
|
@@ -8786,7 +8836,10 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
|
|
|
8786
8836
|
[column.key]: event.target.value
|
|
8787
8837
|
}
|
|
8788
8838
|
})
|
|
8789
|
-
}) :
|
|
8839
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeesCellContent, {
|
|
8840
|
+
$alignRight: rightAlignedColumns.has(column.key),
|
|
8841
|
+
children: row.cells[column.key] ?? ""
|
|
8842
|
+
})
|
|
8790
8843
|
}));
|
|
8791
8844
|
if (canEdit) columns.push({
|
|
8792
8845
|
key: "__tags",
|
|
@@ -8950,6 +9003,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
|
|
|
8950
9003
|
]
|
|
8951
9004
|
}),
|
|
8952
9005
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AlignedFeesTable, {
|
|
9006
|
+
$mobileColumnWidths: columns.map((column) => mobileColumnWidths[column.key] ?? 88),
|
|
8953
9007
|
"data-editable": canEdit || void 0,
|
|
8954
9008
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Table, {
|
|
8955
9009
|
ariaLabel: english ? "Fees and margin table" : "B\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
|
|
@@ -8959,7 +9013,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
|
|
|
8959
9013
|
size,
|
|
8960
9014
|
empty: labels?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
|
|
8961
9015
|
scroll: {
|
|
8962
|
-
x: Math.max(1440, value4.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) +
|
|
9016
|
+
x: canEdit ? Math.max(1440, value4.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + 300) : value4.columns.length * 170 + 8
|
|
8963
9017
|
}
|
|
8964
9018
|
})
|
|
8965
9019
|
}),
|