@aiquants/spreadsheet 0.16.1 → 0.17.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/index.d.cts CHANGED
@@ -1324,6 +1324,20 @@ export declare const SPREADSHEET_RESERVED_SHORTCUTS: readonly string[];
1324
1324
  */
1325
1325
  export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "increaseColumnWidth" | "decreaseColumnWidth" | "increaseRowHeight" | "decreaseRowHeight" | "autoFitColumnWidth" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
1326
1326
 
1327
+ /**
1328
+ * The size of a grid's content in CSS px of the page (v0.17): the column-letter and row-number bands (0 when `headings`
1329
+ * is false), every column and row at its current size, and the two scroll bars the grid always reserves, all scaled by
1330
+ * the zoom — the box a host gives the grid to show every column and row without scrolling.
1331
+ * グリッドの中身の大きさ (ページの CSS px。v0.17)。列の記号と行の番号の帯 (`headings` が false なら 0)、今の大きさの全部の列と行、
1332
+ * グリッドがいつも取る 2 本のスクロールバーを、どれも倍率で伸び縮みさせたもの。ホストがスクロールなしで全部の列と行を見せる箱の大きさ。
1333
+ */
1334
+ export declare type SpreadsheetContentSize = {
1335
+ /** The width in CSS px. 幅 (CSS px)。 */
1336
+ readonly width: number;
1337
+ /** The height in CSS px. 高さ (CSS px)。 */
1338
+ readonly height: number;
1339
+ };
1340
+
1327
1341
  /**
1328
1342
  * The single data boundary between the grid and the consumer. Reads via getCellText (renderCell
1329
1343
  * — a SpreadsheetProps prop, not an adapter member — customizes only the presentation of that
@@ -1594,6 +1608,22 @@ export declare type SpreadsheetHandle = {
1594
1608
  resizeRow: (row: number, heightPx: number) => void;
1595
1609
  /** Column-width resize (§6.9-8). / 列幅変更。 */
1596
1610
  resizeColumn: (col: number, widthPx: number) => void;
1611
+ /**
1612
+ * Fits each listed column to the widest text of ALL its rows (header rows included; v0.17), as Alt+Shift+= fits the
1613
+ * active column over the rows in view: the same painted fonts, the 9 px padding and the 10,000 px bound, measured with
1614
+ * the cells' base font. A hidden column keeps its width and so does an empty one. Refused through
1615
+ * onOperationRejected("resize", cells, "limit") when the cells to measure exceed `maxOperationCells`. Works whatever
1616
+ * `enableResizeUI` and `headings` say (an imperative path, like resizeColumn).
1617
+ * 名指した列を、その列の**全部の行** (見出しの行も) で最も広い文字に合わせる (v0.17)。Alt+Shift+= が表示中の行で active 列を
1618
+ * 合わせるのと同じ塗りの書体・余白 9 px・上限 10,000 px で、セルの基本の書体で測る。隠した列と空の列は幅を保つ。測るセルが
1619
+ * `maxOperationCells` を超えると onOperationRejected("resize", セル, "limit") で拒む。`enableResizeUI` と `headings` に依らず
1620
+ * 働く (resizeColumn と同じ命令の経路)。
1621
+ *
1622
+ * @param columns - The columns to fit (repeats count once). 合わせる列 (重複は 1 回)。
1623
+ * @returns True when the fit ran (a hidden or empty column changes nothing); false when refused or when the grid cannot measure (`renderCell` is set, or the grid is not mounted). 走ったら true (隠した列・空の列は何も変えない)。拒まれたとき・測れないとき (`renderCell` がある、または未装着) は false。
1624
+ * @throws {RangeError} When a column is not an integer between 0 and the column count − 1. 列が 0〜列数 − 1 の整数でない場合。
1625
+ */
1626
+ autoFitColumns: (columns: readonly number[]) => boolean;
1597
1627
  /**
1598
1628
  * Programmatic viewport jump to a cell (delegates to the engine's scrollToCell — the
1599
1629
  * floor-and-pin jump API). Selection is unchanged; the deep grid stays reachable at any
@@ -2042,6 +2072,29 @@ export declare type SpreadsheetProps = {
2042
2072
  * 復元手段を失う (命令 API のみ)。
2043
2073
  */
2044
2074
  enableResizeUI?: boolean;
