@ai-table/grid 0.1.44 → 0.1.45
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/fesm2022/ai-table-grid.mjs +48 -33
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/package.json +1 -1
- package/renderer/components/field-stat/stats.component.d.ts +3 -2
- package/renderer/components/field-stat/stats.component.d.ts.map +1 -1
- package/renderer/components/group/groups.component.d.ts +1 -0
- package/renderer/components/group/groups.component.d.ts.map +1 -1
- package/renderer/drawers/add-row-layout-drawer.d.ts.map +1 -1
- package/renderer/drawers/cell-drawer.d.ts.map +1 -1
- package/renderer/renderer.component.d.ts.map +1 -1
@@ -5674,7 +5674,7 @@ class AddRowLayout extends Layout {
|
|
5674
5674
|
if (this.isFirst || this.isLast)
|
5675
5675
|
return;
|
5676
5676
|
this.renderCell({
|
5677
|
-
width: this.columnWidth,
|
5677
|
+
width: this.columnWidth + AI_TABLE_CELL_LINE_BORDER,
|
5678
5678
|
isHoverRow
|
5679
5679
|
});
|
5680
5680
|
}
|
@@ -6642,7 +6642,7 @@ class CellDrawer extends Drawer {
|
|
6642
6642
|
});
|
6643
6643
|
}
|
6644
6644
|
renderCellProgress(render, ctx) {
|
6645
|
-
const { x, y, transformValue, columnWidth, style } = render;
|
6645
|
+
const { x, y, transformValue, columnWidth, style, isGroupFirstRender } = render;
|
6646
6646
|
const colors = AITable.getColors();
|
6647
6647
|
let validateTransformValue = transformValue;
|
6648
6648
|
if (isUndefinedOrNull(validateTransformValue)) {
|
@@ -6654,31 +6654,41 @@ class CellDrawer extends Drawer {
|
|
6654
6654
|
const offsetX = AI_TABLE_CELL_PADDING;
|
6655
6655
|
const offsetY = (AI_TABLE_ROW_BLANK_HEIGHT - AI_TABLE_PROGRESS_BAR_HEIGHT) / 2;
|
6656
6656
|
const textOffsetY = (AI_TABLE_ROW_BLANK_HEIGHT - textHeight) / 2;
|
6657
|
-
|
6658
|
-
|
6659
|
-
|
6660
|
-
|
6661
|
-
|
6662
|
-
|
6663
|
-
|
6664
|
-
|
6665
|
-
|
6666
|
-
|
6667
|
-
|
6668
|
-
|
6669
|
-
|
6670
|
-
|
6671
|
-
|
6672
|
-
|
6673
|
-
|
6674
|
-
|
6675
|
-
|
6676
|
-
|
6677
|
-
|
6678
|
-
|
6679
|
-
|
6680
|
-
|
6681
|
-
|
6657
|
+
if (isGroupFirstRender) {
|
6658
|
+
this.text({
|
6659
|
+
x: x + offsetX,
|
6660
|
+
y: y + textOffsetY,
|
6661
|
+
text: `${validateTransformValue}%`,
|
6662
|
+
fillStyle: colors.gray800
|
6663
|
+
});
|
6664
|
+
}
|
6665
|
+
else {
|
6666
|
+
// 绘制背景
|
6667
|
+
this.rect({
|
6668
|
+
x: x + offsetX,
|
6669
|
+
y: y + offsetY,
|
6670
|
+
width,
|
6671
|
+
height,
|
6672
|
+
radius: AI_TABLE_PROGRESS_BAR_RADIUS,
|
6673
|
+
fill: colors.gray200
|
6674
|
+
});
|
6675
|
+
// 计算并绘制进度
|
6676
|
+
const progressWidth = (validateTransformValue / 100) * width;
|
6677
|
+
this.rect({
|
6678
|
+
x: x + offsetX,
|
6679
|
+
y: y + offsetY,
|
6680
|
+
width: progressWidth,
|
6681
|
+
height,
|
6682
|
+
radius: AI_TABLE_PROGRESS_BAR_RADIUS,
|
6683
|
+
fill: colors.success
|
6684
|
+
});
|
6685
|
+
this.text({
|
6686
|
+
x: x + offsetX + width + AI_TABLE_TEXT_GAP,
|
6687
|
+
y: y + textOffsetY,
|
6688
|
+
text: `${validateTransformValue}%`,
|
6689
|
+
fillStyle: colors.gray800
|
6690
|
+
});
|
6691
|
+
}
|
6682
6692
|
}
|
6683
6693
|
renderCellMember(render, ctx) {
|
6684
6694
|
const { references, x, y, field, transformValue, rowHeight, columnWidth, isActive } = render;
|
@@ -7008,7 +7018,7 @@ class GroupLayout extends Layout {
|
|
7008
7018
|
});
|
7009
7019
|
}
|
7010
7020
|
const iconContainerWidth = AI_TABLE_ICON_COMMON_SIZE + AI_TABLE_FIELD_HEAD_ICON_GAP_SIZE;
|
7011
|
-
if (!isEmpty(groupValue) ||
|
7021
|
+
if (!isEmpty(groupValue) || [AITableFieldType.checkbox, AITableFieldType.progress].includes(field.type)) {
|
7012
7022
|
cellDrawer.initStyle(field, style);
|
7013
7023
|
cellDrawer.renderCell({
|
7014
7024
|
...render,
|
@@ -9528,6 +9538,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9528
9538
|
class AITableGroups {
|
9529
9539
|
constructor() {
|
9530
9540
|
this.config = input.required();
|
9541
|
+
this.trackBy = (groupStat) => {
|
9542
|
+
return groupStat.groupRow._id + groupStat.columnIndex;
|
9543
|
+
};
|
9531
9544
|
this.frozenColumnCount = computed(() => {
|
9532
9545
|
const { coordinate } = this.config();
|
9533
9546
|
return coordinate.frozenColumnCount ?? 0;
|
@@ -9563,7 +9576,7 @@ class AITableGroups {
|
|
9563
9576
|
}
|
9564
9577
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableGroups, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9565
9578
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableGroups, isStandalone: true, selector: "ai-table-groups", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
9566
|
-
@for (groupCell of groupCells(); track
|
9579
|
+
@for (groupCell of groupCells(); track trackBy(groupCell.groupStat!)) {
|
9567
9580
|
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9568
9581
|
}
|
9569
9582
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AITableFieldStat, selector: "ai-table-field-stat", inputs: ["config"], outputs: ["hover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
@@ -9573,7 +9586,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9573
9586
|
args: [{
|
9574
9587
|
selector: 'ai-table-groups',
|
9575
9588
|
template: `
|
9576
|
-
@for (groupCell of groupCells(); track
|
9589
|
+
@for (groupCell of groupCells(); track trackBy(groupCell.groupStat!)) {
|
9577
9590
|
<ai-table-field-stat [config]="groupCell.groupStat!"></ai-table-field-stat>
|
9578
9591
|
}
|
9579
9592
|
`,
|
@@ -9850,6 +9863,9 @@ class AITableFieldStats {
|
|
9850
9863
|
this.config = input.required();
|
9851
9864
|
this.hover = output();
|
9852
9865
|
this.isHover = signal(false);
|
9866
|
+
this.trackBy = (groupStat) => {
|
9867
|
+
return groupStat.columnIndex;
|
9868
|
+
};
|
9853
9869
|
this.statConfigs = computed(() => createFieldStats(this.config()));
|
9854
9870
|
}
|
9855
9871
|
onMouseenter(e) {
|
@@ -9861,7 +9877,7 @@ class AITableFieldStats {
|
|
9861
9877
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AITableFieldStats, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
9862
9878
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AITableFieldStats, isStandalone: true, selector: "ai-table-column-stats", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { hover: "hover" }, ngImport: i0, template: `
|
9863
9879
|
<ko-group>
|
9864
|
-
@for (config of statConfigs(); track
|
9880
|
+
@for (config of statConfigs(); track trackBy(config)) {
|
9865
9881
|
<ai-table-field-stat [config]="config" (hover)="hover.emit($event)"></ai-table-field-stat>
|
9866
9882
|
}
|
9867
9883
|
</ko-group>
|
@@ -9873,7 +9889,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
9873
9889
|
selector: 'ai-table-column-stats',
|
9874
9890
|
template: `
|
9875
9891
|
<ko-group>
|
9876
|
-
@for (config of statConfigs(); track
|
9892
|
+
@for (config of statConfigs(); track trackBy(config)) {
|
9877
9893
|
<ai-table-field-stat [config]="config" (hover)="hover.emit($event)"></ai-table-field-stat>
|
9878
9894
|
}
|
9879
9895
|
</ko-group>
|
@@ -9970,7 +9986,6 @@ class AITableRenderer {
|
|
9970
9986
|
return {
|
9971
9987
|
clipX: 0,
|
9972
9988
|
clipY: AI_TABLE_FIELD_HEAD_HEIGHT,
|
9973
|
-
clipWidth: this.frozenAreaWidth() + AI_TABLE_SHADOW_DEFAULT_WIDTH,
|
9974
9989
|
clipHeight: this.gridContainerHeight()
|
9975
9990
|
};
|
9976
9991
|
});
|