@macrostrat/data-sheet 3.0.3 → 3.0.4
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 +15 -0
- package/dist/components/actions.cjs +2 -6
- package/dist/components/actions.cjs.map +1 -1
- package/dist/components/actions.js +1 -3
- package/dist/components/actions.js.map +1 -1
- package/dist/components/colors.cjs +4 -7
- package/dist/components/colors.cjs.map +1 -1
- package/dist/components/colors.js +1 -3
- package/dist/components/colors.js.map +1 -1
- package/dist/components/editor-popup.cjs +15 -19
- package/dist/components/editor-popup.cjs.map +1 -1
- package/dist/components/editor-popup.d.ts +1 -1
- package/dist/components/editor-popup.js +10 -12
- package/dist/components/editor-popup.js.map +1 -1
- package/dist/core.cjs +48 -61
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +20 -32
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/postgrest-table/data-loaders.cjs +109 -0
- package/dist/postgrest-table/data-loaders.cjs.map +1 -1
- package/dist/postgrest-table/data-loaders.d.ts +6 -0
- package/dist/postgrest-table/data-loaders.js +111 -2
- package/dist/postgrest-table/data-loaders.js.map +1 -1
- package/dist/postgrest-table/index.cjs +1 -0
- package/dist/postgrest-table/index.cjs.map +1 -1
- package/dist/postgrest-table/index.d.ts +1 -0
- package/dist/postgrest-table/index.js +2 -0
- package/dist/postgrest-table/index.js.map +1 -1
- package/dist/postgrest-table/lazy-loader-table.cjs +26 -0
- package/dist/postgrest-table/lazy-loader-table.cjs.map +1 -0
- package/dist/postgrest-table/lazy-loader-table.d.ts +3 -0
- package/dist/postgrest-table/lazy-loader-table.js +24 -0
- package/dist/postgrest-table/lazy-loader-table.js.map +1 -0
- package/dist/provider.cjs +5 -2
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +5 -2
- package/dist/provider.js.map +1 -1
- package/dist/utils/column-spec.cjs +6 -1
- package/dist/utils/column-spec.cjs.map +1 -1
- package/dist/utils/column-spec.js +6 -1
- package/dist/utils/column-spec.js.map +1 -1
- package/package.json +4 -4
- package/src/components/actions.ts +1 -3
- package/src/components/colors.ts +1 -4
- package/src/components/editor-popup.ts +9 -12
- package/src/core.ts +38 -50
- package/src/postgrest-table/data-loaders.ts +151 -1
- package/src/postgrest-table/index.ts +1 -0
- package/src/postgrest-table/lazy-loader-table.ts +24 -0
- package/src/provider.ts +6 -3
- package/src/utils/column-spec.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.4] - 2026-04-05 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v3.0.3...@macrostrat/data-sheet-v3.0.4)
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- General performance improvements for rendering and infinite scrolling
|
|
8
|
+
- Use `PopoverNext` instead of popover
|
|
9
|
+
[4bd24d9f](https://github.com/UW-Macrostrat/web-components/commit/4bd24d9f65dacfdbbede3613921182858ec1e3d1)
|
|
10
|
+
Re-enable column reordering
|
|
11
|
+
- Updated `@macrostrat/hyper` dependency
|
|
12
|
+
[6e9a6654](https://github.com/UW-Macrostrat/web-components/commit/6e9a665456460b31c30316a2a13d41abed94c43a)
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
[6e9a6654](https://github.com/UW-Macrostrat/web-components/commit/6e9a665456460b31c30316a2a13d41abed94c43a)
|
|
15
|
+
- @macrostrat/data-components@1.1.5
|
|
16
|
+
- @macrostrat/ui-components@5.0.7
|
|
17
|
+
|
|
3
18
|
## [3.0.3] - 2026-04-04 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v3.0.2...@macrostrat/data-sheet-v3.0.3)
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hyper = require("@macrostrat/hyper");
|
|
4
3
|
const actions_module = require("./actions.module.sass.cjs");
|
|
5
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
6
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
7
|
-
const h = hyper__default.default.styled(actions_module);
|
|
8
4
|
function DataSheetActionsRow(props) {
|
|
9
|
-
return
|
|
5
|
+
return actions_module("div.table-actions", props.children);
|
|
10
6
|
}
|
|
11
7
|
function DataSheetAction(props) {
|
|
12
|
-
return
|
|
8
|
+
return actions_module("div.table-action", props.children);
|
|
13
9
|
}
|
|
14
10
|
exports.DataSheetAction = DataSheetAction;
|
|
15
11
|
exports.DataSheetActionsRow = DataSheetActionsRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.cjs","sources":["../../src/components/actions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"actions.cjs","sources":["../../src/components/actions.ts"],"sourcesContent":["import h from \"./actions.module.sass\";\n\nexport function DataSheetActionsRow(props) {\n return h(\"div.table-actions\", props.children);\n}\n\nexport function DataSheetAction(props) {\n return h(\"div.table-action\", props.children);\n}\n"],"names":["h"],"mappings":";;;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAOA,eAAE,qBAAqB,MAAM,QAAQ;AAC9C;AAEO,SAAS,gBAAgB,OAAO;AACrC,SAAOA,eAAE,oBAAoB,MAAM,QAAQ;AAC7C;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../src/components/actions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../src/components/actions.ts"],"sourcesContent":["import h from \"./actions.module.sass\";\n\nexport function DataSheetActionsRow(props) {\n return h(\"div.table-actions\", props.children);\n}\n\nexport function DataSheetAction(props) {\n return h(\"div.table-action\", props.children);\n}\n"],"names":[],"mappings":";AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,EAAE,qBAAqB,MAAM,QAAQ;AAC9C;AAEO,SAAS,gBAAgB,OAAO;AACrC,SAAO,EAAE,oBAAoB,MAAM,QAAQ;AAC7C;"}
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const table = require("@blueprintjs/table");
|
|
4
4
|
const uiComponents = require("@macrostrat/ui-components");
|
|
5
|
-
const hyper = require("@macrostrat/hyper");
|
|
6
5
|
const main_module = require("./main.module.sass.cjs");
|
|
7
6
|
const colorUtils = require("@macrostrat/color-utils");
|
|
8
7
|
const underscore = require("underscore");
|
|
9
8
|
const classNames = require("classnames");
|
|
10
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
11
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
12
10
|
const classNames__default = /* @__PURE__ */ _interopDefault(classNames);
|
|
13
11
|
const ColorPicker = uiComponents.ColorPicker2;
|
|
14
|
-
const h = hyper__default.default.styled(main_module.default);
|
|
15
12
|
function ColorCell({
|
|
16
13
|
value,
|
|
17
14
|
children,
|
|
@@ -35,7 +32,7 @@ function ColorCell({
|
|
|
35
32
|
if (intent != null) {
|
|
36
33
|
mainColor = void 0;
|
|
37
34
|
}
|
|
38
|
-
return
|
|
35
|
+
return main_module.default(
|
|
39
36
|
table.Cell,
|
|
40
37
|
{
|
|
41
38
|
intent,
|
|
@@ -51,11 +48,11 @@ function ColorCell({
|
|
|
51
48
|
);
|
|
52
49
|
}
|
|
53
50
|
function colorSwatchRenderer(value) {
|
|
54
|
-
return
|
|
55
|
-
|
|
51
|
+
return main_module.default("span.color-swatch-container", [
|
|
52
|
+
main_module.default("span.color-swatch", {
|
|
56
53
|
style: { backgroundColor: value }
|
|
57
54
|
}),
|
|
58
|
-
|
|
55
|
+
main_module.default("span.color-name", value)
|
|
59
56
|
]);
|
|
60
57
|
}
|
|
61
58
|
const colorCombo = underscore.memoize(colorUtils.getLuminanceAdjustedColorScheme);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.cjs","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport
|
|
1
|
+
{"version":3,"file":"colors.cjs","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport h from \"./main.module.sass\";\nimport { getLuminanceAdjustedColorScheme } from \"@macrostrat/color-utils\";\nimport { memoize } from \"underscore\";\nimport classNames from \"classnames\";\nimport { ColorPicker2 } from \"@macrostrat/ui-components\";\n\nexport const ColorPicker = ColorPicker2;\n\nexport function ColorCell({\n value,\n children,\n style,\n intent,\n adjustLuminance = true,\n className,\n ...rest\n}) {\n const darkMode = useInDarkMode();\n\n const _className = classNames(className, \"color-cell\");\n\n let mainColor = \"var(--text-color)\";\n let backgroundColor = value;\n\n if (adjustLuminance) {\n // If adjustLuminance is true, get the color scheme based on the value\n let colors = colorCombo(value, darkMode, 0.05);\n if (colors != null) {\n mainColor = colors.mainColor;\n backgroundColor = colors.backgroundColor;\n }\n }\n\n if (intent != null) {\n // If an intent is specified, override the main color\n mainColor = undefined;\n }\n\n return h(\n Cell,\n {\n intent,\n className: _className,\n ...rest,\n style: {\n color: mainColor,\n backgroundColor,\n ...style,\n },\n },\n children,\n );\n}\n\nexport function colorSwatchRenderer(value) {\n return h(\"span.color-swatch-container\", [\n h(\"span.color-swatch\", {\n style: { backgroundColor: value },\n }),\n h(\"span.color-name\", value),\n ]);\n}\n\nconst colorCombo = memoize(getLuminanceAdjustedColorScheme);\n"],"names":["ColorPicker2","useInDarkMode","classNames","h","Cell","memoize","getLuminanceAdjustedColorScheme"],"mappings":";;;;;;;;;;AAQO,MAAM,cAAcA,aAAAA;AAEpB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,WAAWC,aAAAA,cAAA;AAEjB,QAAM,aAAaC,oBAAAA,QAAW,WAAW,YAAY;AAErD,MAAI,YAAY;AAChB,MAAI,kBAAkB;AAEtB,MAAI,iBAAiB;AAEnB,QAAI,SAAS,WAAW,OAAO,UAAU,IAAI;AAC7C,QAAI,UAAU,MAAM;AAClB,kBAAY,OAAO;AACnB,wBAAkB,OAAO;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,UAAU,MAAM;AAElB,gBAAY;AAAA,EACd;AAEA,SAAOC,YAAAA;AAAAA,IACLC,MAAAA;AAAAA,IACA;AAAA,MACE;AAAA,MACA,WAAW;AAAA,MACX,GAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO;AAAA,QACP;AAAA,QACA,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF;AAAA,EAAA;AAEJ;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAOD,YAAAA,QAAE,+BAA+B;AAAA,IACtCA,YAAAA,QAAE,qBAAqB;AAAA,MACrB,OAAO,EAAE,iBAAiB,MAAA;AAAA,IAAM,CACjC;AAAA,IACDA,YAAAA,QAAE,mBAAmB,KAAK;AAAA,EAAA,CAC3B;AACH;AAEA,MAAM,aAAaE,WAAAA,QAAQC,0CAA+B;;;;"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Cell } from "@blueprintjs/table";
|
|
2
2
|
import { ColorPicker2, useInDarkMode } from "@macrostrat/ui-components";
|
|
3
|
-
import
|
|
4
|
-
import h$1 from "./main.module.sass.js";
|
|
3
|
+
import h from "./main.module.sass.js";
|
|
5
4
|
import { getLuminanceAdjustedColorScheme } from "@macrostrat/color-utils";
|
|
6
5
|
import { memoize } from "underscore";
|
|
7
6
|
import classNames from "classnames";
|
|
8
7
|
const ColorPicker = ColorPicker2;
|
|
9
|
-
const h = hyper.styled(h$1);
|
|
10
8
|
function ColorCell({
|
|
11
9
|
value,
|
|
12
10
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport h from \"./main.module.sass\";\nimport { getLuminanceAdjustedColorScheme } from \"@macrostrat/color-utils\";\nimport { memoize } from \"underscore\";\nimport classNames from \"classnames\";\nimport { ColorPicker2 } from \"@macrostrat/ui-components\";\n\nexport const ColorPicker = ColorPicker2;\n\nexport function ColorCell({\n value,\n children,\n style,\n intent,\n adjustLuminance = true,\n className,\n ...rest\n}) {\n const darkMode = useInDarkMode();\n\n const _className = classNames(className, \"color-cell\");\n\n let mainColor = \"var(--text-color)\";\n let backgroundColor = value;\n\n if (adjustLuminance) {\n // If adjustLuminance is true, get the color scheme based on the value\n let colors = colorCombo(value, darkMode, 0.05);\n if (colors != null) {\n mainColor = colors.mainColor;\n backgroundColor = colors.backgroundColor;\n }\n }\n\n if (intent != null) {\n // If an intent is specified, override the main color\n mainColor = undefined;\n }\n\n return h(\n Cell,\n {\n intent,\n className: _className,\n ...rest,\n style: {\n color: mainColor,\n backgroundColor,\n ...style,\n },\n },\n children,\n );\n}\n\nexport function colorSwatchRenderer(value) {\n return h(\"span.color-swatch-container\", [\n h(\"span.color-swatch\", {\n style: { backgroundColor: value },\n }),\n h(\"span.color-name\", value),\n ]);\n}\n\nconst colorCombo = memoize(getLuminanceAdjustedColorScheme);\n"],"names":[],"mappings":";;;;;;AAQO,MAAM,cAAc;AAEpB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,WAAW,cAAA;AAEjB,QAAM,aAAa,WAAW,WAAW,YAAY;AAErD,MAAI,YAAY;AAChB,MAAI,kBAAkB;AAEtB,MAAI,iBAAiB;AAEnB,QAAI,SAAS,WAAW,OAAO,UAAU,IAAI;AAC7C,QAAI,UAAU,MAAM;AAClB,kBAAY,OAAO;AACnB,wBAAkB,OAAO;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,UAAU,MAAM;AAElB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA,WAAW;AAAA,MACX,GAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO;AAAA,QACP;AAAA,QACA,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF;AAAA,EAAA;AAEJ;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,EAAE,+BAA+B;AAAA,IACtC,EAAE,qBAAqB;AAAA,MACrB,OAAO,EAAE,iBAAiB,MAAA;AAAA,IAAM,CACjC;AAAA,IACD,EAAE,mBAAmB,KAAK;AAAA,EAAA,CAC3B;AACH;AAEA,MAAM,aAAa,QAAQ,+BAA+B;"}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hyper = require("@macrostrat/hyper");
|
|
4
3
|
const uiComponents = require("@macrostrat/ui-components");
|
|
5
4
|
const core = require("@blueprintjs/core");
|
|
6
5
|
const main_module = require("./main.module.sass.cjs");
|
|
7
6
|
const react = require("react");
|
|
8
7
|
const provider = require("../provider.cjs");
|
|
9
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
11
|
-
const h = hyper__default.default.styled(main_module.default);
|
|
12
8
|
function EditorPopup(props) {
|
|
13
9
|
const {
|
|
14
10
|
children,
|
|
15
11
|
targetClassName,
|
|
16
12
|
autoFocus,
|
|
17
13
|
valueViewer,
|
|
18
|
-
placement = "right-start"
|
|
19
|
-
minimal = true
|
|
14
|
+
placement = "right-start"
|
|
20
15
|
} = props;
|
|
21
16
|
const [isOpen, setIsOpen] = react.useState(autoFocus);
|
|
22
17
|
const keyHandler = provider.useSelector((state) => state.keyHandler);
|
|
23
18
|
const ref = react.useRef(null);
|
|
24
|
-
const inlineEditor =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
const inlineEditor = main_module.default([
|
|
20
|
+
main_module.default("span.editor-value.bp6-table-cell", valueViewer),
|
|
21
|
+
main_module.default("input.hidden-editor", {
|
|
22
|
+
defaultValue: "",
|
|
28
23
|
autoFocus: true,
|
|
29
24
|
onKeyDown: keyHandler
|
|
30
25
|
})
|
|
31
26
|
]);
|
|
32
|
-
return
|
|
33
|
-
core.
|
|
27
|
+
return main_module.default(
|
|
28
|
+
core.PopoverNext,
|
|
34
29
|
{
|
|
35
|
-
content:
|
|
30
|
+
content: main_module.default(
|
|
36
31
|
"div.interaction-barrier",
|
|
37
32
|
{
|
|
38
33
|
onMouseDown(evt) {
|
|
@@ -49,21 +44,22 @@ function EditorPopup(props) {
|
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
},
|
|
52
|
-
|
|
47
|
+
main_module.default(uiComponents.ErrorBoundary, null, children)
|
|
53
48
|
),
|
|
54
49
|
enforceFocus: false,
|
|
55
50
|
autoFocus: false,
|
|
56
|
-
minimal,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
51
|
+
animation: "minimal",
|
|
52
|
+
lazy: true,
|
|
53
|
+
// modifiers: {
|
|
54
|
+
// offset: { enabled: true, options: { offset: [0, 8] } },
|
|
55
|
+
// },
|
|
60
56
|
placement,
|
|
61
57
|
interactionKind: "hover-target",
|
|
62
58
|
isOpen,
|
|
63
59
|
// Portal must be used to avoid issues with the editor being clipped to the bounds of the cell
|
|
64
60
|
usePortal: true
|
|
65
61
|
},
|
|
66
|
-
|
|
62
|
+
main_module.default(
|
|
67
63
|
"span.editor-popup-target.bp6-table-cell",
|
|
68
64
|
{
|
|
69
65
|
className: targetClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-popup.cjs","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"editor-popup.cjs","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import { ErrorBoundary } from \"@macrostrat/ui-components\";\nimport { PopoverNext } from \"@blueprintjs/core\";\nimport h from \"./main.module.sass\";\nimport { useRef, useState } from \"react\";\nimport { useSelector } from \"../provider\";\n\nexport function EditorPopup(props) {\n const {\n children,\n targetClassName,\n autoFocus,\n valueViewer,\n placement = \"right-start\",\n } = props;\n\n const [isOpen, setIsOpen] = useState(autoFocus);\n const keyHandler = useSelector((state) => state.keyHandler);\n\n const ref = useRef(null);\n\n const inlineEditor = h([\n h(\"span.editor-value.bp6-table-cell\", valueViewer),\n h(\"input.hidden-editor\", {\n defaultValue: \"\",\n autoFocus: true,\n onKeyDown: keyHandler,\n }),\n ]);\n\n return h(\n PopoverNext,\n {\n content: h(\n \"div.interaction-barrier\",\n {\n onMouseDown(evt) {\n evt.nativeEvent.stopImmediatePropagation();\n },\n onKeyDown(evt) {\n if (evt.key === \"Escape\") {\n if (isOpen) {\n setIsOpen(false);\n }\n evt.stopPropagation();\n evt.preventDefault();\n return;\n }\n // Climb over the interaction barrier to propagate the key event to the table\n },\n },\n h(ErrorBoundary, null, children),\n ),\n enforceFocus: false,\n autoFocus: false,\n animation: \"minimal\",\n lazy: true,\n // modifiers: {\n // offset: { enabled: true, options: { offset: [0, 8] } },\n // },\n placement,\n interactionKind: \"hover-target\",\n isOpen,\n // Portal must be used to avoid issues with the editor being clipped to the bounds of the cell\n usePortal: true,\n },\n h(\n \"span.editor-popup-target.bp6-table-cell\",\n {\n className: targetClassName,\n onClick: () => setIsOpen(!isOpen),\n ref,\n },\n // If the editor is open, show the inline editor, otherwise show the value viewer\n isOpen ? valueViewer : (inlineEditor ?? valueViewer),\n ),\n );\n}\n"],"names":["useState","useSelector","useRef","h","PopoverNext","ErrorBoundary"],"mappings":";;;;;;;AAMO,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EAAA,IACV;AAEJ,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAAA,SAAS,SAAS;AAC9C,QAAM,aAAaC,SAAAA,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,MAAMC,MAAAA,OAAO,IAAI;AAEvB,QAAM,eAAeC,YAAAA,QAAE;AAAA,IACrBA,YAAAA,QAAE,oCAAoC,WAAW;AAAA,IACjDA,YAAAA,QAAE,uBAAuB;AAAA,MACvB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,CACF;AAED,SAAOA,YAAAA;AAAAA,IACLC,KAAAA;AAAAA,IACA;AAAA,MACE,SAASD,YAAAA;AAAAA,QACP;AAAA,QACA;AAAA,UACE,YAAY,KAAK;AACf,gBAAI,YAAY,yBAAA;AAAA,UAClB;AAAA,UACA,UAAU,KAAK;AACb,gBAAI,IAAI,QAAQ,UAAU;AACxB,kBAAI,QAAQ;AACV,0BAAU,KAAK;AAAA,cACjB;AACA,kBAAI,gBAAA;AACJ,kBAAI,eAAA;AACJ;AAAA,YACF;AAAA,UAEF;AAAA,QAAA;AAAA,QAEFA,oBAAEE,aAAAA,eAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,MAEjC,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA;AAAA,MAEA,WAAW;AAAA,IAAA;AAAA,IAEbF,YAAAA;AAAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,QAChC;AAAA,MAAA;AAAA;AAAA,MAGF,SAAS,cAAe,gBAAgB;AAAA,IAAA;AAAA,EAC1C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function EditorPopup(props: any): import('react').
|
|
1
|
+
export declare function EditorPopup(props: any): import('react').FunctionComponentElement<import('@blueprintjs/core').PopoverNextProps<import('@blueprintjs/core').DefaultPopoverTargetHTMLProps> & import('react').RefAttributes<import('@blueprintjs/core').PopoverNextRef>>;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import hyper from "@macrostrat/hyper";
|
|
2
1
|
import { ErrorBoundary } from "@macrostrat/ui-components";
|
|
3
|
-
import {
|
|
4
|
-
import h
|
|
2
|
+
import { PopoverNext } from "@blueprintjs/core";
|
|
3
|
+
import h from "./main.module.sass.js";
|
|
5
4
|
import { useState, useRef } from "react";
|
|
6
5
|
import { useSelector } from "../provider.js";
|
|
7
|
-
const h = hyper.styled(h$1);
|
|
8
6
|
function EditorPopup(props) {
|
|
9
7
|
const {
|
|
10
8
|
children,
|
|
11
9
|
targetClassName,
|
|
12
10
|
autoFocus,
|
|
13
11
|
valueViewer,
|
|
14
|
-
placement = "right-start"
|
|
15
|
-
minimal = true
|
|
12
|
+
placement = "right-start"
|
|
16
13
|
} = props;
|
|
17
14
|
const [isOpen, setIsOpen] = useState(autoFocus);
|
|
18
15
|
const keyHandler = useSelector((state) => state.keyHandler);
|
|
@@ -20,13 +17,13 @@ function EditorPopup(props) {
|
|
|
20
17
|
const inlineEditor = h([
|
|
21
18
|
h("span.editor-value.bp6-table-cell", valueViewer),
|
|
22
19
|
h("input.hidden-editor", {
|
|
23
|
-
|
|
20
|
+
defaultValue: "",
|
|
24
21
|
autoFocus: true,
|
|
25
22
|
onKeyDown: keyHandler
|
|
26
23
|
})
|
|
27
24
|
]);
|
|
28
25
|
return h(
|
|
29
|
-
|
|
26
|
+
PopoverNext,
|
|
30
27
|
{
|
|
31
28
|
content: h(
|
|
32
29
|
"div.interaction-barrier",
|
|
@@ -49,10 +46,11 @@ function EditorPopup(props) {
|
|
|
49
46
|
),
|
|
50
47
|
enforceFocus: false,
|
|
51
48
|
autoFocus: false,
|
|
52
|
-
minimal,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
49
|
+
animation: "minimal",
|
|
50
|
+
lazy: true,
|
|
51
|
+
// modifiers: {
|
|
52
|
+
// offset: { enabled: true, options: { offset: [0, 8] } },
|
|
53
|
+
// },
|
|
56
54
|
placement,
|
|
57
55
|
interactionKind: "hover-target",
|
|
58
56
|
isOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-popup.js","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"editor-popup.js","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import { ErrorBoundary } from \"@macrostrat/ui-components\";\nimport { PopoverNext } from \"@blueprintjs/core\";\nimport h from \"./main.module.sass\";\nimport { useRef, useState } from \"react\";\nimport { useSelector } from \"../provider\";\n\nexport function EditorPopup(props) {\n const {\n children,\n targetClassName,\n autoFocus,\n valueViewer,\n placement = \"right-start\",\n } = props;\n\n const [isOpen, setIsOpen] = useState(autoFocus);\n const keyHandler = useSelector((state) => state.keyHandler);\n\n const ref = useRef(null);\n\n const inlineEditor = h([\n h(\"span.editor-value.bp6-table-cell\", valueViewer),\n h(\"input.hidden-editor\", {\n defaultValue: \"\",\n autoFocus: true,\n onKeyDown: keyHandler,\n }),\n ]);\n\n return h(\n PopoverNext,\n {\n content: h(\n \"div.interaction-barrier\",\n {\n onMouseDown(evt) {\n evt.nativeEvent.stopImmediatePropagation();\n },\n onKeyDown(evt) {\n if (evt.key === \"Escape\") {\n if (isOpen) {\n setIsOpen(false);\n }\n evt.stopPropagation();\n evt.preventDefault();\n return;\n }\n // Climb over the interaction barrier to propagate the key event to the table\n },\n },\n h(ErrorBoundary, null, children),\n ),\n enforceFocus: false,\n autoFocus: false,\n animation: \"minimal\",\n lazy: true,\n // modifiers: {\n // offset: { enabled: true, options: { offset: [0, 8] } },\n // },\n placement,\n interactionKind: \"hover-target\",\n isOpen,\n // Portal must be used to avoid issues with the editor being clipped to the bounds of the cell\n usePortal: true,\n },\n h(\n \"span.editor-popup-target.bp6-table-cell\",\n {\n className: targetClassName,\n onClick: () => setIsOpen(!isOpen),\n ref,\n },\n // If the editor is open, show the inline editor, otherwise show the value viewer\n isOpen ? valueViewer : (inlineEditor ?? valueViewer),\n ),\n );\n}\n"],"names":[],"mappings":";;;;;AAMO,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EAAA,IACV;AAEJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,SAAS;AAC9C,QAAM,aAAa,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,MAAM,OAAO,IAAI;AAEvB,QAAM,eAAe,EAAE;AAAA,IACrB,EAAE,oCAAoC,WAAW;AAAA,IACjD,EAAE,uBAAuB;AAAA,MACvB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,CACF;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,SAAS;AAAA,QACP;AAAA,QACA;AAAA,UACE,YAAY,KAAK;AACf,gBAAI,YAAY,yBAAA;AAAA,UAClB;AAAA,UACA,UAAU,KAAK;AACb,gBAAI,IAAI,QAAQ,UAAU;AACxB,kBAAI,QAAQ;AACV,0BAAU,KAAK;AAAA,cACjB;AACA,kBAAI,gBAAA;AACJ,kBAAI,eAAA;AACJ;AAAA,YACF;AAAA,UAEF;AAAA,QAAA;AAAA,QAEF,EAAE,eAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,MAEjC,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA;AAAA,MAEA,WAAW;AAAA,IAAA;AAAA,IAEb;AAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,QAChC;AAAA,MAAA;AAAA;AAAA,MAGF,SAAS,cAAe,gBAAgB;AAAA,IAAA;AAAA,EAC1C;AAEJ;"}
|
package/dist/core.cjs
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const core = require("@blueprintjs/core");
|
|
4
4
|
const table = require("@blueprintjs/table");
|
|
5
5
|
;/* empty css */
|
|
6
|
-
const hyper = require("@macrostrat/hyper");
|
|
7
6
|
const update = require("immutability-helper");
|
|
8
7
|
const react = require("react");
|
|
9
8
|
const main_module = require("./main.module.sass.cjs");
|
|
@@ -11,9 +10,7 @@ const provider = require("./provider.cjs");
|
|
|
11
10
|
const actions = require("./components/actions.cjs");
|
|
12
11
|
const editorPopup = require("./components/editor-popup.cjs");
|
|
13
12
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
15
13
|
const update__default = /* @__PURE__ */ _interopDefault(update);
|
|
16
|
-
const h = hyper__default.default.styled(main_module.default);
|
|
17
14
|
var DataSheetDensity = /* @__PURE__ */ ((DataSheetDensity2) => {
|
|
18
15
|
DataSheetDensity2["HIGH"] = "high";
|
|
19
16
|
DataSheetDensity2["MEDIUM"] = "medium";
|
|
@@ -31,9 +28,9 @@ function DataSheet(props) {
|
|
|
31
28
|
defaultColumnWidth = 150,
|
|
32
29
|
...rest
|
|
33
30
|
} = props;
|
|
34
|
-
return
|
|
31
|
+
return main_module.default(
|
|
35
32
|
core.HotkeysProvider,
|
|
36
|
-
|
|
33
|
+
main_module.default(
|
|
37
34
|
provider.DataSheetProvider,
|
|
38
35
|
{
|
|
39
36
|
data,
|
|
@@ -44,7 +41,7 @@ function DataSheet(props) {
|
|
|
44
41
|
editable,
|
|
45
42
|
...rest
|
|
46
43
|
},
|
|
47
|
-
|
|
44
|
+
main_module.default(_DataSheet, {
|
|
48
45
|
...rest,
|
|
49
46
|
editable,
|
|
50
47
|
enableColumnReordering,
|
|
@@ -53,6 +50,10 @@ function DataSheet(props) {
|
|
|
53
50
|
)
|
|
54
51
|
);
|
|
55
52
|
}
|
|
53
|
+
const deletedRowHeaderStyle = {
|
|
54
|
+
opacity: 0.5,
|
|
55
|
+
textDecoration: "line-through"
|
|
56
|
+
};
|
|
56
57
|
function _DataSheet({
|
|
57
58
|
onVisibleCellsChange,
|
|
58
59
|
enableColumnReordering,
|
|
@@ -141,9 +142,10 @@ function _DataSheet({
|
|
|
141
142
|
"--data-sheet-font-size": "18px"
|
|
142
143
|
};
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
const onColumnsReordered = provider.useSelector((state) => state.onColumnsReordered);
|
|
146
|
+
const children = react.useMemo(() => {
|
|
147
|
+
return columnSpec.map((col, colIndex) => {
|
|
148
|
+
return main_module.default(table.Column, {
|
|
147
149
|
name: col.name,
|
|
148
150
|
cellRenderer: (rowIndex) => {
|
|
149
151
|
const state = storeAPI.getState();
|
|
@@ -156,22 +158,16 @@ function _DataSheet({
|
|
|
156
158
|
);
|
|
157
159
|
}
|
|
158
160
|
});
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
);
|
|
161
|
+
});
|
|
162
|
+
}, [columnSpec, storeAPI, autoFocusEditor]);
|
|
162
163
|
const onColumnWidthChanged = provider.useSelector(
|
|
163
164
|
(state) => state.onColumnWidthChanged
|
|
164
165
|
);
|
|
165
166
|
const rowHeaderCellRenderer = react.useCallback(
|
|
166
167
|
(rowIndex) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
opacity: 0.5,
|
|
171
|
-
textDecoration: "line-through"
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
return h(table.RowHeaderCell, {
|
|
168
|
+
const style2 = deletedRows.has(rowIndex) ? deletedRowHeaderStyle : null;
|
|
169
|
+
return main_module.default(table.RowHeaderCell, {
|
|
170
|
+
enableRowReordering: false,
|
|
175
171
|
index: rowIndex,
|
|
176
172
|
name: `${rowIndex + 1}`,
|
|
177
173
|
style: style2
|
|
@@ -180,18 +176,16 @@ function _DataSheet({
|
|
|
180
176
|
[deletedRows]
|
|
181
177
|
);
|
|
182
178
|
const onKeyDown = provider.useSelector((state) => state.tableKeyHandler);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
h.if(editable)(DataSheetEditToolbar, {
|
|
179
|
+
return main_module.default("div.data-sheet-container", { className, style }, [
|
|
180
|
+
main_module.default.if(editable)(DataSheetEditToolbar, {
|
|
186
181
|
onSaveData: _onSaveData,
|
|
187
182
|
onDeleteRows: nDeletionCandidates > 0 ? _onDeleteRows : null
|
|
188
183
|
}),
|
|
189
184
|
dataSheetActions,
|
|
190
|
-
|
|
185
|
+
main_module.default(
|
|
191
186
|
"div.data-sheet-holder",
|
|
192
187
|
{ onKeyDown },
|
|
193
|
-
|
|
194
|
-
// @ts-expect-error
|
|
188
|
+
main_module.default(
|
|
195
189
|
table.Table,
|
|
196
190
|
{
|
|
197
191
|
ref,
|
|
@@ -199,7 +193,7 @@ function _DataSheet({
|
|
|
199
193
|
className: "data-sheet",
|
|
200
194
|
enableFocusedCell,
|
|
201
195
|
enableColumnReordering,
|
|
202
|
-
|
|
196
|
+
onColumnsReordered,
|
|
203
197
|
focusedCell,
|
|
204
198
|
selectedRegions,
|
|
205
199
|
defaultRowHeight: rowHeight,
|
|
@@ -207,6 +201,9 @@ function _DataSheet({
|
|
|
207
201
|
columnWidths,
|
|
208
202
|
onColumnWidthChanged,
|
|
209
203
|
onSelection,
|
|
204
|
+
renderMode: "batch",
|
|
205
|
+
enableRowReordering: false,
|
|
206
|
+
enableRowResizing: false,
|
|
210
207
|
// The cell renderer is memoized internally based on these data dependencies
|
|
211
208
|
cellRendererDependencies: [
|
|
212
209
|
data,
|
|
@@ -230,10 +227,8 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
230
227
|
const row = data[rowIndex] ?? updatedData[rowIndex];
|
|
231
228
|
const loading = row == null;
|
|
232
229
|
const col = columnSpec;
|
|
233
|
-
const focusedCell = state.focusedCell;
|
|
234
230
|
const _topLeftCell = state.topLeftCell;
|
|
235
231
|
const onCellEdited = state.onCellEdited;
|
|
236
|
-
state.clearSelection;
|
|
237
232
|
const value = updatedData[rowIndex]?.[col.key] ?? data[rowIndex]?.[col.key];
|
|
238
233
|
const _renderedValue = col.valueRenderer?.(value) ?? value;
|
|
239
234
|
let style = col.style ?? {};
|
|
@@ -244,7 +239,6 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
244
239
|
textDecoration: "line-through"
|
|
245
240
|
};
|
|
246
241
|
}
|
|
247
|
-
focusedCell?.col === colIndex && focusedCell?.row === rowIndex;
|
|
248
242
|
const editable = (col.editable ?? state.editable) && !isDeleted;
|
|
249
243
|
const topLeft = _topLeftCell?.col === colIndex && _topLeftCell?.row === rowIndex;
|
|
250
244
|
if (!editable && state.editable) {
|
|
@@ -258,7 +252,7 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
258
252
|
const _Cell = col.cellComponent ?? BaseCell;
|
|
259
253
|
let inlineEditor = editable ? col.inlineEditor ?? true : false;
|
|
260
254
|
if (!topLeft) {
|
|
261
|
-
return
|
|
255
|
+
return main_module.default(
|
|
262
256
|
_Cell,
|
|
263
257
|
{
|
|
264
258
|
intent,
|
|
@@ -270,7 +264,7 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
270
264
|
_renderedValue
|
|
271
265
|
);
|
|
272
266
|
}
|
|
273
|
-
let hiddenInput =
|
|
267
|
+
let hiddenInput = main_module.default("input.hidden-input", {
|
|
274
268
|
autoFocus: true,
|
|
275
269
|
onKeyDown: state.editorKeyHandler
|
|
276
270
|
});
|
|
@@ -278,14 +272,14 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
278
272
|
let _dataEditor = null;
|
|
279
273
|
let className = null;
|
|
280
274
|
if (col.dataEditor != null) {
|
|
281
|
-
_dataEditor =
|
|
275
|
+
_dataEditor = main_module.default(
|
|
282
276
|
editorPopup.EditorPopup,
|
|
283
277
|
{
|
|
284
278
|
autoFocus: autoFocusEditor,
|
|
285
279
|
valueViewer: _renderedValue
|
|
286
280
|
},
|
|
287
281
|
[
|
|
288
|
-
|
|
282
|
+
main_module.default(col.dataEditor, {
|
|
289
283
|
value,
|
|
290
284
|
editable,
|
|
291
285
|
onChange(value2) {
|
|
@@ -300,7 +294,7 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
300
294
|
if (_dataEditor != null) {
|
|
301
295
|
cellContents = _dataEditor;
|
|
302
296
|
}
|
|
303
|
-
return
|
|
297
|
+
return main_module.default(
|
|
304
298
|
_Cell,
|
|
305
299
|
{
|
|
306
300
|
intent,
|
|
@@ -322,7 +316,7 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
322
316
|
if (typeof _renderedValue === "string" || typeof _renderedValue === "number" || _renderedValue == null) {
|
|
323
317
|
_value = _renderedValue;
|
|
324
318
|
}
|
|
325
|
-
_inlineEditor =
|
|
319
|
+
_inlineEditor = main_module.default("input.main-editor", {
|
|
326
320
|
value: _value ?? "",
|
|
327
321
|
autoFocus: autoFocusEditor,
|
|
328
322
|
onChange,
|
|
@@ -340,7 +334,7 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
340
334
|
className = "input-cell";
|
|
341
335
|
hiddenInput = null;
|
|
342
336
|
}
|
|
343
|
-
return
|
|
337
|
+
return main_module.default(
|
|
344
338
|
_Cell,
|
|
345
339
|
{
|
|
346
340
|
intent,
|
|
@@ -351,30 +345,23 @@ function basicCellRenderer(rowIndex, colIndex, columnSpec, state, autoFocusEdito
|
|
|
351
345
|
},
|
|
352
346
|
[
|
|
353
347
|
cellContents,
|
|
354
|
-
|
|
355
|
-
focusedCell
|
|
356
|
-
}),
|
|
348
|
+
main_module.default.if(editable && isSingleCellSelection)(DragHandle),
|
|
357
349
|
hiddenInput
|
|
358
350
|
]
|
|
359
351
|
);
|
|
360
352
|
}
|
|
361
|
-
function DragHandle(
|
|
362
|
-
const
|
|
363
|
-
return
|
|
364
|
-
onMouseDown(e) {
|
|
365
|
-
onDragValue(focusedCell);
|
|
366
|
-
e.preventDefault();
|
|
367
|
-
}
|
|
368
|
-
});
|
|
353
|
+
function DragHandle() {
|
|
354
|
+
const onMouseDown = provider.useSelector((state) => state.onDragValue);
|
|
355
|
+
return main_module.default("div.corner-drag-handle", { onMouseDown });
|
|
369
356
|
}
|
|
370
357
|
function DataSheetEditToolbar({ onSaveData, onDeleteRows }) {
|
|
371
358
|
provider.useSelector((state) => state.selection);
|
|
372
359
|
const resetChanges = provider.useSelector((state) => state.resetChanges);
|
|
373
360
|
const hasUpdates = provider.useSelector((state) => state.hasUpdates);
|
|
374
|
-
return
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
361
|
+
return main_module.default("div.data-sheet-toolbar", [
|
|
362
|
+
main_module.default(core.ButtonGroup, { minimal: true }, [
|
|
363
|
+
main_module.default(AddRowButton),
|
|
364
|
+
main_module.default(
|
|
378
365
|
core.Button,
|
|
379
366
|
{
|
|
380
367
|
intent: core.Intent.DANGER,
|
|
@@ -386,9 +373,9 @@ function DataSheetEditToolbar({ onSaveData, onDeleteRows }) {
|
|
|
386
373
|
"Delete"
|
|
387
374
|
)
|
|
388
375
|
]),
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
376
|
+
main_module.default("div.spacer"),
|
|
377
|
+
main_module.default(core.ButtonGroup, [
|
|
378
|
+
main_module.default(
|
|
392
379
|
core.Button,
|
|
393
380
|
{
|
|
394
381
|
intent: core.Intent.WARNING,
|
|
@@ -397,7 +384,7 @@ function DataSheetEditToolbar({ onSaveData, onDeleteRows }) {
|
|
|
397
384
|
},
|
|
398
385
|
"Reset"
|
|
399
386
|
),
|
|
400
|
-
|
|
387
|
+
main_module.default.if(onSaveData != null)(
|
|
401
388
|
core.Button,
|
|
402
389
|
{
|
|
403
390
|
intent: core.Intent.SUCCESS,
|
|
@@ -413,8 +400,8 @@ function DataSheetEditToolbar({ onSaveData, onDeleteRows }) {
|
|
|
413
400
|
function ScrollToRowControl() {
|
|
414
401
|
const [value, setValue] = react.useState("");
|
|
415
402
|
const scrollToRow = provider.useSelector((state) => state.scrollToRow);
|
|
416
|
-
return
|
|
417
|
-
|
|
403
|
+
return main_module.default(actions.DataSheetAction, [
|
|
404
|
+
main_module.default(core.InputGroup, {
|
|
418
405
|
type: "number",
|
|
419
406
|
placeholder: "Row number",
|
|
420
407
|
value,
|
|
@@ -422,7 +409,7 @@ function ScrollToRowControl() {
|
|
|
422
409
|
setValue(value2);
|
|
423
410
|
}
|
|
424
411
|
}),
|
|
425
|
-
|
|
412
|
+
main_module.default(
|
|
426
413
|
core.Button,
|
|
427
414
|
{
|
|
428
415
|
icon: "arrow-right",
|
|
@@ -437,7 +424,7 @@ function ScrollToRowControl() {
|
|
|
437
424
|
}
|
|
438
425
|
function AddRowButton() {
|
|
439
426
|
const addRow = provider.useSelector((state) => state.addRow);
|
|
440
|
-
return
|
|
427
|
+
return main_module.default(
|
|
441
428
|
core.Button,
|
|
442
429
|
{
|
|
443
430
|
icon: "plus",
|
|
@@ -447,7 +434,7 @@ function AddRowButton() {
|
|
|
447
434
|
);
|
|
448
435
|
}
|
|
449
436
|
function BaseCell({ children, value, ...rest }) {
|
|
450
|
-
return
|
|
437
|
+
return main_module.default(
|
|
451
438
|
table.Cell,
|
|
452
439
|
{
|
|
453
440
|
interactive: true,
|