@gridsheet/react-core 1.4.0 → 2.0.0-rc.2
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/README.md +1 -1
- package/dist/components/Cell.d.ts +3 -3
- package/dist/components/Cell.d.ts.map +1 -1
- package/dist/components/ContextMenu.d.ts +19 -2
- package/dist/components/ContextMenu.d.ts.map +1 -1
- package/dist/components/Editor.d.ts +4 -4
- package/dist/components/Editor.d.ts.map +1 -1
- package/dist/components/Emitter.d.ts +2 -2
- package/dist/components/Emitter.d.ts.map +1 -1
- package/dist/components/Fixed.d.ts +3 -3
- package/dist/components/Fixed.d.ts.map +1 -1
- package/dist/components/FormulaBar.d.ts +1 -2
- package/dist/components/FormulaBar.d.ts.map +1 -1
- package/dist/components/GridSheet.d.ts +1 -2
- package/dist/components/GridSheet.d.ts.map +1 -1
- package/dist/components/HeaderCellLeft.d.ts +2 -2
- package/dist/components/HeaderCellLeft.d.ts.map +1 -1
- package/dist/components/HeaderCellTop.d.ts +2 -2
- package/dist/components/HeaderCellTop.d.ts.map +1 -1
- package/dist/components/PluginBase.d.ts +4 -4
- package/dist/components/PluginBase.d.ts.map +1 -1
- package/dist/components/Resizer.d.ts +1 -2
- package/dist/components/Resizer.d.ts.map +1 -1
- package/dist/components/ScrollHandle.d.ts +9 -0
- package/dist/components/ScrollHandle.d.ts.map +1 -0
- package/dist/components/SearchBar.d.ts +1 -2
- package/dist/components/SearchBar.d.ts.map +1 -1
- package/dist/components/StoreObserver.d.ts +11 -0
- package/dist/components/StoreObserver.d.ts.map +1 -0
- package/dist/components/Tabular.d.ts +3 -3
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/components/hooks.d.ts +2 -0
- package/dist/components/hooks.d.ts.map +1 -1
- package/dist/components/svg/AddIcon.d.ts +1 -2
- package/dist/components/svg/AddIcon.d.ts.map +1 -1
- package/dist/components/svg/Base.d.ts +4 -4
- package/dist/components/svg/Base.d.ts.map +1 -1
- package/dist/components/svg/CloseIcon.d.ts +1 -2
- package/dist/components/svg/CloseIcon.d.ts.map +1 -1
- package/dist/components/svg/SearchIcon.d.ts +1 -2
- package/dist/components/svg/SearchIcon.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/formula/evaluator.d.ts +42 -18
- package/dist/formula/evaluator.d.ts.map +1 -1
- package/dist/formula/functions/__base.d.ts.map +1 -1
- package/dist/formula/functions/__utils.d.ts +5 -2
- package/dist/formula/functions/__utils.d.ts.map +1 -1
- package/dist/formula/functions/abs.d.ts.map +1 -1
- package/dist/formula/functions/acos.d.ts.map +1 -1
- package/dist/formula/functions/add.d.ts +1 -1
- package/dist/formula/functions/add.d.ts.map +1 -1
- package/dist/formula/functions/and.d.ts.map +1 -1
- package/dist/formula/functions/asin.d.ts.map +1 -1
- package/dist/formula/functions/atan.d.ts.map +1 -1
- package/dist/formula/functions/atan2.d.ts.map +1 -1
- package/dist/formula/functions/average.d.ts.map +1 -1
- package/dist/formula/functions/col.d.ts.map +1 -1
- package/dist/formula/functions/concat.d.ts.map +1 -1
- package/dist/formula/functions/concatenate.d.ts.map +1 -1
- package/dist/formula/functions/cos.d.ts.map +1 -1
- package/dist/formula/functions/count.d.ts.map +1 -1
- package/dist/formula/functions/counta.d.ts.map +1 -1
- package/dist/formula/functions/countif.d.ts.map +1 -1
- package/dist/formula/functions/divide.d.ts.map +1 -1
- package/dist/formula/functions/eq.d.ts.map +1 -1
- package/dist/formula/functions/exp.d.ts.map +1 -1
- package/dist/formula/functions/gt.d.ts.map +1 -1
- package/dist/formula/functions/gte.d.ts.map +1 -1
- package/dist/formula/functions/hlookup.d.ts.map +1 -1
- package/dist/formula/functions/if.d.ts.map +1 -1
- package/dist/formula/functions/iferror.d.ts.map +1 -1
- package/dist/formula/functions/index.d.ts +18 -0
- package/dist/formula/functions/index.d.ts.map +1 -0
- package/dist/formula/functions/len.d.ts.map +1 -1
- package/dist/formula/functions/lenb.d.ts.map +1 -1
- package/dist/formula/functions/ln.d.ts.map +1 -1
- package/dist/formula/functions/log.d.ts.map +1 -1
- package/dist/formula/functions/log10.d.ts.map +1 -1
- package/dist/formula/functions/lt.d.ts.map +1 -1
- package/dist/formula/functions/lte.d.ts.map +1 -1
- package/dist/formula/functions/match.d.ts +18 -0
- package/dist/formula/functions/match.d.ts.map +1 -0
- package/dist/formula/functions/match.test.d.ts +2 -0
- package/dist/formula/functions/match.test.d.ts.map +1 -0
- package/dist/formula/functions/max.d.ts.map +1 -1
- package/dist/formula/functions/min.d.ts.map +1 -1
- package/dist/formula/functions/minus.d.ts.map +1 -1
- package/dist/formula/functions/mod.d.ts.map +1 -1
- package/dist/formula/functions/multiply.d.ts.map +1 -1
- package/dist/formula/functions/ne.d.ts.map +1 -1
- package/dist/formula/functions/not.d.ts.map +1 -1
- package/dist/formula/functions/now.d.ts.map +1 -1
- package/dist/formula/functions/or.d.ts.map +1 -1
- package/dist/formula/functions/pi.d.ts.map +1 -1
- package/dist/formula/functions/power.d.ts.map +1 -1
- package/dist/formula/functions/product.d.ts.map +1 -1
- package/dist/formula/functions/radians.d.ts.map +1 -1
- package/dist/formula/functions/rand.d.ts.map +1 -1
- package/dist/formula/functions/round.d.ts.map +1 -1
- package/dist/formula/functions/rounddown.d.ts.map +1 -1
- package/dist/formula/functions/roundup.d.ts.map +1 -1
- package/dist/formula/functions/row.d.ts.map +1 -1
- package/dist/formula/functions/sin.d.ts.map +1 -1
- package/dist/formula/functions/sqrt.d.ts.map +1 -1
- package/dist/formula/functions/sum.d.ts.map +1 -1
- package/dist/formula/functions/sumif.d.ts.map +1 -1
- package/dist/formula/functions/tan.d.ts.map +1 -1
- package/dist/formula/functions/uminus.d.ts.map +1 -1
- package/dist/formula/functions/vlookup.d.ts.map +1 -1
- package/dist/formula/mapping.d.ts.map +1 -1
- package/dist/formula/solver.d.ts +10 -7
- package/dist/formula/solver.d.ts.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10330 -20
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.d.ts +2 -2
- package/dist/lib/autofill.d.ts.map +1 -1
- package/dist/lib/clipboard.d.ts.map +1 -1
- package/dist/lib/converters.d.ts +3 -4
- package/dist/lib/converters.d.ts.map +1 -1
- package/dist/lib/events.d.ts +6 -0
- package/dist/lib/events.d.ts.map +1 -0
- package/dist/lib/hub.d.ts +72 -0
- package/dist/lib/hub.d.ts.map +1 -0
- package/dist/lib/input.d.ts +12 -2
- package/dist/lib/input.d.ts.map +1 -1
- package/dist/lib/operation.d.ts +27 -0
- package/dist/lib/operation.d.ts.map +1 -0
- package/dist/lib/palette.d.ts +1 -1
- package/dist/lib/palette.d.ts.map +1 -1
- package/dist/lib/paste.d.ts +4 -0
- package/dist/lib/paste.d.ts.map +1 -0
- package/dist/lib/reference.d.ts +13 -0
- package/dist/lib/reference.d.ts.map +1 -0
- package/dist/lib/sheet.d.ts +3 -0
- package/dist/lib/sheet.d.ts.map +1 -0
- package/dist/lib/structs.d.ts +12 -3
- package/dist/lib/structs.d.ts.map +1 -1
- package/dist/lib/table.d.ts +152 -91
- package/dist/lib/table.d.ts.map +1 -1
- package/dist/lib/time.d.ts +1 -0
- package/dist/lib/time.d.ts.map +1 -1
- package/dist/lib/virtualization.d.ts +3 -2
- package/dist/lib/virtualization.d.ts.map +1 -1
- package/dist/parsers/core.d.ts +2 -0
- package/dist/parsers/core.d.ts.map +1 -1
- package/dist/policy/core.d.ts +47 -0
- package/dist/policy/core.d.ts.map +1 -0
- package/dist/renderers/checkbox.d.ts +2 -2
- package/dist/renderers/checkbox.d.ts.map +1 -1
- package/dist/renderers/core.d.ts +39 -25
- package/dist/renderers/core.d.ts.map +1 -1
- package/dist/renderers/thousand_separator.d.ts +2 -3
- package/dist/renderers/thousand_separator.d.ts.map +1 -1
- package/dist/store/actions.d.ts +141 -49
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/dispatchers.d.ts +13 -0
- package/dist/store/dispatchers.d.ts.map +1 -0
- package/dist/store/helpers.d.ts +1 -0
- package/dist/store/helpers.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/styles/embedder.d.ts.map +1 -1
- package/dist/styles/minified.d.ts +2 -2
- package/dist/styles/minified.d.ts.map +1 -1
- package/dist/styles/utils.d.ts +52 -0
- package/dist/styles/utils.d.ts.map +1 -0
- package/dist/types.d.ts +112 -55
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +7 -10
- package/dist/_virtual/_commonjsHelpers.js +0 -7
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -8
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/dayjs.min2.js +0 -5
- package/dist/_virtual/dayjs.min2.js.map +0 -1
- package/dist/_virtual/timezone.js +0 -8
- package/dist/_virtual/timezone.js.map +0 -1
- package/dist/_virtual/timezone2.js +0 -5
- package/dist/_virtual/timezone2.js.map +0 -1
- package/dist/_virtual/utc.js +0 -8
- package/dist/_virtual/utc.js.map +0 -1
- package/dist/_virtual/utc2.js +0 -5
- package/dist/_virtual/utc2.js.map +0 -1
- package/dist/components/Cell.js +0 -234
- package/dist/components/Cell.js.map +0 -1
- package/dist/components/ContextMenu.js +0 -297
- package/dist/components/ContextMenu.js.map +0 -1
- package/dist/components/Editor.js +0 -464
- package/dist/components/Editor.js.map +0 -1
- package/dist/components/Emitter.js +0 -26
- package/dist/components/Emitter.js.map +0 -1
- package/dist/components/Fixed.js +0 -17
- package/dist/components/Fixed.js.map +0 -1
- package/dist/components/FormulaBar.js +0 -150
- package/dist/components/FormulaBar.js.map +0 -1
- package/dist/components/GridSheet.js +0 -247
- package/dist/components/GridSheet.js.map +0 -1
- package/dist/components/HeaderCellLeft.js +0 -131
- package/dist/components/HeaderCellLeft.js.map +0 -1
- package/dist/components/HeaderCellTop.js +0 -132
- package/dist/components/HeaderCellTop.js.map +0 -1
- package/dist/components/PluginBase.js +0 -35
- package/dist/components/PluginBase.js.map +0 -1
- package/dist/components/Resizer.js +0 -98
- package/dist/components/Resizer.js.map +0 -1
- package/dist/components/SearchBar.js +0 -108
- package/dist/components/SearchBar.js.map +0 -1
- package/dist/components/SheetProvider.d.ts +0 -30
- package/dist/components/SheetProvider.d.ts.map +0 -1
- package/dist/components/SheetProvider.js +0 -59
- package/dist/components/SheetProvider.js.map +0 -1
- package/dist/components/StoreInitializer.d.ts +0 -4
- package/dist/components/StoreInitializer.d.ts.map +0 -1
- package/dist/components/StoreInitializer.js +0 -84
- package/dist/components/StoreInitializer.js.map +0 -1
- package/dist/components/Tabular.js +0 -317
- package/dist/components/Tabular.js.map +0 -1
- package/dist/components/Toggle.d.ts +0 -12
- package/dist/components/Toggle.d.ts.map +0 -1
- package/dist/components/hooks.js +0 -15
- package/dist/components/hooks.js.map +0 -1
- package/dist/components/svg/Base.js +0 -24
- package/dist/components/svg/Base.js.map +0 -1
- package/dist/components/svg/CloseIcon.js +0 -13
- package/dist/components/svg/CloseIcon.js.map +0 -1
- package/dist/components/svg/SearchIcon.js +0 -13
- package/dist/components/svg/SearchIcon.js.map +0 -1
- package/dist/constants.js +0 -43
- package/dist/constants.js.map +0 -1
- package/dist/formula/evaluator.js +0 -679
- package/dist/formula/evaluator.js.map +0 -1
- package/dist/formula/functions/__base.js +0 -20
- package/dist/formula/functions/__base.js.map +0 -1
- package/dist/formula/functions/__utils.js +0 -145
- package/dist/formula/functions/__utils.js.map +0 -1
- package/dist/formula/functions/abs.js +0 -24
- package/dist/formula/functions/abs.js.map +0 -1
- package/dist/formula/functions/abs.spec.d.ts +0 -2
- package/dist/formula/functions/abs.spec.d.ts.map +0 -1
- package/dist/formula/functions/acos.js +0 -32
- package/dist/formula/functions/acos.js.map +0 -1
- package/dist/formula/functions/add.js +0 -57
- package/dist/formula/functions/add.js.map +0 -1
- package/dist/formula/functions/and.js +0 -28
- package/dist/formula/functions/and.js.map +0 -1
- package/dist/formula/functions/asin.js +0 -32
- package/dist/formula/functions/asin.js.map +0 -1
- package/dist/formula/functions/atan.js +0 -29
- package/dist/formula/functions/atan.js.map +0 -1
- package/dist/formula/functions/atan2.js +0 -35
- package/dist/formula/functions/atan2.js.map +0 -1
- package/dist/formula/functions/average.js +0 -44
- package/dist/formula/functions/average.js.map +0 -1
- package/dist/formula/functions/col.js +0 -34
- package/dist/formula/functions/col.js.map +0 -1
- package/dist/formula/functions/col.spec.d.ts +0 -2
- package/dist/formula/functions/col.spec.d.ts.map +0 -1
- package/dist/formula/functions/concat.js +0 -27
- package/dist/formula/functions/concat.js.map +0 -1
- package/dist/formula/functions/concatenate.js +0 -28
- package/dist/formula/functions/concatenate.js.map +0 -1
- package/dist/formula/functions/cos.js +0 -29
- package/dist/formula/functions/cos.js.map +0 -1
- package/dist/formula/functions/count.js +0 -38
- package/dist/formula/functions/count.js.map +0 -1
- package/dist/formula/functions/counta.js +0 -38
- package/dist/formula/functions/counta.js.map +0 -1
- package/dist/formula/functions/countif.js +0 -32
- package/dist/formula/functions/countif.js.map +0 -1
- package/dist/formula/functions/countif.spec.d.ts +0 -2
- package/dist/formula/functions/countif.spec.d.ts.map +0 -1
- package/dist/formula/functions/divide.js +0 -33
- package/dist/formula/functions/divide.js.map +0 -1
- package/dist/formula/functions/eq.js +0 -29
- package/dist/formula/functions/eq.js.map +0 -1
- package/dist/formula/functions/eq.spec.d.ts +0 -2
- package/dist/formula/functions/eq.spec.d.ts.map +0 -1
- package/dist/formula/functions/exp.js +0 -29
- package/dist/formula/functions/exp.js.map +0 -1
- package/dist/formula/functions/gt.js +0 -29
- package/dist/formula/functions/gt.js.map +0 -1
- package/dist/formula/functions/gte.js +0 -29
- package/dist/formula/functions/gte.js.map +0 -1
- package/dist/formula/functions/hlookup.js +0 -75
- package/dist/formula/functions/hlookup.js.map +0 -1
- package/dist/formula/functions/if.js +0 -39
- package/dist/formula/functions/if.js.map +0 -1
- package/dist/formula/functions/iferror.js +0 -45
- package/dist/formula/functions/iferror.js.map +0 -1
- package/dist/formula/functions/iferror.spec.d.ts +0 -2
- package/dist/formula/functions/iferror.spec.d.ts.map +0 -1
- package/dist/formula/functions/len.js +0 -29
- package/dist/formula/functions/len.js.map +0 -1
- package/dist/formula/functions/lenb.js +0 -29
- package/dist/formula/functions/lenb.js.map +0 -1
- package/dist/formula/functions/ln.js +0 -32
- package/dist/formula/functions/ln.js.map +0 -1
- package/dist/formula/functions/log.js +0 -36
- package/dist/formula/functions/log.js.map +0 -1
- package/dist/formula/functions/log10.js +0 -32
- package/dist/formula/functions/log10.js.map +0 -1
- package/dist/formula/functions/lt.js +0 -29
- package/dist/formula/functions/lt.js.map +0 -1
- package/dist/formula/functions/lte.js +0 -29
- package/dist/formula/functions/lte.js.map +0 -1
- package/dist/formula/functions/max.js +0 -47
- package/dist/formula/functions/max.js.map +0 -1
- package/dist/formula/functions/min.js +0 -47
- package/dist/formula/functions/min.js.map +0 -1
- package/dist/formula/functions/minus.js +0 -57
- package/dist/formula/functions/minus.js.map +0 -1
- package/dist/formula/functions/mod.js +0 -33
- package/dist/formula/functions/mod.js.map +0 -1
- package/dist/formula/functions/mod.spec.d.ts +0 -2
- package/dist/formula/functions/mod.spec.d.ts.map +0 -1
- package/dist/formula/functions/multiply.js +0 -27
- package/dist/formula/functions/multiply.js.map +0 -1
- package/dist/formula/functions/ne.js +0 -29
- package/dist/formula/functions/ne.js.map +0 -1
- package/dist/formula/functions/not.js +0 -30
- package/dist/formula/functions/not.js.map +0 -1
- package/dist/formula/functions/now.js +0 -22
- package/dist/formula/functions/now.js.map +0 -1
- package/dist/formula/functions/or.js +0 -28
- package/dist/formula/functions/or.js.map +0 -1
- package/dist/formula/functions/pi.js +0 -22
- package/dist/formula/functions/pi.js.map +0 -1
- package/dist/formula/functions/power.js +0 -27
- package/dist/formula/functions/power.js.map +0 -1
- package/dist/formula/functions/product.js +0 -40
- package/dist/formula/functions/product.js.map +0 -1
- package/dist/formula/functions/radians.js +0 -29
- package/dist/formula/functions/radians.js.map +0 -1
- package/dist/formula/functions/rand.js +0 -22
- package/dist/formula/functions/rand.js.map +0 -1
- package/dist/formula/functions/round.js +0 -35
- package/dist/formula/functions/round.js.map +0 -1
- package/dist/formula/functions/rounddown.js +0 -35
- package/dist/formula/functions/rounddown.js.map +0 -1
- package/dist/formula/functions/roundup.js +0 -35
- package/dist/formula/functions/roundup.js.map +0 -1
- package/dist/formula/functions/row.js +0 -34
- package/dist/formula/functions/row.js.map +0 -1
- package/dist/formula/functions/row.spec.d.ts +0 -2
- package/dist/formula/functions/row.spec.d.ts.map +0 -1
- package/dist/formula/functions/sin.js +0 -29
- package/dist/formula/functions/sin.js.map +0 -1
- package/dist/formula/functions/sqrt.js +0 -32
- package/dist/formula/functions/sqrt.js.map +0 -1
- package/dist/formula/functions/sum.js +0 -47
- package/dist/formula/functions/sum.js.map +0 -1
- package/dist/formula/functions/sum.spec.d.ts +0 -2
- package/dist/formula/functions/sum.spec.d.ts.map +0 -1
- package/dist/formula/functions/sumif.js +0 -65
- package/dist/formula/functions/sumif.js.map +0 -1
- package/dist/formula/functions/tan.js +0 -29
- package/dist/formula/functions/tan.js.map +0 -1
- package/dist/formula/functions/uminus.js +0 -24
- package/dist/formula/functions/uminus.js.map +0 -1
- package/dist/formula/functions/vlookup.js +0 -75
- package/dist/formula/functions/vlookup.js.map +0 -1
- package/dist/formula/mapping.js +0 -119
- package/dist/formula/mapping.js.map +0 -1
- package/dist/formula/solver.js +0 -70
- package/dist/formula/solver.js.map +0 -1
- package/dist/lib/autofill.js +0 -391
- package/dist/lib/autofill.js.map +0 -1
- package/dist/lib/clipboard.js +0 -72
- package/dist/lib/clipboard.js.map +0 -1
- package/dist/lib/converters.js +0 -141
- package/dist/lib/converters.js.map +0 -1
- package/dist/lib/input.js +0 -52
- package/dist/lib/input.js.map +0 -1
- package/dist/lib/palette.js +0 -24
- package/dist/lib/palette.js.map +0 -1
- package/dist/lib/prevention.d.ts +0 -24
- package/dist/lib/prevention.d.ts.map +0 -1
- package/dist/lib/prevention.js +0 -82
- package/dist/lib/prevention.js.map +0 -1
- package/dist/lib/structs.js +0 -276
- package/dist/lib/structs.js.map +0 -1
- package/dist/lib/table.js +0 -1259
- package/dist/lib/table.js.map +0 -1
- package/dist/lib/time.js +0 -170
- package/dist/lib/time.js.map +0 -1
- package/dist/lib/virtualization.js +0 -129
- package/dist/lib/virtualization.js.map +0 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js +0 -287
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/timezone.js +0 -72
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/timezone.js.map +0 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/utc.js +0 -85
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/utc.js.map +0 -1
- package/dist/parsers/core.js +0 -111
- package/dist/parsers/core.js.map +0 -1
- package/dist/renderers/checkbox.js +0 -20
- package/dist/renderers/checkbox.js.map +0 -1
- package/dist/renderers/core.js +0 -135
- package/dist/renderers/core.js.map +0 -1
- package/dist/renderers/thousand_separator.js +0 -17
- package/dist/renderers/thousand_separator.js.map +0 -1
- package/dist/store/actions.js +0 -762
- package/dist/store/actions.js.map +0 -1
- package/dist/store/helpers.js +0 -88
- package/dist/store/helpers.js.map +0 -1
- package/dist/store/index.js +0 -8
- package/dist/store/index.js.map +0 -1
- package/dist/styles/embedder.js +0 -19
- package/dist/styles/embedder.js.map +0 -1
- package/dist/styles/minified.js +0 -7
- package/dist/styles/minified.js.map +0 -1
package/dist/lib/input.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Lexer } from "../formula/evaluator.js";
|
|
2
|
-
const insertTextAtCursor = (input, text) => {
|
|
3
|
-
var _a;
|
|
4
|
-
input.focus();
|
|
5
|
-
const deprecated = !((_a = document.execCommand) == null ? void 0 : _a.call(document, "insertText", false, text));
|
|
6
|
-
if (!deprecated) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
input.setRangeText(text, input.selectionStart, input.selectionEnd, "end");
|
|
10
|
-
return;
|
|
11
|
-
};
|
|
12
|
-
const insertRef = (input, ref, dryRun = false) => {
|
|
13
|
-
var _a;
|
|
14
|
-
if (!((_a = input == null ? void 0 : input.value) == null ? void 0 : _a.startsWith("=")) || input.selectionStart === 0) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
const lexer = new Lexer(input.value.substring(1));
|
|
18
|
-
lexer.tokenize();
|
|
19
|
-
const tokenIndex = lexer.getTokenIndexByCharPosition(input.selectionStart - 1);
|
|
20
|
-
let token = lexer.tokens[tokenIndex];
|
|
21
|
-
if ((token == null ? void 0 : token.type) === "SPACE") {
|
|
22
|
-
token = lexer.tokens[tokenIndex - 1];
|
|
23
|
-
}
|
|
24
|
-
if (token == null || token.type === "OPEN" || token.type === "COMMA" || token.type === "INFIX_OPERATOR" || token.type === "PREFIX_OPERATOR") {
|
|
25
|
-
if (!dryRun) {
|
|
26
|
-
insertTextAtCursor(input, ref);
|
|
27
|
-
}
|
|
28
|
-
} else if (token.type === "REF" || token.type === "RANGE") {
|
|
29
|
-
if (!dryRun) {
|
|
30
|
-
const [start, end] = lexer.getTokenPositionRange(tokenIndex + 1, 1);
|
|
31
|
-
input.setSelectionRange(start, end);
|
|
32
|
-
insertTextAtCursor(input, ref);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
39
|
-
const isRefInsertable = (input) => {
|
|
40
|
-
return insertRef(input, "", true);
|
|
41
|
-
};
|
|
42
|
-
const expandInput = (input) => {
|
|
43
|
-
input.style.width = `${input.scrollWidth}px`;
|
|
44
|
-
input.style.height = `${input.scrollHeight}px`;
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
expandInput,
|
|
48
|
-
insertRef,
|
|
49
|
-
insertTextAtCursor,
|
|
50
|
-
isRefInsertable
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=input.js.map
|
package/dist/lib/input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../lib/input.ts"],"sourcesContent":["import { Lexer } from '../formula/evaluator';\n\nexport const insertTextAtCursor = (input: HTMLTextAreaElement, text: string) => {\n input.focus();\n const deprecated = !document.execCommand?.('insertText', false, text);\n if (!deprecated) {\n return;\n }\n input.setRangeText(text, input.selectionStart, input.selectionEnd, 'end');\n return;\n};\n\nexport const insertRef = (input: HTMLTextAreaElement | null, ref: string, dryRun = false): boolean => {\n // dryRun is used to check if the ref can be inserted without actually inserting it\n if (!input?.value?.startsWith('=') || input.selectionStart === 0) {\n return false;\n }\n const lexer = new Lexer(input.value.substring(1));\n lexer.tokenize();\n const tokenIndex = lexer.getTokenIndexByCharPosition(input.selectionStart - 1);\n let token = lexer.tokens[tokenIndex];\n if (token?.type === 'SPACE') {\n token = lexer.tokens[tokenIndex - 1];\n }\n if (\n token == null ||\n token.type === 'OPEN' ||\n token.type === 'COMMA' ||\n token.type === 'INFIX_OPERATOR' ||\n token.type === 'PREFIX_OPERATOR'\n ) {\n if (!dryRun) {\n insertTextAtCursor(input, ref);\n }\n } else if (token.type === 'REF' || token.type === 'RANGE') {\n if (!dryRun) {\n const [start, end] = lexer.getTokenPositionRange(tokenIndex + 1, 1);\n input.setSelectionRange(start, end);\n insertTextAtCursor(input, ref);\n }\n } else {\n return false;\n }\n return true;\n};\n\nexport const isRefInsertable = (input: HTMLTextAreaElement | null): boolean => {\n return insertRef(input, '', true);\n};\n\nexport const expandInput = (input: HTMLTextAreaElement) => {\n input.style.width = `${input.scrollWidth}px`;\n input.style.height = `${input.scrollHeight}px`;\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AAM,MAAM,SAAS,GAAG,MAAM,YAAY;AAC5C;"}
|
package/dist/lib/palette.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const REF_PALETTE = [
|
|
2
|
-
// orange
|
|
3
|
-
"#FF6600",
|
|
4
|
-
// purple
|
|
5
|
-
"#AA44FF",
|
|
6
|
-
// emeraldblue
|
|
7
|
-
"#00CCCC",
|
|
8
|
-
// peach
|
|
9
|
-
"#EEAAEE",
|
|
10
|
-
// yellow
|
|
11
|
-
"#DDDD00",
|
|
12
|
-
// winered
|
|
13
|
-
"#AA4444",
|
|
14
|
-
// lightgreen
|
|
15
|
-
"#00FF00",
|
|
16
|
-
// pink
|
|
17
|
-
"#FF00FF",
|
|
18
|
-
// navy
|
|
19
|
-
"#3366FF"
|
|
20
|
-
];
|
|
21
|
-
export {
|
|
22
|
-
REF_PALETTE
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=palette.js.map
|
package/dist/lib/palette.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"palette.js","sources":["../../lib/palette.ts"],"sourcesContent":["export const REF_PALETTE = [\n // orange\n '#FF6600',\n // purple\n '#AA44FF',\n // emeraldblue\n '#00CCCC',\n // peach\n '#EEAAEE',\n // yellow\n '#DDDD00',\n // winered\n '#AA4444',\n // lightgreen\n '#00FF00',\n // pink\n '#FF00FF',\n // navy\n '#3366FF',\n];\n"],"names":[],"mappings":"AAAO,MAAM,cAAc;AAAA;AAAA,EAEzB;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AACF;"}
|
package/dist/lib/prevention.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Prevention } from '../types';
|
|
2
|
-
export declare const DeleteRow: Prevention, // 1
|
|
3
|
-
DeleteCol: Prevention, // 2
|
|
4
|
-
AddRowAbove: Prevention, // 4
|
|
5
|
-
AddRowBelow: Prevention, // 8
|
|
6
|
-
AddColLeft: Prevention, // 16
|
|
7
|
-
AddColRight: Prevention, // 32
|
|
8
|
-
MoveFrom: Prevention, // 64
|
|
9
|
-
MoveTo: Prevention, // 128
|
|
10
|
-
Write: Prevention, // 256
|
|
11
|
-
Style: Prevention, // 512
|
|
12
|
-
Resize: Prevention, // 1024
|
|
13
|
-
SetRenderer: Prevention, // 2048
|
|
14
|
-
SetParser: Prevention;
|
|
15
|
-
export declare const Move: Prevention;
|
|
16
|
-
export declare const Update: Prevention;
|
|
17
|
-
export declare const AddRow: Prevention;
|
|
18
|
-
export declare const AddCol: Prevention;
|
|
19
|
-
export declare const Add: Prevention;
|
|
20
|
-
export declare const Delete: Prevention;
|
|
21
|
-
export declare const ReadOnly: Prevention;
|
|
22
|
-
export declare const isPrevented: (prevention: Prevention | undefined, flag: Prevention) => boolean;
|
|
23
|
-
export declare const debugOperations: (prevention: Prevention | undefined) => string[];
|
|
24
|
-
//# sourceMappingURL=prevention.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prevention.d.ts","sourceRoot":"","sources":["../../lib/prevention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,SAAS,EAAE,UAAoE,EAAE,IAAI;AAChG,SAAS,EAAE,UAAoE,EAAE,IAAI;AACrF,WAAW,EAAE,UAAoE,EAAE,IAAI;AACvF,WAAW,EAAE,UAAoE,EAAE,IAAI;AACvF,UAAU,EAAE,UAAoE,EAAE,KAAK;AACvF,WAAW,EAAE,UAAoE,EAAE,KAAK;AACxF,QAAQ,EAAE,UAAoE,EAAE,KAAK;AACrF,MAAM,EAAE,UAAoE,EAAE,MAAM;AACpF,KAAK,EAAE,UAAoE,EAAE,MAAM;AACnF,KAAK,EAAE,UAAoE,EAAE,MAAM;AACnF,MAAM,EAAE,UAAoE,EAAE,OAAO;AACrF,WAAW,EAAE,UAAoE,EAAE,OAAO;AAC1F,SAAS,EAAE,UAAoE,CAAC;AAElF,eAAO,MAAM,IAAI,EAAE,UAA8B,CAAC;AAElD,eAAO,MAAM,MAAM,EAAE,UAA6D,CAAC;AAEnF,eAAO,MAAM,MAAM,EAAE,UAAsC,CAAC;AAE5D,eAAO,MAAM,MAAM,EAAE,UAAqC,CAAC;AAE3D,eAAO,MAAM,GAAG,EAAE,UAA4B,CAAC;AAE/C,eAAO,MAAM,MAAM,EAAE,UAAkC,CAAC;AAExD,eAAO,MAAM,QAAQ,EAAE,UAAyC,CAAC;AAEjE,eAAO,MAAM,WAAW,GAAI,YAAY,UAAU,GAAG,SAAS,EAAE,MAAM,UAAU,YAK/E,CAAC;AAGF,eAAO,MAAM,eAAe,GAAI,YAAY,UAAU,GAAG,SAAS,aA0CjE,CAAC"}
|
package/dist/lib/prevention.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const DeleteRow = 1, DeleteCol = 2, AddRowAbove = 4, AddRowBelow = 8, AddColLeft = 16, AddColRight = 32, MoveFrom = 64, MoveTo = 128, Write = 256, Style = 512, Resize = 1024, SetRenderer = 2048, SetParser = 4096;
|
|
2
|
-
const Move = MoveFrom | MoveTo;
|
|
3
|
-
const Update = Write | Style | Resize | SetRenderer | SetParser;
|
|
4
|
-
const AddRow = AddRowAbove | AddRowBelow;
|
|
5
|
-
const AddCol = AddColLeft | AddColRight;
|
|
6
|
-
const Add = AddRow | AddCol;
|
|
7
|
-
const Delete = DeleteRow | DeleteCol;
|
|
8
|
-
const ReadOnly = Update | Delete | Add | Move;
|
|
9
|
-
const isPrevented = (prevention, flag) => {
|
|
10
|
-
if (prevention === void 0) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return (prevention & flag) === flag;
|
|
14
|
-
};
|
|
15
|
-
const debugOperations = (prevention) => {
|
|
16
|
-
const preventions = [];
|
|
17
|
-
if (isPrevented(prevention, DeleteRow)) {
|
|
18
|
-
preventions.push("DeleteRow");
|
|
19
|
-
}
|
|
20
|
-
if (isPrevented(prevention, DeleteCol)) {
|
|
21
|
-
preventions.push("DeleteCol");
|
|
22
|
-
}
|
|
23
|
-
if (isPrevented(prevention, AddRowAbove)) {
|
|
24
|
-
preventions.push("AddRowAbove");
|
|
25
|
-
}
|
|
26
|
-
if (isPrevented(prevention, AddRowBelow)) {
|
|
27
|
-
preventions.push("AddRowBelow");
|
|
28
|
-
}
|
|
29
|
-
if (isPrevented(prevention, AddColLeft)) {
|
|
30
|
-
preventions.push("AddColLeft");
|
|
31
|
-
}
|
|
32
|
-
if (isPrevented(prevention, AddColRight)) {
|
|
33
|
-
preventions.push("AddColRight");
|
|
34
|
-
}
|
|
35
|
-
if (isPrevented(prevention, MoveFrom)) {
|
|
36
|
-
preventions.push("MoveFrom");
|
|
37
|
-
}
|
|
38
|
-
if (isPrevented(prevention, MoveTo)) {
|
|
39
|
-
preventions.push("MoveTo");
|
|
40
|
-
}
|
|
41
|
-
if (isPrevented(prevention, Write)) {
|
|
42
|
-
preventions.push("Write");
|
|
43
|
-
}
|
|
44
|
-
if (isPrevented(prevention, Style)) {
|
|
45
|
-
preventions.push("Style");
|
|
46
|
-
}
|
|
47
|
-
if (isPrevented(prevention, Resize)) {
|
|
48
|
-
preventions.push("Resize");
|
|
49
|
-
}
|
|
50
|
-
if (isPrevented(prevention, SetRenderer)) {
|
|
51
|
-
preventions.push("SetRenderer");
|
|
52
|
-
}
|
|
53
|
-
if (isPrevented(prevention, SetParser)) {
|
|
54
|
-
preventions.push("SetParser");
|
|
55
|
-
}
|
|
56
|
-
return preventions;
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
Add,
|
|
60
|
-
AddCol,
|
|
61
|
-
AddColLeft,
|
|
62
|
-
AddColRight,
|
|
63
|
-
AddRow,
|
|
64
|
-
AddRowAbove,
|
|
65
|
-
AddRowBelow,
|
|
66
|
-
Delete,
|
|
67
|
-
DeleteCol,
|
|
68
|
-
DeleteRow,
|
|
69
|
-
Move,
|
|
70
|
-
MoveFrom,
|
|
71
|
-
MoveTo,
|
|
72
|
-
ReadOnly,
|
|
73
|
-
Resize,
|
|
74
|
-
SetParser,
|
|
75
|
-
SetRenderer,
|
|
76
|
-
Style,
|
|
77
|
-
Update,
|
|
78
|
-
Write,
|
|
79
|
-
debugOperations,
|
|
80
|
-
isPrevented
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=prevention.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prevention.js","sources":["../../lib/prevention.ts"],"sourcesContent":["import { Prevention } from '../types';\n\nexport const DeleteRow: Prevention = 0b00000000000000000000000000000000000000000000000000001, // 1\n DeleteCol: Prevention = 0b00000000000000000000000000000000000000000000000000010, // 2\n AddRowAbove: Prevention = 0b00000000000000000000000000000000000000000000000000100, // 4\n AddRowBelow: Prevention = 0b00000000000000000000000000000000000000000000000001000, // 8\n AddColLeft: Prevention = 0b00000000000000000000000000000000000000000000000010000, // 16\n AddColRight: Prevention = 0b00000000000000000000000000000000000000000000000100000, // 32\n MoveFrom: Prevention = 0b00000000000000000000000000000000000000000000001000000, // 64\n MoveTo: Prevention = 0b00000000000000000000000000000000000000000000010000000, // 128\n Write: Prevention = 0b00000000000000000000000000000000000000000000100000000, // 256\n Style: Prevention = 0b00000000000000000000000000000000000000000001000000000, // 512\n Resize: Prevention = 0b00000000000000000000000000000000000000000010000000000, // 1024\n SetRenderer: Prevention = 0b00000000000000000000000000000000000000000100000000000, // 2048\n SetParser: Prevention = 0b00000000000000000000000000000000000000001000000000000; // 4096\n\nexport const Move: Prevention = MoveFrom | MoveTo; // 192\n\nexport const Update: Prevention = Write | Style | Resize | SetRenderer | SetParser; // 1792\n\nexport const AddRow: Prevention = AddRowAbove | AddRowBelow; // 12\n\nexport const AddCol: Prevention = AddColLeft | AddColRight; // 48\n\nexport const Add: Prevention = AddRow | AddCol; // 60\n\nexport const Delete: Prevention = DeleteRow | DeleteCol; // 3\n\nexport const ReadOnly: Prevention = Update | Delete | Add | Move; //\n\nexport const isPrevented = (prevention: Prevention | undefined, flag: Prevention) => {\n if (prevention === undefined) {\n return false;\n }\n return (prevention & flag) === flag;\n};\n\n// Don't use this function in production\nexport const debugOperations = (prevention: Prevention | undefined) => {\n const preventions: string[] = [];\n if (isPrevented(prevention, DeleteRow)) {\n preventions.push('DeleteRow');\n }\n if (isPrevented(prevention, DeleteCol)) {\n preventions.push('DeleteCol');\n }\n if (isPrevented(prevention, AddRowAbove)) {\n preventions.push('AddRowAbove');\n }\n if (isPrevented(prevention, AddRowBelow)) {\n preventions.push('AddRowBelow');\n }\n if (isPrevented(prevention, AddColLeft)) {\n preventions.push('AddColLeft');\n }\n if (isPrevented(prevention, AddColRight)) {\n preventions.push('AddColRight');\n }\n if (isPrevented(prevention, MoveFrom)) {\n preventions.push('MoveFrom');\n }\n if (isPrevented(prevention, MoveTo)) {\n preventions.push('MoveTo');\n }\n if (isPrevented(prevention, Write)) {\n preventions.push('Write');\n }\n if (isPrevented(prevention, Style)) {\n preventions.push('Style');\n }\n if (isPrevented(prevention, Resize)) {\n preventions.push('Resize');\n }\n if (isPrevented(prevention, SetRenderer)) {\n preventions.push('SetRenderer');\n }\n if (isPrevented(prevention, SetParser)) {\n preventions.push('SetParser');\n }\n return preventions;\n};\n"],"names":[],"mappings":"AAEa,MAAA,YAAwB,GACnC,YAAwB,GACxB,cAA0B,GAC1B,cAA0B,GAC1B,aAAyB,IACzB,cAA0B,IAC1B,WAAuB,IACvB,SAAqB,KACrB,QAAoB,KACpB,QAAoB,KACpB,SAAqB,MACrB,cAA0B,MAC1B,YAAwB;AAEnB,MAAM,OAAmB,WAAW;AAEpC,MAAM,SAAqB,QAAQ,QAAQ,SAAS,cAAc;AAElE,MAAM,SAAqB,cAAc;AAEzC,MAAM,SAAqB,aAAa;AAExC,MAAM,MAAkB,SAAS;AAEjC,MAAM,SAAqB,YAAY;AAEjC,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 -1,276 +0,0 @@
|
|
|
1
|
-
import { a2p, c2x, x2c, p2a } from "./converters.js";
|
|
2
|
-
const superposeArea = (srcArea, dstArea) => {
|
|
3
|
-
const { height: srcHeight, width: srcWidth } = areaShape(srcArea);
|
|
4
|
-
const { height: dstHeight, width: dstWidth } = areaShape(dstArea);
|
|
5
|
-
return {
|
|
6
|
-
height: srcHeight > dstHeight ? srcHeight : dstHeight,
|
|
7
|
-
width: srcWidth > dstWidth ? srcWidth : dstWidth
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
const concatAreas = (area1, area2) => {
|
|
11
|
-
const result = { ...area1 };
|
|
12
|
-
if (area2.left < area1.left) {
|
|
13
|
-
result.left = area2.left;
|
|
14
|
-
}
|
|
15
|
-
if (area2.right > area1.right) {
|
|
16
|
-
result.right = area2.right;
|
|
17
|
-
}
|
|
18
|
-
if (area2.top < area1.top) {
|
|
19
|
-
result.top = area2.top;
|
|
20
|
-
}
|
|
21
|
-
if (area2.bottom > area1.bottom) {
|
|
22
|
-
result.bottom = area2.bottom;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
const zoneToArea = (zone) => {
|
|
27
|
-
if (zone.endY === -1 || zone.endX === -1) {
|
|
28
|
-
return { top: -1, left: -1, bottom: -1, right: -1 };
|
|
29
|
-
}
|
|
30
|
-
const [top, bottom] = zone.startY < zone.endY ? [zone.startY, zone.endY] : [zone.endY, zone.startY];
|
|
31
|
-
const [left, right] = zone.startX < zone.endX ? [zone.startX, zone.endX] : [zone.endX, zone.startX];
|
|
32
|
-
return { top, left, bottom, right };
|
|
33
|
-
};
|
|
34
|
-
const areaToZone = (area) => {
|
|
35
|
-
return {
|
|
36
|
-
startY: area.top,
|
|
37
|
-
startX: area.left,
|
|
38
|
-
endY: area.bottom,
|
|
39
|
-
endX: area.right
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
const areaToRange = (area) => {
|
|
43
|
-
const { top, left, bottom, right } = area;
|
|
44
|
-
return `${p2a({ y: top, x: left })}:${p2a({
|
|
45
|
-
y: bottom,
|
|
46
|
-
x: right
|
|
47
|
-
})}`;
|
|
48
|
-
};
|
|
49
|
-
const between = (range2, index) => {
|
|
50
|
-
if (range2.start === -1 || range2.end === -1) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return range2.start <= index && index <= range2.end || range2.end <= index && index <= range2.start;
|
|
54
|
-
};
|
|
55
|
-
const among = (area, point) => {
|
|
56
|
-
if (area.top === -1 || area.left === -1 || area.bottom === -1 || area.right === -1) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
const { y, x } = point;
|
|
60
|
-
const { top, left, bottom, right } = area;
|
|
61
|
-
return top <= y && y <= bottom && left <= x && x <= right;
|
|
62
|
-
};
|
|
63
|
-
const zoneShape = ({ base = 0, ...zone }) => {
|
|
64
|
-
return {
|
|
65
|
-
height: base + Math.abs(zone.startY - zone.endY),
|
|
66
|
-
width: base + Math.abs(zone.startX - zone.endX)
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
const areaShape = ({ base = 0, ...area }) => {
|
|
70
|
-
return {
|
|
71
|
-
height: base + Math.abs(area.top - area.bottom),
|
|
72
|
-
width: base + Math.abs(area.left - area.right)
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
const matrixShape = ({ base = 0, matrix }) => {
|
|
76
|
-
const h = matrix.length;
|
|
77
|
-
if (h === 0) {
|
|
78
|
-
return { height: 0, width: 0 };
|
|
79
|
-
}
|
|
80
|
-
return { height: base + h, width: base + matrix[0].length };
|
|
81
|
-
};
|
|
82
|
-
const makeSequence = (start, stop, step = 1) => {
|
|
83
|
-
return Array.from({ length: (stop - start - 1) / step + 1 }, (_, i) => start + i * step);
|
|
84
|
-
};
|
|
85
|
-
const oa2aa = (oa, fields) => {
|
|
86
|
-
const aa = [];
|
|
87
|
-
oa.forEach((o) => {
|
|
88
|
-
const a = [];
|
|
89
|
-
fields.forEach((field) => {
|
|
90
|
-
a.push(o[field]);
|
|
91
|
-
});
|
|
92
|
-
aa.push(a);
|
|
93
|
-
});
|
|
94
|
-
return aa;
|
|
95
|
-
};
|
|
96
|
-
const aa2oa = (aa, fields) => {
|
|
97
|
-
const oa = [];
|
|
98
|
-
aa.forEach((a) => {
|
|
99
|
-
const o = {};
|
|
100
|
-
a.forEach((v, i) => {
|
|
101
|
-
if (i >= fields.length) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const field = fields[i];
|
|
105
|
-
o[field] = v;
|
|
106
|
-
});
|
|
107
|
-
oa.push(o);
|
|
108
|
-
});
|
|
109
|
-
return oa;
|
|
110
|
-
};
|
|
111
|
-
const putMatrix = (dst, src, dstArea, filter = () => true) => {
|
|
112
|
-
const lostRows = {};
|
|
113
|
-
const { top, left, bottom, right } = dstArea;
|
|
114
|
-
const { height: dstNumRows, width: dstNumCols } = matrixShape({
|
|
115
|
-
matrix: dst,
|
|
116
|
-
base: 1
|
|
117
|
-
});
|
|
118
|
-
for (let y = top; y <= bottom; y++) {
|
|
119
|
-
const lostRow = [];
|
|
120
|
-
for (let x = left; x <= right; x++) {
|
|
121
|
-
const value = src[y - top][x - left];
|
|
122
|
-
if (y < dstNumRows - 1 && x < dstNumCols - 1) {
|
|
123
|
-
if (filter(value, dst[y][x])) {
|
|
124
|
-
dst[y][x] = value;
|
|
125
|
-
}
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (lostRow.length === 0) {
|
|
129
|
-
lostRows[p2a({ y, x })] = [lostRow];
|
|
130
|
-
}
|
|
131
|
-
lostRow.push(value);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return lostRows;
|
|
135
|
-
};
|
|
136
|
-
const createMatrix = (numRows, numCols, fill) => {
|
|
137
|
-
return [...Array(numRows)].map(() => Array(numCols).fill(fill));
|
|
138
|
-
};
|
|
139
|
-
const constructInitialCellsOrigin = ({
|
|
140
|
-
cells = {},
|
|
141
|
-
ensured = {},
|
|
142
|
-
matrix = [],
|
|
143
|
-
flattenAs = "value"
|
|
144
|
-
}) => {
|
|
145
|
-
return constructInitialCells({
|
|
146
|
-
cells,
|
|
147
|
-
ensured,
|
|
148
|
-
matrices: { A1: matrix },
|
|
149
|
-
flattenAs
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
const constructInitialCells = ({
|
|
153
|
-
cells = {},
|
|
154
|
-
ensured = {},
|
|
155
|
-
matrices = {},
|
|
156
|
-
flattenAs = "value"
|
|
157
|
-
} = {}) => {
|
|
158
|
-
upsert({ cells, flattenAs, matrices });
|
|
159
|
-
const { numRows, numCols } = Object.assign({ numRows: 1, numCols: 1 }, ensured);
|
|
160
|
-
const rightBottom = p2a({ y: numRows, x: numCols });
|
|
161
|
-
if (cells[rightBottom] == null) {
|
|
162
|
-
cells[rightBottom] = {};
|
|
163
|
-
}
|
|
164
|
-
return cells;
|
|
165
|
-
};
|
|
166
|
-
const upsert = ({
|
|
167
|
-
cells = {},
|
|
168
|
-
matrices = {},
|
|
169
|
-
flattenAs
|
|
170
|
-
}) => {
|
|
171
|
-
Object.keys(matrices).forEach((baseAddress) => {
|
|
172
|
-
const matrix = matrices[baseAddress];
|
|
173
|
-
const { y: baseY, x: baseX } = a2p(baseAddress);
|
|
174
|
-
matrix.forEach((row, y) => {
|
|
175
|
-
row.forEach((e, x) => {
|
|
176
|
-
const id = p2a({ y: baseY + y, x: baseX + x });
|
|
177
|
-
if (flattenAs) {
|
|
178
|
-
const cell = cells[id];
|
|
179
|
-
cells[id] = { [flattenAs]: e, ...cell };
|
|
180
|
-
} else {
|
|
181
|
-
cells[id] = e;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
return cells;
|
|
187
|
-
};
|
|
188
|
-
const getMaxSizesFromCells = (cells = {}) => {
|
|
189
|
-
let [lastY, lastX] = [0, 0];
|
|
190
|
-
Object.keys(cells).map((address) => {
|
|
191
|
-
const { y, x } = a2p(address);
|
|
192
|
-
if (lastY < y) {
|
|
193
|
-
lastY = y;
|
|
194
|
-
}
|
|
195
|
-
if (lastX < x) {
|
|
196
|
-
lastX = x;
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
return { numRows: lastY, numCols: lastX };
|
|
200
|
-
};
|
|
201
|
-
const range = (start, end) => {
|
|
202
|
-
const list = [];
|
|
203
|
-
for (let i = start; i <= end; i++) {
|
|
204
|
-
list.push(i);
|
|
205
|
-
}
|
|
206
|
-
return list;
|
|
207
|
-
};
|
|
208
|
-
const complementSelectingArea = (selectingArea, choosing) => {
|
|
209
|
-
if (selectingArea.left === -1) {
|
|
210
|
-
selectingArea = {
|
|
211
|
-
left: choosing.x,
|
|
212
|
-
top: choosing.y,
|
|
213
|
-
right: choosing.x,
|
|
214
|
-
bottom: choosing.y
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
return selectingArea;
|
|
218
|
-
};
|
|
219
|
-
const expandRange = (range2) => {
|
|
220
|
-
if (range2.indexOf(":") === -1) {
|
|
221
|
-
return [range2];
|
|
222
|
-
}
|
|
223
|
-
const result = [];
|
|
224
|
-
const isRowRange = /^\d+\:\d+$/.test(range2);
|
|
225
|
-
if (isRowRange) {
|
|
226
|
-
const [startRow2, endRow2] = range2.split(":").map(Number);
|
|
227
|
-
for (let row = startRow2; row <= endRow2; row++) {
|
|
228
|
-
result.push(`${row}`);
|
|
229
|
-
}
|
|
230
|
-
return result;
|
|
231
|
-
}
|
|
232
|
-
const match = range2.match(/^([A-Z]*)(\d+)?\:([A-Z]*)(\d+)?$/);
|
|
233
|
-
if (!match) {
|
|
234
|
-
console.error("Invalid range format", range2);
|
|
235
|
-
return [range2];
|
|
236
|
-
}
|
|
237
|
-
const [, startCol, startRow, endCol, endRow] = match;
|
|
238
|
-
const startColIndex = startCol ? c2x(startCol) : 1;
|
|
239
|
-
const endColIndex = endCol ? c2x(endCol) : 1;
|
|
240
|
-
for (let col = startColIndex; col <= endColIndex; col++) {
|
|
241
|
-
const currentColumn = startCol || endCol ? x2c(col) : "";
|
|
242
|
-
if (startRow && endRow) {
|
|
243
|
-
for (let row = Number(startRow); row <= Number(endRow); row++) {
|
|
244
|
-
result.push(`${currentColumn}${row}`);
|
|
245
|
-
}
|
|
246
|
-
} else if (!startRow && !endRow) {
|
|
247
|
-
result.push(currentColumn);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return result;
|
|
251
|
-
};
|
|
252
|
-
export {
|
|
253
|
-
aa2oa,
|
|
254
|
-
among,
|
|
255
|
-
areaShape,
|
|
256
|
-
areaToRange,
|
|
257
|
-
areaToZone,
|
|
258
|
-
between,
|
|
259
|
-
complementSelectingArea,
|
|
260
|
-
concatAreas,
|
|
261
|
-
constructInitialCells,
|
|
262
|
-
constructInitialCellsOrigin,
|
|
263
|
-
createMatrix,
|
|
264
|
-
expandRange,
|
|
265
|
-
getMaxSizesFromCells,
|
|
266
|
-
makeSequence,
|
|
267
|
-
matrixShape,
|
|
268
|
-
oa2aa,
|
|
269
|
-
putMatrix,
|
|
270
|
-
range,
|
|
271
|
-
superposeArea,
|
|
272
|
-
upsert,
|
|
273
|
-
zoneShape,
|
|
274
|
-
zoneToArea
|
|
275
|
-
};
|
|
276
|
-
//# sourceMappingURL=structs.js.map
|
package/dist/lib/structs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structs.js","sources":["../../lib/structs.ts"],"sourcesContent":["import type {\n MatrixType,\n AreaType,\n ZoneType,\n RangeType,\n PointType,\n Y,\n X,\n CellsByAddressType,\n ShapeType,\n MatricesByAddress,\n CellType,\n Address,\n} from '../types';\nimport { a2p, p2a, x2c, c2x } from './converters';\n\nexport const slideArea = (area: AreaType, y: Y, x: X): AreaType => {\n const { top, left, bottom, right } = area;\n return { top: top + y, left: left + x, bottom: bottom + y, right: right + x };\n};\n\nexport const superposeArea = (srcArea: AreaType, dstArea: AreaType): ShapeType => {\n const { height: srcHeight, width: srcWidth } = areaShape(srcArea);\n const { height: dstHeight, width: dstWidth } = areaShape(dstArea);\n\n // biggerHeight, biggerWidth\n return {\n height: srcHeight > dstHeight ? srcHeight : dstHeight,\n width: srcWidth > dstWidth ? srcWidth : dstWidth,\n };\n};\n\nexport const concatAreas = (area1: AreaType, area2: AreaType): AreaType => {\n const result: AreaType = { ...area1 };\n if (area2.left < area1.left) {\n result.left = area2.left;\n }\n if (area2.right > area1.right) {\n result.right = area2.right;\n }\n if (area2.top < area1.top) {\n result.top = area2.top;\n }\n if (area2.bottom > area1.bottom) {\n result.bottom = area2.bottom;\n }\n return result;\n};\n\nexport const zoneToArea = (zone: ZoneType): AreaType => {\n if (zone.endY === -1 || zone.endX === -1) {\n return { top: -1, left: -1, bottom: -1, right: -1 };\n }\n const [top, bottom] = zone.startY < zone.endY ? [zone.startY, zone.endY] : [zone.endY, zone.startY];\n const [left, right] = zone.startX < zone.endX ? [zone.startX, zone.endX] : [zone.endX, zone.startX];\n return { top, left, bottom, right };\n};\n\nexport const areaToZone = (area: AreaType): ZoneType => {\n return {\n startY: area.top,\n startX: area.left,\n endY: area.bottom,\n endX: area.right,\n };\n};\n\nexport const areaToRange = (area: AreaType): string => {\n const { top, left, bottom, right } = area;\n return `${p2a({ y: top, x: left })}:${p2a({\n y: bottom,\n x: right,\n })}`;\n};\n\nexport const between = (range: RangeType, index: number) => {\n if (range.start === -1 || range.end === -1) {\n return false;\n }\n return (range.start <= index && index <= range.end) || (range.end <= index && index <= range.start);\n};\n\nexport const among = (area: AreaType, point: PointType) => {\n if (area.top === -1 || area.left === -1 || area.bottom === -1 || area.right === -1) {\n return false;\n }\n const { y, x } = point;\n const { top, left, bottom, right } = area;\n return top <= y && y <= bottom && left <= x && x <= right;\n};\n\ntype ShapeExtension = { base?: number };\n\nexport const zoneShape = ({ base = 0, ...zone }: ZoneType & ShapeExtension): ShapeType => {\n return {\n height: base + Math.abs(zone.startY - zone.endY),\n width: base + Math.abs(zone.startX - zone.endX),\n };\n};\n\nexport const areaShape = ({ base = 0, ...area }: AreaType & ShapeExtension): ShapeType => {\n return {\n height: base + Math.abs(area.top - area.bottom),\n width: base + Math.abs(area.left - area.right),\n };\n};\n\nexport const matrixShape = ({ base = 0, matrix }: { matrix: MatrixType } & ShapeExtension): ShapeType => {\n const h = matrix.length;\n if (h === 0) {\n return { height: 0, width: 0 };\n }\n return { height: base + h, width: base + matrix[0].length };\n};\n\nexport const makeSequence = (start: number, stop: number, step: number = 1) => {\n return Array.from({ length: (stop - start - 1) / step + 1 }, (_, i) => start + i * step);\n};\n\nexport const oa2aa = (oa: { [s: string]: any }[], fields: string[]): MatrixType => {\n const aa: any[][] = [];\n oa.forEach((o) => {\n const a: any[] = [];\n fields.forEach((field) => {\n a.push(o[field]);\n });\n aa.push(a);\n });\n return aa;\n};\n\nexport const aa2oa = (aa: MatrixType, fields: string[]): { [s: string]: any }[] => {\n const oa: { [s: string]: any }[] = [];\n aa.forEach((a) => {\n const o: { [s: string]: any } = {};\n a.forEach((v, i) => {\n if (i >= fields.length) {\n return;\n }\n const field = fields[i];\n o[field] = v;\n });\n oa.push(o);\n });\n return oa;\n};\n\nexport const putMatrix = <T = any>(\n dst: T[][],\n src: T[][],\n dstArea: AreaType,\n filter: (newValue: T, currentValue: T) => boolean = () => true,\n) => {\n const lostRows: MatricesByAddress<T> = {};\n const { top, left, bottom, right } = dstArea;\n const { height: dstNumRows, width: dstNumCols } = matrixShape({\n matrix: dst,\n base: 1,\n });\n for (let y = top; y <= bottom; y++) {\n const lostRow: T[] = [];\n for (let x = left; x <= right; x++) {\n const value = src[y - top][x - left];\n // -1 means excluding headers\n if (y < dstNumRows - 1 && x < dstNumCols - 1) {\n if (filter(value, dst[y][x])) {\n dst[y][x] = value;\n }\n continue;\n }\n if (lostRow.length === 0) {\n lostRows[p2a({ y, x })] = [lostRow];\n }\n lostRow.push(value);\n }\n }\n return lostRows;\n};\n\nexport const createMatrix = <T = any>(numRows: number, numCols: number, fill?: T): T[][] => {\n return [...Array(numRows)].map(() => Array(numCols).fill(fill));\n};\n\nexport const cropMatrix = <T = any>(matrix: T[][], area: AreaType): T[][] => {\n const { top, left, bottom, right } = area;\n return matrix.slice(top, bottom + 1).map((cols) => cols.slice(left, right + 1));\n};\n\nexport const constructInitialCellsOrigin = ({\n cells = {},\n ensured = {},\n matrix = [],\n flattenAs = 'value',\n}: {\n cells?: CellsByAddressType;\n ensured?: {\n numRows?: number;\n numCols?: number;\n };\n flattenAs?: keyof CellType;\n matrix?: MatrixType;\n}) => {\n return constructInitialCells({\n cells,\n ensured,\n matrices: { A1: matrix },\n flattenAs,\n });\n};\n\nexport const constructInitialCells = ({\n cells = {},\n ensured = {},\n matrices = {},\n flattenAs = 'value',\n}: {\n cells?: CellsByAddressType;\n ensured?: {\n numRows?: number;\n numCols?: number;\n };\n flattenAs?: keyof CellType;\n matrices?: MatricesByAddress<any>;\n} = {}) => {\n upsert({ cells, flattenAs, matrices });\n const { numRows, numCols } = Object.assign({ numRows: 1, numCols: 1 }, ensured);\n const rightBottom = p2a({ y: numRows, x: numCols });\n if (cells[rightBottom] == null) {\n cells[rightBottom] = {};\n }\n return cells;\n};\n\nexport const upsert = <T>({\n cells = {},\n matrices = {},\n flattenAs,\n}: {\n cells?: CellsByAddressType;\n flattenAs?: keyof CellType;\n matrices?: MatricesByAddress<T>;\n}) => {\n Object.keys(matrices).forEach((baseAddress) => {\n const matrix = matrices[baseAddress];\n const { y: baseY, x: baseX } = a2p(baseAddress);\n matrix.forEach((row, y) => {\n row.forEach((e, x) => {\n const id = p2a({ y: baseY + y, x: baseX + x });\n if (flattenAs) {\n const cell = cells[id];\n cells[id] = { [flattenAs]: e, ...cell };\n } else {\n cells[id] = e as CellType;\n }\n });\n });\n });\n return cells;\n};\n\nexport const getMaxSizesFromCells = (cells: CellsByAddressType = {}) => {\n let [lastY, lastX] = [0, 0];\n Object.keys(cells).map((address) => {\n const { y, x } = a2p(address);\n if (lastY < y) {\n lastY = y;\n }\n if (lastX < x) {\n lastX = x;\n }\n });\n return { numRows: lastY, numCols: lastX };\n};\n\nexport const range = (start: number, end: number) => {\n const list: number[] = [];\n for (let i = start; i <= end; i++) {\n list.push(i);\n }\n return list;\n};\n\nexport const complementSelectingArea = (selectingArea: AreaType, choosing: PointType) => {\n if (selectingArea.left === -1) {\n selectingArea = {\n left: choosing.x,\n top: choosing.y,\n right: choosing.x,\n bottom: choosing.y,\n };\n }\n return selectingArea;\n};\n\nexport const isSameArea = (area1: AreaType, area2: AreaType) => {\n if (area1.top !== area2.top) {\n return false;\n }\n if (area1.left !== area2.left) {\n return false;\n }\n if (area1.bottom !== area2.bottom) {\n return false;\n }\n if (area1.right !== area2.right) {\n return false;\n }\n return true;\n};\n\nexport const expandRange = (range: string): Address[] => {\n if (range.indexOf(':') === -1) {\n return [range];\n }\n\n const result: Address[] = [];\n\n const isRowRange = /^\\d+\\:\\d+$/.test(range);\n\n if (isRowRange) {\n const [startRow, endRow] = range.split(':').map(Number);\n for (let row = startRow; row <= endRow; row++) {\n result.push(`${row}`);\n }\n return result;\n }\n\n const match = range.match(/^([A-Z]*)(\\d+)?\\:([A-Z]*)(\\d+)?$/);\n if (!match) {\n console.error('Invalid range format', range);\n return [range];\n }\n\n const [, startCol, startRow, endCol, endRow] = match;\n const startColIndex = startCol ? c2x(startCol) : 1;\n const endColIndex = endCol ? c2x(endCol) : 1;\n\n for (let col = startColIndex; col <= endColIndex; col++) {\n const currentColumn = startCol || endCol ? x2c(col) : '';\n if (startRow && endRow) {\n for (let row = Number(startRow); row <= Number(endRow); row++) {\n result.push(`${currentColumn}${row}`);\n }\n } else if (!startRow && !endRow) {\n result.push(currentColumn);\n }\n }\n return result;\n};\n"],"names":["range","startRow","endRow"],"mappings":";AAqBa,MAAA,gBAAgB,CAAC,SAAmB,YAAiC;AAChF,QAAM,EAAE,QAAQ,WAAW,OAAO,SAAS,IAAI,UAAU,OAAO;AAChE,QAAM,EAAE,QAAQ,WAAW,OAAO,SAAS,IAAI,UAAU,OAAO;AAGz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