@gridsheet/react-core 1.4.0-alpha.2 → 1.4.0-alpha.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/dist/components/Cell.js +232 -0
- package/dist/components/Cell.js.map +1 -0
- package/dist/components/ContextMenu.js +297 -0
- package/dist/components/ContextMenu.js.map +1 -0
- package/dist/components/Editor.js +455 -0
- package/dist/components/Editor.js.map +1 -0
- package/dist/components/Emitter.js +26 -0
- package/dist/components/Emitter.js.map +1 -0
- package/dist/components/Fixed.js +17 -0
- package/dist/components/Fixed.js.map +1 -0
- package/dist/components/FormulaBar.js +149 -0
- package/dist/components/FormulaBar.js.map +1 -0
- package/dist/components/GridSheet.js +246 -0
- package/dist/components/GridSheet.js.map +1 -0
- package/dist/components/HeaderCellLeft.js +131 -0
- package/dist/components/HeaderCellLeft.js.map +1 -0
- package/dist/components/HeaderCellTop.js +132 -0
- package/dist/components/HeaderCellTop.js.map +1 -0
- package/dist/components/PluginBase.js +35 -0
- package/dist/components/PluginBase.js.map +1 -0
- package/dist/components/Resizer.js +98 -0
- package/dist/components/Resizer.js.map +1 -0
- package/dist/components/SearchBar.js +108 -0
- package/dist/components/SearchBar.js.map +1 -0
- package/dist/components/SheetProvider.js +56 -0
- package/dist/components/SheetProvider.js.map +1 -0
- package/dist/components/StoreInitializer.js +84 -0
- package/dist/components/StoreInitializer.js.map +1 -0
- package/dist/components/Tabular.js +308 -0
- package/dist/components/Tabular.js.map +1 -0
- package/dist/components/hooks.js +15 -0
- package/dist/components/hooks.js.map +1 -0
- package/dist/components/svg/Base.js +24 -0
- package/dist/components/svg/Base.js.map +1 -0
- package/dist/components/svg/CloseIcon.js +13 -0
- package/dist/components/svg/CloseIcon.js.map +1 -0
- package/dist/components/svg/SearchIcon.js +13 -0
- package/dist/components/svg/SearchIcon.js.map +1 -0
- package/dist/constants.js +43 -0
- package/dist/constants.js.map +1 -0
- package/dist/formula/evaluator.js +674 -0
- package/dist/formula/evaluator.js.map +1 -0
- package/dist/formula/functions/__base.js +19 -0
- package/dist/formula/functions/__base.js.map +1 -0
- package/dist/formula/functions/__utils.js +145 -0
- package/dist/formula/functions/__utils.js.map +1 -0
- package/dist/formula/functions/abs.js +24 -0
- package/dist/formula/functions/abs.js.map +1 -0
- package/dist/formula/functions/acos.js +32 -0
- package/dist/formula/functions/acos.js.map +1 -0
- package/dist/formula/functions/add.js +57 -0
- package/dist/formula/functions/add.js.map +1 -0
- package/dist/formula/functions/and.js +28 -0
- package/dist/formula/functions/and.js.map +1 -0
- package/dist/formula/functions/asin.js +32 -0
- package/dist/formula/functions/asin.js.map +1 -0
- package/dist/formula/functions/atan.js +29 -0
- package/dist/formula/functions/atan.js.map +1 -0
- package/dist/formula/functions/atan2.js +35 -0
- package/dist/formula/functions/atan2.js.map +1 -0
- package/dist/formula/functions/average.js +44 -0
- package/dist/formula/functions/average.js.map +1 -0
- package/dist/formula/functions/col.js +31 -0
- package/dist/formula/functions/col.js.map +1 -0
- package/dist/formula/functions/concat.js +27 -0
- package/dist/formula/functions/concat.js.map +1 -0
- package/dist/formula/functions/concatenate.js +28 -0
- package/dist/formula/functions/concatenate.js.map +1 -0
- package/dist/formula/functions/cos.js +29 -0
- package/dist/formula/functions/cos.js.map +1 -0
- package/dist/formula/functions/count.js +38 -0
- package/dist/formula/functions/count.js.map +1 -0
- package/dist/formula/functions/counta.js +38 -0
- package/dist/formula/functions/counta.js.map +1 -0
- package/dist/formula/functions/countif.js +32 -0
- package/dist/formula/functions/countif.js.map +1 -0
- package/dist/formula/functions/divide.js +33 -0
- package/dist/formula/functions/divide.js.map +1 -0
- package/dist/formula/functions/eq.js +29 -0
- package/dist/formula/functions/eq.js.map +1 -0
- package/dist/formula/functions/exp.js +29 -0
- package/dist/formula/functions/exp.js.map +1 -0
- package/dist/formula/functions/gt.js +29 -0
- package/dist/formula/functions/gt.js.map +1 -0
- package/dist/formula/functions/gte.js +29 -0
- package/dist/formula/functions/gte.js.map +1 -0
- package/dist/formula/functions/hlookup.js +75 -0
- package/dist/formula/functions/hlookup.js.map +1 -0
- package/dist/formula/functions/if.js +39 -0
- package/dist/formula/functions/if.js.map +1 -0
- package/dist/formula/functions/iferror.js +45 -0
- package/dist/formula/functions/iferror.js.map +1 -0
- package/dist/formula/functions/len.js +29 -0
- package/dist/formula/functions/len.js.map +1 -0
- package/dist/formula/functions/lenb.js +29 -0
- package/dist/formula/functions/lenb.js.map +1 -0
- package/dist/formula/functions/ln.js +32 -0
- package/dist/formula/functions/ln.js.map +1 -0
- package/dist/formula/functions/log.js +36 -0
- package/dist/formula/functions/log.js.map +1 -0
- package/dist/formula/functions/log10.js +32 -0
- package/dist/formula/functions/log10.js.map +1 -0
- package/dist/formula/functions/lt.js +29 -0
- package/dist/formula/functions/lt.js.map +1 -0
- package/dist/formula/functions/lte.js +29 -0
- package/dist/formula/functions/lte.js.map +1 -0
- package/dist/formula/functions/max.js +47 -0
- package/dist/formula/functions/max.js.map +1 -0
- package/dist/formula/functions/min.js +47 -0
- package/dist/formula/functions/min.js.map +1 -0
- package/dist/formula/functions/minus.js +57 -0
- package/dist/formula/functions/minus.js.map +1 -0
- package/dist/formula/functions/mod.js +33 -0
- package/dist/formula/functions/mod.js.map +1 -0
- package/dist/formula/functions/multiply.js +27 -0
- package/dist/formula/functions/multiply.js.map +1 -0
- package/dist/formula/functions/ne.js +29 -0
- package/dist/formula/functions/ne.js.map +1 -0
- package/dist/formula/functions/not.js +30 -0
- package/dist/formula/functions/not.js.map +1 -0
- package/dist/formula/functions/now.js +22 -0
- package/dist/formula/functions/now.js.map +1 -0
- package/dist/formula/functions/or.js +28 -0
- package/dist/formula/functions/or.js.map +1 -0
- package/dist/formula/functions/pi.js +22 -0
- package/dist/formula/functions/pi.js.map +1 -0
- package/dist/formula/functions/power.js +27 -0
- package/dist/formula/functions/power.js.map +1 -0
- package/dist/formula/functions/product.js +40 -0
- package/dist/formula/functions/product.js.map +1 -0
- package/dist/formula/functions/radians.js +29 -0
- package/dist/formula/functions/radians.js.map +1 -0
- package/dist/formula/functions/rand.js +22 -0
- package/dist/formula/functions/rand.js.map +1 -0
- package/dist/formula/functions/round.js +35 -0
- package/dist/formula/functions/round.js.map +1 -0
- package/dist/formula/functions/rounddown.js +35 -0
- package/dist/formula/functions/rounddown.js.map +1 -0
- package/dist/formula/functions/roundup.js +35 -0
- package/dist/formula/functions/roundup.js.map +1 -0
- package/dist/formula/functions/row.js +31 -0
- package/dist/formula/functions/row.js.map +1 -0
- package/dist/formula/functions/sin.js +29 -0
- package/dist/formula/functions/sin.js.map +1 -0
- package/dist/formula/functions/sqrt.js +32 -0
- package/dist/formula/functions/sqrt.js.map +1 -0
- package/dist/formula/functions/sum.js +47 -0
- package/dist/formula/functions/sum.js.map +1 -0
- package/dist/formula/functions/sumif.js +65 -0
- package/dist/formula/functions/sumif.js.map +1 -0
- package/dist/formula/functions/tan.js +29 -0
- package/dist/formula/functions/tan.js.map +1 -0
- package/dist/formula/functions/uminus.js +24 -0
- package/dist/formula/functions/uminus.js.map +1 -0
- package/dist/formula/functions/vlookup.js +75 -0
- package/dist/formula/functions/vlookup.js.map +1 -0
- package/dist/formula/mapping.js +118 -0
- package/dist/formula/mapping.js.map +1 -0
- package/dist/formula/solver.js +70 -0
- package/dist/formula/solver.js.map +1 -0
- package/dist/index.js +16 -9113
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.js +391 -0
- package/dist/lib/autofill.js.map +1 -0
- package/dist/lib/clipboard.js +46 -0
- package/dist/lib/clipboard.js.map +1 -0
- package/dist/lib/converters.js +141 -0
- package/dist/lib/converters.js.map +1 -0
- package/dist/lib/input.js +52 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/palette.js +24 -0
- package/dist/lib/palette.js.map +1 -0
- package/dist/lib/prevention.js +82 -0
- package/dist/lib/prevention.js.map +1 -0
- package/dist/lib/structs.js +276 -0
- package/dist/lib/structs.js.map +1 -0
- package/dist/lib/table.js +1248 -0
- package/dist/lib/table.js.map +1 -0
- package/dist/lib/time.js +79 -0
- package/dist/lib/time.js.map +1 -0
- package/dist/lib/virtualization.js +129 -0
- package/dist/lib/virtualization.js.map +1 -0
- package/dist/parsers/core.js +139 -0
- package/dist/parsers/core.js.map +1 -0
- package/dist/renderers/checkbox.js +20 -0
- package/dist/renderers/checkbox.js.map +1 -0
- package/dist/renderers/core.js +147 -0
- package/dist/renderers/core.js.map +1 -0
- package/dist/renderers/thousand_separator.js +17 -0
- package/dist/renderers/thousand_separator.js.map +1 -0
- package/dist/store/actions.js +762 -0
- package/dist/store/actions.js.map +1 -0
- package/dist/store/helpers.js +88 -0
- package/dist/store/helpers.js.map +1 -0
- package/dist/store/index.js +8 -0
- package/dist/store/index.js.map +1 -0
- package/dist/styles/embedder.js +19 -0
- package/dist/styles/embedder.js.map +1 -0
- package/dist/styles/minified.js +7 -0
- package/dist/styles/minified.js.map +1 -0
- package/package.json +1 -7
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import { Cell } from "./Cell.js";
|
|
4
|
+
import { HeaderCellTop } from "./HeaderCellTop.js";
|
|
5
|
+
import { HeaderCellLeft } from "./HeaderCellLeft.js";
|
|
6
|
+
import { Context } from "../store/index.js";
|
|
7
|
+
import { updateTable, setInputting, choose, select, setEntering } from "../store/actions.js";
|
|
8
|
+
import { virtualize } from "../lib/virtualization.js";
|
|
9
|
+
import { stripAddressAbsolute, p2a, a2p } from "../lib/converters.js";
|
|
10
|
+
import { zoneToArea } from "../lib/structs.js";
|
|
11
|
+
import { Lexer } from "../formula/evaluator.js";
|
|
12
|
+
import { REF_PALETTE } from "../lib/palette.js";
|
|
13
|
+
import { useSheetContext } from "./SheetProvider.js";
|
|
14
|
+
import { Autofill } from "../lib/autofill.js";
|
|
15
|
+
const createTableRef = () => React__default.useRef(null);
|
|
16
|
+
const Tabular = ({ tableRef }) => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
18
|
+
const [refs, setRefs] = React__default.useState({});
|
|
19
|
+
const [, { externalRefs = {}, setExternalRefs }] = useSheetContext();
|
|
20
|
+
const { store, dispatch } = React__default.useContext(Context);
|
|
21
|
+
const {
|
|
22
|
+
sheetHeight,
|
|
23
|
+
table,
|
|
24
|
+
tableInitialized,
|
|
25
|
+
tabularRef,
|
|
26
|
+
mainRef,
|
|
27
|
+
headerWidth,
|
|
28
|
+
headerHeight,
|
|
29
|
+
editingCell,
|
|
30
|
+
inputting
|
|
31
|
+
} = store;
|
|
32
|
+
React__default.useEffect(() => {
|
|
33
|
+
if (editingCell && inputting.startsWith("=")) {
|
|
34
|
+
const refs2 = {};
|
|
35
|
+
const externalRefs2 = {};
|
|
36
|
+
const lexer = new Lexer(inputting.substring(1));
|
|
37
|
+
lexer.tokenize();
|
|
38
|
+
let i = 0;
|
|
39
|
+
for (const token of lexer.tokens) {
|
|
40
|
+
if (token.type === "REF" || token.type === "RANGE") {
|
|
41
|
+
const normalizedRef = stripAddressAbsolute(token.stringify());
|
|
42
|
+
if (normalizedRef.includes("!")) {
|
|
43
|
+
const [sheetName, ref] = normalizedRef.split("!");
|
|
44
|
+
const upperRef = ref.toUpperCase();
|
|
45
|
+
if (externalRefs2[sheetName] == null) {
|
|
46
|
+
externalRefs2[sheetName] = {};
|
|
47
|
+
}
|
|
48
|
+
if (externalRefs2[sheetName][upperRef] == null) {
|
|
49
|
+
externalRefs2[sheetName][upperRef] = i++;
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
const upperRef = normalizedRef.toUpperCase();
|
|
53
|
+
if (refs2[upperRef] == null) {
|
|
54
|
+
refs2[upperRef] = i++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
setRefs(refs2);
|
|
60
|
+
setExternalRefs == null ? void 0 : setExternalRefs(externalRefs2);
|
|
61
|
+
} else {
|
|
62
|
+
setRefs({});
|
|
63
|
+
setExternalRefs == null ? void 0 : setExternalRefs({});
|
|
64
|
+
}
|
|
65
|
+
}, [store.inputting, store.editingCell]);
|
|
66
|
+
React__default.useEffect(() => {
|
|
67
|
+
if (tableRef && tableInitialized) {
|
|
68
|
+
tableRef.current = {
|
|
69
|
+
table,
|
|
70
|
+
dispatch: (table2) => {
|
|
71
|
+
dispatch(updateTable(table2));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}, [table]);
|
|
76
|
+
React__default.useEffect(() => {
|
|
77
|
+
const v = table.stringify(store.choosing);
|
|
78
|
+
dispatch(setInputting(v || ""));
|
|
79
|
+
}, [table, store.choosing]);
|
|
80
|
+
const [virtualized, setVirtualized] = React__default.useState(null);
|
|
81
|
+
React__default.useEffect(() => {
|
|
82
|
+
setVirtualized(virtualize(table, tabularRef.current));
|
|
83
|
+
}, [tabularRef.current, table, (_a = mainRef.current) == null ? void 0 : _a.clientHeight, (_b = mainRef.current) == null ? void 0 : _b.clientWidth]);
|
|
84
|
+
const operationStyles = useOperationStyles(store, { ...refs, ...externalRefs[table.sheetName] });
|
|
85
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: "gs-tabular",
|
|
89
|
+
style: {
|
|
90
|
+
//width: sheetWidth,
|
|
91
|
+
height: sheetHeight
|
|
92
|
+
},
|
|
93
|
+
ref: tabularRef,
|
|
94
|
+
onMouseEnter: () => {
|
|
95
|
+
dispatch(setEntering(true));
|
|
96
|
+
},
|
|
97
|
+
onMouseLeave: () => {
|
|
98
|
+
dispatch(setEntering(false));
|
|
99
|
+
},
|
|
100
|
+
onScroll: (e) => {
|
|
101
|
+
setVirtualized(virtualize(table, e.currentTarget));
|
|
102
|
+
},
|
|
103
|
+
children: /* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: "gs-tabular-inner",
|
|
107
|
+
style: {
|
|
108
|
+
width: table.totalWidth + 1,
|
|
109
|
+
height: table.totalHeight + 1
|
|
110
|
+
},
|
|
111
|
+
children: /* @__PURE__ */ jsxs(
|
|
112
|
+
"table",
|
|
113
|
+
{
|
|
114
|
+
className: `gs-table`,
|
|
115
|
+
style: {
|
|
116
|
+
width: table.totalWidth
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx("thead", { className: "gs-thead", style: { height: headerHeight }, children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"th",
|
|
122
|
+
{
|
|
123
|
+
className: "gs-th gs-th-left gs-th-top",
|
|
124
|
+
style: { position: "sticky", width: headerWidth, height: headerHeight },
|
|
125
|
+
onClick: () => {
|
|
126
|
+
dispatch(choose({ y: -1, x: -1 }));
|
|
127
|
+
window.setTimeout(() => {
|
|
128
|
+
dispatch(choose({ y: 1, x: 1 }));
|
|
129
|
+
dispatch(
|
|
130
|
+
select({
|
|
131
|
+
startY: 1,
|
|
132
|
+
startX: 1,
|
|
133
|
+
endY: table.getNumRows(),
|
|
134
|
+
endX: table.getNumCols()
|
|
135
|
+
})
|
|
136
|
+
);
|
|
137
|
+
}, 100);
|
|
138
|
+
},
|
|
139
|
+
children: /* @__PURE__ */ jsx("div", { className: "gs-th-inner" })
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
"th",
|
|
144
|
+
{
|
|
145
|
+
className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left",
|
|
146
|
+
style: { width: ((_c = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _c.left) || 1 }
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
(_e = (_d = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (x) => /* @__PURE__ */ jsx(HeaderCellTop, { x }, x)),
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
"th",
|
|
152
|
+
{
|
|
153
|
+
className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right",
|
|
154
|
+
style: { width: (_f = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _f.right }
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] }) }),
|
|
158
|
+
/* @__PURE__ */ jsx("tbody", { className: "gs-table-body-adjuster", children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
"th",
|
|
161
|
+
{
|
|
162
|
+
className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`,
|
|
163
|
+
style: { height: ((_g = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _g.top) || 1 }
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }),
|
|
167
|
+
(_h = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _h.map((x) => /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }, x)),
|
|
168
|
+
/* @__PURE__ */ jsx("th", { className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical` })
|
|
169
|
+
] }) }),
|
|
170
|
+
/* @__PURE__ */ jsx("tbody", { className: "gs-table-body-data", children: (_i = virtualized == null ? void 0 : virtualized.ys) == null ? void 0 : _i.map((y) => {
|
|
171
|
+
var _a2;
|
|
172
|
+
return /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
|
|
173
|
+
/* @__PURE__ */ jsx(HeaderCellLeft, { y }),
|
|
174
|
+
/* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left" }),
|
|
175
|
+
(_a2 = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _a2.map((x) => /* @__PURE__ */ jsx(Cell, { y, x, operationStyle: operationStyles[p2a({ y, x })] }, x)),
|
|
176
|
+
/* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right" })
|
|
177
|
+
] }, y);
|
|
178
|
+
}) })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
) });
|
|
186
|
+
};
|
|
187
|
+
const BORDER_POINTED = "solid 2px #0077ff";
|
|
188
|
+
const BORDER_SELECTED = "solid 1px #0077ff";
|
|
189
|
+
const BORDER_CUTTING = "dotted 2px #0077ff";
|
|
190
|
+
const BORDER_COPYING = "dashed 2px #0077ff";
|
|
191
|
+
const SEARCH_MATCHING_BACKGROUND = "rgba(0,200,100,.2)";
|
|
192
|
+
const SEARCH_MATCHING_BORDER = "solid 2px #00aa78";
|
|
193
|
+
const AUTOFILL_BORDER = "dashed 1px #444444";
|
|
194
|
+
const useOperationStyles = (store, refs) => {
|
|
195
|
+
const cellStyles = {};
|
|
196
|
+
const updateStyle = (point, style) => {
|
|
197
|
+
const address = p2a(point);
|
|
198
|
+
cellStyles[address] = cellStyles[address] || {};
|
|
199
|
+
Object.assign(cellStyles[address], style);
|
|
200
|
+
};
|
|
201
|
+
const { choosing, selectingZone, copyingZone, cutting, matchingCells, matchingCellIndex, table, autofillDraggingTo } = store;
|
|
202
|
+
{
|
|
203
|
+
const { top, left, bottom, right } = zoneToArea(selectingZone);
|
|
204
|
+
for (let y = top; y <= bottom; y++) {
|
|
205
|
+
updateStyle({ y, x: left - 1 }, { borderRight: BORDER_SELECTED });
|
|
206
|
+
updateStyle({ y, x: left }, { borderLeft: BORDER_SELECTED });
|
|
207
|
+
updateStyle({ y, x: right }, { borderRight: BORDER_SELECTED });
|
|
208
|
+
updateStyle({ y, x: right + 1 }, { borderLeft: BORDER_SELECTED });
|
|
209
|
+
}
|
|
210
|
+
for (let x = left; x <= right; x++) {
|
|
211
|
+
updateStyle({ y: top - 1, x }, { borderBottom: BORDER_SELECTED });
|
|
212
|
+
updateStyle({ y: top, x }, { borderTop: BORDER_SELECTED });
|
|
213
|
+
updateStyle({ y: bottom, x }, { borderBottom: BORDER_SELECTED });
|
|
214
|
+
updateStyle({ y: bottom + 1, x }, { borderTop: BORDER_SELECTED });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (autofillDraggingTo) {
|
|
218
|
+
const autofill = new Autofill(store, autofillDraggingTo);
|
|
219
|
+
const { top, left, bottom, right } = autofill.wholeArea;
|
|
220
|
+
for (let y = top; y <= bottom; y++) {
|
|
221
|
+
updateStyle({ y, x: left - 1 }, { borderRight: AUTOFILL_BORDER });
|
|
222
|
+
updateStyle({ y, x: left }, { borderLeft: AUTOFILL_BORDER });
|
|
223
|
+
updateStyle({ y, x: right }, { borderRight: AUTOFILL_BORDER });
|
|
224
|
+
updateStyle({ y, x: right + 1 }, { borderLeft: AUTOFILL_BORDER });
|
|
225
|
+
}
|
|
226
|
+
for (let x = left; x <= right; x++) {
|
|
227
|
+
updateStyle({ y: top - 1, x }, { borderBottom: AUTOFILL_BORDER });
|
|
228
|
+
updateStyle({ y: top, x }, { borderTop: AUTOFILL_BORDER });
|
|
229
|
+
updateStyle({ y: bottom, x }, { borderBottom: AUTOFILL_BORDER });
|
|
230
|
+
updateStyle({ y: bottom + 1, x }, { borderTop: AUTOFILL_BORDER });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
{
|
|
234
|
+
const { y, x } = choosing;
|
|
235
|
+
updateStyle(
|
|
236
|
+
{ y, x },
|
|
237
|
+
{
|
|
238
|
+
borderLeft: BORDER_POINTED,
|
|
239
|
+
borderRight: BORDER_POINTED,
|
|
240
|
+
borderTop: BORDER_POINTED,
|
|
241
|
+
borderBottom: BORDER_POINTED
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
updateStyle({ y, x: x - 1 }, { borderRight: BORDER_POINTED });
|
|
245
|
+
updateStyle({ y, x: x + 1 }, { borderLeft: BORDER_POINTED });
|
|
246
|
+
updateStyle({ y: y - 1, x }, { borderBottom: BORDER_POINTED });
|
|
247
|
+
updateStyle({ y: y + 1, x }, { borderTop: BORDER_POINTED });
|
|
248
|
+
}
|
|
249
|
+
{
|
|
250
|
+
const borderStyle = cutting ? BORDER_CUTTING : BORDER_COPYING;
|
|
251
|
+
const { top, left, bottom, right } = zoneToArea(copyingZone);
|
|
252
|
+
for (let y = top; y <= bottom; y++) {
|
|
253
|
+
updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
|
|
254
|
+
updateStyle({ y, x: left }, { borderLeft: borderStyle });
|
|
255
|
+
updateStyle({ y, x: right }, { borderRight: borderStyle });
|
|
256
|
+
updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
|
|
257
|
+
}
|
|
258
|
+
for (let x = left; x <= right; x++) {
|
|
259
|
+
updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
|
|
260
|
+
updateStyle({ y: top, x }, { borderTop: borderStyle });
|
|
261
|
+
updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
|
|
262
|
+
updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
Object.entries(refs).forEach(([ref, i]) => {
|
|
266
|
+
const palette = REF_PALETTE[i % REF_PALETTE.length];
|
|
267
|
+
const borderStyle = `dashed 2px ${palette}`;
|
|
268
|
+
const { top, left, bottom, right } = table.rangeToArea(ref);
|
|
269
|
+
for (let y = top; y <= bottom; y++) {
|
|
270
|
+
updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
|
|
271
|
+
updateStyle({ y, x: left }, { borderLeft: borderStyle });
|
|
272
|
+
updateStyle({ y, x: right }, { borderRight: borderStyle });
|
|
273
|
+
updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
|
|
274
|
+
}
|
|
275
|
+
for (let x = left; x <= right; x++) {
|
|
276
|
+
updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
|
|
277
|
+
updateStyle({ y: top, x }, { borderTop: borderStyle });
|
|
278
|
+
updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
|
|
279
|
+
updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
matchingCells.forEach((address) => {
|
|
283
|
+
const { y, x } = a2p(address);
|
|
284
|
+
updateStyle({ y, x }, { backgroundColor: SEARCH_MATCHING_BACKGROUND });
|
|
285
|
+
});
|
|
286
|
+
if (matchingCells.length > 0) {
|
|
287
|
+
const { y, x } = a2p(matchingCells[matchingCellIndex]);
|
|
288
|
+
updateStyle(
|
|
289
|
+
{ y, x },
|
|
290
|
+
{
|
|
291
|
+
borderLeft: SEARCH_MATCHING_BORDER,
|
|
292
|
+
borderRight: SEARCH_MATCHING_BORDER,
|
|
293
|
+
borderTop: SEARCH_MATCHING_BORDER,
|
|
294
|
+
borderBottom: SEARCH_MATCHING_BORDER
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
updateStyle({ y, x: x - 1 }, { borderRight: SEARCH_MATCHING_BORDER });
|
|
298
|
+
updateStyle({ y, x: x + 1 }, { borderLeft: SEARCH_MATCHING_BORDER });
|
|
299
|
+
updateStyle({ y: y - 1, x }, { borderBottom: SEARCH_MATCHING_BORDER });
|
|
300
|
+
updateStyle({ y: y + 1, x }, { borderTop: SEARCH_MATCHING_BORDER });
|
|
301
|
+
}
|
|
302
|
+
return cellStyles;
|
|
303
|
+
};
|
|
304
|
+
export {
|
|
305
|
+
Tabular,
|
|
306
|
+
createTableRef
|
|
307
|
+
};
|
|
308
|
+
//# sourceMappingURL=Tabular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabular.js","sources":["../../components/Tabular.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Cell } from './Cell';\nimport { HeaderCellTop } from './HeaderCellTop';\nimport { HeaderCellLeft } from './HeaderCellLeft';\n\nimport { Context } from '../store';\nimport { choose, select, setEntering, updateTable, setInputting } from '../store/actions';\n\nimport { Table } from '../lib/table';\nimport { RefPaletteType, PointType, StoreType, TableRef, Virtualization } from '../types';\nimport { virtualize } from '../lib/virtualization';\nimport { a2p, p2a, stripAddressAbsolute } from '../lib/converters';\nimport { zoneToArea } from '../lib/structs';\nimport { Lexer } from '../formula/evaluator';\nimport { REF_PALETTE } from '../lib/palette';\nimport { useSheetContext } from './SheetProvider';\nimport { Autofill } from '../lib/autofill';\n\ntype Props = {\n tableRef: React.MutableRefObject<TableRef | null> | undefined;\n};\n\nexport const createTableRef = () => React.useRef<TableRef | null>(null);\n\nexport const Tabular = ({ tableRef }: Props) => {\n const [refs, setRefs] = React.useState<RefPaletteType>({});\n const [, { externalRefs = {}, setExternalRefs }] = useSheetContext();\n const { store, dispatch } = React.useContext(Context);\n const {\n sheetHeight,\n table,\n tableInitialized,\n tabularRef,\n mainRef,\n headerWidth,\n headerHeight,\n editingCell,\n inputting,\n } = store;\n\n React.useEffect(() => {\n if (editingCell && inputting.startsWith('=')) {\n const refs: RefPaletteType = {};\n const externalRefs: { [sheetName: string]: RefPaletteType } = {};\n const lexer = new Lexer(inputting.substring(1));\n lexer.tokenize();\n\n let i = 0;\n for (const token of lexer.tokens) {\n if (token.type === 'REF' || token.type === 'RANGE') {\n const normalizedRef = stripAddressAbsolute(token.stringify());\n if (normalizedRef.includes('!')) {\n const [sheetName, ref] = normalizedRef.split('!');\n const upperRef = ref.toUpperCase();\n if (externalRefs[sheetName] == null) {\n externalRefs[sheetName] = {};\n }\n if (externalRefs[sheetName][upperRef] == null) {\n externalRefs[sheetName][upperRef] = i++;\n }\n } else {\n const upperRef = normalizedRef.toUpperCase();\n if (refs[upperRef] == null) {\n refs[upperRef] = i++;\n }\n }\n }\n }\n setRefs(refs);\n setExternalRefs?.(externalRefs);\n } else {\n setRefs({});\n setExternalRefs?.({});\n }\n }, [store.inputting, store.editingCell]);\n\n React.useEffect(() => {\n if (tableRef && tableInitialized) {\n tableRef.current = {\n table,\n dispatch: (table) => {\n dispatch(updateTable(table as Table));\n },\n };\n }\n }, [table]);\n React.useEffect(() => {\n const v = table.stringify(store.choosing);\n dispatch(setInputting(v || ''));\n }, [table, store.choosing]);\n const [virtualized, setVirtualized] = React.useState<Virtualization | null>(null);\n React.useEffect(() => {\n setVirtualized(virtualize(table, tabularRef.current));\n }, [tabularRef.current, table, mainRef.current?.clientHeight, mainRef.current?.clientWidth]);\n\n const operationStyles = useOperationStyles(store, { ...refs, ...externalRefs[table.sheetName] });\n\n return (\n <>\n <div\n className=\"gs-tabular\"\n style={{\n //width: sheetWidth,\n height: sheetHeight,\n }}\n ref={tabularRef}\n onMouseEnter={() => {\n dispatch(setEntering(true));\n }}\n onMouseLeave={() => {\n dispatch(setEntering(false));\n }}\n onScroll={(e) => {\n setVirtualized(virtualize(table, e.currentTarget));\n }}\n >\n <div\n className={'gs-tabular-inner'}\n style={{\n width: table.totalWidth + 1,\n height: table.totalHeight + 1,\n }}\n >\n <table\n className={`gs-table`}\n style={{\n width: table.totalWidth,\n }}\n >\n <thead className=\"gs-thead\" style={{ height: headerHeight }}>\n <tr className=\"gs-row\">\n <th\n className=\"gs-th gs-th-left gs-th-top\"\n style={{ position: 'sticky', width: headerWidth, height: headerHeight }}\n onClick={() => {\n dispatch(choose({ y: -1, x: -1 }));\n window.setTimeout(() => {\n dispatch(choose({ y: 1, x: 1 }));\n dispatch(\n select({\n startY: 1,\n startX: 1,\n endY: table.getNumRows(),\n endX: table.getNumCols(),\n }),\n );\n }, 100);\n }}\n >\n <div className=\"gs-th-inner\"></div>\n </th>\n <th\n className=\"gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left\"\n style={{ width: virtualized?.adjuster?.left || 1 }}\n ></th>\n {virtualized?.xs?.map?.((x) => <HeaderCellTop x={x} key={x} />)}\n <th\n className=\"gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right\"\n style={{ width: virtualized?.adjuster?.right }}\n ></th>\n </tr>\n </thead>\n\n <tbody className=\"gs-table-body-adjuster\">\n <tr className=\"gs-row\">\n <th\n className={`gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`}\n style={{ height: virtualized?.adjuster?.top || 1 }}\n ></th>\n <td className=\"gs-adjuster gs-adjuster-vertical\"></td>\n {virtualized?.xs?.map((x) => <td className=\"gs-adjuster gs-adjuster-vertical\" key={x}></td>)}\n <th className={`gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`}></th>\n </tr>\n </tbody>\n\n <tbody className=\"gs-table-body-data\">\n {virtualized?.ys?.map((y) => {\n return (\n <tr key={y} className=\"gs-row\">\n <HeaderCellLeft y={y} />\n <td className=\"gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left\" />\n {virtualized?.xs?.map((x) => (\n <Cell key={x} y={y} x={x} operationStyle={operationStyles[p2a({ y, x })]} />\n ))}\n <td className=\"gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right\" />\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n </div>\n </>\n );\n};\n\nconst BORDER_POINTED = 'solid 2px #0077ff';\nconst BORDER_SELECTED = 'solid 1px #0077ff';\nconst BORDER_CUTTING = 'dotted 2px #0077ff';\nconst BORDER_COPYING = 'dashed 2px #0077ff';\nconst SEARCH_MATCHING_BACKGROUND = 'rgba(0,200,100,.2)';\nconst SEARCH_MATCHING_BORDER = 'solid 2px #00aa78';\nconst AUTOFILL_BORDER = 'dashed 1px #444444';\n\nconst useOperationStyles = (store: StoreType, refs: RefPaletteType) => {\n const cellStyles: { [key: string]: React.CSSProperties } = {};\n const updateStyle = (point: PointType, style: React.CSSProperties) => {\n const address = p2a(point);\n cellStyles[address] = cellStyles[address] || {};\n Object.assign(cellStyles[address], style);\n };\n const { choosing, selectingZone, copyingZone, cutting, matchingCells, matchingCellIndex, table, autofillDraggingTo } =\n store;\n {\n // selecting\n const { top, left, bottom, right } = zoneToArea(selectingZone);\n for (let y = top; y <= bottom; y++) {\n updateStyle({ y, x: left - 1 }, { borderRight: BORDER_SELECTED });\n updateStyle({ y, x: left }, { borderLeft: BORDER_SELECTED });\n updateStyle({ y, x: right }, { borderRight: BORDER_SELECTED });\n updateStyle({ y, x: right + 1 }, { borderLeft: BORDER_SELECTED });\n }\n for (let x = left; x <= right; x++) {\n updateStyle({ y: top - 1, x }, { borderBottom: BORDER_SELECTED });\n updateStyle({ y: top, x }, { borderTop: BORDER_SELECTED });\n updateStyle({ y: bottom, x }, { borderBottom: BORDER_SELECTED });\n updateStyle({ y: bottom + 1, x }, { borderTop: BORDER_SELECTED });\n }\n }\n if (autofillDraggingTo) {\n const autofill = new Autofill(store, autofillDraggingTo);\n const { top, left, bottom, right } = autofill.wholeArea;\n for (let y = top; y <= bottom; y++) {\n updateStyle({ y, x: left - 1 }, { borderRight: AUTOFILL_BORDER });\n updateStyle({ y, x: left }, { borderLeft: AUTOFILL_BORDER });\n updateStyle({ y, x: right }, { borderRight: AUTOFILL_BORDER });\n updateStyle({ y, x: right + 1 }, { borderLeft: AUTOFILL_BORDER });\n }\n for (let x = left; x <= right; x++) {\n updateStyle({ y: top - 1, x }, { borderBottom: AUTOFILL_BORDER });\n updateStyle({ y: top, x }, { borderTop: AUTOFILL_BORDER });\n updateStyle({ y: bottom, x }, { borderBottom: AUTOFILL_BORDER });\n updateStyle({ y: bottom + 1, x }, { borderTop: AUTOFILL_BORDER });\n }\n }\n {\n // choosing\n const { y, x } = choosing;\n updateStyle(\n { y, x },\n {\n borderLeft: BORDER_POINTED,\n borderRight: BORDER_POINTED,\n borderTop: BORDER_POINTED,\n borderBottom: BORDER_POINTED,\n },\n );\n updateStyle({ y, x: x - 1 }, { borderRight: BORDER_POINTED });\n updateStyle({ y, x: x + 1 }, { borderLeft: BORDER_POINTED });\n updateStyle({ y: y - 1, x }, { borderBottom: BORDER_POINTED });\n updateStyle({ y: y + 1, x }, { borderTop: BORDER_POINTED });\n }\n {\n // copying\n const borderStyle = cutting ? BORDER_CUTTING : BORDER_COPYING;\n const { top, left, bottom, right } = zoneToArea(copyingZone);\n for (let y = top; y <= bottom; y++) {\n updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });\n updateStyle({ y, x: left }, { borderLeft: borderStyle });\n updateStyle({ y, x: right }, { borderRight: borderStyle });\n updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });\n }\n for (let x = left; x <= right; x++) {\n updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });\n updateStyle({ y: top, x }, { borderTop: borderStyle });\n updateStyle({ y: bottom, x }, { borderBottom: borderStyle });\n updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });\n }\n }\n\n Object.entries(refs).forEach(([ref, i]) => {\n const palette = REF_PALETTE[i % REF_PALETTE.length];\n const borderStyle = `dashed 2px ${palette}`;\n const { top, left, bottom, right } = table.rangeToArea(ref);\n for (let y = top; y <= bottom; y++) {\n updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });\n updateStyle({ y, x: left }, { borderLeft: borderStyle });\n updateStyle({ y, x: right }, { borderRight: borderStyle });\n updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });\n }\n for (let x = left; x <= right; x++) {\n updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });\n updateStyle({ y: top, x }, { borderTop: borderStyle });\n updateStyle({ y: bottom, x }, { borderBottom: borderStyle });\n updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });\n }\n });\n matchingCells.forEach((address) => {\n const { y, x } = a2p(address);\n updateStyle({ y, x }, { backgroundColor: SEARCH_MATCHING_BACKGROUND });\n });\n if (matchingCells.length > 0) {\n const { y, x } = a2p(matchingCells[matchingCellIndex]);\n updateStyle(\n { y, x },\n {\n borderLeft: SEARCH_MATCHING_BORDER,\n borderRight: SEARCH_MATCHING_BORDER,\n borderTop: SEARCH_MATCHING_BORDER,\n borderBottom: SEARCH_MATCHING_BORDER,\n },\n );\n updateStyle({ y, x: x - 1 }, { borderRight: SEARCH_MATCHING_BORDER });\n updateStyle({ y, x: x + 1 }, { borderLeft: SEARCH_MATCHING_BORDER });\n updateStyle({ y: y - 1, x }, { borderBottom: SEARCH_MATCHING_BORDER });\n updateStyle({ y: y + 1, x }, { borderTop: SEARCH_MATCHING_BORDER });\n }\n return cellStyles;\n};\n"],"names":["React","refs","externalRefs","table","_a"],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,iBAAiB,MAAMA,eAAM,OAAwB,IAAI;AAE/D,MAAM,UAAU,CAAC,EAAE,eAAsB;;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAIA,eAAM,SAAyB,CAAA,CAAE;AACnD,QAAA,CAAA,EAAG,EAAE,eAAe,CAAA,GAAI,gBAAiB,CAAA,IAAI,gBAAgB;AACnE,QAAM,EAAE,OAAO,SAAA,IAAaA,eAAM,WAAW,OAAO;AAC9C,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEJA,iBAAM,UAAU,MAAM;AACpB,QAAI,eAAe,UAAU,WAAW,GAAG,GAAG;AAC5C,YAAMC,QAAuB,CAAC;AAC9B,YAAMC,gBAAwD,CAAC;AAC/D,YAAM,QAAQ,IAAI,MAAM,UAAU,UAAU,CAAC,CAAC;AAC9C,YAAM,SAAS;AAEf,UAAI,IAAI;AACG,iBAAA,SAAS,MAAM,QAAQ;AAChC,YAAI,MAAM,SAAS,SAAS,MAAM,SAAS,SAAS;AAClD,gBAAM,gBAAgB,qBAAqB,MAAM,UAAA,CAAW;AACxD,cAAA,cAAc,SAAS,GAAG,GAAG;AAC/B,kBAAM,CAAC,WAAW,GAAG,IAAI,cAAc,MAAM,GAAG;AAC1C,kBAAA,WAAW,IAAI,YAAY;AAC7BA,gBAAAA,cAAa,SAAS,KAAK,MAAM;AACnCA,4BAAa,SAAS,IAAI,CAAC;AAAA,YAAA;AAE7B,gBAAIA,cAAa,SAAS,EAAE,QAAQ,KA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AAa;AAC7C,kBAAA,EAAE,GAAG,GAAG,QAAQ,KAAK,EAAE,YAAY,aAAa;AAAA,IAAA;AAE9D,aAAS,IAAI,MAAM,KAAK,OAAO,KAAK;AACtB,kBAAA,EAAE,GAAG,MAAM,GAAG,KAAK,EAAE,cAAc,aAAa;AAChD,kBAAA,EAAE,GAAG,KAAK,EAAA,GAAK,EAAE,WAAW,aAAa;AACzC,kBAAA,EAAE,GAAG,QAAQ,EAAA,GAAK,EAAE,cAAc,aAAa;AAC/C,kBAAA,EAAE,GAAG,SAAS,GAAG,KAAK,EAAE,WAAW,aAAa;AAAA,IAAA;AAAA,EAC9D,CACD;AACa,gBAAA,QAAQ,CAAC,YAAY;AACjC,UAAM,EAAE,GAAG,MAAM,IAAI,OAAO;AAC5B,gBAAY,EAAE,GAAG,KAAK,EAAE,iBAAiB,4BAA4B;AAAA,EAAA,CACtE;AACG,MAAA,cAAc,SAAS,GAAG;AAC5B,UAAM,EAAE,GAAG,EAAA,IAAM,IAAI,cAAc,iBAAiB,CAAC;AACrD;AAAA,MACE,EAAE,GAAG,EAAE;AAAA,MACP;AAAA,QACE,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,WAAW;AAAA,QACX,cAAc;AAAA,MAAA;AAAA,IAElB;AACY,gBAAA,EAAE,GAAG,GAAG,IAAI,KAAK,EAAE,aAAa,wBAAwB;AACxD,gBAAA,EAAE,GAAG,GAAG,IAAI,KAAK,EAAE,YAAY,wBAAwB;AACvD,gBAAA,EAAE,GAAG,IAAI,GAAG,KAAK,EAAE,cAAc,wBAAwB;AACzD,gBAAA,EAAE,GAAG,IAAI,GAAG,KAAK,EAAE,WAAW,wBAAwB;AAAA,EAAA;AAE7D,SAAA;AACT;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React__default from "react";
|
|
2
|
+
const useBrowser = () => {
|
|
3
|
+
const [ok, setOk] = React__default.useState(false);
|
|
4
|
+
React__default.useEffect(() => {
|
|
5
|
+
setOk(true);
|
|
6
|
+
});
|
|
7
|
+
if (ok && typeof window !== "undefined") {
|
|
8
|
+
return { window, document };
|
|
9
|
+
}
|
|
10
|
+
return { window: null, document: null };
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
useBrowser
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":["../../components/hooks.ts"],"sourcesContent":["import React from 'react';\n\n// Return the document object with SSR.\nexport const useBrowser = () => {\n const [ok, setOk] = React.useState(false);\n React.useEffect(() => {\n setOk(true);\n });\n if (ok && typeof window !== 'undefined') {\n return { window, document };\n }\n return { window: null, document: null };\n};\n"],"names":["React"],"mappings":";AAGO,MAAM,aAAa,MAAM;AAC9B,QAAM,CAAC,IAAI,KAAK,IAAIA,eAAM,SAAS,KAAK;AACxCA,iBAAM,UAAU,MAAM;AACpB,UAAM,IAAI;AAAA,EAAA,CACX;AACG,MAAA,MAAM,OAAO,WAAW,aAAa;AAChC,WAAA,EAAE,QAAQ,SAAS;AAAA,EAAA;AAE5B,SAAO,EAAE,QAAQ,MAAM,UAAU,KAAK;AACxC;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const Base = ({ style, size = 24, children }) => {
|
|
3
|
+
return /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: size,
|
|
8
|
+
height: size,
|
|
9
|
+
viewBox: `0 0 24 24`,
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
style,
|
|
16
|
+
className: "icon-tabler",
|
|
17
|
+
children
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
Base
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sources":["../../../components/svg/Base.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface IconProps {\n style?: React.CSSProperties;\n color?: string;\n size?: number;\n}\n\ninterface BaseProps extends IconProps {\n children?: React.ReactNode;\n}\n\n// https://tabler.io/icons\n\nexport const Base = ({ style, size = 24, children }: BaseProps) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox={`0 0 24 24`}\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n style={style}\n className=\"icon-tabler\"\n >\n {children}\n </svg>\n );\n};\n"],"names":[],"mappings":";AAcO,MAAM,OAAO,CAAC,EAAE,OAAO,OAAO,IAAI,eAA0B;AAE/D,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAK;AAAA,MACL,QAAO;AAAA,MACP,gBAAa;AAAA,MACb,kBAAe;AAAA,MACf,mBAAgB;AAAA,MAChB;AAAA,MACA,WAAU;AAAA,MAET;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Base } from "./Base.js";
|
|
3
|
+
const CloseIcon = ({ style, color = "none", size = 24 }) => {
|
|
4
|
+
return /* @__PURE__ */ jsxs(Base, { style, size, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: color }),
|
|
6
|
+
/* @__PURE__ */ jsx("path", { d: "M18 6l-12 12", fill: color }),
|
|
7
|
+
/* @__PURE__ */ jsx("path", { d: "M6 6l12 12", fill: color })
|
|
8
|
+
] });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
CloseIcon
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=CloseIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloseIcon.js","sources":["../../../components/svg/CloseIcon.tsx"],"sourcesContent":["import React from 'react';\nimport { type IconProps, Base } from './Base';\n\n// https://tabler.io/icons\n\nexport const CloseIcon = ({ style, color = 'none', size = 24 }: IconProps) => {\n return (\n <Base style={style} size={size}>\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill={color} />\n <path d=\"M18 6l-12 12\" fill={color} />\n <path d=\"M6 6l12 12\" fill={color} />\n </Base>\n );\n};\n"],"names":[],"mappings":";;AAKa,MAAA,YAAY,CAAC,EAAE,OAAO,QAAQ,QAAQ,OAAO,SAAoB;AAE1E,SAAA,qBAAC,MAAK,EAAA,OAAc,MAClB,UAAA;AAAA,IAAA,oBAAC,UAAK,QAAO,QAAO,GAAE,iBAAgB,MAAM,OAAO;AAAA,IAClD,oBAAA,QAAA,EAAK,GAAE,gBAAe,MAAM,OAAO;AAAA,IACnC,oBAAA,QAAA,EAAK,GAAE,cAAa,MAAM,MAAO,CAAA;AAAA,EAAA,GACpC;AAEJ;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Base } from "./Base.js";
|
|
3
|
+
const SearchIcon = ({ style, color = "none", size = 24 }) => {
|
|
4
|
+
return /* @__PURE__ */ jsxs(Base, { style, size, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: color }),
|
|
6
|
+
/* @__PURE__ */ jsx("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", fill: color }),
|
|
7
|
+
/* @__PURE__ */ jsx("path", { d: "M21 21l-6 -6", fill: color })
|
|
8
|
+
] });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
SearchIcon
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=SearchIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchIcon.js","sources":["../../../components/svg/SearchIcon.tsx"],"sourcesContent":["import React from 'react';\nimport { type IconProps, Base } from './Base';\n\n// https://tabler.io/icons\n\nexport const SearchIcon = ({ style, color = 'none', size = 24 }: IconProps) => {\n return (\n <Base style={style} size={size}>\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill={color} />\n <path d=\"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\" fill={color} />\n <path d=\"M21 21l-6 -6\" fill={color} />\n </Base>\n );\n};\n"],"names":[],"mappings":";;AAKa,MAAA,aAAa,CAAC,EAAE,OAAO,QAAQ,QAAQ,OAAO,SAAoB;AAE3E,SAAA,qBAAC,MAAK,EAAA,OAAc,MAClB,UAAA;AAAA,IAAA,oBAAC,UAAK,QAAO,QAAO,GAAE,iBAAgB,MAAM,OAAO;AAAA,IAClD,oBAAA,QAAA,EAAK,GAAE,8CAA6C,MAAM,OAAO;AAAA,IACjE,oBAAA,QAAA,EAAK,GAAE,gBAAe,MAAM,MAAO,CAAA;AAAA,EAAA,GACtC;AAEJ;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const IMG_BASE64 = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
2
|
+
const DUMMY_IMG = typeof window === "undefined" ? null : document.createElement("img");
|
|
3
|
+
if (DUMMY_IMG) {
|
|
4
|
+
DUMMY_IMG.src = IMG_BASE64;
|
|
5
|
+
}
|
|
6
|
+
const HISTORY_LIMIT = 10;
|
|
7
|
+
const DEFAULT_HEIGHT = 24;
|
|
8
|
+
const DEFAULT_WIDTH = 90;
|
|
9
|
+
const SHEET_HEIGHT = 500;
|
|
10
|
+
const SHEET_WIDTH = 1e3;
|
|
11
|
+
const HEADER_HEIGHT = 24;
|
|
12
|
+
const HEADER_WIDTH = 50;
|
|
13
|
+
const MIN_WIDTH = 5;
|
|
14
|
+
const MIN_HEIGHT = 5;
|
|
15
|
+
const OVERSCAN_X = 5;
|
|
16
|
+
const OVERSCAN_Y = 10;
|
|
17
|
+
const DEFAULT_ALPHABET_CACHE_SIZE = 1e3;
|
|
18
|
+
class Special {
|
|
19
|
+
constructor(name) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const SECONDS_IN_DAY = 86400;
|
|
24
|
+
const FULLDATE_FORMAT_UTC = "YYYY-MM-DDTHH:mm:ss.SSSZ";
|
|
25
|
+
export {
|
|
26
|
+
DEFAULT_ALPHABET_CACHE_SIZE,
|
|
27
|
+
DEFAULT_HEIGHT,
|
|
28
|
+
DEFAULT_WIDTH,
|
|
29
|
+
DUMMY_IMG,
|
|
30
|
+
FULLDATE_FORMAT_UTC,
|
|
31
|
+
HEADER_HEIGHT,
|
|
32
|
+
HEADER_WIDTH,
|
|
33
|
+
HISTORY_LIMIT,
|
|
34
|
+
MIN_HEIGHT,
|
|
35
|
+
MIN_WIDTH,
|
|
36
|
+
OVERSCAN_X,
|
|
37
|
+
OVERSCAN_Y,
|
|
38
|
+
SECONDS_IN_DAY,
|
|
39
|
+
SHEET_HEIGHT,
|
|
40
|
+
SHEET_WIDTH,
|
|
41
|
+
Special
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../constants.ts"],"sourcesContent":["const IMG_BASE64 = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\nexport const DUMMY_IMG = (typeof window === 'undefined' ? null : document.createElement('img')) as HTMLImageElement;\n\nif (DUMMY_IMG) {\n DUMMY_IMG.src = IMG_BASE64;\n}\n\nexport const HISTORY_LIMIT = 10;\n\nexport const DEFAULT_HEIGHT = 24;\nexport const DEFAULT_WIDTH = 90;\n\nexport const SHEET_HEIGHT = 500;\nexport const SHEET_WIDTH = 1000;\n\nexport const HEADER_HEIGHT = 24;\nexport const HEADER_WIDTH = 50;\n\nexport const MIN_WIDTH = 5;\nexport const MIN_HEIGHT = 5;\n\nexport const OVERSCAN_X = 5;\nexport const OVERSCAN_Y = 10;\n\nexport const DEFAULT_ALPHABET_CACHE_SIZE = 1000;\n\nexport class Special {\n public name: string;\n constructor(name: string) {\n this.name = name;\n }\n}\n\nexport const SECONDS_IN_DAY = 86400;\nexport const FULLDATE_FORMAT_UTC = 'YYYY-MM-DDTHH:mm:ss.SSSZ';\n"],"names":[],"mappings":"AAAA,MAAM,aAAa;AAEZ,MAAM,YAAa,OAAO,WAAW,cAAc,OAAO,SAAS,cAAc,KAAK;AAE7F,IAAI,WAAW;AACb,YAAU,MAAM;AAClB;AAEO,MAAM,gBAAgB;AAEtB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AAEtB,MAAM,eAAe;AACrB,MAAM,cAAc;AAEpB,MAAM,gBAAgB;AACtB,MAAM,eAAe;AAErB,MAAM,YAAY;AAClB,MAAM,aAAa;AAEnB,MAAM,aAAa;AACnB,MAAM,aAAa;AAEnB,MAAM,8BAA8B;AAEpC,MAAM,QAAQ;AAAA,EAEnB,YAAY,MAAc;AACxB,SAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAM,iBAAiB;AACvB,MAAM,sBAAsB;"}
|