@ishibashi0112/spreadsheet-grid-solid 1.14.0 → 1.15.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/API_REFERENCE.md +101 -13
- package/README.md +9 -9
- package/dist/{ColumnFilterPopover-t32VGfTq.js → ColumnFilterPopover-DYnfyUTm.js} +40 -41
- package/dist/devWarnings.d.ts +1 -0
- package/dist/features/pagination.d.ts +2 -0
- package/dist/features/types.d.ts +7 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3610 -3315
- package/dist/inputValue-Dvxw-RUC.js +69 -0
- package/dist/primitives/rowDrag.d.ts +1 -0
- package/dist/source/chunks/{ColumnFilterPopover-JL3HPGXY.jsx → ColumnFilterPopover-7COSTSPD.jsx} +2 -4
- package/dist/source/chunks/{chunk-AI3CSPI3.jsx → chunk-D4IAL3ZE.jsx} +43 -1
- package/dist/source/chunks/{toolPanelViews-N6TGBFFW.jsx → toolPanelViews-WBFE4QVY.jsx} +2 -4
- package/dist/source/index.jsx +920 -477
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-CPYtBTQP.js → toolPanelViews-BgEAIDpk.js} +35 -36
- package/dist/view/DefaultGridBottomBar.d.ts +3 -0
- package/dist/view/DefaultGridTopBar.d.ts +1 -0
- package/dist/view/GridBodyGroupRow.d.ts +1 -0
- package/dist/view/GridBodyLabelRow.d.ts +1 -0
- package/dist/view/GridBodyLayer.d.ts +1 -0
- package/dist/view/GridBodySkeletonRow.d.ts +2 -0
- package/dist/view/GridPager.d.ts +9 -0
- package/dist/view/GridScrollHint.d.ts +2 -0
- package/dist/view/GridStickyLabelLayer.d.ts +1 -0
- package/package.json +3 -3
- package/skills/spreadsheet-grid-solid/SKILL.md +3 -1
- package/dist/inputValue-C6BHBMBx.js +0 -24
- package/dist/portalTokens-LgUwLYnR.js +0 -47
- package/dist/source/chunks/chunk-WLXZT66B.jsx +0 -44
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createContext as e, createEffect as t, createRenderEffect as n, createSignal as r, useContext as i } from "solid-js";
|
|
2
|
+
import { syncPopupOrigin as a } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/popupContainer";
|
|
3
|
+
import { isTabKeyEvent as o } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
4
|
+
import { watchPortalTokens as s } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/portalTokens";
|
|
5
|
+
//#region src/primitives/style.ts
|
|
6
|
+
var c = /* @__PURE__ */ new Set([
|
|
7
|
+
"opacity",
|
|
8
|
+
"z-index",
|
|
9
|
+
"flex",
|
|
10
|
+
"flex-grow",
|
|
11
|
+
"flex-shrink",
|
|
12
|
+
"line-height",
|
|
13
|
+
"order",
|
|
14
|
+
"font-weight"
|
|
15
|
+
]), l = (e) => e.startsWith("--") ? e : e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), u = (e) => {
|
|
16
|
+
if (!e) return;
|
|
17
|
+
let t = {};
|
|
18
|
+
for (let [n, r] of Object.entries(e)) {
|
|
19
|
+
if (r == null || r === !1) continue;
|
|
20
|
+
let e = l(n);
|
|
21
|
+
t[e] = typeof r == "number" && !c.has(e) ? `${r}px` : String(r);
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
}, d = (e) => `${e}px`, f = (e) => o(e) ? "Tab" : e.key, p = (e) => ({
|
|
25
|
+
key: f(e),
|
|
26
|
+
altKey: e.altKey,
|
|
27
|
+
ctrlKey: e.ctrlKey,
|
|
28
|
+
metaKey: e.metaKey,
|
|
29
|
+
shiftKey: e.shiftKey,
|
|
30
|
+
isComposing: e.isComposing,
|
|
31
|
+
keyCode: e.keyCode,
|
|
32
|
+
currentTarget: e.currentTarget,
|
|
33
|
+
preventDefault: () => e.preventDefault()
|
|
34
|
+
}), m = e({
|
|
35
|
+
source: () => null,
|
|
36
|
+
container: () => typeof document > "u" ? null : document.body
|
|
37
|
+
}), h = () => i(m);
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/primitives/portalTokens.ts
|
|
40
|
+
function g(e, n, r, i) {
|
|
41
|
+
let { source: o } = h();
|
|
42
|
+
t(() => [e(), n()], ([e]) => e ? s(o, e) : void 0, { name: "portalTokens" }), i?.origin !== !1 && t(() => [e(), r()], ([e]) => {
|
|
43
|
+
e && a(e);
|
|
44
|
+
}, { name: "portalLayout" });
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/primitives/inputValue.ts
|
|
48
|
+
function _(e) {
|
|
49
|
+
let [t, i] = r();
|
|
50
|
+
return n(() => [t(), e()], ([e, t]) => {
|
|
51
|
+
e && e.value !== t && (e.value = t);
|
|
52
|
+
}, { name: "inputValue" }), (e) => {
|
|
53
|
+
i(() => e);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var v = (e, t) => (n) => {
|
|
57
|
+
let r = n.currentTarget;
|
|
58
|
+
r.checked = !r.checked, r.indeterminate = e(), t();
|
|
59
|
+
};
|
|
60
|
+
function y(e) {
|
|
61
|
+
let [t, i] = r();
|
|
62
|
+
return n(() => [t(), e()], ([e, t]) => {
|
|
63
|
+
e && (e.indeterminate = t);
|
|
64
|
+
}, { name: "inputIndeterminate" }), (e) => {
|
|
65
|
+
i(() => e);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { m as a, p as c, g as i, d as l, y as n, h as o, _ as r, f as s, v as t, u };
|
|
@@ -10,6 +10,7 @@ export type RowDragInputs<T> = {
|
|
|
10
10
|
resolveRowKey: () => (row: T, index: number) => GridRowKey;
|
|
11
11
|
hasRowKeys: () => boolean;
|
|
12
12
|
dragRowLabel: () => string;
|
|
13
|
+
rowOffset?: (() => number) | undefined;
|
|
13
14
|
};
|
|
14
15
|
export type RowDrag = {
|
|
15
16
|
onRowDragHandlePointerDown: RowDragController['onRowDragHandlePointerDown'];
|
package/dist/source/chunks/{ColumnFilterPopover-JL3HPGXY.jsx → ColumnFilterPopover-7COSTSPD.jsx}
RENAMED
|
@@ -6,14 +6,12 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
controlledToggle,
|
|
8
8
|
createIndeterminate,
|
|
9
|
-
createInputValue
|
|
10
|
-
} from "./chunk-WLXZT66B.jsx";
|
|
11
|
-
import {
|
|
9
|
+
createInputValue,
|
|
12
10
|
createPortalTokens,
|
|
13
11
|
px,
|
|
14
12
|
readEventKey,
|
|
15
13
|
useGridPortal
|
|
16
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D4IAL3ZE.jsx";
|
|
17
15
|
import {
|
|
18
16
|
usePopupLocaleText
|
|
19
17
|
} from "./chunk-ZW5ET5DO.jsx";
|
|
@@ -65,6 +65,45 @@ function createPortalTokens(portal, modifierClassName, layout, options) {
|
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
// src/primitives/inputValue.ts
|
|
69
|
+
import { createRenderEffect, createSignal } from "solid-js";
|
|
70
|
+
function createInputValue(value) {
|
|
71
|
+
const [element, setElement] = createSignal();
|
|
72
|
+
createRenderEffect(
|
|
73
|
+
() => [element(), value()],
|
|
74
|
+
([target, next]) => {
|
|
75
|
+
if (target && target.value !== next) {
|
|
76
|
+
target.value = next;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{ name: "inputValue" }
|
|
80
|
+
);
|
|
81
|
+
return (target) => {
|
|
82
|
+
setElement(() => target);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
var controlledToggle = (indeterminate, action) => (event) => {
|
|
86
|
+
const target = event.currentTarget;
|
|
87
|
+
target.checked = !target.checked;
|
|
88
|
+
target.indeterminate = indeterminate();
|
|
89
|
+
action();
|
|
90
|
+
};
|
|
91
|
+
function createIndeterminate(value) {
|
|
92
|
+
const [element, setElement] = createSignal();
|
|
93
|
+
createRenderEffect(
|
|
94
|
+
() => [element(), value()],
|
|
95
|
+
([target, next]) => {
|
|
96
|
+
if (target) {
|
|
97
|
+
target.indeterminate = next;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{ name: "inputIndeterminate" }
|
|
101
|
+
);
|
|
102
|
+
return (target) => {
|
|
103
|
+
setElement(() => target);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
68
107
|
export {
|
|
69
108
|
toSolidStyle,
|
|
70
109
|
px,
|
|
@@ -72,5 +111,8 @@ export {
|
|
|
72
111
|
toEditorKeyEvent,
|
|
73
112
|
GridPortalContext,
|
|
74
113
|
useGridPortal,
|
|
75
|
-
createPortalTokens
|
|
114
|
+
createPortalTokens,
|
|
115
|
+
createInputValue,
|
|
116
|
+
controlledToggle,
|
|
117
|
+
createIndeterminate
|
|
76
118
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createInputValue
|
|
3
|
-
} from "./chunk-WLXZT66B.jsx";
|
|
4
|
-
import {
|
|
2
|
+
createInputValue,
|
|
5
3
|
createPortalTokens,
|
|
6
4
|
px,
|
|
7
5
|
readEventKey,
|
|
8
6
|
useGridPortal
|
|
9
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D4IAL3ZE.jsx";
|
|
10
8
|
import {
|
|
11
9
|
usePopupLocaleText
|
|
12
10
|
} from "./chunk-ZW5ET5DO.jsx";
|