@rowsncolumns/spreadsheet 10.3.0 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/banded-ranges.d.ts.map +1 -1
- package/dist/cjs/api/banded-ranges.js +40 -14
- package/dist/cjs/api/calculated-column-fill.d.ts +43 -0
- package/dist/cjs/api/calculated-column-fill.d.ts.map +1 -0
- package/dist/cjs/api/calculated-column-fill.js +16 -0
- package/dist/cjs/api/chart-sheet.d.ts +8 -0
- package/dist/cjs/api/chart-sheet.d.ts.map +1 -0
- package/dist/cjs/api/chart-sheet.js +20 -0
- package/dist/cjs/api/chart-source-ranges.d.ts +64 -0
- package/dist/cjs/api/chart-source-ranges.d.ts.map +1 -0
- package/dist/cjs/api/chart-source-ranges.js +175 -0
- package/dist/cjs/api/selections.d.ts +3 -3
- package/dist/cjs/api/selections.d.ts.map +1 -1
- package/dist/cjs/api/selections.js +28 -2
- package/dist/cjs/api/spreadsheet-api.d.ts +16 -3
- package/dist/cjs/api/spreadsheet-api.d.ts.map +1 -1
- package/dist/cjs/api/spreadsheet-api.js +22 -2
- package/dist/cjs/api/table-auto-expansion.d.ts +37 -0
- package/dist/cjs/api/table-auto-expansion.d.ts.map +1 -0
- package/dist/cjs/api/table-auto-expansion.js +16 -0
- package/dist/cjs/api/table.d.ts +49 -1
- package/dist/cjs/api/table.d.ts.map +1 -1
- package/dist/cjs/api/table.js +145 -1
- package/dist/cjs/api/validation.d.ts +26 -1
- package/dist/cjs/api/validation.d.ts.map +1 -1
- package/dist/cjs/api/validation.js +127 -9
- package/dist/cjs/atoms/calculated-column-fill.atom.d.ts +15 -0
- package/dist/cjs/atoms/calculated-column-fill.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/calculated-column-fill.atom.js +18 -0
- package/dist/cjs/atoms/chart-actions.atom.d.ts +40 -0
- package/dist/cjs/atoms/chart-actions.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/chart-actions.atom.js +66 -0
- package/dist/cjs/atoms/index.d.ts +5 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -1
- package/dist/cjs/atoms/index.js +5 -0
- package/dist/cjs/atoms/move-chart-dialog.atom.d.ts +28 -0
- package/dist/cjs/atoms/move-chart-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/move-chart-dialog.atom.js +34 -0
- package/dist/cjs/atoms/selected-chart-embed.atom.d.ts +9 -1
- package/dist/cjs/atoms/selected-chart-embed.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/selected-chart-embed.atom.js +18 -1
- package/dist/cjs/atoms/selected-chart-series.atom.d.ts +24 -0
- package/dist/cjs/atoms/selected-chart-series.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/selected-chart-series.atom.js +11 -0
- package/dist/cjs/atoms/sheet-context.atom.d.ts +2 -0
- package/dist/cjs/atoms/sheet-context.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/sheet-context.atom.js +5 -2
- package/dist/cjs/atoms/sparkline-dialog.atom.d.ts +34 -0
- package/dist/cjs/atoms/sparkline-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/sparkline-dialog.atom.js +30 -0
- package/dist/cjs/atoms/table-auto-expansion.atom.d.ts +14 -0
- package/dist/cjs/atoms/table-auto-expansion.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/table-auto-expansion.atom.js +17 -0
- package/dist/cjs/components/calculated-column-smart-tag/index.d.ts +25 -0
- package/dist/cjs/components/calculated-column-smart-tag/index.d.ts.map +1 -0
- package/dist/cjs/components/calculated-column-smart-tag/index.js +31 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +407 -77
- package/dist/cjs/components/canvas-grid/typings.d.ts +127 -14
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell/index.d.ts.map +1 -1
- package/dist/cjs/components/cell/index.js +3 -3
- package/dist/cjs/components/cell/typings.d.ts +13 -0
- package/dist/cjs/components/cell/typings.d.ts.map +1 -1
- package/dist/cjs/components/cell-filter/index.d.ts.map +1 -1
- package/dist/cjs/components/cell-filter/index.js +13 -2
- package/dist/cjs/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
- package/dist/cjs/components/cell-input/formula-bar-cell-input.js +4 -1
- package/dist/cjs/components/cell-structured/sparkline-math.d.ts +28 -5
- package/dist/cjs/components/cell-structured/sparkline-math.d.ts.map +1 -1
- package/dist/cjs/components/cell-structured/sparkline-math.js +93 -5
- package/dist/cjs/components/cell-structured/sparkline.d.ts +1 -1
- package/dist/cjs/components/cell-structured/sparkline.d.ts.map +1 -1
- package/dist/cjs/components/cell-structured/sparkline.js +3 -3
- package/dist/cjs/components/cell-structured/types.d.ts +1 -1
- package/dist/cjs/components/cell-structured/types.d.ts.map +1 -1
- package/dist/cjs/components/chart-sheet-view/index.d.ts +27 -0
- package/dist/cjs/components/chart-sheet-view/index.d.ts.map +1 -0
- package/dist/cjs/components/chart-sheet-view/index.js +35 -0
- package/dist/cjs/components/context-menu/embed-context-menu.d.ts +48 -0
- package/dist/cjs/components/context-menu/embed-context-menu.d.ts.map +1 -0
- package/dist/cjs/components/context-menu/embed-context-menu.js +123 -0
- package/dist/cjs/components/context-menu/index.d.ts +23 -2
- package/dist/cjs/components/context-menu/index.d.ts.map +1 -1
- package/dist/cjs/components/context-menu/index.js +217 -39
- package/dist/cjs/components/context-menu/total-row-function-menu.d.ts +33 -0
- package/dist/cjs/components/context-menu/total-row-function-menu.d.ts.map +1 -0
- package/dist/cjs/components/context-menu/total-row-function-menu.js +58 -0
- package/dist/cjs/components/context-menu/total-row-functions.d.ts +12 -12
- package/dist/cjs/components/context-menu/total-row-functions.d.ts.map +1 -1
- package/dist/cjs/components/context-menu/total-row-functions.js +39 -39
- package/dist/cjs/components/embeds/chart-component.d.ts +17 -0
- package/dist/cjs/components/embeds/chart-component.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-draggable.d.ts +61 -4
- package/dist/cjs/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-draggable.js +218 -42
- package/dist/cjs/components/filter-box/date-tree.d.ts +28 -0
- package/dist/cjs/components/filter-box/date-tree.d.ts.map +1 -0
- package/dist/cjs/components/filter-box/date-tree.js +147 -0
- package/dist/cjs/components/filter-box/filter-by-condition.d.ts +14 -2
- package/dist/cjs/components/filter-box/filter-by-condition.d.ts.map +1 -1
- package/dist/cjs/components/filter-box/filter-by-condition.js +95 -19
- package/dist/cjs/components/filter-box/filter-by-value.d.ts.map +1 -1
- package/dist/cjs/components/filter-box/filter-by-value.js +126 -40
- package/dist/cjs/components/filter-box/index.d.ts +7 -1
- package/dist/cjs/components/filter-box/index.d.ts.map +1 -1
- package/dist/cjs/components/filter-box/index.js +102 -11
- package/dist/cjs/components/move-chart-dialog/index.d.ts +34 -0
- package/dist/cjs/components/move-chart-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/move-chart-dialog/index.js +96 -0
- package/dist/cjs/components/print-preview/page-block.d.ts +9 -1
- package/dist/cjs/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/page-block.js +28 -2
- package/dist/cjs/components/print-preview/print-preview-dialog.d.ts +8 -1
- package/dist/cjs/components/print-preview/print-preview-dialog.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/print-preview-dialog.js +144 -3
- package/dist/cjs/components/print-preview/run-print.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/run-print.js +19 -7
- package/dist/cjs/components/print-preview/use-page-layout.d.ts +47 -0
- package/dist/cjs/components/print-preview/use-page-layout.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/use-page-layout.js +81 -7
- package/dist/cjs/components/resizer/index.d.ts.map +1 -1
- package/dist/cjs/components/resizer/index.js +10 -5
- package/dist/cjs/components/selection/index.d.ts +1 -1
- package/dist/cjs/components/selection/index.d.ts.map +1 -1
- package/dist/cjs/components/selection/index.js +6 -2
- package/dist/cjs/components/selection/types.d.ts +15 -0
- package/dist/cjs/components/selection/types.d.ts.map +1 -1
- package/dist/cjs/components/sheet-search/index.d.ts.map +1 -1
- package/dist/cjs/components/sheet-search/index.js +6 -2
- package/dist/cjs/components/sheet-tabs/index.d.ts.map +1 -1
- package/dist/cjs/components/sheet-tabs/index.js +2 -2
- package/dist/cjs/components/sheet-tabs/sheet-tab.d.ts +1 -1
- package/dist/cjs/components/sheet-tabs/sheet-tab.d.ts.map +1 -1
- package/dist/cjs/components/sheet-tabs/sheet-tab.js +3 -1
- package/dist/cjs/components/sparkline-dialog/index.d.ts +43 -0
- package/dist/cjs/components/sparkline-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/sparkline-dialog/index.js +127 -0
- package/dist/cjs/components/subtotal-dialog/index.d.ts.map +1 -1
- package/dist/cjs/components/subtotal-dialog/index.js +10 -1
- package/dist/cjs/components/table-auto-expansion-smart-tag/index.d.ts +24 -0
- package/dist/cjs/components/table-auto-expansion-smart-tag/index.d.ts.map +1 -0
- package/dist/cjs/components/table-auto-expansion-smart-tag/index.js +31 -0
- package/dist/cjs/components/toolbar/index.d.ts +1 -0
- package/dist/cjs/components/toolbar/index.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/index.js +1 -0
- package/dist/cjs/components/toolbar/insert-menu.d.ts +2 -1
- package/dist/cjs/components/toolbar/insert-menu.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/insert-menu.js +24 -1
- package/dist/cjs/components/toolbar/merge-cells-selector.d.ts +4 -1
- package/dist/cjs/components/toolbar/merge-cells-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/merge-cells-selector.js +11 -5
- package/dist/cjs/components/toolbar/sparkline-actions.d.ts +31 -0
- package/dist/cjs/components/toolbar/sparkline-actions.d.ts.map +1 -0
- package/dist/cjs/components/toolbar/sparkline-actions.js +273 -0
- package/dist/cjs/components/toolbar/table-actions.d.ts +9 -1
- package/dist/cjs/components/toolbar/table-actions.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/table-actions.js +17 -7
- package/dist/cjs/components/toolbar/table-style-selector.d.ts +38 -2
- package/dist/cjs/components/toolbar/table-style-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/table-style-selector.js +241 -389
- package/dist/cjs/config.d.ts +2 -0
- package/dist/cjs/config.d.ts.map +1 -1
- package/dist/cjs/config.js +31 -1
- package/dist/cjs/helpers.d.ts +1 -1
- package/dist/cjs/helpers.d.ts.map +1 -1
- package/dist/cjs/helpers.js +13 -2
- package/dist/cjs/hooks/use-cell-renderer.d.ts +16 -1
- package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-cell-renderer.js +20 -8
- package/dist/cjs/hooks/use-chart-clipboard.d.ts +55 -0
- package/dist/cjs/hooks/use-chart-clipboard.d.ts.map +1 -0
- package/dist/cjs/hooks/use-chart-clipboard.js +231 -0
- package/dist/cjs/hooks/use-chart-source-ranges.d.ts +27 -0
- package/dist/cjs/hooks/use-chart-source-ranges.d.ts.map +1 -0
- package/dist/cjs/hooks/use-chart-source-ranges.js +211 -0
- package/dist/cjs/hooks/use-context-setter.d.ts.map +1 -1
- package/dist/cjs/hooks/use-context-setter.js +3 -1
- package/dist/cjs/hooks/use-copy-paste-cut.d.ts.map +1 -1
- package/dist/cjs/hooks/use-copy-paste-cut.js +6 -3
- package/dist/cjs/hooks/use-editable.d.ts +9 -1
- package/dist/cjs/hooks/use-editable.d.ts.map +1 -1
- package/dist/cjs/hooks/use-editable.js +25 -1
- package/dist/cjs/hooks/use-embeds-charts.d.ts +64 -4
- package/dist/cjs/hooks/use-embeds-charts.d.ts.map +1 -1
- package/dist/cjs/hooks/use-embeds-charts.js +412 -41
- package/dist/cjs/hooks/use-grid-children.d.ts +2 -2
- package/dist/cjs/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/cjs/hooks/use-grid-children.js +12 -6
- package/dist/cjs/hooks/use-header-actions.d.ts.map +1 -1
- package/dist/cjs/hooks/use-header-actions.js +17 -10
- package/dist/cjs/hooks/use-isomorphic-layout-effect.d.ts +2 -2
- package/dist/cjs/hooks/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/cjs/hooks/use-keyboard-handler.d.ts +2 -1
- package/dist/cjs/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/cjs/hooks/use-keyboard-handler.js +8 -2
- package/dist/cjs/hooks/use-move-columns-rows.d.ts.map +1 -1
- package/dist/cjs/hooks/use-move-columns-rows.js +21 -15
- package/dist/cjs/hooks/use-reveal-chart-embed.d.ts +17 -0
- package/dist/cjs/hooks/use-reveal-chart-embed.d.ts.map +1 -0
- package/dist/cjs/hooks/use-reveal-chart-embed.js +40 -0
- package/dist/cjs/hooks/use-selection-move.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-move.js +14 -6
- package/dist/cjs/hooks/use-selection-renderer.d.ts +13 -1
- package/dist/cjs/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-renderer.js +37 -7
- package/dist/cjs/hooks/use-selection-resize.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-resize.js +13 -6
- package/dist/cjs/hooks/use-selection.d.ts +9 -1
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +177 -55
- package/dist/cjs/hooks/use-structured-reference-selection.d.ts +1 -1
- package/dist/cjs/hooks/use-structured-reference-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-structured-reference-selection.js +10 -0
- package/dist/cjs/hooks/use-table-hit-zones.d.ts +61 -0
- package/dist/cjs/hooks/use-table-hit-zones.d.ts.map +1 -0
- package/dist/cjs/hooks/use-table-hit-zones.js +157 -0
- package/dist/cjs/hooks/use-table-resizer.d.ts +7 -0
- package/dist/cjs/hooks/use-table-resizer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-table-resizer.js +38 -18
- package/dist/cjs/hooks/use-touch.d.ts.map +1 -1
- package/dist/cjs/hooks/use-touch.js +16 -8
- package/dist/cjs/index.d.ts +13 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +17 -1
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +289 -4
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils/copy-as-picture.d.ts +13 -0
- package/dist/cjs/utils/copy-as-picture.d.ts.map +1 -0
- package/dist/cjs/utils/copy-as-picture.js +70 -0
- package/dist/cjs/utils/pivot-chart-field-buttons.d.ts +19 -0
- package/dist/cjs/utils/pivot-chart-field-buttons.d.ts.map +1 -0
- package/dist/cjs/utils/pivot-chart-field-buttons.js +25 -0
- package/dist/cjs/utils/z-order.d.ts +47 -0
- package/dist/cjs/utils/z-order.d.ts.map +1 -0
- package/dist/cjs/utils/z-order.js +124 -0
- package/dist/esm/api/banded-ranges.d.ts.map +1 -1
- package/dist/esm/api/banded-ranges.js +39 -12
- package/dist/esm/api/calculated-column-fill.d.ts +43 -0
- package/dist/esm/api/calculated-column-fill.d.ts.map +1 -0
- package/dist/esm/api/calculated-column-fill.js +10 -0
- package/dist/esm/api/chart-sheet.d.ts +8 -0
- package/dist/esm/api/chart-sheet.d.ts.map +1 -0
- package/dist/esm/api/chart-sheet.js +15 -0
- package/dist/esm/api/chart-source-ranges.d.ts +64 -0
- package/dist/esm/api/chart-source-ranges.d.ts.map +1 -0
- package/dist/esm/api/chart-source-ranges.js +168 -0
- package/dist/esm/api/selections.d.ts +3 -3
- package/dist/esm/api/selections.d.ts.map +1 -1
- package/dist/esm/api/selections.js +26 -2
- package/dist/esm/api/spreadsheet-api.d.ts +16 -3
- package/dist/esm/api/spreadsheet-api.d.ts.map +1 -1
- package/dist/esm/api/spreadsheet-api.js +18 -2
- package/dist/esm/api/table-auto-expansion.d.ts +37 -0
- package/dist/esm/api/table-auto-expansion.d.ts.map +1 -0
- package/dist/esm/api/table-auto-expansion.js +10 -0
- package/dist/esm/api/table.d.ts +49 -1
- package/dist/esm/api/table.d.ts.map +1 -1
- package/dist/esm/api/table.js +138 -1
- package/dist/esm/api/validation.d.ts +26 -1
- package/dist/esm/api/validation.d.ts.map +1 -1
- package/dist/esm/api/validation.js +119 -9
- package/dist/esm/atoms/calculated-column-fill.atom.d.ts +15 -0
- package/dist/esm/atoms/calculated-column-fill.atom.d.ts.map +1 -0
- package/dist/esm/atoms/calculated-column-fill.atom.js +12 -0
- package/dist/esm/atoms/chart-actions.atom.d.ts +40 -0
- package/dist/esm/atoms/chart-actions.atom.d.ts.map +1 -0
- package/dist/esm/atoms/chart-actions.atom.js +58 -0
- package/dist/esm/atoms/index.d.ts +5 -0
- package/dist/esm/atoms/index.d.ts.map +1 -1
- package/dist/esm/atoms/index.js +5 -0
- package/dist/esm/atoms/move-chart-dialog.atom.d.ts +28 -0
- package/dist/esm/atoms/move-chart-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/move-chart-dialog.atom.js +25 -0
- package/dist/esm/atoms/selected-chart-embed.atom.d.ts +9 -1
- package/dist/esm/atoms/selected-chart-embed.atom.d.ts.map +1 -1
- package/dist/esm/atoms/selected-chart-embed.atom.js +19 -2
- package/dist/esm/atoms/selected-chart-series.atom.d.ts +24 -0
- package/dist/esm/atoms/selected-chart-series.atom.d.ts.map +1 -0
- package/dist/esm/atoms/selected-chart-series.atom.js +4 -0
- package/dist/esm/atoms/sheet-context.atom.d.ts +2 -0
- package/dist/esm/atoms/sheet-context.atom.d.ts.map +1 -1
- package/dist/esm/atoms/sheet-context.atom.js +2 -0
- package/dist/esm/atoms/sparkline-dialog.atom.d.ts +34 -0
- package/dist/esm/atoms/sparkline-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/sparkline-dialog.atom.js +21 -0
- package/dist/esm/atoms/table-auto-expansion.atom.d.ts +14 -0
- package/dist/esm/atoms/table-auto-expansion.atom.d.ts.map +1 -0
- package/dist/esm/atoms/table-auto-expansion.atom.js +11 -0
- package/dist/esm/components/calculated-column-smart-tag/index.d.ts +25 -0
- package/dist/esm/components/calculated-column-smart-tag/index.d.ts.map +1 -0
- package/dist/esm/components/calculated-column-smart-tag/index.js +25 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +346 -26
- package/dist/esm/components/canvas-grid/typings.d.ts +127 -14
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/cell/index.d.ts.map +1 -1
- package/dist/esm/components/cell/index.js +3 -3
- package/dist/esm/components/cell/typings.d.ts +13 -0
- package/dist/esm/components/cell/typings.d.ts.map +1 -1
- package/dist/esm/components/cell-filter/index.d.ts.map +1 -1
- package/dist/esm/components/cell-filter/index.js +14 -3
- package/dist/esm/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
- package/dist/esm/components/cell-input/formula-bar-cell-input.js +4 -1
- package/dist/esm/components/cell-structured/sparkline-math.d.ts +28 -5
- package/dist/esm/components/cell-structured/sparkline-math.d.ts.map +1 -1
- package/dist/esm/components/cell-structured/sparkline-math.js +58 -4
- package/dist/esm/components/cell-structured/sparkline.d.ts +1 -1
- package/dist/esm/components/cell-structured/sparkline.d.ts.map +1 -1
- package/dist/esm/components/cell-structured/sparkline.js +3 -3
- package/dist/esm/components/cell-structured/types.d.ts +1 -1
- package/dist/esm/components/cell-structured/types.d.ts.map +1 -1
- package/dist/esm/components/chart-sheet-view/index.d.ts +27 -0
- package/dist/esm/components/chart-sheet-view/index.d.ts.map +1 -0
- package/dist/esm/components/chart-sheet-view/index.js +30 -0
- package/dist/esm/components/context-menu/embed-context-menu.d.ts +48 -0
- package/dist/esm/components/context-menu/embed-context-menu.d.ts.map +1 -0
- package/dist/esm/components/context-menu/embed-context-menu.js +112 -0
- package/dist/esm/components/context-menu/index.d.ts +23 -2
- package/dist/esm/components/context-menu/index.d.ts.map +1 -1
- package/dist/esm/components/context-menu/index.js +174 -38
- package/dist/esm/components/context-menu/total-row-function-menu.d.ts +33 -0
- package/dist/esm/components/context-menu/total-row-function-menu.d.ts.map +1 -0
- package/dist/esm/components/context-menu/total-row-function-menu.js +50 -0
- package/dist/esm/components/context-menu/total-row-functions.d.ts +12 -12
- package/dist/esm/components/context-menu/total-row-functions.d.ts.map +1 -1
- package/dist/esm/components/context-menu/total-row-functions.js +29 -31
- package/dist/esm/components/embeds/chart-component.d.ts +17 -0
- package/dist/esm/components/embeds/chart-component.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-draggable.d.ts +61 -4
- package/dist/esm/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-draggable.js +207 -47
- package/dist/esm/components/filter-box/date-tree.d.ts +28 -0
- package/dist/esm/components/filter-box/date-tree.d.ts.map +1 -0
- package/dist/esm/components/filter-box/date-tree.js +107 -0
- package/dist/esm/components/filter-box/filter-by-condition.d.ts +14 -2
- package/dist/esm/components/filter-box/filter-by-condition.d.ts.map +1 -1
- package/dist/esm/components/filter-box/filter-by-condition.js +72 -16
- package/dist/esm/components/filter-box/filter-by-value.d.ts.map +1 -1
- package/dist/esm/components/filter-box/filter-by-value.js +110 -39
- package/dist/esm/components/filter-box/index.d.ts +7 -1
- package/dist/esm/components/filter-box/index.d.ts.map +1 -1
- package/dist/esm/components/filter-box/index.js +88 -2
- package/dist/esm/components/move-chart-dialog/index.d.ts +34 -0
- package/dist/esm/components/move-chart-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/move-chart-dialog/index.js +88 -0
- package/dist/esm/components/print-preview/page-block.d.ts +9 -1
- package/dist/esm/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/esm/components/print-preview/page-block.js +27 -2
- package/dist/esm/components/print-preview/print-preview-dialog.d.ts +8 -1
- package/dist/esm/components/print-preview/print-preview-dialog.d.ts.map +1 -1
- package/dist/esm/components/print-preview/print-preview-dialog.js +92 -4
- package/dist/esm/components/print-preview/run-print.d.ts.map +1 -1
- package/dist/esm/components/print-preview/run-print.js +17 -7
- package/dist/esm/components/print-preview/use-page-layout.d.ts +47 -0
- package/dist/esm/components/print-preview/use-page-layout.d.ts.map +1 -1
- package/dist/esm/components/print-preview/use-page-layout.js +55 -0
- package/dist/esm/components/resizer/index.d.ts.map +1 -1
- package/dist/esm/components/resizer/index.js +8 -4
- package/dist/esm/components/selection/index.d.ts +1 -1
- package/dist/esm/components/selection/index.d.ts.map +1 -1
- package/dist/esm/components/selection/index.js +6 -2
- package/dist/esm/components/selection/types.d.ts +15 -0
- package/dist/esm/components/selection/types.d.ts.map +1 -1
- package/dist/esm/components/sheet-search/index.d.ts.map +1 -1
- package/dist/esm/components/sheet-search/index.js +5 -2
- package/dist/esm/components/sheet-tabs/index.d.ts.map +1 -1
- package/dist/esm/components/sheet-tabs/index.js +2 -2
- package/dist/esm/components/sheet-tabs/sheet-tab.d.ts +1 -1
- package/dist/esm/components/sheet-tabs/sheet-tab.d.ts.map +1 -1
- package/dist/esm/components/sheet-tabs/sheet-tab.js +4 -2
- package/dist/esm/components/sparkline-dialog/index.d.ts +43 -0
- package/dist/esm/components/sparkline-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/sparkline-dialog/index.js +123 -0
- package/dist/esm/components/subtotal-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/subtotal-dialog/index.js +10 -1
- package/dist/esm/components/table-auto-expansion-smart-tag/index.d.ts +24 -0
- package/dist/esm/components/table-auto-expansion-smart-tag/index.d.ts.map +1 -0
- package/dist/esm/components/table-auto-expansion-smart-tag/index.js +25 -0
- package/dist/esm/components/toolbar/index.d.ts +1 -0
- package/dist/esm/components/toolbar/index.d.ts.map +1 -1
- package/dist/esm/components/toolbar/index.js +1 -0
- package/dist/esm/components/toolbar/insert-menu.d.ts +2 -1
- package/dist/esm/components/toolbar/insert-menu.d.ts.map +1 -1
- package/dist/esm/components/toolbar/insert-menu.js +24 -1
- package/dist/esm/components/toolbar/merge-cells-selector.d.ts +4 -1
- package/dist/esm/components/toolbar/merge-cells-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/merge-cells-selector.js +10 -6
- package/dist/esm/components/toolbar/sparkline-actions.d.ts +31 -0
- package/dist/esm/components/toolbar/sparkline-actions.d.ts.map +1 -0
- package/dist/esm/components/toolbar/sparkline-actions.js +238 -0
- package/dist/esm/components/toolbar/table-actions.d.ts +9 -1
- package/dist/esm/components/toolbar/table-actions.d.ts.map +1 -1
- package/dist/esm/components/toolbar/table-actions.js +15 -7
- package/dist/esm/components/toolbar/table-style-selector.d.ts +38 -2
- package/dist/esm/components/toolbar/table-style-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/table-style-selector.js +210 -399
- package/dist/esm/config.d.ts +2 -0
- package/dist/esm/config.d.ts.map +1 -1
- package/dist/esm/config.js +30 -0
- package/dist/esm/helpers.d.ts +1 -1
- package/dist/esm/helpers.d.ts.map +1 -1
- package/dist/esm/helpers.js +12 -1
- package/dist/esm/hooks/use-cell-renderer.d.ts +16 -1
- package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-cell-renderer.js +14 -4
- package/dist/esm/hooks/use-chart-clipboard.d.ts +55 -0
- package/dist/esm/hooks/use-chart-clipboard.d.ts.map +1 -0
- package/dist/esm/hooks/use-chart-clipboard.js +213 -0
- package/dist/esm/hooks/use-chart-source-ranges.d.ts +27 -0
- package/dist/esm/hooks/use-chart-source-ranges.d.ts.map +1 -0
- package/dist/esm/hooks/use-chart-source-ranges.js +186 -0
- package/dist/esm/hooks/use-context-setter.d.ts.map +1 -1
- package/dist/esm/hooks/use-context-setter.js +3 -1
- package/dist/esm/hooks/use-copy-paste-cut.d.ts.map +1 -1
- package/dist/esm/hooks/use-copy-paste-cut.js +6 -4
- package/dist/esm/hooks/use-editable.d.ts +9 -1
- package/dist/esm/hooks/use-editable.d.ts.map +1 -1
- package/dist/esm/hooks/use-editable.js +25 -1
- package/dist/esm/hooks/use-embeds-charts.d.ts +64 -4
- package/dist/esm/hooks/use-embeds-charts.d.ts.map +1 -1
- package/dist/esm/hooks/use-embeds-charts.js +394 -39
- package/dist/esm/hooks/use-grid-children.d.ts +2 -2
- package/dist/esm/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/esm/hooks/use-grid-children.js +8 -2
- package/dist/esm/hooks/use-header-actions.d.ts.map +1 -1
- package/dist/esm/hooks/use-header-actions.js +11 -4
- package/dist/esm/hooks/use-isomorphic-layout-effect.d.ts +2 -2
- package/dist/esm/hooks/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/esm/hooks/use-keyboard-handler.d.ts +2 -1
- package/dist/esm/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/esm/hooks/use-keyboard-handler.js +8 -2
- package/dist/esm/hooks/use-move-columns-rows.d.ts.map +1 -1
- package/dist/esm/hooks/use-move-columns-rows.js +12 -6
- package/dist/esm/hooks/use-reveal-chart-embed.d.ts +17 -0
- package/dist/esm/hooks/use-reveal-chart-embed.d.ts.map +1 -0
- package/dist/esm/hooks/use-reveal-chart-embed.js +35 -0
- package/dist/esm/hooks/use-selection-move.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-move.js +11 -4
- package/dist/esm/hooks/use-selection-renderer.d.ts +13 -1
- package/dist/esm/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-renderer.js +35 -6
- package/dist/esm/hooks/use-selection-resize.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-resize.js +11 -5
- package/dist/esm/hooks/use-selection.d.ts +9 -1
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +172 -54
- package/dist/esm/hooks/use-structured-reference-selection.d.ts +1 -1
- package/dist/esm/hooks/use-structured-reference-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-structured-reference-selection.js +16 -0
- package/dist/esm/hooks/use-table-hit-zones.d.ts +61 -0
- package/dist/esm/hooks/use-table-hit-zones.d.ts.map +1 -0
- package/dist/esm/hooks/use-table-hit-zones.js +146 -0
- package/dist/esm/hooks/use-table-resizer.d.ts +7 -0
- package/dist/esm/hooks/use-table-resizer.d.ts.map +1 -1
- package/dist/esm/hooks/use-table-resizer.js +36 -19
- package/dist/esm/hooks/use-touch.d.ts.map +1 -1
- package/dist/esm/hooks/use-touch.js +15 -7
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +13 -0
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +289 -4
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utils/copy-as-picture.d.ts +13 -0
- package/dist/esm/utils/copy-as-picture.d.ts.map +1 -0
- package/dist/esm/utils/copy-as-picture.js +45 -0
- package/dist/esm/utils/pivot-chart-field-buttons.d.ts +19 -0
- package/dist/esm/utils/pivot-chart-field-buttons.d.ts.map +1 -0
- package/dist/esm/utils/pivot-chart-field-buttons.js +18 -0
- package/dist/esm/utils/z-order.d.ts +47 -0
- package/dist/esm/utils/z-order.d.ts.map +1 -0
- package/dist/esm/utils/z-order.js +111 -0
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +8 -6
- package/dist/cjs/components/cell-editor/helpers.spec.d.ts +0 -2
- package/dist/cjs/components/cell-editor/helpers.spec.d.ts.map +0 -1
- package/dist/cjs/components/cell-editor/helpers.spec.js +0 -32
- package/dist/esm/components/cell-editor/helpers.spec.d.ts +0 -2
- package/dist/esm/components/cell-editor/helpers.spec.d.ts.map +0 -1
- package/dist/esm/components/cell-editor/helpers.spec.js +0 -30
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Excel's "Copy as Picture" for a chart: put the renderer's PNG on the
|
|
4
|
+
* system clipboard. The capture is asynchronous, but browsers only allow
|
|
5
|
+
* a clipboard write inside the user gesture that requested it — so the
|
|
6
|
+
* pending capture is handed to `ClipboardItem` as a promise (the shape
|
|
7
|
+
* Safari requires and Chromium ≥ 98 / Firefox ≥ 127 accept); an engine
|
|
8
|
+
* that rejects promise values gets the resolved blob written while the
|
|
9
|
+
* gesture's transient activation still lasts.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.copyPngToClipboard = exports.canCopyImageToClipboard = void 0;
|
|
13
|
+
var tslib_1 = require("tslib");
|
|
14
|
+
var canCopyImageToClipboard = function () {
|
|
15
|
+
var _a;
|
|
16
|
+
return typeof ClipboardItem !== "undefined" &&
|
|
17
|
+
typeof navigator !== "undefined" &&
|
|
18
|
+
typeof ((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.write) === "function";
|
|
19
|
+
};
|
|
20
|
+
exports.canCopyImageToClipboard = canCopyImageToClipboard;
|
|
21
|
+
/** Resolves `true` when the PNG reached the clipboard. */
|
|
22
|
+
var copyPngToClipboard = function (png) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
23
|
+
var blob, _a, captured, _b;
|
|
24
|
+
return tslib_1.__generator(this, function (_c) {
|
|
25
|
+
switch (_c.label) {
|
|
26
|
+
case 0:
|
|
27
|
+
if (!(0, exports.canCopyImageToClipboard)())
|
|
28
|
+
return [2 /*return*/, false];
|
|
29
|
+
blob = png.then(function (captured) {
|
|
30
|
+
if (!captured)
|
|
31
|
+
throw new Error("Chart image could not be captured");
|
|
32
|
+
return captured;
|
|
33
|
+
});
|
|
34
|
+
// The engine consumes the rejection through the ClipboardItem; keep it
|
|
35
|
+
// from surfacing as an unhandled rejection as well.
|
|
36
|
+
blob.catch(function () { return undefined; });
|
|
37
|
+
_c.label = 1;
|
|
38
|
+
case 1:
|
|
39
|
+
_c.trys.push([1, 3, , 9]);
|
|
40
|
+
return [4 /*yield*/, navigator.clipboard.write([
|
|
41
|
+
new ClipboardItem({ "image/png": blob }),
|
|
42
|
+
])];
|
|
43
|
+
case 2:
|
|
44
|
+
_c.sent();
|
|
45
|
+
return [2 /*return*/, true];
|
|
46
|
+
case 3:
|
|
47
|
+
_a = _c.sent();
|
|
48
|
+
return [4 /*yield*/, blob.catch(function () { return undefined; })];
|
|
49
|
+
case 4:
|
|
50
|
+
captured = _c.sent();
|
|
51
|
+
if (!captured)
|
|
52
|
+
return [2 /*return*/, false];
|
|
53
|
+
_c.label = 5;
|
|
54
|
+
case 5:
|
|
55
|
+
_c.trys.push([5, 7, , 8]);
|
|
56
|
+
return [4 /*yield*/, navigator.clipboard.write([
|
|
57
|
+
new ClipboardItem({ "image/png": captured }),
|
|
58
|
+
])];
|
|
59
|
+
case 6:
|
|
60
|
+
_c.sent();
|
|
61
|
+
return [2 /*return*/, true];
|
|
62
|
+
case 7:
|
|
63
|
+
_b = _c.sent();
|
|
64
|
+
return [2 /*return*/, false];
|
|
65
|
+
case 8: return [3 /*break*/, 9];
|
|
66
|
+
case 9: return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
exports.copyPngToClipboard = copyPngToClipboard;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ChartSpec, PivotChartFieldButtons } from "../types";
|
|
2
|
+
/** The four button kinds Excel draws on a PivotChart frame. */
|
|
3
|
+
export type PivotChartFieldButtonKind = Exclude<keyof PivotChartFieldButtons, "visible">;
|
|
4
|
+
type FieldButtonSpec = Pick<ChartSpec, "pivotTableId" | "pivotFieldButtons">;
|
|
5
|
+
/**
|
|
6
|
+
* Whether a PivotChart shows its field buttons at all — Excel's "Hide All
|
|
7
|
+
* Field Buttons" flips this. A chart that is not bound to a pivot never
|
|
8
|
+
* shows any.
|
|
9
|
+
*/
|
|
10
|
+
export declare const pivotChartFieldButtonsVisible: (spec: FieldButtonSpec) => boolean;
|
|
11
|
+
/** Whether one kind of field button shows (every kind defaults to shown). */
|
|
12
|
+
export declare const isPivotChartFieldButtonShown: (spec: FieldButtonSpec, kind: PivotChartFieldButtonKind) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The spec change behind Show / Hide All Field Buttons: only `visible`
|
|
15
|
+
* flips, the per-kind choices survive so re-showing restores them.
|
|
16
|
+
*/
|
|
17
|
+
export declare const togglePivotChartFieldButtons: (spec: FieldButtonSpec) => Pick<ChartSpec, "pivotFieldButtons">;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=pivot-chart-field-buttons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pivot-chart-field-buttons.d.ts","sourceRoot":"","sources":["../../../utils/pivot-chart-field-buttons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElE,+DAA+D;AAC/D,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,sBAAsB,EAC5B,SAAS,CACV,CAAC;AAEF,KAAK,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,eAAe,KAAG,OACE,CAAC;AAEzE,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B,GACvC,MAAM,eAAe,EACrB,MAAM,yBAAyB,KAC9B,OAC8E,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,eAAe,KACpB,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAKpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.togglePivotChartFieldButtons = exports.isPivotChartFieldButtonShown = exports.pivotChartFieldButtonsVisible = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Whether a PivotChart shows its field buttons at all — Excel's "Hide All
|
|
7
|
+
* Field Buttons" flips this. A chart that is not bound to a pivot never
|
|
8
|
+
* shows any.
|
|
9
|
+
*/
|
|
10
|
+
var pivotChartFieldButtonsVisible = function (spec) { var _a; return spec.pivotTableId != null && ((_a = spec.pivotFieldButtons) === null || _a === void 0 ? void 0 : _a.visible) !== false; };
|
|
11
|
+
exports.pivotChartFieldButtonsVisible = pivotChartFieldButtonsVisible;
|
|
12
|
+
/** Whether one kind of field button shows (every kind defaults to shown). */
|
|
13
|
+
var isPivotChartFieldButtonShown = function (spec, kind) { var _a; return (0, exports.pivotChartFieldButtonsVisible)(spec) && ((_a = spec.pivotFieldButtons) === null || _a === void 0 ? void 0 : _a[kind]) !== false; };
|
|
14
|
+
exports.isPivotChartFieldButtonShown = isPivotChartFieldButtonShown;
|
|
15
|
+
/**
|
|
16
|
+
* The spec change behind Show / Hide All Field Buttons: only `visible`
|
|
17
|
+
* flips, the per-kind choices survive so re-showing restores them.
|
|
18
|
+
*/
|
|
19
|
+
var togglePivotChartFieldButtons = function (spec) {
|
|
20
|
+
var _a;
|
|
21
|
+
return ({
|
|
22
|
+
pivotFieldButtons: tslib_1.__assign(tslib_1.__assign({}, ((_a = spec.pivotFieldButtons) !== null && _a !== void 0 ? _a : {})), { visible: !(0, exports.pivotChartFieldButtonsVisible)(spec) }),
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.togglePivotChartFieldButtons = togglePivotChartFieldButtons;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EmbeddedChart, EmbeddedObject } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Excel's Arrange menu for floating objects. Charts and embedded objects
|
|
4
|
+
* (pictures, shapes, text boxes) live in two host arrays but share one
|
|
5
|
+
* stacking order per sheet; `position.zOrder` carries it and, when absent,
|
|
6
|
+
* creation order applies — charts below embeds, each in array order (the
|
|
7
|
+
* paint order before z-order existed).
|
|
8
|
+
*/
|
|
9
|
+
export type ZOrderDirection = "bringForward" | "sendBackward" | "bringToFront" | "sendToBack";
|
|
10
|
+
export type ZOrderTarget = {
|
|
11
|
+
kind: "chart";
|
|
12
|
+
id: EmbeddedChart["chartId"];
|
|
13
|
+
} | {
|
|
14
|
+
kind: "embed";
|
|
15
|
+
id: EmbeddedObject["embedId"];
|
|
16
|
+
};
|
|
17
|
+
/** One object with its new `position.zOrder` already applied — what the host persists. */
|
|
18
|
+
export type ZOrderChange = {
|
|
19
|
+
kind: "chart";
|
|
20
|
+
chart: EmbeddedChart;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "embed";
|
|
23
|
+
embed: EmbeddedObject;
|
|
24
|
+
};
|
|
25
|
+
export type StackedObject = ZOrderTarget & {
|
|
26
|
+
/** Effective stacking value (explicit `zOrder`, else the creation-order default). */
|
|
27
|
+
zOrder: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The sheet's floating objects back-to-front. Explicit `zOrder` wins; an
|
|
31
|
+
* object without one sits at its creation-order slot (charts first, then
|
|
32
|
+
* embeds, both in array order), so a document authored before z-order
|
|
33
|
+
* keeps painting exactly as it did. Ties keep that same default order.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getStackingOrder: (charts: readonly EmbeddedChart[] | null | undefined, embeds: readonly EmbeddedObject[] | null | undefined, sheetId: number) => StackedObject[];
|
|
36
|
+
/** Stacking rank (1 = back-most) per object key — what the grid paints as `z-index`. */
|
|
37
|
+
export declare const getStackingRanks: (charts: readonly EmbeddedChart[] | null | undefined, embeds: readonly EmbeddedObject[] | null | undefined, sheetId: number) => Map<string, number>;
|
|
38
|
+
export declare const stackingKey: (target: ZOrderTarget) => string;
|
|
39
|
+
/**
|
|
40
|
+
* The objects to rewrite for one Arrange command, with their new `zOrder`:
|
|
41
|
+
* Bring Forward / Send Backward swap the target with its neighbour (two
|
|
42
|
+
* objects), Bring to Front / Send to Back put it past the current extreme
|
|
43
|
+
* (one object). `undefined` when the command is a no-op — the target is
|
|
44
|
+
* already at that end, or is not on the sheet.
|
|
45
|
+
*/
|
|
46
|
+
export declare const planZOrderChange: (charts: readonly EmbeddedChart[] | null | undefined, embeds: readonly EmbeddedObject[] | null | undefined, sheetId: number, target: ZOrderTarget, direction: ZOrderDirection) => ZOrderChange[] | undefined;
|
|
47
|
+
//# sourceMappingURL=z-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z-order.d.ts","sourceRoot":"","sources":["../../../utils/z-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE9D;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,cAAc,GACd,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AAErD,0FAA0F;AAC1F,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IACzC,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,EACnD,QAAQ,SAAS,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,EACpD,SAAS,MAAM,KACd,aAAa,EAuBf,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,EACnD,QAAQ,SAAS,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,EACpD,SAAS,MAAM,KACd,GAAG,CAAC,MAAM,EAAE,MAAM,CAMpB,CAAC;AAEF,eAAO,MAAM,WAAW,WAlDH,YAAY,WAkDH,CAAC;AAoB/B;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,EACnD,QAAQ,SAAS,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,EACpD,SAAS,MAAM,EACf,QAAQ,YAAY,EACpB,WAAW,eAAe,KACzB,YAAY,EAAE,GAAG,SA4CnB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planZOrderChange = exports.stackingKey = exports.getStackingRanks = exports.getStackingOrder = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var key = function (target) { return "".concat(target.kind, ":").concat(String(target.id)); };
|
|
6
|
+
/**
|
|
7
|
+
* The sheet's floating objects back-to-front. Explicit `zOrder` wins; an
|
|
8
|
+
* object without one sits at its creation-order slot (charts first, then
|
|
9
|
+
* embeds, both in array order), so a document authored before z-order
|
|
10
|
+
* keeps painting exactly as it did. Ties keep that same default order.
|
|
11
|
+
*/
|
|
12
|
+
var getStackingOrder = function (charts, embeds, sheetId) {
|
|
13
|
+
var _a;
|
|
14
|
+
var chartCount = (_a = charts === null || charts === void 0 ? void 0 : charts.length) !== null && _a !== void 0 ? _a : 0;
|
|
15
|
+
var entries = [];
|
|
16
|
+
charts === null || charts === void 0 ? void 0 : charts.forEach(function (chart, index) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
if (((_a = chart.position) === null || _a === void 0 ? void 0 : _a.sheetId) !== sheetId)
|
|
19
|
+
return;
|
|
20
|
+
entries.push({
|
|
21
|
+
kind: "chart",
|
|
22
|
+
id: chart.chartId,
|
|
23
|
+
zOrder: (_b = chart.position.zOrder) !== null && _b !== void 0 ? _b : index,
|
|
24
|
+
slot: index,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
embeds === null || embeds === void 0 ? void 0 : embeds.forEach(function (embed, index) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if (((_a = embed.position) === null || _a === void 0 ? void 0 : _a.sheetId) !== sheetId)
|
|
30
|
+
return;
|
|
31
|
+
entries.push({
|
|
32
|
+
kind: "embed",
|
|
33
|
+
id: embed.embedId,
|
|
34
|
+
zOrder: (_b = embed.position.zOrder) !== null && _b !== void 0 ? _b : chartCount + index,
|
|
35
|
+
slot: chartCount + index,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
entries.sort(function (a, b) { return a.zOrder - b.zOrder || a.slot - b.slot; });
|
|
39
|
+
return entries.map(function (_a) {
|
|
40
|
+
var _slot = _a.slot, entry = tslib_1.__rest(_a, ["slot"]);
|
|
41
|
+
return entry;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
exports.getStackingOrder = getStackingOrder;
|
|
45
|
+
/** Stacking rank (1 = back-most) per object key — what the grid paints as `z-index`. */
|
|
46
|
+
var getStackingRanks = function (charts, embeds, sheetId) {
|
|
47
|
+
var ranks = new Map();
|
|
48
|
+
(0, exports.getStackingOrder)(charts, embeds, sheetId).forEach(function (entry, index) {
|
|
49
|
+
ranks.set(key(entry), index + 1);
|
|
50
|
+
});
|
|
51
|
+
return ranks;
|
|
52
|
+
};
|
|
53
|
+
exports.getStackingRanks = getStackingRanks;
|
|
54
|
+
exports.stackingKey = key;
|
|
55
|
+
var withZOrder = function (charts, embeds, target, zOrder) {
|
|
56
|
+
if (target.kind === "chart") {
|
|
57
|
+
var chart = charts === null || charts === void 0 ? void 0 : charts.find(function (c) { return c.chartId === target.id; });
|
|
58
|
+
return chart
|
|
59
|
+
? { kind: "chart", chart: tslib_1.__assign(tslib_1.__assign({}, chart), { position: tslib_1.__assign(tslib_1.__assign({}, chart.position), { zOrder: zOrder }) }) }
|
|
60
|
+
: undefined;
|
|
61
|
+
}
|
|
62
|
+
var embed = embeds === null || embeds === void 0 ? void 0 : embeds.find(function (e) { return e.embedId === target.id; });
|
|
63
|
+
return embed
|
|
64
|
+
? { kind: "embed", embed: tslib_1.__assign(tslib_1.__assign({}, embed), { position: tslib_1.__assign(tslib_1.__assign({}, embed.position), { zOrder: zOrder }) }) }
|
|
65
|
+
: undefined;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The objects to rewrite for one Arrange command, with their new `zOrder`:
|
|
69
|
+
* Bring Forward / Send Backward swap the target with its neighbour (two
|
|
70
|
+
* objects), Bring to Front / Send to Back put it past the current extreme
|
|
71
|
+
* (one object). `undefined` when the command is a no-op — the target is
|
|
72
|
+
* already at that end, or is not on the sheet.
|
|
73
|
+
*/
|
|
74
|
+
var planZOrderChange = function (charts, embeds, sheetId, target, direction) {
|
|
75
|
+
var order = (0, exports.getStackingOrder)(charts, embeds, sheetId);
|
|
76
|
+
var index = order.findIndex(function (entry) { return key(entry) === key(target); });
|
|
77
|
+
if (index === -1 || order.length < 2)
|
|
78
|
+
return undefined;
|
|
79
|
+
var current = order[index];
|
|
80
|
+
var changes = [];
|
|
81
|
+
switch (direction) {
|
|
82
|
+
case "bringToFront": {
|
|
83
|
+
if (index === order.length - 1)
|
|
84
|
+
return undefined;
|
|
85
|
+
changes.push(withZOrder(charts, embeds, target, order[order.length - 1].zOrder + 1));
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "sendToBack": {
|
|
89
|
+
if (index === 0)
|
|
90
|
+
return undefined;
|
|
91
|
+
changes.push(withZOrder(charts, embeds, target, order[0].zOrder - 1));
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case "bringForward": {
|
|
95
|
+
if (index === order.length - 1)
|
|
96
|
+
return undefined;
|
|
97
|
+
var above = order[index + 1];
|
|
98
|
+
if (above.zOrder === current.zOrder) {
|
|
99
|
+
changes.push(withZOrder(charts, embeds, target, above.zOrder + 1));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
changes.push(withZOrder(charts, embeds, target, above.zOrder));
|
|
103
|
+
changes.push(withZOrder(charts, embeds, above, current.zOrder));
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "sendBackward": {
|
|
108
|
+
if (index === 0)
|
|
109
|
+
return undefined;
|
|
110
|
+
var below = order[index - 1];
|
|
111
|
+
if (below.zOrder === current.zOrder) {
|
|
112
|
+
changes.push(withZOrder(charts, embeds, target, below.zOrder - 1));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
changes.push(withZOrder(charts, embeds, target, below.zOrder));
|
|
116
|
+
changes.push(withZOrder(charts, embeds, below, current.zOrder));
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
var resolved = changes.filter(function (c) { return !!c; });
|
|
122
|
+
return resolved.length ? resolved : undefined;
|
|
123
|
+
};
|
|
124
|
+
exports.planZOrderChange = planZOrderChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banded-ranges.d.ts","sourceRoot":"","sources":["../../../api/banded-ranges.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,cAAc,WAAW,EAAE,EAC3B,OAAO,gBAAgB,EACvB,SAAS,MAAM,EACf,aAAa,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,EAC1C,gBAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"banded-ranges.d.ts","sourceRoot":"","sources":["../../../api/banded-ranges.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,cAAc,WAAW,EAAE,EAC3B,OAAO,gBAAgB,EACvB,SAAS,MAAM,EACf,aAAa,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,EAC1C,gBAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,4BAuKjD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,iBAE5D,CAAC"}
|
|
@@ -9,13 +9,13 @@ import { getStringifiedColor } from "../themes";
|
|
|
9
9
|
*/
|
|
10
10
|
export const getBandedCells = (bandedRanges, theme, sheetId, isHiddenRow, isHiddenColumn) => {
|
|
11
11
|
const bandedCells = new Map();
|
|
12
|
-
for (const { range, rowProperties, columnProperties } of bandedRanges) {
|
|
12
|
+
for (const { range, rowProperties, columnProperties, showFirstColumn, showLastColumn, totalRow, } of bandedRanges) {
|
|
13
13
|
// Only pick current sheet
|
|
14
14
|
if (range.sheetId !== sheetId) {
|
|
15
15
|
continue;
|
|
16
16
|
}
|
|
17
17
|
if (rowProperties || columnProperties) {
|
|
18
|
-
const { headerColor, firstBandColor, secondBandColor, footerColor, headerBorder, firstBandBorder, footerBorder, } = rowProperties ?? {};
|
|
18
|
+
const { headerColor, firstBandColor, secondBandColor, footerColor, headerBorder, firstBandBorder, footerBorder, firstColumnColor, lastColumnColor, totalRowColor, totalRowBorder, totalRowBold, } = rowProperties ?? {};
|
|
19
19
|
const { firstBandColor: firstBandColorColumn, secondBandColor: secondBandColorColumn, } = columnProperties ?? {};
|
|
20
20
|
const parsedFirstBandColor = parseTintedColor(firstBandColor);
|
|
21
21
|
const parsedSecondBandColor = parseTintedColor(secondBandColor);
|
|
@@ -55,29 +55,56 @@ export const getBandedCells = (bandedRanges, theme, sheetId, isHiddenRow, isHidd
|
|
|
55
55
|
// Body cells
|
|
56
56
|
else {
|
|
57
57
|
const isFooter = rowIndex === lastVisibleRowIndex;
|
|
58
|
+
// A table's totals row takes the style's `totalRow` element (Excel):
|
|
59
|
+
// its fill, its top rule and a bold font — over the plain footer band.
|
|
60
|
+
const isTotalsRow = isFooter && !!totalRow;
|
|
58
61
|
const stripeRowBackground = isOddRow
|
|
59
62
|
? parsedFirstBandColor
|
|
60
63
|
: parsedSecondBandColor;
|
|
61
|
-
|
|
64
|
+
// The footer fill belongs to a totals row (a table without one ends in a plain
|
|
65
|
+
// stripe); the footer border is the style's table outline and stays on the last row
|
|
66
|
+
// either way. A standalone banded range (no `totalRow` flag) keeps Sheets' footer fill.
|
|
67
|
+
const footerBackground = isFooter && totalRow !== false
|
|
62
68
|
? footerColor ?? stripeRowBackground
|
|
63
69
|
: stripeRowBackground;
|
|
70
|
+
const backgroundColor = isTotalsRow
|
|
71
|
+
? totalRowColor ?? footerBackground
|
|
72
|
+
: isFooter
|
|
73
|
+
? footerBackground
|
|
74
|
+
: stripeRowBackground;
|
|
64
75
|
// Border
|
|
65
|
-
const borders =
|
|
66
|
-
? footerBorder ?? firstBandBorder
|
|
67
|
-
:
|
|
76
|
+
const borders = isTotalsRow
|
|
77
|
+
? totalRowBorder ?? footerBorder ?? firstBandBorder
|
|
78
|
+
: isFooter
|
|
79
|
+
? footerBorder ?? firstBandBorder
|
|
80
|
+
: firstBandBorder;
|
|
68
81
|
const isEvenColumn = columnRunningIndex % 2 === 0;
|
|
69
82
|
const finalBackgroundColor = (isEvenColumn
|
|
70
83
|
? parsedFirstBandColorColumn
|
|
71
84
|
: parsedSecondBandColorColumn) ?? backgroundColor;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
// First / Last Column emphasis (Excel: bold, plus the style's fill when it has one).
|
|
86
|
+
// First Column outranks Last Column on a one-column table, like Excel's element order.
|
|
87
|
+
const edgeColumnColor = showFirstColumn && columnIndex === range.startColumnIndex
|
|
88
|
+
? parseTintedColor(firstColumnColor)
|
|
89
|
+
: showLastColumn && columnIndex === range.endColumnIndex
|
|
90
|
+
? parseTintedColor(lastColumnColor)
|
|
91
|
+
: undefined;
|
|
92
|
+
const isEdgeColumn = (showFirstColumn && columnIndex === range.startColumnIndex) ||
|
|
93
|
+
(showLastColumn && columnIndex === range.endColumnIndex);
|
|
94
|
+
const cellBackgroundColor = edgeColumnColor ?? finalBackgroundColor;
|
|
95
|
+
const textColor = edgeColumnColor ??
|
|
96
|
+
(isTotalsRow
|
|
97
|
+
? totalRowColor ?? footerBackground
|
|
98
|
+
: isFooter
|
|
99
|
+
? footerBackground
|
|
100
|
+
: parsedFirstBandColor ??
|
|
101
|
+
parsedSecondBandColor ??
|
|
102
|
+
finalBackgroundColor);
|
|
77
103
|
bandedCells.set(id, {
|
|
78
104
|
borders,
|
|
79
|
-
backgroundColor:
|
|
105
|
+
backgroundColor: cellBackgroundColor,
|
|
80
106
|
textFormat: {
|
|
107
|
+
bold: isEdgeColumn || (isTotalsRow && totalRowBold) ? true : undefined,
|
|
81
108
|
color: textColor
|
|
82
109
|
? getContrastColor(getStringifiedColor(textColor, theme), getStringifiedColor({ theme: 1 }, theme), getStringifiedColor({ theme: 0 }, theme))
|
|
83
110
|
: undefined,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CellInterface, GridRange } from "@rowsncolumns/grid";
|
|
2
|
+
import type { CellData, TableView } from "../types";
|
|
3
|
+
/** A body cell as it was before a calculated-column fill overwrote it (`null` = it was empty). */
|
|
4
|
+
export type CalculatedColumnPreviousCell = {
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
columnIndex: number;
|
|
7
|
+
cell: CellData | null;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `filled`: the formula typed into a table column filled the whole column (Excel's calculated
|
|
11
|
+
* column) — the smart tag offers "Undo Calculated Column". `overwrite`: the column held cells that
|
|
12
|
+
* differ from the typed formula, so nothing filled — the tag offers "Overwrite all cells in this
|
|
13
|
+
* column with this formula".
|
|
14
|
+
*/
|
|
15
|
+
export type CalculatedColumnFillKind = "filled" | "overwrite";
|
|
16
|
+
/**
|
|
17
|
+
* A formula typed into a table body cell that created (or could create) a calculated column — the
|
|
18
|
+
* record behind Excel's AutoCorrect smart tag ("Undo Calculated Column" / "Overwrite all cells in
|
|
19
|
+
* this column with this formula" / "Stop automatically creating calculated columns").
|
|
20
|
+
*/
|
|
21
|
+
export type CalculatedColumnFill = {
|
|
22
|
+
sheetId: number;
|
|
23
|
+
tableId: TableView["id"];
|
|
24
|
+
/** Absolute sheet column of the calculated column. */
|
|
25
|
+
columnIndex: number;
|
|
26
|
+
/** The cell the formula was typed into — the smart tag anchors here. */
|
|
27
|
+
anchor: CellInterface;
|
|
28
|
+
/** The column's body range (header and totals rows excluded). */
|
|
29
|
+
range: GridRange;
|
|
30
|
+
/** The typed formula, as typed (relative to `anchor`). */
|
|
31
|
+
formula: string;
|
|
32
|
+
kind: CalculatedColumnFillKind;
|
|
33
|
+
/** The body cells the fill overwrote, with what they held before — "Undo Calculated Column" restores them. */
|
|
34
|
+
previous: CalculatedColumnPreviousCell[];
|
|
35
|
+
};
|
|
36
|
+
export type CalculatedColumnOption = "undo" | "overwrite" | "stop";
|
|
37
|
+
/**
|
|
38
|
+
* Whether the smart tag stays for the current active cell: it survives the commit's own cursor
|
|
39
|
+
* advance (Enter moves down the column, Tab moves right) and any cell of the calculated column,
|
|
40
|
+
* and goes away when the user moves anywhere else or switches sheet.
|
|
41
|
+
*/
|
|
42
|
+
export declare const keepsCalculatedColumnTag: (fill: CalculatedColumnFill, sheetId: number, activeCell: CellInterface) => boolean;
|
|
43
|
+
//# sourceMappingURL=calculated-column-fill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculated-column-fill.d.ts","sourceRoot":"","sources":["../../../api/calculated-column-fill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpD,kGAAkG;AAClG,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,MAAM,EAAE,aAAa,CAAC;IACtB,iEAAiE;IACjE,KAAK,EAAE,SAAS,CAAC;IACjB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,8GAA8G;IAC9G,QAAQ,EAAE,4BAA4B,EAAE,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,MAAM,oBAAoB,EAC1B,SAAS,MAAM,EACf,YAAY,aAAa,KACxB,OAK6C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the smart tag stays for the current active cell: it survives the commit's own cursor
|
|
3
|
+
* advance (Enter moves down the column, Tab moves right) and any cell of the calculated column,
|
|
4
|
+
* and goes away when the user moves anywhere else or switches sheet.
|
|
5
|
+
*/
|
|
6
|
+
export const keepsCalculatedColumnTag = (fill, sheetId, activeCell) => sheetId === fill.sheetId &&
|
|
7
|
+
activeCell.rowIndex >= fill.range.startRowIndex &&
|
|
8
|
+
activeCell.rowIndex <= fill.range.endRowIndex + 1 &&
|
|
9
|
+
activeCell.columnIndex >= fill.columnIndex &&
|
|
10
|
+
activeCell.columnIndex <= fill.columnIndex + 1;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Sheet } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* The first unused `Chart${n}` sheet title, like Excel's default name for a
|
|
4
|
+
* chartsheet created by "Move Chart → New sheet". `formatTitle` lets hosts
|
|
5
|
+
* localize the pattern.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getNextChartSheetTitle: (sheets: Pick<Sheet, "title">[], formatTitle?: (index: number) => string) => string;
|
|
8
|
+
//# sourceMappingURL=chart-sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-sheet.d.ts","sourceRoot":"","sources":["../../../api/chart-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAC9B,cAAa,CAAC,KAAK,EAAE,MAAM,KAAK,MAAmC,WAUpE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first unused `Chart${n}` sheet title, like Excel's default name for a
|
|
3
|
+
* chartsheet created by "Move Chart → New sheet". `formatTitle` lets hosts
|
|
4
|
+
* localize the pattern.
|
|
5
|
+
*/
|
|
6
|
+
export const getNextChartSheetTitle = (sheets, formatTitle = (index) => `Chart${index}`) => {
|
|
7
|
+
const existingTitles = new Set(sheets.map((sheet) => sheet.title));
|
|
8
|
+
let index = 1;
|
|
9
|
+
let title = formatTitle(index);
|
|
10
|
+
while (existingTitles.has(title)) {
|
|
11
|
+
index++;
|
|
12
|
+
title = formatTitle(index);
|
|
13
|
+
}
|
|
14
|
+
return title;
|
|
15
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { GridRange } from "@rowsncolumns/grid";
|
|
2
|
+
import type { EmbeddedChart, SheetRange } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Border-style `type` of a selected chart's source-range outline. Not a
|
|
5
|
+
* user selection: it never moves the active cell, never shows a fill
|
|
6
|
+
* handle, and only exposes the corner resize handles when the entry is
|
|
7
|
+
* re-bindable.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CHART_SOURCE_SELECTION_TYPE = "chartSource";
|
|
10
|
+
/**
|
|
11
|
+
* Every `ChartData[]` field a spec can carry, in the order Excel colors
|
|
12
|
+
* them: categories, then values, then the extra bubble / hierarchy
|
|
13
|
+
* planes.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CHART_SOURCE_FIELDS: readonly ["domains", "series", "bubbleLabels", "bubbleSizes", "labels", "parentLabels", "sizeData"];
|
|
16
|
+
export type ChartSourceField = (typeof CHART_SOURCE_FIELDS)[number];
|
|
17
|
+
export type ChartSourceRole = ChartSourceField | "seriesName";
|
|
18
|
+
export type ChartSourceRangeEntry = {
|
|
19
|
+
/**
|
|
20
|
+
* Stable identity for the outline. Doubles as the border-style index and
|
|
21
|
+
* as the `data-index` of the outline's resize handles.
|
|
22
|
+
*/
|
|
23
|
+
key: string;
|
|
24
|
+
role: ChartSourceRole;
|
|
25
|
+
field: ChartSourceField;
|
|
26
|
+
dataIndex: number;
|
|
27
|
+
/** Position in `ChartData.sources`; `-1` for a series-name reference. */
|
|
28
|
+
sourceIndex: number;
|
|
29
|
+
range: SheetRange;
|
|
30
|
+
/** Palette slot — the formula editor's per-reference color scheme. */
|
|
31
|
+
colorIndex: number;
|
|
32
|
+
/**
|
|
33
|
+
* Cell-range sources re-bind when a corner handle is dragged. A
|
|
34
|
+
* series-name reference is a single cell and only gets the outline.
|
|
35
|
+
*/
|
|
36
|
+
resizable: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Lists every worksheet range a chart reads, in spec order, each with the
|
|
40
|
+
* palette slot the grid outlines it in. Spec-driven — both chart
|
|
41
|
+
* renderers read the same `EmbeddedChart.spec`, so the outline is the
|
|
42
|
+
* same for either.
|
|
43
|
+
*
|
|
44
|
+
* `sheetId` / `sheetName` identify the sheet being drawn; they are only
|
|
45
|
+
* needed to resolve series-name references, which the spec stores as
|
|
46
|
+
* addresses rather than `SheetRange`s.
|
|
47
|
+
*/
|
|
48
|
+
export declare const getChartSourceRanges: (chart: EmbeddedChart, sheetId: number, sheetName?: string) => ChartSourceRangeEntry[];
|
|
49
|
+
export declare const getChartSourceRangeStroke: (entry: ChartSourceRangeEntry) => string;
|
|
50
|
+
/**
|
|
51
|
+
* The single cell a data point reads from: the `dataIndex`-th cell along
|
|
52
|
+
* the range's long axis (a column range walks rows, a row range walks
|
|
53
|
+
* columns), clamped to the range so a point past the end still outlines
|
|
54
|
+
* the last cell. Excel narrows a series outline to this cell when one
|
|
55
|
+
* data point is selected.
|
|
56
|
+
*/
|
|
57
|
+
export declare const getChartSourcePointRange: (range: SheetRange, dataIndex: number) => SheetRange;
|
|
58
|
+
/**
|
|
59
|
+
* The chart with one source re-bound to `range` (same sheet as before).
|
|
60
|
+
* Returns a new `EmbeddedChart`; `onUpdateChart` applies it as a single
|
|
61
|
+
* history entry on both engines.
|
|
62
|
+
*/
|
|
63
|
+
export declare const replaceChartSourceRange: (chart: EmbeddedChart, entry: ChartSourceRangeEntry, range: GridRange) => EmbeddedChart;
|
|
64
|
+
//# sourceMappingURL=chart-source-ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-source-ranges.d.ts","sourceRoot":"","sources":["../../../api/chart-source-ranges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAa,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGrE;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AAIzD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qGAQtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAc9D,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AA+BF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EACpB,SAAS,MAAM,EACf,YAAY,MAAM,KACjB,qBAAqB,EA+CvB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,OAAO,qBAAqB,WAC1B,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,UAAU,EACjB,WAAW,MAAM,KAChB,UAsBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,aAAa,EACpB,OAAO,qBAAqB,EAC5B,OAAO,SAAS,KACf,aA8BF,CAAC"}
|