@tcn/ui-table 2.3.3 → 2.3.5

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.
Files changed (44) hide show
  1. package/dist/cell.css +1 -1
  2. package/dist/components/cells/data_cell.d.ts.map +1 -1
  3. package/dist/components/cells/data_cell.js +4 -3
  4. package/dist/components/cells/data_cell.js.map +1 -1
  5. package/dist/components/cells/footer_cell.d.ts.map +1 -1
  6. package/dist/components/cells/footer_cell.js +5 -4
  7. package/dist/components/cells/footer_cell.js.map +1 -1
  8. package/dist/components/cells/header_cell.d.ts +3 -5
  9. package/dist/components/cells/header_cell.d.ts.map +1 -1
  10. package/dist/components/cells/header_cell.js +49 -37
  11. package/dist/components/cells/header_cell.js.map +1 -1
  12. package/dist/components/cells/sort_control.d.ts +8 -0
  13. package/dist/components/cells/sort_control.d.ts.map +1 -0
  14. package/dist/components/cells/sort_control.js +27 -0
  15. package/dist/components/cells/sort_control.js.map +1 -0
  16. package/dist/components/cells/sticky_row_data_cell.d.ts.map +1 -1
  17. package/dist/components/cells/sticky_row_data_cell.js +14 -13
  18. package/dist/components/cells/sticky_row_data_cell.js.map +1 -1
  19. package/dist/components/cells/sticky_row_fill_cell.d.ts.map +1 -1
  20. package/dist/components/cells/sticky_row_fill_cell.js +4 -3
  21. package/dist/components/cells/sticky_row_fill_cell.js.map +1 -1
  22. package/dist/components/table/table.d.ts.map +1 -1
  23. package/dist/components/table/table.js +66 -64
  24. package/dist/components/table/table.js.map +1 -1
  25. package/dist/components/table_filter_panel/field_filters/string_field_filter.d.ts.map +1 -1
  26. package/dist/components/table_filter_panel/field_filters/string_field_filter.js +21 -20
  27. package/dist/components/table_filter_panel/field_filters/string_field_filter.js.map +1 -1
  28. package/dist/components/table_pager.d.ts.map +1 -1
  29. package/dist/components/table_pager.js +34 -16
  30. package/dist/components/table_pager.js.map +1 -1
  31. package/dist/table.css +1 -1
  32. package/package.json +4 -4
  33. package/src/__stories__/table.stories.tsx +232 -195
  34. package/src/components/cells/cell.module.css +7 -45
  35. package/src/components/cells/data_cell.tsx +3 -2
  36. package/src/components/cells/footer_cell.tsx +3 -2
  37. package/src/components/cells/header_cell.tsx +19 -28
  38. package/src/components/cells/sort_control.tsx +44 -0
  39. package/src/components/cells/sticky_row_data_cell.tsx +3 -2
  40. package/src/components/cells/sticky_row_fill_cell.tsx +3 -2
  41. package/src/components/table/table.module.css +24 -212
  42. package/src/components/table/table.tsx +35 -24
  43. package/src/components/table_filter_panel/field_filters/string_field_filter.tsx +1 -0
  44. package/src/components/table_pager.tsx +12 -2
