@open-grid/primitives 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/index.d.ts +931 -0
- package/dist/index.js +2084 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Open Grid contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @open-grid/primitives
|
|
2
|
+
|
|
3
|
+
Unstyled DOM prop helpers and interaction utilities for Open Grid renderers.
|
|
4
|
+
|
|
5
|
+
Use this package when building framework UI layers that need shared accessibility attributes and renderer-neutral DOM behavior.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @open-grid/primitives
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Most applications should consume these contracts through `@open-grid/react-ui`, `@open-grid/vue-ui`, or `@open-grid/svelte-ui`. Direct use is intended for custom renderer authors who need the same accessibility, interaction, preference, clipboard, download, and measurement behavior.
|
|
14
|
+
|
|
15
|
+
Versioned grid-preference helpers serialize, parse, read, write, and remove durable column visibility, sizing, order, pinning, and density preferences. Product-provided valid column ids remove stale or unknown fields, malformed values are normalized safely, transient query and interaction state is never serialized, and unavailable or denied browser storage degrades to a no-op.
|
|
16
|
+
|
|
17
|
+
Header drag end action helpers keep drag-to-group-panel and column-reorder decisions aligned across React, Vue, and Svelte renderers, including shared action type guards.
|
|
18
|
+
|
|
19
|
+
Pointer drag movement helpers keep drag-threshold state updates shared while renderers retain pointer listener lifecycles.
|
|
20
|
+
|
|
21
|
+
Pointer listener target helpers keep default browser listener targets and SSR-safe no-op cleanup shared while renderers retain pointer session state.
|
|
22
|
+
|
|
23
|
+
Pointer capture target helpers keep pointer capture event target extraction, structural target guarding, and failure handling shared while preserving renderer-owned pointer lifecycles.
|
|
24
|
+
|
|
25
|
+
Measured block-size target helpers keep ResizeObserver row-height fallback handling structural while renderers retain actual observer lifecycles.
|
|
26
|
+
|
|
27
|
+
Measured element target guards keep renderer measurement callbacks on shared structural row/column element contracts.
|
|
28
|
+
|
|
29
|
+
ResizeObserver dataset target guards keep row/column measurement id lookup structural while renderers retain observer lifecycle and element registration.
|
|
30
|
+
|
|
31
|
+
ResizeObserver constructor helpers keep browser support detection and observer creation shared while renderers retain lifecycle timing and state updates.
|
|
32
|
+
|
|
33
|
+
Cell editor focus helpers keep autofocus and selectable-editor text selection shared while renderers retain lifecycle timing.
|
|
34
|
+
|
|
35
|
+
Cell editor event value helpers keep React/Vue direct editor structural target value handling aligned while Svelte retains declarative value binding.
|
|
36
|
+
|
|
37
|
+
Cell edit validation message helpers keep invalid edit message fallback handling shared through a structural validation event contract.
|
|
38
|
+
|
|
39
|
+
Browser text IO environment helpers keep clipboard and export-download default browser adapters shared while preserving renderer-owned user-trigger timing.
|
|
40
|
+
|
|
41
|
+
Grid shortcut target helpers keep interactive-control isolation and keyboard event target/currentTarget extraction shared across React, Vue, and Svelte renderers.
|
|
42
|
+
|
|
43
|
+
Row-selection toggle guards keep preventable click and keyboard row-selection decisions shared across React, Vue, and Svelte renderers.
|
|
44
|
+
|
|
45
|
+
Prevented-event default reflection helpers keep core event `preventDefault()` decisions aligned when renderers need to reflect them onto source DOM events.
|
|
46
|
+
|
|
47
|
+
Column resize default-prevention guards keep start and apply decisions shared while renderers retain pointer and keyboard event wiring.
|
|
48
|
+
|
|
49
|
+
Virtual row, body, inline-size, group indentation, and pinned-column offset style helpers keep row virtualization positioning, total-height output, canvas widths, spacer widths, virtualized header-row widths, grouped-row padding, and sticky pinned offsets aligned across object-style and text-style renderer bindings.
|
|
50
|
+
|
|
51
|
+
Header action menu descriptor helpers keep default item labels, disabled states, ordering, and grouping availability shared across renderers.
|
|
52
|
+
|
|
53
|
+
Row and column id/index lookup helpers keep renderer-owned collections searchable through the same primitive helpers.
|
|
54
|
+
|
|
55
|
+
Header action menu item type guards keep action, custom, label, and separator narrowing shared while custom item helpers also share user-prop fallback behavior.
|
|
56
|
+
|
|
57
|
+
Header action menu keyboard action type guards keep close, focus, and tab-close branching shared while renderers retain scheduling and DOM focus timing.
|
|
58
|
+
|
|
59
|
+
Header action menu active-element helpers keep owner-document and fallback-document focus lookup shared while renderers retain menu scheduling.
|
|
60
|
+
|
|
61
|
+
Header action menu focus target helpers keep keyboard event menu-container extraction and structural target shape validation shared across renderers.
|
|
62
|
+
|
|
63
|
+
Header action menu trigger focus helpers keep direct/id-based structural trigger focus restoration shared while renderers retain scheduling timing.
|
|
64
|
+
|
|
65
|
+
Header action menu structural item focus helpers filter focusable menu items and report whether a menu focus target was available while preserving renderer-owned scheduling.
|