2075
+ /**
2076
+ * v0.17 — Shows the column letters, the row numbers and the corner (Excel's "headings"; not `headerRows`), true by
2077
+ * default. False draws none of the three and collapses their grid tracks to 0, so the cells start at the grid's
2078
+ * top-left corner; the gestures that live only on them go with them (header presses, the corner's select-all, the
2079
+ * resize strips and unhide markers), and their keyboard twins stay (Ctrl+Space, Shift+Space, Ctrl+A, Alt+Shift+Arrow,
2080
+ * Alt+Shift+=). The bands are `aria-hidden`, so assistive technology meets the same grid. The root carries
2081
+ * `data-aqsp-headings-hidden` while they are hidden. LIVE prop.
2082
+ * v0.17 — 列の記号・行の番号・角 (Excel の「見出し」。`headerRows` とは別) を見せるか (既定 true)。false は 3 つを描かず、
2083
+ * その格子の帯を 0 にしてセルを根の左上から始める。それらの上にだけある操作 (見出しの押下・角の全選択・境の帯と再表示の印) は
2084
+ * 無くなり、キーの双子 (Ctrl+Space・Shift+Space・Ctrl+A・Alt+Shift+矢印・Alt+Shift+=) は残る。帯は `aria-hidden` なので、
2085
+ * 支援技術から見えるグリッドは変わらない。隠している間、根は `data-aqsp-headings-hidden` を持つ。
2086
+ */
2087
+ headings?: boolean;
2088
+ /**
2089
+ * v0.17 — Receives the size of the grid's content (`SpreadsheetContentSize`) after the first layout and again after
2090
+ * every change of it: a track's size (a resize, an autofit, a hide or unhide, the imperative resizeRow / resizeColumn),
2091
+ * the row or column count, the default sizes, the zoom or `headings`. An unchanged size is not repeated. A host uses it
2092
+ * to size the grid's box to its content.
2093
+ * v0.17 — グリッドの中身の大きさ (`SpreadsheetContentSize`) を、最初の配置の後と、それが変わるたびに受け取る (トラックの
2094
+ * 大きさ — 境の操作・autofit・隠す・再表示・命令の resizeRow / resizeColumn —、行や列の数、既定の大きさ、倍率、`headings`)。
2095
+ * 同じ大きさは繰り返さない。ホストはこれでグリッドの箱を中身に合わせる。
2096
+ */
2097
+ onContentSizeChange?: (size: SpreadsheetContentSize) => void;
2045
2098
  /**
2046
2099
  * AT announcement text for the active cell; omit for silence (no built-in strings). `text`
2047
2100
  * is the RAW canonical getCellText; `displayText` is the value-format display string (the
package/dist/index.d.ts CHANGED
@@ -1324,6 +1324,20 @@ export declare const SPREADSHEET_RESERVED_SHORTCUTS: readonly string[];
1324
1324
  */
1325
1325
  export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "increaseColumnWidth" | "decreaseColumnWidth" | "increaseRowHeight" | "decreaseRowHeight" | "autoFitColumnWidth" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
1326
1326
 
1327
+ /**
1328
+ * The size of a grid's content in CSS px of the page (v0.17): the column-letter and row-number bands (0 when `headings`
1329
+ * is false), every column and row at its current size, and the two scroll bars the grid always reserves, all scaled by
1330
+ * the zoom — the box a host gives the grid to show every column and row without scrolling.
1331
+ * グリッドの中身の大きさ (ページの CSS px。v0.17)。列の記号と行の番号の帯 (`headings` が false なら 0)、今の大きさの全部の列と行、
1332
+ * グリッドがいつも取る 2 本のスクロールバーを、どれも倍率で伸び縮みさせたもの。ホストがスクロールなしで全部の列と行を見せる箱の大きさ。
1333
+ */
1334
+ export declare type SpreadsheetContentSize = {
1335
+ /** The width in CSS px. 幅 (CSS px)。 */
1336
+ readonly width: number;
1337
+ /** The height in CSS px. 高さ (CSS px)。 */
1338
+ readonly height: number;
1339
+ };
1340
+
1327
1341
  /**
1328
1342
  * The single data boundary between the grid and the consumer. Reads via getCellText (renderCell
1329
1343
  * — a SpreadsheetProps prop, not an adapter member — customizes only the presentation of that
@@ -1594,6 +1608,22 @@ export declare type SpreadsheetHandle = {
1594
1608
  resizeRow: (row: number, heightPx: number) => void;
1595
1609
  /** Column-width resize (§6.9-8). / 列幅変更。 */
1596
1610
  resizeColumn: (col: number, widthPx: number) => void;
