@gridsheet/react-core 1.4.0 → 2.0.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/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 +8 -0
- package/dist/components/StoreObserver.d.ts.map +1 -0
- package/dist/components/Tabular.d.ts +2 -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 +21 -10
- 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.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.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/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/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.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9914 -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 +39 -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/sheet.d.ts +3 -0
- package/dist/lib/sheet.d.ts.map +1 -0
- package/dist/lib/structs.d.ts +7 -3
- package/dist/lib/structs.d.ts.map +1 -1
- package/dist/lib/table.d.ts +137 -76
- 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.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 +36 -25
- package/dist/renderers/core.d.ts.map +1 -1
- package/dist/renderers/thousand_separator.d.ts.map +1 -1
- package/dist/store/actions.d.ts +25 -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/types.d.ts +108 -50
- 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
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
const CheckboxRendererMixin = {
|
|
3
|
-
bool(value, writer) {
|
|
4
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
-
"input",
|
|
6
|
-
{
|
|
7
|
-
type: "checkbox",
|
|
8
|
-
checked: value,
|
|
9
|
-
onChange: (e) => {
|
|
10
|
-
writer && writer(e.currentTarget.checked.toString());
|
|
11
|
-
e.currentTarget.blur();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
CheckboxRendererMixin
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../renderers/checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { WriterType } from '../types';\n\nexport const CheckboxRendererMixin = {\n bool(value: boolean, writer?: WriterType): any {\n return (\n <input\n type=\"checkbox\"\n checked={value}\n onChange={(e) => {\n writer && writer(e.currentTarget.checked.toString());\n e.currentTarget.blur();\n }}\n />\n );\n },\n};\n"],"names":[],"mappings":";AAGO,MAAM,wBAAwB;AAAA,EACnC,KAAK,OAAgB,QAA0B;AAE3C,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU,CAAC,MAAM;AACf,oBAAU,OAAO,EAAE,cAAc,QAAQ,UAAU;AACnD,YAAE,cAAc,KAAK;AAAA,QAAA;AAAA,MACvB;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
package/dist/renderers/core.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import dayjs from "../_virtual/dayjs.min.js";
|
|
2
|
-
import { Table } from "../lib/table.js";
|
|
3
|
-
import { solveFormula } from "../formula/solver.js";
|
|
4
|
-
import { FormulaError } from "../formula/evaluator.js";
|
|
5
|
-
import { p2a } from "../lib/converters.js";
|
|
6
|
-
import { TimeDelta } from "../lib/time.js";
|
|
7
|
-
class Renderer {
|
|
8
|
-
constructor(props) {
|
|
9
|
-
this.datetimeFormat = "YYYY-MM-DD HH:mm:ss";
|
|
10
|
-
this.dateFormat = "YYYY-MM-DD";
|
|
11
|
-
this.timeDeltaFormat = "HH:mm:ss";
|
|
12
|
-
this.applyMixins(props == null ? void 0 : props.mixins);
|
|
13
|
-
if (props == null) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const { condition, complement } = props;
|
|
17
|
-
this.condition = condition;
|
|
18
|
-
this.complement = complement;
|
|
19
|
-
}
|
|
20
|
-
applyMixins(mixins) {
|
|
21
|
-
if (mixins == null) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
for (const mixin of mixins) {
|
|
25
|
-
for (const key in mixin) {
|
|
26
|
-
this[key] = mixin[key];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
call(table, point, writer) {
|
|
31
|
-
const address = p2a(point);
|
|
32
|
-
const cache = table.getSolvedCache(address);
|
|
33
|
-
const cell = table.getByPoint(point);
|
|
34
|
-
let value = cache || (cell == null ? void 0 : cell.value);
|
|
35
|
-
if (typeof value === "string" && !(cell == null ? void 0 : cell.disableFormula)) {
|
|
36
|
-
if (value[0] === "'") {
|
|
37
|
-
value = value.substring(1);
|
|
38
|
-
} else if (value[0] === "=") {
|
|
39
|
-
value = solveFormula({ value, table, raise: true, origin: point });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return this.render(value, table, writer, point);
|
|
43
|
-
}
|
|
44
|
-
render(value, table, writer, position) {
|
|
45
|
-
var _a;
|
|
46
|
-
if (this.condition && !this.condition(value)) {
|
|
47
|
-
return this.complement ? this.complement(value) : this.stringify({ value });
|
|
48
|
-
}
|
|
49
|
-
switch (typeof value) {
|
|
50
|
-
case "object":
|
|
51
|
-
if (value instanceof Date) {
|
|
52
|
-
return this.date(value, writer, position);
|
|
53
|
-
}
|
|
54
|
-
if (TimeDelta.is(value)) {
|
|
55
|
-
return this.timedelta(TimeDelta.ensure(value), writer, position);
|
|
56
|
-
}
|
|
57
|
-
if (value == null) {
|
|
58
|
-
return this.null(value, writer, position);
|
|
59
|
-
}
|
|
60
|
-
if (value instanceof Table) {
|
|
61
|
-
return this.render((_a = value.getByPoint({ y: value.top, x: value.left })) == null ? void 0 : _a.value, table, writer, position);
|
|
62
|
-
}
|
|
63
|
-
if (Array.isArray(value)) {
|
|
64
|
-
return this.array(value, writer, position);
|
|
65
|
-
}
|
|
66
|
-
if (value instanceof FormulaError) {
|
|
67
|
-
throw value;
|
|
68
|
-
}
|
|
69
|
-
return this.object(value, writer, position);
|
|
70
|
-
case "string":
|
|
71
|
-
return this.string(value, table, writer, position);
|
|
72
|
-
case "number":
|
|
73
|
-
return this.number(value, writer, position);
|
|
74
|
-
case "boolean":
|
|
75
|
-
return this.bool(value, writer, position);
|
|
76
|
-
case "undefined":
|
|
77
|
-
return this.undefined(value, writer, position);
|
|
78
|
-
case "function":
|
|
79
|
-
return value();
|
|
80
|
-
}
|
|
81
|
-
return "";
|
|
82
|
-
}
|
|
83
|
-
stringify(cell, position) {
|
|
84
|
-
const { value } = cell;
|
|
85
|
-
if (value instanceof Date) {
|
|
86
|
-
return this.date(value);
|
|
87
|
-
}
|
|
88
|
-
if (TimeDelta.is(value)) {
|
|
89
|
-
return this.timedelta(TimeDelta.ensure(value));
|
|
90
|
-
}
|
|
91
|
-
if (value == null) {
|
|
92
|
-
return "";
|
|
93
|
-
}
|
|
94
|
-
return value.toString();
|
|
95
|
-
}
|
|
96
|
-
string(value, table, writer, position) {
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
bool(value, writer, position) {
|
|
100
|
-
return value ? "TRUE" : "FALSE";
|
|
101
|
-
}
|
|
102
|
-
number(value, writer, position) {
|
|
103
|
-
if (isNaN(value)) {
|
|
104
|
-
return "NaN";
|
|
105
|
-
}
|
|
106
|
-
return value;
|
|
107
|
-
}
|
|
108
|
-
date(value, writer, position) {
|
|
109
|
-
if (value.getHours() + value.getMinutes() + value.getSeconds() === 0) {
|
|
110
|
-
return dayjs(value).format(this.dateFormat);
|
|
111
|
-
}
|
|
112
|
-
return dayjs(value).format(this.datetimeFormat);
|
|
113
|
-
}
|
|
114
|
-
timedelta(value, writer, position) {
|
|
115
|
-
return value.stringify(this.timeDeltaFormat);
|
|
116
|
-
}
|
|
117
|
-
array(value, writer, position) {
|
|
118
|
-
return value.map((v) => this.stringify({ value: v })).join(",");
|
|
119
|
-
}
|
|
120
|
-
object(value, writer, position) {
|
|
121
|
-
return JSON.stringify(value);
|
|
122
|
-
}
|
|
123
|
-
null(value, writer, position) {
|
|
124
|
-
return "";
|
|
125
|
-
}
|
|
126
|
-
undefined(value, writer, position) {
|
|
127
|
-
return "";
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
const defaultRenderer = new Renderer();
|
|
131
|
-
export {
|
|
132
|
-
Renderer,
|
|
133
|
-
defaultRenderer
|
|
134
|
-
};
|
|
135
|
-
//# sourceMappingURL=core.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../renderers/core.ts"],"sourcesContent":["import dayjs from 'dayjs';\n\nimport { CellType, PointType, WriterType } from '../types';\nimport { Table, UserTable } from '../lib/table';\nimport { solveFormula } from '../formula/solver';\nimport { FormulaError } from '../formula/evaluator';\nimport { p2a } from '../lib/converters';\nimport { TimeDelta } from '../lib/time';\n\ntype Condition = (value: any) => boolean;\n\ntype Stringify = (value: any) => string;\n\ntype Props = {\n condition?: Condition;\n complement?: Stringify;\n mixins?: RendererMixinType[];\n};\n\nexport interface RendererMixinType {\n datetimeFormat?: string;\n dateFormat?: string;\n timeDeltaFormat?: string;\n\n render?(value: any, table: UserTable, writer?: WriterType, position?: PointType): any;\n stringify?(cell: CellType): string;\n string?(value: string, table: UserTable, writer?: WriterType, position?: PointType): any;\n bool?(value: boolean, writer?: WriterType, position?: PointType): any;\n number?(value: number, writer?: WriterType, position?: PointType): any;\n date?(value: Date, writer?: WriterType, position?: PointType): any;\n timedelta?(value: TimeDelta, writer?: WriterType, position?: PointType): any;\n array?(value: any[], writer?: WriterType, position?: PointType): any;\n object?(value: any, writer?: WriterType, position?: PointType): any;\n null?(value: null, writer?: WriterType, position?: PointType): any;\n undefined?(value: undefined, writer?: WriterType, position?: PointType): any;\n}\n\nexport class Renderer implements RendererMixinType {\n public datetimeFormat: string = 'YYYY-MM-DD HH:mm:ss';\n public dateFormat: string = 'YYYY-MM-DD';\n public timeDeltaFormat: string = 'HH:mm:ss';\n private condition?: Condition;\n private complement?: Stringify;\n\n constructor(props?: Props) {\n this.applyMixins(props?.mixins);\n if (props == null) {\n return;\n }\n const { condition, complement } = props;\n this.condition = condition;\n this.complement = complement;\n }\n\n private applyMixins(mixins?: RendererMixinType[]) {\n if (mixins == null) {\n return;\n }\n for (const mixin of mixins) {\n for (const key in mixin) {\n // @ts-expect-error mixin has the same fields as this\n this[key] = mixin[key];\n }\n }\n }\n\n public call(table: Table, point: PointType, writer?: WriterType): any {\n const address = p2a(point);\n const cache = table.getSolvedCache(address);\n const cell = table.getByPoint(point);\n let value = cache || cell?.value;\n if (typeof value === 'string' && !cell?.disableFormula) {\n if (value[0] === \"'\") {\n value = value.substring(1);\n } else if (value[0] === '=') {\n value = solveFormula({ value, table, raise: true, origin: point });\n }\n }\n return this.render(value, table, writer, point);\n }\n\n public render(value: any, table: Table, writer?: WriterType, position?: PointType): any {\n if (this.condition && !this.condition(value)) {\n return this.complement ? this.complement(value) : this.stringify({ value });\n }\n\n switch (typeof value) {\n case 'object':\n if (value instanceof Date) {\n return this.date(value, writer, position);\n }\n if (TimeDelta.is(value)) {\n return this.timedelta(TimeDelta.ensure(value), writer, position);\n }\n if (value == null) {\n return this.null(value, writer, position);\n }\n if (value instanceof Table) {\n return this.render(value.getByPoint({ y: value.top, x: value.left })?.value, table, writer, position);\n }\n if (Array.isArray(value)) {\n return this.array(value, writer, position);\n }\n if (value instanceof FormulaError) {\n throw value;\n }\n return this.object(value, writer, position);\n case 'string':\n return this.string(value, table, writer, position);\n case 'number':\n return this.number(value, writer, position);\n case 'boolean':\n return this.bool(value, writer, position);\n case 'undefined':\n return this.undefined(value, writer, position);\n case 'function':\n return value() as string;\n }\n return '';\n }\n\n stringify(cell: CellType, position?: PointType): string {\n const { value } = cell;\n if (value instanceof Date) {\n return this.date(value);\n }\n if (TimeDelta.is(value)) {\n return this.timedelta(TimeDelta.ensure(value));\n }\n if (value == null) {\n return '';\n }\n\n return value.toString();\n }\n\n string(value: string, table: Table, writer?: WriterType, position?: PointType): any {\n return value;\n }\n\n bool(value: boolean, writer?: WriterType, position?: PointType): any {\n return value ? 'TRUE' : 'FALSE';\n }\n\n number(value: number, writer?: WriterType, position?: PointType): any {\n if (isNaN(value)) {\n return 'NaN';\n }\n return value;\n }\n\n date(value: Date, writer?: WriterType, position?: PointType): any {\n if (value.getHours() + value.getMinutes() + value.getSeconds() === 0) {\n return dayjs(value).format(this.dateFormat);\n }\n return dayjs(value).format(this.datetimeFormat);\n }\n\n timedelta(value: TimeDelta, writer?: WriterType, position?: PointType): any {\n return value.stringify(this.timeDeltaFormat);\n }\n\n array(value: any[], writer?: WriterType, position?: PointType): any {\n return value.map((v) => this.stringify({ value: v })).join(',');\n }\n\n object(value: any, writer?: WriterType, position?: PointType): any {\n return JSON.stringify(value);\n }\n\n null(value: any, writer?: WriterType, position?: PointType): any {\n return '';\n }\n\n undefined(value: undefined, writer?: WriterType, position?: PointType): any {\n return '';\n }\n}\n\nexport type RendererType = Renderer;\nexport const defaultRenderer = new Renderer();\n"],"names":[],"mappings":";;;;;;AAqCO,MAAM,SAAsC;AAAA,EAOjD,YAAY,OAAe;AAN3B,SAAO,iBAAyB;AAChC,SAAO,aAAqB;AAC5B,SAAO,kBAA0B;AAK1B,SAAA,YAAY,+BAAO,MAAM;AAC9B,QAAI,SAAS,MAAM;AACjB;AAAA,IAAA;AAEI,UAAA,EAAE,WAAW,WAAA,IAAe;AAClC,SAAK,YAAY;AACjB,SAAK,aAAa;AAAA,EAAA;AAAA,EAGZ,YAAY,QAA8B;AAChD,QAAI,UAAU,MAAM;AAClB;AAAA,IAAA;AAEF,eAAW,SAAS,QAAQ;AAC1B,iBAAW,OAAO,OAAO;AAElB,aAAA,GAAG,IAAI,MAAM,GAAG;AAAA,MAAA;AAAA,IACvB;AAAA,EACF;AAAA,EAGK,KAAK,OAAc,OAAkB,QAA0B;AAC9D,UAAA,UAAU,IAAI,KAAK;AACnB,UAAA,QAAQ,MAAM,eAAe,OAAO;AACpC,UAAA,OAAO,MAAM,WAAW,KAAK;AAC/B,QAAA,QAAQ,UAAS,6BAAM;AAC3B,QAAI,OAAO,UAAU,YAAY,EAAC,6BAAM,iBAAgB;AAClD,UAAA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AA;AAAA,EAGhE,OAAO,OAAY,QAAqB,UAA2B;AAC1D,WAAA,KAAK,UAAU,KAAK;AAAA,EAAA;AAAA,EAG7B,KAAK,OAAY,QAAqB,UAA2B;AACxD,WAAA;AAAA,EAAA;AAAA,EAGT,UAAU,OAAkB,QAAqB,UAA2B;AACnE,WAAA;AAAA,EAAA;AAEX;AAGa,MAAA,kBAAkB,IAAI,SAAS;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const ThousandSeparatorRendererMixin = {
|
|
2
|
-
number(value) {
|
|
3
|
-
if (isNaN(value)) {
|
|
4
|
-
return "NaN";
|
|
5
|
-
}
|
|
6
|
-
const [int, fraction] = String(value).split(".");
|
|
7
|
-
const result = int.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
|
8
|
-
if (fraction == null) {
|
|
9
|
-
return result;
|
|
10
|
-
}
|
|
11
|
-
return `${result}.${fraction}`;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
ThousandSeparatorRendererMixin
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=thousand_separator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thousand_separator.js","sources":["../../renderers/thousand_separator.ts"],"sourcesContent":["export const ThousandSeparatorRendererMixin = {\n number(value: number): any {\n if (isNaN(value)) {\n return 'NaN';\n }\n const [int, fraction] = String(value).split('.');\n const result = int.replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1,');\n if (fraction == null) {\n return result;\n }\n return `${result}.${fraction}`;\n },\n};\n"],"names":[],"mappings":"AAAO,MAAM,iCAAiC;AAAA,EAC5C,OAAO,OAAoB;AACrB,QAAA,MAAM,KAAK,GAAG;AACT,aAAA;AAAA,IAAA;AAEH,UAAA,CAAC,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,MAAM,GAAG;AAC/C,UAAM,SAAS,IAAI,QAAQ,4BAA4B,KAAK;AAC5D,QAAI,YAAY,MAAM;AACb,aAAA;AAAA,IAAA;AAEF,WAAA,GAAG,MAAM,IAAI,QAAQ;AAAA,EAAA;AAEhC;"}
|