Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] latest from ag-grid:latest #265

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type {
AgDonutSeriesOptions,
AgFillType,
AgGradientFill,
AgPieSeriesOptions,
AgPolarChartOptions,
AgPolarSeriesOptions,
Expand Down Expand Up @@ -138,11 +140,26 @@ export class PieChartProxy extends ChartProxy<AgPolarChartOptions, 'pie' | 'donu
return this.chartType === 'pie' ? params.fields.slice(0, 1) : params.fields;
}

private changeOpacity(fills: string[], alpha: number) {
private changeOpacity<T extends AgFillType>(fills: T[], alpha: number): T[] {
const Color = this.agChartsExports._Util.Color;
return fills.map((fill) => {
const c = Color.fromString(fill);
return new Color(c.r, c.g, c.b, alpha).toHexString();
if (typeof fill === 'string') {
const c = Color.fromString(fill);
return new Color(c.r, c.g, c.b, alpha).toHexString() as T;
}

return {
...(fill as AgGradientFill),
colorStops: fill.colorStops?.map((stop) => {
if (stop.color == null) return stop;

const c = Color.fromString(stop.color);
return {
...stop,
color: new Color(c.r, c.g, c.b, alpha).toHexString(),
};
}),
} as T;
});
}
}
1 change: 1 addition & 0 deletions packages/ag-grid-enterprise/src/find/findService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ export class FindService extends BeanStub implements NamedBean, IFindService {
rowNodes: [...rowNodes],
columns: columns ? [...columns] : undefined,
force: true,
suppressFlash: true,
});
}

Expand Down
10 changes: 5 additions & 5 deletions testing/module-size/moduleDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AllGridCommunityModules: Record<`${CommunityModuleName}Module`, num
UndoRedoEditModule: 23.5,
ValidationModule: 74.31,
ValueCacheModule: 0.65,
CellSpanModule: 6.99,
CellSpanModule: 8.08,
};
export const AllEnterpriseModules: Record<`${EnterpriseModuleName}Module`, number> = {
AdvancedFilterModule: 200,
Expand All @@ -59,18 +59,18 @@ export const AllEnterpriseModules: Record<`${EnterpriseModuleName}Module`, numbe
ContextMenuModule: 70,
ExcelExportModule: 84,
FiltersToolPanelModule: 116,
FindModule: 9.3,
FindModule: 11.61,
GridChartsModule: 67,
IntegratedChartsModule: 385.33,
GroupFilterModule: 93,
MasterDetailModule: 82,
MenuModule: 153,
MultiFilterModule: 121,
PivotModule: 91,
PivotModule: 87.97,
RangeSelectionModule: 53,
RichSelectModule: 77,
RowNumbersModule: 26,
RowGroupingModule: 78,
RowGroupingModule: 74.88,
RowGroupingPanelModule: 71,
ServerSideRowModelApiModule: 19,
ServerSideRowModelModule: 147,
Expand Down Expand Up @@ -120,7 +120,7 @@ const chartModules: ModuleTest[] = [
},
{
modules: ['AgChartsEnterpriseModule' as any, 'IntegratedChartsModule'],
expectedSize: 1840,
expectedSize: 1917.52,
},
{
modules: ['AgChartsCommunityModule' as any, 'SparklinesModule'],
Expand Down
39 changes: 23 additions & 16 deletions testing/module-size/moduleValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,33 @@ function validateSizes() {
(result) => result.selfSize < result.expectedSize - bufferSize(result.expectedSize)
);

if (failuresTooBig.length > 0) {
console.error(
'Validation failed for the following modules which are too large compared to their expected size:'
);
failuresTooBig.forEach((failure) => {
const tooBig = failuresTooBig.length > 0;
const tooSmall = failuresTooSmall.length > 0;

if (tooBig || tooSmall) {
if (tooBig) {
console.error(
`Module: [${failure.modules.join()}], selfSize: ${failure.selfSize}, expectedSize: ${failure.expectedSize} + (${bufferSize(failure.expectedSize)})`
'Validation failed for the following modules which are too large compared to their expected size:'
);
failuresTooBig.forEach((failure) => {
console.error(
`Module: [${failure.modules.join()}], selfSize: ${failure.selfSize}, expectedSize: ${failure.expectedSize} + (${bufferSize(failure.expectedSize)})`
);
});
}
if (tooSmall) {
console.error(
'Validation failed for the following modules which are too small compared to their expected size:'
);
});
process.exit(1); // Return a non-zero exit code
} else if (failuresTooSmall.length > 0) {
console.error(
'Validation failed for the following modules which are too much smaller than their expected size:'
);
console.error('Is the expected size too high in moduleDefinitions? Or has the module dependencies changed?');
failuresTooSmall.forEach((failure) => {
console.error(
`Module: [${failure.modules.join()}], selfSize: ${failure.selfSize}, expectedSize: ${failure.expectedSize} + (${bufferSize(failure.expectedSize)})`
'Is the expected size too high in moduleDefinitions? Or have the module dependencies changed?'
);
});
failuresTooSmall.forEach((failure) => {
console.error(
`Module: [${failure.modules.join()}], selfSize: ${failure.selfSize}, expectedSize: ${failure.expectedSize} + (${bufferSize(failure.expectedSize)})`
);
});
}
process.exit(1); // Return a non-zero exit code
} else {
console.log(`All modules (${results.length}) passed size validation.`);
Expand Down