@ishibashi0112/spreadsheet-grid 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +212 -72
- package/README.md +4 -4
- package/dist/ColumnFilterPopover-BPKRqQ0j.js +1056 -0
- package/dist/ColumnFilterPopover-mXX137Y4.cjs +1 -0
- package/dist/GridShell.d.ts +1 -1
- package/dist/ai/GridAskBar.d.ts +5 -5
- package/dist/ai/useGridAsk.d.ts +8 -8
- package/dist/ai.cjs +1 -1
- package/dist/ai.js +13 -13
- package/dist/common.d.ts +3 -1
- package/dist/editors/DateCellEditor.d.ts +2 -1
- package/dist/editors/editorVisibleBounds.d.ts +10 -0
- package/dist/features/pinnedRows.d.ts +2 -0
- package/dist/features/types.d.ts +49 -35
- package/dist/hooks/useCellContextMenuController.d.ts +1 -1
- package/dist/hooks/useGridHistoryController.d.ts +1 -0
- package/dist/hooks/useGridLocaleText.d.ts +1 -1
- package/dist/hooks/useGridViewportSync.d.ts +1 -1
- package/dist/hooks/usePortalTokens.d.ts +6 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +4008 -3426
- package/dist/lite/CheckboxCell-BBzjMEcs.cjs +1 -0
- package/dist/lite/CheckboxCell-DAGCJJkg.js +40 -0
- package/dist/lite/ColumnFilterPopover-DCydc4GT.cjs +1 -0
- package/dist/{ColumnFilterPopover-xCX4O5Pb.js → lite/ColumnFilterPopover-Mm4bBD9q.js} +407 -387
- package/dist/lite/columnMenu-C2rH9Ti8.cjs +1 -0
- package/dist/lite/columnMenu-CfiIYwpG.js +392 -0
- package/dist/lite/contextMenu-BrvrFfbj.js +160 -0
- package/dist/lite/contextMenu-CAUiZ93K.cjs +1 -0
- package/dist/lite/createSpreadsheetGrid-8FiJsd7p.js +4723 -0
- package/dist/lite/createSpreadsheetGrid-Dvn09NZv.cjs +7 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite/features/columnMenu.cjs +1 -1
- package/dist/lite/features/columnMenu.js +1 -1
- package/dist/lite/features/contextMenu.cjs +1 -1
- package/dist/lite/features/contextMenu.js +1 -1
- package/dist/lite/features/fillHandle.cjs +1 -1
- package/dist/lite/features/fillHandle.js +1 -1
- package/dist/lite/features/filtering.cjs +1 -1
- package/dist/lite/features/filtering.js +1 -1
- package/dist/lite/features/grouping.cjs +1 -1
- package/dist/lite/features/grouping.js +1 -1
- package/dist/lite/features/labelRow.cjs +1 -1
- package/dist/lite/features/labelRow.js +1 -1
- package/dist/lite/features/pinnedRows.cjs +1 -0
- package/dist/lite/features/pinnedRows.js +2 -0
- package/dist/lite/features/rowDrag.cjs +1 -1
- package/dist/lite/features/rowDrag.js +1 -1
- package/dist/lite/features/selectionAggregates.cjs +1 -1
- package/dist/lite/features/selectionAggregates.js +1 -1
- package/dist/lite/features/standard.cjs +1 -1
- package/dist/lite/features/standard.js +3 -3
- package/dist/lite/features/toolPanel.cjs +1 -1
- package/dist/lite/features/toolPanel.js +1 -1
- package/dist/lite/fillHandle-CHJESnrk.cjs +1 -0
- package/dist/lite/fillHandle-CzA_uxgV.js +326 -0
- package/dist/lite/filtering-B9NSMjHq.cjs +1 -0
- package/dist/lite/filtering-BZoWpt28.js +411 -0
- package/dist/lite/grouping-BsOdLS32.cjs +1 -0
- package/dist/lite/{grouping-B6mO2bSd.js → grouping-DCR9Z6JK.js} +32 -32
- package/dist/lite/{labelRow-BNZoTxsT.js → labelRow-l9spGw-3.js} +20 -20
- package/dist/lite/labelRow-rhK34_qd.cjs +1 -0
- package/dist/lite/{lazyPopups-BQZ_tQmx.cjs → lazyPopups-Bx3u_NA9.cjs} +1 -1
- package/dist/lite/{lazyPopups-DbZ9rUbb.js → lazyPopups-DbnjvQXX.js} +1 -1
- package/dist/lite/pinnedRows-BzH-qw2i.js +143 -0
- package/dist/lite/pinnedRows-DwhFtppH.cjs +1 -0
- package/dist/lite/{rowDrag-BbE6--vV.js → rowDrag-BDYMGwvB.js} +1 -1
- package/dist/lite/rowDrag-E2YahPwG.cjs +1 -0
- package/dist/lite/{selectionAggregates-CS_VR9ev.js → selectionAggregates-DoHetiAE.js} +15 -23
- package/dist/lite/{selectionAggregates-CP0_LaAu.cjs → selectionAggregates-DuSb6U5D.cjs} +1 -1
- package/dist/lite/{toolPanel-RciyWlun.cjs → toolPanel-CSADXAfv.cjs} +1 -1
- package/dist/lite/{toolPanel-DZ6JUS79.js → toolPanel-ULXPL1kC.js} +1 -1
- package/dist/lite/toolPanelViews-C4qswcP_.cjs +1 -0
- package/dist/lite/toolPanelViews-DwUa6rm1.js +689 -0
- package/dist/lite/usePortalTokens-CUAiwfmK.cjs +1 -0
- package/dist/lite/usePortalTokens-hsX2T3ep.js +32 -0
- package/dist/lite.cjs +1 -1
- package/dist/lite.d.ts +1 -0
- package/dist/lite.js +21 -19
- package/dist/model/gridTypes.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/themes/astryx.css +3 -1
- package/dist/themes/heroui.css +3 -1
- package/dist/themes/mantine.css +3 -1
- package/dist/themes/shadcn.css +3 -1
- package/dist/toolPanelViews-CKKThiAQ.cjs +1 -0
- package/dist/toolPanelViews-DCpqVIEd.js +689 -0
- package/dist/useGridLocaleText-BV4EomZe.cjs +1 -0
- package/dist/useGridLocaleText-Drud4qg0.js +49 -0
- package/dist/{usePopupLocaleText-u-9PpBon.js → usePopupLocaleText-DJN10Asc.js} +1 -1
- package/dist/{usePopupLocaleText-BAn7AGEy.cjs → usePopupLocaleText-lEFHqTvJ.cjs} +1 -1
- package/dist/{useVirtualizerCore-BubgiDzY.js → useVirtualizerCore-C1k6Aw8p.js} +1 -1
- package/dist/{useVirtualizerCore-DTzCVMhF.cjs → useVirtualizerCore-Cif7t8mS.cjs} +1 -1
- package/dist/view/DefaultGridTopBar.d.ts +3 -2
- package/dist/view/FillHandleLayer.d.ts +1 -1
- package/dist/view/GridBodyGroupRow.d.ts +2 -1
- package/dist/view/GridBodyLabelRow.d.ts +2 -1
- package/dist/view/GridBodyLayer.d.ts +2 -1
- package/dist/view/GridDetailLayer.d.ts +2 -1
- package/dist/view/GridPinnedRows.d.ts +29 -0
- package/package.json +2 -2
- package/skills/spreadsheet-grid/SKILL.md +5 -2
- package/dist/ColumnFilterPopover-VHTWLyQ7.cjs +0 -1
- package/dist/lite/ColumnFilterPopover-BNzAJgCT.js +0 -1036
- package/dist/lite/ColumnFilterPopover-Dusx2AfV.cjs +0 -1
- package/dist/lite/columnMenu-C8LMgSDh.cjs +0 -1
- package/dist/lite/columnMenu-DImtqeXz.js +0 -351
- package/dist/lite/contextMenu-B6c_gXfn.cjs +0 -1
- package/dist/lite/contextMenu-C2IbM5fN.js +0 -137
- package/dist/lite/createSpreadsheetGrid-BsuvhGwN.cjs +0 -7
- package/dist/lite/createSpreadsheetGrid-CcUZV9Nl.js +0 -4383
- package/dist/lite/fillHandle-C7rhbEAc.js +0 -321
- package/dist/lite/fillHandle-DufUH_57.cjs +0 -1
- package/dist/lite/filtering-BJD9TbJf.js +0 -387
- package/dist/lite/filtering-CTgteY8F.cjs +0 -1
- package/dist/lite/grouping-wPCuEmD1.cjs +0 -1
- package/dist/lite/labelRow-JKoR6wHG.cjs +0 -1
- package/dist/lite/rowDrag-BJzh34bd.cjs +0 -1
- package/dist/lite/toolPanelViews-DYrngzT1.js +0 -667
- package/dist/lite/toolPanelViews-DgY7fFl7.cjs +0 -1
- package/dist/lite/usePortalTokens-BVnykmkk.cjs +0 -1
- package/dist/lite/usePortalTokens-mFOziRD2.js +0 -19
- package/dist/toolPanelViews-BdtqSCJ6.cjs +0 -1
- package/dist/toolPanelViews-C7C1j-ss.js +0 -667
- package/dist/useGridLocaleText-B4ZVUbqa.js +0 -36
- package/dist/useGridLocaleText-D74sCoAT.cjs +0 -1
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./useController-zuzvTNo5.js";
|
|
2
|
-
import { n as t } from "./usePortalTokens-mFOziRD2.js";
|
|
3
|
-
import { r as n } from "./useGridLocaleText-CpoTVgyp.js";
|
|
4
|
-
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useSyncExternalStore as s } from "react";
|
|
5
|
-
import { cx as c } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/cx";
|
|
6
|
-
import { createPortal as l } from "react-dom";
|
|
7
|
-
import { formatLocaleText as u } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
8
|
-
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
-
import { resolveSelectionBand as m, resolveSelectionBandSegments as h, resolveSelectionExtents as g } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionOverlayGeometry";
|
|
10
|
-
import { physicalToLogicalScrollTop as _ } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry";
|
|
11
|
-
import { DEFAULT_FILL_HANDLE_LOCALE_TEXT as v } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures";
|
|
12
|
-
import { createFillHandleController as y } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController";
|
|
13
|
-
import { hasFillableSource as b, resolveFillCornerPlacement as x, resolveFillOptionsChipPosition as S, resolveFillSource as C } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/fillHandle";
|
|
14
|
-
//#region src/view/FillHandleLayer.tsx
|
|
15
|
-
function w({ corner: e, headerHeight: t, leadingWidth: n, baseOffset: r, onPointerDown: i }) {
|
|
16
|
-
return e ? /* @__PURE__ */ f("div", {
|
|
17
|
-
className: "ssg-fill-handle",
|
|
18
|
-
style: {
|
|
19
|
-
position: "absolute",
|
|
20
|
-
left: n + e.x,
|
|
21
|
-
top: t + e.y - r
|
|
22
|
-
},
|
|
23
|
-
"data-ssg-fill-handle": "",
|
|
24
|
-
"aria-hidden": "true",
|
|
25
|
-
onPointerDown: i
|
|
26
|
-
}) : null;
|
|
27
|
-
}
|
|
28
|
-
function T({ rect: e, headerHeight: t, leadingWidth: n, baseOffset: r }) {
|
|
29
|
-
return /* @__PURE__ */ f("div", {
|
|
30
|
-
className: "ssg-fill-preview",
|
|
31
|
-
style: {
|
|
32
|
-
position: "absolute",
|
|
33
|
-
left: n + e.left,
|
|
34
|
-
top: t + e.top - r,
|
|
35
|
-
width: e.width,
|
|
36
|
-
height: e.height
|
|
37
|
-
},
|
|
38
|
-
"data-ssg-fill-preview": ""
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function ee({ position: e, headerHeight: t, leadingWidth: r, baseOffset: i, kind: a, menuOpen: o, chipRef: s, controller: l }) {
|
|
42
|
-
let d = n();
|
|
43
|
-
if (!e) return null;
|
|
44
|
-
let m = {
|
|
45
|
-
position: "absolute",
|
|
46
|
-
left: r + e.x,
|
|
47
|
-
top: t + e.y - i
|
|
48
|
-
};
|
|
49
|
-
return /* @__PURE__ */ p("button", {
|
|
50
|
-
ref: s,
|
|
51
|
-
type: "button",
|
|
52
|
-
className: c("ssg-fill-options", o && "ssg-fill-options--open"),
|
|
53
|
-
style: m,
|
|
54
|
-
"data-ssg-fill-options": "",
|
|
55
|
-
"aria-label": u(d.fillOptionsCurrent, { kind: a === "series" ? d.fillSeries : d.fillCopy }),
|
|
56
|
-
"aria-haspopup": "menu",
|
|
57
|
-
"aria-expanded": o,
|
|
58
|
-
title: d.fillOptions,
|
|
59
|
-
onPointerDown: (e) => {
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
},
|
|
62
|
-
onClick: (e) => {
|
|
63
|
-
let t = e.currentTarget.getBoundingClientRect();
|
|
64
|
-
l.toggleMenu({
|
|
65
|
-
left: t.left,
|
|
66
|
-
top: t.top,
|
|
67
|
-
bottom: t.bottom
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
children: [/* @__PURE__ */ p("svg", {
|
|
71
|
-
viewBox: "0 0 16 16",
|
|
72
|
-
width: "13",
|
|
73
|
-
height: "13",
|
|
74
|
-
fill: "none",
|
|
75
|
-
stroke: "currentColor",
|
|
76
|
-
strokeWidth: "1.6",
|
|
77
|
-
strokeLinecap: "round",
|
|
78
|
-
strokeLinejoin: "round",
|
|
79
|
-
"aria-hidden": "true",
|
|
80
|
-
focusable: "false",
|
|
81
|
-
children: [/* @__PURE__ */ f("rect", {
|
|
82
|
-
x: "2.5",
|
|
83
|
-
y: "2.5",
|
|
84
|
-
width: "7",
|
|
85
|
-
height: "7",
|
|
86
|
-
rx: "1"
|
|
87
|
-
}), /* @__PURE__ */ f("path", { d: "M6 10.5h7.5M10 7.5l3.5 3-3.5 3" })]
|
|
88
|
-
}), /* @__PURE__ */ f("span", {
|
|
89
|
-
className: "ssg-fill-options-caret",
|
|
90
|
-
"aria-hidden": "true",
|
|
91
|
-
children: "▾"
|
|
92
|
-
})]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
var E = [{
|
|
96
|
-
kind: "series",
|
|
97
|
-
label: "fillSeries"
|
|
98
|
-
}, {
|
|
99
|
-
kind: "copy",
|
|
100
|
-
label: "fillCopy"
|
|
101
|
-
}];
|
|
102
|
-
function D({ layout: e, kind: r, seriesAvailable: a, themeClassName: o, panelRef: s, controller: u }) {
|
|
103
|
-
let d = n();
|
|
104
|
-
return i(() => {
|
|
105
|
-
s.current?.querySelector("[aria-checked=\"true\"]")?.focus({ preventScroll: !0 });
|
|
106
|
-
}, [s]), t(s, !0, o), l(/* @__PURE__ */ f("div", {
|
|
107
|
-
ref: s,
|
|
108
|
-
role: "menu",
|
|
109
|
-
"aria-label": d.fillOptions,
|
|
110
|
-
className: c("ssg-menu-panel", "ssg-fill-menu", o),
|
|
111
|
-
style: {
|
|
112
|
-
position: "fixed",
|
|
113
|
-
top: e.top,
|
|
114
|
-
left: e.left,
|
|
115
|
-
zIndex: 1e3
|
|
116
|
-
},
|
|
117
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
118
|
-
onKeyDown: (e) => {
|
|
119
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
let t = Array.from(s.current?.querySelectorAll("[role=\"menuitemradio\"]:not(:disabled)") ?? []);
|
|
122
|
-
t[(t.findIndex((e) => e === document.activeElement) + (e.key === "ArrowDown" ? 1 : t.length - 1)) % t.length]?.focus({ preventScroll: !0 });
|
|
123
|
-
} else e.key === "Tab" && (e.preventDefault(), u.closeMenu());
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
},
|
|
126
|
-
onContextMenu: (e) => e.preventDefault(),
|
|
127
|
-
children: E.map((e) => {
|
|
128
|
-
let t = e.kind === "series" && !a, n = e.kind === r;
|
|
129
|
-
return /* @__PURE__ */ p("button", {
|
|
130
|
-
type: "button",
|
|
131
|
-
role: "menuitemradio",
|
|
132
|
-
"aria-checked": n,
|
|
133
|
-
disabled: t,
|
|
134
|
-
className: c("ssg-menu-item", n && "ssg-menu-item--active", t && "ssg-menu-item--disabled"),
|
|
135
|
-
onClick: () => u.chooseKind(e.kind),
|
|
136
|
-
children: [/* @__PURE__ */ f("span", {
|
|
137
|
-
className: "ssg-menu-icon ssg-fill-menu-check",
|
|
138
|
-
children: n ? "✓" : ""
|
|
139
|
-
}), /* @__PURE__ */ f("span", {
|
|
140
|
-
className: "ssg-menu-label",
|
|
141
|
-
children: d[e.label]
|
|
142
|
-
})]
|
|
143
|
-
}, e.kind);
|
|
144
|
-
})
|
|
145
|
-
}), document.body);
|
|
146
|
-
}
|
|
147
|
-
var O = 14, k = 18;
|
|
148
|
-
function te({ text: e, themeClassName: n, controller: r }) {
|
|
149
|
-
let i = s(r.subscribePointer, r.getPointerSnapshot, r.getPointerSnapshot), a = o(null);
|
|
150
|
-
return t(a, i !== null, n), i ? l(/* @__PURE__ */ f("div", {
|
|
151
|
-
ref: a,
|
|
152
|
-
className: c("ssg-tooltip", "ssg-tooltip--visible", "ssg-fill-tooltip", n),
|
|
153
|
-
style: {
|
|
154
|
-
left: i.x + O,
|
|
155
|
-
top: i.y + k
|
|
156
|
-
},
|
|
157
|
-
"aria-hidden": "true",
|
|
158
|
-
"data-ssg-fill-tooltip": "",
|
|
159
|
-
children: e
|
|
160
|
-
}), document.body) : null;
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/hooks/useFillHandleController.ts
|
|
164
|
-
var ne = (t) => {
|
|
165
|
-
let n = e(() => y(), t);
|
|
166
|
-
return {
|
|
167
|
-
fillController: n,
|
|
168
|
-
fillSnapshot: s(n.subscribe, n.getSnapshot, n.getSnapshot),
|
|
169
|
-
fillChipRef: n.chipElement,
|
|
170
|
-
fillMenuRef: n.menuPanel
|
|
171
|
-
};
|
|
172
|
-
}, A = {
|
|
173
|
-
useFillHandle: ({ fillHandle: e, readOnly: t, isServerSide: n, rows: i, rowModel: o, orderedColumns: s, uiState: c, serverSideQueryKey: l, serverSideRefreshToken: u, canEditCell: v, dispatch: y, getCellCoordFromClientPoint: E, scrollContainerRef: O, gridRootRef: k, footerHeight: A, handleRowsChange: j, amendRowsChange: re, applyServerSideCellEdits: M, viewRowCount: N, paneLayout: P, rowMetrics: F, windowFirstRow: I, windowLastRow: L, detailActive: R, detailExtras: z, viewportHeight: B, scrollTop: V, verticalScaleFactor: H, headerHeight: U, overlayBaseOffset: W, portalClassName: G }) => {
|
|
174
|
-
let K = typeof e == "object" ? e : void 0, q = !!e && !t && (n ? M !== void 0 : j !== void 0), { fillController: J, fillSnapshot: Y, fillChipRef: X, fillMenuRef: ie } = ne({
|
|
175
|
-
enabled: q,
|
|
176
|
-
isServerSide: n,
|
|
177
|
-
rows: i,
|
|
178
|
-
rowModel: o,
|
|
179
|
-
columns: s,
|
|
180
|
-
selection: c.selection,
|
|
181
|
-
activeCell: c.activeCell,
|
|
182
|
-
editing: c.editingCell !== null,
|
|
183
|
-
viewKey: [
|
|
184
|
-
c.sort,
|
|
185
|
-
c.filters,
|
|
186
|
-
c.collapsedGroupKeys,
|
|
187
|
-
l,
|
|
188
|
-
u
|
|
189
|
-
],
|
|
190
|
-
readOnly: t,
|
|
191
|
-
canEditCell: v,
|
|
192
|
-
getFillValue: K?.getFillValue,
|
|
193
|
-
dispatch: y,
|
|
194
|
-
hitTest: E,
|
|
195
|
-
scrollContainerRef: O,
|
|
196
|
-
gridRootRef: k,
|
|
197
|
-
footerHeight: A,
|
|
198
|
-
applyRowsChange: j,
|
|
199
|
-
amendRowsChange: re,
|
|
200
|
-
applyServerSideCellEdits: M
|
|
201
|
-
}), Z = a(() => {
|
|
202
|
-
if (!q || c.editingCell || c.dragState?.type === "selection") return null;
|
|
203
|
-
let e = C(c.selection, c.activeCell, N, s.length);
|
|
204
|
-
return !e || !b(e, o, s) ? null : x(e, P, F, I, L);
|
|
205
|
-
}, [
|
|
206
|
-
q,
|
|
207
|
-
c.editingCell,
|
|
208
|
-
c.dragState,
|
|
209
|
-
c.selection,
|
|
210
|
-
c.activeCell,
|
|
211
|
-
N,
|
|
212
|
-
s,
|
|
213
|
-
o,
|
|
214
|
-
P,
|
|
215
|
-
F,
|
|
216
|
-
I,
|
|
217
|
-
L
|
|
218
|
-
]), Q = a(() => {
|
|
219
|
-
if (Y.status !== "dragging" || Y.target === null) return null;
|
|
220
|
-
let { source: e, target: t } = Y;
|
|
221
|
-
return {
|
|
222
|
-
type: "cell",
|
|
223
|
-
range: {
|
|
224
|
-
start: {
|
|
225
|
-
row: Math.min(e.startRow, t.range.startRow),
|
|
226
|
-
col: Math.min(e.startCol, t.range.startCol)
|
|
227
|
-
},
|
|
228
|
-
end: {
|
|
229
|
-
row: Math.max(e.endRow, t.range.endRow),
|
|
230
|
-
col: Math.max(e.endCol, t.range.endCol)
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
}, [Y]), ae = a(() => {
|
|
235
|
-
let e = g(Q, P, N), t = h(R, e, I, L, F, z), n = t ? null : m(e, I, L, F);
|
|
236
|
-
return (r) => {
|
|
237
|
-
let i = e?.extents[r];
|
|
238
|
-
return i ? t ? t.map((e) => ({
|
|
239
|
-
left: i.start,
|
|
240
|
-
top: e.top,
|
|
241
|
-
width: i.width,
|
|
242
|
-
height: e.height
|
|
243
|
-
})) : n ? [{
|
|
244
|
-
left: i.start,
|
|
245
|
-
top: n.top,
|
|
246
|
-
width: i.width,
|
|
247
|
-
height: n.height
|
|
248
|
-
}] : [] : [];
|
|
249
|
-
};
|
|
250
|
-
}, [
|
|
251
|
-
Q,
|
|
252
|
-
P,
|
|
253
|
-
N,
|
|
254
|
-
R,
|
|
255
|
-
I,
|
|
256
|
-
L,
|
|
257
|
-
F,
|
|
258
|
-
z
|
|
259
|
-
]), $ = a(() => {
|
|
260
|
-
if (Y.status !== "filled") return null;
|
|
261
|
-
let e = x(Y.range, P, F, I, L), t = B > 0 ? _(V, H) + B - U : Infinity;
|
|
262
|
-
return e ? {
|
|
263
|
-
pane: e.pane,
|
|
264
|
-
position: S(e, F.totalBodyHeight, t)
|
|
265
|
-
} : null;
|
|
266
|
-
}, [
|
|
267
|
-
Y,
|
|
268
|
-
P,
|
|
269
|
-
F,
|
|
270
|
-
I,
|
|
271
|
-
L,
|
|
272
|
-
B,
|
|
273
|
-
V,
|
|
274
|
-
H,
|
|
275
|
-
U
|
|
276
|
-
]), oe = r((e) => J.handlePointerDown(e), [J]);
|
|
277
|
-
return {
|
|
278
|
-
filling: Y.status === "dragging",
|
|
279
|
-
renderLayer: (e, t) => /* @__PURE__ */ p(d, { children: [
|
|
280
|
-
ae(e).map((e, n) => /* @__PURE__ */ f(T, {
|
|
281
|
-
rect: e,
|
|
282
|
-
headerHeight: U,
|
|
283
|
-
baseOffset: W,
|
|
284
|
-
leadingWidth: t
|
|
285
|
-
}, n)),
|
|
286
|
-
/* @__PURE__ */ f(w, {
|
|
287
|
-
corner: Z?.pane === e ? Z : null,
|
|
288
|
-
headerHeight: U,
|
|
289
|
-
baseOffset: W,
|
|
290
|
-
leadingWidth: t,
|
|
291
|
-
onPointerDown: oe
|
|
292
|
-
}),
|
|
293
|
-
Y.status === "filled" && /* @__PURE__ */ f(ee, {
|
|
294
|
-
position: $?.pane === e ? $.position : null,
|
|
295
|
-
headerHeight: U,
|
|
296
|
-
baseOffset: W,
|
|
297
|
-
leadingWidth: t,
|
|
298
|
-
kind: Y.kind,
|
|
299
|
-
menuOpen: Y.menu !== null,
|
|
300
|
-
chipRef: X,
|
|
301
|
-
controller: J
|
|
302
|
-
})
|
|
303
|
-
] }),
|
|
304
|
-
renderPortals: () => /* @__PURE__ */ p(d, { children: [Y.status === "filled" && Y.menu !== null && /* @__PURE__ */ f(D, {
|
|
305
|
-
layout: Y.menu,
|
|
306
|
-
kind: Y.kind,
|
|
307
|
-
seriesAvailable: Y.seriesAvailable,
|
|
308
|
-
themeClassName: G,
|
|
309
|
-
panelRef: ie,
|
|
310
|
-
controller: J
|
|
311
|
-
}), Y.status === "dragging" && Y.previewText !== null && /* @__PURE__ */ f(te, {
|
|
312
|
-
text: Y.previewText,
|
|
313
|
-
themeClassName: G,
|
|
314
|
-
controller: J
|
|
315
|
-
})] })
|
|
316
|
-
};
|
|
317
|
-
},
|
|
318
|
-
localeText: v
|
|
319
|
-
};
|
|
320
|
-
//#endregion
|
|
321
|
-
export { A as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useController-Zlv7BRoY.cjs"),t=require("./usePortalTokens-BVnykmkk.cjs"),n=require("./useGridLocaleText-CRSWUb4o.cjs");let r=require("react"),i=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/cx"),a=require("react-dom"),o=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText"),s=require("react/jsx-runtime"),c=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/selectionOverlayGeometry"),l=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry"),u=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFeatures"),d=require("@ishibashi0112/spreadsheet-grid-core/internal/controllers/fillHandleController"),f=require("@ishibashi0112/spreadsheet-grid-core/internal/logic/fillHandle");function p({corner:e,headerHeight:t,leadingWidth:n,baseOffset:r,onPointerDown:i}){return e?(0,s.jsx)(`div`,{className:`ssg-fill-handle`,style:{position:`absolute`,left:n+e.x,top:t+e.y-r},"data-ssg-fill-handle":``,"aria-hidden":`true`,onPointerDown:i}):null}function m({rect:e,headerHeight:t,leadingWidth:n,baseOffset:r}){return(0,s.jsx)(`div`,{className:`ssg-fill-preview`,style:{position:`absolute`,left:n+e.left,top:t+e.top-r,width:e.width,height:e.height},"data-ssg-fill-preview":``})}function h({position:e,headerHeight:t,leadingWidth:r,baseOffset:a,kind:c,menuOpen:l,chipRef:u,controller:d}){let f=n.r();if(!e)return null;let p={position:`absolute`,left:r+e.x,top:t+e.y-a};return(0,s.jsxs)(`button`,{ref:u,type:`button`,className:(0,i.cx)(`ssg-fill-options`,l&&`ssg-fill-options--open`),style:p,"data-ssg-fill-options":``,"aria-label":(0,o.formatLocaleText)(f.fillOptionsCurrent,{kind:c===`series`?f.fillSeries:f.fillCopy}),"aria-haspopup":`menu`,"aria-expanded":l,title:f.fillOptions,onPointerDown:e=>{e.preventDefault()},onClick:e=>{let t=e.currentTarget.getBoundingClientRect();d.toggleMenu({left:t.left,top:t.top,bottom:t.bottom})},children:[(0,s.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,s.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`7`,height:`7`,rx:`1`}),(0,s.jsx)(`path`,{d:`M6 10.5h7.5M10 7.5l3.5 3-3.5 3`})]}),(0,s.jsx)(`span`,{className:`ssg-fill-options-caret`,"aria-hidden":`true`,children:`▾`})]})}var g=[{kind:`series`,label:`fillSeries`},{kind:`copy`,label:`fillCopy`}];function _({layout:e,kind:o,seriesAvailable:c,themeClassName:l,panelRef:u,controller:d}){let f=n.r();return(0,r.useEffect)(()=>{u.current?.querySelector(`[aria-checked="true"]`)?.focus({preventScroll:!0})},[u]),t.n(u,!0,l),(0,a.createPortal)((0,s.jsx)(`div`,{ref:u,role:`menu`,"aria-label":f.fillOptions,className:(0,i.cx)(`ssg-menu-panel`,`ssg-fill-menu`,l),style:{position:`fixed`,top:e.top,left:e.left,zIndex:1e3},onPointerDown:e=>e.stopPropagation(),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Array.from(u.current?.querySelectorAll(`[role="menuitemradio"]:not(:disabled)`)??[]);t[(t.findIndex(e=>e===document.activeElement)+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus({preventScroll:!0})}else e.key===`Tab`&&(e.preventDefault(),d.closeMenu());e.stopPropagation()},onContextMenu:e=>e.preventDefault(),children:g.map(e=>{let t=e.kind===`series`&&!c,n=e.kind===o;return(0,s.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,disabled:t,className:(0,i.cx)(`ssg-menu-item`,n&&`ssg-menu-item--active`,t&&`ssg-menu-item--disabled`),onClick:()=>d.chooseKind(e.kind),children:[(0,s.jsx)(`span`,{className:`ssg-menu-icon ssg-fill-menu-check`,children:n?`✓`:``}),(0,s.jsx)(`span`,{className:`ssg-menu-label`,children:f[e.label]})]},e.kind)})}),document.body)}var v=14,y=18;function b({text:e,themeClassName:n,controller:o}){let c=(0,r.useSyncExternalStore)(o.subscribePointer,o.getPointerSnapshot,o.getPointerSnapshot),l=(0,r.useRef)(null);return t.n(l,c!==null,n),c?(0,a.createPortal)((0,s.jsx)(`div`,{ref:l,className:(0,i.cx)(`ssg-tooltip`,`ssg-tooltip--visible`,`ssg-fill-tooltip`,n),style:{left:c.x+v,top:c.y+y},"aria-hidden":`true`,"data-ssg-fill-tooltip":``,children:e}),document.body):null}var x=t=>{let n=e.t(()=>(0,d.createFillHandleController)(),t);return{fillController:n,fillSnapshot:(0,r.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),fillChipRef:n.chipElement,fillMenuRef:n.menuPanel}},S={useFillHandle:({fillHandle:e,readOnly:t,isServerSide:n,rows:i,rowModel:a,orderedColumns:o,uiState:u,serverSideQueryKey:d,serverSideRefreshToken:g,canEditCell:v,dispatch:y,getCellCoordFromClientPoint:S,scrollContainerRef:C,gridRootRef:w,footerHeight:T,handleRowsChange:E,amendRowsChange:D,applyServerSideCellEdits:O,viewRowCount:k,paneLayout:A,rowMetrics:j,windowFirstRow:M,windowLastRow:N,detailActive:P,detailExtras:F,viewportHeight:I,scrollTop:L,verticalScaleFactor:R,headerHeight:z,overlayBaseOffset:B,portalClassName:V})=>{let H=typeof e==`object`?e:void 0,U=!!e&&!t&&(n?O!==void 0:E!==void 0),{fillController:W,fillSnapshot:G,fillChipRef:K,fillMenuRef:q}=x({enabled:U,isServerSide:n,rows:i,rowModel:a,columns:o,selection:u.selection,activeCell:u.activeCell,editing:u.editingCell!==null,viewKey:[u.sort,u.filters,u.collapsedGroupKeys,d,g],readOnly:t,canEditCell:v,getFillValue:H?.getFillValue,dispatch:y,hitTest:S,scrollContainerRef:C,gridRootRef:w,footerHeight:T,applyRowsChange:E,amendRowsChange:D,applyServerSideCellEdits:O}),J=(0,r.useMemo)(()=>{if(!U||u.editingCell||u.dragState?.type===`selection`)return null;let e=(0,f.resolveFillSource)(u.selection,u.activeCell,k,o.length);return!e||!(0,f.hasFillableSource)(e,a,o)?null:(0,f.resolveFillCornerPlacement)(e,A,j,M,N)},[U,u.editingCell,u.dragState,u.selection,u.activeCell,k,o,a,A,j,M,N]),Y=(0,r.useMemo)(()=>{if(G.status!==`dragging`||G.target===null)return null;let{source:e,target:t}=G;return{type:`cell`,range:{start:{row:Math.min(e.startRow,t.range.startRow),col:Math.min(e.startCol,t.range.startCol)},end:{row:Math.max(e.endRow,t.range.endRow),col:Math.max(e.endCol,t.range.endCol)}}}},[G]),X=(0,r.useMemo)(()=>{let e=(0,c.resolveSelectionExtents)(Y,A,k),t=(0,c.resolveSelectionBandSegments)(P,e,M,N,j,F),n=t?null:(0,c.resolveSelectionBand)(e,M,N,j);return r=>{let i=e?.extents[r];return i?t?t.map(e=>({left:i.start,top:e.top,width:i.width,height:e.height})):n?[{left:i.start,top:n.top,width:i.width,height:n.height}]:[]:[]}},[Y,A,k,P,M,N,j,F]),Z=(0,r.useMemo)(()=>{if(G.status!==`filled`)return null;let e=(0,f.resolveFillCornerPlacement)(G.range,A,j,M,N),t=I>0?(0,l.physicalToLogicalScrollTop)(L,R)+I-z:1/0;return e?{pane:e.pane,position:(0,f.resolveFillOptionsChipPosition)(e,j.totalBodyHeight,t)}:null},[G,A,j,M,N,I,L,R,z]),Q=(0,r.useCallback)(e=>W.handlePointerDown(e),[W]);return{filling:G.status===`dragging`,renderLayer:(e,t)=>(0,s.jsxs)(s.Fragment,{children:[X(e).map((e,n)=>(0,s.jsx)(m,{rect:e,headerHeight:z,baseOffset:B,leadingWidth:t},n)),(0,s.jsx)(p,{corner:J?.pane===e?J:null,headerHeight:z,baseOffset:B,leadingWidth:t,onPointerDown:Q}),G.status===`filled`&&(0,s.jsx)(h,{position:Z?.pane===e?Z.position:null,headerHeight:z,baseOffset:B,leadingWidth:t,kind:G.kind,menuOpen:G.menu!==null,chipRef:K,controller:W})]}),renderPortals:()=>(0,s.jsxs)(s.Fragment,{children:[G.status===`filled`&&G.menu!==null&&(0,s.jsx)(_,{layout:G.menu,kind:G.kind,seriesAvailable:G.seriesAvailable,themeClassName:V,panelRef:q,controller:W}),G.status===`dragging`&&G.previewText!==null&&(0,s.jsx)(b,{text:G.previewText,themeClassName:V,controller:W})]})}},localeText:u.DEFAULT_FILL_HANDLE_LOCALE_TEXT};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});
|