@mescius/spread-sheets 18.2.2 → 18.2.3

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.
@@ -25693,23 +25693,30 @@ declare module GC{
25693
25693
  */
25694
25694
  getSparkline(row: number, column: number): GC.Spread.Sheets.Sparklines.Sparkline;
25695
25695
  /**
25696
- * Gets the style information for a specified cell in the specified sheet area.
25697
- * @param {number} row The row index.
25698
- * @param {number} column The column index.
25696
+ * Gets the style information for a cell, row, column, or the sheet default based on the provided indices.
25697
+ * Special Index Behavior:
25698
+ * - When rowIndex is -1 and columnIndex is a valid column index (>= 0), returns the style at the **column level** for the specified column.
25699
+ * - When columnIndex is -1 and rowIndex is a valid row index (>= 0), returns the style at the **row level** for the specified row.
25700
+ * - When both rowIndex and columnIndex are -1, returns the **sheet's default style** (not associated with any specific cell, row, or column).
25701
+ * - When both rowIndex and columnIndex are >= 0 (default case), returns the **cell's style** at the specified (row, column), which is resolved based on the priority: Cell > Row > Column > Default.
25702
+ * @param {number} row The row index. Use -1 to query column-level or default style.
25703
+ * @param {number} column The column index. Use -1 to query row-level or default style.
25699
25704
  * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`.
25700
- * @returns {GC.Spread.Sheets.Style} Returns the cell style of the specified cell.
25705
+ * @returns {GC.Spread.Sheets.Style} The resolved Style object based on the index combination.
25706
+ *
25701
25707
  * @example
25702
25708
  * ```javascript
25703
- * //This example uses the getStyle method.
25704
- * var style = new GC.Spread.Sheets.Style();
25705
- * style.backColor = "red";
25706
- * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
25707
- * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
25708
- * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
25709
- * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
25710
- * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport);
25711
- * var cstyle = activeSheet.getStyle(1,1,GC.Spread.Sheets.SheetArea.viewport);
25712
- * alert(cstyle.backColor);
25709
+ * // 1. Get the style of a specific cell (original usage)
25710
+ * var cellStyle = activeSheet.getStyle(1, 1, GC.Spread.Sheets.SheetArea.viewport);
25711
+ *
25712
+ * // 2. Get the column-level style for column index 1 (column B)
25713
+ * var columnStyle = activeSheet.getStyle(-1, 1, GC.Spread.Sheets.SheetArea.viewport);
25714
+ *
25715
+ * // 3. Get the row-level style for row index 2 (row 3)
25716
+ * var rowStyle = activeSheet.getStyle(2, -1, GC.Spread.Sheets.SheetArea.viewport);
25717
+ *
25718
+ * // 4. Get the sheet's default style
25719
+ * var defaultStyle = activeSheet.getStyle(-1, -1, GC.Spread.Sheets.SheetArea.viewport);
25713
25720
  * ```
25714
25721
  */
25715
25722
  getStyle(row: number, column: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.Style;
@@ -26798,18 +26805,36 @@ declare module GC{
26798
26805
  */
26799
26806
  setSparkline(row: number, col: number, dataRange: GC.Spread.Sheets.Range | string, dataOrientation: GC.Spread.Sheets.Sparklines.DataOrientation, sparklineType: GC.Spread.Sheets.Sparklines.SparklineType, sparklineSetting: GC.Spread.Sheets.Sparklines.SparklineSetting, dateAxisRange?: GC.Spread.Sheets.Range | string, dateAxisOrientation?: GC.Spread.Sheets.Sparklines.DataOrientation): GC.Spread.Sheets.Sparklines.Sparkline;
26800
26807
  /**
26801
- * Sets the style information for a specified cell in the specified sheet area.
26802
- * @param {number} row The row index.
26803
- * @param {number} column The column index.
26804
- * @param {GC.Spread.Sheets.Style} value The cell style.
26808
+ * Sets the style information for a cell, row, column, or the worksheet default based on the provided indices.
26809
+ *
26810
+ * Special Index Behavior:
26811
+ * - When rowIndex is -1 and columnIndex is a valid column index (>= 0), sets the **column-level style** for the specified column.
26812
+ * - When columnIndex is -1 and rowIndex is a valid row index (>= 0), sets the **row-level style** for the specified row.
26813
+ * - When both rowIndex and columnIndex are -1, sets the **worksheet's default style** (applies to all cells unless overridden).
26814
+ * - When both rowIndex and columnIndex are >= 0 (default case), sets the **cell style** for the specified (row, column) in the given sheet area.
26815
+ *
26816
+ * @param {number} row The zero-based row index. Use -1 to target column-level or default style.
26817
+ * @param {number} col The zero-based column index. Use -1 to target row-level or default style.
26818
+ * @param {GC.Spread.Sheets.Style} value The Style object containing the style properties to apply.
26805
26819
  * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`.
26820
+ *
26806
26821
  * @example
26807
26822
  * ```javascript
26808
- * //This example uses the setStyle method.
26809
- * var style = new GC.Spread.Sheets.Style();
26810
- * style.backColor = "lightgreen";
26811
- * style.backgroundImage = "./css/images/quarter1.png";
26812
- * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport);
26823
+ * var style = new GC.Spread.Sheets.Style();
26824
+ * style.backColor = "lightgreen";
26825
+ * sheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport);
26826
+ * // 2. Set the column-level style for column index 2 (column C)
26827
+ * var columnStyle = new GC.Spread.Sheets.Style();
26828
+ * columnStyle.backColor = "yellow";
26829
+ * sheet.setStyle(-1, 2, columnStyle, GC.Spread.Sheets.SheetArea.viewport);
26830
+ * // 3. Set the row-level style for row index 3 (row 4)
26831
+ * var rowStyle = new GC.Spread.Sheets.Style();
26832
+ * rowStyle.backColor = "lightcoral";
26833
+ * sheet.setStyle(3, -1, rowStyle, GC.Spread.Sheets.SheetArea.viewport);
26834
+ * // 4. Set the worksheet's default style
26835
+ * var defaultStyle = new GC.Spread.Sheets.Style();
26836
+ * defaultStyle.backColor = "lightblue";
26837
+ * sheet.setStyle(-1, -1, defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
26813
26838
  * ```
26814
26839
  */
26815
26840
  setStyle(row: number, col: number, value: GC.Spread.Sheets.Style, sheetArea?: GC.Spread.Sheets.SheetArea): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mescius/spread-sheets",
3
- "version": "18.2.2",
3
+ "version": "18.2.3",
4
4
  "main": "index.js",
5
5
  "description":"A Complete Microsoft Excel-like JavaScript Spreadsheet for Enterprise Applications",
6
6
  "scripts": {},