@1771technologies/lytenyte-pro 1.0.14 → 1.0.16

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 (225) hide show
  1. package/dist/__play__/cell-selections/cell-selection.play.d.ts +5 -0
  2. package/dist/__play__/{grid-navigation/normal-layout.play.js → cell-selections/cell-selection.play.js} +32 -24
  3. package/dist/__play__/filter-select/filter-select.play.d.ts +4 -0
  4. package/dist/__play__/filter-select/filter-select.play.js +76 -0
  5. package/dist/__play__/test-utils/row-handler.js +6 -7
  6. package/dist/cell-selection/bound-selection-rect.js +1 -1
  7. package/dist/cell-selection/cell-selection-driver.js +12 -8
  8. package/dist/column-manager/branch.d.ts +1 -1
  9. package/dist/column-manager/branch.js +1 -1
  10. package/dist/column-manager/label.d.ts +1 -1
  11. package/dist/column-manager/label.js +1 -1
  12. package/dist/column-manager/leaf.js +1 -1
  13. package/dist/column-manager/move-handle.d.ts +1 -1
  14. package/dist/column-manager/move-handle.js +1 -2
  15. package/dist/column-manager/visibility-checkbox.d.ts +1 -1
  16. package/dist/column-manager/visibility-checkbox.js +1 -1
  17. package/dist/context.d.ts +2 -1
  18. package/dist/context.js +5 -4
  19. package/dist/filter-selects/apply.d.ts +7 -0
  20. package/dist/filter-selects/apply.js +22 -0
  21. package/dist/filter-selects/context.d.ts +12 -0
  22. package/dist/filter-selects/context.js +3 -0
  23. package/dist/filter-selects/filter-combinator.d.ts +10 -0
  24. package/dist/filter-selects/filter-combinator.js +19 -0
  25. package/dist/filter-selects/filter-row-context.d.ts +30 -0
  26. package/dist/filter-selects/filter-row-context.js +3 -0
  27. package/dist/filter-selects/filter-row.d.ts +13 -0
  28. package/dist/filter-selects/filter-row.js +118 -0
  29. package/dist/filter-selects/index.d.ts +20 -0
  30. package/dist/filter-selects/index.js +18 -0
  31. package/dist/filter-selects/is-complete-filter.d.ts +2 -0
  32. package/dist/filter-selects/is-complete-filter.js +5 -0
  33. package/dist/filter-selects/operator-select.d.ts +14 -0
  34. package/dist/filter-selects/operator-select.js +25 -0
  35. package/dist/filter-selects/options.d.ts +9 -0
  36. package/dist/filter-selects/options.js +100 -0
  37. package/dist/filter-selects/reset.d.ts +7 -0
  38. package/dist/filter-selects/reset.js +22 -0
  39. package/dist/filter-selects/root.d.ts +13 -0
  40. package/dist/filter-selects/root.js +5 -0
  41. package/dist/filter-selects/to-filter-item.d.ts +3 -0
  42. package/dist/filter-selects/to-filter-item.js +7 -0
  43. package/dist/filter-selects/use-filter-select.d.ts +37 -0
  44. package/dist/filter-selects/use-filter-select.js +158 -0
  45. package/dist/filter-selects/value-input.d.ts +12 -0
  46. package/dist/filter-selects/value-input.js +27 -0
  47. package/dist/filter-tree/branch.d.ts +1 -1
  48. package/dist/filter-tree/branch.js +1 -1
  49. package/dist/filter-tree/hooks/use-filter-tree.js +1 -1
  50. package/dist/filter-tree/inclusion-checkbox.d.ts +1 -1
  51. package/dist/filter-tree/inclusion-checkbox.js +1 -1
  52. package/dist/filter-tree/label.d.ts +1 -1
  53. package/dist/filter-tree/label.js +1 -1
  54. package/dist/filter-tree/root.d.ts +1 -1
  55. package/dist/filter-tree/root.js +1 -1
  56. package/dist/grid/cell.d.ts +6 -0
  57. package/dist/grid/cell.js +3 -0
  58. package/dist/grid/header-cell.d.ts +10 -0
  59. package/dist/grid/header-cell.js +3 -0
  60. package/dist/grid/header-group-cell.d.ts +6 -0
  61. package/dist/grid/header-group-cell.js +3 -0
  62. package/dist/grid/header-row.d.ts +5 -0
  63. package/dist/grid/header-row.js +2 -0
  64. package/dist/grid/header.d.ts +1 -0
  65. package/dist/grid/header.js +2 -0
  66. package/dist/{root → grid}/root.d.ts +1 -1
  67. package/dist/grid/root.js +37 -0
  68. package/dist/grid/row-full-width.d.ts +9 -0
  69. package/dist/grid/row-full-width.js +3 -0
  70. package/dist/grid/row.d.ts +8 -0
  71. package/dist/grid/row.js +3 -0
  72. package/dist/grid/rows-container.d.ts +1 -0
  73. package/dist/grid/rows-container.js +2 -0
  74. package/dist/grid/rows-sections.js +13 -0
  75. package/dist/grid/viewport.js +9 -0
  76. package/dist/grid-box/item.d.ts +1 -1
  77. package/dist/grid-box/item.js +1 -2
  78. package/dist/grid-box/panel.js +1 -1
  79. package/dist/grid-box/use-aggregation-box-items.js +1 -1
  80. package/dist/grid-box/use-column-box-items.js +1 -1
  81. package/dist/grid-box/use-row-group-box-items.js +1 -1
  82. package/dist/grid.d.ts +9 -9
  83. package/dist/grid.js +11 -11
  84. package/dist/index.d.ts +2 -1
  85. package/dist/index.js +2 -1
  86. package/dist/license/index.d.ts +1 -0
  87. package/dist/license/index.js +1 -0
  88. package/dist/license/license.d.ts +3 -0
  89. package/dist/license/license.js +215 -0
  90. package/dist/license/md5-hash.d.ts +9 -0
  91. package/dist/license/md5-hash.js +167 -0
  92. package/dist/license.js +1 -1
  93. package/dist/listbox/item.js +1 -1
  94. package/dist/listbox/panel.js +2 -2
  95. package/dist/row-data-source-client/filter/compute-filtered-rows.js +1 -1
  96. package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +1 -1
  97. package/dist/row-data-source-client/use-client-data-source-paginated.js +3 -2
  98. package/dist/row-data-source-client/use-client-data-source.js +3 -2
  99. package/dist/row-data-source-client/use-client-tree-data-source.js +3 -2
  100. package/dist/row-data-source-server/server-data.js +1 -1
  101. package/dist/row-data-source-server/use-server-data-source.js +2 -2
  102. package/dist/sort-manager/hooks/use-sort-manager.js +2 -2
  103. package/dist/sort-manager/hooks/use-sort-row-item.js +1 -1
  104. package/dist/sort-manager/sort-add.d.ts +1 -1
  105. package/dist/sort-manager/sort-add.js +1 -1
  106. package/dist/sort-manager/sort-apply.d.ts +1 -1
  107. package/dist/sort-manager/sort-apply.js +2 -2
  108. package/dist/sort-manager/sort-cancel.d.ts +1 -1
  109. package/dist/sort-manager/sort-cancel.js +2 -2
  110. package/dist/sort-manager/sort-clear.d.ts +1 -1
  111. package/dist/sort-manager/sort-clear.js +1 -1
  112. package/dist/sort-manager/sort-column-select.d.ts +1 -1
  113. package/dist/sort-manager/sort-column-select.js +1 -1
  114. package/dist/sort-manager/sort-direction-select.d.ts +1 -1
  115. package/dist/sort-manager/sort-direction-select.js +1 -1
  116. package/dist/sort-manager/sort-remove.d.ts +1 -1
  117. package/dist/sort-manager/sort-remove.js +1 -1
  118. package/dist/sort-manager/sort-value-select.d.ts +1 -1
  119. package/dist/sort-manager/sort-value-select.js +1 -1
  120. package/dist/state/+types.d.ts +2 -1
  121. package/dist/state/api/column-field.js +1 -1
  122. package/dist/state/api/edit-begin.js +1 -1
  123. package/dist/state/api/focus-cell.js +1 -1
  124. package/dist/state/api/position-from-element.d.ts +5 -2
  125. package/dist/state/api/position-from-element.js +3 -3
  126. package/dist/state/api/row-handle-select.js +1 -1
  127. package/dist/state/api/use-row-drag.js +3 -2
  128. package/dist/state/helpers/column-add-row-group.js +1 -1
  129. package/dist/state/helpers/column-marker.js +1 -1
  130. package/dist/state/use-lytenyte.js +18 -3
  131. package/dist/tree-view/branch/branch.d.ts +1 -1
  132. package/dist/tree-view/branch/branch.js +1 -1
  133. package/dist/tree-view/branch/use-branch-keys.js +2 -2
  134. package/dist/tree-view/leaf.js +1 -1
  135. package/dist/tree-view/panel/make-handle-navigation.js +1 -1
  136. package/dist/tree-view/panel/make-handle-selection.js +1 -1
  137. package/dist/tree-view/panel/panel.js +2 -2
  138. package/dist/tree-view/panel/use-tree-navigation.js +1 -1
  139. package/dist/tree-view/root.js +1 -1
  140. package/dist/tree-view/utils/get-focusable-nodes.js +1 -1
  141. package/dist/tree-view/utils/get-focused-node.js +1 -1
  142. package/dist/tree-view/utils/get-sibling-branches.js +1 -1
  143. package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +1 -1
  144. package/dist/tree-view/virtualized/use-row-start-and-end.js +1 -1
  145. package/dist/tree-view/virtualized/use-virtualized-tree.js +1 -1
  146. package/dist/types/types.d.ts +6 -6
  147. package/package.json +3 -7
  148. package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +0 -3
  149. package/dist/__play__/grid-navigation/cell-spans-large.play.js +0 -26
  150. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +0 -3
  151. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +0 -27
  152. package/dist/__play__/grid-navigation/cell-spans.play.d.ts +0 -3
  153. package/dist/__play__/grid-navigation/cell-spans.play.js +0 -52
  154. package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +0 -3
  155. package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +0 -47
  156. package/dist/__play__/grid-navigation/column-groups.play.d.ts +0 -3
  157. package/dist/__play__/grid-navigation/column-groups.play.js +0 -24
  158. package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +0 -6
  159. package/dist/__play__/grid-navigation/full-width-rows.play.js +0 -67
  160. package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +0 -1
  161. package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +0 -877
  162. package/dist/__play__/grid-navigation/normal-layout.play.d.ts +0 -10
  163. package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +0 -3
  164. package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +0 -11
  165. package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +0 -6
  166. package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +0 -79
  167. package/dist/__play__/grid-navigation/row-detail.play.d.ts +0 -6
  168. package/dist/__play__/grid-navigation/row-detail.play.js +0 -78
  169. package/dist/__play__/grid-navigation/row-detail.pt.d.ts +0 -1
  170. package/dist/__play__/grid-navigation/row-detail.pt.js +0 -68
  171. package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +0 -1
  172. package/dist/__play__/grid-navigation/vertical-navigation.pt.js +0 -176
  173. package/dist/cells/+types.cell.d.ts +0 -13
  174. package/dist/cells/+types.cell.js +0 -1
  175. package/dist/cells/cell-default.d.ts +0 -2
  176. package/dist/cells/cell-default.js +0 -8
  177. package/dist/cells/cell-editor.d.ts +0 -6
  178. package/dist/cells/cell-editor.js +0 -110
  179. package/dist/cells/cell-spacer.d.ts +0 -9
  180. package/dist/cells/cell-spacer.js +0 -39
  181. package/dist/cells/cell.d.ts +0 -5
  182. package/dist/cells/cell.js +0 -44
  183. package/dist/cells/use-cell-style.d.ts +0 -3
  184. package/dist/cells/use-cell-style.js +0 -51
  185. package/dist/header/header-cell.d.ts +0 -10
  186. package/dist/header/header-cell.js +0 -22
  187. package/dist/header/header-group-cell.d.ts +0 -5
  188. package/dist/header/header-group-cell.js +0 -16
  189. package/dist/header/header-row.d.ts +0 -4
  190. package/dist/header/header-row.js +0 -10
  191. package/dist/header/header.d.ts +0 -1
  192. package/dist/header/header.js +0 -12
  193. package/dist/header/resize-handler.d.ts +0 -12
  194. package/dist/header/resize-handler.js +0 -136
  195. package/dist/header/use-drag-move.d.ts +0 -14
  196. package/dist/header/use-drag-move.js +0 -97
  197. package/dist/header/use-header-cell-renderer.d.ts +0 -4
  198. package/dist/header/use-header-cell-renderer.js +0 -37
  199. package/dist/root/root.js +0 -108
  200. package/dist/rows/row/context.d.ts +0 -15
  201. package/dist/rows/row/context.js +0 -14
  202. package/dist/rows/row/row.d.ts +0 -7
  203. package/dist/rows/row/row.js +0 -25
  204. package/dist/rows/row/use-row-context-value.d.ts +0 -6
  205. package/dist/rows/row/use-row-context-value.js +0 -45
  206. package/dist/rows/row-detail-row.d.ts +0 -4
  207. package/dist/rows/row-detail-row.js +0 -47
  208. package/dist/rows/row-full-width.d.ts +0 -8
  209. package/dist/rows/row-full-width.js +0 -19
  210. package/dist/rows/rows-container.d.ts +0 -1
  211. package/dist/rows/rows-container.js +0 -9
  212. package/dist/rows/rows-sections.js +0 -27
  213. package/dist/rows/scrollers/native-scroller.d.ts +0 -2
  214. package/dist/rows/scrollers/native-scroller.js +0 -4
  215. package/dist/utils/cycle-sorts.d.ts +0 -2
  216. package/dist/utils/cycle-sorts.js +0 -16
  217. package/dist/viewport/begin-editing.d.ts +0 -5
  218. package/dist/viewport/begin-editing.js +0 -15
  219. package/dist/viewport/viewport.js +0 -85
  220. /package/dist/{root → grid}/dialog-driver.d.ts +0 -0
  221. /package/dist/{root → grid}/dialog-driver.js +0 -0
  222. /package/dist/{root → grid}/popover-driver.d.ts +0 -0
  223. /package/dist/{root → grid}/popover-driver.js +0 -0
  224. /package/dist/{rows → grid}/rows-sections.d.ts +0 -0
  225. /package/dist/{viewport → grid}/viewport.d.ts +0 -0
