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