@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
@@ -0,0 +1,5 @@
1
+ import "../../../main.css";
2
+ import "./cell-selection.css";
3
+ export default function CellSelection({ data }: {
4
+ data?: any[];
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,23 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./navigation.css";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import "../../../main.css";
3
+ import "./cell-selection.css";
4
+ import { useClientRowDataSource } from "../../row-data-source-client/use-client-data-source.js";
3
5
  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";
6
+ import { useId } from "react";
7
+ import { Viewport } from "../../grid/viewport.js";
8
+ import { Root } from "../../grid/root.js";
9
+ import { Header } from "../../grid/header.js";
10
+ import { HeaderRow } from "../../grid/header-row.js";
11
+ import { HeaderGroupCell } from "../../grid/header-group-cell.js";
12
+ import { HeaderCell } from "../../grid/header-cell.js";
13
+ import { RowsContainer } from "../../grid/rows-container.js";
14
+ import { RowsBottom, RowsCenter, RowsTop } from "../../grid/rows-sections.js";
13
15
  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
+ import { bankDataSmall } from "../test-utils/bank-data-smaller.js";
17
+ const columns = [
16
18
  { id: "age" },
17
19
  { id: "job" },
18
- { id: "balance" },
20
+ { id: "balance", pin: "start" },
19
21
  { id: "education" },
20
22
  { id: "marital" },
21
23
  { id: "default" },
@@ -31,21 +33,27 @@ const baseColumns = [
31
33
  { id: "poutcome" },
32
34
  { id: "y" },
33
35
  ];
34
- export default function BasicRendering({ rtl, columns, pinTop, center, pinBot, floatingRow, }) {
36
+ export default function CellSelection({ data = bankDataSmall }) {
35
37
  const ds = useClientRowDataSource({
36
- data: center ? bankDataSmall.slice(0, center) : bankDataSmall,
37
- topData: pinTop ? bankDataSmall.slice(0, pinTop) : [],
38
- bottomData: pinBot ? bankDataSmall.slice(0, pinBot) : [],
38
+ data: data,
39
+ topData: data.slice(0, 2),
40
+ bottomData: data.slice(0, 2),
39
41
  });
40
42
  const g = useLyteNyte({
41
- gridId: "x",
42
- columns: columns ?? baseColumns,
43
+ gridId: useId(),
44
+ columns,
43
45
  rowDataSource: ds,
44
- rtl: rtl,
45
- floatingRowEnabled: floatingRow,
46
+ cellSelectionMode: "range",
47
+ columnBase: {
48
+ uiHints: {
49
+ movable: true,
50
+ resizable: true,
51
+ },
52
+ },
46
53
  });
47
54
  const view = g.view.useValue();
48
- 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) => {
55
+ const selections = g.state.cellSelections.useValue();
56
+ return (_jsxs("div", { children: [_jsxs("div", { children: [_jsxs("button", { onClick: () => g.state.rtl.set((prev) => !prev), children: ["RTL: ", g.state.rtl.get() ? "Yes" : "No"] }), _jsx("button", { onClick: () => g.state.columnMarkerEnabled.set((prev) => !prev), children: "Toggle Marker" }), _jsx("button", { onClick: () => g.state.cellSelectionMode.set((prev) => prev === "multi-range" ? "range" : "multi-range"), children: "Range Selection" }), _jsx("pre", { children: JSON.stringify(selections) })] }), _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) => {
49
57
  return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
50
58
  if (c.kind === "group") {
51
59
  return (_jsx(HeaderGroupCell, { cell: c, style: {
@@ -68,5 +76,5 @@ export default function BasicRendering({ rtl, columns, pinTop, center, pinBot, f
68
76
  borderRight: "1px solid light-dark(gray, #444242)",
69
77
  } }, c.column.id));
70
78
  }) }, i));
71
- }) }), _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
+ }) }), _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 }) })] })] }) }) })] }));
72
80
  }
