@macrostrat/data-sheet 3.1.0 → 4.0.0-dev1
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 +5 -0
- package/dist/actions/builtin.cjs +56 -0
- package/dist/actions/builtin.cjs.map +1 -0
- package/dist/actions/builtin.d.ts +15 -0
- package/dist/actions/builtin.js +56 -0
- package/dist/actions/builtin.js.map +1 -0
- package/dist/actions/clipboard.cjs +250 -0
- package/dist/actions/clipboard.cjs.map +1 -0
- package/dist/actions/clipboard.d.ts +42 -0
- package/dist/actions/clipboard.js +250 -0
- package/dist/actions/clipboard.js.map +1 -0
- package/dist/actions/filters.cjs +123 -0
- package/dist/actions/filters.cjs.map +1 -0
- package/dist/actions/filters.d.ts +6 -0
- package/dist/actions/filters.js +123 -0
- package/dist/actions/filters.js.map +1 -0
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/selection.cjs +194 -0
- package/dist/actions/selection.cjs.map +1 -0
- package/dist/actions/selection.d.ts +40 -0
- package/dist/actions/selection.js +192 -0
- package/dist/actions/selection.js.map +1 -0
- package/dist/actions/toolbar.cjs +171 -0
- package/dist/actions/toolbar.cjs.map +1 -0
- package/dist/actions/toolbar.d.ts +10 -0
- package/dist/actions/toolbar.js +171 -0
- package/dist/actions/toolbar.js.map +1 -0
- package/dist/actions/toolbar.module.sass.cjs +22 -0
- package/dist/actions/toolbar.module.sass.cjs.map +1 -0
- package/dist/actions/toolbar.module.sass.js +20 -0
- package/dist/actions/toolbar.module.sass.js.map +1 -0
- package/dist/actions/types.d.ts +143 -0
- package/dist/cell-renderer.cjs +44 -41
- package/dist/cell-renderer.cjs.map +1 -1
- package/dist/cell-renderer.d.ts +1 -6
- package/dist/cell-renderer.js +45 -42
- package/dist/cell-renderer.js.map +1 -1
- package/dist/components/actions.module.sass.cjs +3 -3
- package/dist/components/actions.module.sass.js +2 -2
- package/dist/components/colors.cjs +20 -16
- package/dist/components/colors.cjs.map +1 -1
- package/dist/components/colors.d.ts +4 -3
- package/dist/components/colors.js +20 -16
- package/dist/components/colors.js.map +1 -1
- package/dist/components/editor-popup.cjs +4 -3
- package/dist/components/editor-popup.cjs.map +1 -1
- package/dist/components/editor-popup.js +4 -3
- package/dist/components/editor-popup.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/main.module.sass.cjs +12 -12
- package/dist/components/main.module.sass.js +11 -11
- package/dist/components/text-areas.cjs +23 -18
- package/dist/components/text-areas.cjs.map +1 -1
- package/dist/components/text-areas.d.ts +8 -4
- package/dist/components/text-areas.js +20 -13
- package/dist/components/text-areas.js.map +1 -1
- package/dist/components/view-info.cjs +18 -0
- package/dist/components/view-info.cjs.map +1 -0
- package/dist/components/view-info.d.ts +1 -0
- package/dist/components/view-info.js +18 -0
- package/dist/components/view-info.js.map +1 -0
- package/dist/core.cjs +184 -156
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +14 -1
- package/dist/core.js +187 -157
- package/dist/core.js.map +1 -1
- package/dist/data-sheet.css +181 -43
- package/dist/index.cjs +43 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -10
- package/dist/index.js.map +1 -1
- package/dist/main.module.sass.cjs +15 -14
- package/dist/main.module.sass.cjs.map +1 -1
- package/dist/main.module.sass.js +14 -13
- package/dist/main.module.sass.js.map +1 -1
- package/dist/notifications.cjs +19 -0
- package/dist/notifications.cjs.map +1 -0
- package/dist/notifications.d.ts +9 -0
- package/dist/notifications.js +19 -0
- package/dist/notifications.js.map +1 -0
- package/dist/postgrest-table/data-loaders.cjs +181 -104
- package/dist/postgrest-table/data-loaders.cjs.map +1 -1
- package/dist/postgrest-table/data-loaders.d.ts +52 -28
- package/dist/postgrest-table/data-loaders.js +181 -104
- package/dist/postgrest-table/data-loaders.js.map +1 -1
- package/dist/postgrest-table/index.cjs +205 -79
- package/dist/postgrest-table/index.cjs.map +1 -1
- package/dist/postgrest-table/index.d.ts +13 -16
- package/dist/postgrest-table/index.js +186 -58
- package/dist/postgrest-table/index.js.map +1 -1
- package/dist/postgrest-table/lazy-loader-table.cjs +18 -17
- package/dist/postgrest-table/lazy-loader-table.cjs.map +1 -1
- package/dist/postgrest-table/lazy-loader-table.d.ts +1 -1
- package/dist/postgrest-table/lazy-loader-table.js +17 -14
- package/dist/postgrest-table/lazy-loader-table.js.map +1 -1
- package/dist/postgrest-table/loading-utils.cjs +16 -0
- package/dist/postgrest-table/loading-utils.cjs.map +1 -0
- package/dist/postgrest-table/loading-utils.d.ts +13 -0
- package/dist/postgrest-table/loading-utils.js +16 -0
- package/dist/postgrest-table/loading-utils.js.map +1 -0
- package/dist/postgrest-table/main.module.sass.cjs +18 -13
- package/dist/postgrest-table/main.module.sass.cjs.map +1 -1
- package/dist/postgrest-table/main.module.sass.js +18 -13
- package/dist/postgrest-table/main.module.sass.js.map +1 -1
- package/dist/provider.cjs +58 -26
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +57 -23
- package/dist/provider.js.map +1 -1
- package/dist/renderers/column-header-cell-postgrest.cjs +216 -0
- package/dist/renderers/column-header-cell-postgrest.cjs.map +1 -0
- package/dist/renderers/column-header-cell-postgrest.d.ts +13 -0
- package/dist/renderers/column-header-cell-postgrest.js +216 -0
- package/dist/renderers/column-header-cell-postgrest.js.map +1 -0
- package/dist/renderers/column-header-cell-postgrest.module.sass.cjs +23 -0
- package/dist/renderers/column-header-cell-postgrest.module.sass.cjs.map +1 -0
- package/dist/renderers/column-header-cell-postgrest.module.sass.js +22 -0
- package/dist/renderers/column-header-cell-postgrest.module.sass.js.map +1 -0
- package/dist/renderers/column-header-cell.cjs +103 -0
- package/dist/renderers/column-header-cell.cjs.map +1 -0
- package/dist/renderers/column-header-cell.d.ts +30 -0
- package/dist/renderers/column-header-cell.js +101 -0
- package/dist/renderers/column-header-cell.js.map +1 -0
- package/dist/renderers/index.d.ts +2 -0
- package/dist/table-updates/data-parameter.d.ts +14 -0
- package/dist/table-updates/filter.d.ts +16 -0
- package/dist/table-updates/index.d.ts +19 -0
- package/dist/types.cjs +9 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +58 -4
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/column-spec.cjs +9 -1
- package/dist/utils/column-spec.cjs.map +1 -1
- package/dist/utils/column-spec.d.ts +21 -0
- package/dist/utils/column-spec.js +9 -1
- package/dist/utils/column-spec.js.map +1 -1
- package/dist/utils/key-handling.cjs +141 -52
- package/dist/utils/key-handling.cjs.map +1 -1
- package/dist/utils/key-handling.d.ts +2 -3
- package/dist/utils/key-handling.js +142 -53
- package/dist/utils/key-handling.js.map +1 -1
- package/dist/zustand-store.cjs +216 -51
- package/dist/zustand-store.cjs.map +1 -1
- package/dist/zustand-store.js +197 -32
- package/dist/zustand-store.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/builtin.ts +65 -0
- package/src/actions/clipboard.ts +350 -0
- package/src/actions/filters.ts +150 -0
- package/src/actions/index.ts +6 -0
- package/src/actions/selection.ts +271 -0
- package/src/actions/toolbar.module.sass +30 -0
- package/src/actions/toolbar.ts +212 -0
- package/src/actions/types.ts +159 -0
- package/src/cell-renderer.ts +55 -51
- package/src/components/colors.ts +22 -19
- package/src/components/editor-popup.ts +3 -2
- package/src/components/index.ts +1 -0
- package/src/components/main.module.sass +1 -0
- package/src/components/text-areas.ts +34 -19
- package/src/components/view-info.ts +17 -0
- package/src/core.ts +243 -170
- package/src/index.ts +1 -0
- package/src/main.module.sass +14 -2
- package/src/notifications.ts +22 -0
- package/src/postgrest-table/data-loaders.ts +300 -201
- package/src/postgrest-table/index.ts +258 -84
- package/src/postgrest-table/lazy-loader-table.ts +18 -17
- package/src/postgrest-table/loading-utils.ts +49 -0
- package/src/postgrest-table/main.module.sass +16 -0
- package/src/provider.ts +63 -20
- package/src/renderers/column-header-cell-postgrest.module.sass +71 -0
- package/src/renderers/column-header-cell-postgrest.ts +282 -0
- package/src/renderers/column-header-cell.ts +388 -0
- package/src/renderers/index.ts +2 -0
- package/src/table-updates/data-parameter.ts +44 -0
- package/src/table-updates/filter.ts +124 -0
- package/src/table-updates/index.ts +239 -0
- package/src/types.ts +58 -3
- package/src/utils/column-spec.ts +47 -0
- package/src/utils/key-handling.ts +181 -72
- package/src/zustand-store.ts +241 -36
- package/dist/provider.d.ts +0 -15
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hyper = require("@macrostrat/hyper");
|
|
4
3
|
const main_module = require("./main.module.sass.cjs");
|
|
5
4
|
const core = require("@blueprintjs/core");
|
|
6
5
|
const react = require("react");
|
|
7
6
|
const keyHandling = require("../utils/key-handling.cjs");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
function EditableTextArea({
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
isEdited,
|
|
11
|
+
resetValue
|
|
12
|
+
}) {
|
|
12
13
|
const ref = react.useRef(null);
|
|
13
14
|
react.useEffect(() => {
|
|
14
15
|
if (ref.current == null) return;
|
|
@@ -16,24 +17,28 @@ function EditableTextArea({ value, onChange }) {
|
|
|
16
17
|
const val = ref.current.value;
|
|
17
18
|
ref.current.setSelectionRange(val.length, val.length);
|
|
18
19
|
}, []);
|
|
19
|
-
return
|
|
20
|
-
|
|
20
|
+
return main_module.default("div.editable-text-area", [
|
|
21
|
+
main_module.default("textarea.bp6-input", {
|
|
21
22
|
ref,
|
|
22
|
-
|
|
23
|
-
onChange: (evt) =>
|
|
23
|
+
defaultValue: value ?? "",
|
|
24
|
+
//onChange: (evt) => setValue(evt.target.value),
|
|
25
|
+
onBlur: (evt) => {
|
|
26
|
+
if (evt.target.value !== value) {
|
|
27
|
+
onChange(evt.target.value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
24
30
|
onKeyDown: keyHandling.multiLineTextKeyHandler
|
|
25
31
|
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
main_module.default("div.tools", [
|
|
33
|
+
// Tool to reset the value to the default
|
|
34
|
+
main_module.default(core.Button, {
|
|
35
|
+
icon: "undo",
|
|
29
36
|
minimal: true,
|
|
30
37
|
small: true,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ref.current.focus();
|
|
36
|
-
ref.current.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
|
38
|
+
intent: isEdited ? "success" : "none",
|
|
39
|
+
disabled: !isEdited,
|
|
40
|
+
onClick(evt) {
|
|
41
|
+
resetValue?.();
|
|
37
42
|
}
|
|
38
43
|
})
|
|
39
44
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-areas.cjs","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"text-areas.cjs","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import h from \"./main.module.sass\";\nimport { Button } from \"@blueprintjs/core\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { multiLineTextKeyHandler } from \"../utils\";\n\nexport type DataEditorProps = {\n value: string;\n editable: boolean;\n onChange: (value: string) => void;\n isEdited?: boolean;\n resetValue?: () => void;\n};\n\nexport function EditableTextArea({\n value,\n onChange,\n isEdited,\n resetValue,\n}: DataEditorProps) {\n const ref = useRef(null);\n\n // const [_value, setValue] = useState(value);\n //\n // useEffect(() => {\n // setValue(value);\n // }, [value]);\n\n useEffect(() => {\n if (ref.current == null) return;\n ref.current.focus();\n // Get the current value\n const val = ref.current.value;\n // Move the cursor to the end of the text\n ref.current.setSelectionRange(val.length, val.length);\n }, []);\n\n return h(\"div.editable-text-area\", [\n h(\"textarea.bp6-input\", {\n ref,\n defaultValue: value ?? \"\",\n //onChange: (evt) => setValue(evt.target.value),\n onBlur: (evt) => {\n if (evt.target.value !== value) {\n onChange(evt.target.value);\n }\n },\n onKeyDown: multiLineTextKeyHandler,\n }),\n h(\"div.tools\", [\n // Tool to reset the value to the default\n h(Button, {\n icon: \"undo\",\n minimal: true,\n small: true,\n intent: isEdited ? \"success\" : \"none\",\n disabled: !isEdited,\n onClick(evt) {\n resetValue?.();\n },\n }),\n ]),\n ]);\n}\n"],"names":["useRef","useEffect","h","multiLineTextKeyHandler","Button"],"mappings":";;;;;;AAaO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,MAAMA,MAAAA,OAAO,IAAI;AAQvBC,QAAAA,UAAU,MAAM;AACd,QAAI,IAAI,WAAW,KAAM;AACzB,QAAI,QAAQ,MAAA;AAEZ,UAAM,MAAM,IAAI,QAAQ;AAExB,QAAI,QAAQ,kBAAkB,IAAI,QAAQ,IAAI,MAAM;AAAA,EACtD,GAAG,CAAA,CAAE;AAEL,SAAOC,YAAAA,QAAE,0BAA0B;AAAA,IACjCA,YAAAA,QAAE,sBAAsB;AAAA,MACtB;AAAA,MACA,cAAc,SAAS;AAAA;AAAA,MAEvB,QAAQ,CAAC,QAAQ;AACf,YAAI,IAAI,OAAO,UAAU,OAAO;AAC9B,mBAAS,IAAI,OAAO,KAAK;AAAA,QAC3B;AAAA,MACF;AAAA,MACA,WAAWC,YAAAA;AAAAA,IAAA,CACZ;AAAA,IACDD,YAAAA,QAAE,aAAa;AAAA;AAAA,MAEbA,YAAAA,QAAEE,KAAAA,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ,WAAW,YAAY;AAAA,QAC/B,UAAU,CAAC;AAAA,QACX,QAAQ,KAAK;AACX,uBAAA;AAAA,QACF;AAAA,MAAA,CACD;AAAA,IAAA,CACF;AAAA,EAAA,CACF;AACH;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
value:
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export type DataEditorProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
editable: boolean;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
isEdited?: boolean;
|
|
6
|
+
resetValue?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function EditableTextArea({ value, onChange, isEdited, resetValue, }: DataEditorProps): import('react').DOMElement<import('react').DOMAttributes<Element>, Element>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import h$1 from "./main.module.sass.js";
|
|
1
|
+
import h from "./main.module.sass.js";
|
|
3
2
|
import { Button } from "@blueprintjs/core";
|
|
4
3
|
import { useRef, useEffect } from "react";
|
|
5
4
|
import { multiLineTextKeyHandler } from "../utils/key-handling.js";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function EditableTextArea({
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
isEdited,
|
|
9
|
+
resetValue
|
|
10
|
+
}) {
|
|
8
11
|
const ref = useRef(null);
|
|
9
12
|
useEffect(() => {
|
|
10
13
|
if (ref.current == null) return;
|
|
@@ -15,21 +18,25 @@ function EditableTextArea({ value, onChange }) {
|
|
|
15
18
|
return h("div.editable-text-area", [
|
|
16
19
|
h("textarea.bp6-input", {
|
|
17
20
|
ref,
|
|
18
|
-
|
|
19
|
-
onChange: (evt) =>
|
|
21
|
+
defaultValue: value ?? "",
|
|
22
|
+
//onChange: (evt) => setValue(evt.target.value),
|
|
23
|
+
onBlur: (evt) => {
|
|
24
|
+
if (evt.target.value !== value) {
|
|
25
|
+
onChange(evt.target.value);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
20
28
|
onKeyDown: multiLineTextKeyHandler
|
|
21
29
|
}),
|
|
22
30
|
h("div.tools", [
|
|
31
|
+
// Tool to reset the value to the default
|
|
23
32
|
h(Button, {
|
|
24
|
-
icon: "
|
|
33
|
+
icon: "undo",
|
|
25
34
|
minimal: true,
|
|
26
35
|
small: true,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ref.current.focus();
|
|
32
|
-
ref.current.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
|
36
|
+
intent: isEdited ? "success" : "none",
|
|
37
|
+
disabled: !isEdited,
|
|
38
|
+
onClick(evt) {
|
|
39
|
+
resetValue?.();
|
|
33
40
|
}
|
|
34
41
|
})
|
|
35
42
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-areas.js","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"text-areas.js","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import h from \"./main.module.sass\";\nimport { Button } from \"@blueprintjs/core\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { multiLineTextKeyHandler } from \"../utils\";\n\nexport type DataEditorProps = {\n value: string;\n editable: boolean;\n onChange: (value: string) => void;\n isEdited?: boolean;\n resetValue?: () => void;\n};\n\nexport function EditableTextArea({\n value,\n onChange,\n isEdited,\n resetValue,\n}: DataEditorProps) {\n const ref = useRef(null);\n\n // const [_value, setValue] = useState(value);\n //\n // useEffect(() => {\n // setValue(value);\n // }, [value]);\n\n useEffect(() => {\n if (ref.current == null) return;\n ref.current.focus();\n // Get the current value\n const val = ref.current.value;\n // Move the cursor to the end of the text\n ref.current.setSelectionRange(val.length, val.length);\n }, []);\n\n return h(\"div.editable-text-area\", [\n h(\"textarea.bp6-input\", {\n ref,\n defaultValue: value ?? \"\",\n //onChange: (evt) => setValue(evt.target.value),\n onBlur: (evt) => {\n if (evt.target.value !== value) {\n onChange(evt.target.value);\n }\n },\n onKeyDown: multiLineTextKeyHandler,\n }),\n h(\"div.tools\", [\n // Tool to reset the value to the default\n h(Button, {\n icon: \"undo\",\n minimal: true,\n small: true,\n intent: isEdited ? \"success\" : \"none\",\n disabled: !isEdited,\n onClick(evt) {\n resetValue?.();\n },\n }),\n ]),\n ]);\n}\n"],"names":[],"mappings":";;;;AAaO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,MAAM,OAAO,IAAI;AAQvB,YAAU,MAAM;AACd,QAAI,IAAI,WAAW,KAAM;AACzB,QAAI,QAAQ,MAAA;AAEZ,UAAM,MAAM,IAAI,QAAQ;AAExB,QAAI,QAAQ,kBAAkB,IAAI,QAAQ,IAAI,MAAM;AAAA,EACtD,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,0BAA0B;AAAA,IACjC,EAAE,sBAAsB;AAAA,MACtB;AAAA,MACA,cAAc,SAAS;AAAA;AAAA,MAEvB,QAAQ,CAAC,QAAQ;AACf,YAAI,IAAI,OAAO,UAAU,OAAO;AAC9B,mBAAS,IAAI,OAAO,KAAK;AAAA,QAC3B;AAAA,MACF;AAAA,MACA,WAAW;AAAA,IAAA,CACZ;AAAA,IACD,EAAE,aAAa;AAAA;AAAA,MAEb,EAAE,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ,WAAW,YAAY;AAAA,QAC/B,UAAU,CAAC;AAAA,QACX,QAAQ,KAAK;AACX,uBAAA;AAAA,QACF;AAAA,MAAA,CACD;AAAA,IAAA,CACF;AAAA,EAAA,CACF;AACH;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const main_module = require("../postgrest-table/main.module.sass.cjs");
|
|
4
|
+
const provider = require("../provider.cjs");
|
|
5
|
+
const dataLoaders = require("../postgrest-table/data-loaders.cjs");
|
|
6
|
+
function ViewInfoControl() {
|
|
7
|
+
const viewInfo = provider.ctx.useValue(dataLoaders.viewInfoAtom);
|
|
8
|
+
return main_module.default("p", [
|
|
9
|
+
`Rows ${viewInfo.visibleRegion.rowIndexStart}–${viewInfo.visibleRegion.rowIndexEnd}`,
|
|
10
|
+
" of ",
|
|
11
|
+
main_module.default("span.total-count", viewInfo.totalCount)
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
function InfoBar() {
|
|
15
|
+
return main_module.default("div.info-bar", [main_module.default(ViewInfoControl)]);
|
|
16
|
+
}
|
|
17
|
+
exports.InfoBar = InfoBar;
|
|
18
|
+
//# sourceMappingURL=view-info.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-info.cjs","sources":["../../src/components/view-info.ts"],"sourcesContent":["import h from \"../postgrest-table/main.module.sass\";\nimport { ViewInfo, viewInfoAtom } from \"../postgrest-table\";\nimport { ctx } from \"../provider.ts\";\n\nfunction ViewInfoControl() {\n const viewInfo: ViewInfo = ctx.useValue(viewInfoAtom);\n\n return h(\"p\", [\n `Rows ${viewInfo.visibleRegion.rowIndexStart}–${viewInfo.visibleRegion.rowIndexEnd}`,\n \" of \",\n h(\"span.total-count\", viewInfo.totalCount),\n ]);\n}\n\nexport function InfoBar() {\n return h(\"div.info-bar\", [h(ViewInfoControl)]);\n}\n"],"names":["ctx","viewInfoAtom","h"],"mappings":";;;;;AAIA,SAAS,kBAAkB;AACzB,QAAM,WAAqBA,SAAAA,IAAI,SAASC,wBAAY;AAEpD,SAAOC,YAAAA,QAAE,KAAK;AAAA,IACZ,QAAQ,SAAS,cAAc,aAAa,IAAI,SAAS,cAAc,WAAW;AAAA,IAClF;AAAA,IACAA,oBAAE,oBAAoB,SAAS,UAAU;AAAA,EAAA,CAC1C;AACH;AAEO,SAAS,UAAU;AACxB,SAAOA,YAAAA,QAAE,gBAAgB,CAACA,YAAAA,QAAE,eAAe,CAAC,CAAC;AAC/C;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function InfoBar(): import('react').DOMElement<import('react').DOMAttributes<Element>, Element>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import h from "../postgrest-table/main.module.sass.js";
|
|
2
|
+
import { ctx } from "../provider.js";
|
|
3
|
+
import { viewInfoAtom } from "../postgrest-table/data-loaders.js";
|
|
4
|
+
function ViewInfoControl() {
|
|
5
|
+
const viewInfo = ctx.useValue(viewInfoAtom);
|
|
6
|
+
return h("p", [
|
|
7
|
+
`Rows ${viewInfo.visibleRegion.rowIndexStart}–${viewInfo.visibleRegion.rowIndexEnd}`,
|
|
8
|
+
" of ",
|
|
9
|
+
h("span.total-count", viewInfo.totalCount)
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
12
|
+
function InfoBar() {
|
|
13
|
+
return h("div.info-bar", [h(ViewInfoControl)]);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
InfoBar
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=view-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-info.js","sources":["../../src/components/view-info.ts"],"sourcesContent":["import h from \"../postgrest-table/main.module.sass\";\nimport { ViewInfo, viewInfoAtom } from \"../postgrest-table\";\nimport { ctx } from \"../provider.ts\";\n\nfunction ViewInfoControl() {\n const viewInfo: ViewInfo = ctx.useValue(viewInfoAtom);\n\n return h(\"p\", [\n `Rows ${viewInfo.visibleRegion.rowIndexStart}–${viewInfo.visibleRegion.rowIndexEnd}`,\n \" of \",\n h(\"span.total-count\", viewInfo.totalCount),\n ]);\n}\n\nexport function InfoBar() {\n return h(\"div.info-bar\", [h(ViewInfoControl)]);\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,kBAAkB;AACzB,QAAM,WAAqB,IAAI,SAAS,YAAY;AAEpD,SAAO,EAAE,KAAK;AAAA,IACZ,QAAQ,SAAS,cAAc,aAAa,IAAI,SAAS,cAAc,WAAW;AAAA,IAClF;AAAA,IACA,EAAE,oBAAoB,SAAS,UAAU;AAAA,EAAA,CAC1C;AACH;AAEO,SAAS,UAAU;AACxB,SAAO,EAAE,gBAAgB,CAAC,EAAE,eAAe,CAAC,CAAC;AAC/C;"}
|