@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/index.mjs CHANGED
@@ -8360,37 +8360,59 @@ var feesTheme = {
8360
8360
  ]))
8361
8361
  };
8362
8362
  var EditorActions = styled12.div.withConfig({
8363
- componentId: "sc-a6ff7adc-0"
8363
+ componentId: "sc-ecbebe61-0"
8364
8364
  })([
8365
8365
  `display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;`
8366
8366
  ]);
8367
8367
  var EditGroup = styled12.div.withConfig({
8368
- componentId: "sc-a6ff7adc-1"
8368
+ componentId: "sc-ecbebe61-1"
8369
8369
  })([
8370
8370
  `display:flex;flex-direction:column;gap:6px;`
8371
8371
  ]);
8372
8372
  var HeaderGroup = styled12(EditGroup).withConfig({
8373
- componentId: "sc-a6ff7adc-2"
8373
+ componentId: "sc-ecbebe61-2"
8374
8374
  })([
8375
8375
  `gap:8px;`
8376
8376
  ]);
8377
8377
  var HeaderTitle = styled12.div.withConfig({
8378
- componentId: "sc-a6ff7adc-3"
8378
+ componentId: "sc-ecbebe61-3"
8379
8379
  })([
8380
8380
  `display:flex;align-items:flex-start;min-height:var(--fees-header-title-height,36px);`
8381
8381
  ]);
8382
8382
  var HeaderActions = styled12.div.withConfig({
8383
- componentId: "sc-a6ff7adc-4"
8383
+ componentId: "sc-ecbebe61-4"
8384
8384
  })([
8385
8385
  `display:flex;align-items:center;min-height:24px;`
8386
8386
  ]);
