@ishibashi0112/spreadsheet-grid-solid 0.1.1 → 1.4.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 +2865 -0
- package/README.md +43 -25
- package/dist/ColumnFilterPopover-mENgY4gl.js +1426 -0
- package/dist/ai/GridAskBar.d.ts +20 -0
- package/dist/ai/createGridAsk.d.ts +94 -0
- package/dist/ai.d.ts +7 -0
- package/dist/ai.js +412 -0
- package/dist/columnVirtualizer-DdL7-ijS.js +193 -0
- package/dist/createSpreadsheetGrid.d.ts +14 -0
- package/dist/devWarnings.d.ts +0 -1
- package/dist/editors/CellEditorLayer.d.ts +1 -0
- package/dist/editors/DateCellEditor.d.ts +1 -0
- package/dist/editors/NumberCellEditor.d.ts +1 -0
- package/dist/editors/SelectCellEditor.d.ts +3 -1
- package/dist/editors/TextCellEditor.d.ts +1 -0
- package/dist/features/contextMenu.d.ts +0 -14
- package/dist/features/types.d.ts +1 -1
- package/dist/index.js +3069 -3123
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/en.js +2 -2
- package/dist/primitives/effectApply.d.ts +1 -0
- package/dist/primitives/serverSnapshot.d.ts +5 -0
- package/dist/primitives/storeRows.d.ts +2 -0
- package/dist/source/ai.jsx +619 -0
- package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-D7INPNVB.jsx} +29 -10
- package/dist/source/chunks/chunk-ZZTXTW4Z.jsx +301 -0
- package/dist/source/chunks/{toolPanelViews-W6KROURU.jsx → toolPanelViews-HIQGRX3N.jsx} +4 -2
- package/dist/source/index.jsx +857 -853
- package/dist/style.css +1 -1
- package/dist/style.layer.css +1 -1
- package/dist/{toolPanelViews-BE4gv_L0.js → toolPanelViews-BISN9iaG.js} +120 -119
- package/dist/view/DetailToggleButton.d.ts +1 -0
- package/package.json +12 -5
- package/skills/spreadsheet-grid-solid/SKILL.md +108 -0
- package/dist/ColumnFilterPopover-BmxumbB7.js +0 -1418
- package/dist/columnVirtualizer-CGHyzbwH.js +0 -95
- package/dist/source/chunks/chunk-5KX4SR2S.jsx +0 -143
package/dist/source/chunks/{ColumnFilterPopover-BMKPRELT.jsx → ColumnFilterPopover-D7INPNVB.jsx}
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
connectController,
|
|
3
|
+
createColumnVirtualizer,
|
|
4
|
+
createExternalStoreSignal
|
|
5
|
+
} from "./chunk-ZZTXTW4Z.jsx";
|
|
4
6
|
import {
|
|
5
7
|
controlledToggle,
|
|
6
8
|
createIndeterminate,
|
|
@@ -27,6 +29,7 @@ import {
|
|
|
27
29
|
} from "solid-js";
|
|
28
30
|
import { Portal } from "@solidjs/web";
|
|
29
31
|
import { isEscapePreventedInside } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/escapeClaimController";
|
|
32
|
+
import { keepFocusAfterPress } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport";
|
|
30
33
|
import { resolveFocusWrapTarget } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
|
|
31
34
|
import {
|
|
32
35
|
filterSetOptionsBySearch,
|
|
@@ -55,8 +58,10 @@ import {
|
|
|
55
58
|
buildParsedDateFilterFromDraft,
|
|
56
59
|
dateFilterOperandCount,
|
|
57
60
|
filterOptionsByDateCondition,
|
|
58
|
-
normalizeFilterDateInputValue
|
|
61
|
+
normalizeFilterDateInputValue,
|
|
62
|
+
resolveComboReferenceDate
|
|
59
63
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition";
|
|
64
|
+
import { createDateRolloverStore } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore";
|
|
60
65
|
import {
|
|
61
66
|
normalizeDateFilterPresets
|
|
62
67
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
|
|
@@ -68,6 +73,7 @@ import { DEFAULT_FILTER_LOCALE_TEXT } from "@ishibashi0112/spreadsheet-grid-core
|
|
|
68
73
|
// src/view/FilterDateField.tsx
|
|
69
74
|
import { For, Show, createEffect, createMemo, createSignal, onCleanup, untrack } from "solid-js";
|
|
70
75
|
import { toDateKey } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/filtering";
|
|
76
|
+
import { parseFilterDateText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/editorValues";
|
|
71
77
|
import {
|
|
72
78
|
buildCalendarDayCells,
|
|
73
79
|
buildYearGrid,
|
|
@@ -76,6 +82,7 @@ import {
|
|
|
76
82
|
} from "@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar";
|
|
77
83
|
import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
78
84
|
import { formatLocaleText } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
|
|
85
|
+
import { getEventTarget } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
79
86
|
function FilterDateField(props) {
|
|
80
87
|
const texts = usePopupLocaleText();
|
|
81
88
|
const [editingText, setEditingText] = createSignal(null);
|
|
@@ -108,7 +115,7 @@ function FilterDateField(props) {
|
|
|
108
115
|
setIsInvalid(false);
|
|
109
116
|
return;
|
|
110
117
|
}
|
|
111
|
-
const key =
|
|
118
|
+
const key = parseFilterDateText(raw);
|
|
112
119
|
if (key === null) {
|
|
113
120
|
setIsInvalid(true);
|
|
114
121
|
return;
|
|
@@ -139,7 +146,7 @@ function FilterDateField(props) {
|
|
|
139
146
|
return void 0;
|
|
140
147
|
}
|
|
141
148
|
const handleDocumentPointerDown = (event) => {
|
|
142
|
-
const target = event
|
|
149
|
+
const target = getEventTarget(event, rootElement ?? null);
|
|
143
150
|
if (target && rootElement?.contains(target)) {
|
|
144
151
|
return;
|
|
145
152
|
}
|
|
@@ -407,13 +414,13 @@ var pressHandlers = (action) => ({
|
|
|
407
414
|
onPointerDown: (event) => {
|
|
408
415
|
event.preventDefault();
|
|
409
416
|
event.stopPropagation();
|
|
410
|
-
action();
|
|
417
|
+
action(event.currentTarget);
|
|
411
418
|
},
|
|
412
419
|
onKeyDown: (event) => {
|
|
413
420
|
stopButtonKeyPropagation(event);
|
|
414
421
|
if (event.key === "Enter" || event.key === " ") {
|
|
415
422
|
event.preventDefault();
|
|
416
|
-
action();
|
|
423
|
+
action(event.currentTarget);
|
|
417
424
|
}
|
|
418
425
|
}
|
|
419
426
|
});
|
|
@@ -777,7 +784,10 @@ function DateConditionEditor(props) {
|
|
|
777
784
|
<For2 each={props.presets} keyed={(option) => option.id}>
|
|
778
785
|
{(option) => <button
|
|
779
786
|
type="button"
|
|
780
|
-
{...pressHandlers(() =>
|
|
787
|
+
{...pressHandlers((element) => {
|
|
788
|
+
togglePreset(option().id);
|
|
789
|
+
keepFocusAfterPress(element);
|
|
790
|
+
})}
|
|
781
791
|
class={["ssg-filter-preset-chip", { "ssg-filter-preset-chip--active": props.draft.preset === option().id }]}
|
|
782
792
|
>
|
|
783
793
|
{option().label}
|
|
@@ -1151,7 +1161,16 @@ function ColumnFilterPopover(props) {
|
|
|
1151
1161
|
const portal = useGridPortal();
|
|
1152
1162
|
const container = portal.container();
|
|
1153
1163
|
const comboSearchInputRef = { current: null };
|
|
1154
|
-
const
|
|
1164
|
+
const comboOpenedAt = /* @__PURE__ */ new Date();
|
|
1165
|
+
const comboDateRollover = createDateRolloverStore();
|
|
1166
|
+
connectController(
|
|
1167
|
+
comboDateRollover,
|
|
1168
|
+
() => ({ active: props.filterType === "dateSet" && (props.dateConditionDraft?.preset ?? null) !== null }),
|
|
1169
|
+
"render",
|
|
1170
|
+
"filterDateRollover"
|
|
1171
|
+
);
|
|
1172
|
+
const comboDateKey = createExternalStoreSignal(comboDateRollover, "filterDateRolloverStore");
|
|
1173
|
+
const comboNow = () => resolveComboReferenceDate(comboOpenedAt, comboDateKey());
|
|
1155
1174
|
const [panel, setPanel] = createSignal2();
|
|
1156
1175
|
let panelNode;
|
|
1157
1176
|
onCleanup2(() => {
|
|
@@ -1189,7 +1208,7 @@ function ColumnFilterPopover(props) {
|
|
|
1189
1208
|
() => numberComboCondition() !== null || textComboCondition() !== null || dateComboCondition() !== null
|
|
1190
1209
|
);
|
|
1191
1210
|
const comboOptions = createMemo2(
|
|
1192
|
-
() => isNumberSetFilter() ? filterOptionsByNumberCondition(props.selectOptions, numberComboCondition()) : isTextSetFilter() ? filterOptionsByTextCondition(props.selectOptions, textComboCondition()) : isDateSetFilter() ? filterOptionsByDateCondition(props.selectOptions, dateComboCondition(), comboNow, resolvedDatePresets()) : props.selectOptions
|
|
1211
|
+
() => isNumberSetFilter() ? filterOptionsByNumberCondition(props.selectOptions, numberComboCondition()) : isTextSetFilter() ? filterOptionsByTextCondition(props.selectOptions, textComboCondition()) : isDateSetFilter() ? filterOptionsByDateCondition(props.selectOptions, dateComboCondition(), comboNow(), resolvedDatePresets()) : props.selectOptions
|
|
1193
1212
|
);
|
|
1194
1213
|
const comboOptionsMeta = createMemo2(() => {
|
|
1195
1214
|
const phase = optionsPhase();
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
// src/primitives/externalStore.ts
|
|
2
|
+
import { createSignal, isHydrating } from "solid-js";
|
|
3
|
+
|
|
4
|
+
// src/primitives/mountGate.ts
|
|
5
|
+
import { onSettled, untrack } from "solid-js";
|
|
6
|
+
var current = null;
|
|
7
|
+
function createMountGate() {
|
|
8
|
+
return { queue: [], done: false };
|
|
9
|
+
}
|
|
10
|
+
function runInMountGate(gate, fn) {
|
|
11
|
+
const previous = current;
|
|
12
|
+
current = gate;
|
|
13
|
+
try {
|
|
14
|
+
return fn();
|
|
15
|
+
} finally {
|
|
16
|
+
current = previous;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function flushMountGate(gate) {
|
|
20
|
+
if (gate.done) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
gate.done = true;
|
|
24
|
+
const queue = gate.queue;
|
|
25
|
+
gate.queue = [];
|
|
26
|
+
for (const run of queue) {
|
|
27
|
+
run();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function closeMountGateOnSettled(gate) {
|
|
31
|
+
onSettled(() => {
|
|
32
|
+
gate.done = true;
|
|
33
|
+
gate.queue = [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function onGridMounted(fn) {
|
|
37
|
+
const gate = current;
|
|
38
|
+
let ran = false;
|
|
39
|
+
let cleanup;
|
|
40
|
+
const run = () => {
|
|
41
|
+
if (ran) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
ran = true;
|
|
45
|
+
cleanup = untrack(fn);
|
|
46
|
+
};
|
|
47
|
+
gate?.queue.push(run);
|
|
48
|
+
onSettled(() => {
|
|
49
|
+
run();
|
|
50
|
+
return () => {
|
|
51
|
+
if (typeof cleanup === "function") {
|
|
52
|
+
cleanup();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/primitives/externalStore.ts
|
|
59
|
+
function createExternalStoreSignal(store, name) {
|
|
60
|
+
const initial = isHydrating() && store.getServerSnapshot ? store.getServerSnapshot() : store.getSnapshot();
|
|
61
|
+
const [value, setValue] = createSignal(initial, name === void 0 ? void 0 : { name });
|
|
62
|
+
onGridMounted(() => {
|
|
63
|
+
setValue(() => store.getSnapshot());
|
|
64
|
+
return store.subscribe(() => setValue(() => store.getSnapshot()));
|
|
65
|
+
});
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/primitives/controller.ts
|
|
70
|
+
import { createEffect, createRenderEffect, createSignal as createSignal2, untrack as untrack2 } from "solid-js";
|
|
71
|
+
|
|
72
|
+
// src/primitives/effectApply.ts
|
|
73
|
+
function outsideGraphApply(apply) {
|
|
74
|
+
return (...values) => {
|
|
75
|
+
apply(values[0]);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/primitives/userCallback.ts
|
|
80
|
+
import { flush, getOwner, isDisposed } from "solid-js";
|
|
81
|
+
var gridUpdateDepth = 0;
|
|
82
|
+
var handleCallDepth = 0;
|
|
83
|
+
var isolatingDepth = 0;
|
|
84
|
+
var pendingReplays = /* @__PURE__ */ new Set();
|
|
85
|
+
function runGridUpdate(fn) {
|
|
86
|
+
gridUpdateDepth++;
|
|
87
|
+
try {
|
|
88
|
+
return fn();
|
|
89
|
+
} finally {
|
|
90
|
+
gridUpdateDepth--;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function runHandleCall(fn) {
|
|
94
|
+
handleCallDepth++;
|
|
95
|
+
try {
|
|
96
|
+
return fn();
|
|
97
|
+
} finally {
|
|
98
|
+
handleCallDepth--;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function isIsolatingFlush() {
|
|
102
|
+
return isolatingDepth > 0;
|
|
103
|
+
}
|
|
104
|
+
function deferControllerUpdate(replay) {
|
|
105
|
+
pendingReplays.add(replay);
|
|
106
|
+
}
|
|
107
|
+
var flushQuietly = () => {
|
|
108
|
+
try {
|
|
109
|
+
flush();
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var isolatedFlush = () => {
|
|
114
|
+
isolatingDepth++;
|
|
115
|
+
try {
|
|
116
|
+
flushQuietly();
|
|
117
|
+
} finally {
|
|
118
|
+
isolatingDepth--;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var releaseReplays = () => {
|
|
122
|
+
if (pendingReplays.size === 0) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const replays = Array.from(pendingReplays);
|
|
126
|
+
pendingReplays.clear();
|
|
127
|
+
for (const replay of replays) {
|
|
128
|
+
replay();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function callInOwnFrame(fn, ...args) {
|
|
132
|
+
if (handleCallDepth > 0 || gridUpdateDepth > 0 || getOwner() !== null) {
|
|
133
|
+
return fn(...args);
|
|
134
|
+
}
|
|
135
|
+
isolatedFlush();
|
|
136
|
+
try {
|
|
137
|
+
return fn(...args);
|
|
138
|
+
} finally {
|
|
139
|
+
isolatedFlush();
|
|
140
|
+
releaseReplays();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function createUserCallbacks() {
|
|
144
|
+
const owner = getOwner();
|
|
145
|
+
const call = (fn, ...args) => {
|
|
146
|
+
if (handleCallDepth > 0 || gridUpdateDepth === 0 && getOwner() !== null) {
|
|
147
|
+
return fn(...args);
|
|
148
|
+
}
|
|
149
|
+
if (gridUpdateDepth > 0) {
|
|
150
|
+
queueMicrotask(() => {
|
|
151
|
+
if (owner && isDisposed(owner)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
flushQuietly();
|
|
155
|
+
fn(...args);
|
|
156
|
+
flushQuietly();
|
|
157
|
+
});
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
return callInOwnFrame(fn, ...args);
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
call,
|
|
164
|
+
wrap: (fn) => fn ? (...args) => call(fn, ...args) : void 0
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/primitives/controller.ts
|
|
169
|
+
function connectController(controller, args, timing = "render", name) {
|
|
170
|
+
let mounted = false;
|
|
171
|
+
let latest = null;
|
|
172
|
+
const [replay, setReplay] = createSignal2(0, name === void 0 ? void 0 : { name: `${name}Replay` });
|
|
173
|
+
const requestReplay = () => {
|
|
174
|
+
setReplay((value) => value + 1);
|
|
175
|
+
};
|
|
176
|
+
const run = (value) => {
|
|
177
|
+
runGridUpdate(() => untrack2(() => controller.update(value)));
|
|
178
|
+
};
|
|
179
|
+
const apply = (next) => {
|
|
180
|
+
latest = { value: next };
|
|
181
|
+
if (!mounted) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (isIsolatingFlush()) {
|
|
185
|
+
deferControllerUpdate(requestReplay);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
run(next);
|
|
189
|
+
};
|
|
190
|
+
const compute = () => {
|
|
191
|
+
replay();
|
|
192
|
+
return args();
|
|
193
|
+
};
|
|
194
|
+
const options = name === void 0 ? void 0 : { name };
|
|
195
|
+
if (timing === "render") {
|
|
196
|
+
createRenderEffect(compute, outsideGraphApply(apply), options);
|
|
197
|
+
} else {
|
|
198
|
+
createEffect(compute, outsideGraphApply(apply), options);
|
|
199
|
+
}
|
|
200
|
+
onGridMounted(() => {
|
|
201
|
+
mounted = true;
|
|
202
|
+
if (latest) {
|
|
203
|
+
run(latest.value);
|
|
204
|
+
}
|
|
205
|
+
return () => controller.dispose?.();
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// src/primitives/columnVirtualizer.ts
|
|
210
|
+
import { createMemo, createRenderEffect as createRenderEffect2, createSignal as createSignal3, untrack as untrack3 } from "solid-js";
|
|
211
|
+
import {
|
|
212
|
+
Virtualizer,
|
|
213
|
+
elementScroll,
|
|
214
|
+
observeElementOffset,
|
|
215
|
+
observeElementRect
|
|
216
|
+
} from "@tanstack/virtual-core";
|
|
217
|
+
var observeShownElementRect = (instance, cb) => observeElementRect(instance, (rect) => {
|
|
218
|
+
if (rect.width) {
|
|
219
|
+
cb(rect);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
function createColumnVirtualizer(options) {
|
|
223
|
+
const [version, setVersion] = createSignal3(0);
|
|
224
|
+
let mounted = false;
|
|
225
|
+
let syncing = false;
|
|
226
|
+
const resolve = (next) => {
|
|
227
|
+
const rest = { ...next };
|
|
228
|
+
delete rest.measureKey;
|
|
229
|
+
return {
|
|
230
|
+
observeElementRect: observeShownElementRect,
|
|
231
|
+
observeElementOffset,
|
|
232
|
+
scrollToFn: elementScroll,
|
|
233
|
+
...rest,
|
|
234
|
+
onChange: (instance2, sync) => {
|
|
235
|
+
if (mounted && !syncing) {
|
|
236
|
+
setVersion((value) => value + 1);
|
|
237
|
+
}
|
|
238
|
+
rest.onChange?.(instance2, sync);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
const instance = new Virtualizer(resolve(untrack3(options)));
|
|
243
|
+
let measuredKey;
|
|
244
|
+
const items = createMemo(() => {
|
|
245
|
+
version();
|
|
246
|
+
const next = options();
|
|
247
|
+
syncing = true;
|
|
248
|
+
try {
|
|
249
|
+
instance.setOptions(resolve(next));
|
|
250
|
+
if (next.measureKey !== measuredKey) {
|
|
251
|
+
measuredKey = next.measureKey;
|
|
252
|
+
instance.measure();
|
|
253
|
+
}
|
|
254
|
+
} finally {
|
|
255
|
+
syncing = false;
|
|
256
|
+
}
|
|
257
|
+
return instance.getVirtualItems();
|
|
258
|
+
});
|
|
259
|
+
createRenderEffect2(options, () => {
|
|
260
|
+
if (!mounted) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
syncing = true;
|
|
264
|
+
try {
|
|
265
|
+
instance._willUpdate();
|
|
266
|
+
} finally {
|
|
267
|
+
syncing = false;
|
|
268
|
+
}
|
|
269
|
+
}, { name: "columnVirtualizerElement" });
|
|
270
|
+
onGridMounted(() => {
|
|
271
|
+
mounted = true;
|
|
272
|
+
const cleanup = instance._didMount();
|
|
273
|
+
syncing = true;
|
|
274
|
+
try {
|
|
275
|
+
instance._willUpdate();
|
|
276
|
+
} finally {
|
|
277
|
+
syncing = false;
|
|
278
|
+
}
|
|
279
|
+
setVersion((value) => value + 1);
|
|
280
|
+
return () => {
|
|
281
|
+
mounted = false;
|
|
282
|
+
cleanup();
|
|
283
|
+
};
|
|
284
|
+
});
|
|
285
|
+
return { instance, items };
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export {
|
|
289
|
+
runHandleCall,
|
|
290
|
+
callInOwnFrame,
|
|
291
|
+
createUserCallbacks,
|
|
292
|
+
outsideGraphApply,
|
|
293
|
+
createMountGate,
|
|
294
|
+
runInMountGate,
|
|
295
|
+
flushMountGate,
|
|
296
|
+
closeMountGateOnSettled,
|
|
297
|
+
onGridMounted,
|
|
298
|
+
createExternalStoreSignal,
|
|
299
|
+
connectController,
|
|
300
|
+
createColumnVirtualizer
|
|
301
|
+
};
|
|
@@ -15,6 +15,7 @@ import { Portal } from "@solidjs/web";
|
|
|
15
15
|
import { createPanelHeaderDragController } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/panelHeaderDragController";
|
|
16
16
|
import { resolveFocusWrapTarget } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
|
|
17
17
|
import { isImeComposingKeyEvent } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/domGuards";
|
|
18
|
+
import { getActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
18
19
|
var FLASH_CLASS_NAME = "ssg-toolpanel--flash";
|
|
19
20
|
function ToolPanel(props) {
|
|
20
21
|
const texts = usePopupLocaleText();
|
|
@@ -35,7 +36,7 @@ function ToolPanel(props) {
|
|
|
35
36
|
createPortalTokens(panel, () => props.themeClassName, layout);
|
|
36
37
|
onSettled(() => {
|
|
37
38
|
const element = panelNode;
|
|
38
|
-
if (!element || element.contains(element
|
|
39
|
+
if (!element || element.contains(getActiveElement(element))) {
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
const target = element.querySelector('[role="tab"][aria-selected="true"]') ?? element;
|
|
@@ -335,6 +336,7 @@ function DragHandleGlyph(props) {
|
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
// src/view/ColumnChooserPanel.tsx
|
|
339
|
+
import { getDeepActiveElement } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
|
|
338
340
|
var AUTO_SCROLL_EDGE = 28;
|
|
339
341
|
var AUTO_SCROLL_SPEED = 12;
|
|
340
342
|
var PANE_ORDER = ["left", "center", "right"];
|
|
@@ -399,7 +401,7 @@ function ColumnChooserPanel(props) {
|
|
|
399
401
|
const [query, setQuery] = createSignal2("");
|
|
400
402
|
let searchInput;
|
|
401
403
|
const bindQuery = createInputValue(query);
|
|
402
|
-
const focusSearchOnMount = typeof document !== "undefined" &&
|
|
404
|
+
const focusSearchOnMount = typeof document !== "undefined" && getDeepActiveElement()?.closest(".ssg-toolpanel") != null;
|
|
403
405
|
let focusFrame = null;
|
|
404
406
|
onSettled2(() => {
|
|
405
407
|
if (!searchInput || !focusSearchOnMount || typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches) {
|