Skip to content
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
14 changes: 14 additions & 0 deletions .fallowrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"entry": ["src/index.ts", "src/main.ts"],
"ignorePatterns": ["**/package.json", "**/__tests__/**", "**/demos/**", "**/*.{cy,spec}.ts"],
"workspaces": {
"packages": ["frameworks/**", "frameworks-plugins/**", "packages/**", "!**/dist/**"]
},
"duplicates": {
"minOccurrences": 3
},
"rules": {
"unused-dependencies": "warn"
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ jest-coverage
test/cypress/screenshots/*.png

# Environment variables
.env
.env
.fallow/
1 change: 0 additions & 1 deletion frameworks/slickgrid-react/src/contexts/i18nextContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ import type { I18Next } from '../models/i18next.interface.js';

export const I18nextContext = React.createContext<I18Next | null>(null);
export const I18nextProvider = I18nextContext.Provider;
export const useI18next = () => React.useContext(I18nextContext);
4 changes: 0 additions & 4 deletions frameworks/slickgrid-react/src/services/singletons.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { SharedService } from '@slickgrid-universal/common';
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
import { ContainerService } from './container.service.js';

export const GlobalEventPubSubService = new EventPubSubService();
export const GlobalEventSharedService = new SharedService();
export const GlobalContainerService = new ContainerService();
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"roll-new-release": "pnpm build && pnpm new-version && pnpm new-publish",
"build:dev": "pnpm -r --filter=vanilla-demo build:dev",
"serve:vite": "pnpm -r --filter=vanilla-demo dev",
"fallow": "fallow",
"fallow:dead-code": "fallow dead-code --production",
"fallow:dupes": "fallow dupes",
"fallow:health": "fallow health",
"fallow:fix:preview": "fallow fix --dry-run --production",
"fallow:fix": "fallow fix --production",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"prettier:check": "prettier --check **/*.{html,js,ts,tsx,vue}",
Expand Down Expand Up @@ -129,6 +135,7 @@
"cypress-real-events": "catalog:",
"eslint-plugin-cypress": "^6.4.1",
"eslint-plugin-local-import-ext": "0.2.0",
"fallow": "^2.76.0",
"globals": "catalog:",
"jsdom": "catalog:",
"jsdom-global": "catalog:",
Expand Down
22 changes: 4 additions & 18 deletions packages/common/src/aggregators/avgAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import { isNumber } from '@slickgrid-universal/utils';
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class AvgAggregator implements Aggregator {
private _isInitialized = false;
private _isTreeAggregator = false;
export class AvgAggregator extends BaseAggregatorClass implements Aggregator {
private _nonNullCount = 0;
private _sum = 0;
private _field: number | string;
private _type = 'avg';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'avg' as const;
}

init(item?: any, isTreeAggregator = false): void {
Expand Down
22 changes: 22 additions & 0 deletions packages/common/src/aggregators/baseAggregatorClass.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export class BaseAggregatorClass {
protected _isInitialized = false;
protected _isTreeAggregator = false;
protected _field: number | string;
protected _type = '';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
}
}
21 changes: 4 additions & 17 deletions packages/common/src/aggregators/cloneAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class CloneAggregator implements Aggregator {
private _isInitialized = false;
private _field: number | string;
export class CloneAggregator extends BaseAggregatorClass implements Aggregator {
private _data = '';
private _type = 'clone' as const;

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'clone' as const;
}

init(_item?: any, isTreeAggregator = false): void {
Expand Down
22 changes: 4 additions & 18 deletions packages/common/src/aggregators/countAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { isNumber } from '@slickgrid-universal/utils';
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class CountAggregator implements Aggregator {
private _isInitialized = false;
private _isTreeAggregator = false;
private _field: number | string;
export class CountAggregator extends BaseAggregatorClass implements Aggregator {
private _count = 0;
private _type = 'count';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'count' as const;
}

init(item?: any, isTreeAggregator = false): void {
Expand Down
21 changes: 4 additions & 17 deletions packages/common/src/aggregators/distinctAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class DistinctAggregator implements Aggregator {
private _isInitialized = false;
private _field: number | string;
export class DistinctAggregator extends BaseAggregatorClass implements Aggregator {
private _distinctValues: any[] = [];
private _type = 'distinct' as const;

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'distinct' as const;
}

init(_item?: any, isTreeAggregator = false): void {
Expand Down
22 changes: 4 additions & 18 deletions packages/common/src/aggregators/maxAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { isNumber } from '@slickgrid-universal/utils';
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class MaxAggregator implements Aggregator {
private _isInitialized = false;
private _isTreeAggregator = false;
export class MaxAggregator extends BaseAggregatorClass implements Aggregator {
private _max: number | null = null;
private _field: number | string;
private _type = 'max';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'max' as const;
}

init(item?: any, isTreeAggregator = false): void {
Expand Down
22 changes: 4 additions & 18 deletions packages/common/src/aggregators/minAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { isNumber } from '@slickgrid-universal/utils';
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class MinAggregator implements Aggregator {
private _isInitialized = false;
private _isTreeAggregator = false;
export class MinAggregator extends BaseAggregatorClass implements Aggregator {
private _min: number | null = null;
private _field: number | string;
private _type = 'min';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'min' as const;
}

init(item?: any, isTreeAggregator = false): void {
Expand Down
22 changes: 4 additions & 18 deletions packages/common/src/aggregators/sumAggregator.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import { isNumber } from '@slickgrid-universal/utils';
import type { Aggregator } from './../interfaces/aggregator.interface.js';
import type { GroupTotals } from './../interfaces/grouping.interface.js';
import { BaseAggregatorClass } from './baseAggregatorClass.js';

export class SumAggregator implements Aggregator {
private _isInitialized = false;
private _isTreeAggregator = false;
export class SumAggregator extends BaseAggregatorClass implements Aggregator {
private _sum = 0;
private _itemCount = 0;
private _field: number | string;
private _type = 'sum';

constructor(field: number | string) {
this._field = field;
}

get field(): number | string {
return this._field;
}

get isInitialized(): boolean {
return this._isInitialized;
}

get type(): string {
return this._type;
super(field);
this._type = 'sum' as const;
}

init(item?: any, isTreeAggregator = false): void {
Expand Down
Loading
Loading