8387
8387
  var AlignedFeesTable = styled12(FeesAndMarginTable).withConfig({
8388
- componentId: "sc-a6ff7adc-5"
8388
+ componentId: "sc-ecbebe61-5"
8389
+ })([
8390
+ `&[data-editable] th{vertical-align:top;}--fees-row-background:`,
8391
+ `;--fees-stripe-background:`,
8392
+ `;--fees-text:`,
8393
+ `;:root[data-theme="dark"] &{--fees-row-background:#39393d;--fees-stripe-background:`,
8394
+ `;--fees-text:`,
8395
+ `;}&[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:`,
8396
+ `;}thead > tr > th{height:52px;padding:11.5px 8px;color:`,
8397
+ `;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:`,
8398
+ `px;table-layout:fixed;}`,
8399
+ ` 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:`,
8400
+ `;}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);}}}`
8401
+ ], ({ 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) => `
8402
+ th:nth-child(${index + 1}), td:nth-child(${index + 1}) {
8403
+ width: ${width}px;
8404
+ min-width: ${width}px;
8405
+ max-width: ${width}px;
8406
+ }
8407
+ `).join(""), ({ theme }) => theme.colors.accent.primary);
8408
+ var FeesCellContent = styled12.span.withConfig({
8409
+ componentId: "sc-ecbebe61-6"
8389
8410
  })([
8390
- `&[data-editable] th{vertical-align:top;}`
8391
- ]);
8411
+ `display:block;text-align:`,
8412
+ `;`
8413
+ ], ({ $alignRight }) => $alignRight ? "right" : "left");
8392
8414
  var EditorButton = styled12.button.withConfig({
8393
- componentId: "sc-a6ff7adc-6"
8415
+ componentId: "sc-ecbebe61-7"
8394
8416
  })([
8395
8417
  `padding:7px 12px;border:1px solid `,
8396
8418
  `;border-radius:6px;background:`,
@@ -8399,17 +8421,17 @@ var EditorButton = styled12.button.withConfig({
8399
8421
  `;}&:disabled{cursor:default;opacity:.4;}`
8400
8422
  ], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
8401
8423
  var OrderActions = styled12.div.withConfig({
8402
- componentId: "sc-a6ff7adc-7"
8424
+ componentId: "sc-ecbebe61-8"
8403
8425
  })([
8404
8426
  `display:flex;gap:6px;align-items:center;flex-wrap:wrap;`
8405
8427
  ]);
8406
8428
  var PositionLabel = styled12.label.withConfig({
8407
- componentId: "sc-a6ff7adc-8"
8429
+ componentId: "sc-ecbebe61-9"
8408
8430
  })([
8409
8431
  `display:inline-flex;align-items:center;gap:6px;font-size:12px;`
8410
8432
  ]);
8411
8433
  var PositionInput = styled12.input.withConfig({
8412
- componentId: "sc-a6ff7adc-9"
8434
+ componentId: "sc-ecbebe61-10"
8413
8435
  })([
8414
8436
  `width:56px;padding:5px;border:1px solid `,
8415
8437
  `;border-radius:4px;background:`,
@@ -8418,17 +8440,17 @@ var PositionInput = styled12.input.withConfig({
8418
8440
  `;}`
8419
8441
  ], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.background.input, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
8420
8442
  var ColumnRow = styled12.div.withConfig({
8421
- componentId: "sc-a6ff7adc-10"
8443
+ componentId: "sc-ecbebe61-11"
8422
8444
  })([
8423
8445
  `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;}`
8424
8446
  ]);
8425
8447
  var PaginationControls = styled12(FeesAndMarginPagination).withConfig({
8426
- componentId: "sc-a6ff7adc-11"
8448
+ componentId: "sc-ecbebe61-12"
8427
8449
  })([
8428
8450
  `align-items:center;flex-wrap:wrap;gap:16px 24px;`
8429
8451
  ]);
8430
8452
  var PageSizeLabel = styled12.div.withConfig({
8431
- componentId: "sc-a6ff7adc-12"
8453
+ componentId: "sc-ecbebe61-13"
8432
8454
  })([
8433
8455
  `display:inline-flex;align-items:center;gap:8px;color:`,
8434
8456
  `;font:inherit;font-size:13px;`
@@ -8456,12 +8478,12 @@ function Position({ value: value4, max, label, onMove }) {
8456
8478
  });
8457
8479
  }
8458
8480
  var DeleteButton = styled12(EditorButton).withConfig({
8459
- componentId: "sc-a6ff7adc-13"
8481
+ componentId: "sc-ecbebe61-14"
8460
8482
  })([
8461
8483
  `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;}`
8462
8484
  ]);
8463
8485
  var CellEditorInput = styled12.textarea.withConfig({
8464
- componentId: "sc-a6ff7adc-14"
8486
+ componentId: "sc-ecbebe61-15"
8465
8487
  })([
8466
8488
  `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:`,
8467
8489
  `;}&:focus{outline:1px solid `,
@@ -8574,6 +8596,31 @@ var columnWidths = {
8574
8596
  tradingHours: 160,
8575
8597
  priceRange: 112
8576
8598
  };
8599
+ var mobileColumnWidths = {
8600
+ name: 88,
8601
+ code: 60,
8602
+ exchange: 60,
8603
+ initialMargin: 90,
8604
+ tradingFee: 64,
8605
+ tickSize: 54,
8606
+ margin: 70,
8607
+ priceUnit: 88,
8608
+ contractSize: 110,
8609
+ settlement: 92,
8610
+ deliveryDay: 90,
8611
+ tradingHours: 120,
8612
+ priceRange: 70
8613
+ };
8614
+ var rightAlignedColumns = /* @__PURE__ */ new Set([
8615
+ "initialMargin",
8616
+ "tradingFee",
8617
+ "tickSize",
8618
+ "margin",
8619
+ "settlement",
8620
+ "priceRange",
8621
+ "priceUnit",
8622
+ "unit"
8623
+ ]);
8577
8624
  function FeesTable({ value: value4, editable = false, onChange, labels, size = "md", tagOrder = [], language = "vi" }) {
8578
8625
  const [search, setSearch] = useState5("");
8579
8626
  const [tag, setTag] = useState5("");
@@ -8694,7 +8741,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
8694
8741
  });
8695
8742
  const columns = value4.columns.map((column, index) => ({
8696
8743
  key: column.key,
8697
- width: columnWidths[column.key] ?? 140,
8744
+ width: canEdit ? columnWidths[column.key] ?? 140 : index === 0 ? 178 : 170,
8698
8745
  fixed: index === 0 ? "left" : void 0,
8699
8746
  title: canEdit ? /* @__PURE__ */ _jsxs3(HeaderGroup, {
8700
8747
  children: [
@@ -8726,7 +8773,10 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
8726
8773
  })
8727
8774
  })
8728
8775
  ]
8729
- }) : column.title,
8776
+ }) : /* @__PURE__ */ _jsx3(FeesCellContent, {
8777
+ $alignRight: rightAlignedColumns.has(column.key),
8778
+ children: column.title
8779
+ }),
8730
8780
  render: (_unused, row) => canEdit ? /* @__PURE__ */ _jsx3(CellEditor, {
8731
8781
  rows: Math.max(2, (row.cells[column.key] ?? "").split("\n").length),
8732
8782
  value: row.cells[column.key] ?? "",
@@ -8737,7 +8787,10 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
8737
8787
  [column.key]: event.target.value
8738
8788
  }
8739
8789
  })
8740
- }) : row.cells[column.key] ?? ""
8790
+ }) : /* @__PURE__ */ _jsx3(FeesCellContent, {
8791
+ $alignRight: rightAlignedColumns.has(column.key),
8792
+ children: row.cells[column.key] ?? ""
8793
+ })
8741
8794
  }));
8742
8795
  if (canEdit) columns.push({
8743
8796
  key: "__tags",
@@ -8901,6 +8954,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
8901
8954
  ]
8902
8955
  }),
8903
8956
  /* @__PURE__ */ _jsx3(AlignedFeesTable, {
8957
+ $mobileColumnWidths: columns.map((column) => mobileColumnWidths[column.key] ?? 88),
8904
8958
  "data-editable": canEdit || void 0,
8905
8959
  children: /* @__PURE__ */ _jsx3(Table, {
8906
8960
  ariaLabel: english ? "Fees and margin table" : "B\u1EA3ng ph\xED v\xE0 k\xFD qu\u1EF9",
@@ -8910,7 +8964,7 @@ function FeesTable({ value: value4, editable = false, onChange, labels, size = "
8910
8964
  size,
8911
8965
  empty: labels?.empty ?? "Kh\xF4ng t\xECm th\u1EA5y h\xE0ng h\xF3a",
8912
8966
  scroll: {
8913
- x: Math.max(1440, value4.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + (canEdit ? 300 : 0))
8967
+ x: canEdit ? Math.max(1440, value4.columns.reduce((sum, column) => sum + (columnWidths[column.key] ?? 140), 0) + 300) : value4.columns.length * 170 + 8
8914
8968
  }
8915
8969
  })
8916
8970
  }),