Skip to content

Commit

Permalink
Merge pull request #2556 from VisActor/release/1.8.2
Browse files Browse the repository at this point in the history
[Auto release] release 1.8.2
  • Loading branch information
fangsmile authored Oct 8, 2024
2 parents eeb6ab6 + f6c75f0 commit 312a638
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 42 deletions.
53 changes: 33 additions & 20 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.8.1","mainProject":"@visactor/vtable","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.8.2","mainProject":"@visactor/vtable","nextBump":"patch"}]
11 changes: 11 additions & 0 deletions docs/assets/changelog/en/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v1.8.1

2024-09-30


**🔨 Refactor**

- **@visactor/vue-vtable**: rename vue component name

[more detail about v1.8.1](https://github.com/VisActor/VTable/releases/tag/v1.8.1)

# v1.8.0

2024-09-29
Expand Down
11 changes: 11 additions & 0 deletions docs/assets/changelog/zh/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v1.8.1

2024-09-30


**🔨 功能重构**

- **@visactor/vue-vtable**: rename vue component name

[更多详情请查看 v1.8.1](https://github.com/VisActor/VTable/releases/tag/v1.8.1)

# v1.8.0

2024-09-29
Expand Down
2 changes: 1 addition & 1 deletion packages/openinula-vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/openinula-vtable",
"version": "1.8.1",
"version": "1.8.2",
"description": "The openinula version of VTable",
"keywords": [
"openinula",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vtable",
"version": "1.8.1",
"version": "1.8.2",
"description": "The react version of VTable",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-editors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-editors",
"version": "1.8.1",
"version": "1.8.2",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-export",
"version": "1.8.1",
"version": "1.8.2",
"description": "The export util of VTable",
"author": {
"name": "VisActor",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-gantt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-gantt",
"version": "1.8.1",
"version": "1.8.2",
"description": "canvas table width high performance",
"keywords": [
"vtable-gantt",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-search",
"version": "1.8.1",
"version": "1.8.2",
"description": "The search util of VTable",
"author": {
"name": "VisActor",
Expand Down
12 changes: 12 additions & 0 deletions packages/vtable/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@visactor/vtable",
"entries": [
{
"version": "1.8.2",
"tag": "@visactor/vtable_v1.8.2",
"date": "Mon, 30 Sep 2024 09:38:25 GMT",
"comments": {
"none": [
{
"comment": "fix: fix richtext icon update #2281"
}
]
}
},
{
"version": "1.8.1",
"tag": "@visactor/vtable_v1.8.1",
Expand Down
9 changes: 8 additions & 1 deletion packages/vtable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @visactor/vtable

This log was last generated on Sun, 29 Sep 2024 07:41:11 GMT and should not be manually modified.
This log was last generated on Mon, 30 Sep 2024 09:38:25 GMT and should not be manually modified.

## 1.8.2
Mon, 30 Sep 2024 09:38:25 GMT

### Updates

- fix: fix richtext icon update #2281

## 1.8.1
Sun, 29 Sep 2024 07:41:11 GMT
Expand Down
36 changes: 27 additions & 9 deletions packages/vtable/examples/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ const generatePersons = count => {
}));
};

VTable.register.icon('sort_normal', {
type: 'svg',
svg: `<svg t="1669210412838" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5700" width="200" height="200"><path d="M420.559974 72.98601l-54.855 0 0 774.336c-52.455014-69.163008-121.619046-123.762995-201.120051-157.052006l0 61.968c85.838029 41.401958 156.537958 111.337984 201.120051 198.221005l0 0.208 54.855 0 0-13.047c0.005018-0.00297 0.010035-0.005018 0.01495-0.007987-0.005018-0.010035-0.010035-0.019968-0.01495-0.030003L420.559974 72.986zM658.264986 73.385984l0-0.4L603.41 72.985984l0 877.68 54.855 0L658.265 176.524c52.457984 69.178982 121.632051 123.790029 201.149952 157.078016l0-61.961C773.560013 230.238003 702.853018 160.287027 658.264986 73.385984z" p-id="5701"></path></svg>`,
width: 20, //其实指定的是svg图片绘制多大,实际占位是box,margin也是相对阴影范围指定的
height: 20,
funcType: VTable.TYPES.IconFuncTypeEnum.sort,
name: 'sort_normal',
positionType: VTable.TYPES.IconPosition.inlineFront,
marginLeft: 0,
marginRight: 0,
hover: {
width: 24,
height: 24,
bgColor: 'rgba(22,44,66,0.5)'
},
cursor: 'pointer'
});

export function createTable() {
const records = generatePersons(2000);
const columns: VTable.ColumnsDefine = [
Expand Down Expand Up @@ -170,16 +188,16 @@ export function createTable() {
emptyTip: true,
records,
columns: [
...columns,
...columns,
...columns,
...columns,
...columns,
...columns,
...columns,
...columns,
...columns,
...columns
// ...columns,
// ...columns,
// ...columns,
// ...columns,
// ...columns,
// ...columns,
// ...columns,
// ...columns,
// ...columns
],
tooltip: {
isShowOverflowTextTooltip: true
Expand Down
8 changes: 4 additions & 4 deletions packages/vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable",
"version": "1.8.1",
"version": "1.8.2",
"description": "canvas table width high performance",
"keywords": [
"grid",
Expand Down Expand Up @@ -52,9 +52,9 @@
},
"dependencies": {
"@visactor/vtable-editors": "workspace:*",
"@visactor/vrender-core": "0.20.2-alpha.1",
"@visactor/vrender-kits": "0.20.2-alpha.1",
"@visactor/vrender-components": "0.20.2-alpha.1",
"@visactor/vrender-core": "0.20.8-alpha.3",
"@visactor/vrender-kits": "0.20.8-alpha.3",
"@visactor/vrender-components": "0.20.8-alpha.3",
"@visactor/vutils": "~0.18.14",
"@visactor/vscale": "~0.18.1",
"@visactor/vdataset": "~0.18.1",
Expand Down
56 changes: 56 additions & 0 deletions packages/vtable/src/scenegraph/utils/text-icon-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { isNil, isNumber, isValid, isValidNumber } from '@visactor/vutils';
import { isMergeCellGroup } from './is-merge-cell-group';
import { breakString } from './break-string';
import { CUSTOM_CONTAINER_NAME } from '../component/custom';
import { getTargetCell } from '../../event/util';

/**
* @description: 创建单元格内容
Expand Down Expand Up @@ -284,6 +285,10 @@ export function createCellContent(
text.name = 'text';
textMark = text;
text.bindIconEvent();

if (range && (range.start.col !== range.end.col || range.start.row !== range.end.row)) {
text.onBeforeAttributeUpdate = onBeforeAttributeUpdate as any;
}
}

if (contentLeftIcons.length !== 0 || contentRightIcons.length !== 0) {
Expand Down Expand Up @@ -887,3 +892,54 @@ export function dealWithIconLayout(
absoluteRightIconWidth
};
}

function onBeforeAttributeUpdate(val: Record<string, any>, attribute: any) {
if (val.hasOwnProperty('hoverIconId')) {
// @ts-ignore
const graphic = this as any;
if (graphic.skipMergeUpdate) {
return;
}

const cellGroup = getTargetCell(graphic) as Group;
if (!cellGroup || !cellGroup.stage) {
return;
}
const table = ((cellGroup as any).stage as any).table as BaseTableAPI;
graphic.skipAttributeUpdate = true;
const { mergeStartCol, mergeEndCol, mergeStartRow, mergeEndRow } = cellGroup;
if (
isValid(mergeStartCol) &&
isValid(mergeEndCol) &&
isValid(mergeStartRow) &&
isValid(mergeEndRow) &&
(mergeStartCol !== mergeEndCol || mergeStartRow !== mergeEndRow)
) {
for (let col = mergeStartCol; col <= mergeEndCol; col++) {
for (let row = mergeStartRow; row <= mergeEndRow; row++) {
if (col === cellGroup.col && row === cellGroup.row) {
// update icon state
if (val.hoverIconId !== graphic.attribute.hoverIconId) {
const icon = graphic._frameCache.icons.get(val.hoverIconId);
graphic.updateHoverIconState(icon);
}
continue;
}
// const cell = table.scenegraph.getCell(col, row);
const cell = table.scenegraph.highPerformanceGetCell(col, row);
if (cell.role === 'cell') {
const target = cell.getChildByName(graphic.name, true);
if (!target || target.skipAttributeUpdate) {
continue;
}
if (val.hoverIconId !== target.attribute.hoverIconId) {
target.setAttribute('hoverIconId', val.hoverIconId);
cell.addUpdateBoundTag();
}
}
}
}
graphic.skipAttributeUpdate = undefined;
}
}
}
2 changes: 1 addition & 1 deletion packages/vue-vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vue-vtable",
"version": "1.8.1",
"version": "1.8.2",
"description": "The vue version of VTable",
"keywords": [
"vue",
Expand Down

0 comments on commit 312a638

Please sign in to comment.