@@ -0,0 +1,4 @@
1
+ import "../../../main.css";
2
+ export default function FilterSelection({ data }: {
3
+ data?: any[];
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../../../main.css";
3
+ import { useClientRowDataSource } from "../../row-data-source-client/use-client-data-source.js";
4
+ import { useLyteNyte } from "../../state/use-lytenyte.js";
5
+ import { useId } from "react";
6
+ import { Viewport } from "../../grid/viewport.js";
7
+ import { Root } from "../../grid/root.js";
8
+ import { Header } from "../../grid/header.js";
9
+ import { HeaderRow } from "../../grid/header-row.js";
10
+ import { HeaderGroupCell } from "../../grid/header-group-cell.js";
11
+ import { HeaderCell } from "../../grid/header-cell.js";
12
+ import { RowsContainer } from "../../grid/rows-container.js";
13
+ import { RowsBottom, RowsCenter, RowsTop } from "../../grid/rows-sections.js";
14
+ import { RowHandler } from "../test-utils/row-handler.js";
15
+ import { bankDataSmall } from "../test-utils/bank-data-smaller.js";
16
+ import { FilterSelect } from "../../filter-selects/index.js";
17
+ const columns = [
18
+ { id: "age", type: "number" },
19
+ { id: "job", type: "date" },
20
+ { id: "balance", pin: "start" },
21
+ { id: "education" },
22
+ { id: "marital" },
23
+ { id: "default" },
24
+ { id: "housing" },
25
+ { id: "loan" },
26
+ { id: "contact" },
27
+ { id: "day" },
28
+ { id: "month" },
29
+ { id: "duration" },
30
+ { id: "campaign" },
31
+ { id: "pdays" },
32
+ { id: "previous" },
33
+ { id: "poutcome" },
34
+ { id: "y" },
35
+ ];
36
+ export default function FilterSelection({ data = bankDataSmall }) {
37
+ const ds = useClientRowDataSource({
38
+ data: data,
39
+ });
40
+ const g = useLyteNyte({
41
+ gridId: useId(),
42
+ columns,
43
+ rowDataSource: ds,
44
+ });
45
+ const view = g.view.useValue();
46
+ const rootAge = FilterSelect.useFilterSelect({ grid: g, column: columns[0], maxCount: 3 });
47
+ const rootJob = FilterSelect.useFilterSelect({ grid: g, column: columns[1], maxCount: 3 });
48
+ return (_jsxs("div", { style: { display: "flex" }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20 }, children: [_jsx("div", { children: _jsxs(FilterSelect.Root, { root: rootAge, children: [rootAge.filters.map((c, i) => {
49
+ return (_jsxs(FilterSelect.FilterRow, { filter: c, children: [_jsx(FilterSelect.OperatorSelect, {}), _jsx(FilterSelect.ValueInput, {}), _jsx(FilterSelect.FilterCombinator, {})] }, i));
50
+ }), _jsx(FilterSelect.Apply, {}), _jsx(FilterSelect.Reset, {})] }) }), _jsx("div", { children: _jsxs(FilterSelect.Root, { root: rootJob, children: [rootJob.filters.map((c, i) => {
51
+ return (_jsxs(FilterSelect.FilterRow, { filter: c, children: [_jsx(FilterSelect.OperatorSelect, {}), _jsx(FilterSelect.ValueInput, {}), _jsx(FilterSelect.FilterCombinator, {})] }, i));
52
+ }), _jsx(FilterSelect.Apply, {}), _jsx(FilterSelect.Reset, {})] }) })] }), _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) => {
53
+ return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
54
+ if (c.kind === "group") {
55
+ return (_jsx(HeaderGroupCell, { cell: c, style: {
56
+ paddingInline: "16px",
57
+ background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
58
+ color: "light-dark(black,white)",
59
+ display: "flex",
60
+ alignItems: "center",
61
+ borderBottom: "1px solid light-dark(gray, #444242)",
62
+ borderRight: "1px solid light-dark(gray, #444242)",
63
+ } }, c.idOccurrence));
64
+ }
65
+ return (_jsx(HeaderCell, { cell: c, style: {
66
+ paddingInline: "16px",
67
+ background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
68
+ color: "light-dark(black,white)",
69
+ display: "flex",
70
+ alignItems: "center",
71
+ borderBottom: "1px solid light-dark(gray, #444242)",
72
+ borderRight: "1px solid light-dark(gray, #444242)",
73
+ } }, c.column.id));
74
+ }) }, i));
75
+ }) }), _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 }) })] })] }) }) })] }));
76
+ }
@@ -1,15 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fastDeepMemo } from "@1771technologies/lytenyte-react-hooks";
3
- import { Cell } from "../../cells/cell.js";
4
- import { Row } from "../../rows/row/row.js";
5
- import { RowFullWidth } from "../../rows/row-full-width.js";
6
- export const RowHandler = fastDeepMemo((props) => {
2
+ import { Row } from "../../grid/row.js";
3
+ import { Cell } from "../../grid/cell.js";
4
+ import { RowFullWidth } from "../../grid/row-full-width.js";
5
+ export const RowHandler = (props) => {
7
6
  return props.rows.map((row) => {
8
7
  if (row.kind === "full-width")
9
8
  return _jsx(RowFullWidth, { row: row }, row.id);
10
9
  return _jsx(Memo, { row: row, withStyles: props.withStyles, pinned: props.pinned }, row.id);
11
10
  });
12
- });
11
+ };
13
12
  function RowFor({ row, withStyles, pinned, }) {
14
13
  const styles = withStyles
15
14
  ? {
@@ -30,4 +29,4 @@ function RowFor({ row, withStyles, pinned, }) {
30
29
  return _jsx(Cell, { cell: cell, style: styles }, cell.id);
31
30
  }) }));