@@ -1,10 +0,0 @@
1
- import "./navigation.css";
2
- import type { Column } from "../../+types.js";
3
- export default function BasicRendering({ rtl, columns, pinTop, center, pinBot, floatingRow, }: {
4
- rtl?: boolean;
5
- columns?: Column<any>[];
6
- center?: number;
7
- pinTop?: number;
8
- pinBot?: number;
9
- floatingRow?: boolean;
10
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export default function PinnedGapLayout({ rtl }: {
2
- rtl?: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import NormalLayout from "./normal-layout.play.js";
3
- const baseColumns = [
4
- { id: "age", pin: "start" },
5
- { id: "job" },
6
- { id: "marital" },
7
- { id: "housing", pin: "end" },
8
- ];
9
- export default function PinnedGapLayout({ rtl }) {
10
- return _jsx(NormalLayout, { columns: baseColumns, rtl: rtl });
11
- }
@@ -1,6 +0,0 @@
1
- import "./navigation.css";
2
- import type { Column } from "../../+types.js";
3
- export default function RowDetailWithSpans({ rtl, columns, }: {
4
- rtl?: boolean;
5
- columns?: Column<any>[];
6
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,79 +0,0 @@
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
- {
18
- id: "job",
19
- rowSpan: (c) => {
20
- if (c.rowIndex === 0)
21
- return 5;
22
- return 1;
23
- },
24
- },
25
- { id: "balance" },
26
- { id: "education" },
27
- { id: "marital" },
28
- { id: "default" },
29
- { id: "housing" },
30
- { id: "loan" },
31
- { id: "contact" },
32
- { id: "day" },
33
- { id: "month" },
34
- { id: "duration" },
35
- { id: "campaign" },
36
- { id: "pdays" },
37
- { id: "previous" },
38
- { id: "poutcome" },
39
- { id: "y" },
40
- ];
41
- export default function RowDetailWithSpans({ rtl, columns, }) {
42
- const ds = useClientRowDataSource({
43
- data: bankDataSmall,
44
- });
45
- const g = useLyteNyte({
46
- gridId: "x",
47
- columns: columns ?? baseColumns,
48
- rowDataSource: ds,
49
- rtl: rtl,
50
- rowDetailExpansions: new Set(["2"]),
51
- columnMarkerEnabled: true,
52
- columnMarker: {
53
- width: 60,
54
- cellRenderer: (p) => {
55
- return _jsx("button", { onClick: () => p.grid.api.rowDetailToggle(p.row), children: "X" });
56
- },
57
- },
58
- rowDetailRenderer: () => {
59
- return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, children: "Detail A" }), _jsx("button", { tabIndex: 0, children: "Detail B" })] }));
60
- },
61
- });
62
- const view = g.view.useValue();
63
- 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) => {
64
- return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
65
- if (c.kind === "group") {
66
- return _jsx(HeaderGroupCell, { cell: c }, c.idOccurrence);
67
- }
68
- return (_jsx(HeaderCell, { cell: c, style: {
69
- paddingInline: "16px",
70
- background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
71
- color: "light-dark(black,white)",
72
- display: "flex",
73
- alignItems: "center",
74
- borderBottom: "1px solid light-dark(gray, #444242)",
75
- borderRight: "1px solid light-dark(gray, #444242)",
76
- } }, c.column.id));
77
- }) }, i));
78
- }) }), _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" })] }));
79
- }
@@ -1,6 +0,0 @@
1
- import "./navigation.css";
2
- import type { Column } from "../../+types.js";
3
- export default function RowDetail({ rtl, columns }: {
4
- rtl?: boolean;
5
- columns?: Column<any>[];
6
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,78 +0,0 @@
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 RowDetail({ 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
- rowDetailExpansions: new Set(["2", "5"]),
44
- columnMarkerEnabled: true,
45
- columnMarker: {
46
- width: 60,
47
- cellRenderer: (p) => {
48
- return _jsx("button", { onClick: () => p.grid.api.rowDetailToggle(p.row), children: "X" });
49
- },
50
- },
51
- rowDetailRenderer: () => {
52
- return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, children: "Detail A" }), _jsx("button", { tabIndex: 0, children: "Detail B" })] }));
53
- },
54
- rowFullWidthPredicate: (r) => r.rowIndex === 2 || r.rowIndex == 4,
55
- rowFullWidthRenderer: (r) => {
56
- if (r.rowIndex === 2)
57
- return _jsx("div", { children: "Nothing" });
58
- return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, children: "A" }), _jsx("button", { tabIndex: 0, children: "B" }), _jsx("button", { tabIndex: 0, children: "C" })] }));
59
- },
60
- });
61
- const view = g.view.useValue();
62
- 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) => {
63
- return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
64
- if (c.kind === "group") {
65
- return _jsx(HeaderGroupCell, { cell: c }, c.idOccurrence);
66
- }
67
- return (_jsx(HeaderCell, { cell: c, style: {
68
- paddingInline: "16px",
69
- background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
70
- color: "light-dark(black,white)",
71
- display: "flex",
72
- alignItems: "center",
73
- borderBottom: "1px solid light-dark(gray, #444242)",
74
- borderRight: "1px solid light-dark(gray, #444242)",
75
- } }, c.column.id));
76
- }) }, i));
77
- }) }), _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" })] }));
78
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,68 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { wait } from "@1771technologies/lytenyte-js-utils";
3
- import { expect, test } from "vitest";
4
- import { render } from "vitest-browser-react";
5
- import RowDetail from "./row-detail.play.js";
6
- import { getCellQuery } from "@1771technologies/lytenyte-shared";
7
- import { userEvent } from "@vitest/browser/context";
8
- import RowDetailWithSpans from "./row-detail-with-spans.play.js";
9
- test("when row details are present it should be possible to navigate across them", async () => {
10
- const screen = render(_jsx(RowDetail, {}));
11
- const grid = screen.getByRole("grid");
12
- await expect.element(grid).toBeVisible();
13
- await wait(); // Give the grid a moment to render
14
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 0));
15
- ourFirstCell.focus();
16
- await expect.element(ourFirstCell).toHaveFocus();
17
- await userEvent.keyboard("{ArrowDown}");
18
- await wait();
19
- await userEvent.keyboard("{ArrowDown}");
20
- await wait();
21
- await userEvent.keyboard("{ArrowDown}");
22
- await wait();
23
- await expect.element(document.activeElement).toHaveTextContent("Detail ADetail B");
24
- await userEvent.keyboard("{ArrowLeft}");
25
- await wait();
26
- await expect.element(document.activeElement).toHaveTextContent("Detail B");
27
- await userEvent.keyboard("{ArrowLeft}");
28
- await wait();
29
- await expect.element(document.activeElement).toHaveTextContent("Detail A");
30
- await userEvent.keyboard("{ArrowDown}");
31
- await wait();
32
- await expect.element(document.activeElement).toHaveTextContent("X");
33
- await userEvent.keyboard("{ArrowDown}");
34
- await wait();
35
- await expect.element(document.activeElement).toHaveTextContent("ABC");
36
- await userEvent.keyboard("{ArrowUp}");
37
- await wait();
38
- await expect.element(document.activeElement).toHaveTextContent("X");
39
- await userEvent.keyboard("{ArrowUp}");
40
- await wait();
41
- await expect.element(document.activeElement).toHaveTextContent("Detail ADetail B");
42
- await userEvent.keyboard("{ArrowDown}");
43
- await wait();
44
- await expect.element(document.activeElement).toHaveTextContent("X");
45
- await userEvent.keyboard("{ArrowLeft}");
46
- await wait();
47
- await expect.element(document.activeElement).toHaveTextContent("X");
48
- await userEvent.click(document.activeElement);
49
- await wait();
50
- await userEvent.keyboard("{ArrowDown}");
51
- await expect.element(document.activeElement).toHaveTextContent("Detail ADetail B");
52
- });
53
- test("when there are row spans it should be cutoff when the detail is expanded", async () => {
54
- const screen = render(_jsx(RowDetailWithSpans, {}));
55
- const grid = screen.getByRole("grid");
56
- await expect.element(grid).toBeVisible();
57
- await wait(); // Give the grid a moment to render
58
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 2));
59
- ourFirstCell.focus();
60
- await expect.element(ourFirstCell).toHaveFocus();
61
- await expect.element(document.activeElement).toHaveTextContent("unemployed");
62
- await userEvent.keyboard("{ArrowDown}");
63
- await wait();
64
- await expect.element(document.activeElement).toHaveTextContent("management");
65
- await userEvent.keyboard("{ArrowDown}");
66
- await wait();
67
- await expect.element(document.activeElement).toHaveTextContent("Detail ADetail B");
68
- });
@@ -1,176 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { expect, test } from "vitest";
3
- import { render } from "vitest-browser-react";
4
- import NormalLayout from "./normal-layout.play.js";
5
- import { wait } from "@1771technologies/lytenyte-js-utils";
6
- import { getCellQuery } from "@1771technologies/lytenyte-shared";
7
- import { userEvent } from "@vitest/browser/context";
8
- import { bankDataSmall } from "../test-utils/bank-data-smaller.js";
9
- import FullWidthRows from "./full-width-rows.play.js";
10
- import CellSpans from "./cell-spans.play.js";
11
- test("should be able to navigate up and down cells", async () => {
12
- const screen = render(_jsx(NormalLayout, { center: 50 }));
13
- const grid = screen.getByRole("grid");
14
- await expect.element(grid).toBeVisible();
15
- await wait(); // Give the grid a moment to render
16
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 0));
17
- ourFirstCell.focus();
18
- const values = bankDataSmall.slice(0, 50).map((c) => `${c.age}`);
19
- for (const v of values) {
20
- await expect.element(document.activeElement).toHaveTextContent(v);
21
- await userEvent.keyboard("{ArrowDown}");
22
- await wait(100);
23
- }
24
- for (const v of values.toReversed()) {
25
- await expect.element(document.activeElement).toHaveTextContent(v);
26
- await userEvent.keyboard("{ArrowUp}");
27
- await wait(100);
28
- }
29
- });
30
- test("should be able to navigate up and down cells with pins", async () => {
31
- const screen = render(_jsx(NormalLayout, { pinTop: 2, pinBot: 2, center: 50 }));
32
- const grid = screen.getByRole("grid");
33
- await expect.element(grid).toBeVisible();
34
- await wait(); // Give the grid a moment to render
35
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 0));
36
- ourFirstCell.focus();
37
- const values = bankDataSmall
38
- .slice(0, 2)
39
- .map((c) => `${c.age}`)
40
- .concat(bankDataSmall.slice(0, 50).map((c) => `${c.age}`))
41
- .concat(bankDataSmall.slice(0, 2).map((c) => `${c.age}`));
42
- for (const v of values) {
43
- await expect.element(document.activeElement).toHaveTextContent(v);
44
- await userEvent.keyboard("{ArrowDown}");
45
- await wait(100);
46
- }
47
- for (const v of values.toReversed()) {
48
- await expect.element(document.activeElement).toHaveTextContent(v);
49
- await userEvent.keyboard("{ArrowUp}");
50
- await wait(100);
51
- }
52
- });
53
- test("should be able to handle moving to the start or end", async () => {
54
- const screen = render(_jsx(NormalLayout, {}));
55
- const grid = screen.getByRole("grid");
56
- await expect.element(grid).toBeVisible();
57
- await wait(); // Give the grid a moment to render
58
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 0));
59
- ourFirstCell.focus();
60
- await expect.element(document.activeElement).toHaveTextContent("30");
61
- await userEvent.keyboard("{Control>}{ArrowDown}{/Control}");
62
- await wait(200);
63
- await expect.element(document.activeElement).toHaveTextContent("42");
64
- await userEvent.keyboard("{Control>}{ArrowUp}{/Control}");
65
- await wait(200);
66
- await expect.element(document.activeElement).toHaveTextContent("30");
67
- });
68
- test("should be navigate across full width rows", async () => {
69
- const screen = render(_jsx(FullWidthRows, {}));
70
- const grid = screen.getByRole("grid");
71
- await expect.element(grid).toBeVisible();
72
- await wait(); // Give the grid a moment to render
73
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 2));
74
- ourFirstCell.focus();
75
- await expect.element(document.activeElement).toHaveTextContent("1787");
76
- await userEvent.keyboard("{ArrowDown}");
77
- await expect.element(document.activeElement).toHaveTextContent("4789");
78
- await userEvent.keyboard("{ArrowDown}");
79
- await expect.element(document.activeElement).toHaveTextContent("Nothing");
80
- await userEvent.keyboard("{ArrowDown}");
81
- await expect.element(document.activeElement).toHaveTextContent("1476");
82
- await userEvent.keyboard("{ArrowDown}");
83
- await expect.element(document.activeElement).toHaveTextContent("ABC");
84
- await userEvent.keyboard("{ArrowDown}");
85
- await expect.element(document.activeElement).toHaveTextContent("747");
86
- await userEvent.keyboard("{ArrowUp}");
87
- await expect.element(document.activeElement).toHaveTextContent("ABC");
88
- await userEvent.keyboard("{ArrowUp}");
89
- await expect.element(document.activeElement).toHaveTextContent("1476");
90
- await userEvent.keyboard("{ArrowUp}");
91
- await expect.element(document.activeElement).toHaveTextContent("Nothing");
92
- await userEvent.keyboard("{ArrowUp}");
93
- await expect.element(document.activeElement).toHaveTextContent("4789");
94
- });
95
- test("should be able to navigate across column and row spans", async () => {
96
- const screen = render(_jsx(CellSpans, {}));
97
- const grid = screen.getByRole("grid");
98
- await expect.element(grid).toBeVisible();
99
- await wait(); // Give the grid a moment to render
100
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 3));
101
- ourFirstCell.focus();
102
- await expect.element(document.activeElement).toHaveTextContent("primary");
103
- await userEvent.keyboard("{ArrowDown}");
104
- await expect.element(document.activeElement).toHaveTextContent("secondary");
105
- await userEvent.keyboard("{ArrowDown}");
106
- await expect.element(document.activeElement).toHaveTextContent("management");
107
- await userEvent.keyboard("{ArrowDown}");
108
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
109
- await userEvent.keyboard("{ArrowDown}");
110
- await expect.element(document.activeElement).toHaveTextContent("secondary");
111
- await userEvent.keyboard("{ArrowUp}");
112
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
113
- await userEvent.keyboard("{ArrowRight}");
114
- await expect.element(document.activeElement).toHaveTextContent("married");
115
- await userEvent.keyboard("{ArrowDown}");
116
- await expect.element(document.activeElement).toHaveTextContent("secondary");
117
- await userEvent.keyboard("{ArrowDown}");
118
- await expect.element(document.activeElement).toHaveTextContent("married");
119
- await userEvent.keyboard("{ArrowDown}");
120
- await expect.element(document.activeElement).toHaveTextContent("married");
121
- await userEvent.keyboard("{ArrowLeft}");
122
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
123
- await userEvent.keyboard("{ArrowDown}");
124
- await expect.element(document.activeElement).toHaveTextContent("secondary");
125
- await userEvent.keyboard("{ArrowDown}");
126
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
127
- await userEvent.keyboard("{ArrowDown}");
128
- await expect.element(document.activeElement).toHaveTextContent("secondary");
129
- await userEvent.keyboard("{ArrowUp}");
130
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
131
- await userEvent.keyboard("{ArrowUp}");
132
- await expect.element(document.activeElement).toHaveTextContent("secondary");
133
- await userEvent.keyboard("{ArrowUp}");
134
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
135
- await userEvent.keyboard("{ArrowUp}");
136
- await expect.element(document.activeElement).toHaveTextContent("secondary");
137
- await userEvent.keyboard("{ArrowUp}");
138
- await expect.element(document.activeElement).toHaveTextContent("secondary");
139
- await userEvent.keyboard("{ArrowUp}");
140
- await expect.element(document.activeElement).toHaveTextContent("tertiary");
141
- await userEvent.keyboard("{ArrowUp}");
142
- await expect.element(document.activeElement).toHaveTextContent("management");
143
- });
144
- test("page up and down should focus the correct cells", async () => {
145
- const screen = render(_jsx(CellSpans, {}));
146
- const grid = screen.getByRole("grid");
147
- await expect.element(grid).toBeVisible();
148
- await wait(); // Give the grid a moment to render
149
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 3));
150
- ourFirstCell.focus();
151
- await userEvent.keyboard("{PageDown}");
152
- await expect.element(document.activeElement).toHaveTextContent("secondary");
153
- await userEvent.keyboard("{PageUp}");
154
- await expect.element(document.activeElement).toHaveTextContent("management");
155
- });
156
- test("home and end should work as expected", async () => {
157
- const screen = render(_jsx(CellSpans, {}));
158
- const grid = screen.getByRole("grid");
159
- await expect.element(grid).toBeVisible();
160
- await wait(); // Give the grid a moment to render
161
- const ourFirstCell = document.querySelector(getCellQuery("x", 0, 3));
162
- ourFirstCell.focus();
163
- await expect.element(document.activeElement).toHaveTextContent("primary");
164
- await userEvent.keyboard("{End}");
165
- await wait(100);
166
- await expect.element(document.activeElement).toHaveTextContent("unknown");
167
- await userEvent.keyboard("{Home}");
168
- await wait(100);
169
- await expect.element(document.activeElement).toHaveTextContent("30");
170
- await userEvent.keyboard("{Control>}{End}{/Control}");
171
- await wait(100);
172
- await expect.element(document.activeElement).toHaveTextContent("unknown");
173
- await userEvent.keyboard("{Control>}{Home}{/Control}");
174
- await wait(100);
175
- await expect.element(document.activeElement).toHaveTextContent("30");
176
- });
@@ -1,13 +0,0 @@
1
- import type { ColumnPin } from "../+types.js";
2
- export interface Cell {
3
- readonly rowIndex: number;
4
- readonly colIndex: number;
5
- readonly colSpan: number;
6
- readonly rowSpan: number;
7
- readonly rowLastPinTop?: boolean;
8
- readonly rowFirstPinBottom?: boolean;
9
- readonly colLastStartPin?: boolean;
10
- readonly colFirstEndPin?: boolean;
11
- readonly colPin?: ColumnPin;
12
- readonly rowPin?: "top" | "bottom" | null;
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import type { CellRendererParams } from "../+types.js";
2
- export declare function CellDefault<T>({ grid, column, row }: CellRendererParams<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export function CellDefault({ grid, column, row }) {
3
- const r = grid.api.columnField(column, row);
4
- if (row.data == null && row.loading) {
5
- return _jsx("div", { children: "Loading..." });
6
- }
7
- return _jsx("div", { children: `${r ?? ""}` });
8
- }
@@ -1,6 +0,0 @@
1
- import type { RowCellLayout } from "../+types";
2
- interface CellEditorParams<T> {
3
- readonly cell: RowCellLayout<T>;
4
- }
5
- export declare function CellEditor<T>({ cell }: CellEditorParams<T>): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,110 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useState } from "react";
3
- import { getTabbables } from "@1771technologies/lytenyte-dom-utils";
4
- import { useGridRoot } from "../context.js";
5
- import { editOnChange } from "../state/helpers/edit-on-change.js";
6
- import { handleNavigation } from "@1771technologies/lytenyte-shared";
7
- export function CellEditor({ cell }) {
8
- const [el, setEl] = useState(null);
9
- const grid = useGridRoot().grid;
10
- useEffect(() => {
11
- if (!el)
12
- return;
13
- const focusFirst = () => {
14
- const tabbables = getTabbables(el);
15
- if (!el.contains(document.activeElement))
16
- tabbables.at(0)?.focus();
17
- };
18
- const controller = new AbortController();
19
- if (el.parentElement) {
20
- el.parentElement.addEventListener("focus", () => {
21
- focusFirst();
22
- }, { signal: controller.signal });
23
- }
24
- focusFirst();
25
- return () => controller.abort();
26
- }, [el]);
27
- return (_jsx("div", { ref: setEl, style: { width: "100%", height: "100%" }, onKeyDown: (e) => {
28
- if (e.key === "Escape") {
29
- const parent = el?.parentElement;
30
- grid.api.editEnd(true);
31
- setTimeout(() => {
32
- parent?.focus();
33
- }, 4);
34
- }
35
- if (e.key === "Enter") {
36
- const ds = grid.state.rowDataStore;
37
- // Don't move if the there are validation errors.
38
- const editValidation = grid.internal.editValidation.get();
39
- if (typeof editValidation === "boolean"
40
- ? editValidation === false
41
- : Object.keys(editValidation).length >= 1) {
42
- return;
43
- }
44
- handleNavigation({
45
- event: {
46
- key: "ArrowDown",
47
- ctrlKey: false,
48
- metaKey: false,
49
- preventDefault: () => { },
50
- stopPropagation: () => { },
51
- },
52
- topCount: grid.state.rowDataStore.rowTopCount.get(),
53
- centerCount: grid.state.rowDataStore.rowCenterCount.get(),
54
- isRowDetailExpanded: (r) => {
55
- const row = grid.api.rowByIndex(r);
56
- if (!row)
57
- return false;
58
- return grid.api.rowDetailIsExpanded(row);
59
- },
60
- viewport: grid.state.viewport.get(),
61
- rowCount: ds.rowCount.get(),
62
- columnCount: grid.state.columnMeta.get().columnsVisible.length,
63
- focusActive: grid.internal.focusActive,
64
- gridId: grid.state.gridId.get(),
65
- getRootCell: grid.api.cellRoot,
66
- rtl: grid.state.rtl.get(),
67
- scrollIntoView: grid.api.scrollIntoView,
68
- });
69
- }
70
- e.stopPropagation();
71
- }, children: _jsx(EditRenderer, { cell: cell }) }));
72
- }
73
- function EditRenderer({ cell }) {
74
- const column = cell.column;
75
- const ctx = useGridRoot();
76
- const base = ctx.grid.state.columnBase.useValue();
77
- const editFuncs = ctx.grid.state.editRenderers.useValue();
78
- const editRenderer = column.editRenderer ?? base.editRenderer;
79
- const activeData = ctx.grid.internal.editData.useValue();
80
- const row = cell.row.get();
81
- const value = ctx.grid.api.columnField(column, row.kind === "branch"
82
- ? { kind: "branch", data: activeData, key: row.key }
83
- : { kind: "leaf", data: activeData });
84
- const onChange = useCallback((c) => {
85
- editOnChange({
86
- value: c,
87
- activeData,
88
- base,
89
- column,
90
- grid: ctx.grid,
91
- row,
92
- rowIndex: cell.rowIndex,
93
- });
94
- }, [activeData, base, cell.rowIndex, column, ctx.grid, row]);
95
- if (!editRenderer) {
96
- const type = column.type;
97
- if (type === "number")
98
- return (_jsx("input", { type: "number", value: value ?? "", onChange: (e) => (e.target.value ? onChange(Number.parseFloat(e.target.value)) : 0) }));
99
- if (type === "date")
100
- return _jsx("input", { type: "date", value: value ?? "", onChange: (e) => onChange(e.target.value) });
101
- if (type === "datetime")
102
- return (_jsx("input", { type: "datetime-local", value: value ?? "", onChange: (e) => onChange(e.target.value) }));
103
- return _jsx("input", { value: value ?? "", onChange: (e) => onChange(e.target.value) });
104
- }
105
- const Renderer = typeof editRenderer === "string" ? editFuncs[editRenderer] : editRenderer;
106
- const validation = ctx.grid.internal.editValidation.useValue();
107
- if (!Renderer)
108
- return null;
109
- return (_jsx(Renderer, { column: column, grid: ctx.grid, onChange: onChange, row: cell.row.get(), rowIndex: cell.rowIndex, value: value, rowValidationState: validation }));
110
- }
@@ -1,9 +0,0 @@
1
- export declare function CellSpacePinStart({ xPositions: x }: {
2
- xPositions: Uint32Array;
3
- }): import("react/jsx-runtime").JSX.Element | null;
4
- export declare function CellSpacerPinEnd({ xPositions: x }: {
5
- xPositions: Uint32Array;
6
- }): import("react/jsx-runtime").JSX.Element | null;
7
- export declare function CellSpacerNoPin({ xPositions: x }: {
8
- xPositions: Uint32Array;
9
- }): import("react/jsx-runtime").JSX.Element | null;