@toclocoinc/lattice-grid 1.80.0 → 1.81.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +4 -4
- package/docs/THEMING.md +6 -3
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/gantt.html +1 -1
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +1 -1
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/presets.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/types.html +1 -1
- package/docs/api-detail.html +4 -4
- package/docs/warnings.json +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +3 -3
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +2 -2
- package/modules/ai.min.cjs +2 -2
- package/modules/ai.min.js +2 -2
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +2 -2
- package/modules/alarms.min.cjs +2 -2
- package/modules/alarms.min.js +2 -2
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +2 -2
- package/modules/charts.min.cjs +2 -2
- package/modules/charts.min.js +2 -2
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +2 -2
- package/modules/dashboard.min.cjs +2 -2
- package/modules/dashboard.min.js +2 -2
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +2 -2
- package/modules/data-router.min.cjs +2 -2
- package/modules/data-router.min.js +2 -2
- package/modules/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +2 -2
- package/modules/deckgl.min.cjs +2 -2
- package/modules/deckgl.min.js +2 -2
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +2 -2
- package/modules/dhtmlx-compat.min.cjs +2 -2
- package/modules/dhtmlx-compat.min.js +2 -2
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +2 -2
- package/modules/gantt.min.cjs +2 -2
- package/modules/gantt.min.js +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +1 -1
- package/modules/geo-us-states.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +2 -2
- package/modules/geometry.min.cjs +2 -2
- package/modules/geometry.min.js +2 -2
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +3 -3
- package/modules/htmx.min.cjs +3 -3
- package/modules/htmx.min.js +3 -3
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +2 -2
- package/modules/kanban.min.cjs +2 -2
- package/modules/kanban.min.js +2 -2
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +2 -2
- package/modules/kpi.min.cjs +2 -2
- package/modules/kpi.min.js +2 -2
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +2 -2
- package/modules/layout.min.cjs +2 -2
- package/modules/layout.min.js +2 -2
- package/modules/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +2 -2
- package/modules/leaflet.min.cjs +2 -2
- package/modules/leaflet.min.js +2 -2
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +2 -2
- package/modules/list.min.cjs +2 -2
- package/modules/list.min.js +2 -2
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/presets/antd5.css +23 -0
- package/modules/presets/bootstrap5.css +46 -5
- package/modules/presets/fluent2.css +31 -4
- package/modules/presets/material3.css +53 -5
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +2 -2
- package/modules/presets.min.cjs +2 -2
- package/modules/presets.min.js +2 -2
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +2 -2
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +2 -2
- package/modules/tabs.min.cjs +2 -2
- package/modules/tabs.min.js +2 -2
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +3 -3
- package/modules/webcomponent.min.cjs +3 -3
- package/modules/webcomponent.min.js +3 -3
- package/package.json +1 -1
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* `--bs-body-color`, `--bs-border-color`, `--bs-border-radius`,
|
|
13
13
|
* `--bs-font-sans-serif`, `--bs-body-font-size`, `--bs-link-color`,
|
|
14
14
|
* `--bs-emphasis-color`, `--bs-tertiary-bg`, `--bs-table-striped-bg`,
|
|
15
|
-
* `--bs-table-hover-bg
|
|
15
|
+
* `--bs-table-hover-bg`, `--bs-table-active-bg` (BACKLOG-0001582) and
|
|
16
|
+
* `--bs-focus-ring-color` — read LIVE, via
|
|
16
17
|
* `var(--bs-name, fallback)`. Bootstrap declares every one of those on
|
|
17
18
|
* `:root` (the table pair are declared per-`.table` element, so they carry
|
|
18
19
|
* through only when `.lattice` sits inside a Bootstrap `.table`; elsewhere
|
|
@@ -43,18 +44,56 @@
|
|
|
43
44
|
* Bootstrap does not redefine its border-radius or font tokens under
|
|
44
45
|
* `[data-bs-theme="dark"]`, so nesting them under one `data-theme` value only
|
|
45
46
|
* would silently drop them under the other.
|
|
47
|
+
*
|
|
48
|
+
* BACKLOG-0001582 adds the shape the MUST roles above never covered:
|
|
49
|
+
*
|
|
50
|
+
* - `--lattice-cell-border-width: 0` — a stock Bootstrap `.table` draws
|
|
51
|
+
* horizontal rules only (`.table > :not(:first-child) { border-top }`); no
|
|
52
|
+
* vertical rule exists absent the `.table-bordered` variant this preset
|
|
53
|
+
* does not opt into.
|
|
54
|
+
* - `--lattice-row-height`/`--lattice-header-height: 41px` — Bootstrap's own
|
|
55
|
+
* default `.table` cell box: `--bs-table-cell-padding-y: 0.5rem` (8px) top
|
|
56
|
+
* and bottom plus the default `line-height: 1.5` on `1rem` (16px) body
|
|
57
|
+
* text (24px) = 40px, the card's own cited "~41px" rounding. A stock table
|
|
58
|
+
* does not size `<thead>` cells differently from `<tbody>` ones, so header
|
|
59
|
+
* height mirrors row height, the same simplification `antd5.css` makes.
|
|
60
|
+
* - `--lattice-header-font-weight: 700` — Bootstrap's Reboot does not reset
|
|
61
|
+
* `<th>`'s browser-default `font-weight: bold`, so a stock table head is
|
|
62
|
+
* bold, unlike its body.
|
|
63
|
+
* - `--lattice-surface` now reads `var(--bs-body-bg, …)` — "the table head
|
|
64
|
+
* colour" — rather than `--bs-tertiary-bg`: a stock Bootstrap `<thead>`
|
|
65
|
+
* carries no background of its own (`--bs-table-bg` is transparent absent
|
|
66
|
+
* a `.table-*` variant), so it shows the page body colour through, the
|
|
67
|
+
* same "plain" header `material3.css`/`fluent2.css` set for their own
|
|
68
|
+
* systems. `--bs-tertiary-bg` remains available for anything reading
|
|
69
|
+
* `--lattice-surface-alt` — untouched, so striping is unaffected.
|
|
70
|
+
* - `--lattice-selected-background` reads `var(--bs-table-active-bg, …)` —
|
|
71
|
+
* Bootstrap's own `.table-active` row treatment, one Sass factor darker
|
|
72
|
+
* than hover by Bootstrap's own convention (`$table-hover-bg-factor: .075`
|
|
73
|
+
* already read above, `$table-active-bg-factor: .1` for the literal
|
|
74
|
+
* fallback here) — the closest built-in "this row is selected" look Boot-
|
|
75
|
+
* strap ships, since a plain `.table` has no selection state of its own.
|
|
46
76
|
*/
|
|
47
77
|
|
|
48
78
|
.lattice {
|
|
49
79
|
--lattice-radius: var(--bs-border-radius, 0.375rem);
|
|
50
80
|
--lattice-font-family: var(--bs-font-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
|
|
51
81
|
--lattice-font-size: var(--bs-body-font-size, 1rem);
|
|
82
|
+
--lattice-header-font-weight: 700; /* a stock <th> is browser-default bold; Reboot does not reset it */
|
|
83
|
+
|
|
84
|
+
/* Shape (BACKLOG-0001582): divider-only, and the box a stock .table cell's
|
|
85
|
+
own padding/line-height produces — see the file header note. */
|
|
86
|
+
--lattice-cell-border-width: 0;
|
|
87
|
+
--lattice-row-height: 41px;
|
|
88
|
+
--lattice-header-height: 41px;
|
|
52
89
|
}
|
|
53
90
|
|
|
54
91
|
.lattice[data-theme="light"], .lattice[data-theme="auto"] {
|
|
55
|
-
/* surfaces / borders
|
|
92
|
+
/* surfaces / borders. --lattice-surface reads --bs-body-bg, not
|
|
93
|
+
--bs-tertiary-bg: a stock <thead> carries no background of its own (see
|
|
94
|
+
the file header note) — the table head colour is the body colour. */
|
|
56
95
|
--lattice-background: var(--bs-body-bg, #fff);
|
|
57
|
-
--lattice-surface: var(--bs-
|
|
96
|
+
--lattice-surface: var(--bs-body-bg, #fff);
|
|
58
97
|
--lattice-surface-alt: var(--bs-table-striped-bg, rgba(0, 0, 0, 0.05));
|
|
59
98
|
--lattice-border-color: var(--bs-border-color, #dee2e6);
|
|
60
99
|
|
|
@@ -67,8 +106,9 @@
|
|
|
67
106
|
--lattice-accent-contrast: #fff;
|
|
68
107
|
--lattice-link-color: var(--bs-link-color, #0d6efd);
|
|
69
108
|
|
|
70
|
-
/* table hover, reused as the row-hover
|
|
109
|
+
/* table hover/active, reused as the row-hover/selected fills */
|
|
71
110
|
--lattice-hovered-background: var(--bs-table-hover-bg, rgba(0, 0, 0, 0.075));
|
|
111
|
+
--lattice-selected-background: var(--bs-table-active-bg, rgba(0, 0, 0, 0.1));
|
|
72
112
|
|
|
73
113
|
/* focus ring: Bootstrap's own focus-ring token is a translucent primary,
|
|
74
114
|
meant as a box-shadow colour rather than a solid line — kept as-is
|
|
@@ -79,7 +119,7 @@
|
|
|
79
119
|
|
|
80
120
|
.lattice[data-theme="dark"] {
|
|
81
121
|
--lattice-background: var(--bs-body-bg, #212529);
|
|
82
|
-
--lattice-surface: var(--bs-
|
|
122
|
+
--lattice-surface: var(--bs-body-bg, #212529);
|
|
83
123
|
--lattice-surface-alt: var(--bs-table-striped-bg, rgba(255, 255, 255, 0.05));
|
|
84
124
|
--lattice-border-color: var(--bs-border-color, #495057);
|
|
85
125
|
|
|
@@ -93,6 +133,7 @@
|
|
|
93
133
|
--lattice-link-color: var(--bs-link-color, #6ea8fe);
|
|
94
134
|
|
|
95
135
|
--lattice-hovered-background: var(--bs-table-hover-bg, rgba(255, 255, 255, 0.075));
|
|
136
|
+
--lattice-selected-background: var(--bs-table-active-bg, rgba(255, 255, 255, 0.1));
|
|
96
137
|
|
|
97
138
|
--lattice-focus-color: var(--bs-focus-ring-color, rgba(13, 110, 253, 0.25));
|
|
98
139
|
}
|
|
@@ -41,6 +41,28 @@
|
|
|
41
41
|
* menus and dialogs in Fluent 2 itself) onto `--lattice-popup-shadow`, which
|
|
42
42
|
* the contract documents as "menus, tooltips, the filter popup" — the same
|
|
43
43
|
* role Fluent uses shadow8 for.
|
|
44
|
+
*
|
|
45
|
+
* BACKLOG-0001582 adds the shape the colour/radius/font MUST roles never
|
|
46
|
+
* covered:
|
|
47
|
+
*
|
|
48
|
+
* - `--lattice-cell-border-width: 0` — Fluent 2's own `DetailsList`/table
|
|
49
|
+
* guidance draws horizontal row separators only, no vertical rule.
|
|
50
|
+
* - `--lattice-row-height`/`--lattice-header-height: 44px` — the card's own
|
|
51
|
+
* cited Fluent row height (`@fluentui/tokens`' medium row size). Fluent's
|
|
52
|
+
* own default table does not size its header row differently from a body
|
|
53
|
+
* row, so header height mirrors row height, the same simplification
|
|
54
|
+
* `antd5.css`/`bootstrap5.css` make for their own systems.
|
|
55
|
+
* - `--lattice-surface` now equals `--lattice-background` in both themes,
|
|
56
|
+
* rather than `colorNeutralBackground2`/`3` (a 1-2% grey tint) — Fluent's
|
|
57
|
+
* own default table header sits on `colorNeutralBackground1`, the same
|
|
58
|
+
* surface the body uses, not a tinted tier; `--lattice-surface-alt` (the
|
|
59
|
+
* zebra-stripe role) is untouched.
|
|
60
|
+
*
|
|
61
|
+
* `--lattice-hovered-background`/`--lattice-selected-background` already
|
|
62
|
+
* read Fluent's own subtle-interaction tones and `--lattice-header-font-
|
|
63
|
+
* weight: 600` (`fontWeightSemibold`) already matches Fluent's own header
|
|
64
|
+
* weight — neither needed a change. No `--lattice-density-scale`: 44px is
|
|
65
|
+
* taller than Lattice's own 28px compact default, not shorter.
|
|
44
66
|
*/
|
|
45
67
|
|
|
46
68
|
/*
|
|
@@ -57,12 +79,17 @@
|
|
|
57
79
|
--lattice-font-size-lg: 16px; /* fontSizeBase400 */
|
|
58
80
|
--lattice-header-font-weight: 600; /* fontWeightSemibold */
|
|
59
81
|
--lattice-line-height: 1.43; /* lineHeightBase300 */
|
|
82
|
+
|
|
83
|
+
/* Shape (BACKLOG-0001582): divider-only, and Fluent's own cited row height. */
|
|
84
|
+
--lattice-cell-border-width: 0;
|
|
85
|
+
--lattice-row-height: 44px;
|
|
86
|
+
--lattice-header-height: 44px;
|
|
60
87
|
}
|
|
61
88
|
|
|
62
89
|
.lattice[data-theme="light"], .lattice[data-theme="auto"] {
|
|
63
90
|
--lattice-background: #FFFFFF; /* colorNeutralBackground1 */
|
|
64
|
-
--lattice-surface: #
|
|
65
|
-
--lattice-surface-alt: #F5F5F5; /* colorNeutralBackground3 */
|
|
91
|
+
--lattice-surface: #FFFFFF; /* plain — equals --lattice-background */
|
|
92
|
+
--lattice-surface-alt: #F5F5F5; /* colorNeutralBackground3 (zebra stripe only) */
|
|
66
93
|
--lattice-border-color: #D1D1D1; /* colorNeutralStroke1 */
|
|
67
94
|
--lattice-border-strong: #B3B0AD; /* colorNeutralStroke1Hover-ish */
|
|
68
95
|
|
|
@@ -98,8 +125,8 @@
|
|
|
98
125
|
|
|
99
126
|
.lattice[data-theme="dark"] {
|
|
100
127
|
--lattice-background: #292929; /* colorNeutralBackground1 (dark) */
|
|
101
|
-
--lattice-surface: #
|
|
102
|
-
--lattice-surface-alt: #2E2E2E; /* colorNeutralBackground3 (dark) */
|
|
128
|
+
--lattice-surface: #292929; /* plain — equals --lattice-background */
|
|
129
|
+
--lattice-surface-alt: #2E2E2E; /* colorNeutralBackground3 (dark, zebra stripe only) */
|
|
103
130
|
--lattice-border-color: #666666; /* colorNeutralStroke1 (dark) */
|
|
104
131
|
--lattice-border-strong: #858585;
|
|
105
132
|
|
|
@@ -34,6 +34,43 @@
|
|
|
34
34
|
* (the warning-fill tone, matching the amber "find" highlight convention),
|
|
35
35
|
* and `--lattice-skeleton-color` (the outline-variant tone already used for
|
|
36
36
|
* `border-color`).
|
|
37
|
+
*
|
|
38
|
+
* BACKLOG-0001582 adds the shape MUST alone never carried: a MUST-complete
|
|
39
|
+
* preset still had Lattice's own 28px compact row, a vertical rule on every
|
|
40
|
+
* header cell (`--lattice-cell-border-width`, unset, drew the base border
|
|
41
|
+
* width) and a tinted `surface-container-low` header band — none of which
|
|
42
|
+
* read as "Material" beside a real `@mui/x-data-grid` table
|
|
43
|
+
* (`test/preset-proportions-browser.test.js` renders one side by side).
|
|
44
|
+
* Fixed here:
|
|
45
|
+
*
|
|
46
|
+
* 3. **`--lattice-cell-border-width: 0`.** MUI X DataGrid draws horizontal
|
|
47
|
+
* dividers only; Material's own table guidance has no vertical rule
|
|
48
|
+
* either. `--lattice-border-width` itself is untouched, so an explicit
|
|
49
|
+
* `gridLines: 'vertical'|'both'` config still draws its own line
|
|
50
|
+
* (`structure.css`'s own note on the token).
|
|
51
|
+
* 4. **`--lattice-row-height: 52px` / `--lattice-header-height: 56px`.**
|
|
52
|
+
* `@mui/x-data-grid`'s own defaults (`rowHeight`/`columnHeaderHeight`),
|
|
53
|
+
* confirmed against a real installed `DataGrid` in the side-by-side test
|
|
54
|
+
* rather than only cited — a hardcoded guess here would be exactly the
|
|
55
|
+
* "declared but not verified" gap this project's Definition of Done
|
|
56
|
+
* forbids, so the side-by-side test is what makes these two literals a
|
|
57
|
+
* fact rather than a transcription.
|
|
58
|
+
* 5. **`--lattice-surface` no longer carries the M3 `surface-container-low`
|
|
59
|
+
* tint** (`#F3EDF7` light / `#2B2930` dark) — it now equals
|
|
60
|
+
* `--lattice-background` in both themes. MUI X's own header, footer and
|
|
61
|
+
* toolbar all paint `theme.palette.background.paper` (the plain surface),
|
|
62
|
+
* not a tinted container tier; M3's 5-level surface-container ladder has
|
|
63
|
+
* no contract role of its own either (SPIKE-THEME-PRESETS.md §1), so
|
|
64
|
+
* "plain" is the closer read of both sources. `--lattice-surface-alt`
|
|
65
|
+
* (the zebra-stripe role) is untouched and keeps its own tint.
|
|
66
|
+
*
|
|
67
|
+
* `--lattice-hovered-background`/`--lattice-selected-background` already read
|
|
68
|
+
* M3's own primary-tinted state-layer alphas (8%/12%) and needed no change;
|
|
69
|
+
* `--lattice-header-font-weight: 500` (M3 label-large) likewise predates this
|
|
70
|
+
* card. No `--lattice-density-scale` override: none of the four shipped
|
|
71
|
+
* presets' cited row heights are shorter than Lattice's own 28px compact
|
|
72
|
+
* default, so none is "denser" in the sense the card's density-scale clause
|
|
73
|
+
* means.
|
|
37
74
|
*/
|
|
38
75
|
|
|
39
76
|
/*
|
|
@@ -52,13 +89,24 @@
|
|
|
52
89
|
--lattice-font-weight: 400;
|
|
53
90
|
--lattice-header-font-weight: 500; /* M3 label-large */
|
|
54
91
|
--lattice-line-height: 1.43;
|
|
92
|
+
|
|
93
|
+
/* Shape, not colour, so declared once like radius/typography above
|
|
94
|
+
(BACKLOG-0001582). No vertical rule (MUI X DataGrid draws horizontal
|
|
95
|
+
dividers only) and the two-tier row/header heights DataGrid itself ships
|
|
96
|
+
with — see the file header note 4 for how these are verified. */
|
|
97
|
+
--lattice-cell-border-width: 0;
|
|
98
|
+
--lattice-row-height: 52px;
|
|
99
|
+
--lattice-header-height: 56px;
|
|
55
100
|
}
|
|
56
101
|
|
|
57
102
|
.lattice[data-theme="light"], .lattice[data-theme="auto"] {
|
|
58
|
-
/* surface roles: M3 surface / surface
|
|
103
|
+
/* surface roles: M3 surface / outline. `--lattice-surface` is deliberately
|
|
104
|
+
the same value as `--lattice-background` (see file header note 5) — the
|
|
105
|
+
plain header/totals/status-bar fill MUI X DataGrid itself ships, not a
|
|
106
|
+
tinted M3 surface-container tier. */
|
|
59
107
|
--lattice-background: #FFFBFE; /* M3 surface */
|
|
60
|
-
--lattice-surface: #
|
|
61
|
-
--lattice-surface-alt: #ECE6F0; /* M3 surface-container */
|
|
108
|
+
--lattice-surface: #FFFBFE; /* plain — equals --lattice-background */
|
|
109
|
+
--lattice-surface-alt: #ECE6F0; /* M3 surface-container (zebra stripe only) */
|
|
62
110
|
--lattice-border-color: #CAC4D0; /* M3 outline-variant */
|
|
63
111
|
--lattice-border-strong: #79747E; /* M3 outline */
|
|
64
112
|
|
|
@@ -111,8 +159,8 @@
|
|
|
111
159
|
|
|
112
160
|
.lattice[data-theme="dark"] {
|
|
113
161
|
--lattice-background: #1C1B1F; /* M3 dark surface */
|
|
114
|
-
--lattice-surface: #
|
|
115
|
-
--lattice-surface-alt: #322F35; /* surface-container (dark) */
|
|
162
|
+
--lattice-surface: #1C1B1F; /* plain — equals --lattice-background */
|
|
163
|
+
--lattice-surface-alt: #322F35; /* surface-container (dark, zebra stripe only) */
|
|
116
164
|
--lattice-border-color: #49454F; /* outline-variant (dark) */
|
|
117
165
|
--lattice-border-strong: #938F99; /* outline (dark) */
|
|
118
166
|
|
package/modules/presets.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, presets module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var z=Object.create(null),q=Object.create(null);function V(i,b){z[i]=b}function W(i){var b=q[i];if(b)return b;var p=Object.create(null);q[i]=p;var j=z[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,W),p}V("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return S}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return k}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return T}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return R}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return v}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return de}});const p="1.80.0";async function j(){return p}const y="1.80.0",d=new Set,w=2e3;function P(e){if(d.add(e),d.size>w){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function S(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function L(){d.clear(),h.length=0}function $(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function G(e,t){e||$(t)}const Z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e){return typeof e=="function"}function J(e){return e==null}function U(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function k(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return I.set(e,t),t}const A=new Map;function T(e){let t=A.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const F=n[s];o[F]==null&&(o[F]={}),o=o[F]}o!=null&&(o[n[r]]=f)}}return A.set(e,t),t}function Y(e,t){return k(t)(e)}function Q(e,t,n){T(t)(e,n)}function X(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const x={"&":"&","<":"<",">":">",'"':""","'":"'"};function _(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>x[n]):t}function ee(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function te(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function ne(e){return e==null?[]:Array.isArray(e)?e:[e]}const re=Object.freeze(new Set(["__proto__","constructor","prototype"]));function C(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(re.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?C(n[r],l):l)}return n}function ie(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ue{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const M=new Map;function ce(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=M.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),M.set(n,r)),r}function oe(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function R(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const D=typeof requestAnimationFrame=="function";function v(e){return D?requestAnimationFrame(e):setTimeout(()=>e(R()),16)}function E(e){e!=null&&(D?cancelAnimationFrame(e):clearTimeout(e))}function ae(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=v(r))};return l.cancel=()=>{E(t),t=null,n=null},l.flush=()=>{t!==null&&(E(t),r())},l}function le(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function fe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let se=0;function de(e="l"){return`${e}${(++se).toString(36)}`}}),V("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),S=parseInt(m.slice(2,4),16),N=parseInt(m.slice(4,6),16);return`rgba(${O}, ${S}, ${N}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function w(c){return`.lattice {
|
|
6
|
+
var z=Object.create(null),q=Object.create(null);function V(i,b){z[i]=b}function W(i){var b=q[i];if(b)return b;var p=Object.create(null);q[i]=p;var j=z[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,W),p}V("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return S}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return k}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return T}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return _}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return R}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return v}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return de}});const p="1.81.0";async function j(){return p}const y="1.81.0",d=new Set,w=2e3;function P(e){if(d.add(e),d.size>w){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function S(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function L(){d.clear(),h.length=0}function $(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function G(e,t){e||$(t)}const Z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e){return typeof e=="function"}function J(e){return e==null}function U(e){return e==null||e===""}function K(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const I=new Map;function k(e){let t=I.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return I.set(e,t),t}const A=new Map;function T(e){let t=A.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const F=n[s];o[F]==null&&(o[F]={}),o=o[F]}o!=null&&(o[n[r]]=f)}}return A.set(e,t),t}function Y(e,t){return k(t)(e)}function Q(e,t,n){T(t)(e,n)}function X(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const x={"&":"&","<":"<",">":">",'"':""","'":"'"};function _(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>x[n]):t}function ee(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function te(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function ne(e){return e==null?[]:Array.isArray(e)?e:[e]}const re=Object.freeze(new Set(["__proto__","constructor","prototype"]));function C(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(re.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?C(n[r],l):l)}return n}function ie(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ue{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const M=new Map;function ce(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=M.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),M.set(n,r)),r}function oe(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function R(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const D=typeof requestAnimationFrame=="function";function v(e){return D?requestAnimationFrame(e):setTimeout(()=>e(R()),16)}function E(e){e!=null&&(D?cancelAnimationFrame(e):clearTimeout(e))}function ae(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=v(r))};return l.cancel=()=>{E(t),t=null,n=null},l.flush=()=>{t!==null&&(E(t),r())},l}function le(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function fe(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let se=0;function de(e="l"){return`${e}${(++se).toString(36)}`}}),V("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),S=parseInt(m.slice(2,4),16),N=parseInt(m.slice(4,6),16);return`rgba(${O}, ${S}, ${N}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function w(c){return`.lattice {
|
|
7
7
|
${Object.entries(c).map(([a,m])=>` ${a}: ${m};`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
}
|
package/modules/presets.min.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, presets module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(B){"use strict";var F=Object.create(null),I=Object.create(null);function k(i,b){F[i]=b}function A(i){var b=I[i];if(b)return b;var p=Object.create(null);I[i]=p;var j=F[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,A),p}k("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return z}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return me}});const p="1.80.0";async function j(){return p}const y="1.80.0",d=new Set,S=2e3;function P(e){if(d.add(e),d.size>S){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function E(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function G(){d.clear(),h.length=0}function C(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function Z(e,t){e||C(t)}const H=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function J(e){return typeof e=="function"}function U(e){return e==null}function K(e){return e==null||e===""}function Y(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const R=new Map;function M(e){let t=R.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return R.set(e,t),t}const v=new Map;function D(e){let t=v.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const T=n[s];o[T]==null&&(o[T]={}),o=o[T]}o!=null&&(o[n[r]]=f)}}return v.set(e,t),t}function Q(e,t){return M(t)(e)}function X(e,t,n){D(t)(e,n)}function x(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const _={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>_[n]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const ie=Object.freeze(new Set(["__proto__","constructor","prototype"]));function z(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(ie.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?z(n[r],l):l)}return n}function ue(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ce{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const q=new Map;function oe(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=q.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),q.set(n,r)),r}function ae(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function L(e){return W?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function $(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function le(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=L(r))};return l.cancel=()=>{$(t),t=null,n=null},l.flush=()=>{t!==null&&($(t),r())},l}function fe(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function se(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function me(e="l"){return`${e}${(++de).toString(36)}`}}),k("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),N=parseInt(m.slice(2,4),16),E=parseInt(m.slice(4,6),16);return`rgba(${O}, ${N}, ${E}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function S(c){return`.lattice {
|
|
6
|
+
(function(B){"use strict";var F=Object.create(null),I=Object.create(null);function k(i,b){F[i]=b}function A(i){var b=I[i];if(b)return b;var p=Object.create(null);I[i]=p;var j=F[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,A),p}k("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return z}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return me}});const p="1.81.0";async function j(){return p}const y="1.81.0",d=new Set,S=2e3;function P(e){if(d.add(e),d.size>S){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function E(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function G(){d.clear(),h.length=0}function C(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function Z(e,t){e||C(t)}const H=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function J(e){return typeof e=="function"}function U(e){return e==null}function K(e){return e==null||e===""}function Y(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const R=new Map;function M(e){let t=R.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return R.set(e,t),t}const v=new Map;function D(e){let t=v.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const T=n[s];o[T]==null&&(o[T]={}),o=o[T]}o!=null&&(o[n[r]]=f)}}return v.set(e,t),t}function Q(e,t){return M(t)(e)}function X(e,t,n){D(t)(e,n)}function x(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const _={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>_[n]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const ie=Object.freeze(new Set(["__proto__","constructor","prototype"]));function z(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(ie.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?z(n[r],l):l)}return n}function ue(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ce{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const q=new Map;function oe(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=q.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),q.set(n,r)),r}function ae(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function L(e){return W?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function $(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function le(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=L(r))};return l.cancel=()=>{$(t),t=null,n=null},l.flush=()=>{t!==null&&($(t),r())},l}function fe(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function se(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function me(e="l"){return`${e}${(++de).toString(36)}`}}),k("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),N=parseInt(m.slice(2,4),16),E=parseInt(m.slice(4,6),16);return`rgba(${O}, ${N}, ${E}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function S(c){return`.lattice {
|
|
7
7
|
${Object.entries(c).map(([a,m])=>` ${a}: ${m};`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
}
|
package/modules/presets.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, presets module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(B){"use strict";var F=Object.create(null),I=Object.create(null);function k(i,b){F[i]=b}function A(i){var b=I[i];if(b)return b;var p=Object.create(null);I[i]=p;var j=F[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,A),p}k("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return z}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return me}});const p="1.80.0";async function j(){return p}const y="1.80.0",d=new Set,S=2e3;function P(e){if(d.add(e),d.size>S){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function E(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function G(){d.clear(),h.length=0}function C(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function Z(e,t){e||C(t)}const H=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function J(e){return typeof e=="function"}function U(e){return e==null}function K(e){return e==null||e===""}function Y(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const R=new Map;function M(e){let t=R.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return R.set(e,t),t}const v=new Map;function D(e){let t=v.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const T=n[s];o[T]==null&&(o[T]={}),o=o[T]}o!=null&&(o[n[r]]=f)}}return v.set(e,t),t}function Q(e,t){return M(t)(e)}function X(e,t,n){D(t)(e,n)}function x(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const _={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>_[n]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const ie=Object.freeze(new Set(["__proto__","constructor","prototype"]));function z(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(ie.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?z(n[r],l):l)}return n}function ue(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ce{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const q=new Map;function oe(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=q.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),q.set(n,r)),r}function ae(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function L(e){return W?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function $(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function le(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=L(r))};return l.cancel=()=>{$(t),t=null,n=null},l.flush=()=>{t!==null&&($(t),r())},l}function fe(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function se(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function me(e="l"){return`${e}${(++de).toString(36)}`}}),k("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),N=parseInt(m.slice(2,4),16),E=parseInt(m.slice(4,6),16);return`rgba(${O}, ${N}, ${E}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function S(c){return`.lattice {
|
|
6
|
+
(function(B){"use strict";var F=Object.create(null),I=Object.create(null);function k(i,b){F[i]=b}function A(i){var b=I[i];if(b)return b;var p=Object.create(null);I[i]=p;var j=F[i];if(!j)throw new Error("[lattice] missing module: "+i);return j(p,A),p}k("packages/core/src/internal/util.js",function(i,b){"use strict";Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return y}}),Object.defineProperty(i,"reportedWarnings",{enumerable:!0,get:function(){return m}}),Object.defineProperty(i,"warnOnce",{enumerable:!0,get:function(){return N}}),Object.defineProperty(i,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(i,"resetWarnings",{enumerable:!0,get:function(){return G}}),Object.defineProperty(i,"fail",{enumerable:!0,get:function(){return C}}),Object.defineProperty(i,"invariant",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(i,"DEV",{enumerable:!0,get:function(){return H}}),Object.defineProperty(i,"isObject",{enumerable:!0,get:function(){return g}}),Object.defineProperty(i,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(i,"isNil",{enumerable:!0,get:function(){return U}}),Object.defineProperty(i,"isBlank",{enumerable:!0,get:function(){return K}}),Object.defineProperty(i,"isCtor",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(i,"pathGetter",{enumerable:!0,get:function(){return M}}),Object.defineProperty(i,"pathSetter",{enumerable:!0,get:function(){return D}}),Object.defineProperty(i,"getPath",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(i,"setPath",{enumerable:!0,get:function(){return X}}),Object.defineProperty(i,"humanise",{enumerable:!0,get:function(){return x}}),Object.defineProperty(i,"escapeHtml",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(i,"titleCase",{enumerable:!0,get:function(){return te}}),Object.defineProperty(i,"expand",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(i,"toArray",{enumerable:!0,get:function(){return re}}),Object.defineProperty(i,"merge",{enumerable:!0,get:function(){return z}}),Object.defineProperty(i,"mergeRow",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(i,"Lru",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(i,"collator",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(i,"defaultCompare",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(i,"now",{enumerable:!0,get:function(){return V}}),Object.defineProperty(i,"nextFrame",{enumerable:!0,get:function(){return L}}),Object.defineProperty(i,"cancelFrame",{enumerable:!0,get:function(){return $}}),Object.defineProperty(i,"frameBatched",{enumerable:!0,get:function(){return le}}),Object.defineProperty(i,"settleDebounce",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(i,"whenIdle",{enumerable:!0,get:function(){return se}}),Object.defineProperty(i,"uid",{enumerable:!0,get:function(){return me}});const p="1.81.0";async function j(){return p}const y="1.81.0",d=new Set,S=2e3;function P(e){if(d.add(e),d.size>S){const t=d.values().next().value;t!==void 0&&d.delete(t)}}const h=[],c=500;function u(e,t,n){h.push({key:e,level:t,message:n.map(r=>typeof r=="string"?r:a(r)).join(" "),at:Date.now()}),h.length>c&&h.shift()}function a(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function m(){return h.map(e=>({...e}))}function O(e){if(e.length===0||typeof e[0]!="string")return e;const t=e[0].replace(/^\[lattice\]\s*/,"");return t===e[0]?e:[t,...e.slice(1)]}function N(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"warn",n),console.warn("[lattice]",...n)}function E(e,...t){if(d.has(e))return;P(e);const n=O(t);u(e,"info",n),console.info("[lattice]",...n)}function G(){d.clear(),h.length=0}function C(e,t){const n=new Error(`[lattice] ${e}`);throw t!==void 0&&(n.cause=t),n}function Z(e,t){e||C(t)}const H=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function J(e){return typeof e=="function"}function U(e){return e==null}function K(e){return e==null||e===""}function Y(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const R=new Map;function M(e){let t=R.get(e);if(t)return t;if(!e.includes("."))t=n=>n?.[e];else{const n=e.split("."),r=n.length;t=l=>{let f=l;for(let o=0;o<r;o++){if(f==null)return;f=f[n[o]]}return f}}return R.set(e,t),t}const v=new Map;function D(e){let t=v.get(e);if(t)return t;if(!e.includes("."))t=(n,r)=>{n!=null&&(n[e]=r)};else{const n=e.split("."),r=n.length-1;t=(l,f)=>{let o=l;for(let s=0;s<r;s++){if(o==null)return;const T=n[s];o[T]==null&&(o[T]={}),o=o[T]}o!=null&&(o[n[r]]=f)}}return v.set(e,t),t}function Q(e,t){return M(t)(e)}function X(e,t,n){D(t)(e,n)}function x(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const _={"&":"&","<":"<",">":">",'"':""","'":"'"};function ee(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,n=>_[n]):t}function te(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ne(e,t,n){if(e!==void 0)return e===!0?{enabled:!0,...n}:e===!1?{enabled:!1}:g(e)?e:{[t]:e,enabled:!0}}function re(e){return e==null?[]:Array.isArray(e)?e:[e]}const ie=Object.freeze(new Set(["__proto__","constructor","prototype"]));function z(e,t){if(!g(e))return g(t)?{...t}:t;if(!g(t))return t===void 0?e:t;const n={...e};for(const r of Object.keys(t)){if(ie.has(r))continue;const l=t[r];l!==void 0&&(n[r]=g(l)&&g(n[r])?z(n[r],l):l)}return n}function ue(e,t){if(!g(e)||!g(t)||e===t)return t;const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e,t),n}class ce{#n;#e=new Map;#t;constructor(t=256,n=null){this.#n=t,this.#t=n}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const n=this.#e;if(!n.has(t))return;const r=n.get(t);return n.delete(t),n.set(t,r),r}peek(t){return this.#e.get(t)}set(t,n){const r=this.#e;return r.has(t)&&r.delete(t),r.set(t,n),this.#r(),n}delete(t){const n=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(n,t),n}clear(){if(this.#t)for(const[t,n]of this.#e)this.#t(n,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const n=t.keys().next().value,r=t.get(n);t.delete(n),this.#t&&this.#t(r,n)}}}const q=new Map;function oe(e,t){const n=`${e||""}|${t?JSON.stringify(t):""}`;let r=q.get(n);return r||(r=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),q.set(n,r)),r}function ae(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const n=String(e),r=String(t);return n<r?-1:n>r?1:0}function V(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function L(e){return W?requestAnimationFrame(e):setTimeout(()=>e(V()),16)}function $(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function le(e){let t=null,n=null;const r=()=>{t=null;const f=n;n=null,e(...f||[])},l=(...f)=>{n=f,t===null&&(t=L(r))};return l.cancel=()=>{$(t),t=null,n=null},l.flush=()=>{t!==null&&($(t),r())},l}function fe(e,t){let n=null,r=null;const l=()=>{if(n=null,r===null)return;const s=r;r=null,e(...s),f()},f=()=>{n=setTimeout(l,t),typeof n?.unref=="function"&&n.unref()},o=(...s)=>{n===null?(e(...s),f()):(r=s,clearTimeout(n),f())};return o.flush=()=>{if(n!==null&&clearTimeout(n),n=null,r===null)return;const s=r;r=null,e(...s)},o.cancel=()=>{n!==null&&clearTimeout(n),n=null,r=null},o.pending=()=>n!==null||r!==null,o}function se(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let de=0;function me(e="l"){return`${e}${(++de).toString(36)}`}}),k("packages/modules/presets/index.js",function(i,b){"use strict";Object.defineProperty(i,"themeFromMui",{enumerable:!0,get:function(){return P}}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return h}});const j=b("packages/core/src/internal/util.js").warnOnce;function y(c,u){if(typeof c!="string")return c;const a=c.trim().match(/^#([0-9a-f]{6})$/i);if(!a)return c;const m=a[1],O=parseInt(m.slice(0,2),16),N=parseInt(m.slice(2,4),16),E=parseInt(m.slice(4,6),16);return`rgba(${O}, ${N}, ${E}, ${u})`}function d(c){const u=c.palette,a=u.mode==="dark";return{"--lattice-background":u.background.default,"--lattice-surface":u.background.paper,"--lattice-surface-alt":a?"#2a2a2a":u.grey[50],"--lattice-border-color":u.divider,"--lattice-border-strong":a?u.grey[600]:u.grey[400],"--lattice-foreground":u.text.primary,"--lattice-foreground-muted":u.text.secondary,"--lattice-header-foreground":u.text.primary,"--lattice-accent":u.primary.main,"--lattice-accent-contrast":u.primary.contrastText,"--lattice-link-color":u.primary.main,"--lattice-selected-background":y(u.primary.main,.12),"--lattice-hovered-background":y(u.text.primary,.06),"--lattice-focus-color":u.primary.main,"--lattice-variant-danger-solid":u.error.main,"--lattice-variant-danger-fill":y(u.error.main,.12),"--lattice-variant-warning-solid":u.warning.main,"--lattice-variant-warning-fill":y(u.warning.main,.12),"--lattice-variant-success-solid":u.success.main,"--lattice-variant-success-fill":y(u.success.main,.12),"--lattice-variant-info-solid":u.info.main,"--lattice-variant-info-fill":y(u.info.main,.12),"--lattice-radius":`${c.shape.borderRadius}px`,"--lattice-font-family":c.typography.fontFamily,"--lattice-font-size":`${c.typography.body2.fontSize}`,"--lattice-header-font-weight":String(c.typography.fontWeightMedium)}}function S(c){return`.lattice {
|
|
7
7
|
${Object.entries(c).map(([a,m])=>` ${a}: ${m};`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
}
|
package/modules/react.d.ts
CHANGED
package/modules/react.esm.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.81.0, react module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var Ge=Object.create(null),Ne=Object.create(null);function Se(c,le){Ge[c]=le}function Te(c){var le=Ne[c];if(le)return le;var he=Object.create(null);Ne[c]=he;var be=Ge[c];if(!be)throw new Error("[lattice] missing module: "+c);return be(he,Te),he}Se("packages/core/src/internal/util.js",function(c,le){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return W}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return F}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return de}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return f}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return a}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return N}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return $}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return ee}});const he="1.80.0";async function be(){return he}const B="1.80.0",ne=new Set,se=2e3;function U(t){if(ne.add(t),ne.size>se){const n=ne.values().next().value;n!==void 0&&ne.delete(n)}}const re=[],M=500;function E(t,n,i){re.push({key:t,level:n,message:i.map(m=>typeof m=="string"?m:g(m)).join(" "),at:Date.now()}),re.length>M&&re.shift()}function g(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function s(){return re.map(t=>({...t}))}function C(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function W(t,...n){if(ne.has(t))return;U(t);const i=C(n);E(t,"warn",i),console.warn("[lattice]",...i)}function V(t,...n){if(ne.has(t))return;U(t);const i=C(n);E(t,"info",i),console.info("[lattice]",...i)}function S(){ne.clear(),re.length=0}function Z(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function _(t,n){t||Z(n)}const D=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function z(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ue(t){return typeof t=="function"}function F(t){return t==null}function A(t){return t==null||t===""}function ie(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const K=new Map;function X(t){let n=K.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),m=i.length;n=v=>{let q=v;for(let T=0;T<m;T++){if(q==null)return;q=q[i[T]]}return q}}return K.set(t,n),n}const H=new Map;function x(t){let n=H.get(t);if(n)return n;if(!t.includes("."))n=(i,m)=>{i!=null&&(i[t]=m)};else{const i=t.split("."),m=i.length-1;n=(v,q)=>{let T=v;for(let G=0;G<m;G++){if(T==null)return;const k=i[G];T[k]==null&&(T[k]={}),T=T[k]}T!=null&&(T[i[m]]=q)}}return H.set(t,n),n}function de(t,n){return X(n)(t)}function ke(t,n,i){x(n)(t,i)}function f(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const h={"&":"&","<":"<",">":">",'"':""","'":"'"};function L(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>h[i]):n}function ce(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function o(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:z(t)?t:{[n]:t,enabled:!0}}function p(t){return t==null?[]:Array.isArray(t)?t:[t]}const r=Object.freeze(new Set(["__proto__","constructor","prototype"]));function a(t,n){if(!z(t))return z(n)?{...n}:n;if(!z(n))return n===void 0?t:n;const i={...t};for(const m of Object.keys(n)){if(r.has(m))continue;const v=n[m];v!==void 0&&(i[m]=z(v)&&z(i[m])?a(i[m],v):v)}return i}function u(t,n){if(!z(t)||!z(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class O{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const m=i.get(n);return i.delete(n),i.set(n,m),m}peek(n){return this.#e.get(n)}set(n,i){const m=this.#e;return m.has(n)&&m.delete(n),m.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,m=n.get(i);n.delete(i),this.#t&&this.#t(m,i)}}}const y=new Map;function R(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let m=y.get(i);return m||(m=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),y.set(i,m)),m}function b(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),m=String(n);return i<m?-1:i>m?1:0}function J(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const I=typeof requestAnimationFrame=="function";function Q(t){return I?requestAnimationFrame(t):setTimeout(()=>t(J()),16)}function N(t){t!=null&&(I?cancelAnimationFrame(t):clearTimeout(t))}function $(t){let n=null,i=null;const m=()=>{n=null;const q=i;i=null,t(...q||[])},v=(...q)=>{i=q,n===null&&(n=Q(m))};return v.cancel=()=>{N(n),n=null,i=null},v.flush=()=>{n!==null&&(N(n),m())},v}function w(t,n){let i=null,m=null;const v=()=>{if(i=null,m===null)return;const G=m;m=null,t(...G),q()},q=()=>{i=setTimeout(v,n),typeof i?.unref=="function"&&i.unref()},T=(...G)=>{i===null?(t(...G),q()):(m=G,clearTimeout(i),q())};return T.flush=()=>{if(i!==null&&clearTimeout(i),i=null,m===null)return;const G=m;m=null,t(...G)},T.cancel=()=>{i!==null&&clearTimeout(i),i=null,m=null},T.pending=()=>i!==null||m!==null,T}function P(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let oe=0;function ee(t="l"){return`${t}${(++oe).toString(36)}`}}),Se("packages/modules/shared/adapter.js",function(c,le){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return g}});const he=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","detail:cell:edit:start","detail:cell:edit:end","detail:row:edit:start","detail:row:edit:end","detail:cell:changed","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),be=Object.freeze({sort:(s,C)=>s.sort.set(C||[]),filters:(s,C)=>s.filters.set(C||null),quickFilter:(s,C)=>{if(C&&typeof C=="object"){s.filters.quick(C.text||"",{mode:C.mode});return}s.filters.quick(typeof C=="string"?C:"")},selectedKeys:(s,C)=>s.selection.set(Array.isArray(C)?C:[])});function B(s){return`on${String(s).split(":").map(W=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}`}function ne(s){return String(s).replace(/:/g,"-")}const se=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function U(s){return Object.hasOwn(se,s)?se[s]:s}const re=Object.freeze(Object.fromEntries(he.map(s=>[B(s),s])));function M(s){return Object.hasOwn(re,s)}function E(s){const C={},W={},V={};for(const[S,Z]of Object.entries(s||{})){if(M(S)){V[S]=Z;continue}if(Object.hasOwn(be,S)){W[S]=Z;continue}C[S]=Z}return{config:C,imperative:W,handlers:V}}function g(s){const C=s.createGrid;if(typeof C!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const W=E(s.props||{}),V=C(s.element,{...W.config});let S=W.handlers,Z=W.config,_={};const D=F=>{if(!F||typeof F.type!="string")return;const A=S[B(F.type)];typeof A=="function"&&A(F)},z=V.on("*",D);for(const[F,A]of Object.entries(W.imperative))A!==void 0&&(be[F](V,A),_[F]=A);let ue=!1;return{grid:V,update(F){if(ue)return;const A=E(F||{});S=A.handlers;const ie={};for(const[K,X]of Object.entries(A.config))Object.is(Z[K],X)||(ie[K]=X);for(const K of Object.keys(Z))Object.hasOwn(A.config,K)||(ie[K]=void 0);Object.keys(ie).length&&V.setAll(ie),Z=A.config;for(const[K,X]of Object.entries(be)){const H=A.imperative[K];Object.is(_[K],H)||H===void 0&&!Object.hasOwn(_,K)||(X(V,H),_[K]=H)}},destroy(){ue||(ue=!0,z(),V.destroy())}}}}),Se("packages/modules/react/viewers.js",function(c,le){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return E}});const be=le("packages/core/src/internal/util.js").warnOnce,B=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),ne=Object.freeze({kpi:Object.freeze({rows:(g,s)=>g.setRows(Array.isArray(s)?s:[])}),kanban:Object.freeze({rows:(g,s)=>g.setRows(Array.isArray(s)?s:[]),quickFilter:(g,s)=>g.setQuickFilter(typeof s=="string"?s:""),sprint:(g,s)=>g.setSprint(s),epic:(g,s)=>g.setEpic(s),loading:(g,s)=>g.setLoading(!!s),error:(g,s)=>g.setError(s??null)}),gantt:Object.freeze({tasks:(g,s)=>g.setTasks(Array.isArray(s)?s:[]),dependencies:(g,s)=>g.setDependencies(Array.isArray(s)?s:[])}),tabs:Object.freeze({active:(g,s)=>{typeof s=="string"&&g.activate(s)}}),chart:Object.freeze({}),layout:Object.freeze({})}),se=Object.freeze({chart:"update"});function U(g){return`on${String(g).split(":").map(C=>C.charAt(0).toUpperCase()+C.slice(1)).join("")}`}const re=Object.freeze(Object.fromEntries(Object.entries(B).map(([g,s])=>[g,Object.freeze(Object.fromEntries(s.map(C=>[U(C),C])))])));function M(g,s){const C=re[g]||{},W=ne[g]||{},V={},S={},Z={};for(const[_,D]of Object.entries(s||{})){if(Object.hasOwn(C,_)){Z[_]=D;continue}if(Object.hasOwn(W,_)){S[_]=D,V[_]=D;continue}V[_]=D}return{config:V,live:S,handlers:Z}}function E(g){const s=String(g.viewer),C=g.mount,W=g.name||s;if(typeof C!="function")throw new TypeError(`createViewerController needs a mount factory for "${s}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const V=M(s,g.props||{}),S=C(g.element,{...V.config});if(!S||typeof S!="object")throw new TypeError(`the ${W} factory returned no instance; nothing can be driven.`);let Z=V.handlers,_=V.config;const D={...V.live},z=[];if(typeof S.on=="function")for(const ie of B[s]||[]){const K=U(ie),X=S.on(ie,H=>{const x=Z[K];typeof x=="function"&&x(H)});typeof X=="function"&&z.push(X)}const ue=se[s],F=ne[s]||{};let A=!1;return{instance:S,update(ie){if(A)return;const K=M(s,ie||{});Z=K.handlers;const X={};for(const[x,de]of Object.entries(K.config))Object.is(_[x],de)||(X[x]=de);if(_=K.config,!Object.keys(X).length)return;const H=[];for(const x of Object.keys(X)){const de=F[x];if(de){de(S,X[x]),D[x]=X[x];continue}ue&&typeof S[ue]=="function"||H.push(x)}if(ue&&typeof S[ue]=="function"){const x={};for(const de of Object.keys(X))F[de]||(x[de]=X[de]);Object.keys(x).length&&S[ue](x)}H.length&&be(`react.viewer.${s}.mountOnly.${H.join(".")}`,`${W}: ${H.map(x=>`\`${x}\``).join(", ")} changed, but ${W} takes ${H.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!A){A=!0;for(const ie of z)try{ie()}catch{}z.length=0,typeof S.destroy=="function"&&S.destroy()}}}}}),Se("packages/modules/presets/index.js",function(c,le){"use strict";Object.defineProperty(c,"themeFromMui",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return re}});const be=le("packages/core/src/internal/util.js").warnOnce;function B(M,E){if(typeof M!="string")return M;const g=M.trim().match(/^#([0-9a-f]{6})$/i);if(!g)return M;const s=g[1],C=parseInt(s.slice(0,2),16),W=parseInt(s.slice(2,4),16),V=parseInt(s.slice(4,6),16);return`rgba(${C}, ${W}, ${V}, ${E})`}function ne(M){const E=M.palette,g=E.mode==="dark";return{"--lattice-background":E.background.default,"--lattice-surface":E.background.paper,"--lattice-surface-alt":g?"#2a2a2a":E.grey[50],"--lattice-border-color":E.divider,"--lattice-border-strong":g?E.grey[600]:E.grey[400],"--lattice-foreground":E.text.primary,"--lattice-foreground-muted":E.text.secondary,"--lattice-header-foreground":E.text.primary,"--lattice-accent":E.primary.main,"--lattice-accent-contrast":E.primary.contrastText,"--lattice-link-color":E.primary.main,"--lattice-selected-background":B(E.primary.main,.12),"--lattice-hovered-background":B(E.text.primary,.06),"--lattice-focus-color":E.primary.main,"--lattice-variant-danger-solid":E.error.main,"--lattice-variant-danger-fill":B(E.error.main,.12),"--lattice-variant-warning-solid":E.warning.main,"--lattice-variant-warning-fill":B(E.warning.main,.12),"--lattice-variant-success-solid":E.success.main,"--lattice-variant-success-fill":B(E.success.main,.12),"--lattice-variant-info-solid":E.info.main,"--lattice-variant-info-fill":B(E.info.main,.12),"--lattice-radius":`${M.shape.borderRadius}px`,"--lattice-font-family":M.typography.fontFamily,"--lattice-font-size":`${M.typography.body2.fontSize}`,"--lattice-header-font-weight":String(M.typography.fontWeightMedium)}}function se(M){return`.lattice {
|
|
6
|
+
var Ge=Object.create(null),Ne=Object.create(null);function Se(c,le){Ge[c]=le}function Te(c){var le=Ne[c];if(le)return le;var he=Object.create(null);Ne[c]=he;var be=Ge[c];if(!be)throw new Error("[lattice] missing module: "+c);return be(he,Te),he}Se("packages/core/src/internal/util.js",function(c,le){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return W}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return F}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return de}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return f}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return a}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return N}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return $}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return ee}});const he="1.81.0";async function be(){return he}const B="1.81.0",ne=new Set,se=2e3;function U(t){if(ne.add(t),ne.size>se){const n=ne.values().next().value;n!==void 0&&ne.delete(n)}}const re=[],M=500;function E(t,n,i){re.push({key:t,level:n,message:i.map(m=>typeof m=="string"?m:g(m)).join(" "),at:Date.now()}),re.length>M&&re.shift()}function g(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function s(){return re.map(t=>({...t}))}function C(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function W(t,...n){if(ne.has(t))return;U(t);const i=C(n);E(t,"warn",i),console.warn("[lattice]",...i)}function V(t,...n){if(ne.has(t))return;U(t);const i=C(n);E(t,"info",i),console.info("[lattice]",...i)}function S(){ne.clear(),re.length=0}function Z(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function _(t,n){t||Z(n)}const D=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function z(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ue(t){return typeof t=="function"}function F(t){return t==null}function A(t){return t==null||t===""}function ie(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const K=new Map;function X(t){let n=K.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),m=i.length;n=v=>{let q=v;for(let T=0;T<m;T++){if(q==null)return;q=q[i[T]]}return q}}return K.set(t,n),n}const H=new Map;function x(t){let n=H.get(t);if(n)return n;if(!t.includes("."))n=(i,m)=>{i!=null&&(i[t]=m)};else{const i=t.split("."),m=i.length-1;n=(v,q)=>{let T=v;for(let G=0;G<m;G++){if(T==null)return;const k=i[G];T[k]==null&&(T[k]={}),T=T[k]}T!=null&&(T[i[m]]=q)}}return H.set(t,n),n}function de(t,n){return X(n)(t)}function ke(t,n,i){x(n)(t,i)}function f(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const h={"&":"&","<":"<",">":">",'"':""","'":"'"};function L(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>h[i]):n}function ce(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function o(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:z(t)?t:{[n]:t,enabled:!0}}function p(t){return t==null?[]:Array.isArray(t)?t:[t]}const r=Object.freeze(new Set(["__proto__","constructor","prototype"]));function a(t,n){if(!z(t))return z(n)?{...n}:n;if(!z(n))return n===void 0?t:n;const i={...t};for(const m of Object.keys(n)){if(r.has(m))continue;const v=n[m];v!==void 0&&(i[m]=z(v)&&z(i[m])?a(i[m],v):v)}return i}function u(t,n){if(!z(t)||!z(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class O{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const m=i.get(n);return i.delete(n),i.set(n,m),m}peek(n){return this.#e.get(n)}set(n,i){const m=this.#e;return m.has(n)&&m.delete(n),m.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,m=n.get(i);n.delete(i),this.#t&&this.#t(m,i)}}}const y=new Map;function R(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let m=y.get(i);return m||(m=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),y.set(i,m)),m}function b(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),m=String(n);return i<m?-1:i>m?1:0}function J(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const I=typeof requestAnimationFrame=="function";function Q(t){return I?requestAnimationFrame(t):setTimeout(()=>t(J()),16)}function N(t){t!=null&&(I?cancelAnimationFrame(t):clearTimeout(t))}function $(t){let n=null,i=null;const m=()=>{n=null;const q=i;i=null,t(...q||[])},v=(...q)=>{i=q,n===null&&(n=Q(m))};return v.cancel=()=>{N(n),n=null,i=null},v.flush=()=>{n!==null&&(N(n),m())},v}function w(t,n){let i=null,m=null;const v=()=>{if(i=null,m===null)return;const G=m;m=null,t(...G),q()},q=()=>{i=setTimeout(v,n),typeof i?.unref=="function"&&i.unref()},T=(...G)=>{i===null?(t(...G),q()):(m=G,clearTimeout(i),q())};return T.flush=()=>{if(i!==null&&clearTimeout(i),i=null,m===null)return;const G=m;m=null,t(...G)},T.cancel=()=>{i!==null&&clearTimeout(i),i=null,m=null},T.pending=()=>i!==null||m!==null,T}function P(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let oe=0;function ee(t="l"){return`${t}${(++oe).toString(36)}`}}),Se("packages/modules/shared/adapter.js",function(c,le){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return g}});const he=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","detail:cell:edit:start","detail:cell:edit:end","detail:row:edit:start","detail:row:edit:end","detail:cell:changed","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),be=Object.freeze({sort:(s,C)=>s.sort.set(C||[]),filters:(s,C)=>s.filters.set(C||null),quickFilter:(s,C)=>{if(C&&typeof C=="object"){s.filters.quick(C.text||"",{mode:C.mode});return}s.filters.quick(typeof C=="string"?C:"")},selectedKeys:(s,C)=>s.selection.set(Array.isArray(C)?C:[])});function B(s){return`on${String(s).split(":").map(W=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}`}function ne(s){return String(s).replace(/:/g,"-")}const se=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function U(s){return Object.hasOwn(se,s)?se[s]:s}const re=Object.freeze(Object.fromEntries(he.map(s=>[B(s),s])));function M(s){return Object.hasOwn(re,s)}function E(s){const C={},W={},V={};for(const[S,Z]of Object.entries(s||{})){if(M(S)){V[S]=Z;continue}if(Object.hasOwn(be,S)){W[S]=Z;continue}C[S]=Z}return{config:C,imperative:W,handlers:V}}function g(s){const C=s.createGrid;if(typeof C!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const W=E(s.props||{}),V=C(s.element,{...W.config});let S=W.handlers,Z=W.config,_={};const D=F=>{if(!F||typeof F.type!="string")return;const A=S[B(F.type)];typeof A=="function"&&A(F)},z=V.on("*",D);for(const[F,A]of Object.entries(W.imperative))A!==void 0&&(be[F](V,A),_[F]=A);let ue=!1;return{grid:V,update(F){if(ue)return;const A=E(F||{});S=A.handlers;const ie={};for(const[K,X]of Object.entries(A.config))Object.is(Z[K],X)||(ie[K]=X);for(const K of Object.keys(Z))Object.hasOwn(A.config,K)||(ie[K]=void 0);Object.keys(ie).length&&V.setAll(ie),Z=A.config;for(const[K,X]of Object.entries(be)){const H=A.imperative[K];Object.is(_[K],H)||H===void 0&&!Object.hasOwn(_,K)||(X(V,H),_[K]=H)}},destroy(){ue||(ue=!0,z(),V.destroy())}}}}),Se("packages/modules/react/viewers.js",function(c,le){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return E}});const be=le("packages/core/src/internal/util.js").warnOnce,B=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),ne=Object.freeze({kpi:Object.freeze({rows:(g,s)=>g.setRows(Array.isArray(s)?s:[])}),kanban:Object.freeze({rows:(g,s)=>g.setRows(Array.isArray(s)?s:[]),quickFilter:(g,s)=>g.setQuickFilter(typeof s=="string"?s:""),sprint:(g,s)=>g.setSprint(s),epic:(g,s)=>g.setEpic(s),loading:(g,s)=>g.setLoading(!!s),error:(g,s)=>g.setError(s??null)}),gantt:Object.freeze({tasks:(g,s)=>g.setTasks(Array.isArray(s)?s:[]),dependencies:(g,s)=>g.setDependencies(Array.isArray(s)?s:[])}),tabs:Object.freeze({active:(g,s)=>{typeof s=="string"&&g.activate(s)}}),chart:Object.freeze({}),layout:Object.freeze({})}),se=Object.freeze({chart:"update"});function U(g){return`on${String(g).split(":").map(C=>C.charAt(0).toUpperCase()+C.slice(1)).join("")}`}const re=Object.freeze(Object.fromEntries(Object.entries(B).map(([g,s])=>[g,Object.freeze(Object.fromEntries(s.map(C=>[U(C),C])))])));function M(g,s){const C=re[g]||{},W=ne[g]||{},V={},S={},Z={};for(const[_,D]of Object.entries(s||{})){if(Object.hasOwn(C,_)){Z[_]=D;continue}if(Object.hasOwn(W,_)){S[_]=D,V[_]=D;continue}V[_]=D}return{config:V,live:S,handlers:Z}}function E(g){const s=String(g.viewer),C=g.mount,W=g.name||s;if(typeof C!="function")throw new TypeError(`createViewerController needs a mount factory for "${s}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const V=M(s,g.props||{}),S=C(g.element,{...V.config});if(!S||typeof S!="object")throw new TypeError(`the ${W} factory returned no instance; nothing can be driven.`);let Z=V.handlers,_=V.config;const D={...V.live},z=[];if(typeof S.on=="function")for(const ie of B[s]||[]){const K=U(ie),X=S.on(ie,H=>{const x=Z[K];typeof x=="function"&&x(H)});typeof X=="function"&&z.push(X)}const ue=se[s],F=ne[s]||{};let A=!1;return{instance:S,update(ie){if(A)return;const K=M(s,ie||{});Z=K.handlers;const X={};for(const[x,de]of Object.entries(K.config))Object.is(_[x],de)||(X[x]=de);if(_=K.config,!Object.keys(X).length)return;const H=[];for(const x of Object.keys(X)){const de=F[x];if(de){de(S,X[x]),D[x]=X[x];continue}ue&&typeof S[ue]=="function"||H.push(x)}if(ue&&typeof S[ue]=="function"){const x={};for(const de of Object.keys(X))F[de]||(x[de]=X[de]);Object.keys(x).length&&S[ue](x)}H.length&&be(`react.viewer.${s}.mountOnly.${H.join(".")}`,`${W}: ${H.map(x=>`\`${x}\``).join(", ")} changed, but ${W} takes ${H.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!A){A=!0;for(const ie of z)try{ie()}catch{}z.length=0,typeof S.destroy=="function"&&S.destroy()}}}}}),Se("packages/modules/presets/index.js",function(c,le){"use strict";Object.defineProperty(c,"themeFromMui",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return re}});const be=le("packages/core/src/internal/util.js").warnOnce;function B(M,E){if(typeof M!="string")return M;const g=M.trim().match(/^#([0-9a-f]{6})$/i);if(!g)return M;const s=g[1],C=parseInt(s.slice(0,2),16),W=parseInt(s.slice(2,4),16),V=parseInt(s.slice(4,6),16);return`rgba(${C}, ${W}, ${V}, ${E})`}function ne(M){const E=M.palette,g=E.mode==="dark";return{"--lattice-background":E.background.default,"--lattice-surface":E.background.paper,"--lattice-surface-alt":g?"#2a2a2a":E.grey[50],"--lattice-border-color":E.divider,"--lattice-border-strong":g?E.grey[600]:E.grey[400],"--lattice-foreground":E.text.primary,"--lattice-foreground-muted":E.text.secondary,"--lattice-header-foreground":E.text.primary,"--lattice-accent":E.primary.main,"--lattice-accent-contrast":E.primary.contrastText,"--lattice-link-color":E.primary.main,"--lattice-selected-background":B(E.primary.main,.12),"--lattice-hovered-background":B(E.text.primary,.06),"--lattice-focus-color":E.primary.main,"--lattice-variant-danger-solid":E.error.main,"--lattice-variant-danger-fill":B(E.error.main,.12),"--lattice-variant-warning-solid":E.warning.main,"--lattice-variant-warning-fill":B(E.warning.main,.12),"--lattice-variant-success-solid":E.success.main,"--lattice-variant-success-fill":B(E.success.main,.12),"--lattice-variant-info-solid":E.info.main,"--lattice-variant-info-fill":B(E.info.main,.12),"--lattice-radius":`${M.shape.borderRadius}px`,"--lattice-font-family":M.typography.fontFamily,"--lattice-font-size":`${M.typography.body2.fontSize}`,"--lattice-header-font-weight":String(M.typography.fontWeightMedium)}}function se(M){return`.lattice {
|
|
7
7
|
${Object.entries(M).map(([g,s])=>` ${g}: ${s};`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
}
|