@1771technologies/lytenyte-pro 1.0.12 → 1.0.13

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 (57) hide show
  1. package/dist/+types.d.ts +21 -2
  2. package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +3 -0
  3. package/dist/__play__/grid-navigation/cell-spans-large.play.js +26 -0
  4. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +3 -0
  5. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +27 -0
  6. package/dist/__play__/grid-navigation/cell-spans.play.d.ts +3 -0
  7. package/dist/__play__/grid-navigation/cell-spans.play.js +52 -0
  8. package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +3 -0
  9. package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +47 -0
  10. package/dist/__play__/grid-navigation/column-groups.play.d.ts +3 -0
  11. package/dist/__play__/grid-navigation/column-groups.play.js +24 -0
  12. package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +6 -0
  13. package/dist/__play__/grid-navigation/full-width-rows.play.js +67 -0
  14. package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +1 -0
  15. package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +877 -0
  16. package/dist/__play__/grid-navigation/normal-layout.play.d.ts +10 -0
  17. package/dist/__play__/grid-navigation/normal-layout.play.js +72 -0
  18. package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +3 -0
  19. package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +11 -0
  20. package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +6 -0
  21. package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +79 -0
  22. package/dist/__play__/grid-navigation/row-detail.play.d.ts +6 -0
  23. package/dist/__play__/grid-navigation/row-detail.play.js +78 -0
  24. package/dist/__play__/grid-navigation/row-detail.pt.d.ts +1 -0
  25. package/dist/__play__/grid-navigation/row-detail.pt.js +68 -0
  26. package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +1 -0
  27. package/dist/__play__/grid-navigation/vertical-navigation.pt.js +176 -0
  28. package/dist/__play__/test-utils/bank-data-smaller.d.ts +19 -0
  29. package/dist/__play__/test-utils/bank-data-smaller.js +252 -0
  30. package/dist/__play__/test-utils/row-handler.d.ts +6 -0
  31. package/dist/__play__/test-utils/row-handler.js +33 -0
  32. package/dist/cells/+types.cell.d.ts +1 -1
  33. package/dist/cells/cell-default.d.ts +1 -1
  34. package/dist/cells/cell-editor.js +19 -12
  35. package/dist/cells/cell-spacer.js +9 -4
  36. package/dist/cells/cell.js +4 -3
  37. package/dist/context.d.ts +3 -3
  38. package/dist/header/use-header-cell-renderer.js +1 -0
  39. package/dist/icons/index.js +1 -3
  40. package/dist/root/root.js +39 -56
  41. package/dist/rows/row/context.d.ts +2 -1
  42. package/dist/rows/row/context.js +1 -0
  43. package/dist/rows/row/row.d.ts +1 -1
  44. package/dist/rows/row/row.js +1 -1
  45. package/dist/rows/row/use-row-context-value.d.ts +2 -2
  46. package/dist/rows/row/use-row-context-value.js +3 -2
  47. package/dist/rows/row-detail-row.js +4 -87
  48. package/dist/rows/row-full-width.js +1 -1
  49. package/dist/state/api/cell-root.js +4 -3
  50. package/dist/state/api/focus-cell.d.ts +1 -1
  51. package/dist/state/api/focus-cell.js +19 -12
  52. package/dist/state/helpers/column-marker.js +2 -0
  53. package/dist/state/helpers/get-span-callback.js +1 -1
  54. package/dist/state/helpers/row-layout/row-layout.js +8 -28
  55. package/dist/state/use-lytenyte.js +3 -1
  56. package/dist/viewport/viewport.js +22 -15
  57. package/package.json +7 -7
