@univerjs/sheets 0.6.6 → 0.6.7

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/lib/es/facade.js CHANGED
@@ -2244,16 +2244,42 @@ let m = class extends le {
2244
2244
  /**
2245
2245
  * Returns a string description of the range, in A1 notation.
2246
2246
  * @param {boolean} [withSheet] - If true, the sheet name is included in the A1 notation.
2247
+ * @param {AbsoluteRefType} [startAbsoluteRefType] - The absolute reference type for the start cell.
2248
+ * @param {AbsoluteRefType} [endAbsoluteRefType] - The absolute reference type for the end cell.
2247
2249
  * @returns {string} The A1 notation of the range.
2248
2250
  * ```ts
2249
2251
  * const fWorkbook = univerAPI.getActiveWorkbook();
2250
2252
  * const fWorksheet = fWorkbook.getActiveSheet();
2253
+ *
2254
+ * // By default, the A1 notation is returned without the sheet name and without absolute reference types.
2251
2255
  * const fRange = fWorksheet.getRange('A1:B2');
2252
2256
  * console.log(fRange.getA1Notation()); // A1:B2
2257
+ *
2258
+ * // By setting withSheet to true, the sheet name is included in the A1 notation.
2259
+ * fWorksheet.setName('Sheet1');
2260
+ * console.log(fRange.getA1Notation(true)); // Sheet1!A1:B2
2261
+ *
2262
+ * // By setting startAbsoluteRefType, the absolute reference type for the start cell is included in the A1 notation.
2263
+ * console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.ROW)); // A$1:B2
2264
+ * console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.COLUMN)); // $A1:B2
2265
+ * console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.ALL)); // $A$1:B2
2266
+ *
2267
+ * // By setting endAbsoluteRefType, the absolute reference type for the end cell is included in the A1 notation.
2268
+ * console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.ROW)); // A1:B$2
2269
+ * console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.COLUMN)); // A1:$B2
2270
+ * console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.ALL)); // A1:$B$2
2271
+ *
2272
+ * // By setting all parameters example
2273
+ * console.log(fRange.getA1Notation(true, univerAPI.Enum.AbsoluteRefType.ALL, univerAPI.Enum.AbsoluteRefType.ALL)); // Sheet1!$A$1:$B$2
2253
2274
  * ```
2254
2275
  */
2255
- getA1Notation(r) {
2256
- return r ? sn(this._worksheet.getName(), this._range) : _e(this._range);
2276
+ getA1Notation(r, e, t) {
2277
+ const n = {
2278
+ ...this._range,
2279
+ startAbsoluteRefType: e,
2280
+ endAbsoluteRefType: t
2281
+ };
2282
+ return r ? sn(this._worksheet.getName(), n) : _e(n);
2257
2283
  }
2258
2284
  /**
2259
2285
  * Sets the specified range as the active range, with the top left cell in the range as the current cell.
@@ -3086,7 +3112,7 @@ let k = class extends le {
3086
3112
  * ```
3087
3113
  */
3088
3114
  getRowDefaultStyle(e, t = !1) {
3089
- return this._worksheet.getRowStyle(e, t);
3115
+ return t ? this._worksheet.getRowStyle(e, t) : this._worksheet.getRowStyle(e);
3090
3116
  }
3091
3117
  /**
3092
3118
  * Get the default style of the worksheet column
@@ -3105,7 +3131,7 @@ let k = class extends le {
3105
3131
  * ```
3106
3132
  */
3107
3133
  getColumnDefaultStyle(e, t = !1) {
3108
- return this._worksheet.getColumnStyle(e, t);
3134
+ return t ? this._worksheet.getColumnStyle(e, t) : this._worksheet.getColumnStyle(e);
3109
3135
  }
3110
3136
  /**
3111
3137
  * Set the default style of the worksheet