package/dist/cell.css CHANGED
@@ -1 +1 @@
1
- ._table-cell_659286b[data-stick-to=start]{position:sticky;top:0;left:var(--start-offset, 0)}._table-cell_659286b[data-stick-to=end]{position:sticky;top:0;right:var(--end-offset, -1px)}._table-cell_659286b[data-stick-to=start]:dir(rtl){position:sticky;top:0;right:var(--start-offset, -1px)}._table-cell_659286b[data-stick-to=end]:dir(rtl){position:sticky;top:0;left:var(--end-offset, 0)}._table-cell_659286b[data-is-last-sticky-start=true]>div{border-inline-end:1px solid #ccc}.dark-mode ._table-cell_659286b[data-is-last-sticky-start=true]>div{border-inline-end:1px solid #202020}._table-cell_659286b[data-is-last-sticky-end=true]>div{border-inline-start:1px solid #ccc}.dark-mode ._table-cell_659286b[data-is-last-sticky-end=true] div{border-inline-start:1px solid #202020}._table-cell_659286b[data-no-border=true]{border-inline:none}._sticky-row-table-cell_fa29729{position:sticky;top:22px;z-index:1}._sticky-row-table-cell_fa29729[data-stick-to=start]{position:sticky;top:0;left:var(--start-offset, 0);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=end]{position:sticky;top:0;right:var(--end-offset, -1px);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=start]:dir(rtl){position:sticky;top:0;right:var(--start-offset, -1px);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=end]:dir(rtl){position:sticky;top:0;left:var(--end-offset, 0);z-index:2}._sticky-row-table-cell_fa29729[data-is-last-sticky-start=true]>div{border-inline-end:1px solid #ccc}.dark-mode ._sticky-row-table-cell_fa29729[data-is-last-sticky-start=true]>div{border-inline-end:1px solid #202020}._sticky-row-table-cell_fa29729[data-is-last-sticky-end=true]>div{border-inline-start:1px solid #ccc}.dark-mode ._sticky-row-table-cell_fa29729[data-is-last-sticky-end=true]{border-inline-start:1px solid #202020}._sticky-row-table-cell_fa29729[data-no-border=true]{border-inline:none}
1
+ ._table-cell_659286b[data-stick-to=start]{position:sticky;top:0;left:var(--start-offset, 0)}._table-cell_659286b[data-stick-to=end]{position:sticky;top:0;right:var(--end-offset, 0)}._table-cell_659286b[data-stick-to=start]:dir(rtl){position:sticky;top:0;right:var(--start-offset, 0)}._table-cell_659286b[data-stick-to=end]:dir(rtl){position:sticky;top:0;left:var(--end-offset, 0)}._sticky-row-table-cell_fa29729{--material: #cccccc;background-color:#ccc;position:sticky;z-index:1}._sticky-row-table-cell_fa29729[data-stick-to=start]{position:sticky;top:0;left:var(--start-offset, -1px);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=end]{position:sticky;top:0;right:var(--end-offset, -1px);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=start]:dir(rtl){position:sticky;top:0;right:var(--start-offset, -1px);z-index:2}._sticky-row-table-cell_fa29729[data-stick-to=end]:dir(rtl){position:sticky;top:0;left:var(--end-offset, 0);z-index:2}
@@ -1 +1 @@
1
- {"version":3,"file":"data_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/data_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,aAAa,2CAcjE"}
1
+ {"version":3,"file":"data_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/data_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,aAAa,2CAcjE"}
@@ -1,7 +1,8 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { c as i } from "../../cell.module-WpHnQBVu.js";
3
- function m({ content: e, sticky: a, width: t }) {
4
- return /* @__PURE__ */ l("td", { className: i["table-cell"], "data-stick-to": a, children: /* @__PURE__ */ l(
3
+ import { TD as a } from "@tcn/ui/layouts";
4
+ function p({ content: e, sticky: r, width: t }) {
5
+ return /* @__PURE__ */ l(a, { className: i["table-cell"], "data-stick-to": r, children: /* @__PURE__ */ l(
5
6
  "div",
6
7
  {
7
8
  style: {
@@ -14,6 +15,6 @@ function m({ content: e, sticky: a, width: t }) {
14
15
  ) });
15
16
  }
16
17
  export {
17
- m as DataCell
18
+ p as DataCell
18
19
  };
19
20
  //# sourceMappingURL=data_cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data_cell.js","sources":["../../../src/components/cells/data_cell.tsx"],"sourcesContent":["import React from 'react';\n\nimport cellStyles from './cell.module.css';\n\nexport type DataCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n};\n\nexport function DataCell({ content, sticky, width }: DataCellProps) {\n return (\n <td className={cellStyles['table-cell']} data-stick-to={sticky}>\n <div\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n }}\n >\n {content}\n </div>\n </td>\n );\n}\n"],"names":["DataCell","content","sticky","width","cellStyles","jsx"],"mappings":";;AAUO,SAASA,EAAS,EAAE,SAAAC,GAAS,QAAAC,GAAQ,OAAAC,KAAwB;AAClE,2BACG,MAAA,EAAG,WAAWC,EAAW,YAAY,GAAG,iBAAeF,GACtD,UAAA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO,GAAGF,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,MAAA;AAAA,MAGnB,UAAAF;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
1
+ {"version":3,"file":"data_cell.js","sources":["../../../src/components/cells/data_cell.tsx"],"sourcesContent":["import React from 'react';\n\nimport cellStyles from './cell.module.css';\nimport { TD } from '@tcn/ui/layouts';\n\nexport type DataCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n};\n\nexport function DataCell({ content, sticky, width }: DataCellProps) {\n return (\n <TD className={cellStyles['table-cell']} data-stick-to={sticky}>\n <div\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n }}\n >\n {content}\n </div>\n </TD>\n );\n}\n"],"names":["DataCell","content","sticky","width","TD","cellStyles","jsx"],"mappings":";;;AAWO,SAASA,EAAS,EAAE,SAAAC,GAAS,QAAAC,GAAQ,OAAAC,KAAwB;AAClE,2BACGC,GAAA,EAAG,WAAWC,EAAW,YAAY,GAAG,iBAAeH,GACtD,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO,GAAGH,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,MAAA;AAAA,MAGnB,UAAAF;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"footer_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/footer_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,2CAcrE"}
1
+ {"version":3,"file":"footer_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/footer_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,2CAcrE"}
@@ -1,7 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { c as i } from "../../cell.module-WpHnQBVu.js";
3
- function a({ content: l, sticky: r, width: t }) {
4
- return /* @__PURE__ */ e("td", { className: i["table-cell"], "data-stick-to": r, children: /* @__PURE__ */ e(
2
+ import { c as o } from "../../cell.module-WpHnQBVu.js";
3
+ import { TD as i } from "@tcn/ui/layouts";
4
+ function p({ content: l, sticky: r, width: t }) {
5
+ return /* @__PURE__ */ e(i, { className: o["table-cell"], "data-stick-to": r, children: /* @__PURE__ */ e(
5
6
  "div",
6
7
  {
7
8
  style: {
@@ -14,6 +15,6 @@ function a({ content: l, sticky: r, width: t }) {
14
15
  ) });
15
16
  }
16
17
  export {
17
- a as FooterCell
18
+ p as FooterCell
18
19
  };
19
20
  //# sourceMappingURL=footer_cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"footer_cell.js","sources":["../../../src/components/cells/footer_cell.tsx"],"sourcesContent":["import React from 'react';\n\nimport cellStyles from './cell.module.css';\n\nexport type FooterCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n};\n\nexport function FooterCell({ content, sticky, width }: FooterCellProps) {\n return (\n <td className={cellStyles['table-cell']} data-stick-to={sticky}>\n <div\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n }}\n >\n {content}\n </div>\n </td>\n );\n}\n"],"names":["FooterCell","content","sticky","width","cellStyles","jsx"],"mappings":";;AAUO,SAASA,EAAW,EAAE,SAAAC,GAAS,QAAAC,GAAQ,OAAAC,KAA0B;AACtE,2BACG,MAAA,EAAG,WAAWC,EAAW,YAAY,GAAG,iBAAeF,GACtD,UAAA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO,GAAGF,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,MAAA;AAAA,MAGnB,UAAAF;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
1
+ {"version":3,"file":"footer_cell.js","sources":["../../../src/components/cells/footer_cell.tsx"],"sourcesContent":["import React from 'react';\n\nimport cellStyles from './cell.module.css';\nimport { TD } from '@tcn/ui/layouts';\n\nexport type FooterCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n};\n\nexport function FooterCell({ content, sticky, width }: FooterCellProps) {\n return (\n <TD className={cellStyles['table-cell']} data-stick-to={sticky}>\n <div\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n }}\n >\n {content}\n </div>\n </TD>\n );\n}\n"],"names":["FooterCell","content","sticky","width","TD","cellStyles","jsx"],"mappings":";;;AAWO,SAASA,EAAW,EAAE,SAAAC,GAAS,QAAAC,GAAQ,OAAAC,KAA0B;AACtE,2BACGC,GAAA,EAAG,WAAWC,EAAW,YAAY,GAAG,iBAAeH,GACtD,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO,GAAGH,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,MAAA;AAAA,MAGnB,UAAAF;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
@@ -1,13 +1,11 @@
1
1
  import { default as React } from 'react';
2
- export type HeaderCellProps = {
2
+ import { SortControlProps } from './sort_control.js';
3
+ export interface HeaderCellProps extends SortControlProps {
3
4
  heading: React.ReactNode;
4
5
  index: number;
5
6
  sticky?: 'start' | 'end';
6
7
  onResize?: (width: number) => void;
7
8
  width?: number;
8
- sortMode?: 'none' | 'asc' | 'desc';
9
- onSortModeChange?: () => void;
10
- canSort?: boolean;
11
- };
9
+ }
12
10
  export declare function HeaderCell({ heading, sticky, onResize, width, sortMode, onSortModeChange, canSort, }: HeaderCellProps): import("react/jsx-runtime").JSX.Element;
13
11
  //# sourceMappingURL=header_cell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"header_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/header_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,GACR,EAAE,eAAe,2CA+CjB"}
1
+ {"version":3,"file":"header_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/header_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGvE,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,OAAO,GACR,EAAE,eAAe,2CA2CjB"}
@@ -1,46 +1,58 @@
1
- import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
- import { useCallback as h } from "react";
3
- import { Box as o, HStack as x } from "@tcn/ui/stacks";
4
- import { TwoClassSortDownIcon as f } from "@tcn/icons/two_class_sort_down_icon.js";
5
- import { TwoClassSortFilledIcon as u } from "@tcn/icons/two_class_sort_filled_icon.js";
6
- import { TwoClassSortUpIcon as w } from "@tcn/icons/two_class_sort_up_icon.js";
7
- import { Button as C } from "@tcn/ui/actions";
8
- import { c as y } from "../../cell.module-WpHnQBVu.js";
9
- function j({
10
- heading: a,
11
- sticky: i,
12
- onResize: l,
13
- width: r,
14
- sortMode: n,
15
- onSortModeChange: s,
16
- canSort: c
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useCallback as x } from "react";
3
+ import { Box as r, HStack as h } from "@tcn/ui/stacks";
4
+ import { c as f } from "../../cell.module-WpHnQBVu.js";
5
+ import { SortControl as u } from "./sort_control.js";
6
+ import { TH as y } from "@tcn/ui/layouts";
7
+ function H({
8
+ heading: n,
9
+ sticky: l,
10
+ onResize: i,
11
+ width: o,
12
+ sortMode: s,
13
+ onSortModeChange: a,
14
+ canSort: d
17
15
  }) {
18
- const d = i != null ? 2 : 1, m = h(
19
- (e) => {
20
- l?.(Math.max(e, 20));
16
+ const m = l != null ? 2 : 1, p = x(
17
+ (t) => {
18
+ i?.(Math.max(t, 20));
21
19
  },
22
- [l]
20
+ [i]
23
21
  );
24
- return /* @__PURE__ */ t(
25
- "th",
22
+ return /* @__PURE__ */ e(
23
+ y,
26
24
  {
27
- className: y["table-cell"],
28
- "data-stick-to": i,
29
- style: { width: `${r}px`, zIndex: d },
30
- children: /* @__PURE__ */ t(
31
- o,
25
+ className: f["table-cell"],
26
+ "data-stick-to": l,
27
+ style: { width: `${o}px`, zIndex: m },
28
+ children: /* @__PURE__ */ e(
29
+ r,
32
30
  {
33
- padding: "4px 6px",
31
+ padding: "0px 8px",
34
32
  overflow: "hidden",
35
- minWidth: "20px",
33
+ minWidth: "24px",
36
34
  enableResizeOnEnd: !0,
37
- onWidthResize: m,
38
- style: { width: `${r}px`, minWidth: "20px" },
39
- onClick: (e) => e.stopPropagation(),
40
- height: "30px",
41
- children: /* @__PURE__ */ p(x, { children: [
42
- /* @__PURE__ */ t(o, { className: "ellipsis", style: { alignItems: "center", display: "flex" }, children: a }),
43
- /* @__PURE__ */ t(o, { width: "auto", height: "auto", children: c && /* @__PURE__ */ t(C, { onClick: () => s?.(), hierarchy: "tertiary", children: n === "asc" ? /* @__PURE__ */ t(f, {}) : n === "desc" ? /* @__PURE__ */ t(w, {}) : /* @__PURE__ */ t(u, {}) }) })
35
+ onWidthResize: p,
36
+ style: { width: `${o}px`, minWidth: "20px" },
37
+ onClick: (t) => t.stopPropagation(),
38
+ children: /* @__PURE__ */ c(h, { children: [
39
+ /* @__PURE__ */ e(
40
+ r,
41
+ {
42
+ minWidth: "24px",
43
+ className: "ellipsis",
44
+ style: { alignItems: "center", display: "flex" },
45
+ children: n
46
+ }
47
+ ),
48
+ /* @__PURE__ */ e(
49
+ u,
50
+ {
51
+ canSort: d,
52
+ onSortModeChange: a,
53
+ sortMode: s
54
+ }
55
+ )
44
56
  ] })
45
57
  }
46
58
  )
@@ -48,6 +60,6 @@ function j({
48
60
  );
49
61
  }
50
62
  export {
51
- j as HeaderCell
63
+ H as HeaderCell
52
64
  };
53
65
  //# sourceMappingURL=header_cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"header_cell.js","sources":["../../../src/components/cells/header_cell.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { Box, HStack } from '@tcn/ui/stacks';\n\nimport { TwoClassSortDownIcon } from '@tcn/icons/two_class_sort_down_icon.js';\nimport { TwoClassSortFilledIcon } from '@tcn/icons/two_class_sort_filled_icon.js';\nimport { TwoClassSortUpIcon } from '@tcn/icons/two_class_sort_up_icon.js';\nimport { Button } from '@tcn/ui/actions';\nimport cellStyles from './cell.module.css';\n\nexport type HeaderCellProps = {\n heading: React.ReactNode;\n index: number;\n sticky?: 'start' | 'end';\n onResize?: (width: number) => void;\n width?: number;\n sortMode?: 'none' | 'asc' | 'desc';\n onSortModeChange?: () => void;\n canSort?: boolean;\n};\n\nexport function HeaderCell({\n heading,\n sticky,\n onResize,\n width,\n sortMode,\n onSortModeChange,\n canSort,\n}: HeaderCellProps) {\n const zIndex = sticky != null ? 2 : 1;\n\n const handleResize = useCallback(\n (newSize: number) => {\n onResize?.(Math.max(newSize, 20));\n },\n [onResize]\n );\n\n return (\n <th\n className={cellStyles['table-cell']}\n data-stick-to={sticky}\n style={{ width: `${width}px`, zIndex }}\n >\n <Box\n padding=\"4px 6px\"\n overflow=\"hidden\"\n minWidth=\"20px\"\n enableResizeOnEnd\n onWidthResize={handleResize}\n style={{ width: `${width}px`, minWidth: '20px' }}\n onClick={e => e.stopPropagation()}\n height=\"30px\"\n >\n <HStack>\n <Box className=\"ellipsis\" style={{ alignItems: 'center', display: 'flex' }}>\n {heading}\n </Box>\n <Box width=\"auto\" height=\"auto\">\n {canSort && (\n <Button onClick={() => onSortModeChange?.()} hierarchy=\"tertiary\">\n {sortMode === 'asc' ? (\n <TwoClassSortDownIcon />\n ) : sortMode === 'desc' ? (\n <TwoClassSortUpIcon />\n ) : (\n <TwoClassSortFilledIcon />\n )}\n </Button>\n )}\n </Box>\n </HStack>\n </Box>\n </th>\n );\n}\n"],"names":["HeaderCell","heading","sticky","onResize","width","sortMode","onSortModeChange","canSort","zIndex","handleResize","useCallback","newSize","jsx","cellStyles","Box","HStack","Button","TwoClassSortDownIcon","TwoClassSortUpIcon","TwoClassSortFilledIcon"],"mappings":";;;;;;;;AAqBO,SAASA,EAAW;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AACF,GAAoB;AAClB,QAAMC,IAASN,KAAU,OAAO,IAAI,GAE9BO,IAAeC;AAAA,IACnB,CAACC,MAAoB;AACnB,MAAAR,IAAW,KAAK,IAAIQ,GAAS,EAAE,CAAC;AAAA,IAClC;AAAA,IACA,CAACR,CAAQ;AAAA,EAAA;AAGX,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,YAAY;AAAA,MAClC,iBAAeX;AAAA,MACf,OAAO,EAAE,OAAO,GAAGE,CAAK,MAAM,QAAAI,EAAA;AAAA,MAE9B,UAAA,gBAAAI;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,UAAS;AAAA,UACT,UAAS;AAAA,UACT,mBAAiB;AAAA,UACjB,eAAeL;AAAA,UACf,OAAO,EAAE,OAAO,GAAGL,CAAK,MAAM,UAAU,OAAA;AAAA,UACxC,SAAS,CAAA,MAAK,EAAE,gBAAA;AAAA,UAChB,QAAO;AAAA,UAEP,4BAACW,GAAA,EACC,UAAA;AAAA,YAAA,gBAAAH,EAACE,GAAA,EAAI,WAAU,YAAW,OAAO,EAAE,YAAY,UAAU,SAAS,OAAA,GAC/D,UAAAb,EAAA,CACH;AAAA,YACA,gBAAAW,EAACE,GAAA,EAAI,OAAM,QAAO,QAAO,QACtB,UAAAP,KACC,gBAAAK,EAACI,GAAA,EAAO,SAAS,MAAMV,IAAA,GAAsB,WAAU,YACpD,UAAAD,MAAa,QACZ,gBAAAO,EAACK,GAAA,CAAA,CAAqB,IACpBZ,MAAa,SACf,gBAAAO,EAACM,GAAA,CAAA,CAAmB,IAEpB,gBAAAN,EAACO,GAAA,CAAA,CAAuB,EAAA,CAE5B,EAAA,CAEJ;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"header_cell.js","sources":["../../../src/components/cells/header_cell.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { Box, HStack } from '@tcn/ui/stacks';\n\nimport cellStyles from './cell.module.css';\nimport { SortControl, type SortControlProps } from './sort_control.js';\nimport { TH } from '@tcn/ui/layouts';\n\nexport interface HeaderCellProps extends SortControlProps {\n heading: React.ReactNode;\n index: number;\n sticky?: 'start' | 'end';\n onResize?: (width: number) => void;\n width?: number;\n}\n\nexport function HeaderCell({\n heading,\n sticky,\n onResize,\n width,\n sortMode,\n onSortModeChange,\n canSort,\n}: HeaderCellProps) {\n const zIndex = sticky != null ? 2 : 1;\n\n const handleResize = useCallback(\n (newSize: number) => {\n onResize?.(Math.max(newSize, 20));\n },\n [onResize]\n );\n\n return (\n <TH\n className={cellStyles['table-cell']}\n data-stick-to={sticky}\n style={{ width: `${width}px`, zIndex }}\n >\n <Box\n padding=\"0px 8px\" // FIXME: should be on theme ideally.\n overflow=\"hidden\"\n minWidth=\"24px\"\n enableResizeOnEnd\n onWidthResize={handleResize}\n style={{ width: `${width}px`, minWidth: '20px' }}\n onClick={e => e.stopPropagation()}\n >\n <HStack>\n <Box\n minWidth=\"24px\"\n className=\"ellipsis\"\n style={{ alignItems: 'center', display: 'flex' }}\n >\n {heading}\n </Box>\n\n <SortControl\n canSort={canSort}\n onSortModeChange={onSortModeChange}\n sortMode={sortMode}\n />\n </HStack>\n </Box>\n </TH>\n );\n}\n"],"names":["HeaderCell","heading","sticky","onResize","width","sortMode","onSortModeChange","canSort","zIndex","handleResize","useCallback","newSize","jsx","TH","cellStyles","Box","e","HStack","SortControl"],"mappings":";;;;;;AAgBO,SAASA,EAAW;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AACF,GAAoB;AAClB,QAAMC,IAASN,KAAU,OAAO,IAAI,GAE9BO,IAAeC;AAAA,IACnB,CAACC,MAAoB;AACnB,MAAAR,IAAW,KAAK,IAAIQ,GAAS,EAAE,CAAC;AAAA,IAClC;AAAA,IACA,CAACR,CAAQ;AAAA,EAAA;AAGX,SACE,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,YAAY;AAAA,MAClC,iBAAeZ;AAAA,MACf,OAAO,EAAE,OAAO,GAAGE,CAAK,MAAM,QAAAI,EAAA;AAAA,MAE9B,UAAA,gBAAAI;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,UAAS;AAAA,UACT,UAAS;AAAA,UACT,mBAAiB;AAAA,UACjB,eAAeN;AAAA,UACf,OAAO,EAAE,OAAO,GAAGL,CAAK,MAAM,UAAU,OAAA;AAAA,UACxC,SAAS,CAAAY,MAAKA,EAAE,gBAAA;AAAA,UAEhB,4BAACC,GAAA,EACC,UAAA;AAAA,YAAA,gBAAAL;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,WAAU;AAAA,gBACV,OAAO,EAAE,YAAY,UAAU,SAAS,OAAA;AAAA,gBAEvC,UAAAd;AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,gBAAAW;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,SAAAX;AAAA,gBACA,kBAAAD;AAAA,gBACA,UAAAD;AAAA,cAAA;AAAA,YAAA;AAAA,UACF,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,8 @@
1
+ export type SortMode = 'asc' | 'desc' | 'none';
2
+ export interface SortControlProps {
3
+ canSort?: boolean;
4
+ onSortModeChange?: () => void;
5
+ sortMode?: SortMode;
6
+ }
7
+ export declare const SortControl: ({ canSort, onSortModeChange, sortMode, }: SortControlProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ //# sourceMappingURL=sort_control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort_control.d.ts","sourceRoot":"","sources":["../../../src/components/cells/sort_control.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAQD,eAAO,MAAM,WAAW,GAAI,0CAIzB,gBAAgB,mDAgBlB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as e } from "react";
3
+ import { Box as l } from "@tcn/ui/stacks";
4
+ import { TwoClassSortDownIcon as s } from "@tcn/icons/two_class_sort_down_icon.js";
5
+ import { TwoClassSortFilledIcon as m } from "@tcn/icons/two_class_sort_filled_icon.js";
6
+ import { TwoClassSortUpIcon as a } from "@tcn/icons/two_class_sort_up_icon.js";
7
+ import { Button as p } from "@tcn/ui/actions";
8
+ const u = {
9
+ asc: s,
10
+ desc: a,
11
+ none: m
12
+ }, x = ({
13
+ canSort: t,
14
+ onSortModeChange: r,
15
+ sortMode: n = "none"
16
+ }) => {
17
+ const i = e(() => {
18
+ r?.();
19
+ }, [r]);
20
+ if (!t) return null;
21
+ const c = u[n];
22
+ return /* @__PURE__ */ o(l, { width: "auto", height: "auto", children: /* @__PURE__ */ o(p, { utility: !0, onClick: i, hierarchy: "tertiary", children: /* @__PURE__ */ o(c, {}) }) });
23
+ };
24
+ export {
25
+ x as SortControl
26
+ };
27
+ //# sourceMappingURL=sort_control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort_control.js","sources":["../../../src/components/cells/sort_control.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { Box } from '@tcn/ui/stacks';\n\nimport { TwoClassSortDownIcon } from '@tcn/icons/two_class_sort_down_icon.js';\nimport { TwoClassSortFilledIcon } from '@tcn/icons/two_class_sort_filled_icon.js';\nimport { TwoClassSortUpIcon } from '@tcn/icons/two_class_sort_up_icon.js';\nimport { Button } from '@tcn/ui/actions';\n\nexport type SortMode = 'asc' | 'desc' | 'none';\n\nexport interface SortControlProps {\n canSort?: boolean;\n onSortModeChange?: () => void;\n sortMode?: SortMode;\n}\n\nconst sortIconMap: Record<SortMode, React.ComponentType<any>> = {\n asc: TwoClassSortDownIcon,\n desc: TwoClassSortUpIcon,\n none: TwoClassSortFilledIcon,\n};\n\nexport const SortControl = ({\n canSort,\n onSortModeChange,\n sortMode = 'none',\n}: SortControlProps) => {\n const handleSortModeChange = useCallback(() => {\n onSortModeChange?.();\n }, [onSortModeChange]);\n\n if (!canSort) return null;\n\n const SortIcon = sortIconMap[sortMode];\n\n return (\n <Box width=\"auto\" height=\"auto\">\n <Button utility onClick={handleSortModeChange} hierarchy=\"tertiary\">\n <SortIcon />\n </Button>\n </Box>\n );\n};\n"],"names":["sortIconMap","TwoClassSortDownIcon","TwoClassSortUpIcon","TwoClassSortFilledIcon","SortControl","canSort","onSortModeChange","sortMode","handleSortModeChange","useCallback","SortIcon","Box","jsx","Button"],"mappings":";;;;;;;AAiBA,MAAMA,IAA0D;AAAA,EAC9D,KAAKC;AAAA,EACL,MAAMC;AAAA,EACN,MAAMC;AACR,GAEaC,IAAc,CAAC;AAAA,EAC1B,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAwB;AACtB,QAAMC,IAAuBC,EAAY,MAAM;AAC7C,IAAAH,IAAA;AAAA,EACF,GAAG,CAACA,CAAgB,CAAC;AAErB,MAAI,CAACD,EAAS,QAAO;AAErB,QAAMK,IAAWV,EAAYO,CAAQ;AAErC,2BACGI,GAAA,EAAI,OAAM,QAAO,QAAO,QACvB,UAAA,gBAAAC,EAACC,GAAA,EAAO,SAAO,IAAC,SAASL,GAAsB,WAAU,YACvD,UAAA,gBAAAI,EAACF,GAAA,CAAA,CAAS,GACZ,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sticky_row_data_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/sticky_row_data_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,KAAK,EACL,GAAG,GACJ,EAAE,sBAAsB,2CAexB"}
1
+ {"version":3,"file":"sticky_row_data_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/sticky_row_data_cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,KAAK,EACL,GAAG,GACJ,EAAE,sBAAsB,2CAexB"}
@@ -1,27 +1,28 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { c as o } from "../../cell.module-WpHnQBVu.js";
3
- function p({
4
- content: e,
5
- sticky: i,
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { c as e } from "../../cell.module-WpHnQBVu.js";
3
+ import { TD as c } from "@tcn/ui/layouts";
4
+ function s({
5
+ content: l,
6
+ sticky: o,
6
7
  width: t,
7
- top: c
8
+ top: r
8
9
  }) {
9
- return /* @__PURE__ */ l(
10
- "td",
10
+ return /* @__PURE__ */ i(
11
+ c,
11
12
  {
12
- className: o["sticky-row-table-cell"],
13
- "data-stick-to": i,
13
+ className: e["sticky-row-table-cell"],
14
+ "data-stick-to": o,
14
15
  style: {
15
16
  width: `${t}px`,
16
17
  minWidth: `${t}px`,
17
18
  maxWidth: `${t}px`,
18
- top: `${c}px`
19
+ top: `${r}px`
19
20
  },
20
- children: /* @__PURE__ */ l("div", { children: e })
21
+ children: /* @__PURE__ */ i("div", { children: l })
21
22
  }
22
23
  );
23
24
  }
24
25
  export {
25
- p as StickyRowDataCell
26
+ s as StickyRowDataCell
26
27
  };
27
28
  //# sourceMappingURL=sticky_row_data_cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sticky_row_data_cell.js","sources":["../../../src/components/cells/sticky_row_data_cell.tsx"],"sourcesContent":["import React from 'react';\nimport cellStyles from './cell.module.css';\n\nexport type StickyRowDataCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n top?: number;\n};\n\nexport function StickyRowDataCell({\n content,\n sticky,\n width,\n top,\n}: StickyRowDataCellProps) {\n return (\n <td\n className={cellStyles['sticky-row-table-cell']}\n data-stick-to={sticky}\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n top: `${top}px`,\n }}\n >\n <div>{content}</div>\n </td>\n );\n}\n"],"names":["StickyRowDataCell","content","sticky","width","top","jsx","cellStyles"],"mappings":";;AAUO,SAASA,EAAkB;AAAA,EAChC,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,KAAAC;AACF,GAA2B;AACzB,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuB;AAAA,MAC7C,iBAAeJ;AAAA,MACf,OAAO;AAAA,QACL,OAAO,GAAGC,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,QAClB,KAAK,GAAGC,CAAG;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAC,EAAC,SAAK,UAAAJ,EAAA,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
1
+ {"version":3,"file":"sticky_row_data_cell.js","sources":["../../../src/components/cells/sticky_row_data_cell.tsx"],"sourcesContent":["import React from 'react';\nimport cellStyles from './cell.module.css';\nimport { TD } from '@tcn/ui/layouts';\n\nexport type StickyRowDataCellProps = {\n content: React.ReactNode;\n sticky?: 'start' | 'end';\n width?: number;\n top?: number;\n};\n\nexport function StickyRowDataCell({\n content,\n sticky,\n width,\n top,\n}: StickyRowDataCellProps) {\n return (\n <TD\n className={cellStyles['sticky-row-table-cell']}\n data-stick-to={sticky}\n style={{\n width: `${width}px`,\n minWidth: `${width}px`,\n maxWidth: `${width}px`,\n top: `${top}px`,\n }}\n >\n <div>{content}</div>\n </TD>\n );\n}\n"],"names":["StickyRowDataCell","content","sticky","width","top","jsx","TD","cellStyles"],"mappings":";;;AAWO,SAASA,EAAkB;AAAA,EAChC,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,KAAAC;AACF,GAA2B;AACzB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuB;AAAA,MAC7C,iBAAeL;AAAA,MACf,OAAO;AAAA,QACL,OAAO,GAAGC,CAAK;AAAA,QACf,UAAU,GAAGA,CAAK;AAAA,QAClB,UAAU,GAAGA,CAAK;AAAA,QAClB,KAAK,GAAGC,CAAG;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAC,EAAC,SAAK,UAAAJ,EAAA,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sticky_row_fill_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/sticky_row_fill_cell.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,GAAG,EAAE,EAAE,sBAAsB,2CAQhE"}
1
+ {"version":3,"file":"sticky_row_fill_cell.d.ts","sourceRoot":"","sources":["../../../src/components/cells/sticky_row_fill_cell.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,GAAG,EAAE,EAAE,sBAAsB,2CAQhE"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { c as o } from "../../cell.module-WpHnQBVu.js";
3
- function s({ top: t }) {
3
+ import { TD as r } from "@tcn/ui/layouts";
4
+ function i({ top: t }) {
4
5
  return /* @__PURE__ */ l(
5
- "td",
6
+ r,
6
7
  {
7
8
  className: o["sticky-row-table-cell"],
8
9
  "data-stick-to": "start",
@@ -11,6 +12,6 @@ function s({ top: t }) {
11
12
  );
12
13
  }
13
14
  export {
14
- s as StickyRowFillCell
15
+ i as StickyRowFillCell
15
16
  };
16
17
  //# sourceMappingURL=sticky_row_fill_cell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sticky_row_fill_cell.js","sources":["../../../src/components/cells/sticky_row_fill_cell.tsx"],"sourcesContent":["import React from 'react';\nimport cellStyles from './cell.module.css';\n\nexport type StyckyRowFillCellProps = {\n top?: number;\n};\n\nexport function StickyRowFillCell({ top }: StyckyRowFillCellProps) {\n return (\n <td\n className={cellStyles['sticky-row-table-cell']}\n data-stick-to=\"start\"\n style={{ top: `${top}px` }}\n ></td>\n );\n}\n"],"names":["StickyRowFillCell","top","jsx","cellStyles"],"mappings":";;AAOO,SAASA,EAAkB,EAAE,KAAAC,KAA+B;AACjE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuB;AAAA,MAC7C,iBAAc;AAAA,MACd,OAAO,EAAE,KAAK,GAAGF,CAAG,KAAA;AAAA,IAAK;AAAA,EAAA;AAG/B;"}
1
+ {"version":3,"file":"sticky_row_fill_cell.js","sources":["../../../src/components/cells/sticky_row_fill_cell.tsx"],"sourcesContent":["import React from 'react';\nimport cellStyles from './cell.module.css';\nimport { TD } from '@tcn/ui/layouts';\n\nexport type StyckyRowFillCellProps = {\n top?: number;\n};\n\nexport function StickyRowFillCell({ top }: StyckyRowFillCellProps) {\n return (\n <TD\n className={cellStyles['sticky-row-table-cell']}\n data-stick-to=\"start\"\n style={{ top: `${top}px` }}\n ></TD>\n );\n}\n"],"names":["StickyRowFillCell","top","jsx","TD","cellStyles"],"mappings":";;;AAQO,SAASA,EAAkB,EAAE,KAAAC,KAA+B;AACjE,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuB;AAAA,MAC7C,iBAAc;AAAA,MACd,OAAO,EAAE,KAAK,GAAGH,CAAG,KAAA;AAAA,IAAK;AAAA,EAAA;AAG/B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAkB,YAAY,EAAoB,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAO,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAQ/C,OAAO,EAAe,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGlE,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;CACnB,CAAC;AAaF,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACvB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,KAAc,EACd,MAAe,EACf,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,GAAG,KAAK,EACT,EAAE,UAAU,CAAC,CAAC,CAAC,2CA0If"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAkB,YAAY,EAAoB,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAO,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAQ/C,OAAO,EAAe,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAWlE,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;CACnB,CAAC;AAeF,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACvB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,KAAc,EACd,MAAe,EACf,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,GAAG,KAAK,EACT,EAAE,UAAU,CAAC,CAAC,CAAC,2CA2If"}
@@ -1,36 +1,37 @@
1
1
  import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
- import F, { useRef as H, isValidElement as P, useState as W } from "react";
3
- import { useSignalValue as c, useRunnerStatus as j, Status as y } from "@tcn/state";
4
- import { Box as A } from "@tcn/ui/stacks";
5
- import { BodyText as G } from "@tcn/ui/typography";
6
- import { DataCell as I } from "../cells/data_cell.js";
7
- import { FooterCell as O } from "../cells/footer_cell.js";
8
- import { HeaderCell as V } from "../cells/header_cell.js";
9
- import { StickyRowDataCell as v } from "../cells/sticky_row_data_cell.js";
10
- import { StickyRowFillCell as z } from "../cells/sticky_row_fill_cell.js";
11
- import { TableColumn as L } from "./table_column.js";
12
- import { TablePresenter as U } from "./table_presenter.js";
13
- import '../../table.css';const q = "_table-body-wrapper_55f7034", J = "_table-body_b8c928c", w = { "table-body-wrapper": q, "table-body": J }, k = 30;
14
- function N(s) {
15
- return typeof s == "string" ? /* @__PURE__ */ r(G, { children: s }) : s;
2
+ import G, { useRef as P, isValidElement as W, useState as j } from "react";
3
+ import { useSignalValue as f, useRunnerStatus as A, Status as u } from "@tcn/state";
4
+ import { Box as I } from "@tcn/ui/stacks";
5
+ import { BodyText as V } from "@tcn/ui/typography";
6
+ import { DataCell as v } from "../cells/data_cell.js";
7
+ import { FooterCell as z } from "../cells/footer_cell.js";
8
+ import { HeaderCell as L } from "../cells/header_cell.js";
9
+ import { StickyRowDataCell as U } from "../cells/sticky_row_data_cell.js";
10
+ import { StickyRowFillCell as Y } from "../cells/sticky_row_fill_cell.js";
11
+ import { TableColumn as q } from "./table_column.js";
12
+ import { TablePresenter as J } from "./table_presenter.js";
13
+ import { TTable as K, THead as Q, TR as n, TH as X, TBody as Z, TD as N, TFoot as x } from "@tcn/ui/layouts";
14
+ import '../../table.css';const tt = "_table-body_b8c928c", w = { "table-body": tt }, C = 32, R = 24;
15
+ function T(s) {
16
+ return typeof s == "string" ? /* @__PURE__ */ r(V, { children: s }) : s;
16
17
  }
17
- function it({
18
+ function yt({
18
19
  dataSource: s,
19
- stickyItems: S,
20
- children: C,
21
- width: g = "100%",
22
- height: R = "100%",
23
- zIndex: $,
24
- isRowHighlighted: E,
25
- onRowClick: b,
20
+ stickyItems: g,
21
+ children: $,
22
+ width: E = "100%",
23
+ height: H = "100%",
24
+ zIndex: D,
25
+ isRowHighlighted: b,
26
+ onRowClick: k,
26
27
  ..._
27
28
  }) {
28
- const M = c(s.broadcasts.currentResults), p = c(s.broadcasts.currentPageIndex), u = H(null), T = F.Children.toArray(C).filter(
29
- (t) => P(t) && t.type === L
30
- ), [n] = W(
31
- () => new U({
29
+ const B = f(s.broadcasts.currentResults), p = f(s.broadcasts.currentPageIndex), S = P(null), F = G.Children.toArray($).filter(
30
+ (t) => W(t) && t.type === q
31
+ ), [c] = j(
32
+ () => new J({
32
33
  dataSource: s,
33
- columns: T.map((t) => ({
34
+ columns: F.map((t) => ({
34
35
  fieldName: t.props.fieldName,
35
36
  width: t.props.width ?? 100,
36
37
  sortMode: "none",
@@ -40,96 +41,97 @@ function it({
40
41
  sticky: t.props.sticky,
41
42
  render: t.props.render
42
43
  })),
43
- scrollerRef: u
44
+ scrollerRef: S
44
45
  })
45
- ), d = c(n.broadcasts.columnInfo), f = j(s.broadcasts.currentResults), B = c(n.broadcasts.showFooter), D = typeof b == "function";
46
+ ), d = f(c.broadcasts.columnInfo), m = A(s.broadcasts.currentResults), M = f(c.broadcasts.showFooter), O = typeof k == "function";
46
47
  return /* @__PURE__ */ r(
47
- A,
48
+ I,
48
49
  {
49
- ref: u,
50
- zIndex: $,
50
+ ref: S,
51
+ zIndex: D,
51
52
  className: w["table-body-wrapper"],
52
53
  style: { overflow: "auto" },
53
54
  ..._,
54
55
  children: /* @__PURE__ */ a(
55
- "table",
56
+ K,
56
57
  {
57
58
  className: w["table-body"],
58
- "data-is-clickable": D,
59
- style: { width: g, height: R },
59
+ "data-is-clickable": O,
60
+ style: { width: E, height: H },
60
61
  children: [
61
- /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ a("tr", { children: [
62
+ /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ a(n, { children: [
62
63
  d.map((t, e) => /* @__PURE__ */ r(
63
- V,
64
+ L,
64
65
  {
65
66
  index: e,
66
- heading: N(t.heading),
67
+ heading: T(t.heading),
67
68
  sticky: t.sticky,
68
- onResize: (o) => n.setColumnWidth(e, o),
69
+ onResize: (o) => c.setColumnWidth(e, o),
69
70
  width: t.width,
70
71
  sortMode: t.sortMode,
71
- onSortModeChange: () => n.setNextColumnSortMode(e),
72
+ onSortModeChange: () => c.setNextColumnSortMode(e),
72
73
  canSort: t.canSort
73
74
  },
74
75
  `h-${e}`
75
76
  )),
76
- /* @__PURE__ */ r("th", { className: "fill" }, "fill")
77
+ /* @__PURE__ */ r(X, { fill: !0, className: "fill" }, "fill")
77
78
  ] }) }),
78
- /* @__PURE__ */ a("tbody", { children: [
79
- S?.map((t, e) => /* @__PURE__ */ a("tr", { "data-sticky-row": !0, children: [
80
- d.map((o, m) => {
79
+ /* @__PURE__ */ a(Z, { children: [
80
+ g?.map((t, e) => /* @__PURE__ */ a(n, { "data-sticky-row": !0, children: [
81
+ d.map((o, y) => {
81
82
  const i = o.fieldName, l = o.render, h = l ? l(t) : i ? String(t[i] ?? "") : "";
82
83
  return /* @__PURE__ */ r(
83
- v,
84
+ U,
84
85
  {
85
86
  content: h,
86
87
  sticky: o.sticky,
87
88
  width: o.width,
88
- top: k * (e + 1)
89
+ top: C + R * e
89
90
  },
90
- `${p}-${e}-${m}`
91
+ `${p}-${e}-${y}`
91
92
  );
92
93
  }),
93
- /* @__PURE__ */ r(z, { top: k * (e + 1) + 1 })
94
+ /* @__PURE__ */ r(Y, { top: C + R * e })
94
95
  ] }, `sticky-${e}`)),
95
- f === y.SUCCESS && M.map((t, e) => /* @__PURE__ */ a(
96
- "tr",
96
+ m === u.SUCCESS && B.map((t, e) => /* @__PURE__ */ a(
97
+ n,
97
98
  {
98
- "data-selected": E?.(t, e),
99
- onClick: () => b?.(t, e),
99
+ "data-selected": b?.(t, e),
100
+ isSelected: b?.(t, e),
101
+ onClick: () => k?.(t, e),
100
102
  children: [
101
- d.map((o, m) => {
103
+ d.map((o, y) => {
102
104
  const i = o.fieldName, l = o.render, h = l ? l(t) : i ? String(t[i] ?? "") : "";
103
105
  return /* @__PURE__ */ r(
104
- I,
106
+ v,
105
107
  {
106
108
  content: h,
107
109
  sticky: o.sticky,
108
110
  width: o.width
109
111
  },
110
- `${p}-${e}-${m}`
112
+ `${p}-${e}-${y}`
111
113
  );
112
114
  }),
113
- /* @__PURE__ */ r("td", { className: "fill" }, "fill")
115
+ /* @__PURE__ */ r(N, { fill: !0, className: "fill" }, "fill")
114
116
  ]
115
117
  },
116
118
  `${p}-${e}`
117
119
  )),
118
- f === y.PENDING && "Loading...",
119
- f === y.ERROR && "Error loading data",
120
- /* @__PURE__ */ r("tr", { className: "fill" }, "fill")
120
+ m === u.PENDING && "Loading...",
121
+ m === u.ERROR && "Error loading data",
122
+ /* @__PURE__ */ r(n, { className: "fill" }, "fill")
121
123
  ] }),
122
- B && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ a("tr", { children: [
124
+ M && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ a(n, { children: [
123
125
  d.map((t, e) => /* @__PURE__ */ r(
124
- O,
126
+ z,
125
127
  {
126
- content: N(t.footer),
128
+ content: T(t.footer),
127
129
  sticky: t.sticky,
128
130
  width: t.width
129
131
  },
130
132
  `footer-${e}`
131
133
  )),
132
- /* @__PURE__ */ r("td", { className: "fill" }, "footer-fill")
134
+ /* @__PURE__ */ r(N, { fill: !0, className: "fill" }, "footer-fill")
133
135
  ] }) })
134
136
  ]
135
137
  }
@@ -138,6 +140,6 @@ function it({
138
140
  );
139
141
  }
140
142
  export {
141
- it as Table
143
+ yt as Table
142
144
  };
143
145
  //# sourceMappingURL=table.js.map