Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix/remove-endResi…
Browse files Browse the repository at this point in the history
…zing-async
  • Loading branch information
Rui-Sun committed Aug 2, 2024
2 parents 55ee5a1 + 446e42a commit 7d6391b
Show file tree
Hide file tree
Showing 60 changed files with 766 additions and 948 deletions.
4 changes: 4 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads
nvm bash_completion
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: set sort rule occor error #2106\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: clearSelected api clear ctrl+a border #2115\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: pivot table corner cell support icon #2120\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: move header position not work not trigger change_header_position event #2129\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: support editCellTrigger set keydown #2136\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: add react-component for option-emptyTip\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "Ajialuo@outlook.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: add react-component for option-emptyTip - demo\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "Ajialuo@outlook.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "feat: add escape config in csv-exporter",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix cell range clear in update record",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix custom-element update problem #2126",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix customMege cell update",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix legend visible config #2137",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix released async problem #2145",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
4 changes: 2 additions & 2 deletions docs/assets/demo/en/edit/edit-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ option: ListTable-columns-text#editor
This example shows the editability of the table. Click a cell to enter the edit state. If you want to change the timing of entering the edit state, you can set:

```
/** Edit triggering time: double click event | single click event | api to manually start editing. Default is double click 'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api';
/** Edit triggering time: double click event | single click event | api to manually start editing | keydown event. Default is double click 'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api' | 'keydown' | ('doubleclick' | 'click' | 'api' | 'keydown')[];
```

The current example has four editors: input, date, list, and textArea. Different effects can be achieved by setting different editors.
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/demo/zh/edit/edit-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ option: ListTable-columns-text#editor
该示例展示了表格的可编辑能力。单击单元格,即可进入编辑状态。如果想要修改进入编辑的时机,可以设置:

```
/** 编辑触发时机:双击事件 | 单击事件 | api手动开启编辑。默认为双击'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api';
/** 编辑触发时机:双击事件 | 单击事件 | api手动开启编辑 | 键入新值。默认为双击'doubleclick' */
editCellTrigger?:'doubleclick' | 'click' | 'api' | 'keydown' | ('doubleclick' | 'click' | 'api' | 'keydown')[];
```

当前示例中有 input、date、list、textArea 四种编辑器,可以通过设置不同的编辑器来实现不同的效果。
Expand Down
40 changes: 40 additions & 0 deletions docs/assets/guide/en/data/data_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Next we will describe how to apply this data to basic tables and pivot tables, r

## Basic tabular data

### JSON data

In a basic table, data is presented in units of behavior, and each row contains multiple fields (columns). For example: name, age, gender, and address. Each object in the data item will correspond to a row.

