@univerjs/sheets 0.1.0-beta.5 → 0.1.2

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/README.md CHANGED
@@ -1,13 +1,44 @@
1
1
  # @univerjs/sheets
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@univerjs/sheets)](https://npmjs.org/package/@univerjs/sheets)
4
+ [![license](https://img.shields.io/npm/l/@univerjs/sheets)](https://img.shields.io/npm/l/@univerjs/sheets)
5
+
3
6
  ## Introduction
4
7
 
5
- > Core library for Univer Sheets.
8
+ `@univerjs/sheets` serves as the foundation for the core business logic of spreadsheets, with base-sheets designed to be UI-agnostic, allowing for functionality such as collaborative editing to be implemented in a Node.js environment.
9
+
10
+ `@univerjs/sheets` provides the following capabilities for Univer Sheet:
11
+
12
+ * Core functionality, including numerical formatting, selection management, permissions, etc.
13
+ * Commands/mutations for modifying spreadsheet data
14
+ * Formula core functionality
15
+ * Core numerical formatting functionality
6
16
 
7
17
  ## Usage
8
18
 
9
19
  ### Installation
10
20
 
11
21
  ```shell
12
- npm i @univerjs/sheets
22
+ # Using npm
23
+ npm install @univerjs/sheets
24
+
25
+ # Using pnpm
26
+ pnpm add @univerjs/sheets
13
27
  ```
28
+
29
+ ### `SheetInterceptorService`
30
+
31
+ `SheetInterceptorService` is a more specialized service provided by `@univerjs/sheets` that allows higher-level business to modify the results of operations such as obtaining cell data, retrieving row/column hiding information from a Worksheet, and supplementing mutations or operations at specific command executions. This service's primary goal is to enable specific functionalities, including:
32
+
33
+ 1. Sheet formulas
34
+ 2. Sheet conditional formatting
35
+ 3. Sheet data validation
36
+ 4. Sheet pivot tables
37
+
38
+ For detailed usage, please refer to the API documentation.
39
+
40
+ #### When to use `SheetInterceptorService` and when not to?
41
+
42
+ Use `SheetInterceptorService` when multiple features need to operate on the same data or state, but do not have a clear dependency relationship. For example: pivot tables, formulas, conditional formatting, data validation, and raw cell data can all affect how other features retrieve a cell's value, but they do not depend on each other. In this case, using `SheetInterceptorService` to implement these features is appropriate.
43
+
44
+ However, if one feature relies explicitly on another feature, such as a formula needing to perform certain actions when the fill down or copy-paste functions are called, the formula module should directly depend on the fill down and copy-paste modules, instead of using `SheetInterceptorService` for implementation.