@ishibashi0112/spreadsheet-grid 1.2.0 → 1.2.1
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/dist/editors/editorKeyBindings.d.ts +3 -20
- package/dist/index.cjs +6 -7
- package/dist/index.js +2601 -3077
- package/dist/lite/createSpreadsheetGrid-BxaYty_c.js +4290 -0
- package/dist/lite/createSpreadsheetGrid-CfUnI6Xl.cjs +6 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite/features/filtering.cjs +1 -1
- package/dist/lite/features/filtering.js +1 -1
- package/dist/lite/features/scrollHint.cjs +1 -1
- package/dist/lite/features/scrollHint.js +1 -1
- package/dist/lite/features/standard.cjs +1 -1
- package/dist/lite/features/standard.js +1 -1
- package/dist/lite/{filtering-CGAgUfF0.cjs → filtering-DDIQnB3a.cjs} +1 -1
- package/dist/lite/{filtering-CC_aBJ_K.js → filtering-ReroATyh.js} +137 -137
- package/dist/lite/scrollHint-Bt8fuU7l.cjs +1 -0
- package/dist/lite/{scrollHint-ENNefJ2y.js → scrollHint-Dr4TOFNn.js} +57 -57
- package/dist/lite.cjs +1 -1
- package/dist/lite.js +3 -3
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/view/gridBarHelpers.d.ts +1 -27
- package/package.json +2 -2
- package/dist/editors/editorVisibleBounds.d.ts +0 -10
- package/dist/lite/createSpreadsheetGrid-BrOy7MJY.cjs +0 -7
- package/dist/lite/createSpreadsheetGrid-D-A1zUTb.js +0 -4766
- package/dist/lite/scrollHint-DFr8vI15.cjs +0 -1
|
@@ -3,40 +3,40 @@ import { useEffect as t, useMemo as n, useRef as r, useState as i } from "react"
|
|
|
3
3
|
import { cx as a } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
|
|
4
4
|
import { formatLocaleText as o } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT as
|
|
9
|
-
import { computeScrollHintRulerTicks as
|
|
6
|
+
import { physicalToLogicalScrollTop as l } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
7
|
+
import { resolveDataRowNumber as ee } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/labelRows";
|
|
8
|
+
import { DEFAULT_SCROLL_HINT_LOCALE_TEXT as u } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
9
|
+
import { computeScrollHintRulerTicks as te, computeScrollHintTrack as ne, computeScrollHintTrackPointerScrollTop as re, resolveScrollHintDetail as d, resolveScrollHintOptions as f } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/scrollHint";
|
|
10
10
|
//#region src/view/GridScrollHint.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
scrollTop:
|
|
15
|
-
contentHeight:
|
|
16
|
-
viewportHeight:
|
|
11
|
+
var p = 1e3, m = 8, ie = 18, ae = 8, h = 28;
|
|
12
|
+
function g({ options: u, scrollContainerRef: f, scrollTop: g, viewportHeight: _, headerHeight: v, physicalBodyHeight: oe, verticalScaleFactor: y, rowMetrics: b, rowModel: x, slot: S, labelViewIndexes: C }) {
|
|
13
|
+
let w = e(), [T, E] = i(!1), [se, D] = i(!1), [O, k] = i(0), [A, j] = i(null), [M, N] = i(!1), P = r(null), F = r(null), I = r(null), L = u.scrollbar ? v : 0, R = Math.max(u.scrollbar ? _ - v : _, 0), z = ne({
|
|
14
|
+
scrollTop: g,
|
|
15
|
+
contentHeight: v + oe,
|
|
16
|
+
viewportHeight: _,
|
|
17
17
|
trackHeight: R
|
|
18
|
-
}), B = z !== null &&
|
|
18
|
+
}), B = z !== null && b.rowCount > 0;
|
|
19
19
|
t(() => {
|
|
20
|
-
let e =
|
|
20
|
+
let e = f.current;
|
|
21
21
|
if (!e) return;
|
|
22
22
|
let t = () => {
|
|
23
|
-
|
|
24
|
-
P.current = null,
|
|
25
|
-
},
|
|
26
|
-
}, n = () =>
|
|
27
|
-
|
|
23
|
+
E(!0), P.current !== null && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
|
|
24
|
+
P.current = null, E(!1);
|
|
25
|
+
}, p);
|
|
26
|
+
}, n = () => D(!0), r = () => {
|
|
27
|
+
D(!1), j(null);
|
|
28
28
|
}, i = (t) => {
|
|
29
|
-
let n = e.getBoundingClientRect(), r = t.clientX - n.left, i = Math.max(e.offsetWidth - e.clientWidth, 0), a = e.offsetWidth - (i > 0 ? i +
|
|
29
|
+
let n = e.getBoundingClientRect(), r = t.clientX - n.left, i = Math.max(e.offsetWidth - e.clientWidth, 0), a = e.offsetWidth - (i > 0 ? i + ie : ae);
|
|
30
30
|
j(r >= a ? t.clientY - n.top : null);
|
|
31
31
|
}, a = new ResizeObserver(() => {
|
|
32
|
-
|
|
32
|
+
k(Math.max(e.offsetWidth - e.clientWidth, 0));
|
|
33
33
|
});
|
|
34
|
-
return e.addEventListener("scroll", t, { passive: !0 }), e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r),
|
|
34
|
+
return e.addEventListener("scroll", t, { passive: !0 }), e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r), u.scrollbar || e.addEventListener("pointermove", i, { passive: !0 }), a.observe(e), () => {
|
|
35
35
|
e.removeEventListener("scroll", t), e.removeEventListener("pointerenter", n), e.removeEventListener("pointerleave", r), e.removeEventListener("pointermove", i), a.disconnect(), P.current !== null && (window.clearTimeout(P.current), P.current = null);
|
|
36
36
|
};
|
|
37
|
-
}, [
|
|
38
|
-
if (!
|
|
39
|
-
let e = I.current, t =
|
|
37
|
+
}, [f, u.scrollbar]), t(() => {
|
|
38
|
+
if (!u.scrollbar || !B) return;
|
|
39
|
+
let e = I.current, t = f.current;
|
|
40
40
|
if (!e || !t) return;
|
|
41
41
|
let n = (e) => {
|
|
42
42
|
e.preventDefault(), t.scrollTop += e.deltaY;
|
|
@@ -45,33 +45,33 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
45
45
|
e.removeEventListener("wheel", n);
|
|
46
46
|
};
|
|
47
47
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
f,
|
|
49
|
+
u.scrollbar,
|
|
50
50
|
B
|
|
51
51
|
]);
|
|
52
|
-
let V = Math.max(
|
|
52
|
+
let V = Math.max(_ - v, 0), H = C?.length ?? 0, U = Math.max(b.rowCount - H, 0), W = (e) => C && H > 0 ? ee(C, e) : e + 1, G = n(() => u.ruler ? te({
|
|
53
53
|
rowCount: U,
|
|
54
54
|
rulerHeight: V,
|
|
55
|
-
tenThousands:
|
|
55
|
+
tenThousands: w.scrollHintTenThousands
|
|
56
56
|
}) : [], [
|
|
57
|
-
|
|
57
|
+
u.ruler,
|
|
58
58
|
U,
|
|
59
59
|
V,
|
|
60
|
-
|
|
60
|
+
w.scrollHintTenThousands
|
|
61
61
|
]);
|
|
62
|
-
if (z === null ||
|
|
63
|
-
let K =
|
|
62
|
+
if (z === null || b.rowCount <= 0) return null;
|
|
63
|
+
let K = u.trigger === "always" || T || u.trigger === "hover" && se, ce = K || A !== null, q = u.scrollbar ? 14 : O, le = l(Math.min(Math.max(g, 0), z.maxScroll), y), J = b.rowAtContentY(le), Y = d(u, {
|
|
64
64
|
rowIndex: J,
|
|
65
|
-
rowData:
|
|
65
|
+
rowData: x.getRow(J)
|
|
66
66
|
}), X = null;
|
|
67
|
-
if (
|
|
68
|
-
let e =
|
|
67
|
+
if (u.ruler && A !== null && !M) {
|
|
68
|
+
let e = re(A, z, R), t = b.rowAtContentY(l(e, y));
|
|
69
69
|
X = {
|
|
70
|
-
lineY: Math.min(Math.max(L + A,
|
|
70
|
+
lineY: Math.min(Math.max(L + A, v), _),
|
|
71
71
|
rowIndex: t,
|
|
72
|
-
detail:
|
|
72
|
+
detail: d(u, {
|
|
73
73
|
rowIndex: t,
|
|
74
|
-
rowData:
|
|
74
|
+
rowData: x.getRow(t)
|
|
75
75
|
})
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -79,7 +79,7 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
79
79
|
let t = I.current;
|
|
80
80
|
return t === null ? 0 : e.clientY - t.getBoundingClientRect().top;
|
|
81
81
|
}, Q = (e, t) => {
|
|
82
|
-
let n =
|
|
82
|
+
let n = f.current;
|
|
83
83
|
if (n === null) return;
|
|
84
84
|
let r = R - z.thumbHeight;
|
|
85
85
|
r <= 0 || (n.scrollTop = Math.min(Math.max((e - t) / r, 0), 1) * z.maxScroll);
|
|
@@ -98,14 +98,14 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
98
98
|
F.current = null, N(!1);
|
|
99
99
|
};
|
|
100
100
|
return /* @__PURE__ */ c("div", {
|
|
101
|
-
className: a("ssg-scroll-hint",
|
|
102
|
-
style:
|
|
101
|
+
className: a("ssg-scroll-hint", S?.className),
|
|
102
|
+
style: S?.style,
|
|
103
103
|
"aria-hidden": "true",
|
|
104
104
|
children: [
|
|
105
|
-
|
|
105
|
+
u.ruler && G.length > 0 && /* @__PURE__ */ s("div", {
|
|
106
106
|
className: a("ssg-scroll-hint-ruler", ce && "ssg-scroll-hint-ruler--visible"),
|
|
107
107
|
style: {
|
|
108
|
-
top:
|
|
108
|
+
top: v,
|
|
109
109
|
right: q
|
|
110
110
|
},
|
|
111
111
|
children: G.map((e) => /* @__PURE__ */ s("div", {
|
|
@@ -124,22 +124,22 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
124
124
|
right: q
|
|
125
125
|
},
|
|
126
126
|
children: /* @__PURE__ */ c("span", {
|
|
127
|
-
className: a("ssg-scroll-hint-jumpline-label", X.lineY <
|
|
128
|
-
children: [o(
|
|
127
|
+
className: a("ssg-scroll-hint-jumpline-label", X.lineY < v + h && "ssg-scroll-hint-jumpline-label--below"),
|
|
128
|
+
children: [o(w.scrollHintJump, { row: W(X.rowIndex).toLocaleString() }), X.detail !== null && /* @__PURE__ */ c("span", {
|
|
129
129
|
className: "ssg-scroll-hint-jumpline-detail",
|
|
130
|
-
children: [` ${
|
|
130
|
+
children: [` ${w.scrollHintJumpSeparator} `, X.detail]
|
|
131
131
|
})]
|
|
132
132
|
})
|
|
133
133
|
}),
|
|
134
|
-
|
|
134
|
+
u.bubble && /* @__PURE__ */ c("div", {
|
|
135
135
|
className: a("ssg-scroll-hint-bubble", K && "ssg-scroll-hint-bubble--visible"),
|
|
136
136
|
style: {
|
|
137
137
|
top: L + z.centerY,
|
|
138
|
-
right: q +
|
|
138
|
+
right: q + m
|
|
139
139
|
},
|
|
140
140
|
children: [/* @__PURE__ */ c("span", {
|
|
141
141
|
className: "ssg-scroll-hint-bubble-main",
|
|
142
|
-
children: [o(
|
|
142
|
+
children: [o(w.scrollHintRow, { row: W(J).toLocaleString() }), /* @__PURE__ */ c("span", {
|
|
143
143
|
className: "ssg-scroll-hint-bubble-total",
|
|
144
144
|
children: [
|
|
145
145
|
" ",
|
|
@@ -152,11 +152,11 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
152
152
|
children: Y
|
|
153
153
|
})]
|
|
154
154
|
}),
|
|
155
|
-
|
|
155
|
+
u.scrollbar && /* @__PURE__ */ s("div", {
|
|
156
156
|
ref: I,
|
|
157
157
|
className: a("ssg-scroll-hint-scrollbar", M && "ssg-scroll-hint-scrollbar--dragging"),
|
|
158
158
|
style: {
|
|
159
|
-
top:
|
|
159
|
+
top: v,
|
|
160
160
|
height: R,
|
|
161
161
|
width: 14
|
|
162
162
|
},
|
|
@@ -170,9 +170,9 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
170
170
|
},
|
|
171
171
|
onPointerCancel: $,
|
|
172
172
|
onLostPointerCapture: $,
|
|
173
|
-
onPointerEnter: () =>
|
|
173
|
+
onPointerEnter: () => D(!0),
|
|
174
174
|
onPointerLeave: () => {
|
|
175
|
-
|
|
175
|
+
D(!1), F.current === null && j(null);
|
|
176
176
|
},
|
|
177
177
|
children: /* @__PURE__ */ s("div", {
|
|
178
178
|
className: "ssg-scroll-hint-scrollbar-thumb",
|
|
@@ -187,10 +187,10 @@ function _({ options: d, scrollContainerRef: m, scrollTop: _, viewportHeight: v,
|
|
|
187
187
|
}
|
|
188
188
|
//#endregion
|
|
189
189
|
//#region src/features/scrollHint.ts
|
|
190
|
-
var
|
|
191
|
-
resolveScrollHintOptions:
|
|
192
|
-
ScrollHint:
|
|
193
|
-
localeText:
|
|
190
|
+
var _ = {
|
|
191
|
+
resolveScrollHintOptions: f,
|
|
192
|
+
ScrollHint: g,
|
|
193
|
+
localeText: u
|
|
194
194
|
};
|
|
195
195
|
//#endregion
|
|
196
|
-
export {
|
|
196
|
+
export { _ as t };
|
package/dist/lite.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lite/createSpreadsheetGrid-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lite/createSpreadsheetGrid-CfUnI6Xl.cjs"),t=require("./lite/columnAutosize-4rpifIFh.cjs"),n=require("./lite/columnMenu-CBAvHYIy.cjs"),r=require("./lite/features/export.cjs"),i=require("./lite/filtering-DDIQnB3a.cjs"),a=require("./lite/lazyPopups-B0DhlAYW.cjs"),o=require("./lite/toolPanel-H94h6g2U.cjs"),s=require("./lite/features/standard.cjs"),c=require("./lite/find-CBDk2qXA.cjs"),l=require("./lite/fillHandle-CHJESnrk.cjs"),u=require("./lite/columnReorder-CDG4Ngmm.cjs"),d=require("./lite/rowDrag-D17wXvSj.cjs"),f=require("./lite/scrollHint-Bt8fuU7l.cjs"),p=require("./lite/totalRow-CPe9CVv6.cjs"),m=require("./lite/pinnedRows-CBgirKjW.cjs"),h=require("./lite/features/imeDirectInput.cjs"),g=require("./lite/contextMenu-VLz_wVlY.cjs"),_=require("./lite/conditionalFormat-DPOgQy4e.cjs"),v=require("./lite/selectionAggregates-DuSb6U5D.cjs"),y=require("./lite/motionExtras-aDs-d_Qv.cjs"),b=require("./lite/features/autoHeight.cjs"),x=require("./lite/serverSide-CYd3PxVh.cjs"),S=require("./lite/labelRow-rhK34_qd.cjs"),C=require("./lite/grouping-DKYPOjCk.cjs");let w=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/valueFormatters"),T=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/valueParsers"),E=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/gridState");exports.autoHeightFeature=b.autoHeightFeature,exports.columnAutosizeFeature=t.t,exports.columnMenuFeature=n.t,exports.columnReorderFeature=u.t,exports.conditionalFormatFeature=_.t,exports.contextMenuFeature=g.t,exports.createSpreadsheetGrid=e.t,exports.exportFeature=r.exportFeature,exports.fillHandleFeature=l.t,exports.filteringFeature=i.t,exports.findFeature=c.t,exports.groupingFeature=C.t,exports.imeDirectInputFeature=h.imeDirectInputFeature,exports.labelRowFeature=S.t,exports.motionExtrasFeature=y.t,Object.defineProperty(exports,"numberFormatter",{enumerable:!0,get:function(){return w.numberFormatter}}),Object.defineProperty(exports,"numberParser",{enumerable:!0,get:function(){return T.numberParser}}),exports.pinnedRowsFeature=m.t,exports.preloadGridPopups=a.n,Object.defineProperty(exports,"restoreColumnsFromState",{enumerable:!0,get:function(){return E.restoreColumnsFromState}}),exports.rowDragFeature=d.t,exports.scrollHintFeature=f.t,exports.selectionAggregatesFeature=v.t,exports.serverSideFeature=x.t,exports.standardFeatures=s.standardFeatures,exports.toolPanelFeature=o.t,exports.totalRowFeature=p.t;
|
package/dist/lite.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./lite/createSpreadsheetGrid-
|
|
1
|
+
import { t as e } from "./lite/createSpreadsheetGrid-BxaYty_c.js";
|
|
2
2
|
import { t } from "./lite/columnAutosize-B0Rt8TlP.js";
|
|
3
3
|
import { t as n } from "./lite/columnMenu-B_8gLraV.js";
|
|
4
4
|
import { exportFeature as r } from "./lite/features/export.js";
|
|
5
|
-
import { t as i } from "./lite/filtering-
|
|
5
|
+
import { t as i } from "./lite/filtering-ReroATyh.js";
|
|
6
6
|
import { n as a } from "./lite/lazyPopups-C7Y7Kx8w.js";
|
|
7
7
|
import { t as o } from "./lite/toolPanel-DXG3w8Zp.js";
|
|
8
8
|
import { standardFeatures as s } from "./lite/features/standard.js";
|
|
@@ -10,7 +10,7 @@ import { t as c } from "./lite/find-DtRIqxec.js";
|
|
|
10
10
|
import { t as l } from "./lite/fillHandle-CzA_uxgV.js";
|
|
11
11
|
import { t as u } from "./lite/columnReorder-ka-NXl7f.js";
|
|
12
12
|
import { t as d } from "./lite/rowDrag-WVJUKKL8.js";
|
|
13
|
-
import { t as f } from "./lite/scrollHint-
|
|
13
|
+
import { t as f } from "./lite/scrollHint-Dr4TOFNn.js";
|
|
14
14
|
import { t as p } from "./lite/totalRow-Btq5XqtJ.js";
|
|
15
15
|
import { t as m } from "./lite/pinnedRows-BtvLVkLa.js";
|
|
16
16
|
import { imeDirectInputFeature as h } from "./lite/features/imeDirectInput.js";
|