Creating a basic table based on the above JSON data should configure the corresponding [`ListTableConstructorOptions`](../../option/ListTable#container) Assign, and will `records` Configure as a data source.
Expand Down Expand Up @@ -61,6 +63,8 @@ const option = {
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
```

### Two-dimensional array structure

If you use a two-dimensional array as the data source, you can run it as follows:

```javascript livedemo template=vtable
Expand Down Expand Up @@ -98,6 +102,42 @@ const option = {
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
```

### Special usage of multi-level data

A data source with a multi-level data structure can be implemented by setting `records` to `[{}]`.
like:

```
records:
[
{
id: "7981",
details:
productName:'fff'
}
]
```

details is an object in the data entry. In the data source, the corresponding value can be obtained through `details.name`.

You need to configure the above multi-level objects in columns like this:

```
const columns = [
{
"field": ['details','productName'],
"title": "Order productName",
"width": "auto"
},
]
```

The effect is as follows:

<div style="width: 50%; text-align: center;">
<img src="https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/guide/list-record-obj.png" />
</div>

## Pivot Table Data

The main purpose of pivot tables is to display and analyze data in multiple Dimensions. When configuring pivot tables, we need to specify grouping (row and column) Dimensions and Metirc Dimensions. For example, we can group data by gender and calculate the number of people and average age for each.
Expand Down
36 changes: 23 additions & 13 deletions docs/assets/guide/en/data_analysis/pivot_table_dataAnalysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ This configuration is the simplest configuration for multidimensional tables. As

## Data analysis related configuration:

| Configuration item | Type | Description |
| :--------------------------- | :----------------------------- | :---------------------------------------------------------------------------------- |
| rows | (IRowDimension \| string)[] | Row dimension field array, used to parse out the corresponding dimension members |
| columns | (IColumnDimension \| string)[] | Column dimension field array, used to parse out the corresponding dimension members |
| indicators | (IIndicator \| string)[] | Specific display indicators |
| dataConfig.aggregationRules | aggregationRule[] | Aggregation value calculation rules according to row and column dimensions |
| dataConfig.derivedFieldRules | DerivedFieldRule[] | Derived fields |
| dataConfig.sortRules | sortRule[] | Sort rules |
| dataConfig.filterRules | filterRule[] | Filter Rules |
| dataConfig.totals | totalRule[] | Subtotal or total |
| Configuration item | Type | Description |
| :------------------------------ | :----------------------------- | :---------------------------------------------------------------------------------- |
| rows | (IRowDimension \| string)[] | Row dimension field array, used to parse out the corresponding dimension members |
| columns | (IColumnDimension \| string)[] | Column dimension field array, used to parse out the corresponding dimension members |
| indicators | (IIndicator \| string)[] | Specific display indicators |
| dataConfig.aggregationRules | aggregationRule[] | Aggregation value calculation rules according to row and column dimensions |
| dataConfig.derivedFieldRules | DerivedFieldRule[] | Derived fields |
| dataConfig.sortRules | sortRule[] | Sort rules |
| dataConfig.filterRules | filterRule[] | Filter Rules |
| dataConfig.totals | totalRule[] | Subtotal or total |
| dataConfig.calculatedFieldRules | CalculateddFieldRule[] | calculated fields |

dataConfig configuration definition:

Expand All @@ -55,7 +56,7 @@ dataConfig configuration definition:
* Data processing configuration
*/
export interface IDataConfig {
aggregationRules?: AggregationRules; //按照行列维度聚合值计算规则;
aggregationRules?: AggregationRules; //Calculate the aggregated values according to row and column dimensions; by default, all indicator values will be calculated by summing them up.
sortRules?: SortRules; //排序规则;
filterRules?: FilterRules; //过滤规则;
totals?: Totals; //小计或总计;
Expand Down Expand Up @@ -120,6 +121,7 @@ For definitions, please refer to:
The following is an example of the indicator value sorting configuration:

```
dataConfig: {
sortRules: [
{
sortField: 'city',
Expand All @@ -128,7 +130,7 @@ The following is an example of the indicator value sorting configuration:
query: ['office supplies', 'pen']
} as VTable.TYPES.SortByIndicatorRule
]
}
```

If you need to modify the sorting rules of the pivot table, you can use the interface `updateSortRules`.
Expand All @@ -142,24 +144,29 @@ Online demo:https://visactor.io/vtable/demo/data-analysis/pivot-analysis-sort-
Configuration example:

```
filterRules: [
dataConfig: {
filterRules: [
{
filterFunc: (record: Record<string, any>) => {
return record.province !== 'Sichuan Province' || record.category !== 'Furniture';
}
}
]
}
```

Online demo:https://visactor.io/vtable/demo/data-analysis/pivot-analysis-filter

### 4. Aggregation method

By default, all indicator values are calculated as SUM. If you do not want this default calculation method, you can modify it by configuring aggregationRules. Usually, if the indicator is a string type, you need to configure NONE to display the original value of the data source field.

[option description](../../option/PivotTable#dataConfig.aggregationRules)

Configuration example:

```
dataConfig: {
aggregationRules: [
//The basis for doing aggregate calculations, such as sales. If there is no configuration, the cell content will be displayed by default based on the aggregate sum calculation result.
{
Expand Down Expand Up @@ -195,6 +202,7 @@ Configuration example:
aggregationType: VTable.TYPES.AggregationType.RECORD, //don't aggregate. Match all the corresponding data as the value of the cell
}
]
}
```

Online demo:https://visactor.io/vtable/demo/data-analysis/pivot-analysis-aggregation
Expand Down Expand Up @@ -233,6 +241,7 @@ The sales indicator in this record is a non-numeric value, and it is required to
Configuration example:

```
dataConfig: {
derivedFieldRules: [
{
fieldName: 'Year',
Expand All @@ -243,6 +252,7 @@ Configuration example:
derivedFunc: VTable.DataStatistics.dateFormat('Order Date', '%n', true),
}
]
}
```

Online demo:https://visactor.io/vtable/demo/data-analysis/pivot-analysis-derivedField
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/guide/en/edit/edit_cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Editing trigger timing support: double-click a cell to enter editing, click a ce
```ts
interface ListTableConstructorOptions {
/** Editing trigger timing Double-click event Click event API manually starts editing. The default is double-click 'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api';
editCellTrigger?: 'doubleclick' | 'click' | 'api' | 'keydown' | ('doubleclick' | 'click' | 'api' | 'keydown')[];
// ...
}
```
Expand Down
Loading

0 comments on commit 7d6391b

Please sign in to comment.