1611
+ /**
1612
+ * Fits each listed column to the widest text of ALL its rows (header rows included; v0.17), as Alt+Shift+= fits the
1613
+ * active column over the rows in view: the same painted fonts, the 9 px padding and the 10,000 px bound, measured with
1614
+ * the cells' base font. A hidden column keeps its width and so does an empty one. Refused through
1615
+ * onOperationRejected("resize", cells, "limit") when the cells to measure exceed `maxOperationCells`. Works whatever
1616
+ * `enableResizeUI` and `headings` say (an imperative path, like resizeColumn).
1617
+ * 名指した列を、その列の**全部の行** (見出しの行も) で最も広い文字に合わせる (v0.17)。Alt+Shift+= が表示中の行で active 列を
1618
+ * 合わせるのと同じ塗りの書体・余白 9 px・上限 10,000 px で、セルの基本の書体で測る。隠した列と空の列は幅を保つ。測るセルが
1619
+ * `maxOperationCells` を超えると onOperationRejected("resize", セル, "limit") で拒む。`enableResizeUI` と `headings` に依らず
1620
+ * 働く (resizeColumn と同じ命令の経路)。
1621
+ *
1622
+ * @param columns - The columns to fit (repeats count once). 合わせる列 (重複は 1 回)。
1623
+ * @returns True when the fit ran (a hidden or empty column changes nothing); false when refused or when the grid cannot measure (`renderCell` is set, or the grid is not mounted). 走ったら true (隠した列・空の列は何も変えない)。拒まれたとき・測れないとき (`renderCell` がある、または未装着) は false。
1624
+ * @throws {RangeError} When a column is not an integer between 0 and the column count − 1. 列が 0〜列数 − 1 の整数でない場合。
1625
+ */
1626
+ autoFitColumns: (columns: readonly number[]) => boolean;
1597
1627
  /**
1598
1628
  * Programmatic viewport jump to a cell (delegates to the engine's scrollToCell — the
1599
1629
  * floor-and-pin jump API). Selection is unchanged; the deep grid stays reachable at any
@@ -2042,6 +2072,29 @@ export declare type SpreadsheetProps = {
2042
2072
  * 復元手段を失う (命令 API のみ)。
2043
2073
  */
2044
2074
  enableResizeUI?: boolean;
2075
+ /**
2076
+ * v0.17 — Shows the column letters, the row numbers and the corner (Excel's "headings"; not `headerRows`), true by
2077
+ * default. False draws none of the three and collapses their grid tracks to 0, so the cells start at the grid's
2078
+ * top-left corner; the gestures that live only on them go with them (header presses, the corner's select-all, the
2079
+ * resize strips and unhide markers), and their keyboard twins stay (Ctrl+Space, Shift+Space, Ctrl+A, Alt+Shift+Arrow,
2080
+ * Alt+Shift+=). The bands are `aria-hidden`, so assistive technology meets the same grid. The root carries
2081
+ * `data-aqsp-headings-hidden` while they are hidden. LIVE prop.
2082
+ * v0.17 — 列の記号・行の番号・角 (Excel の「見出し」。`headerRows` とは別) を見せるか (既定 true)。false は 3 つを描かず、
2083
+ * その格子の帯を 0 にしてセルを根の左上から始める。それらの上にだけある操作 (見出しの押下・角の全選択・境の帯と再表示の印) は
2084
+ * 無くなり、キーの双子 (Ctrl+Space・Shift+Space・Ctrl+A・Alt+Shift+矢印・Alt+Shift+=) は残る。帯は `aria-hidden` なので、
2085
+ * 支援技術から見えるグリッドは変わらない。隠している間、根は `data-aqsp-headings-hidden` を持つ。
2086
+ */
2087
+ headings?: boolean;
2088
+ /**
2089
+ * v0.17 — Receives the size of the grid's content (`SpreadsheetContentSize`) after the first layout and again after
2090
+ * every change of it: a track's size (a resize, an autofit, a hide or unhide, the imperative resizeRow / resizeColumn),
2091
+ * the row or column count, the default sizes, the zoom or `headings`. An unchanged size is not repeated. A host uses it
2092
+ * to size the grid's box to its content.
2093
+ * v0.17 — グリッドの中身の大きさ (`SpreadsheetContentSize`) を、最初の配置の後と、それが変わるたびに受け取る (トラックの
2094
+ * 大きさ — 境の操作・autofit・隠す・再表示・命令の resizeRow / resizeColumn —、行や列の数、既定の大きさ、倍率、`headings`)。
2095
+ * 同じ大きさは繰り返さない。ホストはこれでグリッドの箱を中身に合わせる。
2096
+ */
2097
+ onContentSizeChange?: (size: SpreadsheetContentSize) => void;
2045
2098
  /**
2046
2099
  * AT announcement text for the active cell; omit for silence (no built-in strings). `text`
2047
2100
  * is the RAW canonical getCellText; `displayText` is the value-format display string (the