@rowsncolumns/spreadsheet 10.3.1 → 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 +393 -72
- 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 +214 -39
- 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/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-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-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-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-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-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.d.ts +9 -1
- package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection.js +118 -30
- 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 +22 -10
- 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/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 +332 -21
- 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 +204 -45
- 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/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-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-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-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-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-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.d.ts +9 -1
- package/dist/esm/hooks/use-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection.js +122 -30
- 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 +21 -10
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../api/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../api/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAc,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,QAAQ,SAAS,EAAE,GAAG,SAAS,GAAG,IAAI,0BAMvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,SAAS,EAChB,YAAY,SAAS,MAAM,EAAE,KAC5B,MAAM,EAOR,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,SAAS,EAChB,MAAM,aAAa,EACnB,WAAW,SAAS,EACpB,cAAc,UAAU,EACxB,iBAAiB,UAAU,KAC1B,cAAc,GAAG,IAwDnB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,KAAG,SAUpD,CAAC;AAcF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,SAAS,SAAS,GAAG,SAAS,KAC7B,SAAS,GAAG,IASd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,SAAS,EAChB,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,SAAS,SAAS,GAAG,SAAS,KAC7B,SAAS,GAAG,IA4Bd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,MAAM;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,SAAS,SAAS,GAAG,SAAS,KAC7B,SAAS,GAAG,IAed,CAAC"}
|
package/dist/esm/api/table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isCellWithinBounds } from "@rowsncolumns/grid";
|
|
1
|
+
import { clampIndex, Direction, isCellWithinBounds } from "@rowsncolumns/grid";
|
|
2
2
|
/**
|
|
3
3
|
* Find table withing a cell
|
|
4
4
|
* @param sheetId
|
|
@@ -9,3 +9,140 @@ import { isCellWithinBounds } from "@rowsncolumns/grid";
|
|
|
9
9
|
export const findActiveTableWithinCell = (sheetId, cell, tables) => {
|
|
10
10
|
return tables?.find((table) => table.sheetId === sheetId && isCellWithinBounds(cell, table.range));
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* The rows of `rowIndexes` that "Delete table rows" may remove: the table's body rows. Excel never
|
|
14
|
+
* deletes the header row or the totals row this way — both are dropped from the request.
|
|
15
|
+
*/
|
|
16
|
+
export const getDeletableTableRowIndexes = (table, rowIndexes) => {
|
|
17
|
+
const firstBodyRow = table.range.startRowIndex + ((table.headerRow ?? true) ? 1 : 0);
|
|
18
|
+
const lastBodyRow = table.range.endRowIndex - (table.totalRow ? 1 : 0);
|
|
19
|
+
return rowIndexes.filter((rowIndex) => rowIndex >= firstBodyRow && rowIndex <= lastBodyRow);
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Excel's Tab / Shift+Tab inside a table. Tab walks the table's columns and
|
|
23
|
+
* wraps to the first column of the next row; on the last cell of the last
|
|
24
|
+
* data row it adds a data row and lands in its first column. Shift+Tab walks
|
|
25
|
+
* back and wraps to the last column of the row above. Returns null when the
|
|
26
|
+
* table has no opinion — the totals row, Shift+Tab off the table's first
|
|
27
|
+
* cell and every other direction navigate the sheet as usual.
|
|
28
|
+
*/
|
|
29
|
+
export const getNextCellInTable = (table, cell, direction, isHiddenRow, isHiddenColumn) => {
|
|
30
|
+
const { range } = table;
|
|
31
|
+
const lastDataRowIndex = table.totalRow
|
|
32
|
+
? range.endRowIndex - 1
|
|
33
|
+
: range.endRowIndex;
|
|
34
|
+
if (cell.rowIndex > lastDataRowIndex) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (direction === Direction.Right) {
|
|
38
|
+
const columnIndex = clampIndex(cell.columnIndex + 1, isHiddenColumn, Direction.Right);
|
|
39
|
+
if (columnIndex <= range.endColumnIndex) {
|
|
40
|
+
return { cell: { rowIndex: cell.rowIndex, columnIndex } };
|
|
41
|
+
}
|
|
42
|
+
const firstColumnIndex = clampIndex(range.startColumnIndex, isHiddenColumn, Direction.Right);
|
|
43
|
+
const rowIndex = clampIndex(cell.rowIndex + 1, isHiddenRow, Direction.Down);
|
|
44
|
+
if (rowIndex <= lastDataRowIndex) {
|
|
45
|
+
return { cell: { rowIndex, columnIndex: firstColumnIndex } };
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
cell: { rowIndex: lastDataRowIndex + 1, columnIndex: firstColumnIndex },
|
|
49
|
+
insertRow: true,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (direction === Direction.Left) {
|
|
53
|
+
const columnIndex = clampIndex(cell.columnIndex - 1, isHiddenColumn, Direction.Left);
|
|
54
|
+
if (columnIndex >= range.startColumnIndex) {
|
|
55
|
+
return { cell: { rowIndex: cell.rowIndex, columnIndex } };
|
|
56
|
+
}
|
|
57
|
+
const rowIndex = clampIndex(cell.rowIndex - 1, isHiddenRow, Direction.Up);
|
|
58
|
+
if (rowIndex < range.startRowIndex) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
cell: {
|
|
63
|
+
rowIndex,
|
|
64
|
+
columnIndex: clampIndex(range.endColumnIndex, isHiddenColumn, Direction.Left),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
/** The table's data body: its rows without the header and totals rows. */
|
|
71
|
+
export const getTableBodyRange = (table) => {
|
|
72
|
+
const { range } = table;
|
|
73
|
+
const firstBodyRow = range.startRowIndex + ((table.headerRow ?? true) ? 1 : 0);
|
|
74
|
+
const lastDataRow = range.endRowIndex - (table.totalRow ? 1 : 0);
|
|
75
|
+
return {
|
|
76
|
+
...range,
|
|
77
|
+
startRowIndex: Math.min(firstBodyRow, range.endRowIndex),
|
|
78
|
+
endRowIndex: Math.max(lastDataRow, firstBodyRow),
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const isSameRange = (a, b) => !!a &&
|
|
82
|
+
a.startRowIndex === b.startRowIndex &&
|
|
83
|
+
a.endRowIndex === b.endRowIndex &&
|
|
84
|
+
a.startColumnIndex === b.startColumnIndex &&
|
|
85
|
+
a.endColumnIndex === b.endColumnIndex;
|
|
86
|
+
const clipSpan = (start, end, lo, hi) => ({
|
|
87
|
+
start: Math.max(Math.min(start, end), lo),
|
|
88
|
+
end: Math.min(Math.max(start, end), hi),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Excel's Ctrl+A inside a table cycles data body → whole table (header and
|
|
92
|
+
* totals included) → whole sheet. `current` is the single selected area, if
|
|
93
|
+
* any; `null` means "select the whole sheet".
|
|
94
|
+
*/
|
|
95
|
+
export const getTableSelectAllRange = (table, current) => {
|
|
96
|
+
const body = getTableBodyRange(table);
|
|
97
|
+
if (isSameRange(current, table.range)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
if (isSameRange(current, body)) {
|
|
101
|
+
return { ...table.range };
|
|
102
|
+
}
|
|
103
|
+
return body;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Excel's Ctrl+Space inside a table: the table column data first, the entire
|
|
107
|
+
* table column (header and totals included) second, the sheet column third
|
|
108
|
+
* (`null`). `columns` is the selected column span.
|
|
109
|
+
*/
|
|
110
|
+
export const getTableColumnSelectRange = (table, columns, current) => {
|
|
111
|
+
const { range } = table;
|
|
112
|
+
const span = clipSpan(columns.start, columns.end, range.startColumnIndex, range.endColumnIndex);
|
|
113
|
+
const body = getTableBodyRange(table);
|
|
114
|
+
const data = {
|
|
115
|
+
startRowIndex: body.startRowIndex,
|
|
116
|
+
endRowIndex: body.endRowIndex,
|
|
117
|
+
startColumnIndex: span.start,
|
|
118
|
+
endColumnIndex: span.end,
|
|
119
|
+
};
|
|
120
|
+
const entire = {
|
|
121
|
+
startRowIndex: range.startRowIndex,
|
|
122
|
+
endRowIndex: range.endRowIndex,
|
|
123
|
+
startColumnIndex: span.start,
|
|
124
|
+
endColumnIndex: span.end,
|
|
125
|
+
};
|
|
126
|
+
if (isSameRange(current, entire)) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
if (isSameRange(current, data)) {
|
|
130
|
+
return entire;
|
|
131
|
+
}
|
|
132
|
+
return data;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Excel's Shift+Space inside a table: the table row(s) first, the sheet
|
|
136
|
+
* row(s) second (`null`). `rows` is the selected row span.
|
|
137
|
+
*/
|
|
138
|
+
export const getTableRowSelectRange = (table, rows, current) => {
|
|
139
|
+
const { range } = table;
|
|
140
|
+
const span = clipSpan(rows.start, rows.end, range.startRowIndex, range.endRowIndex);
|
|
141
|
+
const tableRow = {
|
|
142
|
+
startRowIndex: span.start,
|
|
143
|
+
endRowIndex: span.end,
|
|
144
|
+
startColumnIndex: range.startColumnIndex,
|
|
145
|
+
endColumnIndex: range.endColumnIndex,
|
|
146
|
+
};
|
|
147
|
+
return isSameRange(current, tableRow) ? null : tableRow;
|
|
148
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CellInterface, GridRange } from "@rowsncolumns/grid";
|
|
2
|
-
import type { CellData, ConditionType, ConditionValue, CustomFormulaResult, DataValidationRule, DataValidationRuleAlert, FilterCriteria, Maybe, ProtectedRange, SheetProtection, TimePeriodTypes } from "../types";
|
|
2
|
+
import type { BooleanCondition, CellData, ConditionType, ConditionValue, CustomFormulaResult, DataValidationRule, DataValidationRuleAlert, FilterCriteria, Maybe, ProtectedRange, SheetProtection, TimePeriodTypes } from "../types";
|
|
3
3
|
export type CheckBooleanRuleOptions = {
|
|
4
4
|
locale?: string;
|
|
5
5
|
};
|
|
@@ -11,6 +11,31 @@ export type CheckBooleanRuleOptions = {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const checkBooleanRule: <T extends CellData>(rule?: DataValidationRule | undefined, value?: CustomFormulaResult, previousValue?: CustomFormulaResult, getRangeValues?: (address: string) => ConditionValue[], options?: CheckBooleanRuleOptions) => boolean | undefined;
|
|
13
13
|
export declare const checkFilterRule: (filterCriteria: FilterCriteria, value?: CustomFormulaResult) => boolean | undefined;
|
|
14
|
+
/** One AutoFilter clause (`filterCriteria.condition` or `.condition2`) against a cell value. */
|
|
15
|
+
export declare const checkFilterCondition: (condition: BooleanCondition, value?: CustomFormulaResult) => boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Filter conditions decided against the whole column rather than one cell:
|
|
18
|
+
* Excel's "Top 10…" (N items / N percent, largest or smallest) and Above /
|
|
19
|
+
* Below Average. Only numeric cells take part — text, blanks, booleans and
|
|
20
|
+
* errors never rank and are hidden while such a filter is active.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AGGREGATE_FILTER_CONDITION_TYPES: ReadonlySet<ConditionType>;
|
|
23
|
+
export declare const isAggregateFilterCondition: (condition: Maybe<BooleanCondition> | undefined) => boolean;
|
|
24
|
+
export type AggregateFilterThreshold = {
|
|
25
|
+
op: ">" | ">=" | "<" | "<=";
|
|
26
|
+
bound: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The per-column cutoff an aggregate filter compares every cell against,
|
|
30
|
+
* computed once from the column's numeric values. Top/Bottom N keep the N
|
|
31
|
+
* largest/smallest items including ties at the boundary (Excel keeps every
|
|
32
|
+
* row equal to the Nth value); the percent variants convert N% of the
|
|
33
|
+
* numeric count to an item count, rounded up to at least one. `undefined`
|
|
34
|
+
* when the column holds no numbers or N is not a positive number — nothing
|
|
35
|
+
* passes then (`passesAggregateFilterThreshold` is `false`).
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveAggregateFilterThreshold: (condition: BooleanCondition, columnValues: readonly number[]) => AggregateFilterThreshold | undefined;
|
|
38
|
+
export declare const passesAggregateFilterThreshold: (threshold: AggregateFilterThreshold | undefined, value: unknown) => boolean;
|
|
14
39
|
export declare const validationValueToDate: (value: string | TimePeriodTypes) => Date;
|
|
15
40
|
/**
|
|
16
41
|
* A small helper function for list validation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAenE,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EAEvB,cAAc,EACd,KAAK,EACL,cAAc,EACd,eAAe,EACf,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA6CF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,QAAQ,EACjD,OAAO,kBAAkB,GAAG,SAAS,EACrC,QAAQ,mBAAmB,EAC3B,gBAAgB,mBAAmB,EACnC,iBAAiB,CAAC,OAAO,EAAE,MAAM,KAAK,cAAc,EAAE,EACtD,UAAU,uBAAuB,wBAoYlC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,gBAAgB,cAAc,EAC9B,QAAQ,mBAAmB,wBAM5B,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,GAC/B,WAAW,gBAAgB,EAC3B,QAAQ,mBAAmB,wBACc,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,aAAa,CAQpE,CAAC;AAEL,eAAO,MAAM,0BAA0B,GACrC,WAAW,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAS,KAC7C,OACwE,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,GAC1C,WAAW,gBAAgB,EAC3B,cAAc,SAAS,MAAM,EAAE,KAC9B,wBAAwB,GAAG,SAmB7B,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,WAAW,wBAAwB,GAAG,SAAS,EAC/C,OAAO,OAAO,KACb,OAmBF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,GAAG,eAAe,SA+BpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,kBAAkB,GAAG,IAAI,GAAG,SAAS,YAO7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,iBAAiB,cAAc,EAAE,YA2BlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,kBAAkB,cAAc,EAAE,YAcnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,eAAe,GACf,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,aAAa,GACb,YAAY,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,kBAAkB,KAAK,CAAC,eAAe,CAAC,KACvC,OAA0C,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,GAC3C,iBAAiB,KAAK,CAAC,eAAe,CAAC,GAAG,SAAS,EACnD,QAAQ,qBAAqB,KAC5B,OAQF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACtC,iBAAiB,KAAK,CAAC,eAAe,CAAC,GAAG,SAAS,EACnD,gBAAgB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,KACzE,OAC2E,CAAC;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,OAAO,SAAS,EAChB,iBAAiB,cAAc,EAAE,GAAG,SAAS,GAAG,IAAI,wBAWrD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,MAAM,EACf,OAAO,SAAS,EAChB,iBAAiB,cAAc,EAAE,GAAG,SAAS,+BAW9C,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,KAAK,CAAC,aAAa,CAAC,YAGjE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,KAAK,CAAC,uBAAuB,CAAC,EACrC,SAAS,OAAO,KACf,wBAKF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isCellWithinBounds } from "@rowsncolumns/grid";
|
|
2
|
-
import { escapeCharacters, isNil, toDate, toSerial } from "@rowsncolumns/utils";
|
|
2
|
+
import { escapeCharacters, isNil, matchesWildcardPattern, toDate, toSerial, } from "@rowsncolumns/utils";
|
|
3
3
|
import { EMAIL_REGEX, URL_REGEX } from "../config";
|
|
4
4
|
import { checkIfStringIsReference, splitDataValidationListValues, } from "../helpers";
|
|
5
5
|
/**
|
|
@@ -144,6 +144,33 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
144
144
|
const end = new Date(today.getFullYear(), today.getMonth() + 2, 0);
|
|
145
145
|
return { start: startOfDay(start), end: endOfDay(end) };
|
|
146
146
|
}
|
|
147
|
+
// Calendar quarters / years, like Excel's Date Filters. `new Date` rolls a
|
|
148
|
+
// month index past December (or before January) into the adjacent year.
|
|
149
|
+
case "DATE_THIS_QUARTER":
|
|
150
|
+
case "DATE_LAST_QUARTER":
|
|
151
|
+
case "DATE_NEXT_QUARTER": {
|
|
152
|
+
const shift = type === "DATE_LAST_QUARTER" ? -3 : type === "DATE_NEXT_QUARTER" ? 3 : 0;
|
|
153
|
+
const firstMonth = Math.floor(today.getMonth() / 3) * 3 + shift;
|
|
154
|
+
const start = new Date(today.getFullYear(), firstMonth, 1);
|
|
155
|
+
const end = new Date(today.getFullYear(), firstMonth + 3, 0);
|
|
156
|
+
return { start: startOfDay(start), end: endOfDay(end) };
|
|
157
|
+
}
|
|
158
|
+
case "DATE_THIS_YEAR":
|
|
159
|
+
case "DATE_LAST_YEAR":
|
|
160
|
+
case "DATE_NEXT_YEAR": {
|
|
161
|
+
const year = today.getFullYear() +
|
|
162
|
+
(type === "DATE_LAST_YEAR" ? -1 : type === "DATE_NEXT_YEAR" ? 1 : 0);
|
|
163
|
+
return {
|
|
164
|
+
start: startOfDay(new Date(year, 0, 1)),
|
|
165
|
+
end: endOfDay(new Date(year, 11, 31)),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
case "DATE_YEAR_TO_DATE": {
|
|
169
|
+
return {
|
|
170
|
+
start: startOfDay(new Date(today.getFullYear(), 0, 1)),
|
|
171
|
+
end: endOfDay(today),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
147
174
|
default:
|
|
148
175
|
return undefined;
|
|
149
176
|
}
|
|
@@ -162,9 +189,20 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
162
189
|
const { type, values } = condition;
|
|
163
190
|
const valuesArray = values ?? [];
|
|
164
191
|
const firstValue = valuesArray[0] ?? { userEnteredValue: "" };
|
|
192
|
+
// "All Dates in the Period" (`DATE_IN_Q1`..`Q4`, `DATE_IN_M1`..`M12`): the
|
|
193
|
+
// cell's quarter / month in any year.
|
|
194
|
+
const periodMatch = /^DATE_IN_([QM])(\d+)$/.exec(type);
|
|
195
|
+
if (periodMatch) {
|
|
196
|
+
const dateValue = toComparableDate(value);
|
|
197
|
+
if (!dateValue)
|
|
198
|
+
return false;
|
|
199
|
+
const month = dateValue.getMonth() + 1;
|
|
200
|
+
const period = periodMatch[1] === "Q" ? Math.ceil(month / 3) : month;
|
|
201
|
+
return period === Number(periodMatch[2]);
|
|
202
|
+
}
|
|
165
203
|
switch (type) {
|
|
166
204
|
case "TEXT_EQ":
|
|
167
|
-
return
|
|
205
|
+
return matchesWildcardPattern(firstValue.userEnteredValue, String(value), "equals");
|
|
168
206
|
case "BLANK":
|
|
169
207
|
return value === "" || isNil(value);
|
|
170
208
|
case "BOOLEAN":
|
|
@@ -209,17 +247,17 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
209
247
|
case "NUMBER_NOT_EQ":
|
|
210
248
|
return parseNumber(value) !== parseNumber(firstValue.userEnteredValue);
|
|
211
249
|
case "TEXT_CONTAINS":
|
|
212
|
-
return
|
|
250
|
+
return matchesWildcardPattern(firstValue.userEnteredValue, String(value), "contains");
|
|
213
251
|
case "TEXT_ENDS_WITH":
|
|
214
|
-
return
|
|
252
|
+
return matchesWildcardPattern(firstValue.userEnteredValue, String(value), "endsWith");
|
|
215
253
|
case "TEXT_NOT_CONTAINS":
|
|
216
|
-
return !
|
|
254
|
+
return !matchesWildcardPattern(firstValue.userEnteredValue, String(value), "contains");
|
|
217
255
|
case "NOT_BLANK":
|
|
218
256
|
return !(isNil(value) || value === "");
|
|
219
257
|
case "TEXT_NOT_EQ":
|
|
220
|
-
return !
|
|
258
|
+
return !matchesWildcardPattern(firstValue.userEnteredValue, String(value), "equals");
|
|
221
259
|
case "TEXT_STARTS_WITH":
|
|
222
|
-
return
|
|
260
|
+
return matchesWildcardPattern(firstValue.userEnteredValue, String(value), "startsWith");
|
|
223
261
|
case "ONE_OF_RANGE":
|
|
224
262
|
case "ONE_OF_LIST": {
|
|
225
263
|
// Validate allowBlank
|
|
@@ -262,7 +300,14 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
262
300
|
case "DATE_NEXT_WEEK":
|
|
263
301
|
case "DATE_LAST_MONTH":
|
|
264
302
|
case "DATE_THIS_MONTH":
|
|
265
|
-
case "DATE_NEXT_MONTH":
|
|
303
|
+
case "DATE_NEXT_MONTH":
|
|
304
|
+
case "DATE_THIS_QUARTER":
|
|
305
|
+
case "DATE_LAST_QUARTER":
|
|
306
|
+
case "DATE_NEXT_QUARTER":
|
|
307
|
+
case "DATE_THIS_YEAR":
|
|
308
|
+
case "DATE_LAST_YEAR":
|
|
309
|
+
case "DATE_NEXT_YEAR":
|
|
310
|
+
case "DATE_YEAR_TO_DATE": {
|
|
266
311
|
const dateValue = toComparableDate(value);
|
|
267
312
|
if (!dateValue)
|
|
268
313
|
return false;
|
|
@@ -300,10 +345,75 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
300
345
|
};
|
|
301
346
|
export const checkFilterRule = (filterCriteria, value) => {
|
|
302
347
|
if (filterCriteria.condition) {
|
|
303
|
-
return
|
|
348
|
+
return checkFilterCondition(filterCriteria.condition, value);
|
|
304
349
|
}
|
|
305
350
|
return false;
|
|
306
351
|
};
|
|
352
|
+
/** One AutoFilter clause (`filterCriteria.condition` or `.condition2`) against a cell value. */
|
|
353
|
+
export const checkFilterCondition = (condition, value) => checkBooleanRule({ condition }, value);
|
|
354
|
+
/**
|
|
355
|
+
* Filter conditions decided against the whole column rather than one cell:
|
|
356
|
+
* Excel's "Top 10…" (N items / N percent, largest or smallest) and Above /
|
|
357
|
+
* Below Average. Only numeric cells take part — text, blanks, booleans and
|
|
358
|
+
* errors never rank and are hidden while such a filter is active.
|
|
359
|
+
*/
|
|
360
|
+
export const AGGREGATE_FILTER_CONDITION_TYPES = new Set([
|
|
361
|
+
"NUMBER_TOP_N",
|
|
362
|
+
"NUMBER_BOTTOM_N",
|
|
363
|
+
"NUMBER_TOP_PERCENT",
|
|
364
|
+
"NUMBER_BOTTOM_PERCENT",
|
|
365
|
+
"NUMBER_ABOVE_AVERAGE",
|
|
366
|
+
"NUMBER_BELOW_AVERAGE",
|
|
367
|
+
]);
|
|
368
|
+
export const isAggregateFilterCondition = (condition) => !!condition?.type && AGGREGATE_FILTER_CONDITION_TYPES.has(condition.type);
|
|
369
|
+
/**
|
|
370
|
+
* The per-column cutoff an aggregate filter compares every cell against,
|
|
371
|
+
* computed once from the column's numeric values. Top/Bottom N keep the N
|
|
372
|
+
* largest/smallest items including ties at the boundary (Excel keeps every
|
|
373
|
+
* row equal to the Nth value); the percent variants convert N% of the
|
|
374
|
+
* numeric count to an item count, rounded up to at least one. `undefined`
|
|
375
|
+
* when the column holds no numbers or N is not a positive number — nothing
|
|
376
|
+
* passes then (`passesAggregateFilterThreshold` is `false`).
|
|
377
|
+
*/
|
|
378
|
+
export const resolveAggregateFilterThreshold = (condition, columnValues) => {
|
|
379
|
+
const numbers = columnValues.filter((n) => Number.isFinite(n));
|
|
380
|
+
if (!numbers.length || !condition.type)
|
|
381
|
+
return undefined;
|
|
382
|
+
const type = condition.type;
|
|
383
|
+
if (type === "NUMBER_ABOVE_AVERAGE" || type === "NUMBER_BELOW_AVERAGE") {
|
|
384
|
+
const mean = numbers.reduce((sum, n) => sum + n, 0) / numbers.length;
|
|
385
|
+
return { op: type === "NUMBER_ABOVE_AVERAGE" ? ">" : "<", bound: mean };
|
|
386
|
+
}
|
|
387
|
+
const n = Number(condition.values?.[0]?.userEnteredValue);
|
|
388
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
389
|
+
return undefined;
|
|
390
|
+
const top = type === "NUMBER_TOP_N" || type === "NUMBER_TOP_PERCENT";
|
|
391
|
+
const percent = type === "NUMBER_TOP_PERCENT" || type === "NUMBER_BOTTOM_PERCENT";
|
|
392
|
+
const count = Math.min(numbers.length, Math.max(1, percent ? Math.ceil((numbers.length * n) / 100) : Math.floor(n)));
|
|
393
|
+
const sorted = [...numbers].sort((a, b) => (top ? b - a : a - b));
|
|
394
|
+
return { op: top ? ">=" : "<=", bound: sorted[count - 1] };
|
|
395
|
+
};
|
|
396
|
+
export const passesAggregateFilterThreshold = (threshold, value) => {
|
|
397
|
+
if (!threshold)
|
|
398
|
+
return false;
|
|
399
|
+
const num = typeof value === "number"
|
|
400
|
+
? value
|
|
401
|
+
: typeof value === "string" && value.trim() !== ""
|
|
402
|
+
? Number(value)
|
|
403
|
+
: NaN;
|
|
404
|
+
if (!Number.isFinite(num))
|
|
405
|
+
return false;
|
|
406
|
+
switch (threshold.op) {
|
|
407
|
+
case ">":
|
|
408
|
+
return num > threshold.bound;
|
|
409
|
+
case ">=":
|
|
410
|
+
return num >= threshold.bound;
|
|
411
|
+
case "<":
|
|
412
|
+
return num < threshold.bound;
|
|
413
|
+
default:
|
|
414
|
+
return num <= threshold.bound;
|
|
415
|
+
}
|
|
416
|
+
};
|
|
307
417
|
export const validationValueToDate = (value) => {
|
|
308
418
|
switch (value) {
|
|
309
419
|
case "today":
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CalculatedColumnFill } from "../api/calculated-column-fill";
|
|
2
|
+
/**
|
|
3
|
+
* The calculated column a typed formula just created (or could create), waiting for Excel's
|
|
4
|
+
* AutoCorrect smart tag ("Undo Calculated Column" / "Overwrite all cells in this column with this
|
|
5
|
+
* formula" / "Stop automatically creating calculated columns"). Set by the engines' calculated-column
|
|
6
|
+
* path (`useOnChangeCalculatedColumn` in `@rowsncolumns/spreadsheet-state`; the rnc engine's commit
|
|
7
|
+
* fold), read by `CanvasGrid`. Dropped when the user moves away from the column or switches sheet.
|
|
8
|
+
*/
|
|
9
|
+
export declare const calculatedColumnFillAtom: import("jotai").PrimitiveAtom<CalculatedColumnFill | null> & {
|
|
10
|
+
init: CalculatedColumnFill | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const useCalculatedColumnFillState: () => [CalculatedColumnFill | null, (args_0: CalculatedColumnFill | ((prev: CalculatedColumnFill | null) => CalculatedColumnFill | null) | null) => void];
|
|
13
|
+
export declare const useCalculatedColumnFillValue: () => CalculatedColumnFill | null;
|
|
14
|
+
export declare const useSetCalculatedColumnFill: () => (args_0: CalculatedColumnFill | ((prev: CalculatedColumnFill | null) => CalculatedColumnFill | null) | null) => void;
|
|
15
|
+
//# sourceMappingURL=calculated-column-fill.atom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculated-column-fill.atom.d.ts","sourceRoot":"","sources":["../../../atoms/calculated-column-fill.atom.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;CAA0C,CAAC;AAEhF,eAAO,MAAM,4BAA4B,2JAA0C,CAAC;AACpF,eAAO,MAAM,4BAA4B,mCAA+C,CAAC;AACzF,eAAO,MAAM,0BAA0B,4HAA6C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
2
|
+
/**
|
|
3
|
+
* The calculated column a typed formula just created (or could create), waiting for Excel's
|
|
4
|
+
* AutoCorrect smart tag ("Undo Calculated Column" / "Overwrite all cells in this column with this
|
|
5
|
+
* formula" / "Stop automatically creating calculated columns"). Set by the engines' calculated-column
|
|
6
|
+
* path (`useOnChangeCalculatedColumn` in `@rowsncolumns/spreadsheet-state`; the rnc engine's commit
|
|
7
|
+
* fold), read by `CanvasGrid`. Dropped when the user moves away from the column or switches sheet.
|
|
8
|
+
*/
|
|
9
|
+
export const calculatedColumnFillAtom = atom(null);
|
|
10
|
+
export const useCalculatedColumnFillState = () => useAtom(calculatedColumnFillAtom);
|
|
11
|
+
export const useCalculatedColumnFillValue = () => useAtomValue(calculatedColumnFillAtom);
|
|
12
|
+
export const useSetCalculatedColumnFill = () => useSetAtom(calculatedColumnFillAtom);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { EmbeddedChart } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Actions only the chart renderer can perform (they need the live chart
|
|
4
|
+
* instance or the host's editor). A renderer registers them per chart so
|
|
5
|
+
* the grid's right-click menu can offer them without knowing the renderer.
|
|
6
|
+
*/
|
|
7
|
+
export type EmbeddedChartActions = {
|
|
8
|
+
/** Open the host's chart editor for this chart. */
|
|
9
|
+
requestEdit?(): void;
|
|
10
|
+
/** Rasterise the chart as it is drawn and download it as a PNG. */
|
|
11
|
+
downloadPng?(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Rasterise the chart as it is drawn to a PNG blob — Copy as Picture and
|
|
14
|
+
* the print preview draw from it. Resolves `undefined` when the renderer
|
|
15
|
+
* has no live instance to capture.
|
|
16
|
+
*/
|
|
17
|
+
exportPng?(): Promise<Blob | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Excel's "Switch Row/Column": re-derive the series the other way
|
|
20
|
+
* through the data range and persist the chart. Absent when the chart's
|
|
21
|
+
* sources cannot be transposed or the host gave the renderer no update
|
|
22
|
+
* callback.
|
|
23
|
+
*/
|
|
24
|
+
switchRowColumn?(): void;
|
|
25
|
+
};
|
|
26
|
+
export declare const chartActionsAtom: import("jotai").PrimitiveAtom<Record<string, EmbeddedChartActions | undefined>> & {
|
|
27
|
+
init: Record<string, EmbeddedChartActions | undefined>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Register the renderer-side actions of a chart for the lifetime of the
|
|
31
|
+
* component. Callers pass fresh closures every render; the registered
|
|
32
|
+
* entry only changes when an action appears or disappears.
|
|
33
|
+
*/
|
|
34
|
+
export declare const useRegisterChartActions: (chartId: EmbeddedChart["chartId"], actions: EmbeddedChartActions) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Non-subscribing reader: the grid looks actions up when a menu opens, so
|
|
37
|
+
* registrations never re-render the grid.
|
|
38
|
+
*/
|
|
39
|
+
export declare const useGetChartActions: () => (chartId: EmbeddedChart["chartId"]) => EmbeddedChartActions | undefined;
|
|
40
|
+
//# sourceMappingURL=chart-actions.atom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-actions.atom.d.ts","sourceRoot":"","sources":["../../../atoms/chart-actions.atom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,mDAAmD;IACnD,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB,mEAAmE;IACnE,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACxC;;;;;OAKG;IACH,eAAe,CAAC,IAAI,IAAI,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;CAExB,CAAC;AAEN;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,aAAa,CAAC,SAAS,CAAC,EACjC,SAAS,oBAAoB,SA4C9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,kBAGjB,aAAa,CAAC,SAAS,CAAC,KAAG,oBAAoB,GAAG,SAI/D,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { atom, useSetAtom, useStore } from "jotai";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
export const chartActionsAtom = atom({});
|
|
4
|
+
/**
|
|
5
|
+
* Register the renderer-side actions of a chart for the lifetime of the
|
|
6
|
+
* component. Callers pass fresh closures every render; the registered
|
|
7
|
+
* entry only changes when an action appears or disappears.
|
|
8
|
+
*/
|
|
9
|
+
export const useRegisterChartActions = (chartId, actions) => {
|
|
10
|
+
const setChartActions = useSetAtom(chartActionsAtom);
|
|
11
|
+
const actionsRef = useRef(actions);
|
|
12
|
+
actionsRef.current = actions;
|
|
13
|
+
const hasRequestEdit = !!actions.requestEdit;
|
|
14
|
+
const hasDownloadPng = !!actions.downloadPng;
|
|
15
|
+
const hasExportPng = !!actions.exportPng;
|
|
16
|
+
const hasSwitchRowColumn = !!actions.switchRowColumn;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const key = String(chartId);
|
|
19
|
+
setChartActions((prev) => ({
|
|
20
|
+
...prev,
|
|
21
|
+
[key]: {
|
|
22
|
+
requestEdit: hasRequestEdit
|
|
23
|
+
? () => actionsRef.current.requestEdit?.()
|
|
24
|
+
: undefined,
|
|
25
|
+
downloadPng: hasDownloadPng
|
|
26
|
+
? () => actionsRef.current.downloadPng?.()
|
|
27
|
+
: undefined,
|
|
28
|
+
exportPng: hasExportPng
|
|
29
|
+
? () => actionsRef.current.exportPng?.() ?? Promise.resolve(undefined)
|
|
30
|
+
: undefined,
|
|
31
|
+
switchRowColumn: hasSwitchRowColumn
|
|
32
|
+
? () => actionsRef.current.switchRowColumn?.()
|
|
33
|
+
: undefined,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
return () => {
|
|
37
|
+
setChartActions((prev) => {
|
|
38
|
+
const { [key]: _removed, ...rest } = prev;
|
|
39
|
+
return rest;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}, [
|
|
43
|
+
chartId,
|
|
44
|
+
hasRequestEdit,
|
|
45
|
+
hasDownloadPng,
|
|
46
|
+
hasExportPng,
|
|
47
|
+
hasSwitchRowColumn,
|
|
48
|
+
setChartActions,
|
|
49
|
+
]);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Non-subscribing reader: the grid looks actions up when a menu opens, so
|
|
53
|
+
* registrations never re-render the grid.
|
|
54
|
+
*/
|
|
55
|
+
export const useGetChartActions = () => {
|
|
56
|
+
const store = useStore();
|
|
57
|
+
return useCallback((chartId) => store.get(chartActionsAtom)[String(chartId)], [store]);
|
|
58
|
+
};
|
|
@@ -10,6 +10,7 @@ export * from "./sheet-status-display.atom";
|
|
|
10
10
|
export * from "./spreadsheet-api.atom";
|
|
11
11
|
export { useLoadingIndicator } from "./loading-indicator.atom";
|
|
12
12
|
export * from "./selected-chart-embed.atom";
|
|
13
|
+
export * from "./selected-chart-series.atom";
|
|
13
14
|
export * from "./popover.atom";
|
|
14
15
|
export * from "./paste-menu.atom";
|
|
15
16
|
export * from "./fill-options.atom";
|
|
@@ -25,4 +26,8 @@ export * from "./remove-duplicates-dialog.atom";
|
|
|
25
26
|
export * from "./watch-window.atom";
|
|
26
27
|
export * from "./insert-cells-dialog.atom";
|
|
27
28
|
export * from "./insert-options.atom";
|
|
29
|
+
export * from "./chart-actions.atom";
|
|
30
|
+
export * from "./table-auto-expansion.atom";
|
|
31
|
+
export * from "./calculated-column-fill.atom";
|
|
32
|
+
export * from "./sparkline-dialog.atom";
|
|
28
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
|
package/dist/esm/atoms/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./sheet-status-display.atom";
|
|
|
10
10
|
export * from "./spreadsheet-api.atom";
|
|
11
11
|
export { useLoadingIndicator } from "./loading-indicator.atom";
|
|
12
12
|
export * from "./selected-chart-embed.atom";
|
|
13
|
+
export * from "./selected-chart-series.atom";
|
|
13
14
|
export * from "./popover.atom";
|
|
14
15
|
export * from "./paste-menu.atom";
|
|
15
16
|
export * from "./fill-options.atom";
|
|
@@ -25,3 +26,7 @@ export * from "./remove-duplicates-dialog.atom";
|
|
|
25
26
|
export * from "./watch-window.atom";
|
|
26
27
|
export * from "./insert-cells-dialog.atom";
|
|
27
28
|
export * from "./insert-options.atom";
|
|
29
|
+
export * from "./chart-actions.atom";
|
|
30
|
+
export * from "./table-auto-expansion.atom";
|
|
31
|
+
export * from "./calculated-column-fill.atom";
|
|
32
|
+
export * from "./sparkline-dialog.atom";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { EmbeddedChart } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Open-state + payload for Excel's "Move Chart…" dialog (chart context menu /
|
|
4
|
+
* chart editor). The grid opens it with the chart; the host-mounted dialog
|
|
5
|
+
* routes the chosen target through the host's `onMoveChartToSheet`.
|
|
6
|
+
*/
|
|
7
|
+
export type MoveChartDialogRequest = {
|
|
8
|
+
chart: EmbeddedChart;
|
|
9
|
+
};
|
|
10
|
+
export declare const moveChartDialogAtom: import("jotai").PrimitiveAtom<MoveChartDialogRequest | null> & {
|
|
11
|
+
init: MoveChartDialogRequest | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const useMoveChartDialogState: () => [MoveChartDialogRequest | null, (args_0: MoveChartDialogRequest | ((prev: MoveChartDialogRequest | null) => MoveChartDialogRequest | null) | null) => void];
|
|
14
|
+
/**
|
|
15
|
+
* Number of mounted `MoveChartDialogHost`s. The chart context menu only
|
|
16
|
+
* offers "Move chart…" while a host is mounted, so a host that has not
|
|
17
|
+
* adopted the dialog never gets a dead item.
|
|
18
|
+
*/
|
|
19
|
+
export declare const moveChartDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
|
|
20
|
+
init: number;
|
|
21
|
+
};
|
|
22
|
+
/** True when at least one `MoveChartDialogHost` is mounted. */
|
|
23
|
+
export declare const useIsMoveChartDialogMounted: () => boolean;
|
|
24
|
+
/** Registers the calling component as a dialog host for its lifetime. */
|
|
25
|
+
export declare const useRegisterMoveChartDialogHost: () => void;
|
|
26
|
+
/** Returns a function that opens the host-mounted "Move Chart…" dialog. */
|
|
27
|
+
export declare const useOpenMoveChartDialog: () => (request: MoveChartDialogRequest) => void;
|
|
28
|
+
//# sourceMappingURL=move-chart-dialog.atom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-chart-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/move-chart-dialog.atom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;CAA4C,CAAC;AAE7E,eAAO,MAAM,uBAAuB,mKAAqC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;CAAU,CAAC;AAEpD,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,eACQ,CAAC;AAEjD,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,YAM1C,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,kBAGrB,sBAAsB,SAGnC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
export const moveChartDialogAtom = atom(null);
|
|
4
|
+
export const useMoveChartDialogState = () => useAtom(moveChartDialogAtom);
|
|
5
|
+
/**
|
|
6
|
+
* Number of mounted `MoveChartDialogHost`s. The chart context menu only
|
|
7
|
+
* offers "Move chart…" while a host is mounted, so a host that has not
|
|
8
|
+
* adopted the dialog never gets a dead item.
|
|
9
|
+
*/
|
|
10
|
+
export const moveChartDialogHostCountAtom = atom(0);
|
|
11
|
+
/** True when at least one `MoveChartDialogHost` is mounted. */
|
|
12
|
+
export const useIsMoveChartDialogMounted = () => useAtomValue(moveChartDialogHostCountAtom) > 0;
|
|
13
|
+
/** Registers the calling component as a dialog host for its lifetime. */
|
|
14
|
+
export const useRegisterMoveChartDialogHost = () => {
|
|
15
|
+
const setCount = useSetAtom(moveChartDialogHostCountAtom);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setCount((count) => count + 1);
|
|
18
|
+
return () => setCount((count) => count - 1);
|
|
19
|
+
}, [setCount]);
|
|
20
|
+
};
|
|
21
|
+
/** Returns a function that opens the host-mounted "Move Chart…" dialog. */
|
|
22
|
+
export const useOpenMoveChartDialog = () => {
|
|
23
|
+
const setRequest = useSetAtom(moveChartDialogAtom);
|
|
24
|
+
return useCallback((request) => setRequest(request), [setRequest]);
|
|
25
|
+
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import type { SetStateAction } from "react";
|
|
2
|
+
import type { EmbeddedObject } from "../types";
|
|
1
3
|
export declare const selectedChartEmbedAtom: import("jotai").PrimitiveAtom<string | number | undefined> & {
|
|
2
4
|
init: string | number | undefined;
|
|
3
5
|
};
|
|
4
6
|
export declare const useSelectedChartEmbed: () => [string | number | undefined, (args_0: string | number | ((prev: string | number | undefined) => string | number | undefined) | undefined) => void];
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Select a chart / picture the way Excel does after inserting or restoring one: the object is
|
|
9
|
+
* selected and scrolled into view (`CanvasGridMethods.scrollToChart`, once the grid renders it).
|
|
10
|
+
* A functional update only re-derives the selection (an undo step deselecting a removed object)
|
|
11
|
+
* and clearing it never scrolls.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useFocusEmbedOrChart: () => (update: SetStateAction<EmbeddedObject["embedId"] | undefined>) => void;
|
|
6
14
|
//# sourceMappingURL=selected-chart-embed.atom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-chart-embed.atom.d.ts","sourceRoot":"","sources":["../../../atoms/selected-chart-embed.atom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selected-chart-embed.atom.d.ts","sourceRoot":"","sources":["../../../atoms/selected-chart-embed.atom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,eAAO,MAAM,sBAAsB;;CAEvB,CAAC;AAEb,eAAO,MAAM,qBAAqB,2JAAwC,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,iBAIpB,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,SAQjE,CAAC"}
|