@macrostrat/data-sheet 2.2.3 → 3.0.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 +13 -0
- package/dist/components/actions.cjs +14 -0
- package/dist/components/actions.cjs.map +1 -0
- package/dist/components/actions.d.ts +2 -0
- package/dist/components/actions.js +14 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/actions.module.sass.cjs +8 -0
- package/dist/components/actions.module.sass.cjs.map +1 -0
- package/dist/components/actions.module.sass.js +8 -0
- package/dist/components/actions.module.sass.js.map +1 -0
- package/dist/components/colors.cjs +102 -0
- package/dist/components/colors.cjs.map +1 -0
- package/dist/components/colors.d.ts +27 -0
- package/dist/components/colors.js +102 -0
- package/dist/components/colors.js.map +1 -0
- package/dist/components/editor-popup.cjs +77 -0
- package/dist/components/editor-popup.cjs.map +1 -0
- package/dist/components/editor-popup.d.ts +1 -0
- package/dist/components/editor-popup.js +77 -0
- package/dist/components/editor-popup.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/main.module.sass.cjs +18 -0
- package/dist/components/main.module.sass.cjs.map +1 -0
- package/dist/components/main.module.sass.js +18 -0
- package/dist/components/main.module.sass.js.map +1 -0
- package/dist/components/text-areas.cjs +41 -0
- package/dist/components/text-areas.cjs.map +1 -0
- package/dist/components/text-areas.d.ts +4 -0
- package/dist/components/text-areas.js +41 -0
- package/dist/components/text-areas.js.map +1 -0
- package/dist/core.cjs +477 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.ts +31 -0
- package/dist/core.js +475 -0
- package/dist/core.js.map +1 -0
- package/dist/data-sheet.css +1336 -0
- package/dist/index.cjs +51 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/main.module.sass.cjs +19 -0
- package/dist/main.module.sass.cjs.map +1 -0
- package/dist/main.module.sass.js +19 -0
- package/dist/main.module.sass.js.map +1 -0
- package/dist/postgrest-table/data-loaders.cjs +189 -0
- package/dist/postgrest-table/data-loaders.cjs.map +1 -0
- package/dist/postgrest-table/data-loaders.d.ts +55 -0
- package/dist/postgrest-table/data-loaders.js +189 -0
- package/dist/postgrest-table/data-loaders.js.map +1 -0
- package/dist/postgrest-table/index.cjs +212 -0
- package/dist/postgrest-table/index.cjs.map +1 -0
- package/dist/postgrest-table/index.d.ts +56 -0
- package/dist/postgrest-table/index.js +212 -0
- package/dist/postgrest-table/index.js.map +1 -0
- package/dist/postgrest-table/main.module.sass.cjs +22 -0
- package/dist/postgrest-table/main.module.sass.cjs.map +1 -0
- package/dist/postgrest-table/main.module.sass.js +22 -0
- package/dist/postgrest-table/main.module.sass.js.map +1 -0
- package/dist/provider.cjs +376 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.ts +69 -0
- package/dist/provider.js +376 -0
- package/dist/provider.js.map +1 -0
- package/dist/utils/column-spec.cjs +99 -0
- package/dist/utils/column-spec.cjs.map +1 -0
- package/dist/utils/column-spec.d.ts +31 -0
- package/dist/utils/column-spec.js +99 -0
- package/dist/utils/column-spec.js.map +1 -0
- package/dist/utils/index.cjs +9 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/key-handling.cjs +85 -0
- package/dist/utils/key-handling.cjs.map +1 -0
- package/dist/utils/key-handling.d.ts +5 -0
- package/dist/utils/key-handling.js +85 -0
- package/dist/utils/key-handling.js.map +1 -0
- package/package.json +44 -39
- package/src/components/colors.ts +25 -12
- package/src/components/editor-popup.ts +4 -2
- package/src/components/main.module.sass +3 -7
- package/src/components/text-areas.ts +1 -1
- package/src/core.ts +29 -38
- package/src/main.module.sass +7 -7
- package/src/postgrest-table/index.ts +6 -6
- package/src/postgrest-table/main.module.sass +1 -1
- package/src/provider.ts +2 -1
- package/dist/esm/data-sheet.00353511.js +0 -237
- package/dist/esm/data-sheet.00353511.js.map +0 -1
- package/dist/esm/data-sheet.186dcac8.js +0 -86
- package/dist/esm/data-sheet.186dcac8.js.map +0 -1
- package/dist/esm/data-sheet.37e35216.js +0 -40
- package/dist/esm/data-sheet.37e35216.js.map +0 -1
- package/dist/esm/data-sheet.410c5122.js +0 -83
- package/dist/esm/data-sheet.410c5122.js.map +0 -1
- package/dist/esm/data-sheet.48635112.js +0 -40
- package/dist/esm/data-sheet.48635112.js.map +0 -1
- package/dist/esm/data-sheet.54cfa8e8.js +0 -16
- package/dist/esm/data-sheet.54cfa8e8.js.map +0 -1
- package/dist/esm/data-sheet.6021b6c9.js +0 -92
- package/dist/esm/data-sheet.6021b6c9.js.map +0 -1
- package/dist/esm/data-sheet.6776e250.js +0 -76
- package/dist/esm/data-sheet.6776e250.js.map +0 -1
- package/dist/esm/data-sheet.706f955d.css +0 -11
- package/dist/esm/data-sheet.706f955d.css.map +0 -1
- package/dist/esm/data-sheet.8dbfccef.js +0 -16
- package/dist/esm/data-sheet.8dbfccef.js.map +0 -1
- package/dist/esm/data-sheet.91223ec6.css +0 -69
- package/dist/esm/data-sheet.91223ec6.css.map +0 -1
- package/dist/esm/data-sheet.96446cae.js +0 -58
- package/dist/esm/data-sheet.96446cae.js.map +0 -1
- package/dist/esm/data-sheet.9b593da4.js +0 -13
- package/dist/esm/data-sheet.9b593da4.js.map +0 -1
- package/dist/esm/data-sheet.a3eb6088.js +0 -21
- package/dist/esm/data-sheet.a3eb6088.js.map +0 -1
- package/dist/esm/data-sheet.b3ccc91b.css +0 -65
- package/dist/esm/data-sheet.b3ccc91b.css.map +0 -1
- package/dist/esm/data-sheet.ba9a1241.js +0 -431
- package/dist/esm/data-sheet.ba9a1241.js.map +0 -1
- package/dist/esm/data-sheet.c9b6b6f2.js +0 -439
- package/dist/esm/data-sheet.c9b6b6f2.js.map +0 -1
- package/dist/esm/data-sheet.d2160988.js +0 -218
- package/dist/esm/data-sheet.d2160988.js.map +0 -1
- package/dist/esm/data-sheet.d570ef95.js +0 -43
- package/dist/esm/data-sheet.d570ef95.js.map +0 -1
- package/dist/esm/data-sheet.ef63e366.css +0 -110
- package/dist/esm/data-sheet.ef63e366.css.map +0 -1
- package/dist/esm/index.d.ts +0 -289
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -15
- package/dist/esm/index.js.map +0 -1
- package/dist/node/data-sheet.171105c1.js +0 -2
- package/dist/node/data-sheet.171105c1.js.map +0 -1
- package/dist/node/data-sheet.28641e23.css +0 -2
- package/dist/node/data-sheet.28641e23.css.map +0 -1
- package/dist/node/data-sheet.2a613259.js +0 -2
- package/dist/node/data-sheet.2a613259.js.map +0 -1
- package/dist/node/data-sheet.2cac1a8c.js +0 -2
- package/dist/node/data-sheet.2cac1a8c.js.map +0 -1
- package/dist/node/data-sheet.2f64274d.css +0 -2
- package/dist/node/data-sheet.2f64274d.css.map +0 -1
- package/dist/node/data-sheet.3680e59d.js +0 -2
- package/dist/node/data-sheet.3680e59d.js.map +0 -1
- package/dist/node/data-sheet.648db7af.js +0 -2
- package/dist/node/data-sheet.648db7af.js.map +0 -1
- package/dist/node/data-sheet.6a663031.js +0 -2
- package/dist/node/data-sheet.6a663031.js.map +0 -1
- package/dist/node/data-sheet.7b95fbc1.css +0 -2
- package/dist/node/data-sheet.7b95fbc1.css.map +0 -1
- package/dist/node/data-sheet.809cdb29.js +0 -2
- package/dist/node/data-sheet.809cdb29.js.map +0 -1
- package/dist/node/data-sheet.945becc3.js +0 -2
- package/dist/node/data-sheet.945becc3.js.map +0 -1
- package/dist/node/data-sheet.97ac1b50.js +0 -2
- package/dist/node/data-sheet.97ac1b50.js.map +0 -1
- package/dist/node/data-sheet.ae543670.js +0 -2
- package/dist/node/data-sheet.ae543670.js.map +0 -1
- package/dist/node/data-sheet.bb45401c.js +0 -2
- package/dist/node/data-sheet.bb45401c.js.map +0 -1
- package/dist/node/data-sheet.c350336f.js +0 -2
- package/dist/node/data-sheet.c350336f.js.map +0 -1
- package/dist/node/data-sheet.cbbc8d31.js +0 -2
- package/dist/node/data-sheet.cbbc8d31.js.map +0 -1
- package/dist/node/data-sheet.d971095a.js +0 -2
- package/dist/node/data-sheet.d971095a.js.map +0 -1
- package/dist/node/data-sheet.dffdda71.js +0 -2
- package/dist/node/data-sheet.dffdda71.js.map +0 -1
- package/dist/node/data-sheet.f0223f39.js +0 -2
- package/dist/node/data-sheet.f0223f39.js.map +0 -1
- package/dist/node/data-sheet.ffaf8ac7.css +0 -2
- package/dist/node/data-sheet.ffaf8ac7.css.map +0 -1
- package/dist/node/index.js +0 -2
- package/dist/node/index.js.map +0 -1
package/src/core.ts
CHANGED
|
@@ -5,13 +5,7 @@ import {
|
|
|
5
5
|
InputGroup,
|
|
6
6
|
Intent,
|
|
7
7
|
} from "@blueprintjs/core";
|
|
8
|
-
import {
|
|
9
|
-
Cell,
|
|
10
|
-
Column,
|
|
11
|
-
Region,
|
|
12
|
-
RowHeaderCell,
|
|
13
|
-
Table2,
|
|
14
|
-
} from "@blueprintjs/table";
|
|
8
|
+
import { Cell, Column, Region, RowHeaderCell, Table } from "@blueprintjs/table";
|
|
15
9
|
import "@blueprintjs/table/lib/css/table.css";
|
|
16
10
|
import hyper from "@macrostrat/hyper";
|
|
17
11
|
import update from "immutability-helper";
|
|
@@ -270,7 +264,7 @@ function _DataSheet<T>({
|
|
|
270
264
|
{ onKeyDown },
|
|
271
265
|
h(
|
|
272
266
|
// @ts-expect-error
|
|
273
|
-
|
|
267
|
+
Table,
|
|
274
268
|
{
|
|
275
269
|
ref,
|
|
276
270
|
numRows,
|
|
@@ -385,23 +379,35 @@ function basicCellRenderer<T>(
|
|
|
385
379
|
|
|
386
380
|
let cellContents: ReactNode = _renderedValue;
|
|
387
381
|
|
|
382
|
+
let _dataEditor = null;
|
|
383
|
+
let className = null;
|
|
384
|
+
|
|
385
|
+
if (col.dataEditor != null) {
|
|
386
|
+
_dataEditor = h(
|
|
387
|
+
EditorPopup,
|
|
388
|
+
{
|
|
389
|
+
autoFocus: autoFocusEditor,
|
|
390
|
+
valueViewer: _renderedValue,
|
|
391
|
+
},
|
|
392
|
+
[
|
|
393
|
+
h(col.dataEditor, {
|
|
394
|
+
value,
|
|
395
|
+
editable,
|
|
396
|
+
onChange(value) {
|
|
397
|
+
if (!editable) return;
|
|
398
|
+
state.onSelectionEdited(value);
|
|
399
|
+
},
|
|
400
|
+
}),
|
|
401
|
+
],
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
|
|
388
405
|
if (!editable) {
|
|
389
406
|
// Most cells are not focused and don't need to be editable.
|
|
390
407
|
// This will be the rendering logic for almost all cells
|
|
391
408
|
|
|
392
|
-
if (
|
|
393
|
-
cellContents =
|
|
394
|
-
EditorPopup,
|
|
395
|
-
{
|
|
396
|
-
autoFocus: autoFocusEditor,
|
|
397
|
-
valueViewer: _renderedValue,
|
|
398
|
-
},
|
|
399
|
-
[
|
|
400
|
-
h(col.dataEditor, {
|
|
401
|
-
value,
|
|
402
|
-
}),
|
|
403
|
-
],
|
|
404
|
-
);
|
|
409
|
+
if (_dataEditor != null) {
|
|
410
|
+
cellContents = _dataEditor;
|
|
405
411
|
}
|
|
406
412
|
|
|
407
413
|
return h(
|
|
@@ -447,24 +453,9 @@ function basicCellRenderer<T>(
|
|
|
447
453
|
_inlineEditor = inlineEditor as ReactNode;
|
|
448
454
|
}
|
|
449
455
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if (col.dataEditor != null) {
|
|
456
|
+
if (_dataEditor != null) {
|
|
453
457
|
className = "editor-cell";
|
|
454
|
-
cellContents =
|
|
455
|
-
EditorPopup,
|
|
456
|
-
{
|
|
457
|
-
autoFocus: autoFocusEditor,
|
|
458
|
-
valueViewer: _renderedValue,
|
|
459
|
-
},
|
|
460
|
-
h(col.dataEditor, {
|
|
461
|
-
value,
|
|
462
|
-
onChange(value) {
|
|
463
|
-
if (!editable) return;
|
|
464
|
-
state.onSelectionEdited(value);
|
|
465
|
-
},
|
|
466
|
-
}),
|
|
467
|
-
);
|
|
458
|
+
cellContents = _dataEditor;
|
|
468
459
|
hiddenInput = null;
|
|
469
460
|
} else if (_inlineEditor != null) {
|
|
470
461
|
cellContents = _inlineEditor;
|
package/src/main.module.sass
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
line-height: var(--data-sheet-row-height, 20px)
|
|
7
7
|
|
|
8
8
|
:global
|
|
9
|
-
.
|
|
10
|
-
&:not([class*="
|
|
9
|
+
.bp6-table-cell
|
|
10
|
+
&:not([class*="bp6-intent-"]):not(.bp6-loading)
|
|
11
11
|
color: var(--text-color)
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.bp6-table-cell, .bp6-table-row-name
|
|
14
14
|
font-size: var(--data-sheet-font-size)
|
|
15
15
|
line-height: var(--data-sheet-row-height)
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
.bp6-table-row-name
|
|
18
18
|
color: var(--secondary-color)
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.bp6-table-column-name
|
|
21
21
|
font-size: 1.2em
|
|
22
22
|
|
|
23
23
|
.data-sheet-container
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
.data-sheet
|
|
32
32
|
height: 100%
|
|
33
|
-
:global(.
|
|
33
|
+
:global(.bp6-table-quadrant)
|
|
34
34
|
background-color: var(--panel-secondary-background-color)
|
|
35
35
|
|
|
36
36
|
.input-cell
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
outline: none
|
|
54
54
|
|
|
55
55
|
// Make sure popover target fills the entire cell
|
|
56
|
-
.editor-cell :global(.
|
|
56
|
+
.editor-cell :global(.bp6-popover-target)
|
|
57
57
|
//pointer-events: none
|
|
58
58
|
position: absolute
|
|
59
59
|
top: 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HotkeysProvider, OverlayToaster } from "@blueprintjs/core";
|
|
2
2
|
import hyper from "@macrostrat/hyper";
|
|
3
3
|
import styles from "./main.module.sass";
|
|
4
4
|
import { DataSheet, getRowsToDelete } from "../core"; //getRowsToDelete
|
|
@@ -21,7 +21,7 @@ import type {
|
|
|
21
21
|
GenericFunction,
|
|
22
22
|
GenericTable,
|
|
23
23
|
GenericView,
|
|
24
|
-
} from "@supabase/postgrest-js/dist/cjs/
|
|
24
|
+
} from "@supabase/postgrest-js/dist/cjs/index";
|
|
25
25
|
import { ColorCell } from "../components";
|
|
26
26
|
|
|
27
27
|
const h = hyper.styled(styles);
|
|
@@ -173,7 +173,7 @@ function _PostgRESTTableView<T>({
|
|
|
173
173
|
]);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
export function notifyOnError(toaster:
|
|
176
|
+
export function notifyOnError(toaster: OverlayToaster, error: any) {
|
|
177
177
|
console.error(error);
|
|
178
178
|
const { message, status, code, details } = error;
|
|
179
179
|
|
|
@@ -192,8 +192,8 @@ export function notifyOnError(toaster: Toaster, error: any) {
|
|
|
192
192
|
|
|
193
193
|
toaster.show({
|
|
194
194
|
message: h([
|
|
195
|
-
h.if(status != null)([h("code.
|
|
196
|
-
h.if(code != null)([h("code.
|
|
195
|
+
h.if(status != null)([h("code.bp6-code", status), " "]),
|
|
196
|
+
h.if(code != null)([h("code.bp6-code", code), " "]),
|
|
197
197
|
message ?? "An error occurred",
|
|
198
198
|
errorDetails,
|
|
199
199
|
]),
|
|
@@ -206,7 +206,7 @@ interface PromiseResult {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
export async function wrapWithErrorHandling<T extends PromiseResult>(
|
|
209
|
-
toaster:
|
|
209
|
+
toaster: OverlayToaster,
|
|
210
210
|
fnPromise: Promise<T>,
|
|
211
211
|
): Promise<T | null> {
|
|
212
212
|
try {
|
package/src/provider.ts
CHANGED
|
@@ -260,6 +260,7 @@ export function DataSheetProvider<T>({
|
|
|
260
260
|
const { editable, updatedData, data } = state;
|
|
261
261
|
if (!editable) return {};
|
|
262
262
|
let rowSpec: any;
|
|
263
|
+
|
|
263
264
|
// Check to see if the new value is the same as the old one
|
|
264
265
|
if (value !== data[rowIndex]?.[columnName]) {
|
|
265
266
|
const rowOp = updatedData[rowIndex] != null ? "$merge" : "$set";
|
|
@@ -399,7 +400,7 @@ export function useStoreAPI<T>(): StoreApi<DataSheetStore<T>> {
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
export function useSelector<T = any, A = any>(
|
|
402
|
-
selector: (state: DataSheetStore<T> &
|
|
403
|
+
selector: (state: DataSheetStore<T> & DataSheetComputedVals) => A,
|
|
403
404
|
): A {
|
|
404
405
|
const store = useStoreAPI<T>();
|
|
405
406
|
return useStore(store, selector);
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import "./data-sheet.b3ccc91b.css";
|
|
2
|
-
import $52ytf$datasheet48635112js from "./data-sheet.48635112.js";
|
|
3
|
-
import {DataSheet as $8bdde5bf56f8afde$export$dea56b0125f0282d, getRowsToDelete as $8bdde5bf56f8afde$export$222fa1b971ddc36} from "./data-sheet.ba9a1241.js";
|
|
4
|
-
import {usePostgRESTLazyLoader as $4c00def725e3d600$export$4dffb9bb65ef8b2} from "./data-sheet.d2160988.js";
|
|
5
|
-
import {ColorCell as $52ytf$ColorCell} from "./data-sheet.9b593da4.js";
|
|
6
|
-
import {HotkeysProvider as $52ytf$HotkeysProvider, Spinner as $52ytf$Spinner, InputGroup as $52ytf$InputGroup} from "@blueprintjs/core";
|
|
7
|
-
import $52ytf$macrostrathyper from "@macrostrat/hyper";
|
|
8
|
-
import {LithologyTag as $52ytf$LithologyTag, Tag as $52ytf$Tag, TagSize as $52ytf$TagSize} from "@macrostrat/data-components";
|
|
9
|
-
import {useState as $52ytf$useState, useCallback as $52ytf$useCallback} from "react";
|
|
10
|
-
import {ErrorBoundary as $52ytf$ErrorBoundary, ToasterContext as $52ytf$ToasterContext, useToaster as $52ytf$useToaster, useAPIResult as $52ytf$useAPIResult} from "@macrostrat/ui-components";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function $parcel$interopDefault(a) {
|
|
14
|
-
return a && a.__esModule ? a.default : a;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const $ea3fc6a8962e0e3d$var$h = (0, $52ytf$macrostrathyper).styled((0, ($parcel$interopDefault($52ytf$datasheet48635112js))));
|
|
26
|
-
function $ea3fc6a8962e0e3d$export$34ce2a614f5dd320(props) {
|
|
27
|
-
return $ea3fc6a8962e0e3d$var$h((0, $52ytf$ErrorBoundary), $ea3fc6a8962e0e3d$var$h((0, $52ytf$HotkeysProvider), $ea3fc6a8962e0e3d$var$h((0, $52ytf$ToasterContext), $ea3fc6a8962e0e3d$var$h($ea3fc6a8962e0e3d$var$_PostgRESTTableView, props))));
|
|
28
|
-
}
|
|
29
|
-
const $ea3fc6a8962e0e3d$var$successResponses = [
|
|
30
|
-
200,
|
|
31
|
-
201
|
|
32
|
-
];
|
|
33
|
-
function $ea3fc6a8962e0e3d$var$_PostgRESTTableView({ endpoint: endpoint, table: table, columnOptions: columnOptions, order: order, columns: columns, editable: editable = false, filter: filter, enableFullTableSearch: enableFullTableSearch = false, dataSheetActions: dataSheetActions, identityKey: identityKey = "id", ...rest }) {
|
|
34
|
-
const [input, setInput] = (0, $52ytf$useState)("");
|
|
35
|
-
if (enableFullTableSearch) {
|
|
36
|
-
const columnList = columns ?? $ea3fc6a8962e0e3d$var$getColumnList(endpoint, table);
|
|
37
|
-
filter = (query)=>{
|
|
38
|
-
const urlParams = new URLSearchParams(query.url.search);
|
|
39
|
-
urlParams.delete("or");
|
|
40
|
-
query.url.search = urlParams.toString() ? `?${urlParams.toString()}` : "";
|
|
41
|
-
if (input.length > 2 && enableFullTableSearch) {
|
|
42
|
-
const conditions = columnList?.map((col)=>`${col}.ilike.*${input}*`);
|
|
43
|
-
return query.or(conditions.join(","));
|
|
44
|
-
}
|
|
45
|
-
return query;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const { data: data, onScroll: onScroll, dispatch: dispatch, client: client } = (0, $4c00def725e3d600$export$4dffb9bb65ef8b2)(endpoint, table, {
|
|
49
|
-
order: order ?? {
|
|
50
|
-
key: identityKey,
|
|
51
|
-
ascending: true
|
|
52
|
-
},
|
|
53
|
-
columns: columns,
|
|
54
|
-
filter: filter
|
|
55
|
-
});
|
|
56
|
-
const toaster = (0, $52ytf$useToaster)();
|
|
57
|
-
const finishResponse = (0, $52ytf$useCallback)((promisedResult, changes)=>{
|
|
58
|
-
$ea3fc6a8962e0e3d$export$2022c252b5885348(toaster, promisedResult).then((res)=>{
|
|
59
|
-
if (res == null) throw new Error("Could not complete action");
|
|
60
|
-
else {
|
|
61
|
-
// Merge new data with old data
|
|
62
|
-
console.log("Updating data", changes);
|
|
63
|
-
dispatch({
|
|
64
|
-
type: "update-data",
|
|
65
|
-
changes: changes
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}, [
|
|
70
|
-
dispatch,
|
|
71
|
-
toaster
|
|
72
|
-
]);
|
|
73
|
-
if (data == null) return $ea3fc6a8962e0e3d$var$h((0, $52ytf$Spinner));
|
|
74
|
-
return $ea3fc6a8962e0e3d$var$h("div.data-sheet-outer", [
|
|
75
|
-
$ea3fc6a8962e0e3d$var$h((0, $8bdde5bf56f8afde$export$dea56b0125f0282d), {
|
|
76
|
-
...rest,
|
|
77
|
-
dataSheetActions: enableFullTableSearch ? $ea3fc6a8962e0e3d$var$h($ea3fc6a8962e0e3d$export$a346ab8a0cc01d91, {
|
|
78
|
-
input: input,
|
|
79
|
-
setInput: setInput,
|
|
80
|
-
dispatch: dispatch
|
|
81
|
-
}) : dataSheetActions,
|
|
82
|
-
data: data,
|
|
83
|
-
columnSpecOptions: columnOptions ?? {},
|
|
84
|
-
editable: editable,
|
|
85
|
-
onVisibleCellsChange: onScroll,
|
|
86
|
-
onDeleteRows (selection) {
|
|
87
|
-
if (!editable) return;
|
|
88
|
-
const rowIndices = (0, $8bdde5bf56f8afde$export$222fa1b971ddc36)(selection);
|
|
89
|
-
const ids = rowIndices.map((i)=>data[i][identityKey]);
|
|
90
|
-
dispatch({
|
|
91
|
-
type: "start-loading"
|
|
92
|
-
});
|
|
93
|
-
let query = client.delete().in(identityKey, ids);
|
|
94
|
-
query = filter?.(query) ?? query;
|
|
95
|
-
finishResponse(query, {
|
|
96
|
-
$delete: Array.from(rowIndices.keys())
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
onSaveData (updates, data) {
|
|
100
|
-
if (!editable) return;
|
|
101
|
-
// Augment updates with primary key
|
|
102
|
-
let changes = {};
|
|
103
|
-
let updateRows = [];
|
|
104
|
-
for (let [key, update] of Object.entries(updates)){
|
|
105
|
-
const value = {
|
|
106
|
-
...data[key],
|
|
107
|
-
...update
|
|
108
|
-
};
|
|
109
|
-
updateRows.push(value);
|
|
110
|
-
changes[key] = {
|
|
111
|
-
$set: value
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
dispatch({
|
|
115
|
-
type: "start-loading"
|
|
116
|
-
});
|
|
117
|
-
// Save data
|
|
118
|
-
let query = client.upsert(updateRows, {
|
|
119
|
-
defaultToNull: false
|
|
120
|
-
});
|
|
121
|
-
query = filter?.(query) ?? query;
|
|
122
|
-
finishResponse(query, changes);
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
]);
|
|
126
|
-
}
|
|
127
|
-
function $ea3fc6a8962e0e3d$export$48a1a02e95eff0a2(toaster, error) {
|
|
128
|
-
console.error(error);
|
|
129
|
-
const { message: message, status: status, code: code, details: details } = error;
|
|
130
|
-
let errorDetails = null;
|
|
131
|
-
if (details != null) {
|
|
132
|
-
if (typeof details === "string") errorDetails = $ea3fc6a8962e0e3d$var$h("p.error-details", details);
|
|
133
|
-
else errorDetails = $ea3fc6a8962e0e3d$var$h("div.error-details", [
|
|
134
|
-
$ea3fc6a8962e0e3d$var$h("h4", "Error details"),
|
|
135
|
-
$ea3fc6a8962e0e3d$var$h("pre", JSON.stringify(details, null, 2))
|
|
136
|
-
]);
|
|
137
|
-
}
|
|
138
|
-
toaster.show({
|
|
139
|
-
message: $ea3fc6a8962e0e3d$var$h([
|
|
140
|
-
$ea3fc6a8962e0e3d$var$h.if(status != null)([
|
|
141
|
-
$ea3fc6a8962e0e3d$var$h("code.bp5-code", status),
|
|
142
|
-
" "
|
|
143
|
-
]),
|
|
144
|
-
$ea3fc6a8962e0e3d$var$h.if(code != null)([
|
|
145
|
-
$ea3fc6a8962e0e3d$var$h("code.bp5-code", code),
|
|
146
|
-
" "
|
|
147
|
-
]),
|
|
148
|
-
message ?? "An error occurred",
|
|
149
|
-
errorDetails
|
|
150
|
-
]),
|
|
151
|
-
intent: "danger"
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
async function $ea3fc6a8962e0e3d$export$2022c252b5885348(toaster, fnPromise) {
|
|
155
|
-
try {
|
|
156
|
-
const p = await fnPromise;
|
|
157
|
-
if (p.error != null) // Rethrow error
|
|
158
|
-
throw p.error;
|
|
159
|
-
return p;
|
|
160
|
-
} catch (err) {
|
|
161
|
-
$ea3fc6a8962e0e3d$export$48a1a02e95eff0a2(toaster, err);
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function $ea3fc6a8962e0e3d$export$85a23c82145eafdb({ value: value, onChange: onChange }) {
|
|
166
|
-
return $ea3fc6a8962e0e3d$var$h("div.long-text", value);
|
|
167
|
-
}
|
|
168
|
-
function $ea3fc6a8962e0e3d$export$8d4d3113a9b124d2({ value: value, children: children, ...rest }) {
|
|
169
|
-
return $ea3fc6a8962e0e3d$var$h((0, $52ytf$ColorCell), {
|
|
170
|
-
value: value?.color,
|
|
171
|
-
...rest
|
|
172
|
-
}, value?.name);
|
|
173
|
-
}
|
|
174
|
-
function $ea3fc6a8962e0e3d$export$2ad73a796d2d3eb(value) {
|
|
175
|
-
return $ea3fc6a8962e0e3d$var$h("span.tag-cell-content.liths", value?.map((d)=>$ea3fc6a8962e0e3d$var$h((0, $52ytf$LithologyTag), {
|
|
176
|
-
data: d,
|
|
177
|
-
key: d.id
|
|
178
|
-
})));
|
|
179
|
-
}
|
|
180
|
-
function $ea3fc6a8962e0e3d$export$5da000845ac52c4f({ value: value, onChange: onChange }) {
|
|
181
|
-
if (value == null) return $ea3fc6a8962e0e3d$var$h("div.basis-panel", "No lithologies");
|
|
182
|
-
return $ea3fc6a8962e0e3d$var$h("div.basis-panel", [
|
|
183
|
-
$ea3fc6a8962e0e3d$var$h("table", [
|
|
184
|
-
$ea3fc6a8962e0e3d$var$h("thead", $ea3fc6a8962e0e3d$var$h("tr", [
|
|
185
|
-
$ea3fc6a8962e0e3d$var$h("th", "Lithology"),
|
|
186
|
-
$ea3fc6a8962e0e3d$var$h("th", "Source")
|
|
187
|
-
])),
|
|
188
|
-
$ea3fc6a8962e0e3d$var$h("tbody", value.map((d)=>{
|
|
189
|
-
return $ea3fc6a8962e0e3d$var$h("tr", {
|
|
190
|
-
key: d.id
|
|
191
|
-
}, [
|
|
192
|
-
$ea3fc6a8962e0e3d$var$h("td", $ea3fc6a8962e0e3d$var$h((0, $52ytf$LithologyTag), {
|
|
193
|
-
data: d
|
|
194
|
-
})),
|
|
195
|
-
$ea3fc6a8962e0e3d$var$h("td.basis-col", d.basis_col?.map((d)=>{
|
|
196
|
-
return $ea3fc6a8962e0e3d$var$h((0, $52ytf$Tag), {
|
|
197
|
-
size: (0, $52ytf$TagSize).Small,
|
|
198
|
-
key: d,
|
|
199
|
-
name: $ea3fc6a8962e0e3d$var$h([
|
|
200
|
-
$ea3fc6a8962e0e3d$var$h("span.tag-header", "Column"),
|
|
201
|
-
" ",
|
|
202
|
-
$ea3fc6a8962e0e3d$var$h("code", d)
|
|
203
|
-
])
|
|
204
|
-
});
|
|
205
|
-
}))
|
|
206
|
-
]);
|
|
207
|
-
}))
|
|
208
|
-
])
|
|
209
|
-
]);
|
|
210
|
-
}
|
|
211
|
-
function $ea3fc6a8962e0e3d$export$a346ab8a0cc01d91({ input: input, setInput: setInput, dispatch: dispatch }) {
|
|
212
|
-
return $ea3fc6a8962e0e3d$var$h((0, $52ytf$InputGroup), {
|
|
213
|
-
type: "search",
|
|
214
|
-
placeholder: "Search table...",
|
|
215
|
-
value: input,
|
|
216
|
-
onChange (event) {
|
|
217
|
-
const search = event.target.value;
|
|
218
|
-
if (search.length > 2 || input.length === 3 && search.length < 3) dispatch({
|
|
219
|
-
type: "reset"
|
|
220
|
-
});
|
|
221
|
-
setInput(search.toLowerCase());
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
function $ea3fc6a8962e0e3d$var$getColumnList(endpoint, table) {
|
|
226
|
-
const url = `${endpoint}/${table}?select=*&limit=1`;
|
|
227
|
-
const res = (0, $52ytf$useAPIResult)(url);
|
|
228
|
-
if (!res || !Array.isArray(res) || res.length === 0) return [];
|
|
229
|
-
const sampleRow = res[0];
|
|
230
|
-
return Object.entries(sampleRow).filter(([_, value])=>{
|
|
231
|
-
return typeof value === "string";
|
|
232
|
-
}).map(([key])=>key);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
export {$ea3fc6a8962e0e3d$export$34ce2a614f5dd320 as PostgRESTTableView, $ea3fc6a8962e0e3d$export$2022c252b5885348 as wrapWithErrorHandling, $ea3fc6a8962e0e3d$export$a346ab8a0cc01d91 as SearchAction, $ea3fc6a8962e0e3d$export$48a1a02e95eff0a2 as notifyOnError, $ea3fc6a8962e0e3d$export$85a23c82145eafdb as LongTextViewer, $ea3fc6a8962e0e3d$export$8d4d3113a9b124d2 as IntervalCell, $ea3fc6a8962e0e3d$export$2ad73a796d2d3eb as lithologyRenderer, $ea3fc6a8962e0e3d$export$5da000845ac52c4f as ExpandedLithologies, $4c00def725e3d600$export$4dffb9bb65ef8b2 as usePostgRESTLazyLoader};
|
|
237
|
-
//# sourceMappingURL=data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O,WAAW;QAC7B;IACF;AACF;AAEA,SAAS,oCAAc,QAAgB,EAAE,KAAa;IACpD,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,iBAAiB,CAAC;IACnD,MAAM,MAAM,CAAA,GAAA,mBAAW,EAAE;IAEzB,IAAI,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,QAAQ,IAAI,MAAM,KAAK,GAAG,OAAO,EAAE;IAE9D,MAAM,YAAY,GAAG,CAAC,EAAE;IAExB,OAAO,OAAO,OAAO,CAAC,WACnB,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM;QACjB,OAAO,OAAO,UAAU;IAC1B,GACC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAK;AACpB","sources":["packages/data-sheet/src/postgrest-table/index.ts"],"sourcesContent":["import { Toaster, HotkeysProvider } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { DataSheet, getRowsToDelete } from \"../core\"; //getRowsToDelete\nimport { LithologyTag, Tag, TagSize } from \"@macrostrat/data-components\";\nimport { PostgrestOrder, usePostgRESTLazyLoader } from \"./data-loaders\";\nimport { Spinner, InputGroup } from \"@blueprintjs/core\";\n\nexport * from \"./data-loaders\";\nimport { useCallback, useState, useRef } from \"react\";\nimport {\n ErrorBoundary,\n ToasterContext,\n useAPIResult,\n useToaster,\n} from \"@macrostrat/ui-components\";\nimport { Spec } from \"immutability-helper\";\nimport { DataSheetProviderProps } from \"../provider\";\nimport { PostgrestFilterBuilder } from \"@supabase/postgrest-js\";\nimport type {\n GenericFunction,\n GenericTable,\n GenericView,\n} from \"@supabase/postgrest-js/dist/cjs/types\";\nimport { ColorCell } from \"../components\";\n\nconst h = hyper.styled(styles);\n\nexport type GenericSchema = {\n Tables: Record<string, GenericTable>;\n Views: Record<string, GenericView>;\n Functions: Record<string, GenericFunction>;\n};\n\ninterface PostgRESTTableViewProps<\n T extends object,\n> extends DataSheetProviderProps<T> {\n endpoint: string;\n table: string;\n columnOptions?: any;\n order?: PostgrestOrder<T>;\n columns?: string;\n editable?: boolean;\n identityKey?: string;\n enableFullTableSearch?: boolean;\n dataSheetActions?: any;\n filter(\n query: PostgrestFilterBuilder<T, any, any>,\n ): PostgrestFilterBuilder<T, any, any>;\n}\n\nexport function PostgRESTTableView<T>(props: PostgRESTTableViewProps<T>) {\n return h(\n ErrorBoundary,\n h(HotkeysProvider, h(ToasterContext, h(_PostgRESTTableView, props))),\n );\n}\n\nconst successResponses = [200, 201];\n\nfunction _PostgRESTTableView<T>({\n endpoint,\n table,\n columnOptions,\n order,\n columns,\n editable = false,\n filter = undefined,\n enableFullTableSearch = false,\n dataSheetActions,\n identityKey = \"id\",\n ...rest\n}: PostgRESTTableViewProps<T>) {\n const [input, setInput] = useState(\"\");\n\n if (enableFullTableSearch) {\n const columnList = columns ?? getColumnList(endpoint, table);\n\n filter = (query) => {\n const urlParams = new URLSearchParams(query.url.search);\n urlParams.delete(\"or\");\n query.url.search = urlParams.toString() ? `?${urlParams.toString()}` : \"\";\n\n if (input.length > 2 && enableFullTableSearch) {\n const conditions = columnList?.map((col) => `${col}.ilike.*${input}*`);\n\n return query.or(conditions.join(\",\"));\n }\n\n return query;\n };\n }\n\n const { data, onScroll, dispatch, client } = usePostgRESTLazyLoader(\n endpoint,\n table,\n {\n order: order ?? { key: identityKey, ascending: true },\n columns,\n filter,\n },\n );\n\n const toaster = useToaster();\n\n const finishResponse = useCallback(\n (promisedResult, changes) => {\n wrapWithErrorHandling(toaster, promisedResult).then((res) => {\n if (res == null) {\n throw new Error(\"Could not complete action\");\n } else {\n // Merge new data with old data\n console.log(\"Updating data\", changes);\n dispatch({ type: \"update-data\", changes });\n }\n });\n },\n [dispatch, toaster],\n );\n\n if (data == null) {\n return h(Spinner);\n }\n\n return h(\"div.data-sheet-outer\", [\n h(DataSheet, {\n ...rest,\n dataSheetActions: enableFullTableSearch\n ? h(SearchAction, { input, setInput, dispatch })\n : dataSheetActions,\n data,\n columnSpecOptions: columnOptions ?? {},\n editable,\n onVisibleCellsChange: onScroll,\n onDeleteRows(selection) {\n if (!editable) return;\n\n const rowIndices = getRowsToDelete(selection);\n\n const ids = rowIndices.map((i) => data[i][identityKey]);\n\n dispatch({ type: \"start-loading\" });\n\n let query = client.delete().in(identityKey, ids);\n\n query = filter?.(query) ?? query;\n\n finishResponse(query, { $delete: Array.from(rowIndices.keys()) });\n },\n onSaveData(updates, data) {\n if (!editable) return;\n\n // Augment updates with primary key\n\n let changes: Spec<any[]> = {};\n let updateRows: any[] = [];\n for (let [key, update] of Object.entries(updates)) {\n const value = { ...data[key], ...update };\n updateRows.push(value);\n changes[key] = { $set: value };\n }\n\n dispatch({ type: \"start-loading\" });\n\n // Save data\n let query = client.upsert(updateRows, { defaultToNull: false });\n\n query = filter?.(query) ?? query;\n\n finishResponse(query, changes);\n },\n }),\n ]);\n}\n\nexport function notifyOnError(toaster: Toaster, error: any) {\n console.error(error);\n const { message, status, code, details } = error;\n\n let errorDetails = null;\n\n if (details != null) {\n if (typeof details === \"string\") {\n errorDetails = h(\"p.error-details\", details);\n } else {\n errorDetails = h(\"div.error-details\", [\n h(\"h4\", \"Error details\"),\n h(\"pre\", JSON.stringify(details, null, 2)),\n ]);\n }\n }\n\n toaster.show({\n message: h([\n h.if(status != null)([h(\"code.bp5-code\", status), \" \"]),\n h.if(code != null)([h(\"code.bp5-code\", code), \" \"]),\n message ?? \"An error occurred\",\n errorDetails,\n ]),\n intent: \"danger\",\n });\n}\n\ninterface PromiseResult {\n error?: Error;\n}\n\nexport async function wrapWithErrorHandling<T extends PromiseResult>(\n toaster: Toaster,\n fnPromise: Promise<T>,\n): Promise<T | null> {\n try {\n const p = await fnPromise;\n if (p.error != null) {\n // Rethrow error\n throw p.error;\n }\n return p;\n } catch (err) {\n notifyOnError(toaster, err);\n return null;\n }\n}\n\nexport function LongTextViewer({ value, onChange }) {\n return h(\"div.long-text\", value);\n}\n\nexport function IntervalCell({ value, children, ...rest }) {\n return h(ColorCell, { value: value?.color, ...rest }, value?.name);\n}\n\nexport function lithologyRenderer(value) {\n return h(\n \"span.tag-cell-content.liths\",\n value?.map((d) => h(LithologyTag, { data: d, key: d.id })),\n );\n}\n\nexport function ExpandedLithologies({ value, onChange }) {\n if (value == null) return h(\"div.basis-panel\", \"No lithologies\");\n return h(\"div.basis-panel\", [\n h(\"table\", [\n h(\"thead\", h(\"tr\", [h(\"th\", \"Lithology\"), h(\"th\", \"Source\")])),\n h(\n \"tbody\",\n value.map((d) => {\n return h(\"tr\", { key: d.id }, [\n h(\"td\", h(LithologyTag, { data: d })),\n h(\n \"td.basis-col\",\n d.basis_col?.map((d) => {\n return h(Tag, {\n size: TagSize.Small,\n key: d,\n name: h([h(\"span.tag-header\", \"Column\"), \" \", h(\"code\", d)]),\n });\n }),\n ),\n ]);\n }),\n ),\n ]),\n ]);\n}\n\nexport function SearchAction({ input, setInput, dispatch }) {\n return h(InputGroup, {\n type: \"search\",\n placeholder: \"Search table...\",\n value: input,\n onChange(event) {\n const search = event.target.value;\n if (search.length > 2 || (input.length === 3 && search.length < 3)) {\n dispatch({ type: \"reset\" });\n }\n setInput(search.toLowerCase());\n },\n });\n}\n\nfunction getColumnList(endpoint: string, table: string) {\n const url = `${endpoint}/${table}?select=*&limit=1`;\n const res = useAPIResult(url);\n\n if (!res || !Array.isArray(res) || res.length === 0) return [];\n\n const sampleRow = res[0];\n\n return Object.entries(sampleRow)\n .filter(([_, value]) => {\n return typeof value === \"string\";\n })\n .map(([key]) => key);\n}\n"],"names":[],"version":3,"file":"data-sheet.00353511.js.map"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
function $953dc094ec21e2f0$export$b010a8fb240edb5e(e, state) {
|
|
2
|
-
// General key event
|
|
3
|
-
if (e.key === "Escape") {
|
|
4
|
-
// Clear selection on Escape
|
|
5
|
-
state.setSelection([]);
|
|
6
|
-
e.preventDefault();
|
|
7
|
-
e.stopPropagation();
|
|
8
|
-
}
|
|
9
|
-
// Clear selection on Backspace or Delete
|
|
10
|
-
if (e.key === "Backspace" || e.key === "Delete") {
|
|
11
|
-
// Clear selection on Backspace or Delete
|
|
12
|
-
state.clearSelection();
|
|
13
|
-
e.preventDefault();
|
|
14
|
-
}
|
|
15
|
-
// Handle arrow keys for navigation
|
|
16
|
-
if (e.key in $953dc094ec21e2f0$var$directionMap) {
|
|
17
|
-
// Handle arrow key navigation
|
|
18
|
-
const direction = $953dc094ec21e2f0$var$directionMap[e.key];
|
|
19
|
-
state.moveFocusedCell(direction);
|
|
20
|
-
// Prevent default scrolling behavior
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
}
|
|
23
|
-
if (e.key === "Tab") {
|
|
24
|
-
state.moveFocusedCell(e.shiftKey ? "left" : "right");
|
|
25
|
-
e.preventDefault();
|
|
26
|
-
}
|
|
27
|
-
if (e.key === "Enter") {
|
|
28
|
-
state.moveFocusedCell("down");
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const $953dc094ec21e2f0$var$directionMap = {
|
|
33
|
-
ArrowUp: "up",
|
|
34
|
-
ArrowDown: "down",
|
|
35
|
-
ArrowLeft: "left",
|
|
36
|
-
ArrowRight: "right"
|
|
37
|
-
};
|
|
38
|
-
function $953dc094ec21e2f0$export$1ebdb7ea82507aae(e, isSingleCellSelection) {
|
|
39
|
-
/** Get a key handler for inline cell editing */ // if (e.key == "Enter" || e.key == "Tab") {
|
|
40
|
-
// e.target.blur();
|
|
41
|
-
// return;
|
|
42
|
-
// }
|
|
43
|
-
let shouldCaptureEventForInlineEditing = true;
|
|
44
|
-
if (e.key == "Enter") shouldCaptureEventForInlineEditing = e.shiftKey;
|
|
45
|
-
if (e.key == "Escape" || e.key == "Tab") shouldCaptureEventForInlineEditing = false;
|
|
46
|
-
if (e.key == "Backspace" || e.key == "Delete") /** Clear selection on Backspace or Delete on a multi-cell selection
|
|
47
|
-
* (if shift is held, we allow deletion in a single cell)
|
|
48
|
-
*/ shouldCaptureEventForInlineEditing = isSingleCellSelection && !e.shiftKey;
|
|
49
|
-
if (!shouldCaptureEventForInlineEditing) {
|
|
50
|
-
e.target.blur();
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const shouldPropagate = $953dc094ec21e2f0$var$handleSpecialKeys(e);
|
|
55
|
-
if (!shouldPropagate) e.stopPropagation();
|
|
56
|
-
else e.target.blur();
|
|
57
|
-
}
|
|
58
|
-
function $953dc094ec21e2f0$export$eb6970f6c0d44205(evt) {
|
|
59
|
-
if (evt.key === "Enter") {
|
|
60
|
-
//evt.preventDefault();
|
|
61
|
-
evt.stopPropagation();
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (evt.key === "Escape") {
|
|
65
|
-
evt.preventDefault();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const shouldPropagate = $953dc094ec21e2f0$var$handleSpecialKeys(evt);
|
|
69
|
-
if (!shouldPropagate) evt.stopPropagation();
|
|
70
|
-
}
|
|
71
|
-
function $953dc094ec21e2f0$var$handleSpecialKeys(evt) {
|
|
72
|
-
const target = evt.target;
|
|
73
|
-
if ((evt.key === "ArrowLeft" || evt.key === "ArrowUp" || evt.key === "ArrowDown") && target.selectionStart === 0) {
|
|
74
|
-
target.blur();
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
if ((evt.key === "ArrowRight" || evt.key === "ArrowUp" || evt.key === "Tab" || evt.key === "Enter" || evt.key === "ArrowDown") && target.selectionStart === evt.target.value.length) {
|
|
78
|
-
target.blur();
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export {$953dc094ec21e2f0$export$b010a8fb240edb5e as tableKeyHandler, $953dc094ec21e2f0$export$1ebdb7ea82507aae as editorKeyHandler, $953dc094ec21e2f0$export$eb6970f6c0d44205 as multiLineTextKeyHandler};
|
|
86
|
-
//# source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,MAAM,CAAC,IAAI;QACb,EAAE,cAAc;QAChB;IACF;IAEA,MAAM,kBAAkB,wCAAkB;IAC1C,IAAI,CAAC,iBACH,EAAE,eAAe;SAEjB,EAAE,MAAM,CAAC,IAAI;AAGjB;AAEO,SAAS,0CAAwB,GAAe;IACrD,IAAI,IAAI,GAAG,KAAK,SAAS;QACvB,uBAAuB;QACvB,IAAI,eAAe;QACnB;IACF;IAEA,IAAI,IAAI,GAAG,KAAK,UAAU;QACxB,IAAI,cAAc;QAClB;IACF;IAEA,MAAM,kBAAkB,wCAAkB;IAC1C,IAAI,CAAC,iBACH,IAAI,eAAe;AAEvB;AAEA,SAAS,wCAAkB,GAAkB;IAC3C,MAAM,SAAS,IAAI,MAAM;IACzB,IACE,AAAC,CAAA,IAAI,GAAG,KAAK,eACX,IAAI,GAAG,KAAK,aACZ,IAAI,GAAG,KAAK,WAAU,KACxB,OAAO,cAAc,KAAK,GAC1B;QACA,OAAO,IAAI;QACX,OAAO;IACT;IAEA,IACE,AAAC,CAAA,IAAI,GAAG,KAAK,gBACX,IAAI,GAAG,KAAK,aACZ,IAAI,GAAG,KAAK,SACZ,IAAI,GAAG,KAAK,WACZ,IAAI,GAAG,KAAK,WAAU,KACxB,OAAO,cAAc,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EACjD;QACA,OAAO,IAAI;QACX,OAAO;IACT;IAEA,OAAO;AACT","sources":["packages/data-sheet/src/utils/key-handling.ts"],"sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport { DataSheetStoreMain } from \"@macrostrat/data-sheet\";\n\nexport function tableKeyHandler<T>(\n e: KeyboardEvent,\n state: DataSheetStoreMain<T>,\n) {\n // General key event\n if (e.key === \"Escape\") {\n // Clear selection on Escape\n state.setSelection([]);\n e.preventDefault();\n e.stopPropagation();\n }\n // Clear selection on Backspace or Delete\n if (e.key === \"Backspace\" || e.key === \"Delete\") {\n // Clear selection on Backspace or Delete\n state.clearSelection();\n e.preventDefault();\n }\n // Handle arrow keys for navigation\n if (e.key in directionMap) {\n // Handle arrow key navigation\n const direction = directionMap[e.key];\n state.moveFocusedCell(direction);\n // Prevent default scrolling behavior\n e.preventDefault();\n }\n if (e.key === \"Tab\") {\n state.moveFocusedCell(e.shiftKey ? \"left\" : \"right\");\n e.preventDefault();\n }\n if (e.key === \"Enter\") {\n state.moveFocusedCell(\"down\");\n e.preventDefault();\n }\n}\n\nconst directionMap = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\",\n};\n\nexport function editorKeyHandler(\n e: KeyboardEvent,\n isSingleCellSelection: boolean,\n) {\n /** Get a key handler for inline cell editing */\n\n // if (e.key == \"Enter\" || e.key == \"Tab\") {\n // e.target.blur();\n // return;\n // }\n\n let shouldCaptureEventForInlineEditing = true;\n\n if (e.key == \"Enter\") {\n shouldCaptureEventForInlineEditing = e.shiftKey;\n }\n\n if (e.key == \"Escape\" || e.key == \"Tab\") {\n shouldCaptureEventForInlineEditing = false;\n }\n\n if (e.key == \"Backspace\" || e.key == \"Delete\") {\n /** Clear selection on Backspace or Delete on a multi-cell selection\n * (if shift is held, we allow deletion in a single cell)\n */\n shouldCaptureEventForInlineEditing = isSingleCellSelection && !e.shiftKey;\n }\n\n if (!shouldCaptureEventForInlineEditing) {\n e.target.blur();\n e.preventDefault();\n return;\n }\n\n const shouldPropagate = handleSpecialKeys(e);\n if (!shouldPropagate) {\n e.stopPropagation();\n } else {\n e.target.blur();\n //e.target.parentNode.dispatchEvent(new KeyboardEvent(\"keydown\", e));\n }\n}\n\nexport function multiLineTextKeyHandler(evt: InputEvent) {\n if (evt.key === \"Enter\") {\n //evt.preventDefault();\n evt.stopPropagation();\n return;\n }\n\n if (evt.key === \"Escape\") {\n evt.preventDefault();\n return;\n }\n\n const shouldPropagate = handleSpecialKeys(evt);\n if (!shouldPropagate) {\n evt.stopPropagation();\n }\n}\n\nfunction handleSpecialKeys(evt: KeyboardEvent): boolean {\n const target = evt.target;\n if (\n (evt.key === \"ArrowLeft\" ||\n evt.key === \"ArrowUp\" ||\n evt.key === \"ArrowDown\") &&\n target.selectionStart === 0\n ) {\n target.blur();\n return true;\n }\n\n if (\n (evt.key === \"ArrowRight\" ||\n evt.key === \"ArrowUp\" ||\n evt.key === \"Tab\" ||\n evt.key === \"Enter\" ||\n evt.key === \"ArrowDown\") &&\n target.selectionStart === evt.target.value.length\n ) {\n target.blur();\n return true;\n }\n\n return false;\n}\n"],"names":[],"version":3,"file":"data-sheet.186dcac8.js.map"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
function $parcel$export(e, n, v, s) {
|
|
3
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
-
}
|
|
5
|
-
var $8a595c5428132d53$exports = {};
|
|
6
|
-
|
|
7
|
-
$parcel$export($8a595c5428132d53$exports, "interaction-barrier", () => $8a595c5428132d53$export$5b5c76d17d76c73a, (v) => $8a595c5428132d53$export$5b5c76d17d76c73a = v);
|
|
8
|
-
$parcel$export($8a595c5428132d53$exports, "editor-popup-target", () => $8a595c5428132d53$export$9f1b5764c7eee880, (v) => $8a595c5428132d53$export$9f1b5764c7eee880 = v);
|
|
9
|
-
$parcel$export($8a595c5428132d53$exports, "editable-text-area", () => $8a595c5428132d53$export$5b6e9a3f68799075, (v) => $8a595c5428132d53$export$5b6e9a3f68799075 = v);
|
|
10
|
-
$parcel$export($8a595c5428132d53$exports, "tools", () => $8a595c5428132d53$export$904054328df186b, (v) => $8a595c5428132d53$export$904054328df186b = v);
|
|
11
|
-
$parcel$export($8a595c5428132d53$exports, "hidden-editor", () => $8a595c5428132d53$export$b03e8eaf73558d36, (v) => $8a595c5428132d53$export$b03e8eaf73558d36 = v);
|
|
12
|
-
$parcel$export($8a595c5428132d53$exports, "editor-value", () => $8a595c5428132d53$export$80a18b946e5043ae, (v) => $8a595c5428132d53$export$80a18b946e5043ae = v);
|
|
13
|
-
$parcel$export($8a595c5428132d53$exports, "color-picker-container", () => $8a595c5428132d53$export$41f8318b16f973bb, (v) => $8a595c5428132d53$export$41f8318b16f973bb = v);
|
|
14
|
-
$parcel$export($8a595c5428132d53$exports, "color-swatch", () => $8a595c5428132d53$export$def51519e6441a17, (v) => $8a595c5428132d53$export$def51519e6441a17 = v);
|
|
15
|
-
$parcel$export($8a595c5428132d53$exports, "color-swatch-container", () => $8a595c5428132d53$export$e3346f1f81654362, (v) => $8a595c5428132d53$export$e3346f1f81654362 = v);
|
|
16
|
-
$parcel$export($8a595c5428132d53$exports, "color-name", () => $8a595c5428132d53$export$b057dd79654aa578, (v) => $8a595c5428132d53$export$b057dd79654aa578 = v);
|
|
17
|
-
var $8a595c5428132d53$export$5b5c76d17d76c73a;
|
|
18
|
-
var $8a595c5428132d53$export$9f1b5764c7eee880;
|
|
19
|
-
var $8a595c5428132d53$export$5b6e9a3f68799075;
|
|
20
|
-
var $8a595c5428132d53$export$904054328df186b;
|
|
21
|
-
var $8a595c5428132d53$export$b03e8eaf73558d36;
|
|
22
|
-
var $8a595c5428132d53$export$80a18b946e5043ae;
|
|
23
|
-
var $8a595c5428132d53$export$41f8318b16f973bb;
|
|
24
|
-
var $8a595c5428132d53$export$def51519e6441a17;
|
|
25
|
-
var $8a595c5428132d53$export$e3346f1f81654362;
|
|
26
|
-
var $8a595c5428132d53$export$b057dd79654aa578;
|
|
27
|
-
$8a595c5428132d53$export$5b5c76d17d76c73a = "interaction-barrier_c65904";
|
|
28
|
-
$8a595c5428132d53$export$9f1b5764c7eee880 = "editor-popup-target_c65904";
|
|
29
|
-
$8a595c5428132d53$export$5b6e9a3f68799075 = "editable-text-area_c65904";
|
|
30
|
-
$8a595c5428132d53$export$904054328df186b = "tools_c65904";
|
|
31
|
-
$8a595c5428132d53$export$b03e8eaf73558d36 = "hidden-editor_c65904";
|
|
32
|
-
$8a595c5428132d53$export$80a18b946e5043ae = "editor-value_c65904";
|
|
33
|
-
$8a595c5428132d53$export$41f8318b16f973bb = "color-picker-container_c65904";
|
|
34
|
-
$8a595c5428132d53$export$def51519e6441a17 = "color-swatch_c65904";
|
|
35
|
-
$8a595c5428132d53$export$e3346f1f81654362 = "color-swatch-container_c65904";
|
|
36
|
-
$8a595c5428132d53$export$b057dd79654aa578 = "color-name_c65904";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export {$8a595c5428132d53$exports as default};
|
|
40
|
-
//# sourceMappingURL=data-sheet.37e35216.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAAwC;AACxC,4CAAwC;AACxC,4CAAuC;AACvC,2CAA0B;AAC1B,4CAAkC;AAClC,4CAAiC;AACjC,4CAA2C;AAC3C,4CAAiC;AACjC,4CAA2C;AAC3C,4CAA+B","sources":["packages/data-sheet/src/components/main.module.sass"],"sourcesContent":[".interaction-barrier\n pointer-events: all\n\n.editor-popup-target\n position: absolute\n display: block\n top: 0\n left: 0\n width: 100%\n height: 100%\n\n.editable-text-area\n position: relative\n\n textarea\n min-width: var(--data-editor-width, 15em)\n min-height: var(--data-editor-height, 10em)\n font-family: inherit\n font-size: inherit\n\n .tools\n position: absolute\n top: 0.2em\n right: 0.2em\n transform: scale(0.8)\n\n.hidden-editor\n opacity: 0\n\n.editor-value\n position: absolute\n top: 0\n left: 0\n width: 100%\n height: 100%\n\n\n// Color picker\n.color-picker-container\n :global\n .react-colorful__saturation\n border-radius: 0\n\n .react-colorful__hue\n border-radius: 0\n\n\n.color-swatch\n width: 18px\n height: 18px\n display: inline-block\n margin-right: 0.5em\n\n.color-swatch-container\n position: absolute\n top: 0\n left: 0\n right: 0\n bottom: 0\n display: flex\n flex-direction: row\n align-items: center\n gap: 0.3em\n\n.color-name\n position: relative\n flex-grow: 1\n display: block\n"],"names":[],"version":3,"file":"data-sheet.37e35216.js.map"}
|