@rowsncolumns/spreadsheet-state 28.0.66
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.md +100 -0
- package/Readme.md +65 -0
- package/dist/cjs/api/border.d.ts +9 -0
- package/dist/cjs/api/border.d.ts.map +1 -0
- package/dist/cjs/api/border.js +25 -0
- package/dist/cjs/api/conditional-format.d.ts +2 -0
- package/dist/cjs/api/conditional-format.d.ts.map +1 -0
- package/dist/cjs/api/conditional-format.js +5 -0
- package/dist/cjs/api/copy-paste.d.ts +20 -0
- package/dist/cjs/api/copy-paste.d.ts.map +1 -0
- package/dist/cjs/api/copy-paste.js +384 -0
- package/dist/cjs/api/data-validation.d.ts +2 -0
- package/dist/cjs/api/data-validation.d.ts.map +1 -0
- package/dist/cjs/api/data-validation.js +5 -0
- package/dist/cjs/api/datatype.d.ts +89 -0
- package/dist/cjs/api/datatype.d.ts.map +1 -0
- package/dist/cjs/api/datatype.js +671 -0
- package/dist/cjs/api/date.d.ts +27 -0
- package/dist/cjs/api/date.d.ts.map +1 -0
- package/dist/cjs/api/date.js +222 -0
- package/dist/cjs/api/decimals.d.ts +10 -0
- package/dist/cjs/api/decimals.d.ts.map +1 -0
- package/dist/cjs/api/decimals.js +192 -0
- package/dist/cjs/api/dependency.d.ts +64 -0
- package/dist/cjs/api/dependency.d.ts.map +1 -0
- package/dist/cjs/api/dependency.js +279 -0
- package/dist/cjs/api/fill.d.ts +88 -0
- package/dist/cjs/api/fill.d.ts.map +1 -0
- package/dist/cjs/api/fill.js +959 -0
- package/dist/cjs/api/filter-range.d.ts +4 -0
- package/dist/cjs/api/filter-range.d.ts.map +1 -0
- package/dist/cjs/api/filter-range.js +101 -0
- package/dist/cjs/api/filter.d.ts +24 -0
- package/dist/cjs/api/filter.d.ts.map +1 -0
- package/dist/cjs/api/filter.js +66 -0
- package/dist/cjs/api/format-caches.d.ts +43 -0
- package/dist/cjs/api/format-caches.d.ts.map +1 -0
- package/dist/cjs/api/format-caches.js +107 -0
- package/dist/cjs/api/formula.d.ts +69 -0
- package/dist/cjs/api/formula.d.ts.map +1 -0
- package/dist/cjs/api/formula.js +458 -0
- package/dist/cjs/api/immer-utils.d.ts +66 -0
- package/dist/cjs/api/immer-utils.d.ts.map +1 -0
- package/dist/cjs/api/immer-utils.js +1633 -0
- package/dist/cjs/api/intl.d.ts +51 -0
- package/dist/cjs/api/intl.d.ts.map +1 -0
- package/dist/cjs/api/intl.js +261 -0
- package/dist/cjs/api/merges.d.ts +7 -0
- package/dist/cjs/api/merges.d.ts.map +1 -0
- package/dist/cjs/api/merges.js +134 -0
- package/dist/cjs/api/outline.d.ts +33 -0
- package/dist/cjs/api/outline.d.ts.map +1 -0
- package/dist/cjs/api/outline.js +70 -0
- package/dist/cjs/api/parse-html.d.ts +15 -0
- package/dist/cjs/api/parse-html.d.ts.map +1 -0
- package/dist/cjs/api/parse-html.js +1066 -0
- package/dist/cjs/api/patches.d.ts +11 -0
- package/dist/cjs/api/patches.d.ts.map +1 -0
- package/dist/cjs/api/patches.js +218 -0
- package/dist/cjs/api/pivot-range.d.ts +8 -0
- package/dist/cjs/api/pivot-range.d.ts.map +1 -0
- package/dist/cjs/api/pivot-range.js +130 -0
- package/dist/cjs/api/range-rule-helpers.d.ts +65 -0
- package/dist/cjs/api/range-rule-helpers.d.ts.map +1 -0
- package/dist/cjs/api/range-rule-helpers.js +142 -0
- package/dist/cjs/api/range.d.ts +19 -0
- package/dist/cjs/api/range.d.ts.map +1 -0
- package/dist/cjs/api/range.js +183 -0
- package/dist/cjs/api/rename-sheet.d.ts +22 -0
- package/dist/cjs/api/rename-sheet.d.ts.map +1 -0
- package/dist/cjs/api/rename-sheet.js +54 -0
- package/dist/cjs/api/selection.d.ts +36 -0
- package/dist/cjs/api/selection.d.ts.map +1 -0
- package/dist/cjs/api/selection.js +133 -0
- package/dist/cjs/api/sort.d.ts +3 -0
- package/dist/cjs/api/sort.d.ts.map +1 -0
- package/dist/cjs/api/sort.js +33 -0
- package/dist/cjs/api/split-text.d.ts +2 -0
- package/dist/cjs/api/split-text.d.ts.map +1 -0
- package/dist/cjs/api/split-text.js +25 -0
- package/dist/cjs/api/structural-formula-update.d.ts +75 -0
- package/dist/cjs/api/structural-formula-update.d.ts.map +1 -0
- package/dist/cjs/api/structural-formula-update.js +508 -0
- package/dist/cjs/api/table.d.ts +39 -0
- package/dist/cjs/api/table.d.ts.map +1 -0
- package/dist/cjs/api/table.js +337 -0
- package/dist/cjs/api/validation.d.ts +12 -0
- package/dist/cjs/api/validation.d.ts.map +1 -0
- package/dist/cjs/api/validation.js +306 -0
- package/dist/cjs/api/xlsx-source.d.ts +22 -0
- package/dist/cjs/api/xlsx-source.d.ts.map +1 -0
- package/dist/cjs/api/xlsx-source.js +31 -0
- package/dist/cjs/atoms/delete-sheet-atom.d.ts +6 -0
- package/dist/cjs/atoms/delete-sheet-atom.d.ts.map +1 -0
- package/dist/cjs/atoms/delete-sheet-atom.js +4 -0
- package/dist/cjs/atoms/dialog-state.atom.d.ts +23 -0
- package/dist/cjs/atoms/dialog-state.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/dialog-state.atom.js +72 -0
- package/dist/cjs/atoms/editing-data-validation-id.atom.d.ts +7 -0
- package/dist/cjs/atoms/editing-data-validation-id.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/editing-data-validation-id.atom.js +12 -0
- package/dist/cjs/atoms/editing-embed.atom.d.ts +8 -0
- package/dist/cjs/atoms/editing-embed.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/editing-embed.atom.js +5 -0
- package/dist/cjs/atoms/editing-table.atom.d.ts +8 -0
- package/dist/cjs/atoms/editing-table.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/editing-table.atom.js +6 -0
- package/dist/cjs/atoms/error-state.atom.d.ts +10 -0
- package/dist/cjs/atoms/error-state.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/error-state.atom.js +5 -0
- package/dist/cjs/atoms/index.d.ts +5 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -0
- package/dist/cjs/atoms/index.js +4 -0
- package/dist/cjs/atoms/insert-image-state.atom.d.ts +6 -0
- package/dist/cjs/atoms/insert-image-state.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/insert-image-state.atom.js +9 -0
- package/dist/cjs/atoms/named-range.atom.d.ts +8 -0
- package/dist/cjs/atoms/named-range.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/named-range.atom.js +6 -0
- package/dist/cjs/atoms/resize-dimension.atom.d.ts +12 -0
- package/dist/cjs/atoms/resize-dimension.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/resize-dimension.atom.js +5 -0
- package/dist/cjs/atoms/sheet-observer.atom.d.ts +16 -0
- package/dist/cjs/atoms/sheet-observer.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/sheet-observer.atom.js +19 -0
- package/dist/cjs/cellxfs-registry.d.ts +37 -0
- package/dist/cjs/cellxfs-registry.d.ts.map +1 -0
- package/dist/cjs/cellxfs-registry.js +175 -0
- package/dist/cjs/commands.d.ts +691 -0
- package/dist/cjs/commands.d.ts.map +1 -0
- package/dist/cjs/commands.js +1 -0
- package/dist/cjs/components/dialogs/delete-sheet-confirmation.d.ts +7 -0
- package/dist/cjs/components/dialogs/delete-sheet-confirmation.d.ts.map +1 -0
- package/dist/cjs/components/dialogs/delete-sheet-confirmation.js +31 -0
- package/dist/cjs/components/dialogs/error-state.d.ts +3 -0
- package/dist/cjs/components/dialogs/error-state.d.ts.map +1 -0
- package/dist/cjs/components/dialogs/error-state.js +24 -0
- package/dist/cjs/components/editors/cell-format-editor.d.ts +26 -0
- package/dist/cjs/components/editors/cell-format-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/cell-format-editor.js +671 -0
- package/dist/cjs/components/editors/conditional-format-editor.d.ts +43 -0
- package/dist/cjs/components/editors/conditional-format-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/conditional-format-editor.js +176 -0
- package/dist/cjs/components/editors/conditional-format-rule-editor.d.ts +27 -0
- package/dist/cjs/components/editors/conditional-format-rule-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/conditional-format-rule-editor.js +640 -0
- package/dist/cjs/components/editors/data-validation-editor.d.ts +27 -0
- package/dist/cjs/components/editors/data-validation-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/data-validation-editor.js +163 -0
- package/dist/cjs/components/editors/data-validation-rule-editor.d.ts +17 -0
- package/dist/cjs/components/editors/data-validation-rule-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/data-validation-rule-editor.js +217 -0
- package/dist/cjs/components/editors/embed-editor.d.ts +19 -0
- package/dist/cjs/components/editors/embed-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/embed-editor.js +80 -0
- package/dist/cjs/components/editors/insert-image-editor.d.ts +20 -0
- package/dist/cjs/components/editors/insert-image-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/insert-image-editor.js +78 -0
- package/dist/cjs/components/editors/insert-link-editor.d.ts +20 -0
- package/dist/cjs/components/editors/insert-link-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/insert-link-editor.js +64 -0
- package/dist/cjs/components/editors/named-range-editor.d.ts +13 -0
- package/dist/cjs/components/editors/named-range-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/named-range-editor.js +106 -0
- package/dist/cjs/components/editors/resize-dimension-editor.d.ts +9 -0
- package/dist/cjs/components/editors/resize-dimension-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/resize-dimension-editor.js +62 -0
- package/dist/cjs/components/editors/sheet-filter.d.ts +59 -0
- package/dist/cjs/components/editors/sheet-filter.d.ts.map +1 -0
- package/dist/cjs/components/editors/sheet-filter.js +119 -0
- package/dist/cjs/components/editors/table-editor.d.ts +12 -0
- package/dist/cjs/components/editors/table-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/table-editor.js +105 -0
- package/dist/cjs/components/index.d.ts +13 -0
- package/dist/cjs/components/index.d.ts.map +1 -0
- package/dist/cjs/components/index.js +12 -0
- package/dist/cjs/generated-names.d.ts +51 -0
- package/dist/cjs/generated-names.d.ts.map +1 -0
- package/dist/cjs/generated-names.js +5 -0
- package/dist/cjs/helpers/iterative-calculation.d.ts +4 -0
- package/dist/cjs/helpers/iterative-calculation.d.ts.map +1 -0
- package/dist/cjs/helpers/iterative-calculation.js +44 -0
- package/dist/cjs/helpers/sheet-title.d.ts +5 -0
- package/dist/cjs/helpers/sheet-title.d.ts.map +1 -0
- package/dist/cjs/helpers/sheet-title.js +11 -0
- package/dist/cjs/helpers.d.ts +45 -0
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +154 -0
- package/dist/cjs/hooks/use-async-datasource.d.ts +57 -0
- package/dist/cjs/hooks/use-async-datasource.d.ts.map +1 -0
- package/dist/cjs/hooks/use-async-datasource.js +329 -0
- package/dist/cjs/hooks/use-calculation-initialize.d.ts +61 -0
- package/dist/cjs/hooks/use-calculation-initialize.d.ts.map +1 -0
- package/dist/cjs/hooks/use-calculation-initialize.js +800 -0
- package/dist/cjs/hooks/use-calculation-process-array.d.ts +20 -0
- package/dist/cjs/hooks/use-calculation-process-array.d.ts.map +1 -0
- package/dist/cjs/hooks/use-calculation-process-array.js +331 -0
- package/dist/cjs/hooks/use-calculation-queue.d.ts +10 -0
- package/dist/cjs/hooks/use-calculation-queue.d.ts.map +1 -0
- package/dist/cjs/hooks/use-calculation-queue.js +15 -0
- package/dist/cjs/hooks/use-calculation-worker.d.ts +37 -0
- package/dist/cjs/hooks/use-calculation-worker.d.ts.map +1 -0
- package/dist/cjs/hooks/use-calculation-worker.js +1868 -0
- package/dist/cjs/hooks/use-calculation.d.ts +173 -0
- package/dist/cjs/hooks/use-calculation.d.ts.map +1 -0
- package/dist/cjs/hooks/use-calculation.js +2735 -0
- package/dist/cjs/hooks/use-can-edit-cellrange.d.ts +31 -0
- package/dist/cjs/hooks/use-can-edit-cellrange.d.ts.map +1 -0
- package/dist/cjs/hooks/use-can-edit-cellrange.js +86 -0
- package/dist/cjs/hooks/use-cellxfs-registry.d.ts +6 -0
- package/dist/cjs/hooks/use-cellxfs-registry.d.ts.map +1 -0
- package/dist/cjs/hooks/use-cellxfs-registry.js +22 -0
- package/dist/cjs/hooks/use-citations.d.ts +19 -0
- package/dist/cjs/hooks/use-citations.d.ts.map +1 -0
- package/dist/cjs/hooks/use-citations.js +62 -0
- package/dist/cjs/hooks/use-comments.d.ts +14 -0
- package/dist/cjs/hooks/use-comments.d.ts.map +1 -0
- package/dist/cjs/hooks/use-comments.js +49 -0
- package/dist/cjs/hooks/use-conditional-formatting-rules.d.ts +22 -0
- package/dist/cjs/hooks/use-conditional-formatting-rules.d.ts.map +1 -0
- package/dist/cjs/hooks/use-conditional-formatting-rules.js +95 -0
- package/dist/cjs/hooks/use-data-validation-rules.d.ts +54 -0
- package/dist/cjs/hooks/use-data-validation-rules.d.ts.map +1 -0
- package/dist/cjs/hooks/use-data-validation-rules.js +151 -0
- package/dist/cjs/hooks/use-deferred-calculation-flush.d.ts +14 -0
- package/dist/cjs/hooks/use-deferred-calculation-flush.d.ts.map +1 -0
- package/dist/cjs/hooks/use-deferred-calculation-flush.js +81 -0
- package/dist/cjs/hooks/use-idle-scheduler.d.ts +5 -0
- package/dist/cjs/hooks/use-idle-scheduler.d.ts.map +1 -0
- package/dist/cjs/hooks/use-idle-scheduler.js +46 -0
- package/dist/cjs/hooks/use-indent.d.ts +23 -0
- package/dist/cjs/hooks/use-indent.d.ts.map +1 -0
- package/dist/cjs/hooks/use-indent.js +98 -0
- package/dist/cjs/hooks/use-named-range.d.ts +7 -0
- package/dist/cjs/hooks/use-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-named-range.js +70 -0
- package/dist/cjs/hooks/use-on-adjust-row-height.d.ts +11 -0
- package/dist/cjs/hooks/use-on-adjust-row-height.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-adjust-row-height.js +66 -0
- package/dist/cjs/hooks/use-on-autoresize.d.ts +17 -0
- package/dist/cjs/hooks/use-on-autoresize.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-autoresize.js +39 -0
- package/dist/cjs/hooks/use-on-banded-ranges.d.ts +15 -0
- package/dist/cjs/hooks/use-on-banded-ranges.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-banded-ranges.js +38 -0
- package/dist/cjs/hooks/use-on-calculation-begin.d.ts +14 -0
- package/dist/cjs/hooks/use-on-calculation-begin.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-calculation-begin.js +36 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts +22 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-calculation-success.js +182 -0
- package/dist/cjs/hooks/use-on-change-batch-stream.d.ts +7 -0
- package/dist/cjs/hooks/use-on-change-batch-stream.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-batch-stream.js +59 -0
- package/dist/cjs/hooks/use-on-change-batch.d.ts +54 -0
- package/dist/cjs/hooks/use-on-change-batch.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-batch.js +124 -0
- package/dist/cjs/hooks/use-on-change-calculated-column.d.ts +23 -0
- package/dist/cjs/hooks/use-on-change-calculated-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-calculated-column.js +30 -0
- package/dist/cjs/hooks/use-on-change-decimals.d.ts +22 -0
- package/dist/cjs/hooks/use-on-change-decimals.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-decimals.js +47 -0
- package/dist/cjs/hooks/use-on-change-formatting.d.ts +44 -0
- package/dist/cjs/hooks/use-on-change-formatting.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-formatting.js +165 -0
- package/dist/cjs/hooks/use-on-change-sheet-tabcolor.d.ts +11 -0
- package/dist/cjs/hooks/use-on-change-sheet-tabcolor.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-sheet-tabcolor.js +27 -0
- package/dist/cjs/hooks/use-on-change-table-column.d.ts +25 -0
- package/dist/cjs/hooks/use-on-change-table-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-table-column.js +53 -0
- package/dist/cjs/hooks/use-on-change-theme.d.ts +11 -0
- package/dist/cjs/hooks/use-on-change-theme.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change-theme.js +20 -0
- package/dist/cjs/hooks/use-on-change.d.ts +61 -0
- package/dist/cjs/hooks/use-on-change.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-change.js +298 -0
- package/dist/cjs/hooks/use-on-clear-formatting.d.ts +17 -0
- package/dist/cjs/hooks/use-on-clear-formatting.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-clear-formatting.js +46 -0
- package/dist/cjs/hooks/use-on-collapse-column-group.d.ts +11 -0
- package/dist/cjs/hooks/use-on-collapse-column-group.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-collapse-column-group.js +47 -0
- package/dist/cjs/hooks/use-on-collapse-row-group.d.ts +18 -0
- package/dist/cjs/hooks/use-on-collapse-row-group.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-collapse-row-group.js +57 -0
- package/dist/cjs/hooks/use-on-copy.d.ts +49 -0
- package/dist/cjs/hooks/use-on-copy.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-copy.js +325 -0
- package/dist/cjs/hooks/use-on-create-named-range.d.ts +13 -0
- package/dist/cjs/hooks/use-on-create-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-create-named-range.js +33 -0
- package/dist/cjs/hooks/use-on-create-sheet.d.ts +23 -0
- package/dist/cjs/hooks/use-on-create-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-create-sheet.js +66 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts +28 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.js +66 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts +28 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.js +66 -0
- package/dist/cjs/hooks/use-on-delete-column.d.ts +38 -0
- package/dist/cjs/hooks/use-on-delete-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-column.js +87 -0
- package/dist/cjs/hooks/use-on-delete-named-range.d.ts +14 -0
- package/dist/cjs/hooks/use-on-delete-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-named-range.js +23 -0
- package/dist/cjs/hooks/use-on-delete-row.d.ts +38 -0
- package/dist/cjs/hooks/use-on-delete-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-row.js +87 -0
- package/dist/cjs/hooks/use-on-delete-sheet.d.ts +16 -0
- package/dist/cjs/hooks/use-on-delete-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-sheet.js +37 -0
- package/dist/cjs/hooks/use-on-delete-table-row.d.ts +29 -0
- package/dist/cjs/hooks/use-on-delete-table-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete-table-row.js +56 -0
- package/dist/cjs/hooks/use-on-delete.d.ts +33 -0
- package/dist/cjs/hooks/use-on-delete.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-delete.js +60 -0
- package/dist/cjs/hooks/use-on-drag-n-drop.d.ts +55 -0
- package/dist/cjs/hooks/use-on-drag-n-drop.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-drag-n-drop.js +191 -0
- package/dist/cjs/hooks/use-on-duplicate-sheet.d.ts +29 -0
- package/dist/cjs/hooks/use-on-duplicate-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-duplicate-sheet.js +65 -0
- package/dist/cjs/hooks/use-on-embeds.d.ts +19 -0
- package/dist/cjs/hooks/use-on-embeds.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-embeds.js +87 -0
- package/dist/cjs/hooks/use-on-expand-column-group.d.ts +11 -0
- package/dist/cjs/hooks/use-on-expand-column-group.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-expand-column-group.js +45 -0
- package/dist/cjs/hooks/use-on-expand-row-group.d.ts +18 -0
- package/dist/cjs/hooks/use-on-expand-row-group.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-expand-row-group.js +52 -0
- package/dist/cjs/hooks/use-on-fill-range.d.ts +9 -0
- package/dist/cjs/hooks/use-on-fill-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-fill-range.js +55 -0
- package/dist/cjs/hooks/use-on-fill.d.ts +29 -0
- package/dist/cjs/hooks/use-on-fill.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-fill.js +78 -0
- package/dist/cjs/hooks/use-on-filter-table.d.ts +76 -0
- package/dist/cjs/hooks/use-on-filter-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-filter-table.js +429 -0
- package/dist/cjs/hooks/use-on-find-replace.d.ts +19 -0
- package/dist/cjs/hooks/use-on-find-replace.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-find-replace.js +150 -0
- package/dist/cjs/hooks/use-on-freeze.d.ts +13 -0
- package/dist/cjs/hooks/use-on-freeze.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-freeze.js +56 -0
- package/dist/cjs/hooks/use-on-group-columns.d.ts +11 -0
- package/dist/cjs/hooks/use-on-group-columns.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-group-columns.js +49 -0
- package/dist/cjs/hooks/use-on-group-rows.d.ts +17 -0
- package/dist/cjs/hooks/use-on-group-rows.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-group-rows.js +55 -0
- package/dist/cjs/hooks/use-on-hide-column.d.ts +23 -0
- package/dist/cjs/hooks/use-on-hide-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-hide-column.js +55 -0
- package/dist/cjs/hooks/use-on-hide-row.d.ts +32 -0
- package/dist/cjs/hooks/use-on-hide-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-hide-row.js +58 -0
- package/dist/cjs/hooks/use-on-hide-show-sheet.d.ts +18 -0
- package/dist/cjs/hooks/use-on-hide-show-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-hide-show-sheet.js +90 -0
- package/dist/cjs/hooks/use-on-import-csv-legacy.d.ts +8 -0
- package/dist/cjs/hooks/use-on-import-csv-legacy.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-import-csv-legacy.js +165 -0
- package/dist/cjs/hooks/use-on-import-csv.d.ts +28 -0
- package/dist/cjs/hooks/use-on-import-csv.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-import-csv.js +332 -0
- package/dist/cjs/hooks/use-on-import-excel.d.ts +67 -0
- package/dist/cjs/hooks/use-on-import-excel.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-import-excel.js +689 -0
- package/dist/cjs/hooks/use-on-insert-autosum.d.ts +9 -0
- package/dist/cjs/hooks/use-on-insert-autosum.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-autosum.js +105 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts +28 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.js +66 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts +28 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.js +66 -0
- package/dist/cjs/hooks/use-on-insert-checkbox.d.ts +17 -0
- package/dist/cjs/hooks/use-on-insert-checkbox.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-checkbox.js +87 -0
- package/dist/cjs/hooks/use-on-insert-column.d.ts +40 -0
- package/dist/cjs/hooks/use-on-insert-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-column.js +93 -0
- package/dist/cjs/hooks/use-on-insert-date-time.d.ts +4 -0
- package/dist/cjs/hooks/use-on-insert-date-time.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-date-time.js +12 -0
- package/dist/cjs/hooks/use-on-insert-date.d.ts +4 -0
- package/dist/cjs/hooks/use-on-insert-date.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-date.js +13 -0
- package/dist/cjs/hooks/use-on-insert-image.d.ts +24 -0
- package/dist/cjs/hooks/use-on-insert-image.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-image.js +145 -0
- package/dist/cjs/hooks/use-on-insert-link.d.ts +25 -0
- package/dist/cjs/hooks/use-on-insert-link.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-link.js +220 -0
- package/dist/cjs/hooks/use-on-insert-note.d.ts +4 -0
- package/dist/cjs/hooks/use-on-insert-note.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-note.js +14 -0
- package/dist/cjs/hooks/use-on-insert-row.d.ts +38 -0
- package/dist/cjs/hooks/use-on-insert-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-row.js +106 -0
- package/dist/cjs/hooks/use-on-insert-table-row.d.ts +31 -0
- package/dist/cjs/hooks/use-on-insert-table-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-table-row.js +60 -0
- package/dist/cjs/hooks/use-on-insert-time.d.ts +4 -0
- package/dist/cjs/hooks/use-on-insert-time.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-insert-time.js +12 -0
- package/dist/cjs/hooks/use-on-locale-change.d.ts +35 -0
- package/dist/cjs/hooks/use-on-locale-change.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-locale-change.js +314 -0
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts +28 -0
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.js +366 -0
- package/dist/cjs/hooks/use-on-move-columns.d.ts +28 -0
- package/dist/cjs/hooks/use-on-move-columns.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-move-columns.js +378 -0
- package/dist/cjs/hooks/use-on-move-rows.d.ts +30 -0
- package/dist/cjs/hooks/use-on-move-rows.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-move-rows.js +293 -0
- package/dist/cjs/hooks/use-on-move-selection.d.ts +35 -0
- package/dist/cjs/hooks/use-on-move-selection.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-move-selection.js +477 -0
- package/dist/cjs/hooks/use-on-move-sheet.d.ts +12 -0
- package/dist/cjs/hooks/use-on-move-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-move-sheet.js +68 -0
- package/dist/cjs/hooks/use-on-move-table-columns.d.ts +21 -0
- package/dist/cjs/hooks/use-on-move-table-columns.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-move-table-columns.js +249 -0
- package/dist/cjs/hooks/use-on-paste.d.ts +79 -0
- package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-paste.js +985 -0
- package/dist/cjs/hooks/use-on-protect-range.d.ts +20 -0
- package/dist/cjs/hooks/use-on-protect-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-protect-range.js +67 -0
- package/dist/cjs/hooks/use-on-protect-sheet.d.ts +19 -0
- package/dist/cjs/hooks/use-on-protect-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-protect-sheet.js +65 -0
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts +21 -0
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-remove-duplicates.js +40 -0
- package/dist/cjs/hooks/use-on-rename-sheet.d.ts +21 -0
- package/dist/cjs/hooks/use-on-rename-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-rename-sheet.js +80 -0
- package/dist/cjs/hooks/use-on-request-calculate-wrapper.d.ts +30 -0
- package/dist/cjs/hooks/use-on-request-calculate-wrapper.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-calculate-wrapper.js +90 -0
- package/dist/cjs/hooks/use-on-request-conditional-format.d.ts +2 -0
- package/dist/cjs/hooks/use-on-request-conditional-format.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-conditional-format.js +8 -0
- package/dist/cjs/hooks/use-on-request-data-validation.d.ts +7 -0
- package/dist/cjs/hooks/use-on-request-data-validation.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-data-validation.js +23 -0
- package/dist/cjs/hooks/use-on-request-define-named-range.d.ts +8 -0
- package/dist/cjs/hooks/use-on-request-define-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-define-named-range.js +19 -0
- package/dist/cjs/hooks/use-on-request-delete-sheet.d.ts +2 -0
- package/dist/cjs/hooks/use-on-request-delete-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-delete-sheet.js +12 -0
- package/dist/cjs/hooks/use-on-request-edit-table.d.ts +3 -0
- package/dist/cjs/hooks/use-on-request-edit-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-edit-table.js +11 -0
- package/dist/cjs/hooks/use-on-request-format-cells.d.ts +2 -0
- package/dist/cjs/hooks/use-on-request-format-cells.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-format-cells.js +8 -0
- package/dist/cjs/hooks/use-on-request-insert-image.d.ts +3 -0
- package/dist/cjs/hooks/use-on-request-insert-image.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-insert-image.js +12 -0
- package/dist/cjs/hooks/use-on-request-insert-link.d.ts +5 -0
- package/dist/cjs/hooks/use-on-request-insert-link.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-insert-link.js +9 -0
- package/dist/cjs/hooks/use-on-request-resize.d.ts +3 -0
- package/dist/cjs/hooks/use-on-request-resize.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-resize.js +13 -0
- package/dist/cjs/hooks/use-on-request-update-named-range.d.ts +3 -0
- package/dist/cjs/hooks/use-on-request-update-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-update-named-range.js +11 -0
- package/dist/cjs/hooks/use-on-resize-table.d.ts +33 -0
- package/dist/cjs/hooks/use-on-resize-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-resize-table.js +218 -0
- package/dist/cjs/hooks/use-on-resize.d.ts +19 -0
- package/dist/cjs/hooks/use-on-resize.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-resize.js +55 -0
- package/dist/cjs/hooks/use-on-set-outline-depth.d.ts +17 -0
- package/dist/cjs/hooks/use-on-set-outline-depth.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-set-outline-depth.js +96 -0
- package/dist/cjs/hooks/use-on-show-column.d.ts +16 -0
- package/dist/cjs/hooks/use-on-show-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-show-column.js +96 -0
- package/dist/cjs/hooks/use-on-show-row.d.ts +22 -0
- package/dist/cjs/hooks/use-on-show-row.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-show-row.js +99 -0
- package/dist/cjs/hooks/use-on-sort-column.d.ts +53 -0
- package/dist/cjs/hooks/use-on-sort-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-sort-column.js +300 -0
- package/dist/cjs/hooks/use-on-sort-range.d.ts +42 -0
- package/dist/cjs/hooks/use-on-sort-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-sort-range.js +252 -0
- package/dist/cjs/hooks/use-on-sort-table.d.ts +59 -0
- package/dist/cjs/hooks/use-on-sort-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-sort-table.js +345 -0
- package/dist/cjs/hooks/use-on-table.d.ts +49 -0
- package/dist/cjs/hooks/use-on-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-table.js +386 -0
- package/dist/cjs/hooks/use-on-trace-dependents-precedents.d.ts +14 -0
- package/dist/cjs/hooks/use-on-trace-dependents-precedents.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-trace-dependents-precedents.js +146 -0
- package/dist/cjs/hooks/use-on-ungroup-columns.d.ts +11 -0
- package/dist/cjs/hooks/use-on-ungroup-columns.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-ungroup-columns.js +57 -0
- package/dist/cjs/hooks/use-on-ungroup-rows.d.ts +17 -0
- package/dist/cjs/hooks/use-on-ungroup-rows.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-ungroup-rows.js +63 -0
- package/dist/cjs/hooks/use-on-update-named-range.d.ts +19 -0
- package/dist/cjs/hooks/use-on-update-named-range.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-update-named-range.js +133 -0
- package/dist/cjs/hooks/use-on-update-note.d.ts +13 -0
- package/dist/cjs/hooks/use-on-update-note.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-update-note.js +21 -0
- package/dist/cjs/hooks/use-on-update-sheet.d.ts +10 -0
- package/dist/cjs/hooks/use-on-update-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-update-sheet.js +12 -0
- package/dist/cjs/hooks/use-paint-format.d.ts +17 -0
- package/dist/cjs/hooks/use-paint-format.d.ts.map +1 -0
- package/dist/cjs/hooks/use-paint-format.js +118 -0
- package/dist/cjs/hooks/use-search.d.ts +81 -0
- package/dist/cjs/hooks/use-search.d.ts.map +1 -0
- package/dist/cjs/hooks/use-search.js +261 -0
- package/dist/cjs/hooks/use-select-next-prev-sheet.d.ts +11 -0
- package/dist/cjs/hooks/use-select-next-prev-sheet.d.ts.map +1 -0
- package/dist/cjs/hooks/use-select-next-prev-sheet.js +22 -0
- package/dist/cjs/hooks/use-sheet-observer.d.ts +20 -0
- package/dist/cjs/hooks/use-sheet-observer.d.ts.map +1 -0
- package/dist/cjs/hooks/use-sheet-observer.js +127 -0
- package/dist/cjs/hooks/use-sheet-properties.d.ts +105 -0
- package/dist/cjs/hooks/use-sheet-properties.d.ts.map +1 -0
- package/dist/cjs/hooks/use-sheet-properties.js +1019 -0
- package/dist/cjs/hooks/use-sheet-state.d.ts +17 -0
- package/dist/cjs/hooks/use-sheet-state.d.ts.map +1 -0
- package/dist/cjs/hooks/use-sheet-state.js +84 -0
- package/dist/cjs/hooks/use-sheetdata-subscriber.d.ts +10 -0
- package/dist/cjs/hooks/use-sheetdata-subscriber.d.ts.map +1 -0
- package/dist/cjs/hooks/use-sheetdata-subscriber.js +15 -0
- package/dist/cjs/hooks/use-slicers.d.ts +19 -0
- package/dist/cjs/hooks/use-slicers.d.ts.map +1 -0
- package/dist/cjs/hooks/use-slicers.js +84 -0
- package/dist/cjs/hooks/use-split-text-to-columns.d.ts +19 -0
- package/dist/cjs/hooks/use-split-text-to-columns.d.ts.map +1 -0
- package/dist/cjs/hooks/use-split-text-to-columns.js +32 -0
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts +627 -0
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -0
- package/dist/cjs/hooks/use-spreadsheet-state.js +2038 -0
- package/dist/cjs/hooks/use-ss-registry.d.ts +6 -0
- package/dist/cjs/hooks/use-ss-registry.d.ts.map +1 -0
- package/dist/cjs/hooks/use-ss-registry.js +17 -0
- package/dist/cjs/hooks/use-structured-reference.d.ts +8 -0
- package/dist/cjs/hooks/use-structured-reference.d.ts.map +1 -0
- package/dist/cjs/hooks/use-structured-reference.js +132 -0
- package/dist/cjs/hooks/use-undo-redo-actions.d.ts +40 -0
- package/dist/cjs/hooks/use-undo-redo-actions.d.ts.map +1 -0
- package/dist/cjs/hooks/use-undo-redo-actions.js +209 -0
- package/dist/cjs/hooks/use-undo-redo.d.ts +69 -0
- package/dist/cjs/hooks/use-undo-redo.d.ts.map +1 -0
- package/dist/cjs/hooks/use-undo-redo.js +124 -0
- package/dist/cjs/hooks/utils/frozen-sort.d.ts +9 -0
- package/dist/cjs/hooks/utils/frozen-sort.d.ts.map +1 -0
- package/dist/cjs/hooks/utils/frozen-sort.js +28 -0
- package/dist/cjs/hooks/utils/sort-rows.d.ts +32 -0
- package/dist/cjs/hooks/utils/sort-rows.d.ts.map +1 -0
- package/dist/cjs/hooks/utils/sort-rows.js +113 -0
- package/dist/cjs/index.d.ts +38 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +39 -0
- package/dist/cjs/interface/apply-fill.d.ts +6 -0
- package/dist/cjs/interface/apply-fill.d.ts.map +1 -0
- package/dist/cjs/interface/apply-fill.js +203 -0
- package/dist/cjs/interface/auto-resize.d.ts +4 -0
- package/dist/cjs/interface/auto-resize.d.ts.map +1 -0
- package/dist/cjs/interface/auto-resize.js +63 -0
- package/dist/cjs/interface/calculation-interface.d.ts +67 -0
- package/dist/cjs/interface/calculation-interface.d.ts.map +1 -0
- package/dist/cjs/interface/calculation-interface.js +409 -0
- package/dist/cjs/interface/change-batch-stream.d.ts +25 -0
- package/dist/cjs/interface/change-batch-stream.d.ts.map +1 -0
- package/dist/cjs/interface/change-batch-stream.js +428 -0
- package/dist/cjs/interface/change-batch.d.ts +39 -0
- package/dist/cjs/interface/change-batch.d.ts.map +1 -0
- package/dist/cjs/interface/change-batch.js +329 -0
- package/dist/cjs/interface/change-border.d.ts +5 -0
- package/dist/cjs/interface/change-border.d.ts.map +1 -0
- package/dist/cjs/interface/change-border.js +141 -0
- package/dist/cjs/interface/change-calculated-column.d.ts +5 -0
- package/dist/cjs/interface/change-calculated-column.d.ts.map +1 -0
- package/dist/cjs/interface/change-calculated-column.js +131 -0
- package/dist/cjs/interface/change-decimals.d.ts +7 -0
- package/dist/cjs/interface/change-decimals.d.ts.map +1 -0
- package/dist/cjs/interface/change-decimals.js +82 -0
- package/dist/cjs/interface/change-formatting.d.ts +4 -0
- package/dist/cjs/interface/change-formatting.d.ts.map +1 -0
- package/dist/cjs/interface/change-formatting.js +240 -0
- package/dist/cjs/interface/change-sheet-tabcolor.d.ts +4 -0
- package/dist/cjs/interface/change-sheet-tabcolor.d.ts.map +1 -0
- package/dist/cjs/interface/change-sheet-tabcolor.js +21 -0
- package/dist/cjs/interface/change-table-column.d.ts +49 -0
- package/dist/cjs/interface/change-table-column.d.ts.map +1 -0
- package/dist/cjs/interface/change-table-column.js +267 -0
- package/dist/cjs/interface/change-theme.d.ts +4 -0
- package/dist/cjs/interface/change-theme.d.ts.map +1 -0
- package/dist/cjs/interface/change-theme.js +23 -0
- package/dist/cjs/interface/chart-extensions.d.ts +32 -0
- package/dist/cjs/interface/chart-extensions.d.ts.map +1 -0
- package/dist/cjs/interface/chart-extensions.js +71 -0
- package/dist/cjs/interface/citations.d.ts +33 -0
- package/dist/cjs/interface/citations.d.ts.map +1 -0
- package/dist/cjs/interface/citations.js +142 -0
- package/dist/cjs/interface/clear-formatting.d.ts +5 -0
- package/dist/cjs/interface/clear-formatting.d.ts.map +1 -0
- package/dist/cjs/interface/clear-formatting.js +72 -0
- package/dist/cjs/interface/conditional-formatting-rules.d.ts +7 -0
- package/dist/cjs/interface/conditional-formatting-rules.d.ts.map +1 -0
- package/dist/cjs/interface/conditional-formatting-rules.js +191 -0
- package/dist/cjs/interface/create-table.d.ts +5 -0
- package/dist/cjs/interface/create-table.d.ts.map +1 -0
- package/dist/cjs/interface/create-table.js +96 -0
- package/dist/cjs/interface/data-validation-rules.d.ts +25 -0
- package/dist/cjs/interface/data-validation-rules.d.ts.map +1 -0
- package/dist/cjs/interface/data-validation-rules.js +366 -0
- package/dist/cjs/interface/data-validation-utils.d.ts +12 -0
- package/dist/cjs/interface/data-validation-utils.d.ts.map +1 -0
- package/dist/cjs/interface/data-validation-utils.js +118 -0
- package/dist/cjs/interface/delete-cells-shift-left.d.ts +5 -0
- package/dist/cjs/interface/delete-cells-shift-left.d.ts.map +1 -0
- package/dist/cjs/interface/delete-cells-shift-left.js +160 -0
- package/dist/cjs/interface/delete-cells-shift-up.d.ts +5 -0
- package/dist/cjs/interface/delete-cells-shift-up.d.ts.map +1 -0
- package/dist/cjs/interface/delete-cells-shift-up.js +152 -0
- package/dist/cjs/interface/delete-cells.d.ts +6 -0
- package/dist/cjs/interface/delete-cells.d.ts.map +1 -0
- package/dist/cjs/interface/delete-cells.js +231 -0
- package/dist/cjs/interface/delete-column.d.ts +4 -0
- package/dist/cjs/interface/delete-column.d.ts.map +1 -0
- package/dist/cjs/interface/delete-column.js +306 -0
- package/dist/cjs/interface/delete-row.d.ts +4 -0
- package/dist/cjs/interface/delete-row.d.ts.map +1 -0
- package/dist/cjs/interface/delete-row.js +227 -0
- package/dist/cjs/interface/delete-sheet.d.ts +4 -0
- package/dist/cjs/interface/delete-sheet.d.ts.map +1 -0
- package/dist/cjs/interface/delete-sheet.js +81 -0
- package/dist/cjs/interface/delete-table-column.d.ts +4 -0
- package/dist/cjs/interface/delete-table-column.d.ts.map +1 -0
- package/dist/cjs/interface/delete-table-column.js +349 -0
- package/dist/cjs/interface/delete-table-row.d.ts +4 -0
- package/dist/cjs/interface/delete-table-row.d.ts.map +1 -0
- package/dist/cjs/interface/delete-table-row.js +313 -0
- package/dist/cjs/interface/duplicate-sheet.d.ts +4 -0
- package/dist/cjs/interface/duplicate-sheet.d.ts.map +1 -0
- package/dist/cjs/interface/duplicate-sheet.js +232 -0
- package/dist/cjs/interface/embeds.d.ts +9 -0
- package/dist/cjs/interface/embeds.d.ts.map +1 -0
- package/dist/cjs/interface/embeds.js +121 -0
- package/dist/cjs/interface/freeze.d.ts +5 -0
- package/dist/cjs/interface/freeze.d.ts.map +1 -0
- package/dist/cjs/interface/freeze.js +160 -0
- package/dist/cjs/interface/helpers.d.ts +6 -0
- package/dist/cjs/interface/helpers.d.ts.map +1 -0
- package/dist/cjs/interface/helpers.js +44 -0
- package/dist/cjs/interface/hide-column.d.ts +4 -0
- package/dist/cjs/interface/hide-column.d.ts.map +1 -0
- package/dist/cjs/interface/hide-column.js +68 -0
- package/dist/cjs/interface/hide-row.d.ts +4 -0
- package/dist/cjs/interface/hide-row.d.ts.map +1 -0
- package/dist/cjs/interface/hide-row.js +65 -0
- package/dist/cjs/interface/indent.d.ts +7 -0
- package/dist/cjs/interface/indent.d.ts.map +1 -0
- package/dist/cjs/interface/indent.js +97 -0
- package/dist/cjs/interface/insert-cells-shift-down.d.ts +5 -0
- package/dist/cjs/interface/insert-cells-shift-down.d.ts.map +1 -0
- package/dist/cjs/interface/insert-cells-shift-down.js +154 -0
- package/dist/cjs/interface/insert-cells-shift-right.d.ts +5 -0
- package/dist/cjs/interface/insert-cells-shift-right.d.ts.map +1 -0
- package/dist/cjs/interface/insert-cells-shift-right.js +150 -0
- package/dist/cjs/interface/insert-column.d.ts +7 -0
- package/dist/cjs/interface/insert-column.d.ts.map +1 -0
- package/dist/cjs/interface/insert-column.js +645 -0
- package/dist/cjs/interface/insert-note.d.ts +5 -0
- package/dist/cjs/interface/insert-note.d.ts.map +1 -0
- package/dist/cjs/interface/insert-note.js +27 -0
- package/dist/cjs/interface/insert-row.d.ts +4 -0
- package/dist/cjs/interface/insert-row.d.ts.map +1 -0
- package/dist/cjs/interface/insert-row.js +188 -0
- package/dist/cjs/interface/insert-table-row.d.ts +4 -0
- package/dist/cjs/interface/insert-table-row.d.ts.map +1 -0
- package/dist/cjs/interface/insert-table-row.js +348 -0
- package/dist/cjs/interface/interface-cli.d.ts +3 -0
- package/dist/cjs/interface/interface-cli.d.ts.map +1 -0
- package/dist/cjs/interface/interface-cli.js +76 -0
- package/dist/cjs/interface/named-range-operations.d.ts +19 -0
- package/dist/cjs/interface/named-range-operations.d.ts.map +1 -0
- package/dist/cjs/interface/named-range-operations.js +96 -0
- package/dist/cjs/interface/new-sheet.d.ts +4 -0
- package/dist/cjs/interface/new-sheet.d.ts.map +1 -0
- package/dist/cjs/interface/new-sheet.js +109 -0
- package/dist/cjs/interface/pivot-extensions.d.ts +27 -0
- package/dist/cjs/interface/pivot-extensions.d.ts.map +1 -0
- package/dist/cjs/interface/pivot-extensions.js +62 -0
- package/dist/cjs/interface/remove-duplicates.d.ts +11 -0
- package/dist/cjs/interface/remove-duplicates.d.ts.map +1 -0
- package/dist/cjs/interface/remove-duplicates.js +132 -0
- package/dist/cjs/interface/remove-table.d.ts +4 -0
- package/dist/cjs/interface/remove-table.d.ts.map +1 -0
- package/dist/cjs/interface/remove-table.js +53 -0
- package/dist/cjs/interface/resize-utils.d.ts +18 -0
- package/dist/cjs/interface/resize-utils.d.ts.map +1 -0
- package/dist/cjs/interface/resize-utils.js +60 -0
- package/dist/cjs/interface/resize.d.ts +5 -0
- package/dist/cjs/interface/resize.d.ts.map +1 -0
- package/dist/cjs/interface/resize.js +56 -0
- package/dist/cjs/interface/slicers.d.ts +9 -0
- package/dist/cjs/interface/slicers.d.ts.map +1 -0
- package/dist/cjs/interface/slicers.js +113 -0
- package/dist/cjs/interface/split-text.d.ts +5 -0
- package/dist/cjs/interface/split-text.d.ts.map +1 -0
- package/dist/cjs/interface/split-text.js +120 -0
- package/dist/cjs/interface/spreadsheet-interface.d.ts +642 -0
- package/dist/cjs/interface/spreadsheet-interface.d.ts.map +1 -0
- package/dist/cjs/interface/spreadsheet-interface.js +2787 -0
- package/dist/cjs/interface/table-totalrow.d.ts +20 -0
- package/dist/cjs/interface/table-totalrow.d.ts.map +1 -0
- package/dist/cjs/interface/table-totalrow.js +170 -0
- package/dist/cjs/interface/table-utils.d.ts +21 -0
- package/dist/cjs/interface/table-utils.d.ts.map +1 -0
- package/dist/cjs/interface/table-utils.js +44 -0
- package/dist/cjs/interface/update-sheet.d.ts +16 -0
- package/dist/cjs/interface/update-sheet.d.ts.map +1 -0
- package/dist/cjs/interface/update-sheet.js +63 -0
- package/dist/cjs/interface/update-table.d.ts +4 -0
- package/dist/cjs/interface/update-table.d.ts.map +1 -0
- package/dist/cjs/interface/update-table.js +109 -0
- package/dist/cjs/server-utils.d.ts +8 -0
- package/dist/cjs/server-utils.d.ts.map +1 -0
- package/dist/cjs/server-utils.js +3 -0
- package/dist/cjs/server.browser.d.ts +9 -0
- package/dist/cjs/server.browser.d.ts.map +1 -0
- package/dist/cjs/server.browser.js +5 -0
- package/dist/cjs/server.d.ts +9 -0
- package/dist/cjs/server.d.ts.map +1 -0
- package/dist/cjs/server.js +5 -0
- package/dist/cjs/shared-string-registry.d.ts +35 -0
- package/dist/cjs/shared-string-registry.d.ts.map +1 -0
- package/dist/cjs/shared-string-registry.js +314 -0
- package/dist/cjs/sheet-cell.d.ts +310 -0
- package/dist/cjs/sheet-cell.d.ts.map +1 -0
- package/dist/cjs/sheet-cell.js +1809 -0
- package/dist/cjs/test-setup.d.ts +2 -0
- package/dist/cjs/test-setup.d.ts.map +1 -0
- package/dist/cjs/test-setup.js +3 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/cjs/types.d.ts +44 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +33 -0
- package/dist/cjs/validation-schema/table.schema.d.ts +6 -0
- package/dist/cjs/validation-schema/table.schema.d.ts.map +1 -0
- package/dist/cjs/validation-schema/table.schema.js +4 -0
- package/dist/cjs/vitest.config.d.ts +3 -0
- package/dist/cjs/vitest.config.d.ts.map +1 -0
- package/dist/cjs/vitest.config.js +22 -0
- package/dist/esm/api/border.d.ts +9 -0
- package/dist/esm/api/border.d.ts.map +1 -0
- package/dist/esm/api/border.js +25 -0
- package/dist/esm/api/conditional-format.d.ts +2 -0
- package/dist/esm/api/conditional-format.d.ts.map +1 -0
- package/dist/esm/api/conditional-format.js +5 -0
- package/dist/esm/api/copy-paste.d.ts +20 -0
- package/dist/esm/api/copy-paste.d.ts.map +1 -0
- package/dist/esm/api/copy-paste.js +302 -0
- package/dist/esm/api/data-validation.d.ts +2 -0
- package/dist/esm/api/data-validation.d.ts.map +1 -0
- package/dist/esm/api/data-validation.js +5 -0
- package/dist/esm/api/datatype.d.ts +89 -0
- package/dist/esm/api/datatype.d.ts.map +1 -0
- package/dist/esm/api/datatype.js +639 -0
- package/dist/esm/api/date.d.ts +27 -0
- package/dist/esm/api/date.d.ts.map +1 -0
- package/dist/esm/api/date.js +220 -0
- package/dist/esm/api/decimals.d.ts +10 -0
- package/dist/esm/api/decimals.d.ts.map +1 -0
- package/dist/esm/api/decimals.js +181 -0
- package/dist/esm/api/dependency.d.ts +64 -0
- package/dist/esm/api/dependency.d.ts.map +1 -0
- package/dist/esm/api/dependency.js +251 -0
- package/dist/esm/api/fill.d.ts +88 -0
- package/dist/esm/api/fill.d.ts.map +1 -0
- package/dist/esm/api/fill.js +919 -0
- package/dist/esm/api/filter-range.d.ts +4 -0
- package/dist/esm/api/filter-range.d.ts.map +1 -0
- package/dist/esm/api/filter-range.js +100 -0
- package/dist/esm/api/filter.d.ts +24 -0
- package/dist/esm/api/filter.d.ts.map +1 -0
- package/dist/esm/api/filter.js +62 -0
- package/dist/esm/api/format-caches.d.ts +43 -0
- package/dist/esm/api/format-caches.d.ts.map +1 -0
- package/dist/esm/api/format-caches.js +95 -0
- package/dist/esm/api/formula.d.ts +69 -0
- package/dist/esm/api/formula.d.ts.map +1 -0
- package/dist/esm/api/formula.js +422 -0
- package/dist/esm/api/immer-utils.d.ts +66 -0
- package/dist/esm/api/immer-utils.d.ts.map +1 -0
- package/dist/esm/api/immer-utils.js +1552 -0
- package/dist/esm/api/intl.d.ts +51 -0
- package/dist/esm/api/intl.d.ts.map +1 -0
- package/dist/esm/api/intl.js +257 -0
- package/dist/esm/api/merges.d.ts +7 -0
- package/dist/esm/api/merges.d.ts.map +1 -0
- package/dist/esm/api/merges.js +174 -0
- package/dist/esm/api/outline.d.ts +33 -0
- package/dist/esm/api/outline.d.ts.map +1 -0
- package/dist/esm/api/outline.js +56 -0
- package/dist/esm/api/parse-html.d.ts +15 -0
- package/dist/esm/api/parse-html.d.ts.map +1 -0
- package/dist/esm/api/parse-html.js +865 -0
- package/dist/esm/api/patches.d.ts +11 -0
- package/dist/esm/api/patches.d.ts.map +1 -0
- package/dist/esm/api/patches.js +206 -0
- package/dist/esm/api/pivot-range.d.ts +8 -0
- package/dist/esm/api/pivot-range.d.ts.map +1 -0
- package/dist/esm/api/pivot-range.js +93 -0
- package/dist/esm/api/range-rule-helpers.d.ts +65 -0
- package/dist/esm/api/range-rule-helpers.d.ts.map +1 -0
- package/dist/esm/api/range-rule-helpers.js +138 -0
- package/dist/esm/api/range.d.ts +19 -0
- package/dist/esm/api/range.d.ts.map +1 -0
- package/dist/esm/api/range.js +136 -0
- package/dist/esm/api/rename-sheet.d.ts +22 -0
- package/dist/esm/api/rename-sheet.d.ts.map +1 -0
- package/dist/esm/api/rename-sheet.js +41 -0
- package/dist/esm/api/selection.d.ts +36 -0
- package/dist/esm/api/selection.d.ts.map +1 -0
- package/dist/esm/api/selection.js +138 -0
- package/dist/esm/api/sort.d.ts +3 -0
- package/dist/esm/api/sort.d.ts.map +1 -0
- package/dist/esm/api/sort.js +33 -0
- package/dist/esm/api/split-text.d.ts +2 -0
- package/dist/esm/api/split-text.d.ts.map +1 -0
- package/dist/esm/api/split-text.js +24 -0
- package/dist/esm/api/structural-formula-update.d.ts +75 -0
- package/dist/esm/api/structural-formula-update.d.ts.map +1 -0
- package/dist/esm/api/structural-formula-update.js +431 -0
- package/dist/esm/api/table.d.ts +39 -0
- package/dist/esm/api/table.d.ts.map +1 -0
- package/dist/esm/api/table.js +333 -0
- package/dist/esm/api/validation.d.ts +12 -0
- package/dist/esm/api/validation.d.ts.map +1 -0
- package/dist/esm/api/validation.js +297 -0
- package/dist/esm/api/xlsx-source.d.ts +22 -0
- package/dist/esm/api/xlsx-source.d.ts.map +1 -0
- package/dist/esm/api/xlsx-source.js +30 -0
- package/dist/esm/atoms/delete-sheet-atom.d.ts +6 -0
- package/dist/esm/atoms/delete-sheet-atom.d.ts.map +1 -0
- package/dist/esm/atoms/delete-sheet-atom.js +4 -0
- package/dist/esm/atoms/dialog-state.atom.d.ts +23 -0
- package/dist/esm/atoms/dialog-state.atom.d.ts.map +1 -0
- package/dist/esm/atoms/dialog-state.atom.js +34 -0
- package/dist/esm/atoms/editing-data-validation-id.atom.d.ts +7 -0
- package/dist/esm/atoms/editing-data-validation-id.atom.d.ts.map +1 -0
- package/dist/esm/atoms/editing-data-validation-id.atom.js +6 -0
- package/dist/esm/atoms/editing-embed.atom.d.ts +8 -0
- package/dist/esm/atoms/editing-embed.atom.d.ts.map +1 -0
- package/dist/esm/atoms/editing-embed.atom.js +5 -0
- package/dist/esm/atoms/editing-table.atom.d.ts +8 -0
- package/dist/esm/atoms/editing-table.atom.d.ts.map +1 -0
- package/dist/esm/atoms/editing-table.atom.js +6 -0
- package/dist/esm/atoms/error-state.atom.d.ts +10 -0
- package/dist/esm/atoms/error-state.atom.d.ts.map +1 -0
- package/dist/esm/atoms/error-state.atom.js +5 -0
- package/dist/esm/atoms/index.d.ts +5 -0
- package/dist/esm/atoms/index.d.ts.map +1 -0
- package/dist/esm/atoms/index.js +4 -0
- package/dist/esm/atoms/insert-image-state.atom.d.ts +6 -0
- package/dist/esm/atoms/insert-image-state.atom.d.ts.map +1 -0
- package/dist/esm/atoms/insert-image-state.atom.js +5 -0
- package/dist/esm/atoms/named-range.atom.d.ts +8 -0
- package/dist/esm/atoms/named-range.atom.d.ts.map +1 -0
- package/dist/esm/atoms/named-range.atom.js +6 -0
- package/dist/esm/atoms/resize-dimension.atom.d.ts +12 -0
- package/dist/esm/atoms/resize-dimension.atom.d.ts.map +1 -0
- package/dist/esm/atoms/resize-dimension.atom.js +5 -0
- package/dist/esm/atoms/sheet-observer.atom.d.ts +16 -0
- package/dist/esm/atoms/sheet-observer.atom.d.ts.map +1 -0
- package/dist/esm/atoms/sheet-observer.atom.js +16 -0
- package/dist/esm/cellxfs-registry.d.ts +37 -0
- package/dist/esm/cellxfs-registry.d.ts.map +1 -0
- package/dist/esm/cellxfs-registry.js +147 -0
- package/dist/esm/commands.d.ts +691 -0
- package/dist/esm/commands.d.ts.map +1 -0
- package/dist/esm/commands.js +1 -0
- package/dist/esm/components/dialogs/delete-sheet-confirmation.d.ts +7 -0
- package/dist/esm/components/dialogs/delete-sheet-confirmation.d.ts.map +1 -0
- package/dist/esm/components/dialogs/delete-sheet-confirmation.js +29 -0
- package/dist/esm/components/dialogs/error-state.d.ts +3 -0
- package/dist/esm/components/dialogs/error-state.d.ts.map +1 -0
- package/dist/esm/components/dialogs/error-state.js +22 -0
- package/dist/esm/components/editors/cell-format-editor.d.ts +26 -0
- package/dist/esm/components/editors/cell-format-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/cell-format-editor.js +648 -0
- package/dist/esm/components/editors/conditional-format-editor.d.ts +43 -0
- package/dist/esm/components/editors/conditional-format-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/conditional-format-editor.js +172 -0
- package/dist/esm/components/editors/conditional-format-rule-editor.d.ts +27 -0
- package/dist/esm/components/editors/conditional-format-rule-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/conditional-format-rule-editor.js +608 -0
- package/dist/esm/components/editors/data-validation-editor.d.ts +27 -0
- package/dist/esm/components/editors/data-validation-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/data-validation-editor.js +160 -0
- package/dist/esm/components/editors/data-validation-rule-editor.d.ts +17 -0
- package/dist/esm/components/editors/data-validation-rule-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/data-validation-rule-editor.js +194 -0
- package/dist/esm/components/editors/embed-editor.d.ts +19 -0
- package/dist/esm/components/editors/embed-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/embed-editor.js +75 -0
- package/dist/esm/components/editors/insert-image-editor.d.ts +20 -0
- package/dist/esm/components/editors/insert-image-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/insert-image-editor.js +73 -0
- package/dist/esm/components/editors/insert-link-editor.d.ts +20 -0
- package/dist/esm/components/editors/insert-link-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/insert-link-editor.js +60 -0
- package/dist/esm/components/editors/named-range-editor.d.ts +13 -0
- package/dist/esm/components/editors/named-range-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/named-range-editor.js +103 -0
- package/dist/esm/components/editors/resize-dimension-editor.d.ts +9 -0
- package/dist/esm/components/editors/resize-dimension-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/resize-dimension-editor.js +60 -0
- package/dist/esm/components/editors/sheet-filter.d.ts +59 -0
- package/dist/esm/components/editors/sheet-filter.d.ts.map +1 -0
- package/dist/esm/components/editors/sheet-filter.js +88 -0
- package/dist/esm/components/editors/table-editor.d.ts +12 -0
- package/dist/esm/components/editors/table-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/table-editor.js +106 -0
- package/dist/esm/components/index.d.ts +13 -0
- package/dist/esm/components/index.d.ts.map +1 -0
- package/dist/esm/components/index.js +12 -0
- package/dist/esm/generated-names.d.ts +51 -0
- package/dist/esm/generated-names.d.ts.map +1 -0
- package/dist/esm/generated-names.js +5 -0
- package/dist/esm/helpers/iterative-calculation.d.ts +4 -0
- package/dist/esm/helpers/iterative-calculation.d.ts.map +1 -0
- package/dist/esm/helpers/iterative-calculation.js +44 -0
- package/dist/esm/helpers/sheet-title.d.ts +5 -0
- package/dist/esm/helpers/sheet-title.d.ts.map +1 -0
- package/dist/esm/helpers/sheet-title.js +13 -0
- package/dist/esm/helpers.d.ts +45 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +143 -0
- package/dist/esm/hooks/use-async-datasource.d.ts +57 -0
- package/dist/esm/hooks/use-async-datasource.d.ts.map +1 -0
- package/dist/esm/hooks/use-async-datasource.js +276 -0
- package/dist/esm/hooks/use-calculation-initialize.d.ts +61 -0
- package/dist/esm/hooks/use-calculation-initialize.d.ts.map +1 -0
- package/dist/esm/hooks/use-calculation-initialize.js +603 -0
- package/dist/esm/hooks/use-calculation-process-array.d.ts +20 -0
- package/dist/esm/hooks/use-calculation-process-array.d.ts.map +1 -0
- package/dist/esm/hooks/use-calculation-process-array.js +279 -0
- package/dist/esm/hooks/use-calculation-queue.d.ts +10 -0
- package/dist/esm/hooks/use-calculation-queue.d.ts.map +1 -0
- package/dist/esm/hooks/use-calculation-queue.js +13 -0
- package/dist/esm/hooks/use-calculation-worker.d.ts +37 -0
- package/dist/esm/hooks/use-calculation-worker.d.ts.map +1 -0
- package/dist/esm/hooks/use-calculation-worker.js +1688 -0
- package/dist/esm/hooks/use-calculation.d.ts +173 -0
- package/dist/esm/hooks/use-calculation.d.ts.map +1 -0
- package/dist/esm/hooks/use-calculation.js +2069 -0
- package/dist/esm/hooks/use-can-edit-cellrange.d.ts +31 -0
- package/dist/esm/hooks/use-can-edit-cellrange.d.ts.map +1 -0
- package/dist/esm/hooks/use-can-edit-cellrange.js +72 -0
- package/dist/esm/hooks/use-cellxfs-registry.d.ts +6 -0
- package/dist/esm/hooks/use-cellxfs-registry.d.ts.map +1 -0
- package/dist/esm/hooks/use-cellxfs-registry.js +22 -0
- package/dist/esm/hooks/use-citations.d.ts +19 -0
- package/dist/esm/hooks/use-citations.d.ts.map +1 -0
- package/dist/esm/hooks/use-citations.js +61 -0
- package/dist/esm/hooks/use-comments.d.ts +14 -0
- package/dist/esm/hooks/use-comments.d.ts.map +1 -0
- package/dist/esm/hooks/use-comments.js +45 -0
- package/dist/esm/hooks/use-conditional-formatting-rules.d.ts +22 -0
- package/dist/esm/hooks/use-conditional-formatting-rules.d.ts.map +1 -0
- package/dist/esm/hooks/use-conditional-formatting-rules.js +81 -0
- package/dist/esm/hooks/use-data-validation-rules.d.ts +54 -0
- package/dist/esm/hooks/use-data-validation-rules.d.ts.map +1 -0
- package/dist/esm/hooks/use-data-validation-rules.js +135 -0
- package/dist/esm/hooks/use-deferred-calculation-flush.d.ts +14 -0
- package/dist/esm/hooks/use-deferred-calculation-flush.d.ts.map +1 -0
- package/dist/esm/hooks/use-deferred-calculation-flush.js +78 -0
- package/dist/esm/hooks/use-idle-scheduler.d.ts +5 -0
- package/dist/esm/hooks/use-idle-scheduler.d.ts.map +1 -0
- package/dist/esm/hooks/use-idle-scheduler.js +46 -0
- package/dist/esm/hooks/use-indent.d.ts +23 -0
- package/dist/esm/hooks/use-indent.d.ts.map +1 -0
- package/dist/esm/hooks/use-indent.js +97 -0
- package/dist/esm/hooks/use-named-range.d.ts +7 -0
- package/dist/esm/hooks/use-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-named-range.js +69 -0
- package/dist/esm/hooks/use-on-adjust-row-height.d.ts +11 -0
- package/dist/esm/hooks/use-on-adjust-row-height.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-adjust-row-height.js +63 -0
- package/dist/esm/hooks/use-on-autoresize.d.ts +17 -0
- package/dist/esm/hooks/use-on-autoresize.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-autoresize.js +38 -0
- package/dist/esm/hooks/use-on-banded-ranges.d.ts +15 -0
- package/dist/esm/hooks/use-on-banded-ranges.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-banded-ranges.js +36 -0
- package/dist/esm/hooks/use-on-calculation-begin.d.ts +14 -0
- package/dist/esm/hooks/use-on-calculation-begin.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-calculation-begin.js +22 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts +22 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-calculation-success.js +167 -0
- package/dist/esm/hooks/use-on-change-batch-stream.d.ts +7 -0
- package/dist/esm/hooks/use-on-change-batch-stream.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-batch-stream.js +58 -0
- package/dist/esm/hooks/use-on-change-batch.d.ts +54 -0
- package/dist/esm/hooks/use-on-change-batch.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-batch.js +111 -0
- package/dist/esm/hooks/use-on-change-calculated-column.d.ts +23 -0
- package/dist/esm/hooks/use-on-change-calculated-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-calculated-column.js +29 -0
- package/dist/esm/hooks/use-on-change-decimals.d.ts +22 -0
- package/dist/esm/hooks/use-on-change-decimals.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-decimals.js +45 -0
- package/dist/esm/hooks/use-on-change-formatting.d.ts +44 -0
- package/dist/esm/hooks/use-on-change-formatting.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-formatting.js +158 -0
- package/dist/esm/hooks/use-on-change-sheet-tabcolor.d.ts +11 -0
- package/dist/esm/hooks/use-on-change-sheet-tabcolor.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-sheet-tabcolor.js +26 -0
- package/dist/esm/hooks/use-on-change-table-column.d.ts +25 -0
- package/dist/esm/hooks/use-on-change-table-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-table-column.js +52 -0
- package/dist/esm/hooks/use-on-change-theme.d.ts +11 -0
- package/dist/esm/hooks/use-on-change-theme.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change-theme.js +11 -0
- package/dist/esm/hooks/use-on-change.d.ts +61 -0
- package/dist/esm/hooks/use-on-change.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-change.js +281 -0
- package/dist/esm/hooks/use-on-clear-formatting.d.ts +17 -0
- package/dist/esm/hooks/use-on-clear-formatting.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-clear-formatting.js +45 -0
- package/dist/esm/hooks/use-on-collapse-column-group.d.ts +11 -0
- package/dist/esm/hooks/use-on-collapse-column-group.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-collapse-column-group.js +44 -0
- package/dist/esm/hooks/use-on-collapse-row-group.d.ts +18 -0
- package/dist/esm/hooks/use-on-collapse-row-group.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-collapse-row-group.js +54 -0
- package/dist/esm/hooks/use-on-copy.d.ts +49 -0
- package/dist/esm/hooks/use-on-copy.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-copy.js +302 -0
- package/dist/esm/hooks/use-on-create-named-range.d.ts +13 -0
- package/dist/esm/hooks/use-on-create-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-create-named-range.js +32 -0
- package/dist/esm/hooks/use-on-create-sheet.d.ts +23 -0
- package/dist/esm/hooks/use-on-create-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-create-sheet.js +64 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts +28 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-left.js +65 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts +28 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-cells-shift-up.js +65 -0
- package/dist/esm/hooks/use-on-delete-column.d.ts +38 -0
- package/dist/esm/hooks/use-on-delete-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-column.js +86 -0
- package/dist/esm/hooks/use-on-delete-named-range.d.ts +14 -0
- package/dist/esm/hooks/use-on-delete-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-named-range.js +22 -0
- package/dist/esm/hooks/use-on-delete-row.d.ts +38 -0
- package/dist/esm/hooks/use-on-delete-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-row.js +86 -0
- package/dist/esm/hooks/use-on-delete-sheet.d.ts +16 -0
- package/dist/esm/hooks/use-on-delete-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-sheet.js +36 -0
- package/dist/esm/hooks/use-on-delete-table-row.d.ts +29 -0
- package/dist/esm/hooks/use-on-delete-table-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete-table-row.js +55 -0
- package/dist/esm/hooks/use-on-delete.d.ts +33 -0
- package/dist/esm/hooks/use-on-delete.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-delete.js +58 -0
- package/dist/esm/hooks/use-on-drag-n-drop.d.ts +55 -0
- package/dist/esm/hooks/use-on-drag-n-drop.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-drag-n-drop.js +160 -0
- package/dist/esm/hooks/use-on-duplicate-sheet.d.ts +29 -0
- package/dist/esm/hooks/use-on-duplicate-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-duplicate-sheet.js +63 -0
- package/dist/esm/hooks/use-on-embeds.d.ts +19 -0
- package/dist/esm/hooks/use-on-embeds.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-embeds.js +86 -0
- package/dist/esm/hooks/use-on-expand-column-group.d.ts +11 -0
- package/dist/esm/hooks/use-on-expand-column-group.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-expand-column-group.js +42 -0
- package/dist/esm/hooks/use-on-expand-row-group.d.ts +18 -0
- package/dist/esm/hooks/use-on-expand-row-group.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-expand-row-group.js +49 -0
- package/dist/esm/hooks/use-on-fill-range.d.ts +9 -0
- package/dist/esm/hooks/use-on-fill-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-fill-range.js +79 -0
- package/dist/esm/hooks/use-on-fill.d.ts +29 -0
- package/dist/esm/hooks/use-on-fill.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-fill.js +66 -0
- package/dist/esm/hooks/use-on-filter-table.d.ts +76 -0
- package/dist/esm/hooks/use-on-filter-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-filter-table.js +341 -0
- package/dist/esm/hooks/use-on-find-replace.d.ts +19 -0
- package/dist/esm/hooks/use-on-find-replace.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-find-replace.js +115 -0
- package/dist/esm/hooks/use-on-freeze.d.ts +13 -0
- package/dist/esm/hooks/use-on-freeze.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-freeze.js +55 -0
- package/dist/esm/hooks/use-on-group-columns.d.ts +11 -0
- package/dist/esm/hooks/use-on-group-columns.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-group-columns.js +35 -0
- package/dist/esm/hooks/use-on-group-rows.d.ts +17 -0
- package/dist/esm/hooks/use-on-group-rows.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-group-rows.js +41 -0
- package/dist/esm/hooks/use-on-hide-column.d.ts +23 -0
- package/dist/esm/hooks/use-on-hide-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-hide-column.js +54 -0
- package/dist/esm/hooks/use-on-hide-row.d.ts +32 -0
- package/dist/esm/hooks/use-on-hide-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-hide-row.js +57 -0
- package/dist/esm/hooks/use-on-hide-show-sheet.d.ts +18 -0
- package/dist/esm/hooks/use-on-hide-show-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-hide-show-sheet.js +88 -0
- package/dist/esm/hooks/use-on-import-csv-legacy.d.ts +8 -0
- package/dist/esm/hooks/use-on-import-csv-legacy.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-import-csv-legacy.js +148 -0
- package/dist/esm/hooks/use-on-import-csv.d.ts +28 -0
- package/dist/esm/hooks/use-on-import-csv.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-import-csv.js +267 -0
- package/dist/esm/hooks/use-on-import-excel.d.ts +67 -0
- package/dist/esm/hooks/use-on-import-excel.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-import-excel.js +595 -0
- package/dist/esm/hooks/use-on-insert-autosum.d.ts +9 -0
- package/dist/esm/hooks/use-on-insert-autosum.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-autosum.js +91 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts +28 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-down.js +65 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts +28 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-cells-shift-right.js +65 -0
- package/dist/esm/hooks/use-on-insert-checkbox.d.ts +17 -0
- package/dist/esm/hooks/use-on-insert-checkbox.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-checkbox.js +73 -0
- package/dist/esm/hooks/use-on-insert-column.d.ts +40 -0
- package/dist/esm/hooks/use-on-insert-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-column.js +91 -0
- package/dist/esm/hooks/use-on-insert-date-time.d.ts +4 -0
- package/dist/esm/hooks/use-on-insert-date-time.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-date-time.js +11 -0
- package/dist/esm/hooks/use-on-insert-date.d.ts +4 -0
- package/dist/esm/hooks/use-on-insert-date.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-date.js +12 -0
- package/dist/esm/hooks/use-on-insert-image.d.ts +24 -0
- package/dist/esm/hooks/use-on-insert-image.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-image.js +131 -0
- package/dist/esm/hooks/use-on-insert-link.d.ts +25 -0
- package/dist/esm/hooks/use-on-insert-link.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-link.js +193 -0
- package/dist/esm/hooks/use-on-insert-note.d.ts +4 -0
- package/dist/esm/hooks/use-on-insert-note.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-note.js +14 -0
- package/dist/esm/hooks/use-on-insert-row.d.ts +38 -0
- package/dist/esm/hooks/use-on-insert-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-row.js +104 -0
- package/dist/esm/hooks/use-on-insert-table-row.d.ts +31 -0
- package/dist/esm/hooks/use-on-insert-table-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-table-row.js +59 -0
- package/dist/esm/hooks/use-on-insert-time.d.ts +4 -0
- package/dist/esm/hooks/use-on-insert-time.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-insert-time.js +11 -0
- package/dist/esm/hooks/use-on-locale-change.d.ts +35 -0
- package/dist/esm/hooks/use-on-locale-change.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-locale-change.js +314 -0
- package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts +28 -0
- package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-merge-unmerge-cells.js +310 -0
- package/dist/esm/hooks/use-on-move-columns.d.ts +28 -0
- package/dist/esm/hooks/use-on-move-columns.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-move-columns.js +295 -0
- package/dist/esm/hooks/use-on-move-rows.d.ts +30 -0
- package/dist/esm/hooks/use-on-move-rows.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-move-rows.js +264 -0
- package/dist/esm/hooks/use-on-move-selection.d.ts +35 -0
- package/dist/esm/hooks/use-on-move-selection.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-move-selection.js +383 -0
- package/dist/esm/hooks/use-on-move-sheet.d.ts +12 -0
- package/dist/esm/hooks/use-on-move-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-move-sheet.js +65 -0
- package/dist/esm/hooks/use-on-move-table-columns.d.ts +21 -0
- package/dist/esm/hooks/use-on-move-table-columns.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-move-table-columns.js +235 -0
- package/dist/esm/hooks/use-on-paste.d.ts +79 -0
- package/dist/esm/hooks/use-on-paste.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-paste.js +868 -0
- package/dist/esm/hooks/use-on-protect-range.d.ts +20 -0
- package/dist/esm/hooks/use-on-protect-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-protect-range.js +67 -0
- package/dist/esm/hooks/use-on-protect-sheet.d.ts +19 -0
- package/dist/esm/hooks/use-on-protect-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-protect-sheet.js +61 -0
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts +21 -0
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-remove-duplicates.js +39 -0
- package/dist/esm/hooks/use-on-rename-sheet.d.ts +21 -0
- package/dist/esm/hooks/use-on-rename-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-rename-sheet.js +78 -0
- package/dist/esm/hooks/use-on-request-calculate-wrapper.d.ts +30 -0
- package/dist/esm/hooks/use-on-request-calculate-wrapper.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-calculate-wrapper.js +88 -0
- package/dist/esm/hooks/use-on-request-conditional-format.d.ts +2 -0
- package/dist/esm/hooks/use-on-request-conditional-format.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-conditional-format.js +8 -0
- package/dist/esm/hooks/use-on-request-data-validation.d.ts +7 -0
- package/dist/esm/hooks/use-on-request-data-validation.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-data-validation.js +21 -0
- package/dist/esm/hooks/use-on-request-define-named-range.d.ts +8 -0
- package/dist/esm/hooks/use-on-request-define-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-define-named-range.js +25 -0
- package/dist/esm/hooks/use-on-request-delete-sheet.d.ts +2 -0
- package/dist/esm/hooks/use-on-request-delete-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-delete-sheet.js +11 -0
- package/dist/esm/hooks/use-on-request-edit-table.d.ts +3 -0
- package/dist/esm/hooks/use-on-request-edit-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-edit-table.js +11 -0
- package/dist/esm/hooks/use-on-request-format-cells.d.ts +2 -0
- package/dist/esm/hooks/use-on-request-format-cells.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-format-cells.js +8 -0
- package/dist/esm/hooks/use-on-request-insert-image.d.ts +3 -0
- package/dist/esm/hooks/use-on-request-insert-image.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-insert-image.js +12 -0
- package/dist/esm/hooks/use-on-request-insert-link.d.ts +5 -0
- package/dist/esm/hooks/use-on-request-insert-link.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-insert-link.js +9 -0
- package/dist/esm/hooks/use-on-request-resize.d.ts +3 -0
- package/dist/esm/hooks/use-on-request-resize.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-resize.js +13 -0
- package/dist/esm/hooks/use-on-request-update-named-range.d.ts +3 -0
- package/dist/esm/hooks/use-on-request-update-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-update-named-range.js +11 -0
- package/dist/esm/hooks/use-on-resize-table.d.ts +33 -0
- package/dist/esm/hooks/use-on-resize-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-resize-table.js +212 -0
- package/dist/esm/hooks/use-on-resize.d.ts +19 -0
- package/dist/esm/hooks/use-on-resize.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-resize.js +54 -0
- package/dist/esm/hooks/use-on-set-outline-depth.d.ts +17 -0
- package/dist/esm/hooks/use-on-set-outline-depth.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-set-outline-depth.js +93 -0
- package/dist/esm/hooks/use-on-show-column.d.ts +16 -0
- package/dist/esm/hooks/use-on-show-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-show-column.js +82 -0
- package/dist/esm/hooks/use-on-show-row.d.ts +22 -0
- package/dist/esm/hooks/use-on-show-row.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-show-row.js +85 -0
- package/dist/esm/hooks/use-on-sort-column.d.ts +53 -0
- package/dist/esm/hooks/use-on-sort-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-sort-column.js +268 -0
- package/dist/esm/hooks/use-on-sort-range.d.ts +42 -0
- package/dist/esm/hooks/use-on-sort-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-sort-range.js +247 -0
- package/dist/esm/hooks/use-on-sort-table.d.ts +59 -0
- package/dist/esm/hooks/use-on-sort-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-sort-table.js +332 -0
- package/dist/esm/hooks/use-on-table.d.ts +49 -0
- package/dist/esm/hooks/use-on-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-table.js +384 -0
- package/dist/esm/hooks/use-on-trace-dependents-precedents.d.ts +14 -0
- package/dist/esm/hooks/use-on-trace-dependents-precedents.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-trace-dependents-precedents.js +144 -0
- package/dist/esm/hooks/use-on-ungroup-columns.d.ts +11 -0
- package/dist/esm/hooks/use-on-ungroup-columns.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-ungroup-columns.js +43 -0
- package/dist/esm/hooks/use-on-ungroup-rows.d.ts +17 -0
- package/dist/esm/hooks/use-on-ungroup-rows.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-ungroup-rows.js +49 -0
- package/dist/esm/hooks/use-on-update-named-range.d.ts +19 -0
- package/dist/esm/hooks/use-on-update-named-range.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-update-named-range.js +108 -0
- package/dist/esm/hooks/use-on-update-note.d.ts +13 -0
- package/dist/esm/hooks/use-on-update-note.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-update-note.js +20 -0
- package/dist/esm/hooks/use-on-update-sheet.d.ts +10 -0
- package/dist/esm/hooks/use-on-update-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-update-sheet.js +11 -0
- package/dist/esm/hooks/use-paint-format.d.ts +17 -0
- package/dist/esm/hooks/use-paint-format.d.ts.map +1 -0
- package/dist/esm/hooks/use-paint-format.js +110 -0
- package/dist/esm/hooks/use-search.d.ts +81 -0
- package/dist/esm/hooks/use-search.d.ts.map +1 -0
- package/dist/esm/hooks/use-search.js +251 -0
- package/dist/esm/hooks/use-select-next-prev-sheet.d.ts +11 -0
- package/dist/esm/hooks/use-select-next-prev-sheet.d.ts.map +1 -0
- package/dist/esm/hooks/use-select-next-prev-sheet.js +21 -0
- package/dist/esm/hooks/use-sheet-observer.d.ts +20 -0
- package/dist/esm/hooks/use-sheet-observer.d.ts.map +1 -0
- package/dist/esm/hooks/use-sheet-observer.js +120 -0
- package/dist/esm/hooks/use-sheet-properties.d.ts +105 -0
- package/dist/esm/hooks/use-sheet-properties.d.ts.map +1 -0
- package/dist/esm/hooks/use-sheet-properties.js +895 -0
- package/dist/esm/hooks/use-sheet-state.d.ts +17 -0
- package/dist/esm/hooks/use-sheet-state.d.ts.map +1 -0
- package/dist/esm/hooks/use-sheet-state.js +102 -0
- package/dist/esm/hooks/use-sheetdata-subscriber.d.ts +10 -0
- package/dist/esm/hooks/use-sheetdata-subscriber.d.ts.map +1 -0
- package/dist/esm/hooks/use-sheetdata-subscriber.js +14 -0
- package/dist/esm/hooks/use-slicers.d.ts +19 -0
- package/dist/esm/hooks/use-slicers.d.ts.map +1 -0
- package/dist/esm/hooks/use-slicers.js +83 -0
- package/dist/esm/hooks/use-split-text-to-columns.d.ts +19 -0
- package/dist/esm/hooks/use-split-text-to-columns.d.ts.map +1 -0
- package/dist/esm/hooks/use-split-text-to-columns.js +30 -0
- package/dist/esm/hooks/use-spreadsheet-state.d.ts +627 -0
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -0
- package/dist/esm/hooks/use-spreadsheet-state.js +2010 -0
- package/dist/esm/hooks/use-ss-registry.d.ts +6 -0
- package/dist/esm/hooks/use-ss-registry.d.ts.map +1 -0
- package/dist/esm/hooks/use-ss-registry.js +17 -0
- package/dist/esm/hooks/use-structured-reference.d.ts +8 -0
- package/dist/esm/hooks/use-structured-reference.d.ts.map +1 -0
- package/dist/esm/hooks/use-structured-reference.js +129 -0
- package/dist/esm/hooks/use-undo-redo-actions.d.ts +40 -0
- package/dist/esm/hooks/use-undo-redo-actions.d.ts.map +1 -0
- package/dist/esm/hooks/use-undo-redo-actions.js +166 -0
- package/dist/esm/hooks/use-undo-redo.d.ts +69 -0
- package/dist/esm/hooks/use-undo-redo.d.ts.map +1 -0
- package/dist/esm/hooks/use-undo-redo.js +113 -0
- package/dist/esm/hooks/utils/frozen-sort.d.ts +9 -0
- package/dist/esm/hooks/utils/frozen-sort.d.ts.map +1 -0
- package/dist/esm/hooks/utils/frozen-sort.js +25 -0
- package/dist/esm/hooks/utils/sort-rows.d.ts +32 -0
- package/dist/esm/hooks/utils/sort-rows.d.ts.map +1 -0
- package/dist/esm/hooks/utils/sort-rows.js +102 -0
- package/dist/esm/index.d.ts +38 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +39 -0
- package/dist/esm/interface/apply-fill.d.ts +6 -0
- package/dist/esm/interface/apply-fill.d.ts.map +1 -0
- package/dist/esm/interface/apply-fill.js +195 -0
- package/dist/esm/interface/auto-resize.d.ts +4 -0
- package/dist/esm/interface/auto-resize.d.ts.map +1 -0
- package/dist/esm/interface/auto-resize.js +50 -0
- package/dist/esm/interface/calculation-interface.d.ts +67 -0
- package/dist/esm/interface/calculation-interface.d.ts.map +1 -0
- package/dist/esm/interface/calculation-interface.js +339 -0
- package/dist/esm/interface/change-batch-stream.d.ts +25 -0
- package/dist/esm/interface/change-batch-stream.d.ts.map +1 -0
- package/dist/esm/interface/change-batch-stream.js +294 -0
- package/dist/esm/interface/change-batch.d.ts +39 -0
- package/dist/esm/interface/change-batch.d.ts.map +1 -0
- package/dist/esm/interface/change-batch.js +282 -0
- package/dist/esm/interface/change-border.d.ts +5 -0
- package/dist/esm/interface/change-border.d.ts.map +1 -0
- package/dist/esm/interface/change-border.js +116 -0
- package/dist/esm/interface/change-calculated-column.d.ts +5 -0
- package/dist/esm/interface/change-calculated-column.d.ts.map +1 -0
- package/dist/esm/interface/change-calculated-column.js +120 -0
- package/dist/esm/interface/change-decimals.d.ts +7 -0
- package/dist/esm/interface/change-decimals.d.ts.map +1 -0
- package/dist/esm/interface/change-decimals.js +58 -0
- package/dist/esm/interface/change-formatting.d.ts +4 -0
- package/dist/esm/interface/change-formatting.d.ts.map +1 -0
- package/dist/esm/interface/change-formatting.js +209 -0
- package/dist/esm/interface/change-sheet-tabcolor.d.ts +4 -0
- package/dist/esm/interface/change-sheet-tabcolor.d.ts.map +1 -0
- package/dist/esm/interface/change-sheet-tabcolor.js +19 -0
- package/dist/esm/interface/change-table-column.d.ts +49 -0
- package/dist/esm/interface/change-table-column.d.ts.map +1 -0
- package/dist/esm/interface/change-table-column.js +247 -0
- package/dist/esm/interface/change-theme.d.ts +4 -0
- package/dist/esm/interface/change-theme.d.ts.map +1 -0
- package/dist/esm/interface/change-theme.js +21 -0
- package/dist/esm/interface/chart-extensions.d.ts +32 -0
- package/dist/esm/interface/chart-extensions.d.ts.map +1 -0
- package/dist/esm/interface/chart-extensions.js +71 -0
- package/dist/esm/interface/citations.d.ts +33 -0
- package/dist/esm/interface/citations.d.ts.map +1 -0
- package/dist/esm/interface/citations.js +123 -0
- package/dist/esm/interface/clear-formatting.d.ts +5 -0
- package/dist/esm/interface/clear-formatting.d.ts.map +1 -0
- package/dist/esm/interface/clear-formatting.js +48 -0
- package/dist/esm/interface/conditional-formatting-rules.d.ts +7 -0
- package/dist/esm/interface/conditional-formatting-rules.d.ts.map +1 -0
- package/dist/esm/interface/conditional-formatting-rules.js +123 -0
- package/dist/esm/interface/create-table.d.ts +5 -0
- package/dist/esm/interface/create-table.d.ts.map +1 -0
- package/dist/esm/interface/create-table.js +105 -0
- package/dist/esm/interface/data-validation-rules.d.ts +25 -0
- package/dist/esm/interface/data-validation-rules.d.ts.map +1 -0
- package/dist/esm/interface/data-validation-rules.js +310 -0
- package/dist/esm/interface/data-validation-utils.d.ts +12 -0
- package/dist/esm/interface/data-validation-utils.d.ts.map +1 -0
- package/dist/esm/interface/data-validation-utils.js +79 -0
- package/dist/esm/interface/delete-cells-shift-left.d.ts +5 -0
- package/dist/esm/interface/delete-cells-shift-left.d.ts.map +1 -0
- package/dist/esm/interface/delete-cells-shift-left.js +146 -0
- package/dist/esm/interface/delete-cells-shift-up.d.ts +5 -0
- package/dist/esm/interface/delete-cells-shift-up.d.ts.map +1 -0
- package/dist/esm/interface/delete-cells-shift-up.js +138 -0
- package/dist/esm/interface/delete-cells.d.ts +6 -0
- package/dist/esm/interface/delete-cells.d.ts.map +1 -0
- package/dist/esm/interface/delete-cells.js +184 -0
- package/dist/esm/interface/delete-column.d.ts +4 -0
- package/dist/esm/interface/delete-column.d.ts.map +1 -0
- package/dist/esm/interface/delete-column.js +254 -0
- package/dist/esm/interface/delete-row.d.ts +4 -0
- package/dist/esm/interface/delete-row.d.ts.map +1 -0
- package/dist/esm/interface/delete-row.js +226 -0
- package/dist/esm/interface/delete-sheet.d.ts +4 -0
- package/dist/esm/interface/delete-sheet.d.ts.map +1 -0
- package/dist/esm/interface/delete-sheet.js +78 -0
- package/dist/esm/interface/delete-table-column.d.ts +4 -0
- package/dist/esm/interface/delete-table-column.d.ts.map +1 -0
- package/dist/esm/interface/delete-table-column.js +274 -0
- package/dist/esm/interface/delete-table-row.d.ts +4 -0
- package/dist/esm/interface/delete-table-row.d.ts.map +1 -0
- package/dist/esm/interface/delete-table-row.js +278 -0
- package/dist/esm/interface/duplicate-sheet.d.ts +4 -0
- package/dist/esm/interface/duplicate-sheet.d.ts.map +1 -0
- package/dist/esm/interface/duplicate-sheet.js +206 -0
- package/dist/esm/interface/embeds.d.ts +9 -0
- package/dist/esm/interface/embeds.d.ts.map +1 -0
- package/dist/esm/interface/embeds.js +115 -0
- package/dist/esm/interface/freeze.d.ts +5 -0
- package/dist/esm/interface/freeze.d.ts.map +1 -0
- package/dist/esm/interface/freeze.js +109 -0
- package/dist/esm/interface/helpers.d.ts +6 -0
- package/dist/esm/interface/helpers.d.ts.map +1 -0
- package/dist/esm/interface/helpers.js +32 -0
- package/dist/esm/interface/hide-column.d.ts +4 -0
- package/dist/esm/interface/hide-column.d.ts.map +1 -0
- package/dist/esm/interface/hide-column.js +59 -0
- package/dist/esm/interface/hide-row.d.ts +4 -0
- package/dist/esm/interface/hide-row.d.ts.map +1 -0
- package/dist/esm/interface/hide-row.js +54 -0
- package/dist/esm/interface/indent.d.ts +7 -0
- package/dist/esm/interface/indent.d.ts.map +1 -0
- package/dist/esm/interface/indent.js +73 -0
- package/dist/esm/interface/insert-cells-shift-down.d.ts +5 -0
- package/dist/esm/interface/insert-cells-shift-down.d.ts.map +1 -0
- package/dist/esm/interface/insert-cells-shift-down.js +143 -0
- package/dist/esm/interface/insert-cells-shift-right.d.ts +5 -0
- package/dist/esm/interface/insert-cells-shift-right.d.ts.map +1 -0
- package/dist/esm/interface/insert-cells-shift-right.js +134 -0
- package/dist/esm/interface/insert-column.d.ts +7 -0
- package/dist/esm/interface/insert-column.d.ts.map +1 -0
- package/dist/esm/interface/insert-column.js +481 -0
- package/dist/esm/interface/insert-note.d.ts +5 -0
- package/dist/esm/interface/insert-note.d.ts.map +1 -0
- package/dist/esm/interface/insert-note.js +23 -0
- package/dist/esm/interface/insert-row.d.ts +4 -0
- package/dist/esm/interface/insert-row.d.ts.map +1 -0
- package/dist/esm/interface/insert-row.js +158 -0
- package/dist/esm/interface/insert-table-row.d.ts +4 -0
- package/dist/esm/interface/insert-table-row.d.ts.map +1 -0
- package/dist/esm/interface/insert-table-row.js +314 -0
- package/dist/esm/interface/interface-cli.d.ts +3 -0
- package/dist/esm/interface/interface-cli.d.ts.map +1 -0
- package/dist/esm/interface/interface-cli.js +62 -0
- package/dist/esm/interface/named-range-operations.d.ts +19 -0
- package/dist/esm/interface/named-range-operations.d.ts.map +1 -0
- package/dist/esm/interface/named-range-operations.js +71 -0
- package/dist/esm/interface/new-sheet.d.ts +4 -0
- package/dist/esm/interface/new-sheet.d.ts.map +1 -0
- package/dist/esm/interface/new-sheet.js +102 -0
- package/dist/esm/interface/pivot-extensions.d.ts +27 -0
- package/dist/esm/interface/pivot-extensions.d.ts.map +1 -0
- package/dist/esm/interface/pivot-extensions.js +60 -0
- package/dist/esm/interface/remove-duplicates.d.ts +11 -0
- package/dist/esm/interface/remove-duplicates.d.ts.map +1 -0
- package/dist/esm/interface/remove-duplicates.js +107 -0
- package/dist/esm/interface/remove-table.d.ts +4 -0
- package/dist/esm/interface/remove-table.d.ts.map +1 -0
- package/dist/esm/interface/remove-table.js +50 -0
- package/dist/esm/interface/resize-utils.d.ts +18 -0
- package/dist/esm/interface/resize-utils.d.ts.map +1 -0
- package/dist/esm/interface/resize-utils.js +34 -0
- package/dist/esm/interface/resize.d.ts +5 -0
- package/dist/esm/interface/resize.d.ts.map +1 -0
- package/dist/esm/interface/resize.js +43 -0
- package/dist/esm/interface/slicers.d.ts +9 -0
- package/dist/esm/interface/slicers.d.ts.map +1 -0
- package/dist/esm/interface/slicers.js +107 -0
- package/dist/esm/interface/split-text.d.ts +5 -0
- package/dist/esm/interface/split-text.d.ts.map +1 -0
- package/dist/esm/interface/split-text.js +94 -0
- package/dist/esm/interface/spreadsheet-interface.d.ts +642 -0
- package/dist/esm/interface/spreadsheet-interface.d.ts.map +1 -0
- package/dist/esm/interface/spreadsheet-interface.js +2442 -0
- package/dist/esm/interface/table-totalrow.d.ts +20 -0
- package/dist/esm/interface/table-totalrow.d.ts.map +1 -0
- package/dist/esm/interface/table-totalrow.js +155 -0
- package/dist/esm/interface/table-utils.d.ts +21 -0
- package/dist/esm/interface/table-utils.d.ts.map +1 -0
- package/dist/esm/interface/table-utils.js +38 -0
- package/dist/esm/interface/update-sheet.d.ts +16 -0
- package/dist/esm/interface/update-sheet.d.ts.map +1 -0
- package/dist/esm/interface/update-sheet.js +64 -0
- package/dist/esm/interface/update-table.d.ts +4 -0
- package/dist/esm/interface/update-table.d.ts.map +1 -0
- package/dist/esm/interface/update-table.js +111 -0
- package/dist/esm/server-utils.d.ts +8 -0
- package/dist/esm/server-utils.d.ts.map +1 -0
- package/dist/esm/server-utils.js +3 -0
- package/dist/esm/server.browser.d.ts +9 -0
- package/dist/esm/server.browser.d.ts.map +1 -0
- package/dist/esm/server.browser.js +5 -0
- package/dist/esm/server.d.ts +9 -0
- package/dist/esm/server.d.ts.map +1 -0
- package/dist/esm/server.js +5 -0
- package/dist/esm/shared-string-registry.d.ts +35 -0
- package/dist/esm/shared-string-registry.d.ts.map +1 -0
- package/dist/esm/shared-string-registry.js +248 -0
- package/dist/esm/sheet-cell.d.ts +310 -0
- package/dist/esm/sheet-cell.d.ts.map +1 -0
- package/dist/esm/sheet-cell.js +1829 -0
- package/dist/esm/test-setup.d.ts +2 -0
- package/dist/esm/test-setup.d.ts.map +1 -0
- package/dist/esm/test-setup.js +3 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/esm/types.d.ts +44 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +33 -0
- package/dist/esm/validation-schema/table.schema.d.ts +6 -0
- package/dist/esm/validation-schema/table.schema.d.ts.map +1 -0
- package/dist/esm/validation-schema/table.schema.js +4 -0
- package/dist/esm/vitest.config.d.ts +3 -0
- package/dist/esm/vitest.config.d.ts.map +1 -0
- package/dist/esm/vitest.config.js +22 -0
- package/package.json +89 -0
|
@@ -0,0 +1,2442 @@
|
|
|
1
|
+
import { tokenize as defaultTokenizer } from "@rowsncolumns/calculator";
|
|
2
|
+
import { isCellCoordinate, isCellNode, isCellRangeNode, isStaticNode, } from "@rowsncolumns/dag";
|
|
3
|
+
import { FormulaError } from "@rowsncolumns/fast-formula-parser";
|
|
4
|
+
import { defaultSpreadsheetTheme, } from "@rowsncolumns/spreadsheet";
|
|
5
|
+
import { addressToCell, canUseDOM, cellToAddress, DEFAULT_ACTIVE_CELL, DEFAULT_COLUMN_COUNT, DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_COUNT, DEFAULT_ROW_HEIGHT, generateSelectionsFromFormula, getCellEffectiveFormat, getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredFormat, getCellUserEnteredValue, getColumnIndexFromColumnName, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, isAreasEqual, isCellWithinBounds, isNil, iterateCellsInRange, pointToPixel, } from "@rowsncolumns/utils";
|
|
6
|
+
import { enableMapSet, enablePatches, produceWithPatches } from "immer";
|
|
7
|
+
import { buildConditionalFormatExpression } from "../api/conditional-format";
|
|
8
|
+
import { isConditionalFormatFormulaRule } from "../api/conditional-format";
|
|
9
|
+
import { buildDataValidationExpression } from "../api/data-validation";
|
|
10
|
+
import { isDataValidationFormulaRule } from "../api/data-validation";
|
|
11
|
+
import { getAutoFillValues } from "../api/fill";
|
|
12
|
+
import { formulaToRelativeReference } from "../api/formula";
|
|
13
|
+
import { createSheetDraft, deriveCellFromPrecedents } from "../api/immer-utils";
|
|
14
|
+
import { defaultCellCoords, isStyleReference, SheetCell } from "../sheet-cell";
|
|
15
|
+
import { CellXfsRegistry } from "../cellxfs-registry";
|
|
16
|
+
import { SharedStringRegistry } from "../shared-string-registry";
|
|
17
|
+
import { getSharedStringRuns, getSharedStringText } from "../types";
|
|
18
|
+
import { applyFill } from "./apply-fill";
|
|
19
|
+
import { autoResize } from "./auto-resize";
|
|
20
|
+
import { CalculationInterface } from "./calculation-interface";
|
|
21
|
+
import { changeBatch } from "./change-batch";
|
|
22
|
+
import { changeBatchStream } from "./change-batch-stream";
|
|
23
|
+
import { changeBorder } from "./change-border";
|
|
24
|
+
import { changeCalculatedColumn } from "./change-calculated-column";
|
|
25
|
+
import { changeDecimals } from "./change-decimals";
|
|
26
|
+
import { changeFormatting } from "./change-formatting";
|
|
27
|
+
import { changeSheetTabcolor } from "./change-sheet-tabcolor";
|
|
28
|
+
import { changeTableColumn } from "./change-table-column";
|
|
29
|
+
import { changeTheme } from "./change-theme";
|
|
30
|
+
import { isChartsAvailable, safeCreateChart, safeDeleteChart, safeMoveChart, safeResizeChart, safeUpdateChart, } from "./chart-extensions";
|
|
31
|
+
import { createBatchCitations, createCitation, deleteCitation, removeCitationFromCell, updateCitation, } from "./citations";
|
|
32
|
+
import { clearFormatting } from "./clear-formatting";
|
|
33
|
+
import { createConditionalFormattingRule, deleteConditionalFormattingRule, previewConditionalFormattingRule, updateConditionalFormattingRule, } from "./conditional-formatting-rules";
|
|
34
|
+
import { createTable } from "./create-table";
|
|
35
|
+
import { createDataValidationRule, deleteDataValidationRule, deleteDataValidationRules, updateDataValidationRule, } from "./data-validation-rules";
|
|
36
|
+
import { deleteCells } from "./delete-cells";
|
|
37
|
+
import { deleteCellsShiftLeft } from "./delete-cells-shift-left";
|
|
38
|
+
import { deleteCellsShiftUp } from "./delete-cells-shift-up";
|
|
39
|
+
import { deleteColumn } from "./delete-column";
|
|
40
|
+
import { deleteRow } from "./delete-row";
|
|
41
|
+
import { deleteSheet } from "./delete-sheet";
|
|
42
|
+
import { deleteTableColumn } from "./delete-table-column";
|
|
43
|
+
import { deleteTableRow } from "./delete-table-row";
|
|
44
|
+
import { duplicateSheet } from "./duplicate-sheet";
|
|
45
|
+
import { createEmbed, deleteEmbed, moveEmbed, resizeEmbed, updateEmbed, } from "./embeds";
|
|
46
|
+
import { freezeColumn, freezeRow } from "./freeze";
|
|
47
|
+
import { hideColumns } from "./hide-column";
|
|
48
|
+
import { hideRows } from "./hide-row";
|
|
49
|
+
import { decreaseIndent, increaseIndent } from "./indent";
|
|
50
|
+
import { insertColumn, insertTableColumn } from "./insert-column";
|
|
51
|
+
import { insertNote } from "./insert-note";
|
|
52
|
+
import { insertRow } from "./insert-row";
|
|
53
|
+
import { insertTableRow } from "./insert-table-row";
|
|
54
|
+
import { createNamedRange, deleteNamedRange } from "./named-range-operations";
|
|
55
|
+
import { createNewSheet } from "./new-sheet";
|
|
56
|
+
import { safeCreatePivotTable, safeDeletePivotTable } from "./pivot-extensions";
|
|
57
|
+
import { removeTable } from "./remove-table";
|
|
58
|
+
import { removeDuplicates } from "./remove-duplicates";
|
|
59
|
+
import { resize } from "./resize";
|
|
60
|
+
import { updateSheet } from "./update-sheet";
|
|
61
|
+
import { updateTable } from "./update-table";
|
|
62
|
+
// Enable patches
|
|
63
|
+
enablePatches();
|
|
64
|
+
enableMapSet();
|
|
65
|
+
// lib/canvas-adapter.ts
|
|
66
|
+
let canvasLib = null;
|
|
67
|
+
export const createCanvas = (width, height) => {
|
|
68
|
+
if (canUseDOM) {
|
|
69
|
+
// Browser environment (Storybook)
|
|
70
|
+
const canvas = document.createElement("canvas");
|
|
71
|
+
canvas.width = width;
|
|
72
|
+
canvas.height = height;
|
|
73
|
+
return canvas;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Node environment
|
|
77
|
+
if (!canvasLib) {
|
|
78
|
+
try {
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
80
|
+
canvasLib = require("canvas");
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
// Fallback: return a minimal mock canvas for SSR/build compatibility
|
|
84
|
+
console.warn("canvas not available, using mock canvas");
|
|
85
|
+
return {
|
|
86
|
+
width,
|
|
87
|
+
height,
|
|
88
|
+
getContext: () => ({
|
|
89
|
+
font: "",
|
|
90
|
+
measureText: () => ({ width: 0 }),
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return canvasLib.createCanvas(width, height);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Backend auto-sizer for measuring text dimensions in Node.js
|
|
100
|
+
*/
|
|
101
|
+
class BackendAutoSizer {
|
|
102
|
+
canvas = createCanvas(0, 0);
|
|
103
|
+
ctx = this.canvas.getContext("2d");
|
|
104
|
+
currentFontSize = 12;
|
|
105
|
+
setFont({ fontFamily = "Arial", fontSize = 12, fontWeight = "", fontStyle = "", scale = 1, }) {
|
|
106
|
+
this.currentFontSize = fontSize * scale;
|
|
107
|
+
const font = `${fontStyle} ${fontWeight} ${this.currentFontSize}px ${fontFamily}`
|
|
108
|
+
.trim()
|
|
109
|
+
.replace(/\s+/g, " ");
|
|
110
|
+
this.ctx.font = font;
|
|
111
|
+
}
|
|
112
|
+
reset() {
|
|
113
|
+
this.setFont({});
|
|
114
|
+
}
|
|
115
|
+
measureText(text, shouldWrap = false, maxWidth) {
|
|
116
|
+
if (!text)
|
|
117
|
+
return null;
|
|
118
|
+
const metrics = this.ctx.measureText(text);
|
|
119
|
+
let width = metrics.width;
|
|
120
|
+
let height = this.currentFontSize * 1.2; // Line height approximation
|
|
121
|
+
if (shouldWrap && maxWidth && width > maxWidth) {
|
|
122
|
+
// Simple word wrapping calculation
|
|
123
|
+
const words = text.split(" ");
|
|
124
|
+
let lines = 1;
|
|
125
|
+
let currentLineWidth = 0;
|
|
126
|
+
for (const word of words) {
|
|
127
|
+
const wordWidth = this.ctx.measureText(word + " ").width;
|
|
128
|
+
if (currentLineWidth + wordWidth > maxWidth) {
|
|
129
|
+
lines++;
|
|
130
|
+
currentLineWidth = wordWidth;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
currentLineWidth += wordWidth;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
height = this.currentFontSize * 1.2 * lines;
|
|
137
|
+
width = maxWidth;
|
|
138
|
+
}
|
|
139
|
+
return { width, height };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Generic state change function
|
|
143
|
+
const stateChangeFunction = (getter, setter) => (action) => {
|
|
144
|
+
if (typeof action === "function") {
|
|
145
|
+
// If action is a function, call it with current state
|
|
146
|
+
setter(action(getter()));
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// If action is a value, set it directly
|
|
150
|
+
setter(action);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Spreadsheet Interface for SSR
|
|
155
|
+
*
|
|
156
|
+
* const spreadsheet = new Spreadsheet()
|
|
157
|
+
*/
|
|
158
|
+
export class Spreadsheet {
|
|
159
|
+
_sheets = [];
|
|
160
|
+
_sheetData = {};
|
|
161
|
+
_tables = [];
|
|
162
|
+
_charts = [];
|
|
163
|
+
_embeds = [];
|
|
164
|
+
_pivotTables = [];
|
|
165
|
+
_citations = [];
|
|
166
|
+
_namedRanges = [];
|
|
167
|
+
_dataValidations = [];
|
|
168
|
+
_conditionalFormats = [];
|
|
169
|
+
_locale = "en";
|
|
170
|
+
_patches = [];
|
|
171
|
+
_cellXfs = new Map();
|
|
172
|
+
_activeSheetId = 1;
|
|
173
|
+
_autoSizer = new BackendAutoSizer();
|
|
174
|
+
scale = 1;
|
|
175
|
+
skipDag = false;
|
|
176
|
+
cellHorizontalSpacing = 5;
|
|
177
|
+
cellVerticalSpacing = 5;
|
|
178
|
+
resizeStrategy = "full";
|
|
179
|
+
minRowDimension = DEFAULT_ROW_HEIGHT;
|
|
180
|
+
minColumnDimension = DEFAULT_COLUMN_WIDTH;
|
|
181
|
+
_calculationInterface;
|
|
182
|
+
_sharedStrings = new Map();
|
|
183
|
+
_getEffectiveStructuredValue;
|
|
184
|
+
constructor(options) {
|
|
185
|
+
this._getEffectiveStructuredValue = options?.getEffectiveStructuredValue;
|
|
186
|
+
this._calculationInterface = new CalculationInterface({
|
|
187
|
+
locale: this.locale,
|
|
188
|
+
createWorker: options?.createCalculationWorker,
|
|
189
|
+
iterativeCalculation: options?.iterativeCalculation,
|
|
190
|
+
clientOnlyFunctionPattern: options?.clientOnlyFunctionPattern,
|
|
191
|
+
getSheetName: this.getSheetName,
|
|
192
|
+
getSheetId: (sheetName) => this.getSheetId(sheetName, { fallbackToActiveSheet: false }),
|
|
193
|
+
getSheets: () => this.sheets,
|
|
194
|
+
getTables: () => this.tables,
|
|
195
|
+
getNamedRanges: () => this.namedRanges,
|
|
196
|
+
getFinalUserEnteredValue: this.getFinalUserEnteredValue,
|
|
197
|
+
getEffectiveValue: this.getEffectiveValueForCalculation,
|
|
198
|
+
getEffectiveStructuredValue: options?.getEffectiveStructuredValue,
|
|
199
|
+
onResults: this.applyCalculationResults,
|
|
200
|
+
});
|
|
201
|
+
this.enqueueCalculation = (operation) => {
|
|
202
|
+
this._calculationInterface.enqueueCalculation(operation);
|
|
203
|
+
};
|
|
204
|
+
this.enqueueGraphOperation = (operation) => {
|
|
205
|
+
this._calculationInterface.enqueueGraphOperation(operation);
|
|
206
|
+
};
|
|
207
|
+
this.enqueueStructureChange = (change) => {
|
|
208
|
+
this._calculationInterface.enqueueStructureChange(change);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
rebuildGraph() {
|
|
212
|
+
if (this.skipDag) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this._calculationInterface.rebuildGraph(this.collectFormulaOperations());
|
|
216
|
+
this.addConditionalFormattingToGraph();
|
|
217
|
+
this.addDataValidationsToGraph();
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Add conditional formatting rules to the dependency graph.
|
|
221
|
+
* @param sheetId - Optional sheet ID to restrict to a specific sheet
|
|
222
|
+
*/
|
|
223
|
+
addConditionalFormattingToGraph(sheetId) {
|
|
224
|
+
const restrictToSheet = typeof sheetId === "number";
|
|
225
|
+
for (const rule of this.conditionalFormats ?? []) {
|
|
226
|
+
if (rule.enabled === false) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (isConditionalFormatFormulaRule(rule)) {
|
|
230
|
+
for (const range of rule.ranges) {
|
|
231
|
+
if (restrictToSheet && range.sheetId !== sheetId) {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
for (const [rowIndex, columnIndex] of iterateCellsInRange(range)) {
|
|
235
|
+
this.enqueueGraphOperation({
|
|
236
|
+
position: {
|
|
237
|
+
rowIndex,
|
|
238
|
+
columnIndex,
|
|
239
|
+
sheetId: range.sheetId,
|
|
240
|
+
conditionalFormatId: rule.id,
|
|
241
|
+
},
|
|
242
|
+
type: "add",
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Add data validation rules to the dependency graph.
|
|
251
|
+
* @param sheetId - Optional sheet ID to restrict to a specific sheet
|
|
252
|
+
*/
|
|
253
|
+
addDataValidationsToGraph(sheetId) {
|
|
254
|
+
const restrictToSheet = typeof sheetId === "number";
|
|
255
|
+
for (const rule of this.dataValidations ?? []) {
|
|
256
|
+
if (isDataValidationFormulaRule(rule)) {
|
|
257
|
+
for (const range of rule.ranges) {
|
|
258
|
+
if (restrictToSheet && range.sheetId !== sheetId) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
for (const [rowIndex, columnIndex] of iterateCellsInRange(range)) {
|
|
262
|
+
this.enqueueGraphOperation({
|
|
263
|
+
position: {
|
|
264
|
+
rowIndex,
|
|
265
|
+
columnIndex,
|
|
266
|
+
sheetId: range.sheetId,
|
|
267
|
+
dataValidationId: rule.id,
|
|
268
|
+
},
|
|
269
|
+
type: "add",
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
set sharedStrings(value) {
|
|
277
|
+
this._sharedStrings = value;
|
|
278
|
+
}
|
|
279
|
+
get sharedStrings() {
|
|
280
|
+
return this._sharedStrings;
|
|
281
|
+
}
|
|
282
|
+
get activeSheetId() {
|
|
283
|
+
return this._activeSheetId;
|
|
284
|
+
}
|
|
285
|
+
set activeSheetId(value) {
|
|
286
|
+
this._activeSheetId = value;
|
|
287
|
+
}
|
|
288
|
+
get sheets() {
|
|
289
|
+
return this._sheets;
|
|
290
|
+
}
|
|
291
|
+
set sheets(value) {
|
|
292
|
+
this._sheets = value;
|
|
293
|
+
this._calculationInterface.markMetadataDirty();
|
|
294
|
+
}
|
|
295
|
+
get charts() {
|
|
296
|
+
return this._charts;
|
|
297
|
+
}
|
|
298
|
+
set charts(value) {
|
|
299
|
+
this._charts = value;
|
|
300
|
+
}
|
|
301
|
+
get embeds() {
|
|
302
|
+
return this._embeds;
|
|
303
|
+
}
|
|
304
|
+
set embeds(value) {
|
|
305
|
+
this._embeds = value;
|
|
306
|
+
}
|
|
307
|
+
get pivotTables() {
|
|
308
|
+
return this._pivotTables;
|
|
309
|
+
}
|
|
310
|
+
set pivotTables(value) {
|
|
311
|
+
this._pivotTables = value;
|
|
312
|
+
}
|
|
313
|
+
get citations() {
|
|
314
|
+
return this._citations;
|
|
315
|
+
}
|
|
316
|
+
set citations(value) {
|
|
317
|
+
this._citations = value;
|
|
318
|
+
}
|
|
319
|
+
get namedRanges() {
|
|
320
|
+
return this._namedRanges;
|
|
321
|
+
}
|
|
322
|
+
set namedRanges(value) {
|
|
323
|
+
this._namedRanges = value;
|
|
324
|
+
this._calculationInterface.markMetadataDirty();
|
|
325
|
+
}
|
|
326
|
+
get dataValidations() {
|
|
327
|
+
return this._dataValidations;
|
|
328
|
+
}
|
|
329
|
+
set dataValidations(value) {
|
|
330
|
+
this._dataValidations = value;
|
|
331
|
+
}
|
|
332
|
+
get conditionalFormats() {
|
|
333
|
+
return this._conditionalFormats;
|
|
334
|
+
}
|
|
335
|
+
set conditionalFormats(value) {
|
|
336
|
+
this._conditionalFormats = value;
|
|
337
|
+
}
|
|
338
|
+
get sheetData() {
|
|
339
|
+
return this._sheetData;
|
|
340
|
+
}
|
|
341
|
+
set sheetData(sheetData) {
|
|
342
|
+
this._sheetData = sheetData;
|
|
343
|
+
}
|
|
344
|
+
get tables() {
|
|
345
|
+
return this._tables;
|
|
346
|
+
}
|
|
347
|
+
set tables(value) {
|
|
348
|
+
this._tables = value;
|
|
349
|
+
this._calculationInterface.markMetadataDirty();
|
|
350
|
+
}
|
|
351
|
+
set locale(value) {
|
|
352
|
+
this._locale = value;
|
|
353
|
+
this._calculationInterface.markMetadataDirty();
|
|
354
|
+
}
|
|
355
|
+
get locale() {
|
|
356
|
+
return this._locale;
|
|
357
|
+
}
|
|
358
|
+
set cellXfs(value) {
|
|
359
|
+
this._cellXfs = value;
|
|
360
|
+
}
|
|
361
|
+
get cellXfs() {
|
|
362
|
+
return this._cellXfs;
|
|
363
|
+
}
|
|
364
|
+
set patches(value) {
|
|
365
|
+
this._patches = value;
|
|
366
|
+
}
|
|
367
|
+
get patches() {
|
|
368
|
+
return this._patches;
|
|
369
|
+
}
|
|
370
|
+
clearPatches() {
|
|
371
|
+
this._patches = [];
|
|
372
|
+
}
|
|
373
|
+
onChangeSheets = stateChangeFunction(() => this.sheets, // Getter function
|
|
374
|
+
(value) => (this.sheets = value));
|
|
375
|
+
onChangeSheetData = stateChangeFunction(() => this.sheetData, (value) => (this.sheetData = value));
|
|
376
|
+
onChangeTables = stateChangeFunction(() => this.tables, (value) => (this.tables = value));
|
|
377
|
+
onChangeCharts = stateChangeFunction(() => this.charts, (value) => (this.charts = value));
|
|
378
|
+
onChangeEmbeds = stateChangeFunction(() => this.embeds, (value) => (this.embeds = value));
|
|
379
|
+
onChangeNamedRanges = stateChangeFunction(() => this.namedRanges, (value) => (this.namedRanges = value));
|
|
380
|
+
onChangeSharedStrings = stateChangeFunction(() => this.sharedStrings, (value) => (this.sharedStrings = value));
|
|
381
|
+
onChangeDataValidations = stateChangeFunction(() => this.dataValidations, (value) => (this.dataValidations = value));
|
|
382
|
+
onChangeConditionalFormats = stateChangeFunction(() => this.conditionalFormats, (value) => (this.conditionalFormats = value));
|
|
383
|
+
onChangeCellXfs = stateChangeFunction(() => this.cellXfs, (value) => {
|
|
384
|
+
this.cellXfs = value;
|
|
385
|
+
});
|
|
386
|
+
get cellXfsRegistry() {
|
|
387
|
+
return new CellXfsRegistry(this.cellXfs, this.onChangeCellXfs);
|
|
388
|
+
}
|
|
389
|
+
get sharedStringRegistry() {
|
|
390
|
+
return new SharedStringRegistry(this.sharedStrings, this.onChangeSharedStrings);
|
|
391
|
+
}
|
|
392
|
+
onChangeActiveSheet = stateChangeFunction(() => this.activeSheetId, (value) => (this.activeSheetId = value));
|
|
393
|
+
onChangePivotTables = stateChangeFunction(() => this.pivotTables, // Getter function
|
|
394
|
+
(value) => (this.pivotTables = value));
|
|
395
|
+
onChangeCitations = stateChangeFunction(() => this.citations, (value) => (this.citations = value));
|
|
396
|
+
createHistory = () => (patches) => {
|
|
397
|
+
this._patches.push(patches);
|
|
398
|
+
};
|
|
399
|
+
enqueueCalculation = (_operation) => { };
|
|
400
|
+
enqueueGraphOperation = (_operation) => { };
|
|
401
|
+
enqueueStructureChange = (_change) => { };
|
|
402
|
+
onRequestCalculate = async () => {
|
|
403
|
+
return [];
|
|
404
|
+
};
|
|
405
|
+
getActiveCell = () => defaultCellCoords;
|
|
406
|
+
getSelections = () => [];
|
|
407
|
+
getDependents = (source, includeSource) => {
|
|
408
|
+
return this._calculationInterface.getDependents(source).filter((node) => {
|
|
409
|
+
if (isStaticNode(node)) {
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
if (!includeSource && isCellRangeNode(node)) {
|
|
413
|
+
return !isAreasEqual(node.position, source);
|
|
414
|
+
}
|
|
415
|
+
if (!includeSource && isCellCoordinate(source) && isCellNode(node)) {
|
|
416
|
+
const cellNode = node;
|
|
417
|
+
return (cellNode.position.rowIndex !== source.rowIndex ||
|
|
418
|
+
cellNode.position.columnIndex !== source.columnIndex);
|
|
419
|
+
}
|
|
420
|
+
return true;
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
onChangeSelections = () => [];
|
|
424
|
+
getContentfulRangeAroundCell = (sheetId, startCell) => {
|
|
425
|
+
return {
|
|
426
|
+
startRowIndex: startCell.rowIndex,
|
|
427
|
+
endRowIndex: startCell.rowIndex,
|
|
428
|
+
startColumnIndex: startCell.columnIndex,
|
|
429
|
+
endColumnIndex: startCell.columnIndex,
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
onChangeActiveCell = () => [];
|
|
433
|
+
getSharedStringValue(cellData) {
|
|
434
|
+
if (cellData?.ss == null) {
|
|
435
|
+
return undefined;
|
|
436
|
+
}
|
|
437
|
+
const value = this.sharedStrings.get(String(cellData.ss));
|
|
438
|
+
if (value == null) {
|
|
439
|
+
return undefined;
|
|
440
|
+
}
|
|
441
|
+
// Entries may be plain strings OR rich `{text, runs}` objects — mirror the
|
|
442
|
+
// hooks' getSharedStringValue, which resolves the rich form's text.
|
|
443
|
+
return getSharedStringText(value);
|
|
444
|
+
}
|
|
445
|
+
getEffectiveValue = (sheetId, rowIndex, columnIndex, _property) => {
|
|
446
|
+
const cellData = this.sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex];
|
|
447
|
+
// Check for shared strings
|
|
448
|
+
const sharedStringValue = this.getSharedStringValue(cellData);
|
|
449
|
+
if (sharedStringValue !== undefined) {
|
|
450
|
+
return sharedStringValue;
|
|
451
|
+
}
|
|
452
|
+
const effectiveValue = getCellEffectiveValue(cellData);
|
|
453
|
+
if (!effectiveValue) {
|
|
454
|
+
return undefined;
|
|
455
|
+
}
|
|
456
|
+
return (getExtendedValueBool(effectiveValue) ??
|
|
457
|
+
getExtendedValueNumber(effectiveValue) ??
|
|
458
|
+
getExtendedValueString(effectiveValue));
|
|
459
|
+
};
|
|
460
|
+
getHyperLink(sheetId, rowIndex, columnIndex) {
|
|
461
|
+
return this.getCellData(sheetId, rowIndex, columnIndex)?.hyperlink;
|
|
462
|
+
}
|
|
463
|
+
getHyperlinkText(hyperlink) {
|
|
464
|
+
if (!hyperlink) {
|
|
465
|
+
return undefined;
|
|
466
|
+
}
|
|
467
|
+
if (typeof hyperlink === "string") {
|
|
468
|
+
return hyperlink;
|
|
469
|
+
}
|
|
470
|
+
if (hyperlink.kind === "external") {
|
|
471
|
+
return hyperlink.url;
|
|
472
|
+
}
|
|
473
|
+
return hyperlink.location;
|
|
474
|
+
}
|
|
475
|
+
getEffectiveValueForCalculation = (sheetId, rowIndex, columnIndex, property) => {
|
|
476
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
477
|
+
if (property) {
|
|
478
|
+
return this._getEffectiveStructuredValue?.(getCellEffectiveValue(cellData)?.structuredValue, property);
|
|
479
|
+
}
|
|
480
|
+
const effectiveValue = getCellEffectiveValue(cellData);
|
|
481
|
+
const errorValue = getExtendedValueError(effectiveValue);
|
|
482
|
+
if (errorValue) {
|
|
483
|
+
return new FormulaError(errorValue.name, errorValue.message);
|
|
484
|
+
}
|
|
485
|
+
const hyperlink = this.getHyperlinkText(this.getHyperLink(sheetId, rowIndex, columnIndex));
|
|
486
|
+
return (hyperlink ??
|
|
487
|
+
this.getEffectiveValue(sheetId, rowIndex, columnIndex) ??
|
|
488
|
+
hyperlink ??
|
|
489
|
+
this._getEffectiveStructuredValue?.(effectiveValue?.structuredValue) ??
|
|
490
|
+
effectiveValue?.structuredValue);
|
|
491
|
+
};
|
|
492
|
+
getCellData(sheetId, rowIndex, columnIndex) {
|
|
493
|
+
return this.sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex];
|
|
494
|
+
}
|
|
495
|
+
getUserEnteredValue = (sheetId, rowIndex, columnIndex) => {
|
|
496
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
497
|
+
const sharedStringValue = this.getSharedStringValue(cellData);
|
|
498
|
+
if (sharedStringValue !== undefined) {
|
|
499
|
+
return { sv: sharedStringValue };
|
|
500
|
+
}
|
|
501
|
+
return getCellUserEnteredValue(cellData);
|
|
502
|
+
};
|
|
503
|
+
getUserEnteredStringValue = (sheetId, rowIndex, columnIndex) => {
|
|
504
|
+
const formulaValue = this.getFormulaValue(sheetId, rowIndex, columnIndex);
|
|
505
|
+
if (formulaValue) {
|
|
506
|
+
return formulaValue;
|
|
507
|
+
}
|
|
508
|
+
const userEnteredValue = this.getUserEnteredValue(sheetId, rowIndex, columnIndex);
|
|
509
|
+
const stringValue = getExtendedValueString(userEnteredValue);
|
|
510
|
+
if (stringValue) {
|
|
511
|
+
return stringValue;
|
|
512
|
+
}
|
|
513
|
+
return undefined;
|
|
514
|
+
};
|
|
515
|
+
getFormulaValue = (sheetId, rowIndex, columnIndex) => {
|
|
516
|
+
const userEnteredValue = this.getUserEnteredValue(sheetId, rowIndex, columnIndex);
|
|
517
|
+
return getExtendedValueFormula(userEnteredValue);
|
|
518
|
+
};
|
|
519
|
+
getFormattedValue = (sheetId, rowIndex, columnIndex) => {
|
|
520
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
521
|
+
const sharedStringValue = this.getSharedStringValue(cellData);
|
|
522
|
+
if (sharedStringValue !== undefined) {
|
|
523
|
+
return sharedStringValue;
|
|
524
|
+
}
|
|
525
|
+
return getCellFormattedValue(cellData);
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* Get sheet
|
|
529
|
+
* @param sheetId
|
|
530
|
+
* @returns
|
|
531
|
+
*/
|
|
532
|
+
getSheet(sheetId) {
|
|
533
|
+
const sheet = this.sheets.find((sheet) => sheet.sheetId === sheetId);
|
|
534
|
+
return new SheetInterface(sheet);
|
|
535
|
+
}
|
|
536
|
+
getSheetId = (sheetName, options) => {
|
|
537
|
+
const fallbackToActiveSheet = options?.fallbackToActiveSheet ?? true;
|
|
538
|
+
const sheet = this.sheets.find((sheet) => sheet.title === sheetName);
|
|
539
|
+
if (sheet) {
|
|
540
|
+
return sheet.sheetId;
|
|
541
|
+
}
|
|
542
|
+
return fallbackToActiveSheet ? this.activeSheetId : undefined;
|
|
543
|
+
};
|
|
544
|
+
getSheetIdOrActive = (sheetName) => {
|
|
545
|
+
return (this.getSheetId(sheetName, { fallbackToActiveSheet: true }) ??
|
|
546
|
+
this.activeSheetId);
|
|
547
|
+
};
|
|
548
|
+
getSheetName = (sheetId) => {
|
|
549
|
+
return this.getSheet(sheetId)?.name;
|
|
550
|
+
};
|
|
551
|
+
getDataValidationById = (id) => {
|
|
552
|
+
return this.dataValidations?.find((rule) => rule.id === id);
|
|
553
|
+
};
|
|
554
|
+
getConditionalFormatFormula = (sheetId, rowIndex, columnIndex, conditionalFormatId) => {
|
|
555
|
+
const rule = this.conditionalFormats?.find((candidate) => candidate.id === conditionalFormatId);
|
|
556
|
+
if (!rule) {
|
|
557
|
+
return undefined;
|
|
558
|
+
}
|
|
559
|
+
const formulaValue = isConditionalFormatFormulaRule(rule)
|
|
560
|
+
? buildConditionalFormatExpression(rule, cellToAddress({
|
|
561
|
+
rowIndex: rule?.ranges?.[0]?.startRowIndex ?? 1,
|
|
562
|
+
columnIndex: rule?.ranges?.[0]?.startColumnIndex ?? 1,
|
|
563
|
+
}, false, false) ?? "A1", this.locale)
|
|
564
|
+
: undefined;
|
|
565
|
+
if (!formulaValue || !rule.ranges.length) {
|
|
566
|
+
return formulaValue;
|
|
567
|
+
}
|
|
568
|
+
const masterCell = {
|
|
569
|
+
rowIndex: rule.ranges[0].startRowIndex,
|
|
570
|
+
columnIndex: rule.ranges[0].startColumnIndex,
|
|
571
|
+
};
|
|
572
|
+
const activeSheetName = this.getSheetName(sheetId) ?? "";
|
|
573
|
+
for (const range of rule.ranges) {
|
|
574
|
+
if (sheetId === range.sheetId &&
|
|
575
|
+
isCellWithinBounds({ rowIndex, columnIndex }, range)) {
|
|
576
|
+
return (formulaToRelativeReference(formulaValue, masterCell, { rowIndex, columnIndex }, activeSheetName, {
|
|
577
|
+
ignoreCircular: true,
|
|
578
|
+
preserveAbsolutes: true,
|
|
579
|
+
ignoreReferenceError: true,
|
|
580
|
+
}) ?? "");
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
getDataValidationFormula = (sheetId, rowIndex, columnIndex) => {
|
|
585
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
586
|
+
let dataValidation = cellData?.dataValidation;
|
|
587
|
+
if (typeof dataValidation === "string" ||
|
|
588
|
+
typeof dataValidation === "number") {
|
|
589
|
+
dataValidation = this.getDataValidationById(dataValidation);
|
|
590
|
+
}
|
|
591
|
+
const record = dataValidation;
|
|
592
|
+
const formulaValue = isDataValidationFormulaRule(record)
|
|
593
|
+
? buildDataValidationExpression(record, cellToAddress({
|
|
594
|
+
rowIndex: record?.ranges?.[0]?.startRowIndex ?? 1,
|
|
595
|
+
columnIndex: record?.ranges?.[0]?.startColumnIndex ?? 1,
|
|
596
|
+
}, false, false) ?? "A1", this.locale)
|
|
597
|
+
: undefined;
|
|
598
|
+
if (formulaValue && record?.ranges?.length) {
|
|
599
|
+
const masterCell = {
|
|
600
|
+
rowIndex: record.ranges[0].startRowIndex,
|
|
601
|
+
columnIndex: record.ranges[0].startColumnIndex,
|
|
602
|
+
};
|
|
603
|
+
const activeSheetName = this.getSheetName(sheetId) ?? "";
|
|
604
|
+
return (formulaToRelativeReference(formulaValue, masterCell, { rowIndex, columnIndex }, activeSheetName, {
|
|
605
|
+
ignoreCircular: true,
|
|
606
|
+
preserveAbsolutes: true,
|
|
607
|
+
ignoreReferenceError: true,
|
|
608
|
+
}) ?? "");
|
|
609
|
+
}
|
|
610
|
+
return formulaValue;
|
|
611
|
+
};
|
|
612
|
+
getFinalUserEnteredValue = (position) => {
|
|
613
|
+
const { conditionalFormatId, dataValidationId } = position;
|
|
614
|
+
if (!isNil(conditionalFormatId)) {
|
|
615
|
+
return this.getConditionalFormatFormula(position.sheetId, position.rowIndex, position.columnIndex, conditionalFormatId);
|
|
616
|
+
}
|
|
617
|
+
if (!isNil(dataValidationId)) {
|
|
618
|
+
return this.getDataValidationFormula(position.sheetId, position.rowIndex, position.columnIndex);
|
|
619
|
+
}
|
|
620
|
+
return this.getFormulaValue(position.sheetId, position.rowIndex, position.columnIndex);
|
|
621
|
+
};
|
|
622
|
+
getPrecedents = (source, includeSource) => {
|
|
623
|
+
return this._calculationInterface.getPrecedents(source).filter((node) => {
|
|
624
|
+
if (isStaticNode(node)) {
|
|
625
|
+
return true;
|
|
626
|
+
}
|
|
627
|
+
if (!includeSource &&
|
|
628
|
+
isCellCoordinate(node.position) &&
|
|
629
|
+
isCellCoordinate(source)) {
|
|
630
|
+
return (node.position.rowIndex !== source.rowIndex ||
|
|
631
|
+
node.position.columnIndex !== source.columnIndex);
|
|
632
|
+
}
|
|
633
|
+
if (includeSource &&
|
|
634
|
+
!isCellCoordinate(node.position) &&
|
|
635
|
+
!isCellCoordinate(source)) {
|
|
636
|
+
return !isAreasEqual(node.position, source);
|
|
637
|
+
}
|
|
638
|
+
return true;
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
collectFormulaOperations = () => {
|
|
642
|
+
const operations = [];
|
|
643
|
+
const sheetCell = new SheetCell();
|
|
644
|
+
for (const sheetIdKey in this.sheetData) {
|
|
645
|
+
const sheetId = Number(sheetIdKey);
|
|
646
|
+
for (const [rowIndex, value] of this.sheetData[sheetId]?.entries() ??
|
|
647
|
+
[]) {
|
|
648
|
+
for (const [columnIndex, cellData] of value?.values?.entries() ?? []) {
|
|
649
|
+
if (!cellData) {
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
sheetCell.assign(sheetId, { rowIndex, columnIndex }, cellData);
|
|
653
|
+
if (sheetCell.formula) {
|
|
654
|
+
operations.push({
|
|
655
|
+
type: "add",
|
|
656
|
+
position: { sheetId, rowIndex, columnIndex },
|
|
657
|
+
value: sheetCell.formula,
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return operations;
|
|
664
|
+
};
|
|
665
|
+
getEffectiveValuesFromRange = (address) => {
|
|
666
|
+
const [sheetToken, rangeToken] = address.split("!");
|
|
667
|
+
const hasExplicitSheet = Boolean(rangeToken);
|
|
668
|
+
const sheetName = hasExplicitSheet ? sheetToken : undefined;
|
|
669
|
+
const sheetId = sheetName ? this.getSheetId(sheetName) : this.activeSheetId;
|
|
670
|
+
const rangeAddress = hasExplicitSheet ? rangeToken : sheetToken;
|
|
671
|
+
if (!sheetId || !rangeAddress) {
|
|
672
|
+
return [];
|
|
673
|
+
}
|
|
674
|
+
const sheet = this.getSheet(sheetId);
|
|
675
|
+
const [startRef, endRef] = rangeAddress.split(":");
|
|
676
|
+
const startCell = addressToCell(startRef, {
|
|
677
|
+
position: "start",
|
|
678
|
+
rowCount: sheet.rowCount,
|
|
679
|
+
columnCount: sheet.columnCount,
|
|
680
|
+
});
|
|
681
|
+
const endCell = addressToCell(endRef ?? startRef, {
|
|
682
|
+
position: "end",
|
|
683
|
+
rowCount: sheet.rowCount,
|
|
684
|
+
columnCount: sheet.columnCount,
|
|
685
|
+
});
|
|
686
|
+
if (!startCell || !endCell) {
|
|
687
|
+
return [];
|
|
688
|
+
}
|
|
689
|
+
const values = [];
|
|
690
|
+
for (let row = startCell.rowIndex; row <= endCell.rowIndex; row += 1) {
|
|
691
|
+
for (let col = startCell.columnIndex; col <= endCell.columnIndex; col += 1) {
|
|
692
|
+
const value = this.getEffectiveValue(sheetId, row, col);
|
|
693
|
+
values.push({
|
|
694
|
+
userEnteredValue: value == null ? "" : String(value),
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return values;
|
|
699
|
+
};
|
|
700
|
+
applyCalculationResults = (results) => {
|
|
701
|
+
const sheetCell = new SheetCell();
|
|
702
|
+
const saveHistory = this.createHistory();
|
|
703
|
+
const cellXfsRegisry = this.cellXfsRegistry;
|
|
704
|
+
this.onChangeSheetData?.((prevSheetData) => {
|
|
705
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevSheetData, (draft) => {
|
|
706
|
+
for (const [position, result, formatting] of results) {
|
|
707
|
+
const { rowIndex, columnIndex, sheetId, conditionalFormatId, dataValidationId, } = position;
|
|
708
|
+
const currentSheet = createSheetDraft(draft, sheetId, rowIndex);
|
|
709
|
+
const cellData = currentSheet[rowIndex].values?.[columnIndex];
|
|
710
|
+
sheetCell.assign(sheetId, { rowIndex, columnIndex }, cellData, {
|
|
711
|
+
getRangeValues: this.getEffectiveValuesFromRange,
|
|
712
|
+
locale: this.locale,
|
|
713
|
+
cellXfsRegistry: cellXfsRegisry,
|
|
714
|
+
getDataValidationById: this.getDataValidationById,
|
|
715
|
+
});
|
|
716
|
+
sheetCell.hideLoading();
|
|
717
|
+
if (!isNil(conditionalFormatId)) {
|
|
718
|
+
sheetCell.setConditionalFormatResult(conditionalFormatId, result);
|
|
719
|
+
}
|
|
720
|
+
else if (!isNil(dataValidationId)) {
|
|
721
|
+
sheetCell.setDataValidationResult(result);
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
const preserveStringLiteral = typeof result === "string";
|
|
725
|
+
sheetCell.setEffectiveValue(result, false, preserveStringLiteral);
|
|
726
|
+
// Calculator-supplied formatting (e.g. spilled FILTER results)
|
|
727
|
+
// is persisted as user-entered so the renderer respects it
|
|
728
|
+
// without walking precedents. Effective number format from
|
|
729
|
+
// precedents is derived at render time and not written here.
|
|
730
|
+
if (formatting) {
|
|
731
|
+
for (const type in formatting) {
|
|
732
|
+
sheetCell.setUserEnteredFormat(type, formatting[type]);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
const derivedCell = deriveCellFromPrecedents(sheetCell.formula, this.getPrecedents(position), draft, sheetId, this.locale, this.cellXfsRegistry);
|
|
736
|
+
if (derivedCell) {
|
|
737
|
+
sheetCell.processDerivedCell(derivedCell);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
currentSheet[rowIndex].values[columnIndex] =
|
|
741
|
+
sheetCell.getCellData();
|
|
742
|
+
cellXfsRegisry?.registerCellXfs(sheetCell);
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
saveHistory({
|
|
746
|
+
sheetData: { patches, inversePatches },
|
|
747
|
+
disableRecalc: true,
|
|
748
|
+
});
|
|
749
|
+
return nextState;
|
|
750
|
+
});
|
|
751
|
+
cellXfsRegisry?.getPatches(saveHistory);
|
|
752
|
+
};
|
|
753
|
+
async flushCalculations() {
|
|
754
|
+
await this._calculationInterface.flush();
|
|
755
|
+
}
|
|
756
|
+
async calculateAll() {
|
|
757
|
+
const operations = this.collectFormulaOperations();
|
|
758
|
+
if (!operations.length) {
|
|
759
|
+
return [];
|
|
760
|
+
}
|
|
761
|
+
return this._calculationInterface.calculate(operations);
|
|
762
|
+
}
|
|
763
|
+
async calculatePending() {
|
|
764
|
+
return this._calculationInterface.flushWithResults();
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Get text format for a cell (for auto-sizing)
|
|
768
|
+
*/
|
|
769
|
+
/**
|
|
770
|
+
* Rich-text runs for a cell, read off the SharedStrings entry the cell
|
|
771
|
+
* points at via `ss` (same source as the hooks' `getTextFormatRuns`).
|
|
772
|
+
*/
|
|
773
|
+
getCellTextFormatRuns(sheetId, rowIndex, columnIndex) {
|
|
774
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
775
|
+
if (cellData?.ss == null)
|
|
776
|
+
return undefined;
|
|
777
|
+
return getSharedStringRuns(this.sharedStrings.get(String(cellData.ss)));
|
|
778
|
+
}
|
|
779
|
+
getCellTextFormat(sheetId, rowIndex, columnIndex) {
|
|
780
|
+
const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
|
|
781
|
+
// `ef` is no longer persisted on cellData. Read `uf` first, fall back to
|
|
782
|
+
// legacy `ef` for older saved data.
|
|
783
|
+
let effectiveFormat = getCellUserEnteredFormat(cellData) ?? getCellEffectiveFormat(cellData);
|
|
784
|
+
// Registry
|
|
785
|
+
if (isStyleReference(effectiveFormat)) {
|
|
786
|
+
effectiveFormat = this.cellXfsRegistry.getCellXfsFromStyleId(effectiveFormat.sid ?? effectiveFormat.styleId);
|
|
787
|
+
}
|
|
788
|
+
return {
|
|
789
|
+
bold: effectiveFormat?.textFormat?.bold,
|
|
790
|
+
fontSize: effectiveFormat?.textFormat?.fontSize,
|
|
791
|
+
fontFamily: effectiveFormat?.textFormat?.fontFamily,
|
|
792
|
+
italic: effectiveFormat?.textFormat?.italic,
|
|
793
|
+
shouldWrap: effectiveFormat?.wrapStrategy === "wrap",
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
shouldWrapCell(sheetId, rowIndex, columnIndex) {
|
|
797
|
+
const cellFormat = this.getCellTextFormat(sheetId, rowIndex, columnIndex);
|
|
798
|
+
return cellFormat?.shouldWrap;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Get column width from sheet metadata (stored width)
|
|
802
|
+
*/
|
|
803
|
+
getStoredColumnWidth(sheetId, columnIndex) {
|
|
804
|
+
const sheet = this.sheets.find((s) => s.sheetId === sheetId);
|
|
805
|
+
return sheet?.columnMetadata?.[columnIndex]?.size ?? DEFAULT_COLUMN_WIDTH;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Check if a column is hidden
|
|
809
|
+
*/
|
|
810
|
+
isHiddenColumn(sheetId, columnIndex) {
|
|
811
|
+
const sheet = this.sheets.find((s) => s.sheetId === sheetId);
|
|
812
|
+
const metadata = sheet?.columnMetadata?.[columnIndex];
|
|
813
|
+
return metadata?.hiddenByUser ?? metadata?.hiddenByFilter ?? false;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Check if a row is hidden
|
|
817
|
+
*/
|
|
818
|
+
isHiddenRow(sheetId, rowIndex) {
|
|
819
|
+
const sheet = this.sheets.find((s) => s.sheetId === sheetId);
|
|
820
|
+
const metadata = sheet?.rowMetadata?.[rowIndex];
|
|
821
|
+
return metadata?.hiddenByUser ?? metadata?.hiddenByFilter ?? false;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Get dimension of a single cell
|
|
825
|
+
* Similar to use-sizer.ts getCellDimensions
|
|
826
|
+
*/
|
|
827
|
+
getCellDimensions = (sheetId, rowIndex, columnIndex, axis = "y", options) => {
|
|
828
|
+
const { textOverride, textFormatOverride, shouldWrapOverride } = options ?? {};
|
|
829
|
+
const text = textOverride ?? this.getFormattedValue(sheetId, rowIndex, columnIndex);
|
|
830
|
+
if (!text)
|
|
831
|
+
return { width: 0, height: 0 };
|
|
832
|
+
const textFormat = textFormatOverride ??
|
|
833
|
+
this.getCellTextFormat(sheetId, rowIndex, columnIndex);
|
|
834
|
+
// Rich-text runs carry their own font sizes; the tallest run sets the
|
|
835
|
+
// line box (Excel scales a row to the largest glyph in a mixed line).
|
|
836
|
+
// Headless heuristic, mirroring the Rust engine's refit: the whole cell
|
|
837
|
+
// measures under the tallest font rather than per-segment metrics.
|
|
838
|
+
const runs = textFormatOverride == null
|
|
839
|
+
? this.getCellTextFormatRuns(sheetId, rowIndex, columnIndex)
|
|
840
|
+
: undefined;
|
|
841
|
+
const maxRunFontSize = runs?.reduce((acc, run) => "format" in run ? Math.max(acc, run.format?.fontSize ?? 0) : acc, 0);
|
|
842
|
+
const fitFontSize = Math.max(textFormat.fontSize ?? 10, maxRunFontSize ?? 0);
|
|
843
|
+
// Reset and set font
|
|
844
|
+
this._autoSizer.reset();
|
|
845
|
+
const textFontSize = pointToPixel(fitFontSize);
|
|
846
|
+
this._autoSizer.setFont({
|
|
847
|
+
fontFamily: textFormat?.fontFamily ?? "Arial",
|
|
848
|
+
fontSize: textFontSize,
|
|
849
|
+
fontWeight: textFormat?.bold ? "bold" : "",
|
|
850
|
+
fontStyle: textFormat?.italic ? "italic" : "",
|
|
851
|
+
scale: this.scale,
|
|
852
|
+
});
|
|
853
|
+
const shouldWrap = shouldWrapOverride ?? this.shouldWrapCell(sheetId, rowIndex, columnIndex);
|
|
854
|
+
const columnWidth = this.getStoredColumnWidth(sheetId, columnIndex);
|
|
855
|
+
const metrics = this._autoSizer.measureText(text, shouldWrap, columnWidth - this.cellHorizontalSpacing);
|
|
856
|
+
if (!metrics)
|
|
857
|
+
return { width: 0, height: 0 };
|
|
858
|
+
return {
|
|
859
|
+
width: Math.ceil(metrics.width) + this.cellHorizontalSpacing,
|
|
860
|
+
height: Math.ceil(metrics.height) + this.cellVerticalSpacing,
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
/**
|
|
864
|
+
* Check if a cell is merged
|
|
865
|
+
* @param sheetId
|
|
866
|
+
* @param rowIndex
|
|
867
|
+
* @param columnIndex
|
|
868
|
+
* @returns
|
|
869
|
+
*/
|
|
870
|
+
isMergedCell = (sheetId, rowIndex, columnIndex) => {
|
|
871
|
+
const sheet = this.sheets.find((sheet) => sheet.sheetId === sheetId);
|
|
872
|
+
if (sheet) {
|
|
873
|
+
return sheet.merges?.some((range) => {
|
|
874
|
+
return isCellWithinBounds({ rowIndex, columnIndex }, range);
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
return false;
|
|
878
|
+
};
|
|
879
|
+
/**
|
|
880
|
+
* Calculate row height based on cell content
|
|
881
|
+
* Same logic as use-sizer.ts getRowHeight
|
|
882
|
+
*/
|
|
883
|
+
getRowHeight = (sheetId, rowIndex, shouldExclude) => {
|
|
884
|
+
const sheet = this.getSheet(sheetId);
|
|
885
|
+
const columnCount = sheet.columnCount;
|
|
886
|
+
const visibleColumns = this.resizeStrategy === "full" ? columnCount : 20;
|
|
887
|
+
let maxHeight = 0;
|
|
888
|
+
// Calculate for frozen columns
|
|
889
|
+
for (let i = 1; i <= sheet.frozenColumns; i++) {
|
|
890
|
+
if (this.isHiddenColumn(sheetId, i)) {
|
|
891
|
+
continue;
|
|
892
|
+
}
|
|
893
|
+
const { height } = this.getCellDimensions(sheetId, rowIndex, i, "x");
|
|
894
|
+
if (height > maxHeight)
|
|
895
|
+
maxHeight = height;
|
|
896
|
+
}
|
|
897
|
+
// Loop through visible columns
|
|
898
|
+
let start = this.resizeStrategy === "full" ? Math.max(sheet.frozenColumns, 1) : 0;
|
|
899
|
+
while (start < visibleColumns) {
|
|
900
|
+
if (this.isHiddenColumn(sheetId, start) || shouldExclude?.(start)) {
|
|
901
|
+
start++;
|
|
902
|
+
continue;
|
|
903
|
+
}
|
|
904
|
+
const { height } = this.getCellDimensions(sheetId, rowIndex, start, "x");
|
|
905
|
+
if (height > maxHeight)
|
|
906
|
+
maxHeight = height;
|
|
907
|
+
start++;
|
|
908
|
+
}
|
|
909
|
+
return Math.max(this.minRowDimension * this.scale, maxHeight) / this.scale;
|
|
910
|
+
};
|
|
911
|
+
/**
|
|
912
|
+
* Calculate column width based on cell content
|
|
913
|
+
* Same logic as use-sizer.ts getColumnWidth
|
|
914
|
+
*/
|
|
915
|
+
getColumnWidth = (sheetId, columnIndex, options) => {
|
|
916
|
+
const sheet = this.getSheet(sheetId);
|
|
917
|
+
const rowCount = sheet.rowCount;
|
|
918
|
+
const { rowStartIndexRegion, rowStopIndexRegion, fallbackToDefaultIfEmpty, } = options ?? {};
|
|
919
|
+
const visibleRows = rowStopIndexRegion ?? this.resizeStrategy === "full" ? rowCount : 20;
|
|
920
|
+
let maxWidth = 0;
|
|
921
|
+
// Calculate for frozen rows: Frozen rows are always on the screen
|
|
922
|
+
for (let i = 1; i < sheet.frozenRows; i++) {
|
|
923
|
+
if (this.isHiddenRow(sheetId, i)) {
|
|
924
|
+
continue;
|
|
925
|
+
}
|
|
926
|
+
const { width } = this.getCellDimensions(sheetId, i, columnIndex);
|
|
927
|
+
if (width > maxWidth)
|
|
928
|
+
maxWidth = width;
|
|
929
|
+
}
|
|
930
|
+
// Loop through all visible rows
|
|
931
|
+
let start = rowStartIndexRegion ?? this.resizeStrategy === "full"
|
|
932
|
+
? sheet.frozenRows
|
|
933
|
+
: 0;
|
|
934
|
+
while (start < visibleRows) {
|
|
935
|
+
if (this.isHiddenRow(sheetId, start)) {
|
|
936
|
+
start++;
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
const { width } = this.getCellDimensions(sheetId, start, columnIndex, "y");
|
|
940
|
+
if (width > maxWidth)
|
|
941
|
+
maxWidth = width;
|
|
942
|
+
start++;
|
|
943
|
+
}
|
|
944
|
+
// This column is empty
|
|
945
|
+
if (maxWidth === 0) {
|
|
946
|
+
if (fallbackToDefaultIfEmpty) {
|
|
947
|
+
return DEFAULT_COLUMN_WIDTH;
|
|
948
|
+
}
|
|
949
|
+
return this.getStoredColumnWidth(sheetId, columnIndex);
|
|
950
|
+
}
|
|
951
|
+
return (Math.max(this.minColumnDimension * this.scale, maxWidth) / this.scale);
|
|
952
|
+
};
|
|
953
|
+
/**
|
|
954
|
+
* Generate RFC patches that can be used to
|
|
955
|
+
* update yJS doc
|
|
956
|
+
* @returns
|
|
957
|
+
*/
|
|
958
|
+
async generateStatePatches() {
|
|
959
|
+
const spreadsheetPatches = [];
|
|
960
|
+
const promises = [];
|
|
961
|
+
// Sheet data
|
|
962
|
+
promises.push(new Promise((resolve) => {
|
|
963
|
+
this.onChangeSheetData?.((prev) => {
|
|
964
|
+
const [_, patches, inversePatches] = produceWithPatches({}, () => {
|
|
965
|
+
return prev;
|
|
966
|
+
});
|
|
967
|
+
spreadsheetPatches.push([
|
|
968
|
+
{
|
|
969
|
+
sheetData: { patches, inversePatches },
|
|
970
|
+
},
|
|
971
|
+
]);
|
|
972
|
+
resolve();
|
|
973
|
+
return prev;
|
|
974
|
+
});
|
|
975
|
+
}));
|
|
976
|
+
// onChangeSheets
|
|
977
|
+
promises.push(new Promise((resolve) => {
|
|
978
|
+
this.onChangeSheets?.((prev) => {
|
|
979
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
980
|
+
return prev;
|
|
981
|
+
});
|
|
982
|
+
spreadsheetPatches.push([
|
|
983
|
+
{
|
|
984
|
+
sheets: { patches, inversePatches },
|
|
985
|
+
},
|
|
986
|
+
]);
|
|
987
|
+
resolve();
|
|
988
|
+
return prev;
|
|
989
|
+
});
|
|
990
|
+
}));
|
|
991
|
+
// onChangeTables
|
|
992
|
+
promises.push(new Promise((resolve) => {
|
|
993
|
+
this.onChangeTables?.((prev) => {
|
|
994
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
995
|
+
return prev;
|
|
996
|
+
});
|
|
997
|
+
spreadsheetPatches.push([
|
|
998
|
+
{
|
|
999
|
+
tables: { patches, inversePatches },
|
|
1000
|
+
},
|
|
1001
|
+
]);
|
|
1002
|
+
resolve();
|
|
1003
|
+
return prev;
|
|
1004
|
+
});
|
|
1005
|
+
}));
|
|
1006
|
+
// onChangeCharts
|
|
1007
|
+
promises.push(new Promise((resolve) => {
|
|
1008
|
+
this.onChangeCharts?.((prev) => {
|
|
1009
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1010
|
+
return prev;
|
|
1011
|
+
});
|
|
1012
|
+
spreadsheetPatches.push([
|
|
1013
|
+
{
|
|
1014
|
+
charts: { patches, inversePatches },
|
|
1015
|
+
},
|
|
1016
|
+
]);
|
|
1017
|
+
resolve();
|
|
1018
|
+
return prev;
|
|
1019
|
+
});
|
|
1020
|
+
}));
|
|
1021
|
+
// onChangeEmbeds
|
|
1022
|
+
promises.push(new Promise((resolve) => {
|
|
1023
|
+
this.onChangeEmbeds?.((prev) => {
|
|
1024
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1025
|
+
return prev;
|
|
1026
|
+
});
|
|
1027
|
+
spreadsheetPatches.push([
|
|
1028
|
+
{
|
|
1029
|
+
embeds: { patches, inversePatches },
|
|
1030
|
+
},
|
|
1031
|
+
]);
|
|
1032
|
+
resolve();
|
|
1033
|
+
return prev;
|
|
1034
|
+
});
|
|
1035
|
+
}));
|
|
1036
|
+
// onChangeNamedRanges
|
|
1037
|
+
promises.push(new Promise((resolve) => {
|
|
1038
|
+
this.onChangeNamedRanges?.((prev) => {
|
|
1039
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1040
|
+
return prev;
|
|
1041
|
+
});
|
|
1042
|
+
spreadsheetPatches.push([
|
|
1043
|
+
{
|
|
1044
|
+
namedRanges: { patches, inversePatches },
|
|
1045
|
+
},
|
|
1046
|
+
]);
|
|
1047
|
+
resolve();
|
|
1048
|
+
return prev;
|
|
1049
|
+
});
|
|
1050
|
+
}));
|
|
1051
|
+
// onChangeSharedStrings
|
|
1052
|
+
promises.push(new Promise((resolve) => {
|
|
1053
|
+
this.onChangeSharedStrings?.((prev) => {
|
|
1054
|
+
// Always use Map for shared strings
|
|
1055
|
+
const base = new Map();
|
|
1056
|
+
const [_, patches, inversePatches] = produceWithPatches(base, () => {
|
|
1057
|
+
return prev;
|
|
1058
|
+
});
|
|
1059
|
+
spreadsheetPatches.push([
|
|
1060
|
+
{
|
|
1061
|
+
sharedStrings: { patches, inversePatches },
|
|
1062
|
+
},
|
|
1063
|
+
]);
|
|
1064
|
+
resolve();
|
|
1065
|
+
return prev;
|
|
1066
|
+
});
|
|
1067
|
+
}));
|
|
1068
|
+
// onChangeDataValidations
|
|
1069
|
+
promises.push(new Promise((resolve) => {
|
|
1070
|
+
this.onChangeDataValidations?.((prev) => {
|
|
1071
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1072
|
+
return prev;
|
|
1073
|
+
});
|
|
1074
|
+
spreadsheetPatches.push([
|
|
1075
|
+
{
|
|
1076
|
+
dataValidations: { patches, inversePatches },
|
|
1077
|
+
},
|
|
1078
|
+
]);
|
|
1079
|
+
resolve();
|
|
1080
|
+
return prev;
|
|
1081
|
+
});
|
|
1082
|
+
}));
|
|
1083
|
+
// onChangeConditionalFormats
|
|
1084
|
+
promises.push(new Promise((resolve) => {
|
|
1085
|
+
this.onChangeConditionalFormats?.((prev) => {
|
|
1086
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1087
|
+
return prev;
|
|
1088
|
+
});
|
|
1089
|
+
spreadsheetPatches.push([
|
|
1090
|
+
{
|
|
1091
|
+
conditionalFormats: { patches, inversePatches },
|
|
1092
|
+
},
|
|
1093
|
+
]);
|
|
1094
|
+
resolve();
|
|
1095
|
+
return prev;
|
|
1096
|
+
});
|
|
1097
|
+
}));
|
|
1098
|
+
// onChangeCellXfs
|
|
1099
|
+
promises.push(new Promise((resolve) => {
|
|
1100
|
+
this.onChangeCellXfs?.((prev) => {
|
|
1101
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1102
|
+
return prev;
|
|
1103
|
+
});
|
|
1104
|
+
spreadsheetPatches.push([
|
|
1105
|
+
{
|
|
1106
|
+
cellXfs: { patches, inversePatches },
|
|
1107
|
+
},
|
|
1108
|
+
]);
|
|
1109
|
+
resolve();
|
|
1110
|
+
return prev;
|
|
1111
|
+
});
|
|
1112
|
+
}));
|
|
1113
|
+
// onChangeCitations
|
|
1114
|
+
promises.push(new Promise((resolve) => {
|
|
1115
|
+
this.onChangeCitations?.((prev) => {
|
|
1116
|
+
const [_, patches, inversePatches] = produceWithPatches([], () => {
|
|
1117
|
+
return prev;
|
|
1118
|
+
});
|
|
1119
|
+
spreadsheetPatches.push([
|
|
1120
|
+
{
|
|
1121
|
+
citations: { patches, inversePatches },
|
|
1122
|
+
},
|
|
1123
|
+
]);
|
|
1124
|
+
resolve();
|
|
1125
|
+
return prev;
|
|
1126
|
+
});
|
|
1127
|
+
}));
|
|
1128
|
+
// Wait for all callbacks to complete
|
|
1129
|
+
await Promise.all(promises);
|
|
1130
|
+
return spreadsheetPatches;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Get selection from a named range variable
|
|
1134
|
+
* @param variableName
|
|
1135
|
+
* @returns
|
|
1136
|
+
*/
|
|
1137
|
+
getSelectionFromNamedRange = (variableName) => {
|
|
1138
|
+
const namedRange = this.namedRanges?.find((range) => range.name.localeCompare(variableName, undefined, {
|
|
1139
|
+
sensitivity: "accent",
|
|
1140
|
+
}) === 0);
|
|
1141
|
+
// Only return selection for names with ranges
|
|
1142
|
+
if (namedRange?.range) {
|
|
1143
|
+
const sheet = this.getSheet(namedRange.range.sheetId);
|
|
1144
|
+
return {
|
|
1145
|
+
range: namedRange.range,
|
|
1146
|
+
sheetName: sheet.name,
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
// Get static or formula value
|
|
1150
|
+
const result = namedRange?.value;
|
|
1151
|
+
if (!isNil(result)) {
|
|
1152
|
+
return result;
|
|
1153
|
+
}
|
|
1154
|
+
return undefined;
|
|
1155
|
+
};
|
|
1156
|
+
/**
|
|
1157
|
+
* Get selections from table reference
|
|
1158
|
+
* @param sheetId
|
|
1159
|
+
* @param cell
|
|
1160
|
+
* @param tableName
|
|
1161
|
+
* @param columnNames
|
|
1162
|
+
* @param thisRow
|
|
1163
|
+
* @param specialItem
|
|
1164
|
+
* @returns
|
|
1165
|
+
*/
|
|
1166
|
+
getSelectionFromTable = (sheetId, cell, tableName, columnNames, thisRow, specialItem) => {
|
|
1167
|
+
// If there is no tablename, we need to find table based
|
|
1168
|
+
// on cell
|
|
1169
|
+
const table = this.tables?.find((table) => {
|
|
1170
|
+
if (tableName) {
|
|
1171
|
+
return table.title === tableName;
|
|
1172
|
+
}
|
|
1173
|
+
return cell
|
|
1174
|
+
? isCellWithinBounds(cell, table.range) && table.sheetId === sheetId
|
|
1175
|
+
: true;
|
|
1176
|
+
});
|
|
1177
|
+
// Current row
|
|
1178
|
+
const { rowIndex } = cell ?? DEFAULT_ACTIVE_CELL;
|
|
1179
|
+
if (table) {
|
|
1180
|
+
const { range } = table;
|
|
1181
|
+
const headerRow = table.headerRow ?? true;
|
|
1182
|
+
const totalRow = table.totalRow ?? false;
|
|
1183
|
+
const headerRowOffset = headerRow ? 1 : 0;
|
|
1184
|
+
const totalRowOffset = totalRow ? 1 : 0;
|
|
1185
|
+
const sheet = this.getSheet(table.sheetId);
|
|
1186
|
+
const sheetName = sheet.name;
|
|
1187
|
+
const [from, to] = columnNames ?? [];
|
|
1188
|
+
const startColIndex = getColumnIndexFromColumnName(table, from);
|
|
1189
|
+
const endColIndex = getColumnIndexFromColumnName(table, to);
|
|
1190
|
+
const startColumnIndex = isNil(startColIndex)
|
|
1191
|
+
? range.startColumnIndex
|
|
1192
|
+
: startColIndex;
|
|
1193
|
+
const endColumnIndex = isNil(endColIndex) && isNil(startColIndex)
|
|
1194
|
+
? range.endColumnIndex
|
|
1195
|
+
: isNil(endColIndex)
|
|
1196
|
+
? startColumnIndex
|
|
1197
|
+
: endColIndex;
|
|
1198
|
+
// Headers only
|
|
1199
|
+
if (specialItem === "#Headers") {
|
|
1200
|
+
return {
|
|
1201
|
+
range: {
|
|
1202
|
+
...range,
|
|
1203
|
+
startColumnIndex,
|
|
1204
|
+
endColumnIndex,
|
|
1205
|
+
startRowIndex: range.startRowIndex,
|
|
1206
|
+
endRowIndex: range.startRowIndex,
|
|
1207
|
+
},
|
|
1208
|
+
sheetName,
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
// All
|
|
1212
|
+
if (specialItem === "#All") {
|
|
1213
|
+
return {
|
|
1214
|
+
range: {
|
|
1215
|
+
...range,
|
|
1216
|
+
startColumnIndex,
|
|
1217
|
+
endColumnIndex,
|
|
1218
|
+
},
|
|
1219
|
+
sheetName,
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
// All
|
|
1223
|
+
if (specialItem === "#Data") {
|
|
1224
|
+
return {
|
|
1225
|
+
range: {
|
|
1226
|
+
...range,
|
|
1227
|
+
startColumnIndex,
|
|
1228
|
+
endColumnIndex,
|
|
1229
|
+
startRowIndex: range.startRowIndex + headerRowOffset,
|
|
1230
|
+
endRowIndex: range.endRowIndex - totalRowOffset,
|
|
1231
|
+
},
|
|
1232
|
+
sheetName,
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
if (!from && !to) {
|
|
1236
|
+
return {
|
|
1237
|
+
range: {
|
|
1238
|
+
startRowIndex: thisRow
|
|
1239
|
+
? rowIndex
|
|
1240
|
+
: range.startRowIndex + headerRowOffset,
|
|
1241
|
+
endRowIndex: thisRow
|
|
1242
|
+
? rowIndex
|
|
1243
|
+
: range.endRowIndex - totalRowOffset,
|
|
1244
|
+
startColumnIndex,
|
|
1245
|
+
endColumnIndex,
|
|
1246
|
+
},
|
|
1247
|
+
sheetName,
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
// If column is not found, lets not select anything
|
|
1251
|
+
if (startColIndex === -1 || isNil(startColIndex)) {
|
|
1252
|
+
return undefined;
|
|
1253
|
+
}
|
|
1254
|
+
// Check if thisrow is active and current cell is in bounds
|
|
1255
|
+
if (thisRow &&
|
|
1256
|
+
(rowIndex < range.startRowIndex || rowIndex > range.endRowIndex)) {
|
|
1257
|
+
return undefined;
|
|
1258
|
+
}
|
|
1259
|
+
return {
|
|
1260
|
+
range: {
|
|
1261
|
+
...range,
|
|
1262
|
+
startRowIndex: thisRow
|
|
1263
|
+
? rowIndex
|
|
1264
|
+
: range.startRowIndex + headerRowOffset,
|
|
1265
|
+
endRowIndex: thisRow ? rowIndex : range.endRowIndex - totalRowOffset,
|
|
1266
|
+
startColumnIndex,
|
|
1267
|
+
endColumnIndex,
|
|
1268
|
+
},
|
|
1269
|
+
sheetName: sheet.name,
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
/**
|
|
1274
|
+
* Tokenize a string in the back-end
|
|
1275
|
+
* @param value
|
|
1276
|
+
* @param sheetId
|
|
1277
|
+
* @param activeCell
|
|
1278
|
+
* @returns
|
|
1279
|
+
*/
|
|
1280
|
+
tokenize = (value, sheetId, activeCell) => {
|
|
1281
|
+
const tokens = defaultTokenizer?.(value) ?? [];
|
|
1282
|
+
let index = -1;
|
|
1283
|
+
for (const token of tokens) {
|
|
1284
|
+
if (token.selection) {
|
|
1285
|
+
token["index"] = ++index;
|
|
1286
|
+
}
|
|
1287
|
+
if (token.isNamedRange) {
|
|
1288
|
+
if (this.getSelectionFromNamedRange?.(token.image)) {
|
|
1289
|
+
token["index"] = ++index;
|
|
1290
|
+
}
|
|
1291
|
+
else {
|
|
1292
|
+
delete token["index"];
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
if (token.structured) {
|
|
1296
|
+
if (this.getSelectionFromTable?.(sheetId, activeCell, token.tableName, token.columnNames, token.thisRow, token.specialItem)) {
|
|
1297
|
+
token["index"] = ++index;
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
delete token["index"];
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
return tokens;
|
|
1305
|
+
};
|
|
1306
|
+
/**
|
|
1307
|
+
* Get selections from a formula
|
|
1308
|
+
* @param value
|
|
1309
|
+
* @param sheetId
|
|
1310
|
+
* @param activeCell
|
|
1311
|
+
* @returns
|
|
1312
|
+
*/
|
|
1313
|
+
getSelectionFromFormula = (value, sheetId, activeCell) => {
|
|
1314
|
+
const sheet = this.getSheet(sheetId);
|
|
1315
|
+
return generateSelectionsFromFormula(value, sheetId, sheet.name, activeCell, sheet.rowCount, sheet.columnCount, (formulaValue) => this.tokenize(formulaValue, sheetId, activeCell), (id, cell, tableName, columnNames, thisRow, specialItem) => this.getSelectionFromTable(id, cell, tableName, columnNames, thisRow, specialItem), this.getSelectionFromNamedRange);
|
|
1316
|
+
};
|
|
1317
|
+
/**
|
|
1318
|
+
* Get patches as tuples for applyPatchesToYDoc
|
|
1319
|
+
* @param type - The operation type ('redo' or 'undo')
|
|
1320
|
+
* @returns Array of tuples in the format expected by applyPatchesToYDoc
|
|
1321
|
+
*/
|
|
1322
|
+
getPatchTuples(type = "redo") {
|
|
1323
|
+
return this._patches.map((patch) => [patch, type]);
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Insert note in a cell
|
|
1327
|
+
* @param args
|
|
1328
|
+
*/
|
|
1329
|
+
insertNote(...args) {
|
|
1330
|
+
insertNote({
|
|
1331
|
+
createHistory: this.createHistory,
|
|
1332
|
+
locale: this.locale,
|
|
1333
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1334
|
+
})(...args);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Inserts table row
|
|
1338
|
+
* @param tableView
|
|
1339
|
+
* @param relativeRowIndex
|
|
1340
|
+
* @param rowData
|
|
1341
|
+
*/
|
|
1342
|
+
insertTableRow(tableView, relativeRowIndex, rowData) {
|
|
1343
|
+
const sheet = this.getSheet(tableView.sheetId);
|
|
1344
|
+
insertTableRow({
|
|
1345
|
+
onChangeSheets: this.onChangeSheets,
|
|
1346
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1347
|
+
onChangeTables: this.onChangeTables,
|
|
1348
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1349
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1350
|
+
createHistory: this.createHistory,
|
|
1351
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1352
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1353
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1354
|
+
getActiveCell: this.getActiveCell,
|
|
1355
|
+
getDependents: this.getDependents,
|
|
1356
|
+
getSheetName: this.getSheetName,
|
|
1357
|
+
rowCount: sheet.rowCount,
|
|
1358
|
+
columnCount: sheet.columnCount,
|
|
1359
|
+
})(tableView, relativeRowIndex, rowData);
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Inserts a row
|
|
1363
|
+
* @param sheetId
|
|
1364
|
+
* @param referenceRowIndex
|
|
1365
|
+
* @param numRows
|
|
1366
|
+
*/
|
|
1367
|
+
insertRow(sheetId, referenceRowIndex, numRows = 1) {
|
|
1368
|
+
const sheet = this.getSheet(sheetId);
|
|
1369
|
+
insertRow({
|
|
1370
|
+
onChangeSheets: this.onChangeSheets,
|
|
1371
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1372
|
+
onChangeTables: this.onChangeTables,
|
|
1373
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1374
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1375
|
+
createHistory: this.createHistory,
|
|
1376
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1377
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1378
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1379
|
+
getActiveCell: this.getActiveCell,
|
|
1380
|
+
getSelections: this.getSelections,
|
|
1381
|
+
getDependents: this.getDependents,
|
|
1382
|
+
getGraphNodes: () => this._calculationInterface.getNodes(),
|
|
1383
|
+
getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
|
|
1384
|
+
getSheetName: this.getSheetName,
|
|
1385
|
+
rowCount: sheet.rowCount,
|
|
1386
|
+
columnCount: sheet.columnCount,
|
|
1387
|
+
})(sheetId, referenceRowIndex, numRows);
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Inserts a column
|
|
1391
|
+
* @param sheetId
|
|
1392
|
+
* @param referenceColumnIndex
|
|
1393
|
+
* @param numColumns
|
|
1394
|
+
*/
|
|
1395
|
+
insertColumn(sheetId, referenceColumnIndex, numColumns = 1) {
|
|
1396
|
+
const sheet = this.getSheet(sheetId);
|
|
1397
|
+
insertColumn({
|
|
1398
|
+
onChangeSheets: this.onChangeSheets,
|
|
1399
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1400
|
+
onChangeTables: this.onChangeTables,
|
|
1401
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1402
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1403
|
+
createHistory: this.createHistory,
|
|
1404
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1405
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1406
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1407
|
+
getDependents: this.getDependents,
|
|
1408
|
+
getGraphNodes: () => this._calculationInterface.getNodes(),
|
|
1409
|
+
getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
|
|
1410
|
+
getSelections: this.getSelections,
|
|
1411
|
+
getActiveCell: this.getActiveCell,
|
|
1412
|
+
getSheetName: this.getSheetName,
|
|
1413
|
+
rowCount: sheet.rowCount,
|
|
1414
|
+
columnCount: sheet.columnCount,
|
|
1415
|
+
tables: this.tables,
|
|
1416
|
+
})(sheetId, referenceColumnIndex, numColumns);
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Deletes columns
|
|
1420
|
+
* @param sheetId
|
|
1421
|
+
* @param columnIndexes
|
|
1422
|
+
*/
|
|
1423
|
+
deleteColumn(sheetId, columnIndexes) {
|
|
1424
|
+
const sheet = this.getSheet(sheetId);
|
|
1425
|
+
deleteColumn({
|
|
1426
|
+
onChangeSheets: this.onChangeSheets,
|
|
1427
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1428
|
+
onChangeTables: this.onChangeTables,
|
|
1429
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1430
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1431
|
+
createHistory: this.createHistory,
|
|
1432
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1433
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1434
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1435
|
+
getDependents: this.getDependents,
|
|
1436
|
+
getGraphNodes: () => this._calculationInterface.getNodes(),
|
|
1437
|
+
getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
|
|
1438
|
+
getActiveCell: this.getActiveCell,
|
|
1439
|
+
getSelections: this.getSelections,
|
|
1440
|
+
getSheetName: this.getSheetName,
|
|
1441
|
+
rowCount: sheet.rowCount,
|
|
1442
|
+
columnCount: sheet.columnCount,
|
|
1443
|
+
locale: this.locale,
|
|
1444
|
+
onChangeActiveCell: this.onChangeActiveSheet,
|
|
1445
|
+
onChangeSelections: this.onChangeSelections,
|
|
1446
|
+
onChangeCitations: this.onChangeCitations,
|
|
1447
|
+
})(sheetId, columnIndexes);
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Update a range of cells
|
|
1451
|
+
* @param sheetId
|
|
1452
|
+
* @param ranges
|
|
1453
|
+
* @param values
|
|
1454
|
+
*/
|
|
1455
|
+
changeBatch(sheetId, ranges, values, formatting, citations, changeBatchOptions) {
|
|
1456
|
+
const ssRegistry = this.sharedStringRegistry;
|
|
1457
|
+
const cellXfsRegistry = this.cellXfsRegistry;
|
|
1458
|
+
return changeBatch({
|
|
1459
|
+
createHistory: this.createHistory,
|
|
1460
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1461
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1462
|
+
onChangeSheets: this.onChangeSheets,
|
|
1463
|
+
tables: this.tables,
|
|
1464
|
+
onChangeTables: this.onChangeTables,
|
|
1465
|
+
locale: this.locale,
|
|
1466
|
+
getUserEnteredValue: this.getUserEnteredStringValue,
|
|
1467
|
+
cellXfsRegistry: cellXfsRegistry,
|
|
1468
|
+
getFormattedValue: this.getFormattedValue,
|
|
1469
|
+
getCellDimensions: this.getCellDimensions,
|
|
1470
|
+
getRowHeight: this.getRowHeight,
|
|
1471
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1472
|
+
getDependents: this.getDependents,
|
|
1473
|
+
getSheetName: this.getSheetName,
|
|
1474
|
+
isMergedCell: this.isMergedCell,
|
|
1475
|
+
getDataValidationById: this.getDataValidationById,
|
|
1476
|
+
sharedStringRegistry: ssRegistry,
|
|
1477
|
+
getEffectiveValuesFromRange: this.getEffectiveValuesFromRange,
|
|
1478
|
+
onChangeCitations: this.onChangeCitations,
|
|
1479
|
+
onChangeTableColumn: (...args) => changeTableColumn({
|
|
1480
|
+
locale: this.locale,
|
|
1481
|
+
sharedStringRegistry: ssRegistry,
|
|
1482
|
+
cellXfsRegistry: cellXfsRegistry,
|
|
1483
|
+
createHistory: this.createHistory,
|
|
1484
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1485
|
+
enqueueGraphOperation: this.enqueueCalculation,
|
|
1486
|
+
getDependents: this.getDependents,
|
|
1487
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1488
|
+
onChangeTables: this.onChangeTables,
|
|
1489
|
+
})(...args),
|
|
1490
|
+
onChangeCalculatedColumn: (...args) => changeCalculatedColumn({
|
|
1491
|
+
locale: this.locale,
|
|
1492
|
+
sharedStringRegistry: ssRegistry,
|
|
1493
|
+
cellXfsRegistry: cellXfsRegistry,
|
|
1494
|
+
createHistory: this.createHistory,
|
|
1495
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1496
|
+
onChangeTables: this.onChangeTables,
|
|
1497
|
+
getSheetName: this.getSheetName,
|
|
1498
|
+
getUserEnteredValue: this.getUserEnteredStringValue,
|
|
1499
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1500
|
+
})(...args),
|
|
1501
|
+
})(sheetId, ranges, values, formatting, citations, changeBatchOptions);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Stream cell updates into a range
|
|
1505
|
+
* @param sheetId
|
|
1506
|
+
* @param range
|
|
1507
|
+
* @param stream
|
|
1508
|
+
*/
|
|
1509
|
+
async changeBatchStream(sheetId, range, stream) {
|
|
1510
|
+
return changeBatchStream({
|
|
1511
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1512
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1513
|
+
locale: this.locale,
|
|
1514
|
+
getDataValidationById: this.getDataValidationById,
|
|
1515
|
+
getEffectiveValuesFromRange: this.getEffectiveValuesFromRange,
|
|
1516
|
+
})(sheetId, range, stream);
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Change cell formatting
|
|
1520
|
+
* @param args
|
|
1521
|
+
*/
|
|
1522
|
+
changeFormatting(...args) {
|
|
1523
|
+
changeFormatting({
|
|
1524
|
+
getFormattedValue: this.getFormattedValue,
|
|
1525
|
+
createHistory: this.createHistory,
|
|
1526
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1527
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1528
|
+
onChangeSheets: this.onChangeSheets,
|
|
1529
|
+
locale: this.locale,
|
|
1530
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1531
|
+
getCellDimensions: this.getCellDimensions,
|
|
1532
|
+
getRowHeight: this.getRowHeight,
|
|
1533
|
+
})(...args);
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Change cell border
|
|
1537
|
+
* @param sheetId
|
|
1538
|
+
* @param activeCell
|
|
1539
|
+
* @param selections
|
|
1540
|
+
* @param location
|
|
1541
|
+
* @param color
|
|
1542
|
+
* @param style
|
|
1543
|
+
*/
|
|
1544
|
+
changeBorder(sheetId, activeCell, selections, location, color, style = "solid") {
|
|
1545
|
+
changeBorder({
|
|
1546
|
+
getFormattedValue: this.getFormattedValue,
|
|
1547
|
+
createHistory: this.createHistory,
|
|
1548
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1549
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1550
|
+
onChangeSheets: this.onChangeSheets,
|
|
1551
|
+
locale: this.locale,
|
|
1552
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1553
|
+
})(sheetId, activeCell, selections, location, color, style);
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Create a new table spec
|
|
1557
|
+
* @param sheetId
|
|
1558
|
+
* @param activeCell
|
|
1559
|
+
* @param selections
|
|
1560
|
+
* @param tableSpec
|
|
1561
|
+
* @param theme
|
|
1562
|
+
* @param bandedRange
|
|
1563
|
+
*/
|
|
1564
|
+
createTable(sheetId, activeCell, selections, tableSpec, theme, bandedRange) {
|
|
1565
|
+
const sheet = this.getSheet(sheetId);
|
|
1566
|
+
return createTable({
|
|
1567
|
+
locale: this.locale,
|
|
1568
|
+
rowCount: sheet.rowCount,
|
|
1569
|
+
columnCount: sheet.columnCount,
|
|
1570
|
+
createHistory: this.createHistory,
|
|
1571
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1572
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1573
|
+
getDependents: this.getDependents,
|
|
1574
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1575
|
+
onChangeSheets: this.onChangeSheets,
|
|
1576
|
+
onChangeTables: this.onChangeTables,
|
|
1577
|
+
onRequestCalculate: this.onRequestCalculate,
|
|
1578
|
+
getEffectiveValue: this.getEffectiveValue,
|
|
1579
|
+
getFormattedValue: this.getFormattedValue,
|
|
1580
|
+
getContentfulRangeAroundCell: this.getContentfulRangeAroundCell,
|
|
1581
|
+
getSheetName: this.getSheetName,
|
|
1582
|
+
theme: defaultSpreadsheetTheme,
|
|
1583
|
+
})(sheetId, activeCell, selections, tableSpec, theme, bandedRange);
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Updates an existing table spec
|
|
1587
|
+
* @param sheetId
|
|
1588
|
+
* @param updatedTable
|
|
1589
|
+
* @param previousTable
|
|
1590
|
+
*/
|
|
1591
|
+
updateTable(sheetId, tableId, updatedTable) {
|
|
1592
|
+
return updateTable({
|
|
1593
|
+
locale: this.locale,
|
|
1594
|
+
tables: this.tables,
|
|
1595
|
+
createHistory: this.createHistory,
|
|
1596
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1597
|
+
getDependents: this.getDependents,
|
|
1598
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1599
|
+
onChangeTables: this.onChangeTables,
|
|
1600
|
+
getFormattedValue: this.getFormattedValue,
|
|
1601
|
+
})(sheetId, tableId, updatedTable);
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Removes an existing table view
|
|
1605
|
+
* @param tableView
|
|
1606
|
+
*/
|
|
1607
|
+
removeTable(tableView) {
|
|
1608
|
+
removeTable({
|
|
1609
|
+
createHistory: this.createHistory,
|
|
1610
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1611
|
+
getDependents: this.getDependents,
|
|
1612
|
+
onChangeSheets: this.onChangeSheets,
|
|
1613
|
+
onChangeTables: this.onChangeTables,
|
|
1614
|
+
})(tableView);
|
|
1615
|
+
}
|
|
1616
|
+
/**
|
|
1617
|
+
* Insert a column into a table
|
|
1618
|
+
* @param tableView
|
|
1619
|
+
* @param dimensionIndex
|
|
1620
|
+
* @param direction
|
|
1621
|
+
*/
|
|
1622
|
+
insertTableColumn(tableView, dimensionIndex, direction) {
|
|
1623
|
+
const sheet = this.getSheet(tableView.sheetId);
|
|
1624
|
+
insertTableColumn({
|
|
1625
|
+
tables: this.tables,
|
|
1626
|
+
columnCount: sheet.columnCount,
|
|
1627
|
+
rowCount: sheet.rowCount,
|
|
1628
|
+
locale: this.locale,
|
|
1629
|
+
createHistory: this.createHistory,
|
|
1630
|
+
onChangeTables: this.onChangeTables,
|
|
1631
|
+
onChangeSheets: this.onChangeSheets,
|
|
1632
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1633
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1634
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1635
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1636
|
+
getDependents: this.getDependents,
|
|
1637
|
+
getSheetName: this.getSheetName,
|
|
1638
|
+
})(tableView, dimensionIndex, direction);
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Delete a column from a table
|
|
1642
|
+
* @param tableView
|
|
1643
|
+
* @param dimensionIndex
|
|
1644
|
+
*/
|
|
1645
|
+
deleteTableColumn(tableView, dimensionIndex) {
|
|
1646
|
+
const sheet = this.getSheet(tableView.sheetId);
|
|
1647
|
+
deleteTableColumn({
|
|
1648
|
+
columnCount: sheet.columnCount,
|
|
1649
|
+
rowCount: sheet.rowCount,
|
|
1650
|
+
locale: this.locale,
|
|
1651
|
+
getSheetName: this.getSheetName,
|
|
1652
|
+
createHistory: this.createHistory,
|
|
1653
|
+
onChangeTables: this.onChangeTables,
|
|
1654
|
+
onChangeSheets: this.onChangeSheets,
|
|
1655
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1656
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1657
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1658
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1659
|
+
getDependents: this.getDependents,
|
|
1660
|
+
})(tableView, dimensionIndex);
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Delete rows
|
|
1664
|
+
* @param sheetId
|
|
1665
|
+
* @param rowIndexes
|
|
1666
|
+
*/
|
|
1667
|
+
deleteRow(sheetId, rowIndexes) {
|
|
1668
|
+
const sheet = this.getSheet(sheetId);
|
|
1669
|
+
deleteRow({
|
|
1670
|
+
rowCount: sheet.rowCount,
|
|
1671
|
+
columnCount: sheet.columnCount,
|
|
1672
|
+
locale: this.locale,
|
|
1673
|
+
getActiveCell: this.getActiveCell,
|
|
1674
|
+
getSelections: this.getSelections,
|
|
1675
|
+
getDependents: this.getDependents,
|
|
1676
|
+
getGraphNodes: () => this._calculationInterface.getNodes(),
|
|
1677
|
+
getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
|
|
1678
|
+
getSheetName: this.getSheetName,
|
|
1679
|
+
createHistory: this.createHistory,
|
|
1680
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1681
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1682
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1683
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1684
|
+
onChangeSheets: this.onChangeSheets,
|
|
1685
|
+
onChangeTables: this.onChangeTables,
|
|
1686
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1687
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1688
|
+
onChangeActiveCell: this.onChangeActiveSheet,
|
|
1689
|
+
onChangeSelections: this.onChangeSelections,
|
|
1690
|
+
})(sheetId, rowIndexes);
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Delete selected cells and shift left
|
|
1694
|
+
*/
|
|
1695
|
+
deleteCellsShiftLeft(sheetId, activeCell, selections) {
|
|
1696
|
+
const sheet = this.getSheet(sheetId);
|
|
1697
|
+
deleteCellsShiftLeft({
|
|
1698
|
+
rowCount: sheet.rowCount,
|
|
1699
|
+
columnCount: sheet.columnCount,
|
|
1700
|
+
locale: this.locale,
|
|
1701
|
+
getDependents: this.getDependents,
|
|
1702
|
+
getActiveCell: this.getActiveCell,
|
|
1703
|
+
getSelections: this.getSelections,
|
|
1704
|
+
createHistory: this.createHistory,
|
|
1705
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1706
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1707
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1708
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1709
|
+
onChangeSheets: this.onChangeSheets,
|
|
1710
|
+
})(sheetId, activeCell, selections);
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Delete selected cells and shift up
|
|
1714
|
+
*/
|
|
1715
|
+
deleteCellsShiftUp(sheetId, activeCell, selections) {
|
|
1716
|
+
const sheet = this.getSheet(sheetId);
|
|
1717
|
+
deleteCellsShiftUp({
|
|
1718
|
+
rowCount: sheet.rowCount,
|
|
1719
|
+
columnCount: sheet.columnCount,
|
|
1720
|
+
locale: this.locale,
|
|
1721
|
+
getDependents: this.getDependents,
|
|
1722
|
+
getActiveCell: this.getActiveCell,
|
|
1723
|
+
getSelections: this.getSelections,
|
|
1724
|
+
createHistory: this.createHistory,
|
|
1725
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1726
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1727
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
1728
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1729
|
+
onChangeSheets: this.onChangeSheets,
|
|
1730
|
+
})(sheetId, activeCell, selections);
|
|
1731
|
+
}
|
|
1732
|
+
/** Freeze a row index */
|
|
1733
|
+
freezeRow(sheetId, rowIndex) {
|
|
1734
|
+
freezeRow({
|
|
1735
|
+
createHistory: this.createHistory,
|
|
1736
|
+
onChangeSheets: this.onChangeSheets,
|
|
1737
|
+
onChangeCharts: this.onChangeCharts,
|
|
1738
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
1739
|
+
})(sheetId, rowIndex);
|
|
1740
|
+
}
|
|
1741
|
+
/** Freeze a column index */
|
|
1742
|
+
freezeColumn(sheetId, columnIndex) {
|
|
1743
|
+
freezeColumn({
|
|
1744
|
+
createHistory: this.createHistory,
|
|
1745
|
+
onChangeSheets: this.onChangeSheets,
|
|
1746
|
+
onChangeCharts: this.onChangeCharts,
|
|
1747
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
1748
|
+
})(sheetId, columnIndex);
|
|
1749
|
+
}
|
|
1750
|
+
/** Hide columns */
|
|
1751
|
+
hideColumns(sheetId, columnIndexes) {
|
|
1752
|
+
const sheet = this.getSheet(sheetId);
|
|
1753
|
+
hideColumns({
|
|
1754
|
+
createHistory: this.createHistory,
|
|
1755
|
+
getActiveCell: this.getActiveCell,
|
|
1756
|
+
getSelections: this.getSelections,
|
|
1757
|
+
onChangeActiveCell: this.onChangeActiveCell,
|
|
1758
|
+
onChangeSelections: this.onChangeSelections,
|
|
1759
|
+
onChangeSheets: this.onChangeSheets,
|
|
1760
|
+
rowCount: sheet.rowCount,
|
|
1761
|
+
columnCount: sheet.columnCount,
|
|
1762
|
+
getNextFocusableCell: undefined,
|
|
1763
|
+
})(sheetId, columnIndexes);
|
|
1764
|
+
}
|
|
1765
|
+
/** Hide rows */
|
|
1766
|
+
hideRows(sheetId, rowIndexes) {
|
|
1767
|
+
const sheet = this.getSheet(sheetId);
|
|
1768
|
+
hideRows({
|
|
1769
|
+
createHistory: this.createHistory,
|
|
1770
|
+
getActiveCell: this.getActiveCell,
|
|
1771
|
+
getSelections: this.getSelections,
|
|
1772
|
+
onChangeActiveCell: this.onChangeActiveCell,
|
|
1773
|
+
onChangeSelections: this.onChangeSelections,
|
|
1774
|
+
onChangeSheets: this.onChangeSheets,
|
|
1775
|
+
columnCount: sheet.columnCount,
|
|
1776
|
+
rowCount: sheet.rowCount,
|
|
1777
|
+
getNextFocusableCell: undefined,
|
|
1778
|
+
})(sheetId, rowIndexes);
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Apply fill operation programmatically
|
|
1782
|
+
*/
|
|
1783
|
+
async applyFill(sheetId, activeCell, fillSelection, selections, fillableSelections, fillType) {
|
|
1784
|
+
const getCellData = (sId, r, c) => this._sheetData?.[sId]?.[r]?.values?.[c];
|
|
1785
|
+
const ssRegistry = this.sharedStringRegistry;
|
|
1786
|
+
await applyFill({
|
|
1787
|
+
locale: this.locale,
|
|
1788
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1789
|
+
// Fallback safe getters
|
|
1790
|
+
getCellData,
|
|
1791
|
+
getEffectiveValue: this.getEffectiveValue,
|
|
1792
|
+
getFormattedValue: this.getFormattedValue,
|
|
1793
|
+
getAutoFillValues,
|
|
1794
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1795
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1796
|
+
createHistory: this.createHistory,
|
|
1797
|
+
getSheetName: this.getSheetName,
|
|
1798
|
+
sharedStringRegistry: ssRegistry,
|
|
1799
|
+
})(sheetId, activeCell, fillSelection, selections, fillableSelections, fillType);
|
|
1800
|
+
}
|
|
1801
|
+
createNewSheet(sheetSpec) {
|
|
1802
|
+
return createNewSheet({
|
|
1803
|
+
sheetId: this.activeSheetId,
|
|
1804
|
+
createHistory: this.createHistory,
|
|
1805
|
+
onChangeActiveSheet: this.onChangeActiveSheet,
|
|
1806
|
+
onChangeSheets: this.onChangeSheets,
|
|
1807
|
+
sheets: this.sheets,
|
|
1808
|
+
})(sheetSpec);
|
|
1809
|
+
}
|
|
1810
|
+
updateSheet(sheetId, sheetSpec) {
|
|
1811
|
+
return updateSheet({
|
|
1812
|
+
sheets: this.sheets,
|
|
1813
|
+
locale: this.locale,
|
|
1814
|
+
createHistory: this.createHistory,
|
|
1815
|
+
onChangeSheets: this.onChangeSheets,
|
|
1816
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1817
|
+
getGraphNodes: () => this._calculationInterface.getNodes(),
|
|
1818
|
+
// Use raw getPrecedents without filtering to correctly handle cross-sheet references
|
|
1819
|
+
getPrecedents: (source) => this._calculationInterface.getPrecedents(source),
|
|
1820
|
+
})(sheetId, sheetSpec);
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Delete a sheet
|
|
1824
|
+
* @param sheetId
|
|
1825
|
+
*/
|
|
1826
|
+
deleteSheet(sheetId) {
|
|
1827
|
+
deleteSheet({
|
|
1828
|
+
sheets: this.sheets,
|
|
1829
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1830
|
+
onChangeActiveSheet: () => { },
|
|
1831
|
+
onChangeSheets: this.onChangeSheets,
|
|
1832
|
+
createHistory: this.createHistory,
|
|
1833
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
1834
|
+
})(sheetId);
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Create conditional formatting rule
|
|
1838
|
+
* @param rule
|
|
1839
|
+
*/
|
|
1840
|
+
createConditionalFormattingRule(rule) {
|
|
1841
|
+
createConditionalFormattingRule({
|
|
1842
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1843
|
+
createHistory: this.createHistory,
|
|
1844
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1845
|
+
})(rule);
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Update conditional formatting rule
|
|
1849
|
+
* @param updatedRule
|
|
1850
|
+
* @param previousRule
|
|
1851
|
+
*/
|
|
1852
|
+
updateConditionalFormattingRule(updatedRule, previousRule) {
|
|
1853
|
+
updateConditionalFormattingRule({
|
|
1854
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1855
|
+
createHistory: this.createHistory,
|
|
1856
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1857
|
+
})(updatedRule, previousRule);
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* Delete conditional formatting rule
|
|
1861
|
+
* @param rule
|
|
1862
|
+
*/
|
|
1863
|
+
deleteConditionalFormattingRule(rule) {
|
|
1864
|
+
deleteConditionalFormattingRule({
|
|
1865
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1866
|
+
createHistory: this.createHistory,
|
|
1867
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1868
|
+
})(rule);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Preview conditional formatting rule
|
|
1872
|
+
* @param rule
|
|
1873
|
+
*/
|
|
1874
|
+
previewConditionalFormattingRule(rule) {
|
|
1875
|
+
previewConditionalFormattingRule({
|
|
1876
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1877
|
+
createHistory: this.createHistory,
|
|
1878
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
1879
|
+
})(rule);
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Create data validation rule
|
|
1883
|
+
* @param rule
|
|
1884
|
+
*/
|
|
1885
|
+
createDataValidationRule(rule) {
|
|
1886
|
+
createDataValidationRule({
|
|
1887
|
+
locale: this.locale,
|
|
1888
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1889
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1890
|
+
createHistory: this.createHistory,
|
|
1891
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1892
|
+
getSheetName: this.getSheetName,
|
|
1893
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1894
|
+
sharedStringRegistry: this.sharedStringRegistry,
|
|
1895
|
+
})(rule);
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Update data validation rule
|
|
1899
|
+
* @param rule
|
|
1900
|
+
* @param previousRule
|
|
1901
|
+
*/
|
|
1902
|
+
updateDataValidationRule(rule, previousRule) {
|
|
1903
|
+
updateDataValidationRule({
|
|
1904
|
+
locale: this.locale,
|
|
1905
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1906
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1907
|
+
createHistory: this.createHistory,
|
|
1908
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1909
|
+
getSheetName: this.getSheetName,
|
|
1910
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1911
|
+
sharedStringRegistry: this.sharedStringRegistry,
|
|
1912
|
+
})(rule, previousRule);
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* Delete data validation rule
|
|
1916
|
+
* @param rule
|
|
1917
|
+
*/
|
|
1918
|
+
deleteDataValidationRule(rule) {
|
|
1919
|
+
deleteDataValidationRule({
|
|
1920
|
+
locale: this.locale,
|
|
1921
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1922
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1923
|
+
createHistory: this.createHistory,
|
|
1924
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1925
|
+
getSheetName: this.getSheetName,
|
|
1926
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1927
|
+
sharedStringRegistry: this.sharedStringRegistry,
|
|
1928
|
+
})(rule);
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Delete all data validation rules
|
|
1932
|
+
* @param rules
|
|
1933
|
+
*/
|
|
1934
|
+
deleteDataValidationRules(rules) {
|
|
1935
|
+
deleteDataValidationRules({
|
|
1936
|
+
locale: this.locale,
|
|
1937
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1938
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
1939
|
+
createHistory: this.createHistory,
|
|
1940
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1941
|
+
getSheetName: this.getSheetName,
|
|
1942
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1943
|
+
sharedStringRegistry: this.sharedStringRegistry,
|
|
1944
|
+
})(rules);
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Change cell decimals
|
|
1948
|
+
* @param sheetId
|
|
1949
|
+
* @param activeCell
|
|
1950
|
+
* @param selections
|
|
1951
|
+
* @param type
|
|
1952
|
+
*/
|
|
1953
|
+
changeDecimals(sheetId, activeCell, selections, type) {
|
|
1954
|
+
changeDecimals({
|
|
1955
|
+
locale: this.locale,
|
|
1956
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1957
|
+
createHistory: this.createHistory,
|
|
1958
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
1959
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1960
|
+
})(sheetId, activeCell, selections, type);
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* Change sheet tab color
|
|
1964
|
+
* @param sheetId
|
|
1965
|
+
* @param color
|
|
1966
|
+
*/
|
|
1967
|
+
changeSheetTabcolor(sheetId, color) {
|
|
1968
|
+
changeSheetTabcolor({
|
|
1969
|
+
onChangeSheets: this.onChangeSheets,
|
|
1970
|
+
createHistory: this.createHistory,
|
|
1971
|
+
})(sheetId, color);
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* Change theme
|
|
1975
|
+
* @param theme
|
|
1976
|
+
*/
|
|
1977
|
+
changeTheme(theme) {
|
|
1978
|
+
changeTheme({
|
|
1979
|
+
createHistory: this.createHistory,
|
|
1980
|
+
onChangeTheme: () => { },
|
|
1981
|
+
})(theme);
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* Clear formatting
|
|
1985
|
+
* @param sheetId
|
|
1986
|
+
* @param activeCell
|
|
1987
|
+
* @param selections
|
|
1988
|
+
*/
|
|
1989
|
+
clearFormatting(sheetId, activeCell, selections) {
|
|
1990
|
+
clearFormatting({
|
|
1991
|
+
locale: this.locale,
|
|
1992
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
1993
|
+
createHistory: this.createHistory,
|
|
1994
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1995
|
+
})(sheetId, activeCell, selections);
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* Remove duplicate rows
|
|
1999
|
+
* @param sheetId
|
|
2000
|
+
* @param activeCell
|
|
2001
|
+
* @param selections
|
|
2002
|
+
*/
|
|
2003
|
+
removeDuplicates(sheetId, activeCell, selections) {
|
|
2004
|
+
return removeDuplicates({
|
|
2005
|
+
locale: this.locale,
|
|
2006
|
+
getFormattedValue: this.getFormattedValue,
|
|
2007
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2008
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2009
|
+
createHistory: this.createHistory,
|
|
2010
|
+
})(sheetId, activeCell, selections);
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Increase indent
|
|
2014
|
+
* @param sheetId
|
|
2015
|
+
* @param activeCell
|
|
2016
|
+
* @param selections
|
|
2017
|
+
*/
|
|
2018
|
+
increaseIndent(sheetId, activeCell, selections) {
|
|
2019
|
+
increaseIndent({
|
|
2020
|
+
locale: this.locale,
|
|
2021
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2022
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2023
|
+
createHistory: this.createHistory,
|
|
2024
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
2025
|
+
})(sheetId, activeCell, selections);
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Decrease indent
|
|
2029
|
+
* @param sheetId
|
|
2030
|
+
* @param activeCell
|
|
2031
|
+
* @param selections
|
|
2032
|
+
*/
|
|
2033
|
+
decreaseIndent(sheetId, activeCell, selections) {
|
|
2034
|
+
decreaseIndent({
|
|
2035
|
+
locale: this.locale,
|
|
2036
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2037
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2038
|
+
createHistory: this.createHistory,
|
|
2039
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
2040
|
+
})(sheetId, activeCell, selections);
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Create named range
|
|
2044
|
+
* @param sheetId
|
|
2045
|
+
* @param namedRange
|
|
2046
|
+
*/
|
|
2047
|
+
createNamedRange(sheetId, namedRange) {
|
|
2048
|
+
createNamedRange({
|
|
2049
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2050
|
+
createHistory: this.createHistory,
|
|
2051
|
+
onChangeNamedRanges: this.onChangeNamedRanges,
|
|
2052
|
+
})(sheetId, namedRange);
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Delete named range
|
|
2056
|
+
* @param id
|
|
2057
|
+
*/
|
|
2058
|
+
deleteNamedRange(id) {
|
|
2059
|
+
deleteNamedRange({
|
|
2060
|
+
getDependents: this.getDependents,
|
|
2061
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2062
|
+
createHistory: this.createHistory,
|
|
2063
|
+
onChangeNamedRanges: this.onChangeNamedRanges,
|
|
2064
|
+
})(id);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Delete cells
|
|
2068
|
+
* @param sheetId
|
|
2069
|
+
* @param activeCell
|
|
2070
|
+
* @param selections
|
|
2071
|
+
* @param clearType - "contents" (default), "formats", or "all"
|
|
2072
|
+
*/
|
|
2073
|
+
deleteCells(sheetId, activeCell, selections, clearType = "contents") {
|
|
2074
|
+
const sheet = this.getSheet(sheetId);
|
|
2075
|
+
deleteCells({
|
|
2076
|
+
locale: this.locale,
|
|
2077
|
+
rowCount: sheet.rowCount,
|
|
2078
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
2079
|
+
getDependents: this.getDependents,
|
|
2080
|
+
getDataRowCount: () => sheet.rowCount,
|
|
2081
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2082
|
+
onChangeSheets: this.onChangeSheets,
|
|
2083
|
+
onChangeTables: this.onChangeTables,
|
|
2084
|
+
onChangeActiveCell: () => { },
|
|
2085
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2086
|
+
createHistory: this.createHistory,
|
|
2087
|
+
isArrayFormula: () => false,
|
|
2088
|
+
getRowHeight: this.getRowHeight,
|
|
2089
|
+
})(sheetId, activeCell, selections, clearType);
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Delete table row
|
|
2093
|
+
* @param tableView
|
|
2094
|
+
* @param rowIndexes
|
|
2095
|
+
*/
|
|
2096
|
+
deleteTableRow(tableView, rowIndexes) {
|
|
2097
|
+
const sheet = this.getSheet(tableView.sheetId);
|
|
2098
|
+
deleteTableRow({
|
|
2099
|
+
rowCount: sheet.rowCount,
|
|
2100
|
+
columnCount: sheet.columnCount,
|
|
2101
|
+
locale: this.locale,
|
|
2102
|
+
getDependents: this.getDependents,
|
|
2103
|
+
getSheetName: this.getSheetName,
|
|
2104
|
+
createHistory: this.createHistory,
|
|
2105
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
2106
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2107
|
+
enqueueStructureChange: this.enqueueStructureChange,
|
|
2108
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2109
|
+
onChangeSheets: this.onChangeSheets,
|
|
2110
|
+
onChangeTables: this.onChangeTables,
|
|
2111
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
2112
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
2113
|
+
})(tableView, rowIndexes);
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Duplicate sheet
|
|
2117
|
+
* @param sheetId
|
|
2118
|
+
*/
|
|
2119
|
+
duplicateSheet(sheetId, newSheetId) {
|
|
2120
|
+
return duplicateSheet({
|
|
2121
|
+
locale: this.locale,
|
|
2122
|
+
maxSheetCount: 100,
|
|
2123
|
+
sheets: this.sheets,
|
|
2124
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2125
|
+
onChangeSheets: this.onChangeSheets,
|
|
2126
|
+
onChangeTables: this.onChangeTables,
|
|
2127
|
+
onChangeCharts: this.onChangeCharts,
|
|
2128
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2129
|
+
onChangeConditionalFormats: this.onChangeConditionalFormats,
|
|
2130
|
+
onChangeDataValidations: this.onChangeDataValidations,
|
|
2131
|
+
onChangeActiveSheet: () => { },
|
|
2132
|
+
enqueueGraphOperation: this.enqueueGraphOperation,
|
|
2133
|
+
createHistory: this.createHistory,
|
|
2134
|
+
})(sheetId, newSheetId);
|
|
2135
|
+
}
|
|
2136
|
+
/**
|
|
2137
|
+
* Create embed
|
|
2138
|
+
* @param embedId
|
|
2139
|
+
*/
|
|
2140
|
+
createEmbed(spec) {
|
|
2141
|
+
createEmbed({
|
|
2142
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2143
|
+
createHistory: this.createHistory,
|
|
2144
|
+
})(spec);
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Delete embed
|
|
2148
|
+
* @param embedId
|
|
2149
|
+
*/
|
|
2150
|
+
deleteEmbed(embedId) {
|
|
2151
|
+
deleteEmbed({
|
|
2152
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2153
|
+
createHistory: this.createHistory,
|
|
2154
|
+
})(embedId);
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Update embed
|
|
2158
|
+
* @param embed
|
|
2159
|
+
*/
|
|
2160
|
+
updateEmbed(embed) {
|
|
2161
|
+
updateEmbed({
|
|
2162
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2163
|
+
createHistory: this.createHistory,
|
|
2164
|
+
})(embed);
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Move embed
|
|
2168
|
+
* @param embedId
|
|
2169
|
+
* @param sheetId
|
|
2170
|
+
* @param anchorCell
|
|
2171
|
+
* @param offsetXPixels
|
|
2172
|
+
* @param offsetYPixels
|
|
2173
|
+
*/
|
|
2174
|
+
moveEmbed(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels) {
|
|
2175
|
+
moveEmbed({
|
|
2176
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2177
|
+
createHistory: this.createHistory,
|
|
2178
|
+
})(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels);
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* Resize embed
|
|
2182
|
+
* @param embedId
|
|
2183
|
+
* @param sheetId
|
|
2184
|
+
* @param anchorCell
|
|
2185
|
+
* @param offsetXPixels
|
|
2186
|
+
* @param offsetYPixels
|
|
2187
|
+
* @param width
|
|
2188
|
+
* @param height
|
|
2189
|
+
*/
|
|
2190
|
+
resizeEmbed(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels, width, height) {
|
|
2191
|
+
resizeEmbed({
|
|
2192
|
+
onChangeEmbeds: this.onChangeEmbeds,
|
|
2193
|
+
createHistory: this.createHistory,
|
|
2194
|
+
})(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels, width, height);
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Check if chart operations are available
|
|
2198
|
+
* @returns true if @rowsncolumns/charts package is installed
|
|
2199
|
+
*/
|
|
2200
|
+
isChartsAvailable() {
|
|
2201
|
+
return isChartsAvailable();
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Create a chart
|
|
2205
|
+
* @param sheetId
|
|
2206
|
+
* @param activeCell
|
|
2207
|
+
* @param selections
|
|
2208
|
+
* @param chartSpec
|
|
2209
|
+
*/
|
|
2210
|
+
createChart(sheetId, activeCell, selections, chartSpec) {
|
|
2211
|
+
safeCreateChart({
|
|
2212
|
+
onChangeCharts: this.onChangeCharts,
|
|
2213
|
+
getFormattedValue: this.getFormattedValue,
|
|
2214
|
+
getEffectiveValue: this.getEffectiveValue,
|
|
2215
|
+
createHistory: this.createHistory,
|
|
2216
|
+
})(sheetId, activeCell, selections, chartSpec);
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Delete a chart
|
|
2220
|
+
* @param chartId
|
|
2221
|
+
*/
|
|
2222
|
+
deleteChart(chartId) {
|
|
2223
|
+
safeDeleteChart({
|
|
2224
|
+
onChangeCharts: this.onChangeCharts,
|
|
2225
|
+
createHistory: this.createHistory,
|
|
2226
|
+
})(chartId);
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Move a chart
|
|
2230
|
+
* @param chartId
|
|
2231
|
+
* @param anchorCell
|
|
2232
|
+
* @param offsetXPixels
|
|
2233
|
+
* @param offsetYPixels
|
|
2234
|
+
*/
|
|
2235
|
+
moveChart(chartId, anchorCell, offsetXPixels, offsetYPixels) {
|
|
2236
|
+
safeMoveChart({
|
|
2237
|
+
onChangeCharts: this.onChangeCharts,
|
|
2238
|
+
createHistory: this.createHistory,
|
|
2239
|
+
})(chartId, anchorCell, offsetXPixels, offsetYPixels);
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Resize a chart
|
|
2243
|
+
* @param chartId
|
|
2244
|
+
* @param anchorCell
|
|
2245
|
+
* @param offsetXPixels
|
|
2246
|
+
* @param offsetYPixels
|
|
2247
|
+
* @param width
|
|
2248
|
+
* @param height
|
|
2249
|
+
*/
|
|
2250
|
+
resizeChart(chartId, anchorCell, offsetXPixels, offsetYPixels, width, height) {
|
|
2251
|
+
safeResizeChart({
|
|
2252
|
+
onChangeCharts: this.onChangeCharts,
|
|
2253
|
+
createHistory: this.createHistory,
|
|
2254
|
+
})(chartId, anchorCell, offsetXPixels, offsetYPixels, width, height);
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* Update a chart
|
|
2258
|
+
* @param chart
|
|
2259
|
+
*/
|
|
2260
|
+
updateChart(chart) {
|
|
2261
|
+
safeUpdateChart({
|
|
2262
|
+
onChangeCharts: this.onChangeCharts,
|
|
2263
|
+
createHistory: this.createHistory,
|
|
2264
|
+
})(chart);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Auto fit rows or columns
|
|
2268
|
+
* @param sheetId
|
|
2269
|
+
* @param indexes
|
|
2270
|
+
* @param axis
|
|
2271
|
+
* @returns
|
|
2272
|
+
*/
|
|
2273
|
+
autoResize(sheetId, indexes, axis) {
|
|
2274
|
+
return autoResize({
|
|
2275
|
+
createHistory: this.createHistory,
|
|
2276
|
+
onChangeSheets: this.onChangeSheets,
|
|
2277
|
+
getColumnWidth: this.getColumnWidth,
|
|
2278
|
+
getRowHeight: this.getRowHeight,
|
|
2279
|
+
getActiveCell: this.getActiveCell,
|
|
2280
|
+
})(sheetId, indexes, axis);
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Resize row or column
|
|
2284
|
+
* @param sheetId
|
|
2285
|
+
* @param indexes
|
|
2286
|
+
* @param dimension
|
|
2287
|
+
* @param axis
|
|
2288
|
+
* @returns
|
|
2289
|
+
*/
|
|
2290
|
+
resize(sheetId, indexes, dimension, axis) {
|
|
2291
|
+
return resize({
|
|
2292
|
+
createHistory: this.createHistory,
|
|
2293
|
+
onChangeSheets: this.onChangeSheets,
|
|
2294
|
+
getRowHeight: this.getRowHeight,
|
|
2295
|
+
getActiveCell: this.getActiveCell,
|
|
2296
|
+
getCellDimensions: this.getCellDimensions,
|
|
2297
|
+
isMergedCell: this.isMergedCell,
|
|
2298
|
+
})(sheetId, indexes, dimension, axis);
|
|
2299
|
+
}
|
|
2300
|
+
async deletePivotTable(pivotId, database) {
|
|
2301
|
+
return safeDeletePivotTable({
|
|
2302
|
+
activeCell: this.getActiveCell(),
|
|
2303
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2304
|
+
onChangeActiveCell: this.onChangeActiveSheet,
|
|
2305
|
+
pivotTables: this.pivotTables,
|
|
2306
|
+
sheetId: this.activeSheetId,
|
|
2307
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
2308
|
+
database,
|
|
2309
|
+
locale: this.locale,
|
|
2310
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2311
|
+
onChangeSheets: this.onChangeSheets,
|
|
2312
|
+
// onCreateNewSheet:,
|
|
2313
|
+
createHistory: this.createHistory,
|
|
2314
|
+
onChangePivotTables: this.onChangePivotTables,
|
|
2315
|
+
getColumnWidth: this.getColumnWidth,
|
|
2316
|
+
})(pivotId);
|
|
2317
|
+
}
|
|
2318
|
+
async createPivotTable(pivotTable, createNewSheet, database) {
|
|
2319
|
+
await safeCreatePivotTable({
|
|
2320
|
+
activeCell: this.getActiveCell(),
|
|
2321
|
+
enqueueCalculation: this.enqueueCalculation,
|
|
2322
|
+
onChangeActiveCell: this.onChangeActiveSheet,
|
|
2323
|
+
pivotTables: this.pivotTables,
|
|
2324
|
+
sheetId: this.activeSheetId,
|
|
2325
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
2326
|
+
database,
|
|
2327
|
+
locale: this.locale,
|
|
2328
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2329
|
+
onChangeSheets: this.onChangeSheets,
|
|
2330
|
+
// onCreateNewSheet:,
|
|
2331
|
+
createHistory: this.createHistory,
|
|
2332
|
+
onChangePivotTables: this.onChangePivotTables,
|
|
2333
|
+
getGridValues: this.getGridValuesForPivot,
|
|
2334
|
+
getColumnWidth: this.getColumnWidth,
|
|
2335
|
+
})(pivotTable, createNewSheet);
|
|
2336
|
+
}
|
|
2337
|
+
getGridValuesForPivot = (range) => {
|
|
2338
|
+
let headers = [];
|
|
2339
|
+
const rows = [];
|
|
2340
|
+
for (let rowIndex = range.startRowIndex; rowIndex <= range.endRowIndex; rowIndex++) {
|
|
2341
|
+
const row = [];
|
|
2342
|
+
const isHeader = rowIndex === range.startRowIndex;
|
|
2343
|
+
for (let columnIndex = range.startColumnIndex; columnIndex <= range.endColumnIndex; columnIndex++) {
|
|
2344
|
+
row.push(this.getEffectiveValue(range.sheetId, rowIndex, columnIndex) ?? "");
|
|
2345
|
+
}
|
|
2346
|
+
if (isHeader) {
|
|
2347
|
+
headers = row;
|
|
2348
|
+
}
|
|
2349
|
+
else {
|
|
2350
|
+
rows.push(row);
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
return {
|
|
2354
|
+
headers,
|
|
2355
|
+
rows,
|
|
2356
|
+
};
|
|
2357
|
+
};
|
|
2358
|
+
/**
|
|
2359
|
+
* Create a new citation and attach it to a cell
|
|
2360
|
+
* @param sheetId
|
|
2361
|
+
* @param rowIndex
|
|
2362
|
+
* @param columnIndex
|
|
2363
|
+
* @param citation
|
|
2364
|
+
*/
|
|
2365
|
+
createCitation(sheetId, rowIndex, columnIndex, citation) {
|
|
2366
|
+
createCitation({
|
|
2367
|
+
locale: this.locale,
|
|
2368
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2369
|
+
onChangeCitations: this.onChangeCitations,
|
|
2370
|
+
createHistory: this.createHistory,
|
|
2371
|
+
})(sheetId, rowIndex, columnIndex, citation);
|
|
2372
|
+
}
|
|
2373
|
+
/**
|
|
2374
|
+
* Create multiple citations in a batch (adds to citations array only)
|
|
2375
|
+
* @param cellCitations
|
|
2376
|
+
*/
|
|
2377
|
+
createBatchCitations(citations) {
|
|
2378
|
+
createBatchCitations({
|
|
2379
|
+
onChangeCitations: this.onChangeCitations,
|
|
2380
|
+
createHistory: this.createHistory,
|
|
2381
|
+
})(citations);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Update an existing citation
|
|
2385
|
+
* @param citationId
|
|
2386
|
+
* @param updates
|
|
2387
|
+
*/
|
|
2388
|
+
updateCitation(citationId, updates) {
|
|
2389
|
+
updateCitation({
|
|
2390
|
+
onChangeCitations: this.onChangeCitations,
|
|
2391
|
+
createHistory: this.createHistory,
|
|
2392
|
+
})(citationId, updates);
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Remove a citation reference from a cell
|
|
2396
|
+
* @param sheetId
|
|
2397
|
+
* @param rowIndex
|
|
2398
|
+
* @param columnIndex
|
|
2399
|
+
*/
|
|
2400
|
+
removeCitationFromCell(sheetId, rowIndex, columnIndex) {
|
|
2401
|
+
removeCitationFromCell({
|
|
2402
|
+
locale: this.locale,
|
|
2403
|
+
onChangeSheetData: this.onChangeSheetData,
|
|
2404
|
+
createHistory: this.createHistory,
|
|
2405
|
+
})(sheetId, rowIndex, columnIndex);
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* Delete a citation completely (removes from citations array)
|
|
2409
|
+
* Note: Cells with this citationId will still have the reference
|
|
2410
|
+
* @param citationId
|
|
2411
|
+
*/
|
|
2412
|
+
deleteCitation(citationId) {
|
|
2413
|
+
deleteCitation({
|
|
2414
|
+
onChangeCitations: this.onChangeCitations,
|
|
2415
|
+
createHistory: this.createHistory,
|
|
2416
|
+
})(citationId);
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
* Simple sheet interface for some getters
|
|
2421
|
+
*/
|
|
2422
|
+
class SheetInterface {
|
|
2423
|
+
sheet;
|
|
2424
|
+
constructor(sheet) {
|
|
2425
|
+
this.sheet = sheet;
|
|
2426
|
+
}
|
|
2427
|
+
get name() {
|
|
2428
|
+
return this.sheet?.title;
|
|
2429
|
+
}
|
|
2430
|
+
get rowCount() {
|
|
2431
|
+
return this.sheet?.rowCount ?? DEFAULT_ROW_COUNT;
|
|
2432
|
+
}
|
|
2433
|
+
get columnCount() {
|
|
2434
|
+
return this.sheet?.columnCount ?? DEFAULT_COLUMN_COUNT;
|
|
2435
|
+
}
|
|
2436
|
+
get frozenColumns() {
|
|
2437
|
+
return this.sheet?.frozenColumnCount ?? 0;
|
|
2438
|
+
}
|
|
2439
|
+
get frozenRows() {
|
|
2440
|
+
return this.sheet?.frozenRowCount ?? 0;
|
|
2441
|
+
}
|
|
2442
|
+
}
|