Skip to content

Commit

Permalink
Merge pull request #1389 from VisActor/develop
Browse files Browse the repository at this point in the history
release 0.22.2
  • Loading branch information
fangsmile authored Mar 27, 2024
2 parents 6a35e3d + 64168f9 commit 8a8fc4d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
- name: Build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: node common/scripts/install-run-rush.js build --only tag:package
run: node common/scripts/install-run-rush.js build -t @visactor/vtable
- name: Test
run: node common/scripts/install-run-rush.js test --only tag:package
run: node common/scripts/install-run-rush.js test -t @visactor/vtable
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { getProp } from '../../utils/get-prop';
import { getQuadProps } from '../../utils/padding';
import type { BaseTableAPI } from '../../../ts-types/base-table';
import { isNumber } from '@visactor/vutils';
import type { StylePropertyFunctionArg } from '../../../ts-types';

export function createProgressBarCell(
progressBarDefine: {
min?: number;
max?: number;
min?: number | ((args: StylePropertyFunctionArg) => number);
max?: number | ((args: StylePropertyFunctionArg) => number);
barType?: 'default' | 'negative' | 'negative_no_axis'; // 进度图类型
dependField?: string; // 指定其他列数据(风神使用),
},
Expand All @@ -34,18 +35,18 @@ export function createProgressBarCell(
col,
row,
table,
context: null,
value,
dataValue
dataValue,
cellHeaderPaths: undefined
}) ?? 0;
progressBarDefine.max =
getOrApply(progressBarDefine.max, {
col,
row,
table,
context: null,
value,
dataValue
dataValue,
cellHeaderPaths: undefined
}) ?? progressBarDefine.min + 100;
const height = table.getRowHeight(row);
let contentWidth = width;
Expand Down
8 changes: 4 additions & 4 deletions packages/vtable/src/themes/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ import { defalutPoptipStyle, getAxisStyle } from './component';

function getProp(obj: PartialTableThemeDefine, superObj: ITableThemeDefine, names: string[], defNames?: string[]): any {
return (
getChainSafe(obj, ...names) ||
getChainSafe(superObj, ...names) ||
(defNames && getChainSafe(obj, ...defNames)) ||
getChainSafe(obj, ...names) ??
getChainSafe(superObj, ...names) ??
(defNames && getChainSafe(obj, ...defNames)) ??
(defNames && getChainSafe(superObj, ...defNames))
);
}
Expand Down Expand Up @@ -105,7 +105,7 @@ export class TableTheme implements ITableThemeDefine {

get cellInnerBorder(): boolean {
const { obj, superTheme } = this.internalTheme;
return !!getProp(obj, superTheme, ['cellInnerBorder']) ?? true;
return getProp(obj, superTheme, ['cellInnerBorder']) ?? true;
}

get cellBorderClipDirection(): 'top-left' | 'bottom-right' {
Expand Down

0 comments on commit 8a8fc4d

Please sign in to comment.