@rowsncolumns/spreadsheet 10.18.0 → 10.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/fill-series.d.ts +48 -8
- package/dist/cjs/api/fill-series.d.ts.map +1 -1
- package/dist/cjs/api/fill-series.js +231 -25
- package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/fill-series-dialog.atom.d.ts +6 -0
- package/dist/cjs/atoms/fill-series-dialog.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/frozen-area-sent.atom.d.ts +53 -0
- package/dist/cjs/atoms/frozen-area-sent.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/frozen-area-sent.atom.js +48 -0
- package/dist/cjs/atoms/index.d.ts +2 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -1
- package/dist/cjs/atoms/index.js +2 -0
- package/dist/cjs/atoms/undo-redo-sent.atom.d.ts +25 -0
- package/dist/cjs/atoms/undo-redo-sent.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/undo-redo-sent.atom.js +23 -0
- package/dist/cjs/components/canvas-grid/frozen-start.d.ts +25 -10
- package/dist/cjs/components/canvas-grid/frozen-start.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/frozen-start.js +25 -18
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +181 -33
- package/dist/cjs/components/canvas-grid/typings.d.ts +15 -0
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/fill-series-dialog/index.d.ts +13 -4
- package/dist/cjs/components/fill-series-dialog/index.d.ts.map +1 -1
- package/dist/cjs/components/fill-series-dialog/index.js +29 -14
- package/dist/cjs/hooks/use-selection-interceptors.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-interceptors.js +9 -0
- package/dist/cjs/hooks/use-selection.d.ts +8 -1
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +39 -9
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/api/fill-series.d.ts +48 -8
- package/dist/esm/api/fill-series.d.ts.map +1 -1
- package/dist/esm/api/fill-series.js +222 -23
- package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/esm/atoms/fill-series-dialog.atom.d.ts +6 -0
- package/dist/esm/atoms/fill-series-dialog.atom.d.ts.map +1 -1
- package/dist/esm/atoms/frozen-area-sent.atom.d.ts +53 -0
- package/dist/esm/atoms/frozen-area-sent.atom.d.ts.map +1 -0
- package/dist/esm/atoms/frozen-area-sent.atom.js +43 -0
- package/dist/esm/atoms/index.d.ts +2 -0
- package/dist/esm/atoms/index.d.ts.map +1 -1
- package/dist/esm/atoms/index.js +2 -0
- package/dist/esm/atoms/undo-redo-sent.atom.d.ts +25 -0
- package/dist/esm/atoms/undo-redo-sent.atom.d.ts.map +1 -0
- package/dist/esm/atoms/undo-redo-sent.atom.js +18 -0
- package/dist/esm/components/canvas-grid/frozen-start.d.ts +25 -10
- package/dist/esm/components/canvas-grid/frozen-start.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/frozen-start.js +25 -18
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +176 -31
- package/dist/esm/components/canvas-grid/typings.d.ts +15 -0
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/fill-series-dialog/index.d.ts +13 -4
- package/dist/esm/components/fill-series-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/fill-series-dialog/index.js +29 -14
- package/dist/esm/hooks/use-selection-interceptors.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-interceptors.js +10 -1
- package/dist/esm/hooks/use-selection.d.ts +8 -1
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +35 -5
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../config.ts","../../helpers.ts","../../index.tsx","../../platform.ts","../../release-date.ts","../../test-setup.ts","../../themes.ts","../../types.ts","../../vitest.config.ts","../../api/animate.ts","../../api/autocomplete.ts","../../api/banded-ranges.ts","../../api/calculated-column-fill.ts","../../api/cf-data-bar.ts","../../api/cf-engine.ts","../../api/cf-icons.ts","../../api/cf-overlays.ts","../../api/cf-priority.ts","../../api/cf-window.ts","../../api/chart-sheet.ts","../../api/chart-source-ranges.ts","../../api/colors.ts","../../api/copy-paste.ts","../../api/editor-formula.ts","../../api/error-checking.ts","../../api/evaluate-formula.ts","../../api/excel-edit-value.ts","../../api/excel-validation-kinds.ts","../../api/fill-patterns.ts","../../api/fill-series.ts","../../api/font-loader.ts","../../api/go-to-special.ts","../../api/go-to.ts","../../api/heatmap.ts","../../api/index-ranges.ts","../../api/insert-options.ts","../../api/move-overwrite.ts","../../api/multi-selection.ts","../../api/scheduler.ts","../../api/scroller.ts","../../api/selections.ts","../../api/split-pane.ts","../../api/spreadsheet-api.ts","../../api/table-auto-expansion.ts","../../api/table.ts","../../api/validation-tooltip.tsx","../../api/validation.ts","../../atoms/active-editor.atom.ts","../../atoms/advanced-filter-dialog.atom.ts","../../atoms/calculated-column-fill.atom.ts","../../atoms/cell-editor-mode.atom.ts","../../atoms/cell-input-context.atom.ts","../../atoms/chart-actions.atom.ts","../../atoms/consolidate-dialog.atom.ts","../../atoms/copied-range.atom.ts","../../atoms/editing-cell.atom.ts","../../atoms/enter-key-direction.atom.ts","../../atoms/evaluate-formula-dialog.atom.ts","../../atoms/fill-options.atom.ts","../../atoms/fill-series-dialog.atom.ts","../../atoms/flash-fill-options.atom.ts","../../atoms/formula-bar-editor-value.atom.ts","../../atoms/formula-mode.atom.ts","../../atoms/formula-selection-state.atom.ts","../../atoms/formula-selections.atom.ts","../../atoms/go-to-dialog.atom.ts","../../atoms/goal-seek-dialog.atom.ts","../../atoms/index.ts","../../atoms/insert-cells-dialog.atom.ts","../../atoms/insert-options.atom.ts","../../atoms/loading-indicator.atom.ts","../../atoms/magic-fill-state.atom.ts","../../atoms/move-chart-dialog.atom.ts","../../atoms/move-overwrite-confirm.atom.ts","../../atoms/outline-settings-dialog.atom.ts","../../atoms/paste-menu.atom.ts","../../atoms/paste-special-dialog.atom.ts","../../atoms/persistent-tooltip.atom.ts","../../atoms/pick-list.atom.ts","../../atoms/popover.atom.ts","../../atoms/range-selector.atom.ts","../../atoms/remove-duplicates-dialog.atom.ts","../../atoms/selected-chart-embed.atom.ts","../../atoms/selected-chart-series.atom.ts","../../atoms/selected-object-formula.atom.ts","../../atoms/sheet-context.atom.ts","../../atoms/sheet-status-display.atom.ts","../../atoms/show-formula-help.atom.ts","../../atoms/sort-dialog.atom.ts","../../atoms/sparkline-dialog.atom.ts","../../atoms/spreadsheet-api.atom.ts","../../atoms/subtotal-dialog.atom.ts","../../atoms/table-auto-expansion.atom.ts","../../atoms/text-to-columns-dialog.atom.ts","../../atoms/validation-alert.atom.ts","../../atoms/watch-window.atom.ts","../../components/advanced-filter-dialog/index.tsx","../../components/autocorrect-options-smart-tag/index.tsx","../../components/bottom-bar/index.tsx","../../components/calculated-column-smart-tag/index.tsx","../../components/calculation-options-dialog/index.tsx","../../components/canvas-grid/frozen-start.ts","../../components/canvas-grid/helpers.ts","../../components/canvas-grid/index.tsx","../../components/canvas-grid/overflow.ts","../../components/canvas-grid/page-break-preview-styles.ts","../../components/canvas-grid/page-breaks.ts","../../components/canvas-grid/typings.ts","../../components/cell/alignment.ts","../../components/cell/cell-background.tsx","../../components/cell/cell-backgrounds.tsx","../../components/cell/cell-text-runs.tsx","../../components/cell/helpers.ts","../../components/cell/index.tsx","../../components/cell/line-height.ts","../../components/cell/number-format-layout.ts","../../components/cell/rich-text.ts","../../components/cell/typings.ts","../../components/cell-arrow/index.tsx","../../components/cell-calculated/index.tsx","../../components/cell-checkbox/index.tsx","../../components/cell-diff/index.tsx","../../components/cell-editor/calendar-popup.tsx","../../components/cell-editor/formula-result-preview.tsx","../../components/cell-editor/helpers.ts","../../components/cell-editor/index.tsx","../../components/cell-editor/style.tsx","../../components/cell-expand/index.tsx","../../components/cell-filter/index.tsx","../../components/cell-group/index.tsx","../../components/cell-indicator/index.tsx","../../components/cell-input/cell-input.tsx","../../components/cell-input/formula-bar-cell-input.tsx","../../components/cell-input/index.tsx","../../components/cell-input/style.tsx","../../components/cell-overlay/index.tsx","../../components/cell-structured/cell-image.tsx","../../components/cell-structured/image-geometry.ts","../../components/cell-structured/index.tsx","../../components/cell-structured/sparkline-math.ts","../../components/cell-structured/sparkline.tsx","../../components/cell-structured/types.ts","../../components/cell-tooltip/index.tsx","../../components/cell-tooltip/note-editor.tsx","../../components/cell-tooltip/style.tsx","../../components/cf-icon-preview/index.tsx","../../components/chart-sheet-view/index.tsx","../../components/consolidate-dialog/index.tsx","../../components/context-menu/embed-context-menu.tsx","../../components/context-menu/index.tsx","../../components/context-menu/menu.tsx","../../components/context-menu/style.tsx","../../components/context-menu/total-row-function-menu.tsx","../../components/context-menu/total-row-functions.ts","../../components/data-table-dialog/index.tsx","../../components/embeds/chart-component.tsx","../../components/embeds/embed-component.tsx","../../components/embeds/embed-draggable.tsx","../../components/embeds/index.tsx","../../components/embeds/linked-picture.tsx","../../components/embeds/object-cell-offset.ts","../../components/embeds/object-focus.ts","../../components/embeds/page-gaps.ts","../../components/embeds/pane-copy.tsx","../../components/embeds/shape-geometry.ts","../../components/embeds/shape-svg.tsx","../../components/embeds/slicer-component.tsx","../../components/embeds/text-box-view.tsx","../../components/error-check-smart-tag/index.tsx","../../components/evaluate-formula-dialog/index.tsx","../../components/fill-handle/index.tsx","../../components/fill-series-dialog/index.tsx","../../components/filter-box/date-tree.ts","../../components/filter-box/filter-by-color.tsx","../../components/filter-box/filter-by-condition.tsx","../../components/filter-box/filter-by-value.tsx","../../components/filter-box/index.tsx","../../components/flash-fill-options-smart-tag/index.tsx","../../components/floating-cell-editor/index.tsx","../../components/forecast-sheet-dialog/index.tsx","../../components/formula-bar/index.tsx","../../components/formula-bar/style.tsx","../../components/formula-input/index.tsx","../../components/go-to-dialog/index.tsx","../../components/goal-seek-dialog/index.tsx","../../components/grid-footer/index.tsx","../../components/header-cell/index.tsx","../../components/header-menu/index.tsx","../../components/header-move/index.tsx","../../components/header-resizer/index.tsx","../../components/hidden-markers/index.tsx","../../components/hidden-markers/style.tsx","../../components/insert-cells-dialog/index.tsx","../../components/insert-function-dialog/index.tsx","../../components/insert-options-smart-tag/index.tsx","../../components/loading-indicator/index.tsx","../../components/move-chart-dialog/index.tsx","../../components/move-overwrite-confirm-dialog/index.tsx","../../components/outline-gutter/index.tsx","../../components/outline-gutter/offsets.ts","../../components/outline-settings-dialog/index.tsx","../../components/page-layout-view/compute-page-layout.ts","../../components/page-layout-view/header-footer-codes.ts","../../components/page-layout-view/index.ts","../../components/page-layout-view/page-layout-chrome.tsx","../../components/paste-special-dialog/index.tsx","../../components/pivot-placeholder/index.tsx","../../components/print-preview/cell-styles.ts","../../components/print-preview/index.ts","../../components/print-preview/page-block.tsx","../../components/print-preview/page-break-preview.ts","../../components/print-preview/print-cells.ts","../../components/print-preview/print-comments.tsx","../../components/print-preview/print-preview-dialog.tsx","../../components/print-preview/run-print.ts","../../components/print-preview/settings.ts","../../components/print-preview/sheet-page-setup.ts","../../components/print-preview/use-page-layout.ts","../../components/protect-sheet-dialog/allow-edit-ranges-dialog.tsx","../../components/protect-sheet-dialog/constants.ts","../../components/protect-sheet-dialog/index.tsx","../../components/range-selector/index.tsx","../../components/remove-duplicates-dialog/index.tsx","../../components/resizer/index.tsx","../../components/scenario-manager-dialog/index.tsx","../../components/selection/avatar.tsx","../../components/selection/fill-options-menu.tsx","../../components/selection/index.tsx","../../components/selection/magic-fill.tsx","../../components/selection/paste-menu.tsx","../../components/selection/paste-options.ts","../../components/selection/quick-edit.tsx","../../components/selection/style.tsx","../../components/selection/suggestion-action.tsx","../../components/selection/title.tsx","../../components/selection/types.ts","../../components/selection-drop-menu/index.tsx","../../components/selection-input/index.tsx","../../components/selection-input/style.tsx","../../components/sheet-background/index.tsx","../../components/sheet-search/index.tsx","../../components/sheet-status/index.tsx","../../components/sheet-status/style.tsx","../../components/sheet-switcher/index.tsx","../../components/sheet-switcher/new-sheet-button.tsx","../../components/sheet-tabs/context-menu.tsx","../../components/sheet-tabs/index.tsx","../../components/sheet-tabs/sheet-tab.tsx","../../components/sheet-tabs/style.tsx","../../components/sheet-tabs/types.ts","../../components/solver-dialog/index.tsx","../../components/sort-range-dialog/index.tsx","../../components/sparkline-dialog/index.tsx","../../components/subtotal-dialog/index.tsx","../../components/table-auto-expansion-smart-tag/index.tsx","../../components/text-to-columns-dialog/index.tsx","../../components/toolbar/background-color-selector.tsx","../../components/toolbar/border-color-selector.tsx","../../components/toolbar/border-line-style-options.tsx","../../components/toolbar/border-line-style-selector.tsx","../../components/toolbar/border-location-options.tsx","../../components/toolbar/border-selector.tsx","../../components/toolbar/buttons.tsx","../../components/toolbar/cell-style-selector.tsx","../../components/toolbar/color-selector.tsx","../../components/toolbar/fill-selectors.tsx","../../components/toolbar/font-family-selector.tsx","../../components/toolbar/font-size-selector.tsx","../../components/toolbar/index.tsx","../../components/toolbar/insert-menu.tsx","../../components/toolbar/merge-cells-selector.tsx","../../components/toolbar/scale-selector.tsx","../../components/toolbar/sparkline-actions.tsx","../../components/toolbar/style.tsx","../../components/toolbar/table-actions.tsx","../../components/toolbar/table-style-editor.tsx","../../components/toolbar/table-style-selector.tsx","../../components/toolbar/text-color-selector.tsx","../../components/toolbar/text-format-selector.tsx","../../components/toolbar/text-horizontal-align-selector.tsx","../../components/toolbar/text-rotation-selector.tsx","../../components/toolbar/text-vertical-align-selector.tsx","../../components/toolbar/text-wrap-selector.tsx","../../components/toolbar/theme-selector.tsx","../../components/toolbar/toolbar.tsx","../../components/toolbar/types.ts","../../components/toolbar/view-menu.tsx","../../components/validation-alert-dialog/index.tsx","../../components/watch-window/index.tsx","../../helpers/merged-cell-borders.ts","../../hooks/export-range-tiles.ts","../../hooks/index.ts","../../hooks/object-clipboard-payload.ts","../../hooks/object-spec-schema.generated.ts","../../hooks/show-zeros.ts","../../hooks/use-async.ts","../../hooks/use-border-styles.ts","../../hooks/use-callback-ref.ts","../../hooks/use-cell-diff-highlight.ts","../../hooks/use-cell-popover.tsx","../../hooks/use-cell-renderer.tsx","../../hooks/use-chart-clipboard.ts","../../hooks/use-chart-source-ranges.ts","../../hooks/use-column-color-icons.ts","../../hooks/use-conditional-formatting.ts","../../hooks/use-context-menu.tsx","../../hooks/use-context-setter.ts","../../hooks/use-copy-paste-cut.tsx","../../hooks/use-create-address-from-selection.ts","../../hooks/use-create-formula-tokenizer.ts","../../hooks/use-delayed-value.ts","../../hooks/use-editable.tsx","../../hooks/use-editor-cancel.ts","../../hooks/use-editor-change.ts","../../hooks/use-editor-keydown.ts","../../hooks/use-editor-submit.ts","../../hooks/use-embeds-charts.tsx","../../hooks/use-expand-cell.tsx","../../hooks/use-export-range.ts","../../hooks/use-filter.ts","../../hooks/use-flash-fill-suggestion.ts","../../hooks/use-flash.ts","../../hooks/use-fonts.ts","../../hooks/use-formula-range-helpers.ts","../../hooks/use-get-tooltip.tsx","../../hooks/use-get-values-from-range.ts","../../hooks/use-grid-children.tsx","../../hooks/use-header-actions.tsx","../../hooks/use-hidden-dimension-markers.tsx","../../hooks/use-hidden-dimensions.ts","../../hooks/use-hovered-selection-ids.ts","../../hooks/use-isomorphic-layout-effect.ts","../../hooks/use-keyboard-handler.tsx","../../hooks/use-licensekey-validator.tsx","../../hooks/use-memo-compare.ts","../../hooks/use-merge.refs.ts","../../hooks/use-move-columns-rows.tsx","../../hooks/use-navigate-sheet-range.ts","../../hooks/use-previous.ts","../../hooks/use-raf.ts","../../hooks/use-resize-observer.ts","../../hooks/use-reveal-chart-embed.ts","../../hooks/use-scale-listener.ts","../../hooks/use-selected-rows-columns.ts","../../hooks/use-selection-aware-formatting.ts","../../hooks/use-selection-change.ts","../../hooks/use-selection-drag-copy.ts","../../hooks/use-selection-interceptors.ts","../../hooks/use-selection-move.ts","../../hooks/use-selection-renderer.tsx","../../hooks/use-selection-resize.ts","../../hooks/use-selection.ts","../../hooks/use-sheet-change-handler.ts","../../hooks/use-shown-notes.tsx","../../hooks/use-sizer.ts","../../hooks/use-spreadsheet-theme.ts","../../hooks/use-stable-ref.ts","../../hooks/use-structured-reference-selection.ts","../../hooks/use-table-hit-zones.ts","../../hooks/use-table-resizer.tsx","../../hooks/use-text-dimensions.ts","../../hooks/use-tooltip.ts","../../hooks/use-touch.ts","../../providers/spreadsheet-provider.tsx","../../signals/scroll-subscriber.ts","../../utils/copy-as-picture.ts","../../utils/maybe.ts","../../utils/pivot-chart-field-buttons.ts","../../utils/z-order.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../../config.ts","../../helpers.ts","../../index.tsx","../../platform.ts","../../release-date.ts","../../test-setup.ts","../../themes.ts","../../types.ts","../../vitest.config.ts","../../api/animate.ts","../../api/autocomplete.ts","../../api/banded-ranges.ts","../../api/calculated-column-fill.ts","../../api/cf-data-bar.ts","../../api/cf-engine.ts","../../api/cf-icons.ts","../../api/cf-overlays.ts","../../api/cf-priority.ts","../../api/cf-window.ts","../../api/chart-sheet.ts","../../api/chart-source-ranges.ts","../../api/colors.ts","../../api/copy-paste.ts","../../api/editor-formula.ts","../../api/error-checking.ts","../../api/evaluate-formula.ts","../../api/excel-edit-value.ts","../../api/excel-validation-kinds.ts","../../api/fill-patterns.ts","../../api/fill-series.ts","../../api/font-loader.ts","../../api/go-to-special.ts","../../api/go-to.ts","../../api/heatmap.ts","../../api/index-ranges.ts","../../api/insert-options.ts","../../api/move-overwrite.ts","../../api/multi-selection.ts","../../api/scheduler.ts","../../api/scroller.ts","../../api/selections.ts","../../api/split-pane.ts","../../api/spreadsheet-api.ts","../../api/table-auto-expansion.ts","../../api/table.ts","../../api/validation-tooltip.tsx","../../api/validation.ts","../../atoms/active-editor.atom.ts","../../atoms/advanced-filter-dialog.atom.ts","../../atoms/calculated-column-fill.atom.ts","../../atoms/cell-editor-mode.atom.ts","../../atoms/cell-input-context.atom.ts","../../atoms/chart-actions.atom.ts","../../atoms/consolidate-dialog.atom.ts","../../atoms/copied-range.atom.ts","../../atoms/editing-cell.atom.ts","../../atoms/enter-key-direction.atom.ts","../../atoms/evaluate-formula-dialog.atom.ts","../../atoms/fill-options.atom.ts","../../atoms/fill-series-dialog.atom.ts","../../atoms/flash-fill-options.atom.ts","../../atoms/formula-bar-editor-value.atom.ts","../../atoms/formula-mode.atom.ts","../../atoms/formula-selection-state.atom.ts","../../atoms/formula-selections.atom.ts","../../atoms/frozen-area-sent.atom.ts","../../atoms/go-to-dialog.atom.ts","../../atoms/goal-seek-dialog.atom.ts","../../atoms/index.ts","../../atoms/insert-cells-dialog.atom.ts","../../atoms/insert-options.atom.ts","../../atoms/loading-indicator.atom.ts","../../atoms/magic-fill-state.atom.ts","../../atoms/move-chart-dialog.atom.ts","../../atoms/move-overwrite-confirm.atom.ts","../../atoms/outline-settings-dialog.atom.ts","../../atoms/paste-menu.atom.ts","../../atoms/paste-special-dialog.atom.ts","../../atoms/persistent-tooltip.atom.ts","../../atoms/pick-list.atom.ts","../../atoms/popover.atom.ts","../../atoms/range-selector.atom.ts","../../atoms/remove-duplicates-dialog.atom.ts","../../atoms/selected-chart-embed.atom.ts","../../atoms/selected-chart-series.atom.ts","../../atoms/selected-object-formula.atom.ts","../../atoms/sheet-context.atom.ts","../../atoms/sheet-status-display.atom.ts","../../atoms/show-formula-help.atom.ts","../../atoms/sort-dialog.atom.ts","../../atoms/sparkline-dialog.atom.ts","../../atoms/spreadsheet-api.atom.ts","../../atoms/subtotal-dialog.atom.ts","../../atoms/table-auto-expansion.atom.ts","../../atoms/text-to-columns-dialog.atom.ts","../../atoms/undo-redo-sent.atom.ts","../../atoms/validation-alert.atom.ts","../../atoms/watch-window.atom.ts","../../components/advanced-filter-dialog/index.tsx","../../components/autocorrect-options-smart-tag/index.tsx","../../components/bottom-bar/index.tsx","../../components/calculated-column-smart-tag/index.tsx","../../components/calculation-options-dialog/index.tsx","../../components/canvas-grid/frozen-start.ts","../../components/canvas-grid/helpers.ts","../../components/canvas-grid/index.tsx","../../components/canvas-grid/overflow.ts","../../components/canvas-grid/page-break-preview-styles.ts","../../components/canvas-grid/page-breaks.ts","../../components/canvas-grid/typings.ts","../../components/cell/alignment.ts","../../components/cell/cell-background.tsx","../../components/cell/cell-backgrounds.tsx","../../components/cell/cell-text-runs.tsx","../../components/cell/helpers.ts","../../components/cell/index.tsx","../../components/cell/line-height.ts","../../components/cell/number-format-layout.ts","../../components/cell/rich-text.ts","../../components/cell/typings.ts","../../components/cell-arrow/index.tsx","../../components/cell-calculated/index.tsx","../../components/cell-checkbox/index.tsx","../../components/cell-diff/index.tsx","../../components/cell-editor/calendar-popup.tsx","../../components/cell-editor/formula-result-preview.tsx","../../components/cell-editor/helpers.ts","../../components/cell-editor/index.tsx","../../components/cell-editor/style.tsx","../../components/cell-expand/index.tsx","../../components/cell-filter/index.tsx","../../components/cell-group/index.tsx","../../components/cell-indicator/index.tsx","../../components/cell-input/cell-input.tsx","../../components/cell-input/formula-bar-cell-input.tsx","../../components/cell-input/index.tsx","../../components/cell-input/style.tsx","../../components/cell-overlay/index.tsx","../../components/cell-structured/cell-image.tsx","../../components/cell-structured/image-geometry.ts","../../components/cell-structured/index.tsx","../../components/cell-structured/sparkline-math.ts","../../components/cell-structured/sparkline.tsx","../../components/cell-structured/types.ts","../../components/cell-tooltip/index.tsx","../../components/cell-tooltip/note-editor.tsx","../../components/cell-tooltip/style.tsx","../../components/cf-icon-preview/index.tsx","../../components/chart-sheet-view/index.tsx","../../components/consolidate-dialog/index.tsx","../../components/context-menu/embed-context-menu.tsx","../../components/context-menu/index.tsx","../../components/context-menu/menu.tsx","../../components/context-menu/style.tsx","../../components/context-menu/total-row-function-menu.tsx","../../components/context-menu/total-row-functions.ts","../../components/data-table-dialog/index.tsx","../../components/embeds/chart-component.tsx","../../components/embeds/embed-component.tsx","../../components/embeds/embed-draggable.tsx","../../components/embeds/index.tsx","../../components/embeds/linked-picture.tsx","../../components/embeds/object-cell-offset.ts","../../components/embeds/object-focus.ts","../../components/embeds/page-gaps.ts","../../components/embeds/pane-copy.tsx","../../components/embeds/shape-geometry.ts","../../components/embeds/shape-svg.tsx","../../components/embeds/slicer-component.tsx","../../components/embeds/text-box-view.tsx","../../components/error-check-smart-tag/index.tsx","../../components/evaluate-formula-dialog/index.tsx","../../components/fill-handle/index.tsx","../../components/fill-series-dialog/index.tsx","../../components/filter-box/date-tree.ts","../../components/filter-box/filter-by-color.tsx","../../components/filter-box/filter-by-condition.tsx","../../components/filter-box/filter-by-value.tsx","../../components/filter-box/index.tsx","../../components/flash-fill-options-smart-tag/index.tsx","../../components/floating-cell-editor/index.tsx","../../components/forecast-sheet-dialog/index.tsx","../../components/formula-bar/index.tsx","../../components/formula-bar/style.tsx","../../components/formula-input/index.tsx","../../components/go-to-dialog/index.tsx","../../components/goal-seek-dialog/index.tsx","../../components/grid-footer/index.tsx","../../components/header-cell/index.tsx","../../components/header-menu/index.tsx","../../components/header-move/index.tsx","../../components/header-resizer/index.tsx","../../components/hidden-markers/index.tsx","../../components/hidden-markers/style.tsx","../../components/insert-cells-dialog/index.tsx","../../components/insert-function-dialog/index.tsx","../../components/insert-options-smart-tag/index.tsx","../../components/loading-indicator/index.tsx","../../components/move-chart-dialog/index.tsx","../../components/move-overwrite-confirm-dialog/index.tsx","../../components/outline-gutter/index.tsx","../../components/outline-gutter/offsets.ts","../../components/outline-settings-dialog/index.tsx","../../components/page-layout-view/compute-page-layout.ts","../../components/page-layout-view/header-footer-codes.ts","../../components/page-layout-view/index.ts","../../components/page-layout-view/page-layout-chrome.tsx","../../components/paste-special-dialog/index.tsx","../../components/pivot-placeholder/index.tsx","../../components/print-preview/cell-styles.ts","../../components/print-preview/index.ts","../../components/print-preview/page-block.tsx","../../components/print-preview/page-break-preview.ts","../../components/print-preview/print-cells.ts","../../components/print-preview/print-comments.tsx","../../components/print-preview/print-preview-dialog.tsx","../../components/print-preview/run-print.ts","../../components/print-preview/settings.ts","../../components/print-preview/sheet-page-setup.ts","../../components/print-preview/use-page-layout.ts","../../components/protect-sheet-dialog/allow-edit-ranges-dialog.tsx","../../components/protect-sheet-dialog/constants.ts","../../components/protect-sheet-dialog/index.tsx","../../components/range-selector/index.tsx","../../components/remove-duplicates-dialog/index.tsx","../../components/resizer/index.tsx","../../components/scenario-manager-dialog/index.tsx","../../components/selection/avatar.tsx","../../components/selection/fill-options-menu.tsx","../../components/selection/index.tsx","../../components/selection/magic-fill.tsx","../../components/selection/paste-menu.tsx","../../components/selection/paste-options.ts","../../components/selection/quick-edit.tsx","../../components/selection/style.tsx","../../components/selection/suggestion-action.tsx","../../components/selection/title.tsx","../../components/selection/types.ts","../../components/selection-drop-menu/index.tsx","../../components/selection-input/index.tsx","../../components/selection-input/style.tsx","../../components/sheet-background/index.tsx","../../components/sheet-search/index.tsx","../../components/sheet-status/index.tsx","../../components/sheet-status/style.tsx","../../components/sheet-switcher/index.tsx","../../components/sheet-switcher/new-sheet-button.tsx","../../components/sheet-tabs/context-menu.tsx","../../components/sheet-tabs/index.tsx","../../components/sheet-tabs/sheet-tab.tsx","../../components/sheet-tabs/style.tsx","../../components/sheet-tabs/types.ts","../../components/solver-dialog/index.tsx","../../components/sort-range-dialog/index.tsx","../../components/sparkline-dialog/index.tsx","../../components/subtotal-dialog/index.tsx","../../components/table-auto-expansion-smart-tag/index.tsx","../../components/text-to-columns-dialog/index.tsx","../../components/toolbar/background-color-selector.tsx","../../components/toolbar/border-color-selector.tsx","../../components/toolbar/border-line-style-options.tsx","../../components/toolbar/border-line-style-selector.tsx","../../components/toolbar/border-location-options.tsx","../../components/toolbar/border-selector.tsx","../../components/toolbar/buttons.tsx","../../components/toolbar/cell-style-selector.tsx","../../components/toolbar/color-selector.tsx","../../components/toolbar/fill-selectors.tsx","../../components/toolbar/font-family-selector.tsx","../../components/toolbar/font-size-selector.tsx","../../components/toolbar/index.tsx","../../components/toolbar/insert-menu.tsx","../../components/toolbar/merge-cells-selector.tsx","../../components/toolbar/scale-selector.tsx","../../components/toolbar/sparkline-actions.tsx","../../components/toolbar/style.tsx","../../components/toolbar/table-actions.tsx","../../components/toolbar/table-style-editor.tsx","../../components/toolbar/table-style-selector.tsx","../../components/toolbar/text-color-selector.tsx","../../components/toolbar/text-format-selector.tsx","../../components/toolbar/text-horizontal-align-selector.tsx","../../components/toolbar/text-rotation-selector.tsx","../../components/toolbar/text-vertical-align-selector.tsx","../../components/toolbar/text-wrap-selector.tsx","../../components/toolbar/theme-selector.tsx","../../components/toolbar/toolbar.tsx","../../components/toolbar/types.ts","../../components/toolbar/view-menu.tsx","../../components/validation-alert-dialog/index.tsx","../../components/watch-window/index.tsx","../../helpers/merged-cell-borders.ts","../../hooks/export-range-tiles.ts","../../hooks/index.ts","../../hooks/object-clipboard-payload.ts","../../hooks/object-spec-schema.generated.ts","../../hooks/show-zeros.ts","../../hooks/use-async.ts","../../hooks/use-border-styles.ts","../../hooks/use-callback-ref.ts","../../hooks/use-cell-diff-highlight.ts","../../hooks/use-cell-popover.tsx","../../hooks/use-cell-renderer.tsx","../../hooks/use-chart-clipboard.ts","../../hooks/use-chart-source-ranges.ts","../../hooks/use-column-color-icons.ts","../../hooks/use-conditional-formatting.ts","../../hooks/use-context-menu.tsx","../../hooks/use-context-setter.ts","../../hooks/use-copy-paste-cut.tsx","../../hooks/use-create-address-from-selection.ts","../../hooks/use-create-formula-tokenizer.ts","../../hooks/use-delayed-value.ts","../../hooks/use-editable.tsx","../../hooks/use-editor-cancel.ts","../../hooks/use-editor-change.ts","../../hooks/use-editor-keydown.ts","../../hooks/use-editor-submit.ts","../../hooks/use-embeds-charts.tsx","../../hooks/use-expand-cell.tsx","../../hooks/use-export-range.ts","../../hooks/use-filter.ts","../../hooks/use-flash-fill-suggestion.ts","../../hooks/use-flash.ts","../../hooks/use-fonts.ts","../../hooks/use-formula-range-helpers.ts","../../hooks/use-get-tooltip.tsx","../../hooks/use-get-values-from-range.ts","../../hooks/use-grid-children.tsx","../../hooks/use-header-actions.tsx","../../hooks/use-hidden-dimension-markers.tsx","../../hooks/use-hidden-dimensions.ts","../../hooks/use-hovered-selection-ids.ts","../../hooks/use-isomorphic-layout-effect.ts","../../hooks/use-keyboard-handler.tsx","../../hooks/use-licensekey-validator.tsx","../../hooks/use-memo-compare.ts","../../hooks/use-merge.refs.ts","../../hooks/use-move-columns-rows.tsx","../../hooks/use-navigate-sheet-range.ts","../../hooks/use-previous.ts","../../hooks/use-raf.ts","../../hooks/use-resize-observer.ts","../../hooks/use-reveal-chart-embed.ts","../../hooks/use-scale-listener.ts","../../hooks/use-selected-rows-columns.ts","../../hooks/use-selection-aware-formatting.ts","../../hooks/use-selection-change.ts","../../hooks/use-selection-drag-copy.ts","../../hooks/use-selection-interceptors.ts","../../hooks/use-selection-move.ts","../../hooks/use-selection-renderer.tsx","../../hooks/use-selection-resize.ts","../../hooks/use-selection.ts","../../hooks/use-sheet-change-handler.ts","../../hooks/use-shown-notes.tsx","../../hooks/use-sizer.ts","../../hooks/use-spreadsheet-theme.ts","../../hooks/use-stable-ref.ts","../../hooks/use-structured-reference-selection.ts","../../hooks/use-table-hit-zones.ts","../../hooks/use-table-resizer.tsx","../../hooks/use-text-dimensions.ts","../../hooks/use-tooltip.ts","../../hooks/use-touch.ts","../../providers/spreadsheet-provider.tsx","../../signals/scroll-subscriber.ts","../../utils/copy-as-picture.ts","../../utils/maybe.ts","../../utils/pivot-chart-field-buttons.ts","../../utils/z-order.ts"],"version":"5.8.3"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { GridRange } from "@rowsncolumns/grid";
|
|
2
2
|
import type { FillSeriesSpec } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* The Series dialog's Stop value as the serial the spec carries, read the way a cell entry is read,
|
|
5
|
+
* for a host that does not parse it itself (`CanvasGrid`'s `parseCellEntryNumber`, which the rnc
|
|
6
|
+
* engine's hook answers with the cell-entry inference). `undefined` when the text is empty or would
|
|
7
|
+
* not be a number in a cell (text, a boolean).
|
|
8
|
+
* - A day / month without a year (`3/4`, `15/1`) follows the locale's order (3 April and 15 January
|
|
9
|
+
* in en-GB, 4 March in en-US), in the current year, as a cell entry does. Where the decimal mark is a
|
|
10
|
+
* comma, `1.5` is such a date too (1 May in de-DE).
|
|
11
|
+
* - A plain number is taken as it is (`45306`, `-2.5`, `1e3`; `1.5` where the decimal mark is `.`).
|
|
12
|
+
* - A date with a year, a date and time, or a time, in the locale (`15/1/2024` in en-GB,
|
|
13
|
+
* `15.1.2024` in de-DE, `Jan 15, 2024`, `2024-01-15`, `1/15/2024 12:00`, `10:30`). A date counts
|
|
14
|
+
* in the workbook's date system (1462 lower in a 1904 workbook); a time part is kept.
|
|
15
|
+
* - A number the locale writes otherwise: `2,5` in de-DE, `50%` (0.5), `1,000` (1000) and `$5` in en-US.
|
|
16
|
+
*/
|
|
17
|
+
export declare const parseSeriesStopValue: (text: string, options?: {
|
|
18
|
+
locale?: string;
|
|
19
|
+
date1904?: boolean;
|
|
20
|
+
}) => number | undefined;
|
|
3
21
|
/**
|
|
4
22
|
* The seed line of a Series-dialog fill: Excel treats the target range's first
|
|
5
23
|
* row (Series in Columns — filling down) or first column (Series in Rows —
|
|
@@ -9,20 +27,36 @@ export declare const seedRangeForSeriesSpec: (target: GridRange, spec: FillSerie
|
|
|
9
27
|
/**
|
|
10
28
|
* How many series values fit before `stop` is passed, starting from the seed's
|
|
11
29
|
* last value. `undefined` when the spec has no usable stop (no stop, zero step,
|
|
12
|
-
* a
|
|
13
|
-
*
|
|
30
|
+
* a trend, AutoFill, a Growth that shrinks toward zero and never reaches a stop
|
|
31
|
+
* on the other side, …): a seed-only selection is then not filled at all. A Date
|
|
32
|
+
* series counts on the calendar: a 1904 workbook's serials (`date1904`) are
|
|
33
|
+
* moved onto the 1900 system first, as the engine does with the seed and stop.
|
|
14
34
|
*/
|
|
15
|
-
export declare const seriesCountToStop: (last: number, spec: FillSeriesSpec
|
|
35
|
+
export declare const seriesCountToStop: (last: number, spec: FillSeriesSpec, options?: {
|
|
36
|
+
date1904?: boolean;
|
|
37
|
+
}) => number | undefined;
|
|
16
38
|
export type FillRangeForSeriesSpecArgs = {
|
|
17
39
|
/** The range the user selected (seed + cells to fill). */
|
|
18
40
|
target: GridRange;
|
|
19
41
|
/** From {@link seedRangeForSeriesSpec}. */
|
|
20
42
|
seed: GridRange;
|
|
21
43
|
spec: FillSeriesSpec;
|
|
22
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The value a seed cell starts the series from, or `undefined` when the engine would not run its
|
|
46
|
+
* line as this series (not a number, a formula, or, for a Date series, not a date). A seed-only
|
|
47
|
+
* selection with any such line fills nothing: the engine would fill that line with its regular
|
|
48
|
+
* generator over the whole range, ignoring the stop.
|
|
49
|
+
*/
|
|
23
50
|
getSeedValue(rowIndex: number, columnIndex: number): number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Bounds of the fill: the last row index is `rowCount - 1` and the last column index
|
|
53
|
+
* `columnCount - 1`. A host whose rows / columns start at index 1 passes its sheet's last index
|
|
54
|
+
* + 1 (CanvasGrid passes the sheet maximum, 1,048,576 rows × 16,384 columns, not its drawn extent).
|
|
55
|
+
*/
|
|
24
56
|
rowCount: number;
|
|
25
57
|
columnCount: number;
|
|
58
|
+
/** The workbook counts dates in the 1904 system (a Date series' stop is one of its serials). */
|
|
59
|
+
date1904?: boolean;
|
|
26
60
|
};
|
|
27
61
|
/**
|
|
28
62
|
* The range a Series-dialog fill covers (seed + cells to fill). A selection
|
|
@@ -30,9 +64,15 @@ export type FillRangeForSeriesSpecArgs = {
|
|
|
30
64
|
* is nothing beyond the seed and no stop): the engines apply the `stop` value
|
|
31
65
|
* per fill line — every column (Series in Columns) / row (Rows) ends at the
|
|
32
66
|
* last value within its own stop and the remaining selected cells stay
|
|
33
|
-
* untouched, exactly as Excel leaves them.
|
|
34
|
-
*
|
|
35
|
-
* Excel
|
|
67
|
+
* untouched, exactly as Excel leaves them. A seed-only selection (one cell, or
|
|
68
|
+
* one line across the axis) is extended along the axis to the LONGEST of its
|
|
69
|
+
* lines' series — Excel runs every line from its own seed until its next value
|
|
70
|
+
* would pass the stop (A1:C1 = 8, 1, 5, Columns, Stop 10 fills A to 10, B to 10
|
|
71
|
+
* and C to 10: rows 2–3, 2–10 and 2–6) — and the engine's stop ends each
|
|
72
|
+
* shorter line inside that range. When any line is one the engine will not run
|
|
73
|
+
* as the series (`getSeedValue` answers `undefined`: text, empty, a formula, a
|
|
74
|
+
* plain number under Date), nothing is filled: the engine would copy or clear
|
|
75
|
+
* that line down the whole range.
|
|
36
76
|
*/
|
|
37
|
-
export declare const fillRangeForSeriesSpec: ({ target, seed, spec, getSeedValue, rowCount, columnCount, }: FillRangeForSeriesSpecArgs) => GridRange | undefined;
|
|
77
|
+
export declare const fillRangeForSeriesSpec: ({ target, seed, spec, getSeedValue, rowCount, columnCount, date1904, }: FillRangeForSeriesSpecArgs) => GridRange | undefined;
|
|
38
78
|
//# sourceMappingURL=fill-series.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-series.d.ts","sourceRoot":"","sources":["../../../api/fill-series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"fill-series.d.ts","sourceRoot":"","sources":["../../../api/fill-series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAkC/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,KACpD,MAAM,GAAG,SA8CX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,SAAS,EACjB,MAAM,cAAc,KACnB,SAGyD,CAAC;AAyF7D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EACZ,MAAM,cAAc,EACpB,UAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,KACnC,MAAM,GAAG,SA0CX,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,0DAA0D;IAC1D,MAAM,EAAE,SAAS,CAAC;IAClB,2CAA2C;IAC3C,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAAI,wEAQpC,0BAA0B,KAAG,SAAS,GAAG,SAgC3C,CAAC"}
|
|
@@ -1,3 +1,92 @@
|
|
|
1
|
+
import { parseDate, parseNumber, parseTime } from "numfmt";
|
|
2
|
+
/** Days from the 1900 date system's day zero to the 1904 system's (`DATE1904_OFFSET`). */
|
|
3
|
+
const DATE_1904_OFFSET = 1462;
|
|
4
|
+
/** A locale's day / month order and decimal mark, from `Intl` (en-US conventions on a bad tag). */
|
|
5
|
+
const localeEntryConventions = (locale) => {
|
|
6
|
+
try {
|
|
7
|
+
const order = new Intl.DateTimeFormat(locale, {
|
|
8
|
+
year: "numeric",
|
|
9
|
+
month: "numeric",
|
|
10
|
+
day: "numeric",
|
|
11
|
+
})
|
|
12
|
+
.formatToParts(new Date(2024, 11, 25))
|
|
13
|
+
.map((part) => part.type);
|
|
14
|
+
const decimal = new Intl.NumberFormat(locale)
|
|
15
|
+
.formatToParts(1.5)
|
|
16
|
+
.find((part) => part.type === "decimal")?.value ?? ".";
|
|
17
|
+
return {
|
|
18
|
+
monthFirst: order.indexOf("month") < order.indexOf("day"),
|
|
19
|
+
decimal,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return { monthFirst: true, decimal: "." };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/** Excel's serial for a calendar date (UTC arithmetic, the same in every timezone; from 1 March 1900). */
|
|
27
|
+
const calendarSerial = (year, month, day) => (Date.UTC(year, month - 1, day) - Date.UTC(1899, 11, 30)) / 86_400_000;
|
|
28
|
+
/**
|
|
29
|
+
* The Series dialog's Stop value as the serial the spec carries, read the way a cell entry is read,
|
|
30
|
+
* for a host that does not parse it itself (`CanvasGrid`'s `parseCellEntryNumber`, which the rnc
|
|
31
|
+
* engine's hook answers with the cell-entry inference). `undefined` when the text is empty or would
|
|
32
|
+
* not be a number in a cell (text, a boolean).
|
|
33
|
+
* - A day / month without a year (`3/4`, `15/1`) follows the locale's order (3 April and 15 January
|
|
34
|
+
* in en-GB, 4 March in en-US), in the current year, as a cell entry does. Where the decimal mark is a
|
|
35
|
+
* comma, `1.5` is such a date too (1 May in de-DE).
|
|
36
|
+
* - A plain number is taken as it is (`45306`, `-2.5`, `1e3`; `1.5` where the decimal mark is `.`).
|
|
37
|
+
* - A date with a year, a date and time, or a time, in the locale (`15/1/2024` in en-GB,
|
|
38
|
+
* `15.1.2024` in de-DE, `Jan 15, 2024`, `2024-01-15`, `1/15/2024 12:00`, `10:30`). A date counts
|
|
39
|
+
* in the workbook's date system (1462 lower in a 1904 workbook); a time part is kept.
|
|
40
|
+
* - A number the locale writes otherwise: `2,5` in de-DE, `50%` (0.5), `1,000` (1000) and `$5` in en-US.
|
|
41
|
+
*/
|
|
42
|
+
export const parseSeriesStopValue = (text, options = {}) => {
|
|
43
|
+
const trimmed = text.trim();
|
|
44
|
+
if (!trimmed)
|
|
45
|
+
return undefined;
|
|
46
|
+
const { locale } = options;
|
|
47
|
+
const shift = options.date1904 ? DATE_1904_OFFSET : 0;
|
|
48
|
+
const { monthFirst, decimal } = localeEntryConventions(locale);
|
|
49
|
+
const yearless = /^(\d{1,2})([/.-])(\d{1,2})$/.exec(trimmed);
|
|
50
|
+
if (yearless && (yearless[2] !== "." || decimal === ",")) {
|
|
51
|
+
const first = Number(yearless[1]);
|
|
52
|
+
const second = Number(yearless[3]);
|
|
53
|
+
const [month, day] = monthFirst ? [first, second] : [second, first];
|
|
54
|
+
const year = new Date().getFullYear();
|
|
55
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
56
|
+
if (month >= 1 &&
|
|
57
|
+
month <= 12 &&
|
|
58
|
+
date.getUTCMonth() === month - 1 &&
|
|
59
|
+
date.getUTCDate() === day) {
|
|
60
|
+
return calendarSerial(year, month, day) - shift;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (/^[+-]?\d+$/.test(trimmed) || decimal === ".") {
|
|
65
|
+
const number = Number(trimmed);
|
|
66
|
+
if (Number.isFinite(number))
|
|
67
|
+
return number;
|
|
68
|
+
}
|
|
69
|
+
const parseOptions = locale ? { locale } : undefined;
|
|
70
|
+
try {
|
|
71
|
+
const date = parseDate(trimmed, parseOptions);
|
|
72
|
+
if (date && typeof date.v === "number" && Number.isFinite(date.v)) {
|
|
73
|
+
return date.v - shift;
|
|
74
|
+
}
|
|
75
|
+
// A time alone is a fraction of a day, the same in both date systems.
|
|
76
|
+
const time = parseTime(trimmed, parseOptions);
|
|
77
|
+
if (time && typeof time.v === "number" && Number.isFinite(time.v)) {
|
|
78
|
+
return time.v;
|
|
79
|
+
}
|
|
80
|
+
const number = parseNumber(trimmed, parseOptions);
|
|
81
|
+
if (number && typeof number.v === "number" && Number.isFinite(number.v)) {
|
|
82
|
+
return number.v;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// numfmt throws on a malformed locale tag: the text is then refused.
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
};
|
|
1
90
|
/**
|
|
2
91
|
* The seed line of a Series-dialog fill: Excel treats the target range's first
|
|
3
92
|
* row (Series in Columns — filling down) or first column (Series in Rows —
|
|
@@ -6,15 +95,95 @@
|
|
|
6
95
|
export const seedRangeForSeriesSpec = (target, spec) => spec.in === "columns"
|
|
7
96
|
? { ...target, endRowIndex: target.startRowIndex }
|
|
8
97
|
: { ...target, endColumnIndex: target.startColumnIndex };
|
|
98
|
+
/**
|
|
99
|
+
* Days from 1970-01-01 to serial 0 of the 1900 system (1899-12-30). The calendar below is the
|
|
100
|
+
* engine's (`civil_from_days` / `days_from_civil`, proleptic Gregorian), in integer arithmetic so a
|
|
101
|
+
* Stop far outside `Date`'s range still counts.
|
|
102
|
+
*/
|
|
103
|
+
const SERIAL_EPOCH_CIVIL_DAYS = -25_569;
|
|
104
|
+
const serialToYmd = (serial) => {
|
|
105
|
+
const z = serial + SERIAL_EPOCH_CIVIL_DAYS + 719_468;
|
|
106
|
+
const era = Math.floor(z / 146_097);
|
|
107
|
+
const doe = z - era * 146_097;
|
|
108
|
+
const yoe = Math.floor((doe - Math.floor(doe / 1460) + Math.floor(doe / 36_524) - Math.floor(doe / 146_096)) / 365);
|
|
109
|
+
const doy = doe - (365 * yoe + Math.floor(yoe / 4) - Math.floor(yoe / 100));
|
|
110
|
+
const mp = Math.floor((5 * doy + 2) / 153);
|
|
111
|
+
const day = doy - Math.floor((153 * mp + 2) / 5) + 1;
|
|
112
|
+
const month = mp < 10 ? mp + 3 : mp - 9;
|
|
113
|
+
return [yoe + era * 400 + (month <= 2 ? 1 : 0), month, day];
|
|
114
|
+
};
|
|
115
|
+
const ymdToSerial = (year, month, day) => {
|
|
116
|
+
const y = month <= 2 ? year - 1 : year;
|
|
117
|
+
const era = Math.floor(y / 400);
|
|
118
|
+
const yoe = y - era * 400;
|
|
119
|
+
const doy = Math.floor((153 * (month > 2 ? month - 3 : month + 9) + 2) / 5) + day - 1;
|
|
120
|
+
const doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
|
|
121
|
+
return era * 146_097 + doe - 719_468 - SERIAL_EPOCH_CIVIL_DAYS;
|
|
122
|
+
};
|
|
123
|
+
const daysInMonth = (year, month) => month === 2
|
|
124
|
+
? (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0
|
|
125
|
+
? 29
|
|
126
|
+
: 28
|
|
127
|
+
: [4, 6, 9, 11].includes(month)
|
|
128
|
+
? 30
|
|
129
|
+
: 31;
|
|
130
|
+
/** `serial` + `months` months, the day of month clamped to the target month's length (Jan 31 + 1 → Feb 28). */
|
|
131
|
+
const addMonthsClamped = (serial, months) => {
|
|
132
|
+
const [year, month, day] = serialToYmd(serial);
|
|
133
|
+
const total = year * 12 + (month - 1) + months;
|
|
134
|
+
const targetYear = Math.floor(total / 12);
|
|
135
|
+
const targetMonth = total - targetYear * 12 + 1;
|
|
136
|
+
return ymdToSerial(targetYear, targetMonth, Math.min(day, daysInMonth(targetYear, targetMonth)));
|
|
137
|
+
};
|
|
138
|
+
/** Weekdays (Mon–Fri) among serials up to `day`, from a fixed origin: serial 0 is a Saturday. */
|
|
139
|
+
const weekdaysThrough = (day) => {
|
|
140
|
+
const weeks = Math.floor(day / 7);
|
|
141
|
+
return weeks * 5 + Math.max(0, day - weeks * 7 - 1);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* How many values a Date series in `unit`s of `step` (a whole, non-zero number) takes from the day
|
|
145
|
+
* `lastDay` before passing `stopDay` — the engine's calendar: each weekday step skips Saturdays and
|
|
146
|
+
* Sundays (from a weekend seed the first value is the Monday), and the k-th month / year value is the
|
|
147
|
+
* seed's day of month moved k steps and clamped to that month (1/31 → 2/28 → 3/31).
|
|
148
|
+
*/
|
|
149
|
+
const dateCountToStop = (lastDay, stopDay, step, unit) => {
|
|
150
|
+
const ascending = step > 0;
|
|
151
|
+
if (ascending ? stopDay <= lastDay : stopDay >= lastDay)
|
|
152
|
+
return 0;
|
|
153
|
+
const size = Math.abs(step);
|
|
154
|
+
if (unit === "day")
|
|
155
|
+
return Math.floor(Math.abs(stopDay - lastDay) / size);
|
|
156
|
+
if (unit === "weekday") {
|
|
157
|
+
// The k-th value is the (k × step)-th weekday after the seed.
|
|
158
|
+
const weekdays = ascending
|
|
159
|
+
? weekdaysThrough(stopDay) - weekdaysThrough(lastDay)
|
|
160
|
+
: weekdaysThrough(lastDay - 1) - weekdaysThrough(stopDay - 1);
|
|
161
|
+
return Math.floor(weekdays / size);
|
|
162
|
+
}
|
|
163
|
+
const monthsPerStep = unit === "year" ? 12 * step : step;
|
|
164
|
+
const [lastYear, lastMonth] = serialToYmd(lastDay);
|
|
165
|
+
const [stopYear, stopMonth] = serialToYmd(stopDay);
|
|
166
|
+
const months = Math.abs(stopYear * 12 + stopMonth - (lastYear * 12 + lastMonth));
|
|
167
|
+
const count = Math.floor(months / Math.abs(monthsPerStep));
|
|
168
|
+
// The value landing in the Stop's own month may still pass it by its day of month.
|
|
169
|
+
const value = addMonthsClamped(lastDay, monthsPerStep * count);
|
|
170
|
+
return count > 0 && (ascending ? value > stopDay : value < stopDay) ? count - 1 : count;
|
|
171
|
+
};
|
|
9
172
|
/**
|
|
10
173
|
* How many series values fit before `stop` is passed, starting from the seed's
|
|
11
174
|
* last value. `undefined` when the spec has no usable stop (no stop, zero step,
|
|
12
|
-
* a
|
|
13
|
-
*
|
|
175
|
+
* a trend, AutoFill, a Growth that shrinks toward zero and never reaches a stop
|
|
176
|
+
* on the other side, …): a seed-only selection is then not filled at all. A Date
|
|
177
|
+
* series counts on the calendar: a 1904 workbook's serials (`date1904`) are
|
|
178
|
+
* moved onto the 1900 system first, as the engine does with the seed and stop.
|
|
14
179
|
*/
|
|
15
|
-
export const seriesCountToStop = (last, spec) => {
|
|
180
|
+
export const seriesCountToStop = (last, spec, options = {}) => {
|
|
16
181
|
const { stop } = spec;
|
|
17
|
-
if (stop === undefined || !Number.isFinite(stop))
|
|
182
|
+
if (stop === undefined || !Number.isFinite(stop) || !Number.isFinite(last)) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
// Trend ignores Step and Stop (Excel greys both out).
|
|
186
|
+
if (spec.trend)
|
|
18
187
|
return undefined;
|
|
19
188
|
const step = spec.step ?? 1;
|
|
20
189
|
if (spec.type === "linear") {
|
|
@@ -26,16 +195,29 @@ export const seriesCountToStop = (last, spec) => {
|
|
|
26
195
|
if (spec.type === "growth") {
|
|
27
196
|
if (last === 0 || step <= 0 || step === 1)
|
|
28
197
|
return undefined;
|
|
29
|
-
if (Math.sign(last) !== Math.sign(stop))
|
|
30
|
-
|
|
198
|
+
if (Math.sign(last) !== Math.sign(stop)) {
|
|
199
|
+
// Growing away from zero the first value is already past a stop on the other side; shrinking
|
|
200
|
+
// toward zero the series never reaches it, so it has no count (the engine would run on).
|
|
201
|
+
return step > 1 ? 0 : undefined;
|
|
202
|
+
}
|
|
31
203
|
const n = Math.floor(Math.log(Math.abs(stop) / Math.abs(last)) / Math.log(step) + 1e-9);
|
|
32
204
|
return n >= 0 ? n : 0;
|
|
33
205
|
}
|
|
34
|
-
if (spec.type === "date"
|
|
35
|
-
|
|
206
|
+
if (spec.type === "date") {
|
|
207
|
+
// The engine steps a date series by whole units; Excel fills nothing for Step 0.
|
|
208
|
+
const wholeStep = Math.trunc(step);
|
|
209
|
+
if (wholeStep === 0)
|
|
36
210
|
return undefined;
|
|
37
|
-
const
|
|
38
|
-
|
|
211
|
+
const shift = options.date1904 ? DATE_1904_OFFSET : 0;
|
|
212
|
+
const lastValue = last + shift;
|
|
213
|
+
const stopValue = stop + shift;
|
|
214
|
+
const lastDay = Math.floor(lastValue);
|
|
215
|
+
// Every value carries the seed's time of day; a value passes the Stop when it is beyond it.
|
|
216
|
+
const time = lastValue - lastDay;
|
|
217
|
+
const stopDay = wholeStep > 0
|
|
218
|
+
? Math.floor(stopValue - time + 1e-9)
|
|
219
|
+
: Math.ceil(stopValue - time - 1e-9);
|
|
220
|
+
return dateCountToStop(lastDay, stopDay, wholeStep, spec.dateUnit ?? "day");
|
|
39
221
|
}
|
|
40
222
|
return undefined;
|
|
41
223
|
};
|
|
@@ -45,24 +227,41 @@ export const seriesCountToStop = (last, spec) => {
|
|
|
45
227
|
* is nothing beyond the seed and no stop): the engines apply the `stop` value
|
|
46
228
|
* per fill line — every column (Series in Columns) / row (Rows) ends at the
|
|
47
229
|
* last value within its own stop and the remaining selected cells stay
|
|
48
|
-
* untouched, exactly as Excel leaves them.
|
|
49
|
-
*
|
|
50
|
-
* Excel
|
|
230
|
+
* untouched, exactly as Excel leaves them. A seed-only selection (one cell, or
|
|
231
|
+
* one line across the axis) is extended along the axis to the LONGEST of its
|
|
232
|
+
* lines' series — Excel runs every line from its own seed until its next value
|
|
233
|
+
* would pass the stop (A1:C1 = 8, 1, 5, Columns, Stop 10 fills A to 10, B to 10
|
|
234
|
+
* and C to 10: rows 2–3, 2–10 and 2–6) — and the engine's stop ends each
|
|
235
|
+
* shorter line inside that range. When any line is one the engine will not run
|
|
236
|
+
* as the series (`getSeedValue` answers `undefined`: text, empty, a formula, a
|
|
237
|
+
* plain number under Date), nothing is filled: the engine would copy or clear
|
|
238
|
+
* that line down the whole range.
|
|
51
239
|
*/
|
|
52
|
-
export const fillRangeForSeriesSpec = ({ target, seed, spec, getSeedValue, rowCount, columnCount, }) => {
|
|
240
|
+
export const fillRangeForSeriesSpec = ({ target, seed, spec, getSeedValue, rowCount, columnCount, date1904, }) => {
|
|
53
241
|
const down = spec.in === "columns";
|
|
54
|
-
// Excel reads the stop against the first seed line's last value.
|
|
55
|
-
const last = down
|
|
56
|
-
? getSeedValue(seed.endRowIndex, seed.startColumnIndex)
|
|
57
|
-
: getSeedValue(seed.startRowIndex, seed.endColumnIndex);
|
|
58
242
|
const selectedBeyondSeed = down
|
|
59
243
|
? target.endRowIndex - seed.endRowIndex
|
|
60
244
|
: target.endColumnIndex - seed.endColumnIndex;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
245
|
+
let extent = selectedBeyondSeed;
|
|
246
|
+
if (extent <= 0) {
|
|
247
|
+
// Every line of the seed continues from its own last value.
|
|
248
|
+
const [first, end] = down
|
|
249
|
+
? [seed.startColumnIndex, seed.endColumnIndex]
|
|
250
|
+
: [seed.startRowIndex, seed.endRowIndex];
|
|
251
|
+
for (let line = first; line <= end; line++) {
|
|
252
|
+
const last = down
|
|
253
|
+
? getSeedValue(seed.endRowIndex, line)
|
|
254
|
+
: getSeedValue(line, seed.endColumnIndex);
|
|
255
|
+
if (last === undefined)
|
|
256
|
+
return undefined;
|
|
257
|
+
// No count to the stop (no stop, a step that never reaches it, …): the engine would run
|
|
258
|
+
// that line over the whole range, so nothing is filled.
|
|
259
|
+
const count = seriesCountToStop(last, spec, { date1904 });
|
|
260
|
+
if (count === undefined)
|
|
261
|
+
return undefined;
|
|
262
|
+
extent = Math.max(extent, count);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
66
265
|
if (extent <= 0)
|
|
67
266
|
return undefined;
|
|
68
267
|
if (down) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;
|
|
1
|
+
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBAC4m8F,CAAC;qBAAwB,CAAC;;;;;;;;;;;CADvl8F,CAAC"}
|
|
@@ -16,6 +16,12 @@ export type FillSeriesDialogRequest = {
|
|
|
16
16
|
/** Pre-selected axis (a right-drag seeds it from the drag direction). */
|
|
17
17
|
initialIn?: FillSeriesSpec["in"];
|
|
18
18
|
onApply(spec: FillSeriesSpec): void;
|
|
19
|
+
/** The workbook's locale, for a date typed in Stop value. */
|
|
20
|
+
locale?: string;
|
|
21
|
+
/** The workbook's 1904 date system, for a date typed in Stop value. */
|
|
22
|
+
date1904?: boolean;
|
|
23
|
+
/** The host's cell-entry reading of Stop value (`CanvasGrid` `parseCellEntryNumber`). */
|
|
24
|
+
parseStop?(text: string): number | undefined;
|
|
19
25
|
};
|
|
20
26
|
export declare const fillSeriesDialogAtom: import("jotai").PrimitiveAtom<FillSeriesDialogRequest | null> & {
|
|
21
27
|
init: FillSeriesDialogRequest | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-series-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/fill-series-dialog.atom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC;IAC1B,uFAAuF;IACvF,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC9C,yEAAyE;IACzE,SAAS,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"fill-series-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/fill-series-dialog.atom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC;IAC1B,uFAAuF;IACvF,SAAS,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC9C,yEAAyE;IACzE,SAAS,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;CAA6C,CAAC;AAE/E,eAAO,MAAM,wBAAwB,uKAAsC,CAAC;AAE5E,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,kBAGtB,uBAAuB,SAGpC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One axis of a freeze as it is sent: how many lines, and the first of them (absent = line 1).
|
|
3
|
+
* `seq`: the count the axis was noted at (set by {@link useNoteFrozenAreaSent}; absent = the
|
|
4
|
+
* value's `seq`). The grid consumes each axis once, by this count.
|
|
5
|
+
*/
|
|
6
|
+
export type FrozenAxisSent = {
|
|
7
|
+
count?: number;
|
|
8
|
+
start?: number | null;
|
|
9
|
+
seq?: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The last Freeze Panes / unfreeze this window itself sent, counted, with the area it asked for.
|
|
13
|
+
* `CanvasGrid` reads it so that only this window's own freeze or unfreeze places its view the way a
|
|
14
|
+
* Freeze Panes does (a frozen start, demo-app-monorepo#57258 W-5); the same change arriving from
|
|
15
|
+
* another window keeps the view's first line instead.
|
|
16
|
+
*
|
|
17
|
+
* Set by the engine hook wherever it sends one (`useSpreadsheetEngine`'s `onFreezeRow`,
|
|
18
|
+
* `onFreezeColumn`, and an `onUpdateSheet` that carries frozen counts or starts), by the legacy
|
|
19
|
+
* `useSpreadsheetState` freeze, and by `CanvasGrid`'s own menu, so a host whose ribbon calls those
|
|
20
|
+
* needs nothing more. A host that sends the command some other way calls `useNoteFrozenAreaSent()`
|
|
21
|
+
* right before it.
|
|
22
|
+
*/
|
|
23
|
+
export declare const frozenAreaSentAtom: import("jotai").PrimitiveAtom<{
|
|
24
|
+
seq: number;
|
|
25
|
+
sheetId: number;
|
|
26
|
+
rows?: FrozenAxisSent;
|
|
27
|
+
columns?: FrozenAxisSent;
|
|
28
|
+
} | null> & {
|
|
29
|
+
init: {
|
|
30
|
+
seq: number;
|
|
31
|
+
sheetId: number;
|
|
32
|
+
rows?: FrozenAxisSent;
|
|
33
|
+
columns?: FrozenAxisSent;
|
|
34
|
+
} | null;
|
|
35
|
+
};
|
|
36
|
+
export declare const useFrozenAreaSentValue: () => {
|
|
37
|
+
seq: number;
|
|
38
|
+
sheetId: number;
|
|
39
|
+
rows?: FrozenAxisSent;
|
|
40
|
+
columns?: FrozenAxisSent;
|
|
41
|
+
} | null;
|
|
42
|
+
/**
|
|
43
|
+
* Say "the next frozen-area change on this sheet is my own freeze" (see {@link frozenAreaSentAtom}).
|
|
44
|
+
* Noting one axis keeps the other axis's mark on the same sheet, with the count it was noted at,
|
|
45
|
+
* so a host that changes both axes in one act (`onFreezeRow` then `onFreezeColumn`) marks both;
|
|
46
|
+
* an axis the grid has already consumed keeps its old count and is not taken again
|
|
47
|
+
* (rowsncolumns/spreadsheet#1769). A mark on another sheet is dropped.
|
|
48
|
+
*/
|
|
49
|
+
export declare const useNoteFrozenAreaSent: () => (sheetId: number, area: {
|
|
50
|
+
rows?: FrozenAxisSent;
|
|
51
|
+
columns?: FrozenAxisSent;
|
|
52
|
+
}) => void;
|
|
53
|
+
//# sourceMappingURL=frozen-area-sent.atom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frozen-area-sent.atom.d.ts","sourceRoot":"","sources":["../../../atoms/frozen-area-sent.atom.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB;SACxB,MAAM;aACF,MAAM;WACR,cAAc;cACX,cAAc;;;aAHnB,MAAM;iBACF,MAAM;eACR,cAAc;kBACX,cAAc;;CACX,CAAC;AAEhB,eAAO,MAAM,sBAAsB;SAN5B,MAAM;aACF,MAAM;WACR,cAAc;cACX,cAAc;QAGkD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,kBAGpB,MAAM,QAAQ;IAAE,IAAI,CAAC,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,SAqB9E,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { atom, useAtomValue, useSetAtom } from "jotai";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The last Freeze Panes / unfreeze this window itself sent, counted, with the area it asked for.
|
|
5
|
+
* `CanvasGrid` reads it so that only this window's own freeze or unfreeze places its view the way a
|
|
6
|
+
* Freeze Panes does (a frozen start, demo-app-monorepo#57258 W-5); the same change arriving from
|
|
7
|
+
* another window keeps the view's first line instead.
|
|
8
|
+
*
|
|
9
|
+
* Set by the engine hook wherever it sends one (`useSpreadsheetEngine`'s `onFreezeRow`,
|
|
10
|
+
* `onFreezeColumn`, and an `onUpdateSheet` that carries frozen counts or starts), by the legacy
|
|
11
|
+
* `useSpreadsheetState` freeze, and by `CanvasGrid`'s own menu, so a host whose ribbon calls those
|
|
12
|
+
* needs nothing more. A host that sends the command some other way calls `useNoteFrozenAreaSent()`
|
|
13
|
+
* right before it.
|
|
14
|
+
*/
|
|
15
|
+
export const frozenAreaSentAtom = atom(null);
|
|
16
|
+
export const useFrozenAreaSentValue = () => useAtomValue(frozenAreaSentAtom);
|
|
17
|
+
/**
|
|
18
|
+
* Say "the next frozen-area change on this sheet is my own freeze" (see {@link frozenAreaSentAtom}).
|
|
19
|
+
* Noting one axis keeps the other axis's mark on the same sheet, with the count it was noted at,
|
|
20
|
+
* so a host that changes both axes in one act (`onFreezeRow` then `onFreezeColumn`) marks both;
|
|
21
|
+
* an axis the grid has already consumed keeps its old count and is not taken again
|
|
22
|
+
* (rowsncolumns/spreadsheet#1769). A mark on another sheet is dropped.
|
|
23
|
+
*/
|
|
24
|
+
export const useNoteFrozenAreaSent = () => {
|
|
25
|
+
const set = useSetAtom(frozenAreaSentAtom);
|
|
26
|
+
return useCallback((sheetId, area) => set((previous) => {
|
|
27
|
+
const seq = (previous?.seq ?? 0) + 1;
|
|
28
|
+
const kept = previous && previous.sheetId === sheetId ? previous : undefined;
|
|
29
|
+
const axis = (noted, held) => noted
|
|
30
|
+
? { ...noted, seq }
|
|
31
|
+
: held
|
|
32
|
+
? { ...held, seq: held.seq ?? kept?.seq }
|
|
33
|
+
: undefined;
|
|
34
|
+
const rows = axis(area.rows, kept?.rows);
|
|
35
|
+
const columns = axis(area.columns, kept?.columns);
|
|
36
|
+
return {
|
|
37
|
+
seq,
|
|
38
|
+
sheetId,
|
|
39
|
+
...(rows ? { rows } : {}),
|
|
40
|
+
...(columns ? { columns } : {}),
|
|
41
|
+
};
|
|
42
|
+
}), [set]);
|
|
43
|
+
};
|
|
@@ -35,6 +35,8 @@ export * from "./insert-cells-dialog.atom";
|
|
|
35
35
|
export * from "./insert-options.atom";
|
|
36
36
|
export * from "./chart-actions.atom";
|
|
37
37
|
export * from "./table-auto-expansion.atom";
|
|
38
|
+
export * from "./undo-redo-sent.atom";
|
|
39
|
+
export * from "./frozen-area-sent.atom";
|
|
38
40
|
export * from "./flash-fill-options.atom";
|
|
39
41
|
export * from "./calculated-column-fill.atom";
|
|
40
42
|
export * from "./sparkline-dialog.atom";
|