@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,1829 @@
|
|
|
1
|
+
import { lexify, tokenVocabulary } from "@rowsncolumns/calculator";
|
|
2
|
+
import { FormulaError } from "@rowsncolumns/fast-formula-parser";
|
|
3
|
+
import { getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredFormat, getCellUserEnteredValue, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, getStyleId, balanceFormula, cellToAddress, getCellXfsKey, getCurrentLocale, getDefaultDateFormat, getDefaultTimeFormat, desanitizeSheetName, isAlternateFormula, isDatePattern, isDateTimePattern, isNil, isTextPattern, isValidFormula, looksLikeMarkdown, } from "@rowsncolumns/utils";
|
|
4
|
+
import isEqual from "lodash/isEqual";
|
|
5
|
+
import set from "lodash/set";
|
|
6
|
+
import { isDataValidationFormulaRule } from "./api/data-validation";
|
|
7
|
+
import { checkBooleanRule } from "./api/validation";
|
|
8
|
+
import { createFormattedValue, createNumberValue, detectNumberFormatPattern, detectNumberFormatType, detectValueType, detectValueTypeAndPattern, isMultiline, isNumber, isValidURLorEmail, } from "./api/datatype";
|
|
9
|
+
import { changeDecimals, getDecimalPlaces, pattern_number, pattern_number_thousands, } from "./api/decimals";
|
|
10
|
+
import { formulaToRelativeReference, updateColumnName, updateNamedRangeName, updateSheetName, } from "./api/formula";
|
|
11
|
+
import { getLocaleSeparators } from "./api/intl";
|
|
12
|
+
import { AWAITING_CALCULATION } from "./helpers";
|
|
13
|
+
export const defaultSheetId = 1;
|
|
14
|
+
export const defaultCellCoords = { rowIndex: 1, columnIndex: 1 };
|
|
15
|
+
// Add this helper function to determine if an object is a StyleReference
|
|
16
|
+
export function isStyleReference(obj) {
|
|
17
|
+
return obj && typeof obj === "object" && ("styleId" in obj || "sid" in obj);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Marker persisted as `fv` on cells whose calculation is in flight (set by
|
|
21
|
+
* `setLoading()`). Exported so other modules can detect the loading state
|
|
22
|
+
* from cellData without a stringly-typed comparison.
|
|
23
|
+
*/
|
|
24
|
+
export const LOADING_VALUE = "Loading...";
|
|
25
|
+
const excludeKeys = new Set([
|
|
26
|
+
"userEnteredValue",
|
|
27
|
+
"ue",
|
|
28
|
+
"effectiveValue",
|
|
29
|
+
"ev",
|
|
30
|
+
"formattedValue",
|
|
31
|
+
"fv",
|
|
32
|
+
"ss",
|
|
33
|
+
"effectiveFormat",
|
|
34
|
+
"ef",
|
|
35
|
+
"userEnteredFormat",
|
|
36
|
+
"uf",
|
|
37
|
+
"dataValidation",
|
|
38
|
+
"imageUrl",
|
|
39
|
+
"hyperlink",
|
|
40
|
+
"metaType",
|
|
41
|
+
"note",
|
|
42
|
+
"citationId",
|
|
43
|
+
"commentThreadId",
|
|
44
|
+
"expandable",
|
|
45
|
+
"expanded",
|
|
46
|
+
"groupKeys",
|
|
47
|
+
"pivotId",
|
|
48
|
+
"conditionalFormattingResultById",
|
|
49
|
+
"dataValidationResult",
|
|
50
|
+
]);
|
|
51
|
+
const hasExcelTextPrefix = (value) => {
|
|
52
|
+
return typeof value === "string" && value.startsWith("'") && value.length > 1;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Both halves of a `NumberFormat` can encode "General" two ways: as a
|
|
56
|
+
* missing field, or as the literal sentinel value (`"GENERAL"` for type,
|
|
57
|
+
* `"General"` for pattern). These two predicates normalize both forms so
|
|
58
|
+
* the rules above don't have to repeat `(!x || x === "…")` everywhere.
|
|
59
|
+
*/
|
|
60
|
+
const hasGeneralType = (format) => !format.type || format.type === "GENERAL";
|
|
61
|
+
const hasGeneralPattern = (format) => !format.pattern || format.pattern === "General";
|
|
62
|
+
/**
|
|
63
|
+
* "General" means the cell has no explicit number format applied. Excel's
|
|
64
|
+
* auto-format-on-input rule triggers only for General cells; any other
|
|
65
|
+
* format is preserved as-is.
|
|
66
|
+
*/
|
|
67
|
+
const isGeneralNumberFormat = (format) => !format || (hasGeneralType(format) && hasGeneralPattern(format));
|
|
68
|
+
const stripExcelTextPrefix = (value) => value.slice(1);
|
|
69
|
+
const getHyperlinkTarget = (hyperlink) => {
|
|
70
|
+
if (typeof hyperlink === "string") {
|
|
71
|
+
return hyperlink;
|
|
72
|
+
}
|
|
73
|
+
if (hyperlink.kind === "external") {
|
|
74
|
+
return hyperlink.url;
|
|
75
|
+
}
|
|
76
|
+
return hyperlink.location;
|
|
77
|
+
};
|
|
78
|
+
const getHyperlinkDisplay = (hyperlink) => {
|
|
79
|
+
if (typeof hyperlink === "string") {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return hyperlink.display;
|
|
83
|
+
};
|
|
84
|
+
export class SheetCell {
|
|
85
|
+
static defaultSharedStrings;
|
|
86
|
+
static defaultEnableAtFormula = false;
|
|
87
|
+
sheetId;
|
|
88
|
+
coords;
|
|
89
|
+
value;
|
|
90
|
+
userEnteredValue;
|
|
91
|
+
effectiveValue;
|
|
92
|
+
formattedValue;
|
|
93
|
+
textFormatRuns;
|
|
94
|
+
userEnteredFormat;
|
|
95
|
+
dataValidationId;
|
|
96
|
+
dataValidationRule;
|
|
97
|
+
conditionalFormattingResultById;
|
|
98
|
+
dataValidationResult;
|
|
99
|
+
defaultPattern;
|
|
100
|
+
loadingValue;
|
|
101
|
+
isLoading;
|
|
102
|
+
hyperlink;
|
|
103
|
+
imageUrl;
|
|
104
|
+
getRangeValues;
|
|
105
|
+
locale;
|
|
106
|
+
use1904;
|
|
107
|
+
lenientGrouping;
|
|
108
|
+
note;
|
|
109
|
+
commentThreadId;
|
|
110
|
+
citationId;
|
|
111
|
+
metaType;
|
|
112
|
+
expandable;
|
|
113
|
+
expanded;
|
|
114
|
+
cellData;
|
|
115
|
+
formatColor;
|
|
116
|
+
cellXfsRegistry;
|
|
117
|
+
sharedStringRegistry;
|
|
118
|
+
sharedStrings;
|
|
119
|
+
sharedStringIndex;
|
|
120
|
+
enableAtFormula;
|
|
121
|
+
originalUserEnteredFormat;
|
|
122
|
+
pivotId;
|
|
123
|
+
groupKeys;
|
|
124
|
+
version;
|
|
125
|
+
updatedAt;
|
|
126
|
+
arrayFormulaRef;
|
|
127
|
+
// Shared-formula provenance captured on xlsx import. Carries the
|
|
128
|
+
// structural grouping (xlsx `<f t="shared" si="N" ref="A1:A10">`) so the
|
|
129
|
+
// exporter can re-emit the same `t="shared"` markers. Leader cells carry
|
|
130
|
+
// both `si` and `ref`; follower cells carry only `si`. The renderer and
|
|
131
|
+
// calculator don't read this — it's pure export-side metadata that
|
|
132
|
+
// mirrors `arrayFormulaRef` (af) in lifecycle and intent. Cleared on any
|
|
133
|
+
// user formula edit so a modified cell exports as a standalone formula.
|
|
134
|
+
sharedFormulaSpec;
|
|
135
|
+
setVersion(version) {
|
|
136
|
+
this.version = version ?? undefined;
|
|
137
|
+
}
|
|
138
|
+
setUpdatedAt(timestamp) {
|
|
139
|
+
this.updatedAt = timestamp ?? undefined;
|
|
140
|
+
}
|
|
141
|
+
static setDefaultSharedStrings(sharedStrings) {
|
|
142
|
+
SheetCell.defaultSharedStrings = sharedStrings;
|
|
143
|
+
}
|
|
144
|
+
static setDefaultEnableAtFormula(enable) {
|
|
145
|
+
SheetCell.defaultEnableAtFormula = enable ?? false;
|
|
146
|
+
}
|
|
147
|
+
constructor(sheetId = defaultSheetId, coords = defaultCellCoords, cellData, options) {
|
|
148
|
+
this.assign(sheetId, coords, cellData, options);
|
|
149
|
+
this.ensureFormatsMutable();
|
|
150
|
+
}
|
|
151
|
+
setLocale(locale) {
|
|
152
|
+
this.locale = locale;
|
|
153
|
+
}
|
|
154
|
+
setUse1904(use1904) {
|
|
155
|
+
this.use1904 = use1904;
|
|
156
|
+
}
|
|
157
|
+
assign(sheetId = defaultSheetId, coords = defaultCellCoords, cellData, options) {
|
|
158
|
+
const { getRangeValues, locale = getCurrentLocale(), use1904, lenientGrouping, enableAtFormula, cellXfsRegistry, getDataValidationById, sharedStringRegistry, } = options ?? {};
|
|
159
|
+
this.sheetId = sheetId;
|
|
160
|
+
this.coords = coords;
|
|
161
|
+
this.cellData = cellData;
|
|
162
|
+
this.cellXfsRegistry = cellXfsRegistry;
|
|
163
|
+
this.sharedStringRegistry = sharedStringRegistry;
|
|
164
|
+
this.sharedStrings =
|
|
165
|
+
sharedStringRegistry?.getSharedStrings() ??
|
|
166
|
+
SheetCell.defaultSharedStrings ??
|
|
167
|
+
this.sharedStrings;
|
|
168
|
+
this.sharedStringIndex = cellData?.ss ?? undefined;
|
|
169
|
+
this.use1904 = use1904;
|
|
170
|
+
this.lenientGrouping = lenientGrouping;
|
|
171
|
+
this.enableAtFormula =
|
|
172
|
+
enableAtFormula ?? SheetCell.defaultEnableAtFormula ?? false;
|
|
173
|
+
const userEnteredFormat = cellData
|
|
174
|
+
? getCellUserEnteredFormat(cellData)
|
|
175
|
+
: undefined;
|
|
176
|
+
// Legacy `ef` is still readable from cellData for backwards-compat at
|
|
177
|
+
// the renderer layer (see `useSheetProperties.getEffectiveFormat`),
|
|
178
|
+
// but `SheetCell` no longer tracks it as in-memory state. `uf` is the
|
|
179
|
+
// single source of truth.
|
|
180
|
+
this.userEnteredFormat = isStyleReference(userEnteredFormat)
|
|
181
|
+
? cellXfsRegistry?.getCellXfsFromStyleId(getStyleId(userEnteredFormat))
|
|
182
|
+
: userEnteredFormat;
|
|
183
|
+
this.originalUserEnteredFormat = userEnteredFormat;
|
|
184
|
+
this.userEnteredValue = cellData
|
|
185
|
+
? getCellUserEnteredValue(cellData)
|
|
186
|
+
: undefined;
|
|
187
|
+
this.defaultPattern = "General";
|
|
188
|
+
this.effectiveValue = cellData
|
|
189
|
+
? getCellEffectiveValue(cellData)
|
|
190
|
+
: undefined;
|
|
191
|
+
this.formattedValue = cellData
|
|
192
|
+
? getCellFormattedValue(cellData)
|
|
193
|
+
: undefined;
|
|
194
|
+
this.textFormatRuns = Array.isArray(cellData?.tf)
|
|
195
|
+
? [
|
|
196
|
+
...cellData.tf,
|
|
197
|
+
]
|
|
198
|
+
: undefined;
|
|
199
|
+
if (this.sharedStringIndex != null) {
|
|
200
|
+
this.hydrateSharedStringValue(this.sharedStringIndex);
|
|
201
|
+
}
|
|
202
|
+
const cellDataValidation = cellData?.dataValidation;
|
|
203
|
+
// Backwards compatiblity
|
|
204
|
+
// Object based
|
|
205
|
+
if (cellDataValidation && typeof cellDataValidation === "object") {
|
|
206
|
+
this.dataValidationId = cellDataValidation.id;
|
|
207
|
+
this.dataValidationRule = cellDataValidation;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
// New
|
|
211
|
+
this.dataValidationId = cellDataValidation ?? undefined;
|
|
212
|
+
this.dataValidationRule = this.dataValidationId
|
|
213
|
+
? getDataValidationById?.(this.dataValidationId)
|
|
214
|
+
: undefined;
|
|
215
|
+
}
|
|
216
|
+
this.conditionalFormattingResultById =
|
|
217
|
+
cellData?.conditionalFormattingResultById;
|
|
218
|
+
this.dataValidationResult = cellData?.dataValidationResult;
|
|
219
|
+
this.imageUrl = cellData?.imageUrl ?? undefined;
|
|
220
|
+
this.isLoading = false;
|
|
221
|
+
this.loadingValue = LOADING_VALUE;
|
|
222
|
+
this.hyperlink = cellData?.hyperlink ?? undefined;
|
|
223
|
+
this.metaType = cellData?.metaType ?? undefined;
|
|
224
|
+
this.note = cellData?.note ?? undefined;
|
|
225
|
+
this.commentThreadId = cellData?.commentThreadId ?? undefined;
|
|
226
|
+
this.citationId = cellData?.citationId ?? undefined;
|
|
227
|
+
this.expandable = cellData?.expandable ?? undefined;
|
|
228
|
+
this.expanded = cellData?.expanded ?? undefined;
|
|
229
|
+
this.getRangeValues = getRangeValues;
|
|
230
|
+
this.locale = locale;
|
|
231
|
+
this.pivotId = cellData?.pivotId;
|
|
232
|
+
this.groupKeys = cellData?.groupKeys;
|
|
233
|
+
this.version = cellData?.version ?? undefined;
|
|
234
|
+
this.updatedAt = cellData?.updatedAt ?? undefined;
|
|
235
|
+
this.arrayFormulaRef = cellData?.af ?? undefined;
|
|
236
|
+
this.sharedFormulaSpec = cellData?.sf
|
|
237
|
+
? {
|
|
238
|
+
si: cellData.sf.si,
|
|
239
|
+
...(cellData.sf.ref ? { ref: cellData.sf.ref } : {}),
|
|
240
|
+
}
|
|
241
|
+
: undefined;
|
|
242
|
+
return this;
|
|
243
|
+
}
|
|
244
|
+
get key() {
|
|
245
|
+
return SheetCell.generateCellKey(this.sheetId, this.coords.rowIndex, this.coords.columnIndex);
|
|
246
|
+
}
|
|
247
|
+
cloneWithFormatting() {
|
|
248
|
+
// Delete cell contents
|
|
249
|
+
this.deleteContents({ preserveTextNumberFormat: true });
|
|
250
|
+
return this;
|
|
251
|
+
}
|
|
252
|
+
updateNote(note) {
|
|
253
|
+
this.note = note;
|
|
254
|
+
}
|
|
255
|
+
updateCommentThreadId(commentThreadId) {
|
|
256
|
+
this.commentThreadId = commentThreadId;
|
|
257
|
+
}
|
|
258
|
+
clearCommentThreadId() {
|
|
259
|
+
this.commentThreadId = undefined;
|
|
260
|
+
}
|
|
261
|
+
updateCitationId(citationId) {
|
|
262
|
+
this.citationId = citationId;
|
|
263
|
+
}
|
|
264
|
+
clearCitationId() {
|
|
265
|
+
this.citationId = undefined;
|
|
266
|
+
}
|
|
267
|
+
static generateCellKey(sheetId, rowIndex, columnIndex) {
|
|
268
|
+
return `${sheetId}!${cellToAddress({
|
|
269
|
+
rowIndex: rowIndex,
|
|
270
|
+
columnIndex: columnIndex,
|
|
271
|
+
})}`;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Clears the cell's content (value, formatted value, links,
|
|
275
|
+
* notes, comments, shared-string refs, etc.).
|
|
276
|
+
*
|
|
277
|
+
* Formatting behavior is intentionally Del-key-compatible by
|
|
278
|
+
* default — Excel's Delete clears value but keeps bold / fill /
|
|
279
|
+
* etc. so users don't lose their styling when they wipe a cell.
|
|
280
|
+
* Pass `clearFormat: true` for callers that want unconditional
|
|
281
|
+
* full-clear semantics (e.g. pivot tear-down regenerating cells,
|
|
282
|
+
* "Clear All" toolbar action).
|
|
283
|
+
*
|
|
284
|
+
* Even without `clearFormat`, the method still strips
|
|
285
|
+
* `userEnteredFormat` when the existing numberFormat is one of
|
|
286
|
+
* the implicit defaults (`NUMBER` with `pattern_number` /
|
|
287
|
+
* `pattern_number_thousands`, or `TEXT`) — those formats are
|
|
288
|
+
* auto-applied based on the value's type and shouldn't outlive
|
|
289
|
+
* the value. Explicit user-applied formats (bold, fill,
|
|
290
|
+
* custom number formats) are preserved.
|
|
291
|
+
*/
|
|
292
|
+
deleteContents(options) {
|
|
293
|
+
const { preserveTextNumberFormat = false, clearFormat = false, clearDataValidation = false, } = options ?? {};
|
|
294
|
+
// Stripping the validation stamp is an interactive-delete-only
|
|
295
|
+
// semantic (Del on an already-empty cell, incl. checkboxes). It must
|
|
296
|
+
// be requested explicitly — programmatic clears (changeBatch null
|
|
297
|
+
// writes, move/cut sources, fill previews) keep the validation.
|
|
298
|
+
if (clearDataValidation &&
|
|
299
|
+
!this.userEnteredValue &&
|
|
300
|
+
this.dataValidationRule) {
|
|
301
|
+
// Reset data validation
|
|
302
|
+
this.dataValidationId = undefined;
|
|
303
|
+
this.dataValidationRule = undefined;
|
|
304
|
+
}
|
|
305
|
+
this.cellData = undefined;
|
|
306
|
+
this.userEnteredValue = undefined;
|
|
307
|
+
this.effectiveValue = undefined;
|
|
308
|
+
this.formattedValue = undefined;
|
|
309
|
+
this.imageUrl = undefined;
|
|
310
|
+
this.hyperlink = undefined;
|
|
311
|
+
this.metaType = undefined;
|
|
312
|
+
this.note = undefined;
|
|
313
|
+
this.commentThreadId = undefined;
|
|
314
|
+
this.citationId = undefined;
|
|
315
|
+
this.textFormatRuns = undefined;
|
|
316
|
+
this.expandable = undefined;
|
|
317
|
+
this.expanded = undefined;
|
|
318
|
+
this.groupKeys = undefined;
|
|
319
|
+
this.version = undefined;
|
|
320
|
+
this.updatedAt = undefined;
|
|
321
|
+
this.arrayFormulaRef = undefined;
|
|
322
|
+
this.sharedFormulaSpec = undefined;
|
|
323
|
+
this.clearSharedStringIndex();
|
|
324
|
+
/**
|
|
325
|
+
* Strip userEnteredFormat. `clearFormat=true` is an
|
|
326
|
+
* unconditional wipe — used by pivot tear-down and "Clear All".
|
|
327
|
+
* Without it, only the implicit auto-applied formats go (a
|
|
328
|
+
* NUMBER cell with the default integer/thousands pattern, or
|
|
329
|
+
* a TEXT cell unless preserved). User-applied bold / fill /
|
|
330
|
+
* custom formats stay so the Del key keeps cell styling, matching
|
|
331
|
+
* Excel's behavior.
|
|
332
|
+
*/
|
|
333
|
+
if (clearFormat) {
|
|
334
|
+
this.userEnteredFormat = undefined;
|
|
335
|
+
this.originalUserEnteredFormat = undefined;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
const numberFormat = this.userEnteredFormat?.numberFormat;
|
|
339
|
+
if ((numberFormat?.type === "NUMBER" &&
|
|
340
|
+
(numberFormat.pattern === pattern_number ||
|
|
341
|
+
numberFormat?.pattern === pattern_number_thousands)) ||
|
|
342
|
+
(numberFormat?.type === "TEXT" && !preserveTextNumberFormat)) {
|
|
343
|
+
this.userEnteredFormat = undefined;
|
|
344
|
+
this.originalUserEnteredFormat = undefined;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// If there is no data validation result
|
|
348
|
+
// Preserves data validation result
|
|
349
|
+
if (!this.dataValidationRule) {
|
|
350
|
+
this.dataValidationResult = undefined;
|
|
351
|
+
}
|
|
352
|
+
this.validate();
|
|
353
|
+
}
|
|
354
|
+
deleteUserEnteredFormat() {
|
|
355
|
+
this.userEnteredFormat = undefined;
|
|
356
|
+
this.originalUserEnteredFormat = undefined;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Copy a `userEnteredFormat` from a source format onto this cell.
|
|
360
|
+
* No-op when this cell already has a format, or when the source is
|
|
361
|
+
* empty. Used by table row-expansion to propagate column-consistent
|
|
362
|
+
* formats onto newly added rows (Excel parity).
|
|
363
|
+
*/
|
|
364
|
+
inheritFormat(format) {
|
|
365
|
+
if (!format)
|
|
366
|
+
return;
|
|
367
|
+
if (this.userEnteredFormat || this.originalUserEnteredFormat)
|
|
368
|
+
return;
|
|
369
|
+
this.userEnteredFormat = isStyleReference(format) ? undefined : format;
|
|
370
|
+
this.originalUserEnteredFormat = format;
|
|
371
|
+
}
|
|
372
|
+
changeFormulaSheetName(name, oldName) {
|
|
373
|
+
if (this.formula) {
|
|
374
|
+
set(this, "userEnteredValue.fv", updateSheetName(this.formula, name, oldName));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
changeNamedRangeName(name, oldName) {
|
|
378
|
+
if (this.formula) {
|
|
379
|
+
set(this, "userEnteredValue.fv", updateNamedRangeName(this.formula, name, oldName));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
changeFormulaColumnName(name, previousName) {
|
|
383
|
+
if (this.formula) {
|
|
384
|
+
set(this, "userEnteredValue.fv", updateColumnName(this.formula, name, previousName));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
setLoading() {
|
|
388
|
+
// Preserve effectiveValue: Excel-style, the cell keeps showing the
|
|
389
|
+
// last calculated value while a recalc is in flight. getCellData only
|
|
390
|
+
// emits the "Loading..." placeholder when no prior value exists.
|
|
391
|
+
this.isLoading = true;
|
|
392
|
+
}
|
|
393
|
+
hideLoading() {
|
|
394
|
+
this.isLoading = false;
|
|
395
|
+
}
|
|
396
|
+
get formula() {
|
|
397
|
+
return getExtendedValueFormula(this.userEnteredValue);
|
|
398
|
+
}
|
|
399
|
+
get error() {
|
|
400
|
+
return getExtendedValueError(this.effectiveValue);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* True when the current value violates the cell's data-validation rule
|
|
404
|
+
* AND the rule blocks entry. Excel's default errorStyle is "stop" — only
|
|
405
|
+
* an explicit warning/information alert downgrades the rule (mirroring
|
|
406
|
+
* the agent-write guard's strictness).
|
|
407
|
+
*
|
|
408
|
+
* Unlike `validate()`, this checks the rule SYNCHRONOUSLY via
|
|
409
|
+
* `checkBooleanRule` even for condition types that `validate()` routes
|
|
410
|
+
* through the calculator (ONE_OF_LIST dropdowns etc.) — a programmatic
|
|
411
|
+
* write path needs the verdict before committing, not one calc tick
|
|
412
|
+
* later. CUSTOM_FORMULA rules (calculator-only), rules that error while
|
|
413
|
+
* evaluating, and ONE_OF_RANGE without a range resolver all fail open,
|
|
414
|
+
* matching the agent-write guard. Used by `changeBatchStream` with
|
|
415
|
+
* `skipInvalidValues` to drop the write silently; interactive editing
|
|
416
|
+
* keeps its dialog flow.
|
|
417
|
+
*/
|
|
418
|
+
get failsBlockingValidation() {
|
|
419
|
+
const rule = this.dataValidationRule;
|
|
420
|
+
if (!rule?.condition?.type) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
const style = rule.alert?.style;
|
|
424
|
+
if (style === "warning" || style === "information") {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
if (rule.condition.type === "CUSTOM_FORMULA") {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
try {
|
|
431
|
+
// Error values (a formula result like #REF!) aren't a validation
|
|
432
|
+
// concern — fail open, same as validate().
|
|
433
|
+
if (getExtendedValueError(this.effectiveValue)) {
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
const effectiveValue = this.getEffectiveValue();
|
|
437
|
+
const isBlank = effectiveValue === undefined ||
|
|
438
|
+
effectiveValue === null ||
|
|
439
|
+
(typeof effectiveValue === "string" && effectiveValue === "");
|
|
440
|
+
if (rule.allowBlank && isBlank) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
// Strict `=== false`: a rule the checker can't resolve (e.g.
|
|
444
|
+
// ONE_OF_RANGE without getRangeValues) returns undefined → fail open.
|
|
445
|
+
return (checkBooleanRule(rule, effectiveValue, undefined, this.getRangeValues, { locale: this.locale }) === false);
|
|
446
|
+
}
|
|
447
|
+
catch {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
static getRelativeFormula(value, from, to, activeSheetName = "", exclusionRange, ignoreCircular = false, rowCount, columnCount, preserveAbsolutes) {
|
|
452
|
+
if (typeof value !== "string") {
|
|
453
|
+
return undefined;
|
|
454
|
+
}
|
|
455
|
+
return formulaToRelativeReference(value, from, to, activeSheetName, {
|
|
456
|
+
exclusionRange,
|
|
457
|
+
ignoreCircular,
|
|
458
|
+
rowCount,
|
|
459
|
+
columnCount,
|
|
460
|
+
preserveAbsolutes,
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
moveFormula(from, to, activeSheetName, options) {
|
|
464
|
+
/**
|
|
465
|
+
* Moving formula does not trigger a recalc
|
|
466
|
+
* The cell dependency is updated using
|
|
467
|
+
* enqueueGraphOperation
|
|
468
|
+
*/
|
|
469
|
+
if (this.isFormula()) {
|
|
470
|
+
try {
|
|
471
|
+
const sourceFormula = this.formula;
|
|
472
|
+
let movedFormula = formulaToRelativeReference(sourceFormula, from, to, activeSheetName, options);
|
|
473
|
+
// Filling/moving formulas should also shift explicit refs like
|
|
474
|
+
// ='Sheet1'!A1 when the source and target rows/cols move.
|
|
475
|
+
const referencedSheetNames = lexify(sourceFormula)
|
|
476
|
+
.tokens.map((token) => {
|
|
477
|
+
if (token.tokenType.name === tokenVocabulary.Sheet.name) {
|
|
478
|
+
return token.image.slice(0, -1);
|
|
479
|
+
}
|
|
480
|
+
if (token.tokenType.name === tokenVocabulary.SheetQuoted.name) {
|
|
481
|
+
const desanitized = desanitizeSheetName(token.image);
|
|
482
|
+
return desanitized ? desanitized.slice(0, -1) : undefined;
|
|
483
|
+
}
|
|
484
|
+
return undefined;
|
|
485
|
+
})
|
|
486
|
+
.filter((sheetName) => Boolean(sheetName));
|
|
487
|
+
for (const sheetName of new Set(referencedSheetNames)) {
|
|
488
|
+
if (sheetName.toLowerCase() === activeSheetName.toLowerCase()) {
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
movedFormula = formulaToRelativeReference(movedFormula, from, to, sheetName, options);
|
|
492
|
+
}
|
|
493
|
+
this.userEnteredValue = { fv: movedFormula };
|
|
494
|
+
}
|
|
495
|
+
catch (err) {
|
|
496
|
+
console.log("Error moving formula", err, this.formula, from, to);
|
|
497
|
+
if (err instanceof FormulaError) {
|
|
498
|
+
this.effectiveValue = {
|
|
499
|
+
ev: {
|
|
500
|
+
type: "Error",
|
|
501
|
+
name: err.error,
|
|
502
|
+
message: err.message,
|
|
503
|
+
},
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
isFormula() {
|
|
510
|
+
return !!getExtendedValueFormula(this.userEnteredValue);
|
|
511
|
+
}
|
|
512
|
+
isStructuredReferenceFormula() {
|
|
513
|
+
// This regex matches table references like [Column], [@Column], or TableName[Column]
|
|
514
|
+
return this.formula && /(\w+\[[@]?\w+\]|\[[@]?\w+\])/.test(this.formula);
|
|
515
|
+
}
|
|
516
|
+
ephemeral() {
|
|
517
|
+
// The formula contains absolute reference or is a table
|
|
518
|
+
return this.isStructuredReferenceFormula() || this.formula?.includes("$");
|
|
519
|
+
}
|
|
520
|
+
isEmpty() {
|
|
521
|
+
return !getExtendedValueString(this.userEnteredValue);
|
|
522
|
+
}
|
|
523
|
+
isNumberType(numType) {
|
|
524
|
+
return [
|
|
525
|
+
"NUMBER",
|
|
526
|
+
"CURRENCY",
|
|
527
|
+
"PERCENT",
|
|
528
|
+
"ACCOUNTING",
|
|
529
|
+
"FRACTION",
|
|
530
|
+
"SCIENTIFIC",
|
|
531
|
+
].includes(numType);
|
|
532
|
+
}
|
|
533
|
+
changeDecimals(delta = 1) {
|
|
534
|
+
// Read through getNumberFormat so we pick up `uf.numberFormat` when
|
|
535
|
+
// `effectiveFormat` is empty (which is the common case now that `ef`
|
|
536
|
+
// is no longer persisted on cellData).
|
|
537
|
+
const currentNumberFormat = this.getNumberFormat();
|
|
538
|
+
const effectiveNumberType = currentNumberFormat?.type;
|
|
539
|
+
const isNumber = this.isNumberType(effectiveNumberType);
|
|
540
|
+
const effectiveValue = getExtendedValueNumber(this.effectiveValue);
|
|
541
|
+
const isGeneralNumber = effectiveNumberType === undefined || effectiveNumberType === "GENERAL";
|
|
542
|
+
const effectivePattern = currentNumberFormat?.pattern === "General"
|
|
543
|
+
? undefined
|
|
544
|
+
: currentNumberFormat?.pattern;
|
|
545
|
+
// Blank cells stay editable when they carry an explicit numeric pattern
|
|
546
|
+
// (e.g. whole-column formatting), so later entries inherit the adjusted
|
|
547
|
+
// precision. Blank General cells have nothing to adjust.
|
|
548
|
+
if ((!isNumber && !isGeneralNumber) ||
|
|
549
|
+
(typeof effectiveValue !== "number" && !(isNumber && effectivePattern))) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
const finalNumberType = isGeneralNumber ? "NUMBER" : effectiveNumberType;
|
|
553
|
+
const finalPattern = effectivePattern
|
|
554
|
+
? effectivePattern
|
|
555
|
+
: changeDecimals(pattern_number, Math.min(
|
|
556
|
+
// The guard above ensures effectiveValue is a number whenever
|
|
557
|
+
// effectivePattern is falsy, so the 0 fallback is unreachable —
|
|
558
|
+
// it only narrows the type for getDecimalPlaces.
|
|
559
|
+
getDecimalPlaces(this.formattedValue ?? effectiveValue ?? 0, this.locale), 3), false);
|
|
560
|
+
const pattern = changeDecimals(finalPattern, delta);
|
|
561
|
+
if (pattern) {
|
|
562
|
+
if (typeof effectiveValue === "number") {
|
|
563
|
+
this.formattedValue = createFormattedValue(effectiveValue, "numberValue", pattern, this.locale);
|
|
564
|
+
}
|
|
565
|
+
if (!this.userEnteredFormat) {
|
|
566
|
+
this.userEnteredFormat = {};
|
|
567
|
+
}
|
|
568
|
+
this.userEnteredFormat.numberFormat = {
|
|
569
|
+
type: finalNumberType,
|
|
570
|
+
pattern,
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
decreaseDecimals() {
|
|
575
|
+
this.changeDecimals(-1);
|
|
576
|
+
}
|
|
577
|
+
increaseDecimals() {
|
|
578
|
+
this.changeDecimals(1);
|
|
579
|
+
}
|
|
580
|
+
setBorder(position, border) {
|
|
581
|
+
this.ensureUserEnteredFormatMutable();
|
|
582
|
+
if (!this.userEnteredFormat) {
|
|
583
|
+
this.userEnteredFormat = {};
|
|
584
|
+
}
|
|
585
|
+
const existing = this.userEnteredFormat.borders;
|
|
586
|
+
const borders = existing && Object.isExtensible(existing)
|
|
587
|
+
? existing
|
|
588
|
+
: { ...(existing ?? {}) };
|
|
589
|
+
this.userEnteredFormat.borders = borders;
|
|
590
|
+
if (!border.color) {
|
|
591
|
+
// User is trying to clear the border
|
|
592
|
+
delete borders[position];
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
if (isNil(border)) {
|
|
596
|
+
delete borders[position];
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
borders[position] = border;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
setUserEnteredBorder(position, border) {
|
|
604
|
+
this.ensureUserEnteredFormatMutable();
|
|
605
|
+
if (!this.userEnteredFormat) {
|
|
606
|
+
this.userEnteredFormat = {};
|
|
607
|
+
}
|
|
608
|
+
const existing = this.userEnteredFormat.borders;
|
|
609
|
+
const borders = existing && Object.isExtensible(existing)
|
|
610
|
+
? existing
|
|
611
|
+
: { ...(existing ?? {}) };
|
|
612
|
+
this.userEnteredFormat.borders = borders;
|
|
613
|
+
if (!border.color) {
|
|
614
|
+
// User is trying to clear the border
|
|
615
|
+
delete borders[position];
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
if (isNil(border)) {
|
|
619
|
+
delete borders[position];
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
borders[position] = border;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
setAllBorders(border) {
|
|
627
|
+
// User is trying to clear the border
|
|
628
|
+
if (!border.color) {
|
|
629
|
+
this.clearAllBorders();
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
set(this, "userEnteredFormat.borders", {
|
|
633
|
+
top: border,
|
|
634
|
+
bottom: border,
|
|
635
|
+
left: border,
|
|
636
|
+
right: border,
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
clearAllBorders() {
|
|
641
|
+
if (this.userEnteredFormat) {
|
|
642
|
+
this.userEnteredFormat.borders = undefined;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
setImage(imageUrl) {
|
|
646
|
+
this.imageUrl = imageUrl;
|
|
647
|
+
this.userEnteredValue = undefined;
|
|
648
|
+
this.hyperlink = undefined;
|
|
649
|
+
this.formattedValue = "";
|
|
650
|
+
}
|
|
651
|
+
isMultiline() {
|
|
652
|
+
return isMultiline(this.getUserEnteredValue());
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Over write formatted value
|
|
656
|
+
* @param value
|
|
657
|
+
*/
|
|
658
|
+
setFormattedValue(value) {
|
|
659
|
+
this.formattedValue = value;
|
|
660
|
+
}
|
|
661
|
+
setUserEnteredValue(value, textFormatRuns, options) {
|
|
662
|
+
if (value === "" || isNil(value)) {
|
|
663
|
+
this.clearUserEnteredValue();
|
|
664
|
+
return this;
|
|
665
|
+
}
|
|
666
|
+
// Ensure new entries can replace the previously formatted value (e.g. hyperlinks)
|
|
667
|
+
this.formattedValue = undefined;
|
|
668
|
+
// SDK / programmatic-write path: trust the caller's explicit JS type
|
|
669
|
+
// (matches stock openpyxl / Excel-Java behavior — a Python string
|
|
670
|
+
// stays a string, a Python datetime is pre-converted by the SDK and
|
|
671
|
+
// arrives as a numberValue with the appropriate numberFormat already
|
|
672
|
+
// staged by a separate ``SetCellStyle`` command). Skips the markdown,
|
|
673
|
+
// ``@``-prefix, leading-``+``, and ``detectValueTypeAndPattern``
|
|
674
|
+
// coercions that the cell-editor UX relies on.
|
|
675
|
+
if (options?.disableTypeInference) {
|
|
676
|
+
// eslint-disable-next-line no-console
|
|
677
|
+
const inferredType = typeof value === "boolean"
|
|
678
|
+
? "boolValue"
|
|
679
|
+
: typeof value === "number"
|
|
680
|
+
? "numberValue"
|
|
681
|
+
: "stringValue";
|
|
682
|
+
// For numeric values, set ``numberFormatType="NUMBER"`` so the cell
|
|
683
|
+
// doesn't get auto-interned as a shared string. ``setNumberValue``
|
|
684
|
+
// stores ``userEnteredValue.sv`` with the string representation of
|
|
685
|
+
// the number; without a non-falsy ``numberFormat.type``,
|
|
686
|
+
// ``shouldUseSharedStrings`` treats the cell as a string and the
|
|
687
|
+
// shared-string registry promotes it to ``ss``. That in turn makes
|
|
688
|
+
// a subsequent ``SetCellStyle`` with a ``numberFormat`` (e.g.
|
|
689
|
+
// ``"$#,##0.00"``) early-return inside ``setNumberFormat``
|
|
690
|
+
// (the ``!isNil(sharedStringIndex) && numberFormatType !== "TEXT"``
|
|
691
|
+
// guard), so the user's currency / percent / date pattern never
|
|
692
|
+
// lands on the cell. Stamping ``NUMBER`` here mirrors what
|
|
693
|
+
// ``detectValueTypeAndPattern`` does for a plain integer / float
|
|
694
|
+
// — only the auto-detected ``pattern`` is left undefined, so the
|
|
695
|
+
// SDK-supplied ``SetCellStyle`` is authoritative.
|
|
696
|
+
const inferredFormatType = typeof value === "number" ? "NUMBER" : undefined;
|
|
697
|
+
this.setUserEnteredValueByType(inferredType, value, textFormatRuns, inferredFormatType, typeof value === "number" ? value : undefined, undefined, undefined);
|
|
698
|
+
if (!this.isFormula()) {
|
|
699
|
+
this.validate();
|
|
700
|
+
}
|
|
701
|
+
this.setVersion((this.version ?? 0) + 1);
|
|
702
|
+
this.setUpdatedAt(Date.now());
|
|
703
|
+
return this;
|
|
704
|
+
}
|
|
705
|
+
const originalValue = value;
|
|
706
|
+
let normalizedValue = value;
|
|
707
|
+
let forceStringFromPrefix = false;
|
|
708
|
+
if (hasExcelTextPrefix(normalizedValue)) {
|
|
709
|
+
normalizedValue = stripExcelTextPrefix(normalizedValue);
|
|
710
|
+
forceStringFromPrefix = true;
|
|
711
|
+
}
|
|
712
|
+
if (typeof normalizedValue === "string" &&
|
|
713
|
+
normalizedValue.startsWith("+") &&
|
|
714
|
+
!isAlternateFormula(normalizedValue)) {
|
|
715
|
+
const plusTrimmed = normalizedValue.slice(1).trim();
|
|
716
|
+
if (isNumber(plusTrimmed, this.locale, this.lenientGrouping)) {
|
|
717
|
+
normalizedValue = plusTrimmed;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
const forceMarkdownText = typeof normalizedValue === "string" && looksLikeMarkdown(normalizedValue);
|
|
721
|
+
const startsWithAt = typeof normalizedValue === "string" && normalizedValue.startsWith("@");
|
|
722
|
+
const forceStringFromAtPrefix = startsWithAt && !this.enableAtFormula;
|
|
723
|
+
const dataValuePattern = forceMarkdownText
|
|
724
|
+
? ["stringValue"]
|
|
725
|
+
: forceStringFromAtPrefix
|
|
726
|
+
? ["stringValue"]
|
|
727
|
+
: this.enableAtFormula && startsWithAt
|
|
728
|
+
? ["formulaValue"]
|
|
729
|
+
: detectValueTypeAndPattern(normalizedValue, this.locale, this.lenientGrouping, this.use1904);
|
|
730
|
+
const [valueType, , numberValue, newPattern] = dataValuePattern;
|
|
731
|
+
// User forced this cell to be a text
|
|
732
|
+
const forceStringValue = this.isText(this.userEnteredFormat?.numberFormat);
|
|
733
|
+
const finalValueType = forceStringValue ||
|
|
734
|
+
forceStringFromPrefix ||
|
|
735
|
+
forceMarkdownText ||
|
|
736
|
+
forceStringFromAtPrefix
|
|
737
|
+
? "stringValue"
|
|
738
|
+
: valueType;
|
|
739
|
+
const numberFormatType = dataValuePattern[1];
|
|
740
|
+
this.setUserEnteredValueByType(finalValueType, normalizedValue, textFormatRuns, numberFormatType, numberValue, newPattern, forceStringFromPrefix ? originalValue : undefined);
|
|
741
|
+
// Validate
|
|
742
|
+
// Formula cells preserve their prior effectiveValue across an edit
|
|
743
|
+
// (Excel-like behavior), so guarding on `getEffectiveValue()` would
|
|
744
|
+
// validate against the *stale* value. Defer validation for formulas
|
|
745
|
+
// entirely — calc-success drives it via setDataValidationResult.
|
|
746
|
+
if (!this.isFormula()) {
|
|
747
|
+
this.validate();
|
|
748
|
+
}
|
|
749
|
+
this.setVersion((this.version ?? 0) + 1);
|
|
750
|
+
this.setUpdatedAt(Date.now());
|
|
751
|
+
return this;
|
|
752
|
+
}
|
|
753
|
+
clearUserEnteredValue() {
|
|
754
|
+
this.userEnteredValue = undefined;
|
|
755
|
+
this.formattedValue = undefined;
|
|
756
|
+
this.textFormatRuns = undefined;
|
|
757
|
+
this.clearSharedStringIndex();
|
|
758
|
+
// Remove effective value too
|
|
759
|
+
this.effectiveValue = undefined;
|
|
760
|
+
}
|
|
761
|
+
clearEffectiveValueForFormula() {
|
|
762
|
+
// Remove effective value
|
|
763
|
+
this.effectiveValue = undefined;
|
|
764
|
+
this.textFormatRuns = undefined;
|
|
765
|
+
this.formattedValue = "";
|
|
766
|
+
}
|
|
767
|
+
setUserEnteredValueByType(valueType, value, textFormatRuns, numberFormatType, numberValue, newPattern, originalStringValue) {
|
|
768
|
+
switch (valueType) {
|
|
769
|
+
case "boolValue":
|
|
770
|
+
this.setBooleanValue(value);
|
|
771
|
+
break;
|
|
772
|
+
case "numberValue":
|
|
773
|
+
this.setNumberValue(value, numberFormatType, numberValue, newPattern);
|
|
774
|
+
break;
|
|
775
|
+
case "formulaValue":
|
|
776
|
+
this.setFormulaValue(value);
|
|
777
|
+
break;
|
|
778
|
+
case "stringValue":
|
|
779
|
+
// Check if its url (unless original prefix forced plain text)
|
|
780
|
+
if (!originalStringValue && isValidURLorEmail(value)) {
|
|
781
|
+
// A fresh user entry replaces whatever string the cell held.
|
|
782
|
+
// `setHyperlink`'s no-title branch deliberately leaves the
|
|
783
|
+
// shared-string index alone (it also runs during hydration),
|
|
784
|
+
// so drop it here — otherwise `getCellData` keeps serializing
|
|
785
|
+
// the old SST slot and the cell renders the previous URL.
|
|
786
|
+
this.clearSharedStringIndex();
|
|
787
|
+
this.setUrl(value);
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
this.setStringValue(value, textFormatRuns, originalStringValue);
|
|
791
|
+
}
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
ensureUserEnteredFormatMutable() {
|
|
796
|
+
if (this.userEnteredFormat &&
|
|
797
|
+
!Object.isExtensible(this.userEnteredFormat)) {
|
|
798
|
+
this.userEnteredFormat = { ...this.userEnteredFormat };
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
ensureFormatsMutable() {
|
|
802
|
+
this.ensureUserEnteredFormatMutable();
|
|
803
|
+
}
|
|
804
|
+
setBooleanValue(value) {
|
|
805
|
+
this.clearSharedStringIndex();
|
|
806
|
+
const effectiveValue = String(value).toUpperCase() === "TRUE";
|
|
807
|
+
set(this, "userEnteredValue", { bv: effectiveValue });
|
|
808
|
+
set(this, "effectiveValue", { bv: effectiveValue });
|
|
809
|
+
this.formattedValue = createFormattedValue(value, "boolValue", this.defaultPattern, this.locale);
|
|
810
|
+
this.ensureFormatsMutable();
|
|
811
|
+
// Excel parity: the cell's existing number format survives a boolean
|
|
812
|
+
// entry — re-typing a number later restores the styled display. Wiping
|
|
813
|
+
// `uf.numberFormat` here would silently drop a user-applied custom
|
|
814
|
+
// format the moment TRUE/FALSE was written.
|
|
815
|
+
}
|
|
816
|
+
setNumberValue(value, numberFormatType, numberValue, newPattern) {
|
|
817
|
+
this.clearSharedStringIndex();
|
|
818
|
+
// Read through getNumberFormat so we pick up either `uf.numberFormat`
|
|
819
|
+
// or the in-memory `effectiveFormat.numberFormat` (legacy `ef`-only
|
|
820
|
+
// cells loaded from older saved data populate effectiveFormat in
|
|
821
|
+
// assign()). Without this, editing a legacy ef-only currency cell
|
|
822
|
+
// would silently drop CURRENCY back to NUMBER.
|
|
823
|
+
const existingFormat = this.getNumberFormat();
|
|
824
|
+
let finalFormatType = numberFormatType;
|
|
825
|
+
let finalPattern = newPattern;
|
|
826
|
+
if (existingFormat?.type === "TEXT") {
|
|
827
|
+
finalFormatType = "TEXT";
|
|
828
|
+
finalPattern = existingFormat.pattern ?? finalPattern;
|
|
829
|
+
}
|
|
830
|
+
// Excel-like behavior: Preserve existing format when entering plain numbers
|
|
831
|
+
if (existingFormat &&
|
|
832
|
+
this.shouldPreserveExistingFormat(numberFormatType, existingFormat, newPattern, numberValue)) {
|
|
833
|
+
finalFormatType = existingFormat.type;
|
|
834
|
+
finalPattern = existingFormat.pattern ?? undefined;
|
|
835
|
+
}
|
|
836
|
+
// Calculate string value for user entered value
|
|
837
|
+
const stringValue = this.getStringValueForFormat(value, numberValue, finalFormatType);
|
|
838
|
+
// Create formatted display value
|
|
839
|
+
this.formattedValue = createFormattedValue(numberValue, "numberValue", finalPattern ?? this.defaultPattern, this.locale);
|
|
840
|
+
// Set values and alignment
|
|
841
|
+
if (finalFormatType === "TEXT") {
|
|
842
|
+
this.formattedValue = createFormattedValue(String(value), "stringValue", finalPattern ?? this.defaultPattern, this.locale);
|
|
843
|
+
set(this, "userEnteredValue", { sv: String(value) });
|
|
844
|
+
set(this, "effectiveValue", { sv: String(value) });
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
const userString = typeof value === "string" && finalFormatType === "NUMBER"
|
|
848
|
+
? this.normalizeUserEnteredNumber(value)
|
|
849
|
+
: typeof value === "string" && finalFormatType === "SCIENTIFIC"
|
|
850
|
+
? stringValue // Use expanded numeric string for scientific notation
|
|
851
|
+
: typeof value === "string"
|
|
852
|
+
? value
|
|
853
|
+
: stringValue;
|
|
854
|
+
set(this, "userEnteredValue", { sv: userString });
|
|
855
|
+
set(this, "effectiveValue", { nv: numberValue });
|
|
856
|
+
}
|
|
857
|
+
// Apply number format if specified — uf only.
|
|
858
|
+
if (finalFormatType) {
|
|
859
|
+
set(this, "userEnteredFormat.numberFormat.type", finalFormatType);
|
|
860
|
+
set(this, "userEnteredFormat.numberFormat.pattern", finalPattern);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
normalizeUserEnteredNumber(value) {
|
|
864
|
+
const { group } = getLocaleSeparators(this.locale);
|
|
865
|
+
if (!group) {
|
|
866
|
+
return value;
|
|
867
|
+
}
|
|
868
|
+
const isWhitespaceGroup = group.trim() === "";
|
|
869
|
+
if (isWhitespaceGroup) {
|
|
870
|
+
return value.replace(/[\s\u00A0\u202F]/g, "");
|
|
871
|
+
}
|
|
872
|
+
const escaped = group.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
873
|
+
return value.replace(new RegExp(escaped, "g"), "");
|
|
874
|
+
}
|
|
875
|
+
shouldPreserveExistingFormat(newFormatType, existingFormat, _newPattern, _numberValue) {
|
|
876
|
+
// Excel rule, in three layers:
|
|
877
|
+
// 1. General cell → defer to the typed value's
|
|
878
|
+
// inferred format
|
|
879
|
+
// 2. Plain NUMBER input → preserve any non-General format
|
|
880
|
+
// 3. Explicit-format input → preserve only when the
|
|
881
|
+
// (Currency / Percent / Date) existing format is in the same
|
|
882
|
+
// category, else switch
|
|
883
|
+
if (isGeneralNumberFormat(existingFormat))
|
|
884
|
+
return false;
|
|
885
|
+
if (!newFormatType || newFormatType === "NUMBER")
|
|
886
|
+
return true;
|
|
887
|
+
// Specific data state: General type combined with a non-General
|
|
888
|
+
// pattern is the exact shape the Custom-format dialog produces.
|
|
889
|
+
// Excel's auto-format paths always stamp a named type (CURRENCY,
|
|
890
|
+
// PERCENT, DATE, …), so a pattern paired with a General type can
|
|
891
|
+
// only have come from explicit user action (dialog or programmatic).
|
|
892
|
+
// Respect it across all inputs.
|
|
893
|
+
if (hasGeneralType(existingFormat) && !hasGeneralPattern(existingFormat)) {
|
|
894
|
+
return true;
|
|
895
|
+
}
|
|
896
|
+
// Cross-category transitions — resolve the existing format's
|
|
897
|
+
// effective category, falling back to pattern inference for
|
|
898
|
+
// pattern-only formats imported from xlsx.
|
|
899
|
+
const effectiveType = !hasGeneralType(existingFormat)
|
|
900
|
+
? existingFormat.type
|
|
901
|
+
: this.isDateTime(existingFormat)
|
|
902
|
+
? "DATE_TIME"
|
|
903
|
+
: this.isDate(existingFormat)
|
|
904
|
+
? "DATE"
|
|
905
|
+
: "NUMBER";
|
|
906
|
+
return effectiveType === newFormatType;
|
|
907
|
+
}
|
|
908
|
+
getStringValueForFormat(value, numberValue, formatType) {
|
|
909
|
+
const isDate = this.isDate(formatType ? { type: formatType } : undefined);
|
|
910
|
+
const isDateTime = this.isDateTime(formatType ? { type: formatType } : undefined);
|
|
911
|
+
if (isDate || isDateTime) {
|
|
912
|
+
return createFormattedValue(numberValue, "numberValue", isDate ? getDefaultDateFormat(this.locale) : getDefaultTimeFormat(this.locale), this.locale);
|
|
913
|
+
}
|
|
914
|
+
if (formatType === "PERCENT") {
|
|
915
|
+
return value; // Show user entered value for percent
|
|
916
|
+
}
|
|
917
|
+
return String(numberValue);
|
|
918
|
+
}
|
|
919
|
+
setFormulaValue(formulaValue, clearEffectiveValue = false) {
|
|
920
|
+
if (formulaValue.startsWith("@") && !this.enableAtFormula) {
|
|
921
|
+
this.setStringValue(formulaValue);
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
// A leading "==" can never start a valid formula expression (Excel/Sheets
|
|
925
|
+
// have no token for it), so values like "=== COMP DRIVERS ===" are label
|
|
926
|
+
// text, not formulas. Store them as a plain string rather than handing a
|
|
927
|
+
// never-parseable expression to the calculator. Mirrors the "@" guard
|
|
928
|
+
// above and the matching `isAFormula` classification.
|
|
929
|
+
if (formulaValue.startsWith("==")) {
|
|
930
|
+
this.setStringValue(formulaValue);
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
this.clearSharedStringIndex();
|
|
934
|
+
// Balance parenthesis
|
|
935
|
+
formulaValue = balanceFormula(formulaValue);
|
|
936
|
+
// Sanitize formula
|
|
937
|
+
if (formulaValue.startsWith("@")) {
|
|
938
|
+
formulaValue = `=${formulaValue.slice(1)}`;
|
|
939
|
+
}
|
|
940
|
+
else if (isAlternateFormula(formulaValue)) {
|
|
941
|
+
// If it starts with @, replace it with =
|
|
942
|
+
formulaValue = `=${formulaValue}`;
|
|
943
|
+
}
|
|
944
|
+
// Convert escaped quotes \\" or \" to Excel's doubled quote format ""
|
|
945
|
+
formulaValue = formulaValue.replace(/\\+"/g, '""');
|
|
946
|
+
// Convert newline escape sequences to CHAR(10) function
|
|
947
|
+
formulaValue = formulaValue.replace(/\\n/g, '"&CHAR(10)&"');
|
|
948
|
+
// Drop xlsx round-trip provenance — the user is supplying a brand-new
|
|
949
|
+
// formula, so any source-side `<f t="array" ref="…">` or
|
|
950
|
+
// `<f t="shared" si="…">` grouping no longer applies. Without this,
|
|
951
|
+
// the exporter would replay the stale marker and either:
|
|
952
|
+
// (a) write `<f t="array" ref="G7:G10">USER_FORMULA</f>` and spill
|
|
953
|
+
// the user's edit across cells that weren't part of the source
|
|
954
|
+
// array, or
|
|
955
|
+
// (b) emit `<f t="shared" si="N"/>` (self-closing, no formula text)
|
|
956
|
+
// and lose the user's new expression entirely.
|
|
957
|
+
// Editing a cell formula is the canonical "detach from group" action,
|
|
958
|
+
// mirroring how Excel breaks the grouping on in-place edits.
|
|
959
|
+
this.arrayFormulaRef = undefined;
|
|
960
|
+
this.sharedFormulaSpec = undefined;
|
|
961
|
+
// Set user entered value
|
|
962
|
+
this.userEnteredValue = { fv: formulaValue };
|
|
963
|
+
// Clear
|
|
964
|
+
if (clearEffectiveValue) {
|
|
965
|
+
if (isValidFormula(formulaValue)) {
|
|
966
|
+
this.clearEffectiveValueForFormula();
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
this.formattedValue = formulaValue;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
setStringValue(stringValue, textFormatRuns, userEnteredStringValue) {
|
|
974
|
+
this.clearSharedStringIndex();
|
|
975
|
+
this.ensureFormatsMutable();
|
|
976
|
+
const coercedValue = String(stringValue);
|
|
977
|
+
const userValue = userEnteredStringValue ?? coercedValue;
|
|
978
|
+
set(this, "userEnteredValue", { sv: userValue });
|
|
979
|
+
set(this, "effectiveValue", { sv: coercedValue });
|
|
980
|
+
// Excel parity: the cell's existing pattern still applies to text. A
|
|
981
|
+
// 4-section custom format like `[Blue]#,##0.00;[Red]-#,##0.00;[Green]"zero";[Magenta]@`
|
|
982
|
+
// uses its `@` (segment 4) branch for string values, so the literal
|
|
983
|
+
// prefixes / suffixes around `@` (e.g. `"Note: "@` → `Note: hello`) and
|
|
984
|
+
// any `[Color]` directive in that segment must flow through. Falling
|
|
985
|
+
// back to `defaultPattern` here would silently drop them.
|
|
986
|
+
const pattern = this.userEnteredFormat?.numberFormat?.pattern ?? this.defaultPattern;
|
|
987
|
+
this.formattedValue = createFormattedValue(coercedValue, "stringValue", pattern, this.locale);
|
|
988
|
+
this.textFormatRuns = textFormatRuns;
|
|
989
|
+
// Don't clear `uf.numberFormat` here. Excel preserves the cell's number
|
|
990
|
+
// format when text is entered — re-typing a number later restores the
|
|
991
|
+
// styled display, and the `@` section of the existing pattern still
|
|
992
|
+
// formats the current text value. The previous "delete unless TEXT"
|
|
993
|
+
// branch nuked any user-applied custom format the moment a string was
|
|
994
|
+
// written, which also broke the per-section color path at render time.
|
|
995
|
+
}
|
|
996
|
+
getSharedStringCandidate() {
|
|
997
|
+
return (getExtendedValueString(this.userEnteredValue) ??
|
|
998
|
+
getExtendedValueString(this.effectiveValue));
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Runs attached to this cell at write-time. The shared-string
|
|
1002
|
+
* registry calls this to decide whether to intern a plain or rich
|
|
1003
|
+
* SST entry. Returns `undefined` when the cell has no per-segment
|
|
1004
|
+
* formatting (plain interning path stays unchanged).
|
|
1005
|
+
*/
|
|
1006
|
+
getSharedStringRichRuns() {
|
|
1007
|
+
if (!this.textFormatRuns || this.textFormatRuns.length === 0) {
|
|
1008
|
+
return undefined;
|
|
1009
|
+
}
|
|
1010
|
+
return this.textFormatRuns;
|
|
1011
|
+
}
|
|
1012
|
+
shouldUseSharedStrings(candidate) {
|
|
1013
|
+
if (!candidate || candidate === "") {
|
|
1014
|
+
return false;
|
|
1015
|
+
}
|
|
1016
|
+
if (hasExcelTextPrefix(candidate)) {
|
|
1017
|
+
return false;
|
|
1018
|
+
}
|
|
1019
|
+
if (this.isFormula()) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
// The cell's effective value is numeric (or boolean) — the candidate
|
|
1023
|
+
// string is just a serialized form of a real number. Promoting it to
|
|
1024
|
+
// the SST would replace `ev.nv` with `ev.sv` on hydration, turning a
|
|
1025
|
+
// genuine number into a text cell. That's exactly how `-12` typed
|
|
1026
|
+
// into a `[Blue]…;[Red]-…;[Green]…;[Magenta]@` custom-format cell
|
|
1027
|
+
// ended up rendered in magenta and left-aligned: the renderer saw a
|
|
1028
|
+
// string and routed it through the `@` section instead of the
|
|
1029
|
+
// negative-number section. This single guard is sufficient — a
|
|
1030
|
+
// *text* value in the same custom-pattern cell still goes to the SST
|
|
1031
|
+
// normally (no `ev.nv` to protect), which keeps xlsx export's
|
|
1032
|
+
// string-interning optimization intact for the long-text case.
|
|
1033
|
+
if (this.effectiveValue &&
|
|
1034
|
+
(getExtendedValueNumber(this.effectiveValue) !== undefined ||
|
|
1035
|
+
getExtendedValueBool(this.effectiveValue) !== undefined)) {
|
|
1036
|
+
return false;
|
|
1037
|
+
}
|
|
1038
|
+
const numberFormat = this.userEnteredFormat?.numberFormat;
|
|
1039
|
+
const numberFormatType = numberFormat?.type;
|
|
1040
|
+
// A pattern-only format (no `type`) imported from xlsx still carries
|
|
1041
|
+
// semantic intent. If the pattern is date/datetime/time, the cell is
|
|
1042
|
+
// numeric in Excel's eyes — promoting it to the SST would lose that
|
|
1043
|
+
// and re-emit the value as a literal text serial on save.
|
|
1044
|
+
if (!numberFormatType && numberFormat?.pattern) {
|
|
1045
|
+
if (isDatePattern(numberFormat.pattern) ||
|
|
1046
|
+
isDateTimePattern(numberFormat.pattern)) {
|
|
1047
|
+
return false;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
return (numberFormatType === undefined ||
|
|
1051
|
+
numberFormatType === "GENERAL" ||
|
|
1052
|
+
numberFormatType === "TEXT");
|
|
1053
|
+
}
|
|
1054
|
+
getSharedStringIndex() {
|
|
1055
|
+
return this.sharedStringIndex;
|
|
1056
|
+
}
|
|
1057
|
+
applySharedStringIndex(index) {
|
|
1058
|
+
this.sharedStringIndex = index ?? undefined;
|
|
1059
|
+
}
|
|
1060
|
+
clearSharedStringIndex() {
|
|
1061
|
+
this.sharedStringIndex = undefined;
|
|
1062
|
+
}
|
|
1063
|
+
hydrateSharedStringValue(index) {
|
|
1064
|
+
const strings = this.sharedStrings ?? SheetCell.defaultSharedStrings ?? undefined;
|
|
1065
|
+
if (!strings) {
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const rawValue = strings instanceof Map
|
|
1069
|
+
? strings.get(String(index))
|
|
1070
|
+
: Array.isArray(strings)
|
|
1071
|
+
? strings[Number(index)]
|
|
1072
|
+
: undefined;
|
|
1073
|
+
// SharedStrings may hold a plain string OR a rich `{text, runs}`
|
|
1074
|
+
// object. Either way we surface the plain text into `ue.sv` and
|
|
1075
|
+
// hydrate the cell's `textFormatRuns` from the rich runs when
|
|
1076
|
+
// present — so a cell loaded from a rich SST entry already
|
|
1077
|
+
// carries the runs without a second lookup at render time.
|
|
1078
|
+
let value;
|
|
1079
|
+
if (typeof rawValue === "string") {
|
|
1080
|
+
value = rawValue;
|
|
1081
|
+
}
|
|
1082
|
+
else if (rawValue &&
|
|
1083
|
+
typeof rawValue === "object" &&
|
|
1084
|
+
typeof rawValue.text === "string") {
|
|
1085
|
+
value = rawValue.text;
|
|
1086
|
+
const richRuns = rawValue.runs;
|
|
1087
|
+
if (Array.isArray(richRuns) && richRuns.length > 0) {
|
|
1088
|
+
this.textFormatRuns = richRuns;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (value === undefined) {
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
|
|
1098
|
+
this.userEnteredValue = { sv: value };
|
|
1099
|
+
if (!hasEffectiveError) {
|
|
1100
|
+
this.effectiveValue = { sv: value };
|
|
1101
|
+
}
|
|
1102
|
+
this.formattedValue =
|
|
1103
|
+
this.formattedValue ??
|
|
1104
|
+
createFormattedValue(value, "stringValue", this.defaultPattern, this.locale);
|
|
1105
|
+
}
|
|
1106
|
+
validate() {
|
|
1107
|
+
// Validation
|
|
1108
|
+
if (this.dataValidationRule) {
|
|
1109
|
+
try {
|
|
1110
|
+
const isFormulaRule = isDataValidationFormulaRule(this.dataValidationRule);
|
|
1111
|
+
const allowBlank = this.dataValidationRule.allowBlank;
|
|
1112
|
+
const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
|
|
1113
|
+
const effectiveValue = this.getEffectiveValue();
|
|
1114
|
+
const isBlank = !hasEffectiveError &&
|
|
1115
|
+
(effectiveValue === undefined ||
|
|
1116
|
+
effectiveValue === null ||
|
|
1117
|
+
(typeof effectiveValue === "string" && effectiveValue === ""));
|
|
1118
|
+
const isValid = allowBlank && isBlank
|
|
1119
|
+
? true
|
|
1120
|
+
: isFormulaRule
|
|
1121
|
+
? this.dataValidationResult === undefined
|
|
1122
|
+
? true
|
|
1123
|
+
: Boolean(this.dataValidationResult)
|
|
1124
|
+
: checkBooleanRule(this.dataValidationRule, effectiveValue, undefined, this.getRangeValues, { locale: this.locale });
|
|
1125
|
+
if (!isValid) {
|
|
1126
|
+
// Excel parity: a value that fails data validation is *flagged*,
|
|
1127
|
+
// not erased. The cell keeps showing its `sv` / `nv` / `bv` and
|
|
1128
|
+
// gets a red indicator (sourced from the `ev.ev` invalid marker).
|
|
1129
|
+
// Previously this replaced the entire effectiveValue with just
|
|
1130
|
+
// `{ev: ...}`, which destroyed the user's data the moment a
|
|
1131
|
+
// validation rule was applied to a non-matching cell.
|
|
1132
|
+
set(this, "effectiveValue.ev", {
|
|
1133
|
+
message: "This cell's contents violate its validation rule",
|
|
1134
|
+
type: "Invalid",
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
else {
|
|
1138
|
+
delete this.effectiveValue?.ev;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
catch (err) {
|
|
1142
|
+
set(this, "effectiveValue.ev", {
|
|
1143
|
+
type: "Error",
|
|
1144
|
+
name: err instanceof FormulaError ? err.error : "#ERROR!",
|
|
1145
|
+
message: String(err),
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
else {
|
|
1150
|
+
delete this.effectiveValue?.ev;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
setConditionalFormatResult(ruleId, value) {
|
|
1154
|
+
if (!this.conditionalFormattingResultById) {
|
|
1155
|
+
this.conditionalFormattingResultById = {};
|
|
1156
|
+
}
|
|
1157
|
+
this.conditionalFormattingResultById[ruleId] = value;
|
|
1158
|
+
}
|
|
1159
|
+
clearConditionalFormatResults() {
|
|
1160
|
+
this.conditionalFormattingResultById = undefined;
|
|
1161
|
+
}
|
|
1162
|
+
setDataValidationResult(value) {
|
|
1163
|
+
this.dataValidationResult = value;
|
|
1164
|
+
// Validate
|
|
1165
|
+
this.validate();
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Refresh formatted value
|
|
1169
|
+
* from effective value and effective format
|
|
1170
|
+
*/
|
|
1171
|
+
refreshFormattedValue() {
|
|
1172
|
+
const effectiveValue = this.getEffectiveValue();
|
|
1173
|
+
if (isNil(effectiveValue)) {
|
|
1174
|
+
this.formattedValue = undefined;
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
const valueType = detectValueType(effectiveValue, this.locale, this.lenientGrouping);
|
|
1178
|
+
switch (valueType) {
|
|
1179
|
+
case "numberValue":
|
|
1180
|
+
this.formattedValue = createFormattedValue(effectiveValue, "numberValue", this.getNumberFormat()?.pattern ?? this.defaultPattern, this.locale);
|
|
1181
|
+
break;
|
|
1182
|
+
case "boolValue":
|
|
1183
|
+
this.setEffectiveBooleanValue(effectiveValue);
|
|
1184
|
+
break;
|
|
1185
|
+
case "stringValue":
|
|
1186
|
+
default:
|
|
1187
|
+
this.setEffectiveStringValue(effectiveValue);
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
setEffectiveValue(value, isPreview = false, preserveStringLiteral = false) {
|
|
1192
|
+
// Hide loading
|
|
1193
|
+
this.hideLoading();
|
|
1194
|
+
if (isNil(value)) {
|
|
1195
|
+
this.clearEffectiveValue();
|
|
1196
|
+
return this;
|
|
1197
|
+
}
|
|
1198
|
+
if (value instanceof FormulaError) {
|
|
1199
|
+
this.setErrorValue(value);
|
|
1200
|
+
return this;
|
|
1201
|
+
}
|
|
1202
|
+
if (value === AWAITING_CALCULATION) {
|
|
1203
|
+
// AWAITING_CALCULATION is a placeholder, not a computed result: the
|
|
1204
|
+
// on-demand gate publishes it when it deliberately does NOT evaluate
|
|
1205
|
+
// the formula. It must never destroy a persisted result — in
|
|
1206
|
+
// particular a persisted error ev (#VALUE! from a failed =AOP() run)
|
|
1207
|
+
// was erased here on every subsequent open: the open pass
|
|
1208
|
+
// force-enqueues persisted-error cells, the on-demand gate answers
|
|
1209
|
+
// AWAITING_CALCULATION, and the removeErrorValue() below scrubbed the
|
|
1210
|
+
// error from state and (via the leader's recalc broadcast) from the
|
|
1211
|
+
// Y.Doc, leaving the cell blank after reload.
|
|
1212
|
+
if (!this.error &&
|
|
1213
|
+
(!this.effectiveValue?.structuredValue ||
|
|
1214
|
+
this.formattedValue === this.loadingValue)) {
|
|
1215
|
+
this.formattedValue = value;
|
|
1216
|
+
}
|
|
1217
|
+
return this;
|
|
1218
|
+
}
|
|
1219
|
+
this.removeErrorValue();
|
|
1220
|
+
if (typeof value === "object" &&
|
|
1221
|
+
value.kind) {
|
|
1222
|
+
this.setStructuredValue(value);
|
|
1223
|
+
return this;
|
|
1224
|
+
}
|
|
1225
|
+
else if (typeof value === "object") {
|
|
1226
|
+
// Stringify objects to be displayed in a cell
|
|
1227
|
+
value = JSON.stringify(value);
|
|
1228
|
+
}
|
|
1229
|
+
let normalizedValue = value;
|
|
1230
|
+
let forceStringFromPrefix = false;
|
|
1231
|
+
if (hasExcelTextPrefix(normalizedValue)) {
|
|
1232
|
+
normalizedValue = stripExcelTextPrefix(normalizedValue);
|
|
1233
|
+
forceStringFromPrefix = true;
|
|
1234
|
+
}
|
|
1235
|
+
const valueType = (preserveStringLiteral || forceStringFromPrefix) &&
|
|
1236
|
+
typeof normalizedValue === "string"
|
|
1237
|
+
? "stringValue"
|
|
1238
|
+
: detectValueType(normalizedValue, this.locale, this.lenientGrouping);
|
|
1239
|
+
switch (valueType) {
|
|
1240
|
+
case "numberValue":
|
|
1241
|
+
this.setEffectiveNumberValue(normalizedValue);
|
|
1242
|
+
break;
|
|
1243
|
+
case "stringValue":
|
|
1244
|
+
case "formulaValue":
|
|
1245
|
+
this.setEffectiveStringValue(normalizedValue);
|
|
1246
|
+
break;
|
|
1247
|
+
case "boolValue":
|
|
1248
|
+
this.setEffectiveBooleanValue(normalizedValue);
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
if (!isPreview) {
|
|
1252
|
+
this.validate();
|
|
1253
|
+
this.setVersion((this.version ?? 0) + 1);
|
|
1254
|
+
this.setUpdatedAt(Date.now());
|
|
1255
|
+
}
|
|
1256
|
+
return this;
|
|
1257
|
+
}
|
|
1258
|
+
clearEffectiveValue() {
|
|
1259
|
+
this.effectiveValue = undefined;
|
|
1260
|
+
this.formattedValue = undefined;
|
|
1261
|
+
this.cellData = undefined;
|
|
1262
|
+
}
|
|
1263
|
+
setErrorValue(error) {
|
|
1264
|
+
this.effectiveValue = {
|
|
1265
|
+
ev: {
|
|
1266
|
+
type: "Error",
|
|
1267
|
+
name: error.error,
|
|
1268
|
+
message: error.message,
|
|
1269
|
+
},
|
|
1270
|
+
};
|
|
1271
|
+
this.formattedValue = String(error.error);
|
|
1272
|
+
}
|
|
1273
|
+
removeErrorValue() {
|
|
1274
|
+
delete this.effectiveValue?.ev;
|
|
1275
|
+
}
|
|
1276
|
+
setStructuredValue(structuredValue) {
|
|
1277
|
+
switch (structuredValue.kind) {
|
|
1278
|
+
case "hyperlink":
|
|
1279
|
+
this.setUrl(structuredValue.url, structuredValue.title);
|
|
1280
|
+
// Set structuredValue
|
|
1281
|
+
set(this, "effectiveValue.structuredValue", structuredValue);
|
|
1282
|
+
break;
|
|
1283
|
+
case "image":
|
|
1284
|
+
this.imageUrl = structuredValue.imageUrl;
|
|
1285
|
+
this.formattedValue = "";
|
|
1286
|
+
// Set structuredValue
|
|
1287
|
+
set(this, "effectiveValue", { structuredValue });
|
|
1288
|
+
break;
|
|
1289
|
+
case "sparkline":
|
|
1290
|
+
this.formattedValue = structuredValue.formattedValue;
|
|
1291
|
+
// Set structuredValue
|
|
1292
|
+
set(this, "effectiveValue", { structuredValue });
|
|
1293
|
+
break;
|
|
1294
|
+
default:
|
|
1295
|
+
this.formattedValue = structuredValue.formattedValue;
|
|
1296
|
+
// Set structuredValue
|
|
1297
|
+
set(this, "effectiveValue", { structuredValue });
|
|
1298
|
+
// Always set to left
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
setEffectiveNumberValue(value) {
|
|
1303
|
+
this.clearSharedStringIndex();
|
|
1304
|
+
const numberFormat = this.userEnteredFormat?.numberFormat?.type ??
|
|
1305
|
+
detectNumberFormatType(value, this.locale, this.lenientGrouping);
|
|
1306
|
+
const numberValue = createNumberValue(value, numberFormat, this.locale, this.use1904, this.lenientGrouping);
|
|
1307
|
+
const pattern = this.userEnteredFormat?.numberFormat?.pattern ??
|
|
1308
|
+
detectNumberFormatPattern(value, numberValue, numberFormat, this.locale);
|
|
1309
|
+
this.formattedValue = createFormattedValue(numberValue, "numberValue", pattern ?? this.defaultPattern, this.locale);
|
|
1310
|
+
this.effectiveValue = { nv: numberValue };
|
|
1311
|
+
}
|
|
1312
|
+
setEffectiveStringValue(value) {
|
|
1313
|
+
this.clearSharedStringIndex();
|
|
1314
|
+
const stringValue = String(value);
|
|
1315
|
+
this.effectiveValue = { sv: stringValue };
|
|
1316
|
+
this.formattedValue = createFormattedValue(stringValue, "stringValue", this.defaultPattern, this.locale);
|
|
1317
|
+
}
|
|
1318
|
+
setEffectiveBooleanValue(value) {
|
|
1319
|
+
this.clearSharedStringIndex();
|
|
1320
|
+
this.effectiveValue = { bv: Boolean(value) };
|
|
1321
|
+
this.formattedValue = createFormattedValue(value, "boolValue", this.defaultPattern, this.locale);
|
|
1322
|
+
}
|
|
1323
|
+
setHyperlink(hyperlink, title) {
|
|
1324
|
+
const target = getHyperlinkTarget(hyperlink);
|
|
1325
|
+
const display = title ?? getHyperlinkDisplay(hyperlink);
|
|
1326
|
+
if (!target) {
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
this.hyperlink = hyperlink;
|
|
1330
|
+
if (display) {
|
|
1331
|
+
this.clearSharedStringIndex();
|
|
1332
|
+
this.formattedValue = display;
|
|
1333
|
+
// Update both user entered and effective values
|
|
1334
|
+
set(this, "userEnteredValue.sv", display);
|
|
1335
|
+
set(this, "effectiveValue.sv", display);
|
|
1336
|
+
}
|
|
1337
|
+
else {
|
|
1338
|
+
if (!this.formattedValue && target) {
|
|
1339
|
+
this.formattedValue = target;
|
|
1340
|
+
}
|
|
1341
|
+
// Update both user entered and effective values with the URL if no
|
|
1342
|
+
// title. `userEnteredValue` must be populated so consumers that read
|
|
1343
|
+
// only `userEnteredValue` (e.g. the rnc-engine paste handler) see the
|
|
1344
|
+
// pasted URL instead of an empty cell.
|
|
1345
|
+
if (!display && target) {
|
|
1346
|
+
set(this, "userEnteredValue.sv", target);
|
|
1347
|
+
set(this, "effectiveValue.sv", target);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
// Persist the hyperlink underline on `userEnteredFormat`. Writing to
|
|
1351
|
+
// `effectiveFormat` here would silently drop on save/reload because
|
|
1352
|
+
// `effectiveFormat` is derived at render time and not persisted (see
|
|
1353
|
+
// the in-file note around `assign()` — `uf` is the single source of
|
|
1354
|
+
// truth). Excel saves the underline as part of the cell's style.
|
|
1355
|
+
this.ensureFormatsMutable();
|
|
1356
|
+
set(this, "userEnteredFormat.textFormat.underline", true);
|
|
1357
|
+
}
|
|
1358
|
+
setUrl(url, title) {
|
|
1359
|
+
this.setHyperlink(url, title);
|
|
1360
|
+
}
|
|
1361
|
+
deleteUrl() {
|
|
1362
|
+
this.hyperlink = undefined;
|
|
1363
|
+
// Excel parity: removing the hyperlink also removes the underline that
|
|
1364
|
+
// was added when the hyperlink was applied. We only strip the
|
|
1365
|
+
// underline (not the whole textFormat) so any user-applied bold /
|
|
1366
|
+
// italic / color the user set on top of the hyperlink survives.
|
|
1367
|
+
if (this.userEnteredFormat?.textFormat?.underline) {
|
|
1368
|
+
this.ensureFormatsMutable();
|
|
1369
|
+
delete this.userEnteredFormat.textFormat.underline;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
setDataValidation(dataValidationId, dataValidationRule) {
|
|
1373
|
+
this.dataValidationId = dataValidationId;
|
|
1374
|
+
this.dataValidationRule = dataValidationRule;
|
|
1375
|
+
// Excel parity: adding a validation rule (including a BOOLEAN /
|
|
1376
|
+
// checkbox rule) does NOT mutate the cell's existing value. The rule
|
|
1377
|
+
// is enforced on future edits — values that violate it get the
|
|
1378
|
+
// standard "invalid value" indicator via `validate()` instead. The
|
|
1379
|
+
// previous auto-coercion turned every cell into FALSE the moment a
|
|
1380
|
+
// checkbox rule was applied, which destroyed user data.
|
|
1381
|
+
this.validate();
|
|
1382
|
+
}
|
|
1383
|
+
deleteDataValidation() {
|
|
1384
|
+
this.dataValidationId = undefined;
|
|
1385
|
+
this.dataValidationRule = undefined;
|
|
1386
|
+
// Remove any errors
|
|
1387
|
+
delete this.effectiveValue?.ev;
|
|
1388
|
+
}
|
|
1389
|
+
clearUserEnteredFormat() {
|
|
1390
|
+
this.userEnteredFormat = undefined;
|
|
1391
|
+
this.originalUserEnteredFormat = undefined;
|
|
1392
|
+
}
|
|
1393
|
+
setUserEnteredFormat(type, value) {
|
|
1394
|
+
if (type === "textFormat") {
|
|
1395
|
+
this.setTextFormat(value);
|
|
1396
|
+
}
|
|
1397
|
+
else if (type === "numberFormat") {
|
|
1398
|
+
this.setNumberFormat(value);
|
|
1399
|
+
}
|
|
1400
|
+
else if (type === "borders") {
|
|
1401
|
+
this.setBorders(value);
|
|
1402
|
+
}
|
|
1403
|
+
else {
|
|
1404
|
+
set(this, `userEnteredFormat.${type}`, value);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
setTextFormat(value) {
|
|
1408
|
+
this.ensureUserEnteredFormatMutable();
|
|
1409
|
+
if (!this.userEnteredFormat) {
|
|
1410
|
+
this.userEnteredFormat = {};
|
|
1411
|
+
}
|
|
1412
|
+
const existing = this.userEnteredFormat.textFormat;
|
|
1413
|
+
const textFormat = existing && Object.isExtensible(existing)
|
|
1414
|
+
? existing
|
|
1415
|
+
: { ...(existing ?? {}) };
|
|
1416
|
+
this.userEnteredFormat.textFormat = textFormat;
|
|
1417
|
+
const target = textFormat;
|
|
1418
|
+
for (const key in value) {
|
|
1419
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
1420
|
+
const finalValue = value[key];
|
|
1421
|
+
if (isNil(finalValue)) {
|
|
1422
|
+
delete textFormat[key];
|
|
1423
|
+
}
|
|
1424
|
+
else {
|
|
1425
|
+
target[key] = finalValue;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
setBorders(value) {
|
|
1431
|
+
this.ensureUserEnteredFormatMutable();
|
|
1432
|
+
if (!this.userEnteredFormat) {
|
|
1433
|
+
this.userEnteredFormat = {};
|
|
1434
|
+
}
|
|
1435
|
+
const existing = this.userEnteredFormat.borders;
|
|
1436
|
+
const borders = existing && Object.isExtensible(existing)
|
|
1437
|
+
? existing
|
|
1438
|
+
: { ...(existing ?? {}) };
|
|
1439
|
+
this.userEnteredFormat.borders = borders;
|
|
1440
|
+
for (const key in value) {
|
|
1441
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
1442
|
+
const borderValue = value[key];
|
|
1443
|
+
if (borderValue === null || borderValue === undefined) {
|
|
1444
|
+
delete borders[key];
|
|
1445
|
+
}
|
|
1446
|
+
else if (!borderValue.color) {
|
|
1447
|
+
delete borders[key];
|
|
1448
|
+
}
|
|
1449
|
+
else {
|
|
1450
|
+
borders[key] = borderValue;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
setNumberFormat(value) {
|
|
1456
|
+
const previousFormatType = this.userEnteredFormat?.numberFormat?.type;
|
|
1457
|
+
const numberFormatType = value?.type;
|
|
1458
|
+
const hasUserEnteredValue = this.getUserEnteredValue() !== undefined;
|
|
1459
|
+
if (!isNil(this.sharedStringIndex) &&
|
|
1460
|
+
numberFormatType &&
|
|
1461
|
+
numberFormatType !== "TEXT") {
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
set(this, "userEnteredFormat.numberFormat", value);
|
|
1465
|
+
const effectiveValue = this.getEffectiveValue();
|
|
1466
|
+
if (effectiveValue === null || effectiveValue === undefined) {
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
if (numberFormatType === "TEXT") {
|
|
1470
|
+
const userValue = this.getUserEnteredValue();
|
|
1471
|
+
this.formatAsText(userValue ?? effectiveValue, value, !hasUserEnteredValue);
|
|
1472
|
+
}
|
|
1473
|
+
else {
|
|
1474
|
+
const preserveUserEnteredText = previousFormatType === "TEXT";
|
|
1475
|
+
this.formatAsNumber(effectiveValue, value, preserveUserEnteredText, !hasUserEnteredValue);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
formatAsText(effectiveValue, numberFormat, keepUserEnteredUnset = false) {
|
|
1479
|
+
const textValue = String(effectiveValue);
|
|
1480
|
+
this.formattedValue = createFormattedValue(effectiveValue, "stringValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
|
|
1481
|
+
delete this.imageUrl;
|
|
1482
|
+
delete this.hyperlink;
|
|
1483
|
+
if (!keepUserEnteredUnset) {
|
|
1484
|
+
set(this, "userEnteredValue", { sv: textValue });
|
|
1485
|
+
}
|
|
1486
|
+
set(this, "effectiveValue", { sv: textValue });
|
|
1487
|
+
}
|
|
1488
|
+
formatAsNumber(effectiveValue, numberFormat, preserveUserEnteredText = false, keepUserEnteredUnset = false) {
|
|
1489
|
+
const isDate = this.isDate(numberFormat);
|
|
1490
|
+
const isDateTime = this.isDateTime(numberFormat);
|
|
1491
|
+
const parsedNumberValue = createNumberValue(effectiveValue, numberFormat?.type, this.locale, this.use1904, this.lenientGrouping);
|
|
1492
|
+
const hasValidNumberValue = typeof parsedNumberValue === "number" && !Number.isNaN(parsedNumberValue);
|
|
1493
|
+
// When conversion fails for plain text (e.g. "hello"), keep displaying text
|
|
1494
|
+
// instead of showing "NaN" while still preserving the selected number format.
|
|
1495
|
+
// Excel parity: the cell's pattern still applies via its `@` (text)
|
|
1496
|
+
// section — e.g. `"Note: "@` renders `Note: hello`, and a `[Magenta]@`
|
|
1497
|
+
// segment colors the text. Falling back to `defaultPattern` here would
|
|
1498
|
+
// silently drop the user-applied custom format from the display.
|
|
1499
|
+
if (!hasValidNumberValue && typeof effectiveValue === "string") {
|
|
1500
|
+
const textValue = String(effectiveValue);
|
|
1501
|
+
this.formattedValue = createFormattedValue(textValue, "stringValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
|
|
1502
|
+
if (!keepUserEnteredUnset &&
|
|
1503
|
+
(!preserveUserEnteredText || this.userEnteredValue?.sv === undefined)) {
|
|
1504
|
+
set(this, "userEnteredValue", { sv: textValue });
|
|
1505
|
+
}
|
|
1506
|
+
set(this, "effectiveValue", { sv: textValue });
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
const numberValue = parsedNumberValue === undefined ? effectiveValue : parsedNumberValue;
|
|
1510
|
+
this.formattedValue = createFormattedValue(numberValue, "numberValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
|
|
1511
|
+
const stringValue = isDate || isDateTime
|
|
1512
|
+
? createFormattedValue(numberValue, "numberValue", isDate ? getDefaultDateFormat(this.locale) : getDefaultTimeFormat(this.locale), this.locale)
|
|
1513
|
+
: numberFormat?.type === "PERCENT"
|
|
1514
|
+
? this.formattedValue
|
|
1515
|
+
: String(numberValue);
|
|
1516
|
+
if (!keepUserEnteredUnset &&
|
|
1517
|
+
(!preserveUserEnteredText || this.userEnteredValue?.sv === undefined)) {
|
|
1518
|
+
set(this, "userEnteredValue.sv", stringValue);
|
|
1519
|
+
}
|
|
1520
|
+
set(this, "effectiveValue.nv", preserveUserEnteredText ? String(numberValue) : numberValue);
|
|
1521
|
+
// Default horizontal alignment for numbers/dates/currency is computed
|
|
1522
|
+
// at render time by `getDefaultHorizontalAlignment` in canvas-grid —
|
|
1523
|
+
// we deliberately do NOT stamp `uf.horizontalAlignment` here so the
|
|
1524
|
+
// user's explicit alignment choice (or its absence) is preserved.
|
|
1525
|
+
}
|
|
1526
|
+
getEffectiveValue() {
|
|
1527
|
+
if (!this.effectiveValue) {
|
|
1528
|
+
return undefined;
|
|
1529
|
+
}
|
|
1530
|
+
return (getExtendedValueNumber(this.effectiveValue) ??
|
|
1531
|
+
getExtendedValueString(this.effectiveValue) ??
|
|
1532
|
+
getExtendedValueBool(this.effectiveValue));
|
|
1533
|
+
}
|
|
1534
|
+
getUserEnteredValue() {
|
|
1535
|
+
if (!this.userEnteredValue) {
|
|
1536
|
+
return undefined;
|
|
1537
|
+
}
|
|
1538
|
+
return (getExtendedValueFormula(this.userEnteredValue) ??
|
|
1539
|
+
getExtendedValueNumber(this.userEnteredValue) ??
|
|
1540
|
+
getExtendedValueString(this.userEnteredValue) ??
|
|
1541
|
+
getExtendedValueBool(this.userEnteredValue));
|
|
1542
|
+
}
|
|
1543
|
+
getNumberFormat() {
|
|
1544
|
+
return this.userEnteredFormat?.numberFormat;
|
|
1545
|
+
}
|
|
1546
|
+
processDerivedCell(cellData) {
|
|
1547
|
+
// Image url
|
|
1548
|
+
if (cellData.imageUrl) {
|
|
1549
|
+
this.setImage(cellData.imageUrl);
|
|
1550
|
+
}
|
|
1551
|
+
// Set formatted value for hyperlink
|
|
1552
|
+
if (cellData.hyperlink) {
|
|
1553
|
+
this.setHyperlink(cellData.hyperlink, getCellFormattedValue(cellData));
|
|
1554
|
+
}
|
|
1555
|
+
const structuredValue = getCellEffectiveValue(cellData)?.structuredValue;
|
|
1556
|
+
if (structuredValue) {
|
|
1557
|
+
this.setStructuredValue(structuredValue);
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
// Excel parity: xlsx files often carry a `numberFormat.pattern` without
|
|
1561
|
+
// a corresponding `type` (the Google-Sheets style category that we layer
|
|
1562
|
+
// on top). Fall back to inspecting the pattern itself so DATE / DATE_TIME
|
|
1563
|
+
// / TEXT cells imported from Excel render and serialize correctly.
|
|
1564
|
+
isDate(numberFormat) {
|
|
1565
|
+
if (numberFormat?.type === "DATE")
|
|
1566
|
+
return true;
|
|
1567
|
+
if (numberFormat?.type)
|
|
1568
|
+
return false;
|
|
1569
|
+
return (isDatePattern(numberFormat?.pattern) &&
|
|
1570
|
+
!isDateTimePattern(numberFormat?.pattern));
|
|
1571
|
+
}
|
|
1572
|
+
isDateTime(numberFormat) {
|
|
1573
|
+
if (numberFormat?.type === "DATE_TIME")
|
|
1574
|
+
return true;
|
|
1575
|
+
if (numberFormat?.type)
|
|
1576
|
+
return false;
|
|
1577
|
+
return isDateTimePattern(numberFormat?.pattern);
|
|
1578
|
+
}
|
|
1579
|
+
isText(numberFormat) {
|
|
1580
|
+
if (numberFormat?.type === "TEXT")
|
|
1581
|
+
return true;
|
|
1582
|
+
if (numberFormat?.type)
|
|
1583
|
+
return false;
|
|
1584
|
+
return isTextPattern(numberFormat?.pattern);
|
|
1585
|
+
}
|
|
1586
|
+
setGroupKeys(groupKeys) {
|
|
1587
|
+
this.groupKeys = groupKeys;
|
|
1588
|
+
if (groupKeys) {
|
|
1589
|
+
// If a cell is not expandable and has group keys
|
|
1590
|
+
// its the last child the group. Indent persists on uf so the
|
|
1591
|
+
// renderer (and exporters) see it.
|
|
1592
|
+
const indent = (groupKeys.length - 1) * 2 + (this.expandable ? 0 : 4);
|
|
1593
|
+
if (!this.userEnteredFormat) {
|
|
1594
|
+
this.userEnteredFormat = {};
|
|
1595
|
+
}
|
|
1596
|
+
this.userEnteredFormat.indent = Math.max(0, indent);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
changeIndent(size = 1) {
|
|
1600
|
+
const indent = this.userEnteredFormat?.indent ?? 0;
|
|
1601
|
+
if (!this.userEnteredFormat) {
|
|
1602
|
+
this.userEnteredFormat = {};
|
|
1603
|
+
}
|
|
1604
|
+
this.userEnteredFormat.indent = Math.max(0, indent + size);
|
|
1605
|
+
}
|
|
1606
|
+
setPivotId(pivotId) {
|
|
1607
|
+
this.pivotId = pivotId;
|
|
1608
|
+
}
|
|
1609
|
+
expand() {
|
|
1610
|
+
this.expanded = true;
|
|
1611
|
+
}
|
|
1612
|
+
collapse() {
|
|
1613
|
+
this.expanded = false;
|
|
1614
|
+
}
|
|
1615
|
+
setExpandable(expandable) {
|
|
1616
|
+
this.expandable = expandable;
|
|
1617
|
+
}
|
|
1618
|
+
setArrayFormulaRef(ref) {
|
|
1619
|
+
this.arrayFormulaRef = ref ?? undefined;
|
|
1620
|
+
}
|
|
1621
|
+
clearArrayFormulaRef() {
|
|
1622
|
+
if (!this.arrayFormulaRef) {
|
|
1623
|
+
return;
|
|
1624
|
+
}
|
|
1625
|
+
this.arrayFormulaRef = undefined;
|
|
1626
|
+
}
|
|
1627
|
+
setSharedFormulaSpec(spec) {
|
|
1628
|
+
this.sharedFormulaSpec = spec
|
|
1629
|
+
? { si: spec.si, ...(spec.ref ? { ref: spec.ref } : {}) }
|
|
1630
|
+
: undefined;
|
|
1631
|
+
}
|
|
1632
|
+
clearSharedFormulaSpec() {
|
|
1633
|
+
if (!this.sharedFormulaSpec) {
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1636
|
+
this.sharedFormulaSpec = undefined;
|
|
1637
|
+
}
|
|
1638
|
+
increaseIndent() {
|
|
1639
|
+
this.changeIndent(2);
|
|
1640
|
+
}
|
|
1641
|
+
decreaseIndent() {
|
|
1642
|
+
this.changeIndent(-2);
|
|
1643
|
+
}
|
|
1644
|
+
clearFormatting() {
|
|
1645
|
+
this.userEnteredFormat = undefined;
|
|
1646
|
+
this.originalUserEnteredFormat = undefined;
|
|
1647
|
+
}
|
|
1648
|
+
clearHyperlink() {
|
|
1649
|
+
this.hyperlink = undefined;
|
|
1650
|
+
}
|
|
1651
|
+
// Inherit a different set of cell data
|
|
1652
|
+
inheritCellData(cellData) {
|
|
1653
|
+
this.cellData = cellData;
|
|
1654
|
+
}
|
|
1655
|
+
getUserCellData() {
|
|
1656
|
+
if (!this.cellData)
|
|
1657
|
+
return undefined;
|
|
1658
|
+
const result = {};
|
|
1659
|
+
for (const key in this.cellData) {
|
|
1660
|
+
if (!excludeKeys.has(key)) {
|
|
1661
|
+
result[key] = this.cellData[key];
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
1665
|
+
}
|
|
1666
|
+
extendCellData(newCellData) {
|
|
1667
|
+
this.assign(this.sheetId, this.coords, newCellData, {
|
|
1668
|
+
getRangeValues: this.getRangeValues,
|
|
1669
|
+
locale: this.locale,
|
|
1670
|
+
cellXfsRegistry: this.cellXfsRegistry,
|
|
1671
|
+
sharedStringRegistry: this.sharedStringRegistry,
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
getUserEnteredFormat() {
|
|
1675
|
+
if (isStyleReference(this.originalUserEnteredFormat) &&
|
|
1676
|
+
!this.cellXfsRegistry) {
|
|
1677
|
+
return this.originalUserEnteredFormat;
|
|
1678
|
+
}
|
|
1679
|
+
return this.userEnteredFormat;
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Returns the user-entered format. The "effective" format (uf + auto-
|
|
1683
|
+
* derived alignment / pattern color / formula-precedent number format /
|
|
1684
|
+
* conditional formatting) is computed at render time by
|
|
1685
|
+
* `useSheetProperties.getEffectiveFormat`. SheetCell no longer maintains
|
|
1686
|
+
* a separate in-memory effective format.
|
|
1687
|
+
*
|
|
1688
|
+
* Loading-state alignment override is preserved for legacy callers that
|
|
1689
|
+
* sniff this method while a cell is being recalculated.
|
|
1690
|
+
*/
|
|
1691
|
+
getEffectiveCellFormat() {
|
|
1692
|
+
if (!this.userEnteredFormat && !this.isLoading) {
|
|
1693
|
+
return undefined;
|
|
1694
|
+
}
|
|
1695
|
+
if (this.isLoading) {
|
|
1696
|
+
return {
|
|
1697
|
+
...(this.userEnteredFormat ?? {}),
|
|
1698
|
+
horizontalAlignment: "center",
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
return this.userEnteredFormat ?? undefined;
|
|
1702
|
+
}
|
|
1703
|
+
getCellFormats(disableRegistry) {
|
|
1704
|
+
// `ef` is no longer persisted: rendering derives the effective format
|
|
1705
|
+
// on the fly from `uf`, the cell value, and (for formulas) precedent
|
|
1706
|
+
// formats. The renderer caches the derivation so this stays cheap.
|
|
1707
|
+
//
|
|
1708
|
+
// Fall back to `originalUserEnteredFormat` when we never resolved a
|
|
1709
|
+
// CellFormat — happens when assign() ran without a cellXfsRegistry on
|
|
1710
|
+
// input that already had `uf: { sid: ... }` (e.g. the sheet-rename
|
|
1711
|
+
// formula round-trip). Without this fallback the StyleReference is
|
|
1712
|
+
// silently dropped on the way out.
|
|
1713
|
+
const format = this.userEnteredFormat ?? this.originalUserEnteredFormat;
|
|
1714
|
+
if (!format)
|
|
1715
|
+
return {};
|
|
1716
|
+
if (!disableRegistry &&
|
|
1717
|
+
this.cellXfsRegistry?.active &&
|
|
1718
|
+
this.userEnteredFormat) {
|
|
1719
|
+
return { uf: { sid: getCellXfsKey(this.userEnteredFormat) } };
|
|
1720
|
+
}
|
|
1721
|
+
return { uf: { ...format } };
|
|
1722
|
+
}
|
|
1723
|
+
get isModified() {
|
|
1724
|
+
return !isEqual(this.cellData, this.getCellData());
|
|
1725
|
+
}
|
|
1726
|
+
getCellData(options) {
|
|
1727
|
+
const hasSharedString = this.sharedStringIndex != null;
|
|
1728
|
+
const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
|
|
1729
|
+
const useSharedString = hasSharedString;
|
|
1730
|
+
// Formula cells no longer persist `fv`: the renderer derives it from
|
|
1731
|
+
// `effectiveValue` + the resolved number format and caches the result.
|
|
1732
|
+
// Structured-value formula cells (sparkline/image/hyperlink) still get
|
|
1733
|
+
// their display text from `effectiveValue.structuredValue` itself, so
|
|
1734
|
+
// we don't need to write `fv` either.
|
|
1735
|
+
//
|
|
1736
|
+
// Exception: when `isLoading` is true, persist `fv = loadingValue` even
|
|
1737
|
+
// for formula cells (and even when a prior `effectiveValue` is on the
|
|
1738
|
+
// cell). The renderer surfaces "Loading..." while a recalc is in
|
|
1739
|
+
// flight; calc-success clears it by writing the cell back through
|
|
1740
|
+
// getCellData with isLoading=false.
|
|
1741
|
+
const isFormulaCell = !!getExtendedValueFormula(this.userEnteredValue);
|
|
1742
|
+
const shouldPersistFormattedValue = !useSharedString &&
|
|
1743
|
+
(this.isLoading || (!isFormulaCell && this.formattedValue));
|
|
1744
|
+
const newCellData = {
|
|
1745
|
+
...this.getUserCellData(),
|
|
1746
|
+
// Rich-text runs are persisted on the SharedStrings entry the
|
|
1747
|
+
// cell references via `ss`, not on `cellData`. See
|
|
1748
|
+
// `SharedStringRegistry.registerCell` for the write path.
|
|
1749
|
+
...(this.conditionalFormattingResultById
|
|
1750
|
+
? {
|
|
1751
|
+
conditionalFormattingResultById: this.conditionalFormattingResultById,
|
|
1752
|
+
}
|
|
1753
|
+
: {}),
|
|
1754
|
+
...(this.dataValidationResult
|
|
1755
|
+
? { dataValidationResult: this.dataValidationResult }
|
|
1756
|
+
: {}),
|
|
1757
|
+
...(!useSharedString && this.userEnteredValue
|
|
1758
|
+
? {
|
|
1759
|
+
ue: this.userEnteredValue,
|
|
1760
|
+
}
|
|
1761
|
+
: {}),
|
|
1762
|
+
...(this.effectiveValue && (!useSharedString || hasEffectiveError)
|
|
1763
|
+
? {
|
|
1764
|
+
ev: this.effectiveValue,
|
|
1765
|
+
}
|
|
1766
|
+
: {}),
|
|
1767
|
+
...(shouldPersistFormattedValue
|
|
1768
|
+
? {
|
|
1769
|
+
fv: this.isLoading ? this.loadingValue : this.formattedValue,
|
|
1770
|
+
}
|
|
1771
|
+
: undefined),
|
|
1772
|
+
...(hasSharedString
|
|
1773
|
+
? {
|
|
1774
|
+
ss: typeof this.sharedStringIndex === "string"
|
|
1775
|
+
? this.sharedStringIndex
|
|
1776
|
+
: String(this.sharedStringIndex),
|
|
1777
|
+
}
|
|
1778
|
+
: {}),
|
|
1779
|
+
...this.getCellFormats(options?.disableRegistry),
|
|
1780
|
+
...(this.dataValidationId
|
|
1781
|
+
? {
|
|
1782
|
+
dataValidation: this.dataValidationId,
|
|
1783
|
+
}
|
|
1784
|
+
: {}),
|
|
1785
|
+
...(this.imageUrl
|
|
1786
|
+
? {
|
|
1787
|
+
imageUrl: this.imageUrl,
|
|
1788
|
+
}
|
|
1789
|
+
: {}),
|
|
1790
|
+
...(this.hyperlink
|
|
1791
|
+
? {
|
|
1792
|
+
hyperlink: this.hyperlink,
|
|
1793
|
+
}
|
|
1794
|
+
: {}),
|
|
1795
|
+
...(this.metaType ? { metaType: this.metaType } : {}),
|
|
1796
|
+
...(this.pivotId ? { pivotId: this.pivotId } : {}),
|
|
1797
|
+
...(this.groupKeys ? { groupKeys: this.groupKeys } : {}),
|
|
1798
|
+
// Disable version and updatedAt for now
|
|
1799
|
+
// ...(this.version != null ? { version: this.version } : {}),
|
|
1800
|
+
// ...(this.updatedAt != null ? { updatedAt: this.updatedAt } : {}),
|
|
1801
|
+
...(this.note ? { note: this.note } : {}),
|
|
1802
|
+
...(!isNil(this.commentThreadId)
|
|
1803
|
+
? { commentThreadId: this.commentThreadId }
|
|
1804
|
+
: {}),
|
|
1805
|
+
...(!isNil(this.citationId) ? { citationId: this.citationId } : {}),
|
|
1806
|
+
...(this.expandable
|
|
1807
|
+
? {
|
|
1808
|
+
expandable: this.expandable,
|
|
1809
|
+
expanded: this.expanded,
|
|
1810
|
+
}
|
|
1811
|
+
: {}),
|
|
1812
|
+
...(this.arrayFormulaRef ? { af: this.arrayFormulaRef } : {}),
|
|
1813
|
+
...(this.sharedFormulaSpec
|
|
1814
|
+
? {
|
|
1815
|
+
sf: {
|
|
1816
|
+
si: this.sharedFormulaSpec.si,
|
|
1817
|
+
...(this.sharedFormulaSpec.ref
|
|
1818
|
+
? { ref: this.sharedFormulaSpec.ref }
|
|
1819
|
+
: {}),
|
|
1820
|
+
},
|
|
1821
|
+
}
|
|
1822
|
+
: {}),
|
|
1823
|
+
};
|
|
1824
|
+
if (newCellData && Object.keys(newCellData).length === 0) {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1827
|
+
return newCellData;
|
|
1828
|
+
}
|
|
1829
|
+
}
|