32
31
  }
33
- const Memo = fastDeepMemo(RowFor);
32
+ const Memo = RowFor;
@@ -1,4 +1,4 @@
1
- import { clamp } from "@1771technologies/lytenyte-js-utils";
1
+ import { clamp } from "@1771technologies/lytenyte-shared";
2
2
  export function boundSelectionRect(grid, rect) {
3
3
  const rowCount = grid.state.rowDataStore.rowCount.get();
4
4
  const maxRow = rowCount;
@@ -2,9 +2,9 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
3
  import { useGridRoot } from "../context.js";
4
4
  import { useEdgeScroll } from "./use-edge-scroll.js";
5
- import { equal, getClientX, getClientY, getRelativeXPosition, getRelativeYPosition, } from "@1771technologies/lytenyte-js-utils";
5
+ import { equal, getClientX, getClientY, getRelativeXPosition, getRelativeYPosition, } from "@1771technologies/lytenyte-shared";
6
6
  import { getNearestFocusable, getPositionFromFocusable } from "@1771technologies/lytenyte-shared";
7
- import { isHTMLElement } from "@1771technologies/lytenyte-dom-utils";
7
+ import { isHTMLElement } from "@1771technologies/lytenyte-shared";
8
8
  import { updateAdditiveCellSelection } from "./update-additive-cell-selection.js";
9
9
  import { deselectRectRange } from "./deselect-rect-range.js";
10
10
  import { isWithinSelectionRect } from "./is-within-selection-rect.js";
@@ -31,6 +31,7 @@ export function CellSelectionDriver() {
31
31
  let pointerStartY = 0;
32
32
  let lastRect = null;
33
33
  let animFrame = null;
34
+ const gridId = grid.state.gridId.get();
34
35
  const pointerMove = (event) => {
35
36
  if (animFrame)
36
37
  cancelAnimationFrame(animFrame);
@@ -41,10 +42,10 @@ export function CellSelectionDriver() {
41
42
  const target = event.target;
42
43
  if (!isHTMLElement(target))
43
44
  return;
44
- const focusable = getNearestFocusable(target);
45
+ const focusable = getNearestFocusable(gridId, target);
45
46
  if (!focusable)
46
47
  return;
47
- const position = getPositionFromFocusable(focusable);
48
+ const position = getPositionFromFocusable(focusable, gridId);
48
49
  if (position.kind !== "cell" && position.kind !== "full-width")
49
50
  return;
50
51
  const rowIndex = position.rowIndex;
@@ -117,18 +118,21 @@ export function CellSelectionDriver() {
117
118
  const pointerDown = (event) => {
118
119
  if (!isNormalClick(event)) {
119
120
  document.removeEventListener("pointermove", pointerMove);
120
- // Prevent the default for the context menu, otherwise the cell right clicked will be focused,
121
- // resulting in the cell selection changing. if (event.button == 2) event.preventDefault();
121
+ // Prevent the default for the context menu, otherwise the cell
122
+ // right clicked will be focused,
123
+ // resulting in the cell selection changing.
124
+ if (event.button == 2)
125
+ event.preventDefault();
122
126
  return;
123
127
  }
124
128
  isAdditive = isMultiRange && (event.ctrlKey || event.metaKey);
125
129
  const target = event.target;
126
130
  if (!isHTMLElement(target))
127
131
  return;
128
- const focusable = getNearestFocusable(target);
132
+ const focusable = getNearestFocusable(gridId, target);
129
133
  if (!focusable)
130
134
  return;
131
- const position = getPositionFromFocusable(focusable);
135
+ const position = getPositionFromFocusable(focusable, gridId);
132
136
  if (position.kind !== "cell" && position.kind !== "full-width")
133
137
  return;
134
138
  const rowIndex = position.rowIndex;
@@ -1,7 +1,7 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import type { Column } from "../+types";
3
- import type { SlotComponent } from "@1771technologies/lytenyte-react-hooks";
4
3
  import type { PathBranch } from "@1771technologies/lytenyte-shared";
4
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
5
5
  export interface ColumnManagerBranchProps {
6
6
  readonly item: PathBranch<Column<any>>;
7
7
  readonly label: SlotComponent;
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useMemo } from "react";
3
3
  import { TreeBranch } from "../tree-view/branch/branch.js";
4
4
  import { ColumnItemContext } from "./context.js";
5
- import { dragState, DropWrap } from "@1771technologies/lytenyte-dragon";
6
5
  import { useGrid } from "../grid-provider/use-grid.js";
7
6
  import { useColumnsFromContext } from "./use-columns-from-context.js";
7
+ import { dragState, DropWrap } from "@1771technologies/lytenyte-core/yinternal";
8
8
  export const Branch = forwardRef(function Branch({ item, label, labelWrapClassName, labelWrapStyle, ...props }, forwarded) {
9
9
  const grid = useGrid();
10
10
  const id = grid.state.gridId.useValue();
@@ -1,4 +1,4 @@
1
- import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
1
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
2
2
  export interface LabelProps {
3
3
  readonly as?: SlotComponent;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useSlot } from "@1771technologies/lytenyte-react-hooks";
3
2
  import { forwardRef, useMemo } from "react";
4
3
  import { useColumnItemContext } from "./context.js";
4
+ import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
5
5
  export const Label = forwardRef(function Label({ as, ...props }, forwarded) {
6
6
  const { item } = useColumnItemContext();
7
7
  const label = useMemo(() => {
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useMemo } from "react";
3
3
  import { ColumnItemContext } from "./context.js";
4
4
  import { TreeLeaf } from "../tree-view/leaf.js";
5
- import { dragState, DropWrap } from "@1771technologies/lytenyte-dragon";
6
5
  import { useGrid } from "../grid-provider/use-grid.js";
7
6
  import { useColumnsFromContext } from "./use-columns-from-context.js";
7
+ import { dragState, DropWrap } from "@1771technologies/lytenyte-core/yinternal";
8
8
  export const Leaf = forwardRef(function ColumnManagerLeaf({ item, ...props }, forwarded) {
9
9
  const context = useMemo(() => {
10
10
  return { item: item };
@@ -1,4 +1,4 @@
1
- import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
1
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
2
2
  export interface MoveHandleProps {
3
3
  readonly as?: SlotComponent;
4
4
  }
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useDraggable } from "@1771technologies/lytenyte-dragon";
3
- import { useCombinedRefs, useSlot, } from "@1771technologies/lytenyte-react-hooks";
4
2
  import { forwardRef, useMemo } from "react";
5
3
  import { useColumnItemContext } from "./context.js";
6
4
  import { useColumnsFromContext } from "./use-columns-from-context.js";
7
5
  import { useGrid } from "../grid-provider/use-grid.js";
6
+ import { useCombinedRefs, useDraggable, useSlot, } from "@1771technologies/lytenyte-core/yinternal";
8
7
  export const MoveHandle = forwardRef(function MoveHandle({ as, ...props }, forwarded) {
9
8
  const item = useColumnItemContext().item;
10
9
  const grid = useGrid();
@@ -1,4 +1,4 @@
1
- import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
1
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
2
2
  export interface VisibilityCheckbox {
3
3
  readonly as?: SlotComponent<{
4
4
  visible: boolean;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useSlot } from "@1771technologies/lytenyte-react-hooks";
3
2
  import { useColumnItemContext } from "./context.js";
4
3
  import { forwardRef, useCallback, useMemo } from "react";
5
4
  import { useGrid } from "../grid-provider/use-grid.js";
6
5
  import { useColumnsFromContext } from "./use-columns-from-context.js";
6
+ import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
7
7
  export const VisibilityCheckbox = forwardRef(function VisibilityCheckbox({ as, ...props }, forwarded) {
8
8
  const { item } = useColumnItemContext();
9
9
  const grid = useGrid();
package/dist/context.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import type { Grid } from "./+types.js";
2
2
  import type { InternalAtoms } from "./state/+types.js";
3
+ import type { Provider } from "react";
3
4
  export interface GridRootContext {
4
5
  readonly ref: (el: HTMLElement | null) => void;
5
6
  readonly grid: Grid<any> & {
6
7
  internal: InternalAtoms;
7
8
  };
8
9
  }
9
- export declare const RootProvider: import("react").Provider<GridRootContext>;
10
+ export declare const RootProvider: Provider<GridRootContext>;
10
11
  export declare const useGridRoot: () => GridRootContext;
package/dist/context.js CHANGED
@@ -1,4 +1,5 @@
1
- import { createContext, useContext } from "react";
2
- const context = createContext(null);
3
- export const RootProvider = context.Provider;
4
- export const useGridRoot = () => useContext(context);
1
+ import { RootProvider as CoreProvider, useGridRoot as useCoreRoot, } from "@1771technologies/lytenyte-core/yinternal";
2
+ // The PRO context is a superset of the Core context, but we still want to leverage some of the core
3
+ // components to share code. Hence we share the context functionality.
4
+ export const RootProvider = CoreProvider;
5
+ export const useGridRoot = useCoreRoot;
@@ -0,0 +1,7 @@
1
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
2
+ export interface ApplyProps {
3
+ readonly as?: SlotComponent<{
4
+ onApply: () => void;
5
+ }>;
6
+ }
7
+ export declare const Apply: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & ApplyProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
3
+ import { forwardRef } from "react";
4
+ import { useFilterSelectRoot } from "./context.js";
5
+ function ApplyImpl({ as, ...props }, ref) {
6
+ const ctx = useFilterSelectRoot();
7
+ const slot = useSlot({
8
+ props: [
9
+ {
10
+ onClick: ctx.apply,
11
+ },
12
+ props,
13
+ ],
14
+ ref: ref,
15
+ slot: as ?? _jsx("button", { children: "Apply" }),
16
+ state: {
17
+ onReset: ctx.apply,
18
+ },
19
+ });
20
+ return slot;
21
+ }
22
+ export const Apply = forwardRef(ApplyImpl);
@@ -0,0 +1,12 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ import type { FilterSelectFlat } from "./use-filter-select";
3
+ export interface FilterSelectRoot {
4
+ readonly defaultFilter: FilterSelectFlat;
5
+ readonly filters: FilterSelectFlat[];
6
+ readonly setFilters: Dispatch<SetStateAction<FilterSelectFlat[]>>;
7
+ readonly maxCount: number;
8
+ readonly apply: () => void;
9
+ readonly reset: () => void;
10
+ }
11
+ export declare const context: import("react").Context<FilterSelectRoot>;
12
+ export declare const useFilterSelectRoot: () => FilterSelectRoot;
@@ -0,0 +1,3 @@
1
+ import { createContext, useContext } from "react";
2
+ export const context = createContext({});
3
+ export const useFilterSelectRoot = () => useContext(context);
@@ -0,0 +1,10 @@
1
+ import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
2
+ export interface FilterCombinatorSlotProps {
3
+ readonly value: "AND" | "OR" | null;
4
+ readonly onChange: (v: "AND" | "OR" | null) => void;
5
+ readonly shouldShow: boolean;
6
+ }
7
+ export interface FilterCombinatorProps {
8
+ readonly as?: SlotComponent<FilterCombinatorSlotProps>;
9
+ }
10
+ export declare const FilterCombinator: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & FilterCombinatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
3
+ import { forwardRef } from "react";
4
+ import { useFilterRow } from "./filter-row-context.js";
5
+ function FilterCombinatorImpl({ as, ...props }, ref) {
6
+ const ctx = useFilterRow();
7
+ const slot = useSlot({
8
+ props: [props],
9
+ ref: ref,
10
+ slot: as ?? (_jsx(_Fragment, { children: ctx.showExtender && (_jsxs("div", { ...props, ref: ref, children: [_jsxs("label", { children: ["AND", _jsx("input", { type: "radio", checked: ctx.extender === "AND", value: "AND", onChange: (e) => ctx.onExtenderChange(e.target.value) })] }), _jsxs("label", { children: ["OR", _jsx("input", { type: "radio", checked: ctx.extender === "OR", value: "OR", onChange: (e) => ctx.onExtenderChange(e.target.value) })] })] })) })),
11
+ state: {
12
+ onChange: ctx.onExtenderChange,
13
+ shouldShow: ctx.showExtender,
14
+ value: ctx.extender,
15
+ },
16
+ });
17
+ return slot;
18
+ }
19
+ export const FilterCombinator = forwardRef(FilterCombinatorImpl);
@@ -0,0 +1,30 @@
1
+ import type { SelectOption } from "./operator-select";
2
+ import type { FilterSelectFlat } from "./use-filter-select";
3
+ export declare const context: import("react").Context<{
4
+ readonly filter: FilterSelectFlat;
5
+ readonly extender: "AND" | "OR" | null;
6
+ readonly showExtender: boolean;
7
+ readonly onExtenderChange: (v: "AND" | "OR" | null) => void;
8
+ readonly operatorOptions: SelectOption[];
9
+ readonly operatorValue: SelectOption | null;
10
+ readonly operatorOnChange: (v: SelectOption) => void;
11
+ readonly value: string | number | null | undefined;
12
+ readonly valueDisabled: boolean;
13
+ readonly onValueChange: (v: string | number | null) => void;
14
+ readonly isNumberInput: boolean;
15
+ readonly filterHasNoValue: boolean;
16
+ }>;
17
+ export declare const useFilterRow: () => {
18
+ readonly filter: FilterSelectFlat;
19
+ readonly extender: "AND" | "OR" | null;
20
+ readonly showExtender: boolean;
21
+ readonly onExtenderChange: (v: "AND" | "OR" | null) => void;
22
+ readonly operatorOptions: SelectOption[];
23
+ readonly operatorValue: SelectOption | null;
24
+ readonly operatorOnChange: (v: SelectOption) => void;
25
+ readonly value: string | number | null | undefined;
26
+ readonly valueDisabled: boolean;
27
+ readonly onValueChange: (v: string | number | null) => void;
28
+ readonly isNumberInput: boolean;
29
+ readonly filterHasNoValue: boolean;
30
+ };
@@ -0,0 +1,3 @@
1
+ import { createContext, useContext } from "react";
2
+ export const context = createContext({});
3
+ export const useFilterRow = () => useContext(context);
@@ -0,0 +1,13 @@
1
+ import type { FilterSelectFlat } from "./use-filter-select";
2
+ import type { SelectOption } from "./operator-select";
3
+ export interface SelectSlotProps {
4
+ readonly options: SelectOption[];
5
+ readonly value: SelectOption | null;
6
+ readonly onChange: (v: SelectOption) => void;
7
+ }
8
+ export interface FilterRowProps {
9
+ readonly filter: FilterSelectFlat;
10
+ }
11
+ export declare const FilterRow: import("react").ForwardRefExoticComponent<FilterRowProps & {
12
+ children?: import("react").ReactNode | undefined;
13
+ } & import("react").RefAttributes<HTMLDivElement>>;