package/dist/+types.d.ts CHANGED
@@ -2650,7 +2650,7 @@ export interface FieldFnParams<T> {
2650
2650
  *
2651
2651
  * Example: `"point.x"` will return `data.point.x`. Useful for deeply nested row data.
2652
2652
  *
2653
- * @group field
2653
+ * @group Field
2654
2654
  */
2655
2655
  export interface FieldPath {
2656
2656
  /**
@@ -4715,6 +4715,25 @@ export interface OnEditErrorParams<T> {
4715
4715
  */
4716
4716
  readonly error?: unknown;
4717
4717
  }
4718
+ /**
4719
+ * The position value type when the current focus position of the grid is within a detail cell.
4720
+ *
4721
+ * @group Navigation
4722
+ */
4723
+ export interface PositionDetailCell {
4724
+ /**
4725
+ * Discriminant indicating this position refers to a detail cell.
4726
+ */
4727
+ readonly kind: "detail";
4728
+ /**
4729
+ * The zero-based index of the row.
4730
+ */
4731
+ readonly rowIndex: number;
4732
+ /**
4733
+ * The zero-based index of the column.
4734
+ */
4735
+ readonly colIndex: number;
4736
+ }
4718
4737
  /**
4719
4738
  * Describes the focus position of a floating header cell.
4720
4739
  *
@@ -4843,7 +4862,7 @@ export interface PositionHeaderGroupCell {
4843
4862
  *
4844
4863
  * @group Navigation
4845
4864
  */
4846
- export type PositionUnion = PositionGridCell | PositionFloatingCell | PositionHeaderCell | PositionFullWidthRow | PositionHeaderGroupCell;
4865
+ export type PositionUnion = PositionGridCell | PositionFloatingCell | PositionHeaderCell | PositionDetailCell | PositionFullWidthRow | PositionHeaderGroupCell;
4847
4866
  /**
4848
4867
  * Specifies the height of the row detail section.
4849
4868
  * Can be a fixed number of pixels or "auto" to size based on content.
@@ -0,0 +1,3 @@
1
+ export default function CellSpansLarge({ rtl }: {
2
+ rtl?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import NormalLayout from "./normal-layout.play.js";
3
+ const columns = [
4
+ {
5
+ id: "age",
6
+ colSpan: (c) => {
7
+ return c.rowIndex === 0 ? 10 : 1;
8
+ },
9
+ },
10
+ { id: "marital" },
11
+ { id: "default" },
12
+ { id: "housing", colSpan: 2 },
13
+ { id: "loan" },
14
+ { id: "contact" },
15
+ { id: "day" },
16
+ { id: "month" },
17
+ { id: "duration" },
18
+ { id: "campaign" },
19
+ { id: "pdays" },
20
+ { id: "previous" },
21
+ { id: "poutcome", colSpan: 2 },
22
+ { id: "y" },
23
+ ];
24
+ export default function CellSpansLarge({ rtl }) {
25
+ return _jsx(NormalLayout, { columns: columns, rtl: rtl });
26
+ }
@@ -0,0 +1,3 @@
1
+ export default function CellSpansWithPins({ rtl }: {
2
+ rtl?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import NormalLayout from "./normal-layout.play.js";
3
+ const columns = [
4
+ {
5
+ id: "age",
6
+ pin: "start",
7
+ colSpan: (c) => {
8
+ return c.rowIndex === 0 ? 10 : 1;
9
+ },
10
+ },
11
+ { id: "marital", pin: "start" },
12
+ { id: "default" },
13
+ { id: "housing", colSpan: 2 },
14
+ { id: "loan" },
15
+ { id: "contact", pin: "end" },
16
+ { id: "day", pin: "end" },
17
+ { id: "month" },
18
+ { id: "duration" },
19
+ { id: "campaign" },
20
+ { id: "pdays" },
21
+ { id: "previous" },
22
+ { id: "poutcome", colSpan: 2 },
23
+ { id: "y" },
24
+ ];
25
+ export default function CellSpansWithPins({ rtl }) {
26
+ return _jsx(NormalLayout, { columns: columns, rtl: rtl });
27
+ }
@@ -0,0 +1,3 @@
1
+ export default function CellSpans({ rtl }: {
2
+ rtl?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import NormalLayout from "./normal-layout.play.js";
3
+ const columns = [
4
+ {
5
+ id: "age",
6
+ colSpan: (c) => {
7
+ return c.rowIndex === 0 || c.rowIndex === 12 ? 3 : 1;
8
+ },
9
+ },
10
+ {
11
+ id: "job",
12
+ colSpan: (c) => {
13
+ return c.rowIndex === 2 ? 3 : 1;
14
+ },
15
+ },
16
+ { id: "balance" },
17
+ {
18
+ id: "education",
19
+ colSpan: (t) => {
20
+ if (t.rowIndex === 4)
21
+ return 2;
22
+ if (t.rowIndex === 12)
23
+ return 2;
24
+ return 1;
25
+ },
26
+ rowSpan: (t) => {
27
+ if (t.rowIndex === 4)
28
+ return 3;
29
+ if (t.rowIndex === 8)
30
+ return 3;
31
+ if (t.rowIndex === 12)
32
+ return 2;
33
+ return 1;
34
+ },
35
+ },
36
+ { id: "marital" },
37
+ { id: "default" },
38
+ { id: "housing", colSpan: 2 },
39
+ { id: "loan" },
40
+ { id: "contact" },
41
+ { id: "day" },
42
+ { id: "month" },
43
+ { id: "duration" },
44
+ { id: "campaign" },
45
+ { id: "pdays" },
46
+ { id: "previous" },
47
+ { id: "poutcome", colSpan: 2 },
48
+ { id: "y" },
49
+ ];
50
+ export default function CellSpans({ rtl }) {
51
+ return _jsx(NormalLayout, { columns: columns, rtl: rtl });
52
+ }
@@ -0,0 +1,3 @@
1
+ export default function CellWithTabbables({ rtl }: {
2
+ rtl?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import NormalLayout from "./normal-layout.play.js";
3
+ const columns = [
4
+ {
5
+ id: "age",
6
+ colSpan: (c) => {
7
+ return c.rowIndex === 0 || c.rowIndex === 12 ? 3 : 1;
8
+ },
9
+ cellRenderer: () => {
10
+ return (_jsxs(_Fragment, { children: [_jsx("button", { tabIndex: 0, children: "A" }), _jsx("button", { tabIndex: 0, children: "B" }), _jsx("button", { tabIndex: 0, children: "C" })] }));
11
+ },
12
+ },
13
+ {
14
+ id: "job",
15
+ colSpan: (c) => {
16
+ return c.rowIndex === 2 ? 3 : 1;
17
+ },
18
+ },
19
+ { id: "balance" },
20
+ {
21
+ id: "education",
22
+ colSpan: (t) => {
23
+ if (t.rowIndex === 4)
24
+ return 2;
25
+ if (t.rowIndex === 12)
26
+ return 2;
27
+ return 1;
28
+ },
29
+ cellRenderer: () => {
30
+ return (_jsxs(_Fragment, { children: [_jsx("button", { tabIndex: 0, children: "Prev" }), _jsx("button", { tabIndex: -1, children: "Not Tabbable" }), _jsx("button", { tabIndex: 0, children: "Next" })] }));
31
+ },
32
+ rowSpan: (t) => {
33
+ if (t.rowIndex === 4)
34
+ return 3;
35
+ if (t.rowIndex === 8)
36
+ return 3;
37
+ if (t.rowIndex === 12)
38
+ return 2;
39
+ return 1;
40
+ },
41
+ },
42
+ { id: "marital" },
43
+ { id: "default" },
44
+ ];
45
+ export default function CellWithTabbables({ rtl }) {
46
+ return _jsx(NormalLayout, { columns: columns, rtl: rtl });
47
+ }
@@ -0,0 +1,3 @@
1
+ export default function ColumnGroups({ rtl }: {
2
+ rtl?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import NormalLayout from "./normal-layout.play.js";
3
+ const columns = [
4
+ {
5
+ id: "age",
6
+ groupPath: ["A", "B"],
7
+ },
8
+ { id: "marital", groupPath: ["A"] },
9
+ { id: "default", groupPath: ["T"] },
10
+ { id: "housing" },
11
+ { id: "loan" },
12
+ { id: "contact", groupPath: ["A", "B", "C"] },
13
+ { id: "day", groupPath: ["A", "B"] },
14
+ { id: "month", groupPath: ["A"] },
15
+ { id: "duration" },
16
+ { id: "campaign" },
17
+ { id: "pdays", groupPath: ["C"] },
18
+ { id: "previous", groupPath: ["C", "D"] },
19
+ { id: "poutcome", colSpan: 2 },
20
+ { id: "y" },
21
+ ];
22
+ export default function ColumnGroups({ rtl }) {
23
+ return _jsx(NormalLayout, { columns: columns, rtl: rtl, floatingRow: true });
24
+ }
@@ -0,0 +1,6 @@
1
+ import "./navigation.css";
2
+ import type { Column } from "../../+types.js";
3
+ export default function FullWidthRows({ rtl, columns, }: {
4
+ rtl?: boolean;
5
+ columns?: Column<any>[];
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "./navigation.css";
3
+ import { useLyteNyte } from "../../state/use-lytenyte.js";
4
+ import { bankDataSmall } from "../test-utils/bank-data-smaller.js";
5
+ import { Root } from "../../root/root.js";
6
+ import { Viewport } from "../../viewport/viewport.js";
7
+ import { Header } from "../../header/header.js";
8
+ import { HeaderRow } from "../../header/header-row.js";
9
+ import { HeaderGroupCell } from "../../header/header-group-cell.js";
10
+ import { HeaderCell } from "../../header/header-cell.js";
11
+ import { RowsContainer } from "../../rows/rows-container.js";
12
+ import { RowsBottom, RowsCenter, RowsTop } from "../../rows/rows-sections.js";
13
+ import { RowHandler } from "../test-utils/row-handler.js";
14
+ import { useClientRowDataSource } from "../../row-data-source-client/use-client-data-source.js";
15
+ const baseColumns = [
16
+ { id: "age" },
17
+ { id: "job" },
18
+ { id: "balance" },
19
+ { id: "education" },
20
+ { id: "marital" },
21
+ { id: "default" },
22
+ { id: "housing" },
23
+ { id: "loan" },
24
+ { id: "contact" },
25
+ { id: "day" },
26
+ { id: "month" },
27
+ { id: "duration" },
28
+ { id: "campaign" },
29
+ { id: "pdays" },
30
+ { id: "previous" },
31
+ { id: "poutcome" },
32
+ { id: "y" },
33
+ ];
34
+ export default function FullWidthRows({ rtl, columns, }) {
35
+ const ds = useClientRowDataSource({
36
+ data: bankDataSmall,
37
+ });
38
+ const g = useLyteNyte({
39
+ gridId: "x",
40
+ columns: columns ?? baseColumns,
41
+ rowDataSource: ds,
42
+ rtl: rtl,
43
+ rowFullWidthPredicate: (r) => r.rowIndex === 2 || r.rowIndex == 4,
44
+ rowFullWidthRenderer: (r) => {
45
+ if (r.rowIndex === 2)
46
+ return _jsx("div", { children: "Nothing" });
47
+ return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, children: "A" }), _jsx("button", { tabIndex: 0, children: "B" }), _jsx("button", { tabIndex: 0, children: "C" })] }));
48
+ },
49
+ });
50
+ const view = g.view.useValue();
51
+ return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, onClick: () => { }, children: "Top Capture" }), _jsx("div", { style: { width: "100%", height: "90vh", border: "1px solid black" }, children: _jsx(Root, { grid: g, children: _jsxs(Viewport, { children: [_jsx(Header, { children: view.header.layout.map((row, i) => {
52
+ return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
53
+ if (c.kind === "group") {
54
+ return _jsx(HeaderGroupCell, { cell: c }, c.idOccurrence);
55
+ }
56
+ return (_jsx(HeaderCell, { cell: c, style: {
57
+ paddingInline: "16px",
58
+ background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
59
+ color: "light-dark(black,white)",
60
+ display: "flex",
61
+ alignItems: "center",
62
+ borderBottom: "1px solid light-dark(gray, #444242)",
63
+ borderRight: "1px solid light-dark(gray, #444242)",
64
+ } }, c.column.id));
65
+ }) }, i));
66
+ }) }), _jsxs(RowsContainer, { children: [_jsx(RowsTop, { children: _jsx(RowHandler, { rows: view.rows.top, withStyles: true, pinned: true }) }), _jsx(RowsCenter, { children: _jsx(RowHandler, { rows: view.rows.center, withStyles: true }) }), _jsx(RowsBottom, { children: _jsx(RowHandler, { rows: view.rows.bottom, withStyles: true, pinned: true }) })] })] }) }) }), _jsx("button", { tabIndex: 0, onClick: () => { }, children: "Bottom Capture" })] }));
67
+ }