@gridsheet/react-core 0.12.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +84 -0
- package/dist/components/Cell.d.ts +8 -0
- package/dist/components/Cell.d.ts.map +1 -0
- package/dist/components/Cell.js +195 -0
- package/dist/components/Cell.js.map +1 -0
- package/dist/components/ContextMenu.d.ts +3 -0
- package/dist/components/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu.js +207 -0
- package/dist/components/ContextMenu.js.map +1 -0
- package/dist/components/Editor.d.ts +3 -0
- package/dist/components/Editor.d.ts.map +1 -0
- package/dist/components/Editor.js +304 -0
- package/dist/components/Editor.js.map +1 -0
- package/dist/components/Emitter.d.ts +9 -0
- package/dist/components/Emitter.d.ts.map +1 -0
- package/dist/components/Emitter.js +26 -0
- package/dist/components/Emitter.js.map +1 -0
- package/dist/components/GridSheet.d.ts +4 -0
- package/dist/components/GridSheet.d.ts.map +1 -0
- package/dist/components/GridSheet.js +110 -0
- package/dist/components/GridSheet.js.map +1 -0
- package/dist/components/HeaderLeftCell.d.ts +7 -0
- package/dist/components/HeaderLeftCell.d.ts.map +1 -0
- package/dist/components/HeaderLeftCell.js +67 -0
- package/dist/components/HeaderLeftCell.js.map +1 -0
- package/dist/components/HeaderTopCell.d.ts +7 -0
- package/dist/components/HeaderTopCell.d.ts.map +1 -0
- package/dist/components/HeaderTopCell.js +68 -0
- package/dist/components/HeaderTopCell.js.map +1 -0
- package/dist/components/Resizer.d.ts +3 -0
- package/dist/components/Resizer.d.ts.map +1 -0
- package/dist/components/Resizer.js +83 -0
- package/dist/components/Resizer.js.map +1 -0
- package/dist/components/SearchBox.d.ts +3 -0
- package/dist/components/SearchBox.d.ts.map +1 -0
- package/dist/components/SearchBox.js +52 -0
- package/dist/components/SearchBox.js.map +1 -0
- package/dist/components/StoreInitializer.d.ts +4 -0
- package/dist/components/StoreInitializer.d.ts.map +1 -0
- package/dist/components/StoreInitializer.js +68 -0
- package/dist/components/StoreInitializer.js.map +1 -0
- package/dist/components/Tabular.d.ts +9 -0
- package/dist/components/Tabular.d.ts.map +1 -0
- package/dist/components/Tabular.js +84 -0
- package/dist/components/Tabular.js.map +1 -0
- package/dist/constants.d.ts +18 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +21 -0
- package/dist/constants.js.map +1 -0
- package/dist/formula/evaluator.d.ts +91 -0
- package/dist/formula/evaluator.d.ts.map +1 -0
- package/dist/formula/evaluator.js +541 -0
- package/dist/formula/evaluator.js.map +1 -0
- package/dist/formula/functions/__base.d.ts +23 -0
- package/dist/formula/functions/__base.d.ts.map +1 -0
- package/dist/formula/functions/__base.js +16 -0
- package/dist/formula/functions/__base.js.map +1 -0
- package/dist/formula/functions/__utils.d.ts +6 -0
- package/dist/formula/functions/__utils.d.ts.map +1 -0
- package/dist/formula/functions/__utils.js +102 -0
- package/dist/formula/functions/__utils.js.map +1 -0
- package/dist/formula/functions/abs.d.ts +12 -0
- package/dist/formula/functions/abs.d.ts.map +1 -0
- package/dist/formula/functions/abs.js +21 -0
- package/dist/formula/functions/abs.js.map +1 -0
- package/dist/formula/functions/abs.spec.d.ts +2 -0
- package/dist/formula/functions/abs.spec.d.ts.map +1 -0
- package/dist/formula/functions/abs.spec.js +29 -0
- package/dist/formula/functions/abs.spec.js.map +1 -0
- package/dist/formula/functions/acos.d.ts +12 -0
- package/dist/formula/functions/acos.d.ts.map +1 -0
- package/dist/formula/functions/acos.js +29 -0
- package/dist/formula/functions/acos.js.map +1 -0
- package/dist/formula/functions/add.d.ts +13 -0
- package/dist/formula/functions/add.d.ts.map +1 -0
- package/dist/formula/functions/add.js +50 -0
- package/dist/formula/functions/add.js.map +1 -0
- package/dist/formula/functions/and.d.ts +19 -0
- package/dist/formula/functions/and.d.ts.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.d.ts +12 -0
- package/dist/formula/functions/asin.d.ts.map +1 -0
- package/dist/formula/functions/asin.js +29 -0
- package/dist/formula/functions/asin.js.map +1 -0
- package/dist/formula/functions/atan.d.ts +12 -0
- package/dist/formula/functions/atan.d.ts.map +1 -0
- package/dist/formula/functions/atan.js +26 -0
- package/dist/formula/functions/atan.js.map +1 -0
- package/dist/formula/functions/atan2.d.ts +12 -0
- package/dist/formula/functions/atan2.d.ts.map +1 -0
- package/dist/formula/functions/atan2.js +32 -0
- package/dist/formula/functions/atan2.js.map +1 -0
- package/dist/formula/functions/average.d.ts +19 -0
- package/dist/formula/functions/average.d.ts.map +1 -0
- package/dist/formula/functions/average.js +41 -0
- package/dist/formula/functions/average.js.map +1 -0
- package/dist/formula/functions/col.d.ts +14 -0
- package/dist/formula/functions/col.d.ts.map +1 -0
- package/dist/formula/functions/col.js +30 -0
- package/dist/formula/functions/col.js.map +1 -0
- package/dist/formula/functions/concat.d.ts +12 -0
- package/dist/formula/functions/concat.d.ts.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.d.ts +19 -0
- package/dist/formula/functions/concatenate.d.ts.map +1 -0
- package/dist/formula/functions/concatenate.js +25 -0
- package/dist/formula/functions/concatenate.js.map +1 -0
- package/dist/formula/functions/cos.d.ts +12 -0
- package/dist/formula/functions/cos.d.ts.map +1 -0
- package/dist/formula/functions/cos.js +26 -0
- package/dist/formula/functions/cos.js.map +1 -0
- package/dist/formula/functions/count.d.ts +19 -0
- package/dist/formula/functions/count.d.ts.map +1 -0
- package/dist/formula/functions/count.js +35 -0
- package/dist/formula/functions/count.js.map +1 -0
- package/dist/formula/functions/counta.d.ts +19 -0
- package/dist/formula/functions/counta.d.ts.map +1 -0
- package/dist/formula/functions/counta.js +35 -0
- package/dist/formula/functions/counta.js.map +1 -0
- package/dist/formula/functions/countif.d.ts +13 -0
- package/dist/formula/functions/countif.d.ts.map +1 -0
- package/dist/formula/functions/countif.js +30 -0
- package/dist/formula/functions/countif.js.map +1 -0
- package/dist/formula/functions/divide.d.ts +12 -0
- package/dist/formula/functions/divide.d.ts.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.d.ts +12 -0
- package/dist/formula/functions/eq.d.ts.map +1 -0
- package/dist/formula/functions/eq.js +25 -0
- package/dist/formula/functions/eq.js.map +1 -0
- package/dist/formula/functions/exp.d.ts +12 -0
- package/dist/formula/functions/exp.d.ts.map +1 -0
- package/dist/formula/functions/exp.js +28 -0
- package/dist/formula/functions/exp.js.map +1 -0
- package/dist/formula/functions/gt.d.ts +12 -0
- package/dist/formula/functions/gt.d.ts.map +1 -0
- package/dist/formula/functions/gt.js +27 -0
- package/dist/formula/functions/gt.js.map +1 -0
- package/dist/formula/functions/gte.d.ts +12 -0
- package/dist/formula/functions/gte.d.ts.map +1 -0
- package/dist/formula/functions/gte.js +27 -0
- package/dist/formula/functions/gte.js.map +1 -0
- package/dist/formula/functions/hlookup.d.ts +18 -0
- package/dist/formula/functions/hlookup.d.ts.map +1 -0
- package/dist/formula/functions/hlookup.js +74 -0
- package/dist/formula/functions/hlookup.js.map +1 -0
- package/dist/formula/functions/if.d.ts +17 -0
- package/dist/formula/functions/if.d.ts.map +1 -0
- package/dist/formula/functions/if.js +36 -0
- package/dist/formula/functions/if.js.map +1 -0
- package/dist/formula/functions/iferror.d.ts +20 -0
- package/dist/formula/functions/iferror.d.ts.map +1 -0
- package/dist/formula/functions/iferror.js +41 -0
- package/dist/formula/functions/iferror.js.map +1 -0
- package/dist/formula/functions/iferror.spec.d.ts +2 -0
- package/dist/formula/functions/iferror.spec.d.ts.map +1 -0
- package/dist/formula/functions/iferror.spec.js +61 -0
- package/dist/formula/functions/iferror.spec.js.map +1 -0
- package/dist/formula/functions/len.d.ts +12 -0
- package/dist/formula/functions/len.d.ts.map +1 -0
- package/dist/formula/functions/len.js +26 -0
- package/dist/formula/functions/len.js.map +1 -0
- package/dist/formula/functions/lenb.d.ts +12 -0
- package/dist/formula/functions/lenb.d.ts.map +1 -0
- package/dist/formula/functions/lenb.js +26 -0
- package/dist/formula/functions/lenb.js.map +1 -0
- package/dist/formula/functions/ln.d.ts +12 -0
- package/dist/formula/functions/ln.d.ts.map +1 -0
- package/dist/formula/functions/ln.js +29 -0
- package/dist/formula/functions/ln.js.map +1 -0
- package/dist/formula/functions/log.d.ts +12 -0
- package/dist/formula/functions/log.d.ts.map +1 -0
- package/dist/formula/functions/log.js +35 -0
- package/dist/formula/functions/log.js.map +1 -0
- package/dist/formula/functions/log10.d.ts +12 -0
- package/dist/formula/functions/log10.d.ts.map +1 -0
- package/dist/formula/functions/log10.js +29 -0
- package/dist/formula/functions/log10.js.map +1 -0
- package/dist/formula/functions/lt.d.ts +12 -0
- package/dist/formula/functions/lt.d.ts.map +1 -0
- package/dist/formula/functions/lt.js +27 -0
- package/dist/formula/functions/lt.js.map +1 -0
- package/dist/formula/functions/lte.d.ts +12 -0
- package/dist/formula/functions/lte.d.ts.map +1 -0
- package/dist/formula/functions/lte.js +27 -0
- package/dist/formula/functions/lte.js.map +1 -0
- package/dist/formula/functions/max.d.ts +19 -0
- package/dist/formula/functions/max.d.ts.map +1 -0
- package/dist/formula/functions/max.js +44 -0
- package/dist/formula/functions/max.js.map +1 -0
- package/dist/formula/functions/min.d.ts +19 -0
- package/dist/formula/functions/min.d.ts.map +1 -0
- package/dist/formula/functions/min.js +44 -0
- package/dist/formula/functions/min.js.map +1 -0
- package/dist/formula/functions/minus.d.ts +13 -0
- package/dist/formula/functions/minus.d.ts.map +1 -0
- package/dist/formula/functions/minus.js +50 -0
- package/dist/formula/functions/minus.js.map +1 -0
- package/dist/formula/functions/mod.d.ts +12 -0
- package/dist/formula/functions/mod.d.ts.map +1 -0
- package/dist/formula/functions/mod.js +31 -0
- package/dist/formula/functions/mod.js.map +1 -0
- package/dist/formula/functions/mod.spec.d.ts +2 -0
- package/dist/formula/functions/mod.spec.d.ts.map +1 -0
- package/dist/formula/functions/mod.spec.js +52 -0
- package/dist/formula/functions/mod.spec.js.map +1 -0
- package/dist/formula/functions/multiply.d.ts +12 -0
- package/dist/formula/functions/multiply.d.ts.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.d.ts +12 -0
- package/dist/formula/functions/ne.d.ts.map +1 -0
- package/dist/formula/functions/ne.js +25 -0
- package/dist/formula/functions/ne.js.map +1 -0
- package/dist/formula/functions/not.d.ts +12 -0
- package/dist/formula/functions/not.d.ts.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.d.ts +9 -0
- package/dist/formula/functions/now.d.ts.map +1 -0
- package/dist/formula/functions/now.js +21 -0
- package/dist/formula/functions/now.js.map +1 -0
- package/dist/formula/functions/or.d.ts +19 -0
- package/dist/formula/functions/or.d.ts.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.d.ts +9 -0
- package/dist/formula/functions/pi.d.ts.map +1 -0
- package/dist/formula/functions/pi.js +19 -0
- package/dist/formula/functions/pi.js.map +1 -0
- package/dist/formula/functions/power.d.ts +12 -0
- package/dist/formula/functions/power.d.ts.map +1 -0
- package/dist/formula/functions/power.js +24 -0
- package/dist/formula/functions/power.js.map +1 -0
- package/dist/formula/functions/product.d.ts +19 -0
- package/dist/formula/functions/product.d.ts.map +1 -0
- package/dist/formula/functions/product.js +37 -0
- package/dist/formula/functions/product.js.map +1 -0
- package/dist/formula/functions/radians.d.ts +12 -0
- package/dist/formula/functions/radians.d.ts.map +1 -0
- package/dist/formula/functions/radians.js +26 -0
- package/dist/formula/functions/radians.js.map +1 -0
- package/dist/formula/functions/rand.d.ts +9 -0
- package/dist/formula/functions/rand.d.ts.map +1 -0
- package/dist/formula/functions/rand.js +19 -0
- package/dist/formula/functions/rand.js.map +1 -0
- package/dist/formula/functions/round.d.ts +17 -0
- package/dist/formula/functions/round.d.ts.map +1 -0
- package/dist/formula/functions/round.js +34 -0
- package/dist/formula/functions/round.js.map +1 -0
- package/dist/formula/functions/rounddown.d.ts +17 -0
- package/dist/formula/functions/rounddown.d.ts.map +1 -0
- package/dist/formula/functions/rounddown.js +34 -0
- package/dist/formula/functions/rounddown.js.map +1 -0
- package/dist/formula/functions/roundup.d.ts +17 -0
- package/dist/formula/functions/roundup.d.ts.map +1 -0
- package/dist/formula/functions/roundup.js +34 -0
- package/dist/formula/functions/roundup.js.map +1 -0
- package/dist/formula/functions/row.d.ts +14 -0
- package/dist/formula/functions/row.d.ts.map +1 -0
- package/dist/formula/functions/row.js +30 -0
- package/dist/formula/functions/row.js.map +1 -0
- package/dist/formula/functions/sin.d.ts +12 -0
- package/dist/formula/functions/sin.d.ts.map +1 -0
- package/dist/formula/functions/sin.js +26 -0
- package/dist/formula/functions/sin.js.map +1 -0
- package/dist/formula/functions/sqrt.d.ts +12 -0
- package/dist/formula/functions/sqrt.d.ts.map +1 -0
- package/dist/formula/functions/sqrt.js +29 -0
- package/dist/formula/functions/sqrt.js.map +1 -0
- package/dist/formula/functions/sum.d.ts +19 -0
- package/dist/formula/functions/sum.d.ts.map +1 -0
- package/dist/formula/functions/sum.js +44 -0
- package/dist/formula/functions/sum.js.map +1 -0
- package/dist/formula/functions/sum.spec.d.ts +2 -0
- package/dist/formula/functions/sum.spec.d.ts.map +1 -0
- package/dist/formula/functions/sum.spec.js +40 -0
- package/dist/formula/functions/sum.spec.js.map +1 -0
- package/dist/formula/functions/sumif.d.ts +18 -0
- package/dist/formula/functions/sumif.d.ts.map +1 -0
- package/dist/formula/functions/sumif.js +59 -0
- package/dist/formula/functions/sumif.js.map +1 -0
- package/dist/formula/functions/tan.d.ts +12 -0
- package/dist/formula/functions/tan.d.ts.map +1 -0
- package/dist/formula/functions/tan.js +26 -0
- package/dist/formula/functions/tan.js.map +1 -0
- package/dist/formula/functions/uminus.d.ts +12 -0
- package/dist/formula/functions/uminus.d.ts.map +1 -0
- package/dist/formula/functions/uminus.js +23 -0
- package/dist/formula/functions/uminus.js.map +1 -0
- package/dist/formula/functions/vlookup.d.ts +18 -0
- package/dist/formula/functions/vlookup.d.ts.map +1 -0
- package/dist/formula/functions/vlookup.js +74 -0
- package/dist/formula/functions/vlookup.js.map +1 -0
- package/dist/formula/mapping.d.ts +114 -0
- package/dist/formula/mapping.d.ts.map +1 -0
- package/dist/formula/mapping.js +114 -0
- package/dist/formula/mapping.js.map +1 -0
- package/dist/formula/solver.d.ts +12 -0
- package/dist/formula/solver.d.ts.map +1 -0
- package/dist/formula/solver.js +64 -0
- package/dist/formula/solver.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/autofill.d.ts +17 -0
- package/dist/lib/autofill.d.ts.map +1 -0
- package/dist/lib/autofill.js +389 -0
- package/dist/lib/autofill.js.map +1 -0
- package/dist/lib/clipboard.d.ts +3 -0
- package/dist/lib/clipboard.d.ts.map +1 -0
- package/dist/lib/clipboard.js +45 -0
- package/dist/lib/clipboard.js.map +1 -0
- package/dist/lib/converters.d.ts +10 -0
- package/dist/lib/converters.d.ts.map +1 -0
- package/dist/lib/converters.js +127 -0
- package/dist/lib/converters.js.map +1 -0
- package/dist/lib/structs.d.ts +60 -0
- package/dist/lib/structs.d.ts.map +1 -0
- package/dist/lib/structs.js +251 -0
- package/dist/lib/structs.js.map +1 -0
- package/dist/lib/table.d.ts +303 -0
- package/dist/lib/table.d.ts.map +1 -0
- package/dist/lib/table.js +989 -0
- package/dist/lib/table.js.map +1 -0
- package/dist/lib/time.d.ts +14 -0
- package/dist/lib/time.d.ts.map +1 -0
- package/dist/lib/time.js +60 -0
- package/dist/lib/time.js.map +1 -0
- package/dist/lib/virtualization.d.ts +30 -0
- package/dist/lib/virtualization.d.ts.map +1 -0
- package/dist/lib/virtualization.js +114 -0
- package/dist/lib/virtualization.js.map +1 -0
- package/dist/parsers/core.d.ts +36 -0
- package/dist/parsers/core.d.ts.map +1 -0
- package/dist/parsers/core.js +123 -0
- package/dist/parsers/core.js.map +1 -0
- package/dist/renderers/checkbox.d.ts +5 -0
- package/dist/renderers/checkbox.d.ts.map +1 -0
- package/dist/renderers/checkbox.js +10 -0
- package/dist/renderers/checkbox.js.map +1 -0
- package/dist/renderers/core.d.ts +48 -0
- package/dist/renderers/core.d.ts.map +1 -0
- package/dist/renderers/core.js +143 -0
- package/dist/renderers/core.js.map +1 -0
- package/dist/renderers/thousand_separator.d.ts +5 -0
- package/dist/renderers/thousand_separator.d.ts.map +1 -0
- package/dist/renderers/thousand_separator.js +14 -0
- package/dist/renderers/thousand_separator.js.map +1 -0
- package/dist/store/actions.d.ts +198 -0
- package/dist/store/actions.d.ts.map +1 -0
- package/dist/store/actions.js +519 -0
- package/dist/store/actions.js.map +1 -0
- package/dist/store/helpers.d.ts +28 -0
- package/dist/store/helpers.d.ts.map +1 -0
- package/dist/store/helpers.js +78 -0
- package/dist/store/helpers.js.map +1 -0
- package/dist/store/index.d.ts +11 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +3 -0
- package/dist/store/index.js.map +1 -0
- package/dist/styles/embedder.d.ts +2 -0
- package/dist/styles/embedder.d.ts.map +1 -0
- package/dist/styles/embedder.js +16 -0
- package/dist/styles/embedder.js.map +1 -0
- package/dist/styles/minified.d.ts +3 -0
- package/dist/styles/minified.d.ts.map +1 -0
- package/dist/styles/minified.js +4 -0
- package/dist/styles/minified.js.map +1 -0
- package/dist/types.d.ts +213 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { DEFAULT_ALPHABET_CACHE_SIZE } from "../constants";
|
|
2
|
+
const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
3
|
+
const N2C_CACHE = new Map();
|
|
4
|
+
const C2N_CACHE = new Map();
|
|
5
|
+
const getColumnLetterFromNumber = (key, cacheSize = DEFAULT_ALPHABET_CACHE_SIZE) => {
|
|
6
|
+
const cached = N2C_CACHE.get(--key);
|
|
7
|
+
if (cached != null) {
|
|
8
|
+
return cached;
|
|
9
|
+
}
|
|
10
|
+
if (key === 0) {
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
let num = key;
|
|
14
|
+
let result = "";
|
|
15
|
+
do {
|
|
16
|
+
result = ALPHABET[--num % 26] + result;
|
|
17
|
+
num = Math.floor(num / 26);
|
|
18
|
+
} while (num > 0);
|
|
19
|
+
N2C_CACHE.set(key, result);
|
|
20
|
+
const it = N2C_CACHE.keys();
|
|
21
|
+
for (let st = it.next(); N2C_CACHE.size > cacheSize; st = it.next()) {
|
|
22
|
+
N2C_CACHE.delete(st.value);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
const getNumberFromColumnLetter = (key, cacheSize = DEFAULT_ALPHABET_CACHE_SIZE) => {
|
|
27
|
+
const cached = C2N_CACHE.get(key);
|
|
28
|
+
if (cached != null) {
|
|
29
|
+
return cached;
|
|
30
|
+
}
|
|
31
|
+
if (key === "") {
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
let alpha = key;
|
|
35
|
+
let result = 0;
|
|
36
|
+
for (let digit = 0; digit < alpha.length; digit++) {
|
|
37
|
+
const a = alpha[alpha.length - digit - 1];
|
|
38
|
+
const num = ALPHABET.indexOf(a) + 1;
|
|
39
|
+
result += Math.pow(ALPHABET.length, digit) * num;
|
|
40
|
+
}
|
|
41
|
+
C2N_CACHE.set(key, result);
|
|
42
|
+
const it = C2N_CACHE.keys();
|
|
43
|
+
for (let st = it.next(); C2N_CACHE.size > cacheSize; st = it.next()) {
|
|
44
|
+
C2N_CACHE.delete(st.value);
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
export const x2c = (x) => {
|
|
49
|
+
if (x === 0) {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
const c = getColumnLetterFromNumber(x + 1);
|
|
53
|
+
return x < 0 ? `$${c}` : c;
|
|
54
|
+
};
|
|
55
|
+
export const c2x = (col, absolute = false) => {
|
|
56
|
+
const n = getNumberFromColumnLetter(col);
|
|
57
|
+
return absolute ? -n : n;
|
|
58
|
+
};
|
|
59
|
+
export const y2r = (y) => {
|
|
60
|
+
if (y === 0) {
|
|
61
|
+
return "";
|
|
62
|
+
}
|
|
63
|
+
return y < 0 ? `$${y}` : String(y);
|
|
64
|
+
};
|
|
65
|
+
export const r2y = (row, absolute = false) => {
|
|
66
|
+
if (typeof row === "string") {
|
|
67
|
+
row = parseInt(row, 10);
|
|
68
|
+
}
|
|
69
|
+
return absolute ? -row : row;
|
|
70
|
+
};
|
|
71
|
+
export const p2a = ({ y, x }) => {
|
|
72
|
+
return `${x2c(x)}${y2r(y)}`;
|
|
73
|
+
};
|
|
74
|
+
const restoreDoubleQuote = (text) => text.replace(/\x00/g, '"');
|
|
75
|
+
export const tsv2matrix = (tsv) => {
|
|
76
|
+
tsv = tsv.replace(/""/g, "\x00");
|
|
77
|
+
const rows = [[]];
|
|
78
|
+
let row = rows[0];
|
|
79
|
+
let entering = false;
|
|
80
|
+
let word = "";
|
|
81
|
+
for (let i = 0; i < tsv.length; i++) {
|
|
82
|
+
const s = tsv[i];
|
|
83
|
+
if (s === "\n" && !entering) {
|
|
84
|
+
row.push(restoreDoubleQuote(word));
|
|
85
|
+
word = "";
|
|
86
|
+
row = [];
|
|
87
|
+
rows.push(row);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (s === "\t") {
|
|
91
|
+
row.push(restoreDoubleQuote(word));
|
|
92
|
+
word = "";
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (s === '"' && !entering && word === "") {
|
|
96
|
+
entering = true;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (s === '"' && entering) {
|
|
100
|
+
entering = false;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
word += s;
|
|
104
|
+
}
|
|
105
|
+
if (word) {
|
|
106
|
+
row.push(restoreDoubleQuote(word));
|
|
107
|
+
}
|
|
108
|
+
return rows;
|
|
109
|
+
};
|
|
110
|
+
export const a2p = (address) => {
|
|
111
|
+
const m = address.match(/(\$)?([A-Z]*)(\$)?([0-9]*)/);
|
|
112
|
+
if (m == null) {
|
|
113
|
+
console.error("invalid address", address);
|
|
114
|
+
return { y: 1, x: 1 };
|
|
115
|
+
}
|
|
116
|
+
const [_, absoluteCol, col, absoluteRow, row] = m.slice();
|
|
117
|
+
return { y: r2y(row, !!absoluteRow) || 0, x: c2x(col, !!absoluteCol) || 0 };
|
|
118
|
+
};
|
|
119
|
+
export const grantAddressAbsolute = (address, absCol, absRow) => {
|
|
120
|
+
const m = address.match(/([A-Z]*)([0-9]*)/);
|
|
121
|
+
if (m == null) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const [_, col, row] = m.slice();
|
|
125
|
+
return `${absCol ? "$" : ""}${col}${absRow ? "$" : ""}${row}`;
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=converters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"converters.js","sourceRoot":"","sources":["../../src/lib/converters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAE9C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC5C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE5C,MAAM,yBAAyB,GAAG,CAChC,GAAW,EAC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E,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1D,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;AAC9E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAAgB,EAChB,MAAe,EACf,MAAe,EACf,EAAE;IACF,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,IAAI,EAAE;QACb,OAAO;KACR;IACD,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IAChC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC;AAChE,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MatrixType, AreaType, ZoneType, RangeType, PointType, Y, X, CellsByAddressType, ShapeType, MatricesByAddress, CellType } from "../types";
|
|
2
|
+
export declare const slideArea: (area: AreaType, y: Y, x: X) => AreaType;
|
|
3
|
+
export declare const superposeArea: (srcArea: AreaType, dstArea: AreaType) => ShapeType;
|
|
4
|
+
export declare const concatAreas: (area1: AreaType, area2: AreaType) => AreaType;
|
|
5
|
+
export declare const zoneToArea: (zone: ZoneType) => AreaType;
|
|
6
|
+
export declare const areaToZone: (area: AreaType) => ZoneType;
|
|
7
|
+
export declare const areaToRange: (area: AreaType) => string;
|
|
8
|
+
export declare const rangeToArea: (range: string) => AreaType;
|
|
9
|
+
export declare const between: (range: RangeType, index: number) => boolean;
|
|
10
|
+
export declare const among: (area: AreaType, point: PointType) => boolean;
|
|
11
|
+
declare type ShapeExtension = {
|
|
12
|
+
base?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const zoneShape: ({ base, ...zone }: ZoneType & ShapeExtension) => ShapeType;
|
|
15
|
+
export declare const areaShape: ({ base, ...area }: AreaType & ShapeExtension) => ShapeType;
|
|
16
|
+
export declare const matrixShape: ({ base, matrix, }: {
|
|
17
|
+
matrix: MatrixType<any>;
|
|
18
|
+
} & ShapeExtension) => ShapeType;
|
|
19
|
+
export declare const makeSequence: (start: number, stop: number, step?: number) => number[];
|
|
20
|
+
export declare const oa2aa: (oa: {
|
|
21
|
+
[s: string]: any;
|
|
22
|
+
}[], fields: string[]) => MatrixType<any>;
|
|
23
|
+
export declare const aa2oa: (aa: MatrixType<any>, fields: string[]) => {
|
|
24
|
+
[s: string]: any;
|
|
25
|
+
};
|
|
26
|
+
export declare const putMatrix: <T = any>(dst: T[][], src: T[][], dstArea: AreaType) => MatricesByAddress<T>;
|
|
27
|
+
export declare const createMatrix: <T = any>(numRows: number, numCols: number, fill?: T | undefined) => T[][];
|
|
28
|
+
export declare const cropMatrix: <T = any>(matrix: T[][], area: AreaType) => T[][];
|
|
29
|
+
export declare const generateInitialSimple: <T>({ cells, ensured, matrix, flattenAs, }: {
|
|
30
|
+
cells?: CellsByAddressType | undefined;
|
|
31
|
+
ensured?: {
|
|
32
|
+
numRows?: number | undefined;
|
|
33
|
+
numCols?: number | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
flattenAs?: keyof CellType<any> | undefined;
|
|
36
|
+
matrix?: MatrixType<any> | undefined;
|
|
37
|
+
}) => CellsByAddressType;
|
|
38
|
+
export declare const generateInitial: ({ cells, ensured, matrices, flattenAs, }?: {
|
|
39
|
+
cells?: CellsByAddressType | undefined;
|
|
40
|
+
ensured?: {
|
|
41
|
+
numRows?: number | undefined;
|
|
42
|
+
numCols?: number | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
flattenAs?: keyof CellType<any> | undefined;
|
|
45
|
+
matrices?: MatricesByAddress<any> | undefined;
|
|
46
|
+
}) => CellsByAddressType;
|
|
47
|
+
export declare const upsert: <T>({ cells, matrices, flattenAs, }: {
|
|
48
|
+
cells?: CellsByAddressType | undefined;
|
|
49
|
+
flattenAs?: keyof CellType<any> | undefined;
|
|
50
|
+
matrices?: MatricesByAddress<T> | undefined;
|
|
51
|
+
}) => CellsByAddressType;
|
|
52
|
+
export declare const getMaxSizesFromCells: (cells?: CellsByAddressType) => {
|
|
53
|
+
numRows: number;
|
|
54
|
+
numCols: number;
|
|
55
|
+
};
|
|
56
|
+
export declare const range: (start: number, end: number) => number[];
|
|
57
|
+
export declare const complementSelectingArea: (selectingArea: AreaType, choosing: PointType) => AreaType;
|
|
58
|
+
export declare const isSameArea: (area1: AreaType, area2: AreaType) => boolean;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=structs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../src/lib/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,CAAC,EACD,CAAC,EACD,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACT,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,SAAS,SAAU,QAAQ,KAAK,CAAC,KAAK,CAAC,KAAG,QAGtD,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,QAAQ,WACR,QAAQ,KAChB,SASF,CAAC;AAEF,eAAO,MAAM,WAAW,UACf,QAAQ,SACR,QAAQ,KACd,QAeF,CAAC;AAGF,eAAO,MAAM,UAAU,SAAU,QAAQ,KAAG,QAU3C,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,QAAQ,KAAG,QAO3C,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,QAAQ,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|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { a2p, p2a } from "./converters";
|
|
13
|
+
export const slideArea = (area, y, x) => {
|
|
14
|
+
const { top, left, bottom, right } = area;
|
|
15
|
+
return { top: top + y, left: left + x, bottom: bottom + y, right: right + x };
|
|
16
|
+
};
|
|
17
|
+
export const superposeArea = (srcArea, dstArea) => {
|
|
18
|
+
const { height: srcHeight, width: srcWidth } = areaShape(srcArea);
|
|
19
|
+
const { height: dstHeight, width: dstWidth } = areaShape(dstArea);
|
|
20
|
+
// biggerHeight, biggerWidth
|
|
21
|
+
return {
|
|
22
|
+
height: srcHeight > dstHeight ? srcHeight : dstHeight,
|
|
23
|
+
width: srcWidth > dstWidth ? srcWidth : dstWidth,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export const concatAreas = (area1, area2) => {
|
|
27
|
+
const result = Object.assign({}, area1);
|
|
28
|
+
if (area2.left < area1.left) {
|
|
29
|
+
result.left = area2.left;
|
|
30
|
+
}
|
|
31
|
+
if (area2.right > area1.right) {
|
|
32
|
+
result.right = area2.right;
|
|
33
|
+
}
|
|
34
|
+
if (area2.top < area1.top) {
|
|
35
|
+
result.top = area2.top;
|
|
36
|
+
}
|
|
37
|
+
if (area2.bottom > area1.bottom) {
|
|
38
|
+
result.bottom = area2.bottom;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
export const zoneToArea = (zone) => {
|
|
43
|
+
const [top, bottom] = zone.startY < zone.endY
|
|
44
|
+
? [zone.startY, zone.endY]
|
|
45
|
+
: [zone.endY, zone.startY];
|
|
46
|
+
const [left, right] = zone.startX < zone.endX
|
|
47
|
+
? [zone.startX, zone.endX]
|
|
48
|
+
: [zone.endX, zone.startX];
|
|
49
|
+
return { top, left, bottom, right };
|
|
50
|
+
};
|
|
51
|
+
export const areaToZone = (area) => {
|
|
52
|
+
return {
|
|
53
|
+
startY: area.top,
|
|
54
|
+
startX: area.left,
|
|
55
|
+
endY: area.bottom,
|
|
56
|
+
endX: area.right,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export const areaToRange = (area) => {
|
|
60
|
+
const { top, left, bottom, right } = area;
|
|
61
|
+
return `${p2a({ y: top, x: left })}${p2a({
|
|
62
|
+
y: bottom,
|
|
63
|
+
x: right,
|
|
64
|
+
})}`;
|
|
65
|
+
};
|
|
66
|
+
export const rangeToArea = (range) => {
|
|
67
|
+
const cells = range.split(":");
|
|
68
|
+
const [start, end] = cells;
|
|
69
|
+
const { y: top, x: left } = a2p(start);
|
|
70
|
+
const { y: bottom, x: right } = a2p(end);
|
|
71
|
+
return { top, left, bottom, right };
|
|
72
|
+
};
|
|
73
|
+
export const between = (range, index) => {
|
|
74
|
+
if (range.start === -1 || range.end === -1) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return ((range.start <= index && index <= range.end) ||
|
|
78
|
+
(range.end <= index && index <= range.start));
|
|
79
|
+
};
|
|
80
|
+
export const among = (area, point) => {
|
|
81
|
+
if (area.top === -1 ||
|
|
82
|
+
area.left === -1 ||
|
|
83
|
+
area.bottom === -1 ||
|
|
84
|
+
area.right === -1) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
const { y, x } = point;
|
|
88
|
+
const { top, left, bottom, right } = area;
|
|
89
|
+
return top <= y && y <= bottom && left <= x && x <= right;
|
|
90
|
+
};
|
|
91
|
+
export const zoneShape = (_a) => {
|
|
92
|
+
var { base = 0 } = _a, zone = __rest(_a, ["base"]);
|
|
93
|
+
return {
|
|
94
|
+
height: base + Math.abs(zone.startY - zone.endY),
|
|
95
|
+
width: base + Math.abs(zone.startX - zone.endX),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export const areaShape = (_a) => {
|
|
99
|
+
var { base = 0 } = _a, area = __rest(_a, ["base"]);
|
|
100
|
+
return {
|
|
101
|
+
height: base + Math.abs(area.top - area.bottom),
|
|
102
|
+
width: base + Math.abs(area.left - area.right),
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export const matrixShape = ({ base = 0, matrix, }) => {
|
|
106
|
+
const h = matrix.length;
|
|
107
|
+
if (h === 0) {
|
|
108
|
+
return { height: 0, width: 0 };
|
|
109
|
+
}
|
|
110
|
+
return { height: base + h, width: base + matrix[0].length };
|
|
111
|
+
};
|
|
112
|
+
export const makeSequence = (start, stop, step = 1) => {
|
|
113
|
+
return Array.from({ length: (stop - start - 1) / step + 1 }, (_, i) => start + i * step);
|
|
114
|
+
};
|
|
115
|
+
export const oa2aa = (oa, fields) => {
|
|
116
|
+
const aa = [];
|
|
117
|
+
oa.forEach((o) => {
|
|
118
|
+
const a = [];
|
|
119
|
+
fields.forEach((field) => {
|
|
120
|
+
a.push(o[field]);
|
|
121
|
+
});
|
|
122
|
+
aa.push(a);
|
|
123
|
+
});
|
|
124
|
+
return aa;
|
|
125
|
+
};
|
|
126
|
+
export const aa2oa = (aa, fields) => {
|
|
127
|
+
const oa = [];
|
|
128
|
+
aa.forEach((a) => {
|
|
129
|
+
const o = {};
|
|
130
|
+
a.forEach((v, i) => {
|
|
131
|
+
if (i >= fields.length) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const field = fields[i];
|
|
135
|
+
o[field] = v;
|
|
136
|
+
});
|
|
137
|
+
oa.push(o);
|
|
138
|
+
});
|
|
139
|
+
return oa;
|
|
140
|
+
};
|
|
141
|
+
export const putMatrix = (dst, src, dstArea) => {
|
|
142
|
+
const lostRows = {};
|
|
143
|
+
const { top, left, bottom, right } = dstArea;
|
|
144
|
+
const { height: dstNumRows, width: dstNumCols } = matrixShape({
|
|
145
|
+
matrix: dst,
|
|
146
|
+
base: 1,
|
|
147
|
+
});
|
|
148
|
+
for (let y = top; y <= bottom; y++) {
|
|
149
|
+
const lostRow = [];
|
|
150
|
+
for (let x = left; x <= right; x++) {
|
|
151
|
+
const value = src[y - top][x - left];
|
|
152
|
+
// -1 means excluding headers
|
|
153
|
+
if (y < dstNumRows - 1 && x < dstNumCols - 1) {
|
|
154
|
+
dst[y][x] = value;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (lostRow.length === 0) {
|
|
158
|
+
lostRows[p2a({ y, x })] = [lostRow];
|
|
159
|
+
}
|
|
160
|
+
lostRow.push(value);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return lostRows;
|
|
164
|
+
};
|
|
165
|
+
export const createMatrix = (numRows, numCols, fill) => {
|
|
166
|
+
return [...Array(numRows)].map(() => Array(numCols).fill(fill));
|
|
167
|
+
};
|
|
168
|
+
export const cropMatrix = (matrix, area) => {
|
|
169
|
+
const { top, left, bottom, right } = area;
|
|
170
|
+
return matrix
|
|
171
|
+
.slice(top, bottom + 1)
|
|
172
|
+
.map((cols) => cols.slice(left, right + 1));
|
|
173
|
+
};
|
|
174
|
+
export const generateInitialSimple = ({ cells = {}, ensured = {}, matrix = [], flattenAs = "value", }) => {
|
|
175
|
+
return generateInitial({
|
|
176
|
+
cells,
|
|
177
|
+
ensured,
|
|
178
|
+
matrices: { A1: matrix },
|
|
179
|
+
flattenAs,
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
export const generateInitial = ({ cells = {}, ensured = {}, matrices = {}, flattenAs = "value", } = {}) => {
|
|
183
|
+
upsert({ cells, flattenAs, matrices });
|
|
184
|
+
const { numRows, numCols } = Object.assign({ numRows: 1, numCols: 1 }, ensured);
|
|
185
|
+
const rightBottom = p2a({ y: numRows, x: numCols });
|
|
186
|
+
if (cells[rightBottom] == null) {
|
|
187
|
+
cells[rightBottom] = {};
|
|
188
|
+
}
|
|
189
|
+
return cells;
|
|
190
|
+
};
|
|
191
|
+
export const upsert = ({ cells = {}, matrices = {}, flattenAs, }) => {
|
|
192
|
+
Object.keys(matrices).forEach((address) => {
|
|
193
|
+
const matrix = matrices[address];
|
|
194
|
+
const { y: baseY, x: baseX } = a2p(address);
|
|
195
|
+
matrix.forEach((row, y) => {
|
|
196
|
+
row.forEach((e, x) => {
|
|
197
|
+
const id = p2a({ y: baseY + y, x: baseX + x });
|
|
198
|
+
if (flattenAs) {
|
|
199
|
+
const cell = cells[id];
|
|
200
|
+
cells[id] = Object.assign({ [flattenAs]: e }, cell);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
cells[id] = e;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
return cells;
|
|
209
|
+
};
|
|
210
|
+
export const getMaxSizesFromCells = (cells = {}) => {
|
|
211
|
+
let [lastY, lastX] = [0, 0];
|
|
212
|
+
Object.keys(cells).map((address) => {
|
|
213
|
+
const { y, x } = a2p(address);
|
|
214
|
+
if (lastY < y) {
|
|
215
|
+
lastY = y;
|
|
216
|
+
}
|
|
217
|
+
if (lastX < x) {
|
|
218
|
+
lastX = x;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return { numRows: lastY, numCols: lastX };
|
|
222
|
+
};
|
|
223
|
+
export const range = (start, end) => {
|
|
224
|
+
const list = [];
|
|
225
|
+
for (let i = start; i <= end; i++) {
|
|
226
|
+
list.push(i);
|
|
227
|
+
}
|
|
228
|
+
return list;
|
|
229
|
+
};
|
|
230
|
+
export const complementSelectingArea = (selectingArea, choosing) => {
|
|
231
|
+
if (selectingArea.left === -1) {
|
|
232
|
+
selectingArea = { left: choosing.x, top: choosing.y, right: choosing.x, bottom: choosing.y };
|
|
233
|
+
}
|
|
234
|
+
return selectingArea;
|
|
235
|
+
};
|
|
236
|
+
export const isSameArea = (area1, area2) => {
|
|
237
|
+
if (area1.top !== area2.top) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
if (area1.left !== area2.left) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
if (area1.bottom !== area2.bottom) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
if (area1.right !== area2.right) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
return true;
|
|
250
|
+
};
|
|
251
|
+
//# sourceMappingURL=structs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../src/lib/structs.ts"],"names":[],"mappings":";;;;;;;;;;;AAaA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,CAAI,EAAE,CAAI,EAAY,EAAE;IAChE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,OAAiB,EACjB,OAAiB,EACN,EAAE;IACb,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;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