[Auto release] release 1.23.1#4985
Merged
Merged
Conversation
允许 triggerEvent 参数接受 'change_cell_values' 字符串值,用于精确控制是否触发 CHANGE_CELL_VALUES 事件
为addRecord、addRecords、deleteRecords和updateRecords方法添加triggerEvent可选参数 当triggerEvent为false时,不触发对应的事件通知
Feat/support cell values change
添加syncRecordOperationsToSourceRecords配置选项,当设置为true时,表格的增删改操作会同步到原始records数组 修改DataSource类实现源数据同步逻辑,包括添加、删除和更新记录时对原始数据的处理 添加相关测试用例验证同步功能 在示例中添加同步选项的UI控制
# Summary - Add IVTableSheetUpdateOptions type for partial spreadsheet updates - Implement WorkSheet.updateSheetOption to map common sheet options to VTable granular APIs - Implement VTableSheet.updateOption as the unified entry for full and incremental updates - Integrate FormulaManager.rebuildFormulas to keep formulas and dependencies consistent after sheet structure changes # Details - Extend ts-types to support partial update options with JSDoc, including theme, default sizes, header visibility, frozen rows/columns, filter config and state, sort state, and row/column size configs - Enhance FormulaManager with rebuildFormulas helper to rebuild internal sheet/formula state from ISheetDefine list after structural updates - Add WorkSheet.updateSheetOption to apply per-sheet incremental changes via existing VTable APIs such as setRowHeight, setColWidth, updateTheme, updateOption, and Filter plugin setFilterState - Add VTableSheet.updateOption as the top-level API to: - Diff sheets for added/removed/updated cases - Reuse existing WorkSheet instances for updated sheets and delegate to updateSheetOption - Keep SheetManager definitions in sync and re-activate the correct sheet - Trigger FormulaManager to rebuild formulas and dependencies after structural changes # References - Aligns with plan.md Stage 2 for spreadsheet update API implementation in @visactor/vtable-sheet - Reuses existing VTable APIs (updateOption, setRowHeight, setColWidth, updateTheme, filter plugin APIs, etc.) for minimal-risk incremental updates Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I16be04ec75981bb10495ad3f8f93c09018533888
# Summary - Add unit tests for the new spreadsheet update APIs in @visactor/vtable-sheet # Details - Cover VTableSheet.updateOption behavior in multi-sheet scenarios, including: - Full replacement of the sheets list with added, removed, and updated sheets - Reuse of existing WorkSheet instances for updated sheets - Correct activation of the target active sheet after full update - Cover WorkSheet.updateSheetOption incremental behavior in single-sheet scenarios, including: - Column width and row height updates via columnWidthConfig/rowHeightConfig - Header visibility (showHeader) and frozen rows/columns configuration - Filter on/off and filterState propagation - SortState updates and basic theme updates # References - Validates the feature implementation from commit "feat(vtable-sheet): add sheet update apis" and ensures API contracts for Stage 2 are guarded by tests Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I0de161197898525080343900ae92eeeebe3dbfe9
## Summary - Fix lint issues reported for `vtable-sheet` update API implementation. - Clean up unused imports and parameters. - Replace non-null assertions, loose equality checks, and self-assignments with safer patterns. ## Details - Removed unused `IStyle` type import from `ts-types/index.ts`. - Updated `FormulaManager` catch blocks to avoid unused error variables, while keeping error handling behavior unchanged. - Removed no-op self-assignment in `WorkSheet._generateTableOptions` and added an explicit guard for `addressFromCoord` to avoid non-null assertion on `row`. - In `VTableSheet`: - Renamed unused callback parameter in `createSheetTabItem`. - Replaced non-null assertions on `workSheetInstances.get(...)` with explicit guards and clearer error messages. - Made the `saveToConfig` sort state mapping use explicit `null/undefined` checks instead of loose equality. - Re-ran `standard-lint` against the modified files to ensure they pass the configured rule set. ## Affected Files - `packages/vtable-sheet/src/ts-types/index.ts` - `packages/vtable-sheet/src/managers/formula-manager.ts` - `packages/vtable-sheet/src/core/WorkSheet.ts` - `packages/vtable-sheet/src/components/vtable-sheet.ts` ## Testing - `standard-lint` (scoped to the modified files) now reports all checks passing: - `packages/vtable-sheet/src/ts-types/index.ts` - `packages/vtable-sheet/src/index.ts` - `packages/vtable-sheet/src/managers/formula-manager.ts` - `packages/vtable-sheet/src/core/WorkSheet.ts` - `packages/vtable-sheet/src/components/vtable-sheet.ts` - `packages/vtable-sheet/__tests__/sheet-update-api.test.ts` > Note: Broader TypeScript checks and Jest test runs are still subject to the repository's Node/Rush version constraints and should be executed in an environment that satisfies `nodeSupportedVersionRange` in `rush.json`. Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I58e98d79364d20a9b1e48bedc2c7ac0e87a1c947
Aime/1769517639 sheet update api
…yout priority
### Summary
- Introduce `componentLayoutOrder` option on `BaseTableConstructorOptions` to control layout priority between `title` and `legend` while preserving existing default behavior.
- Update `BaseTable.resize()` to apply layout (and available drawing area shrinking) in the order defined by `componentLayoutOrder`, so that `title` and legends sharing the same orient (such as `top`) can be stacked deterministically.
### Details
- **Types**
- Extended `BaseTableConstructorOptions` in `packages/vtable/src/ts-types/base-table.ts` with:
- `componentLayoutOrder?: ('legend' | 'title')[]` including JSDoc explaining default behavior and compatibility.
- **Runtime behavior**
- Updated `BaseTable.resize()` in `packages/vtable/src/core/BaseTable.ts`:
- After `_updateSize()`, iterate over `this.options.componentLayoutOrder ?? ['legend', 'title']`.
- For `legend`, call `resize()` on each legend in `this.internalProps.legends`.
- For `title`, call `resize()` on `this.internalProps.title` when present.
- Keep `emptyTip` resize and `scenegraph.resize()` behavior unchanged.
- Added comments in `ListTable`, `PivotChart`, and `PivotTable` constructors to clarify that the first layout after initialization also goes through `BaseTable.resize()` and therefore respects `componentLayoutOrder`.
- **Examples & docs**
- Added a new example `packages/vtable/examples/components/legend-title-order.ts` using `ListTable` that demonstrates `componentLayoutOrder: ['title', 'legend']` with both title and legends at `orient: 'top'` so legend is laid out below the title.
- Updated `packages/vtable/README.md` to add a "Component Layout Priority" section after the Usage chapter, documenting `componentLayoutOrder`, its default value, and a small code snippet in English showing how to place the title above legends.
### Testing & Quality
- **standard-lint**
- Command (Node 18.20.0):
- `standard-lint` run against the modified TS files in `packages/vtable`.
- Result:
- Failed due to multiple pre-existing lint issues (e.g. `byted_s_ts_no_unused_vars` and `byted_s_js_guard_for_in`) in `BaseTable.ts` and `ts-types/base-table.ts`, unrelated to this change and impacting large legacy sections.
- I did not modify unrelated legacy logic to avoid introducing risky changes.
- **tsc-files**
- Command (Node 18.20.0):
- `npx @byted/tsc-files-mono` on the same TS files.
- Result:
- Failed with `TS6053: File '@internal/ts-config/tsconfig.base.json' not found.`
- Root cause: the repo's TypeScript configuration depends on internal package `@internal/ts-config` which is not available in the current environment (monorepo dependencies are not fully installed), so `tsc-files` cannot resolve the shared base tsconfig.
Given these constraints, the new feature is implemented and wired into examples and docs, while lint/tsc failures are due to existing repository configuration and historical issues rather than the new code.
Co-Authored-By: Aime <aime@bytedance.com>
Change-Id: If2b110b4443dc1fba58acfa9bc2f0e97759a4b7c
…out-order feat(vtable): support componentLayoutOrder to control title/legend la…
fix(csv): handle escape option correctly for CSV export
Feat/support cell values change
fix: set white background for media overlay image
Feat/component layout order
…r-onChart fix: when double click on vchart occor error after rightdown
Feat/sheet update api
Feat/batch cell values&filter api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🆕 feat
🐛 fix
🔨 refactor