Skip to content
Open
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
1 change: 0 additions & 1 deletion libs/angular/cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"peerDependencies": {
"@angular/core": "^21.0.9",
"rxjs": "~7.8.0",
"lodash": "^4.17.21",
"vanilla-cookieconsent": "^3.1.0",
"@ibenvandeveire/ngx-core": "^21.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
input,
InputSignal,
} from '@angular/core';
import { flatten } from 'lodash';
import { Subject, tap, takeUntil, combineLatest, map } from 'rxjs';

import { NgxCookiesFallBackComponent } from '../../abstracts';
Expand Down Expand Up @@ -119,7 +118,7 @@ export class NgxHasCookieDirective implements OnDestroy {
)
.pipe(
map((hasCookies) => {
return flatten(hasCookies).every((hasCookie) => hasCookie);
return hasCookies.flat().every((hasCookie) => hasCookie);
}),
tap((hasCookie) => {
// Iben: Clear the current view
Expand Down
2 changes: 1 addition & 1 deletion libs/angular/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@angular/core": "^21.0.9",
"@angular/forms": "^21.0.9",
"rxjs": "~7.8.0",
"lodash": "^4.17.21",
"remeda": "^2.39.0",
"@angular/router": "^21.0.9",
"obj-clean": "^3.0.1",
"date-fns": "^4.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, input, InputSignal, OnDestroy, OnInit } from '@angular/core';
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
import { AbstractControl, FormControl } from '@angular/forms';
import { isEqual } from 'lodash';
import { isDeepEqual } from 'remeda';
import { Observable, of, Subject } from 'rxjs';
import { switchMap, takeUntil, tap } from 'rxjs/operators';

Expand All @@ -12,7 +12,7 @@ export abstract class DataFormAccessor<
ConstructionDataType = unknown,
DataType = unknown,
FormAccessorFormType extends AbstractControl = FormControl,
FormValueType = DataType,
FormValueType = DataType
>
extends NgxFormsControlValueAccessor<DataType, FormAccessorFormType, FormValueType>
implements OnDestroy, OnInit
Expand Down Expand Up @@ -50,7 +50,7 @@ export abstract class DataFormAccessor<
const currentFormValue = this.form?.getRawValue();

// Iben: If we already have current data and the current data matches the new data, we don't make a new form
if (this.currentData && isEqual(this.currentData, data)) {
if (this.currentData && isDeepEqual(this.currentData, data)) {
this.currentData = data;
return of();
}
Expand Down
2 changes: 1 addition & 1 deletion libs/angular/inform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@angular/router": "^21.0.9",
"@ibenvandeveire/ngx-core": "^21.0.0",
"@angular/common": "^21.0.9",
"lodash": "^4.17.21"
"remeda": "^2.39.0"
},
"sideEffects": false
}
4 changes: 2 additions & 2 deletions libs/angular/inform/src/lib/services/toast/toast.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed, inject, Injectable, Signal, Type } from '@angular/core';
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
import { uniqBy } from 'lodash';
import { uniqueBy } from 'remeda';
import {
BehaviorSubject,
combineLatest,
Expand Down Expand Up @@ -65,7 +65,7 @@ export class NgxToastService {
combineLatest([this.queue$, this.showBundledToasts$]).pipe(
map(([toasts, showBundled]) => {
// Iben: Prevent duplicates
const result = uniqBy(toasts, (item) => item.id) || [];
const result = uniqueBy(toasts, (item) => item.id) || [];

// Iben: If there is no max amount, we return the toasts as is
if (!this.configuration.maxAmount || showBundled) {
Expand Down
2 changes: 1 addition & 1 deletion libs/angular/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"uuid": "^11.1.0",
"@angular/cdk": "^21.0.6",
"@angular/forms": "^21.0.9",
"lodash": "^4.17.21",
"remeda": "^2.39.0",
"markerjs2": "^2.32.4",
"markerjs-live": "^1.2.1",
"@ibenvandeveire/ngx-core": "^21.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
NG_VALUE_ACCESSOR,
ReactiveFormsModule,
} from '@angular/forms';
import { isEmpty } from 'lodash';
import { isEmptyish } from 'remeda';
import { Subject } from 'rxjs';
import { takeUntil, tap } from 'rxjs/operators';

Expand Down Expand Up @@ -726,7 +726,7 @@ export class NgxTableComponent
private handleCurrentSort(event: NgxTableSortEvent): void {
// Iben: Early exit if the sortable cell record is empty or if the cell already has the sortDirection of the event
if (
isEmpty(
isEmptyish(
this.sortableTableCellRecord() ||
(event &&
this.sortableTableCellRecord()[event.column].sortDirection ===
Expand Down
8 changes: 6 additions & 2 deletions libs/angular/layout/src/lib/pipes/get-pipe/get.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Pipe, PipeTransform } from '@angular/core';
import { get } from 'lodash';

/**
* This pipe returns a value based on a provided path
Expand Down Expand Up @@ -33,6 +32,11 @@ export class NgxTableGetPipe implements PipeTransform {
}

// Iben: Return the property
return get(value, path);
return path
.split('.')
.reduce<unknown>(
(acc, key) => (acc == null ? undefined : (acc as Record<string, unknown>)[key]),
value
);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { inject, Injectable, signal, Signal, WritableSignal } from '@angular/core';
import { get } from 'lodash';
import clean from 'obj-clean';
import {
BehaviorSubject,
Expand Down Expand Up @@ -67,16 +66,15 @@ export class NgxMobileLayoutService {
*/
protected readonly showFlyout: WritableSignal<boolean> = signal(false);

/**
* Whether the currently opened flyout should be preserved when the route changes
*/
protected readonly preserveFlyout: WritableSignal<boolean> = signal( false );
/**
* Whether the currently opened flyout should be preserved when the route changes
*/
protected readonly preserveFlyout: WritableSignal<boolean> = signal(false);

/**
* Whether the aside should be shown
*/
protected readonly showAside: WritableSignal<boolean> = signal( false );

protected readonly showAside: WritableSignal<boolean> = signal(false);

/**
* An array of queries
Expand Down Expand Up @@ -138,15 +136,15 @@ export class NgxMobileLayoutService {
return this.initialLayoutSet$.pipe(
filter(Boolean),
take(1),
tap( () => {
// Iben: Preserve the flyout if it was required
const result = this.preserveFlyout()
? { ...layout, flyout: this.layoutSubject$.value.flyout }
: layout;
tap(() => {
// Iben: Preserve the flyout if it was required
const result = this.preserveFlyout()
? { ...layout, flyout: this.layoutSubject$.value.flyout }
: layout;

// Iben: Update the layout
this.layoutSubject$.next(extractLayout(result, this.defaultLayout, this.queries));
})
// Iben: Update the layout
this.layoutSubject$.next(extractLayout(result, this.defaultLayout, this.queries));
})
);
}

Expand All @@ -157,7 +155,11 @@ export class NgxMobileLayoutService {
* @param params - An optional set of parameters for the flyout
*
*/
public openFlyout(flyout?: ComponentType, params?: NgxMobileLayoutOutletParams, preserveFlyout: boolean = false): void {
public openFlyout(
flyout?: ComponentType,
params?: NgxMobileLayoutOutletParams,
preserveFlyout: boolean = false
): void {
// Iben: Add the flyout if there wasn't one defined
if (flyout) {
this.layoutSubject$.next({
Expand All @@ -171,8 +173,8 @@ export class NgxMobileLayoutService {
});

// Iben: Make the flyout visible and add the injector
this.showFlyout.set( true );
this.preserveFlyout.set(preserveFlyout)
this.showFlyout.set(true);
this.preserveFlyout.set(preserveFlyout);
this.flyoutParams.set(params);
}
}
Expand All @@ -182,8 +184,8 @@ export class NgxMobileLayoutService {
*/
public closeFlyout(): void {
// Iben: Make the flyout invisible
this.preserveFlyout.set( false );
this.showFlyout.set( false );
this.preserveFlyout.set(false);
this.showFlyout.set(false);
this.flyoutParams.set(undefined);
}

Expand Down Expand Up @@ -223,17 +225,18 @@ export class NgxMobileLayoutService {
/**
* Provides an initial layout if one was provided
*/
public setUpInitialLayout ( markAsInitial: boolean = true ): void {

public setUpInitialLayout(markAsInitial: boolean = true): void {
// Iben: Set up the initial queries and set it as 'default' if
this.queries = this.mediaService.queries.length
? this.mediaService.queries.map((query) => query.toLowerCase())
: ['default'];

// Iben: Preserve the flyout if it was required
const layout = this.preserveFlyout() ? { ...this.defaultLayout,flyout: this.layoutSubject$.value.flyout } : this.defaultLayout;
// Iben: Preserve the flyout if it was required
const layout = this.preserveFlyout()
? { ...this.defaultLayout, flyout: this.layoutSubject$.value.flyout }
: this.defaultLayout;

// Iben: Set initial layout
// Iben: Set initial layout
this.layoutSubject$.next(extractLayout(layout, {}, this.queries));

// Iben: Mark the initial layout set as true
Expand All @@ -251,7 +254,17 @@ export class NgxMobileLayoutService {
return this.layout$.pipe(
filter(Boolean),
distinctUntilChanged(),
map((layout) => Boolean(get(layout, element)))
map((layout) =>
Boolean(
element
.split('.')
.reduce<unknown>(
(acc, key) =>
acc == null ? undefined : (acc as Record<string, unknown>)[key],
layout
)
)
)
);
}
}
6 changes: 1 addition & 5 deletions libs/angular/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
"@angular/common": "^21.0.9",
"@angular/core": "^21.0.9",
"rxjs": "~7.8.0",
"lodash": "^4.17.21",
"@ngrx/effects": "^21.0.1",
"@ngrx/entity": "^21.0.1",
"@ngrx/signals": "^21.0.1",
"@ngrx/store": "^21.0.1"
},
"sideEffects": false,
"devDependencies": {
"@types/lodash": "^4.14.195"
}
"sideEffects": false
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HttpErrorResponse } from '@angular/common/http';
import { createAction, createReducer, createSelector, on, props } from '@ngrx/store';
import { get } from 'lodash';

import { BaseStore, BaseStoreAssets, BaseStoreAssetsGeneratorOptions } from '../../interfaces';
import { BaseStoreEffectsInterface } from '../../interfaces/effects';
Expand All @@ -9,10 +8,11 @@ import { BaseStoreEffectsInterface } from '../../interfaces/effects';
* Creates store assets to save basic properties (object, string, number, etc.) into the store
*
* @param slice - The slice we wish to save the data in
* @param initialStateValue - The actual value of the initial state
*/
export const createBaseStoreAssets = <
StateInterface,
EffectsInterface extends BaseStoreEffectsInterface = any,
EffectsInterface extends BaseStoreEffectsInterface = any
>({
slice,
initialStateValue,
Expand Down Expand Up @@ -72,7 +72,8 @@ export const createBaseStoreAssets = <
);

// Iben: Create selectors
const featureSelector = (state) => get(state, slice);
const featureSelector = (state) =>
slice.split('.').reduce((acc, key) => (acc == null ? undefined : acc[key]), state);

const selectors = {
select: createSelector(featureSelector, (state: BaseStore<StateInterface>) => state.data),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EntityAdapter, createEntityAdapter } from '@ngrx/entity';
import { createAction, createReducer, createSelector, on, props } from '@ngrx/store';
import { get } from 'lodash';

import {
BasicEntityState,
Expand Down Expand Up @@ -82,7 +81,8 @@ export const createEntityAdapterStoreAssets = <
};

// Iben: Create state selectors
const featureSelector = (state): any => get(state, slice);
const featureSelector = (state): any =>
slice.split('.').reduce((acc, key) => (acc == null ? undefined : acc[key]), state);

const selectors = {
selectAll: createSelector(featureSelector, adapter.getSelectors().selectAll),
Expand Down
3 changes: 1 addition & 2 deletions libs/angular/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"@angular/router": "^21.0.9",
"rxjs": "~7.8.0",
"@angular/platform-browser": "^21.0.9",
"@ibenvandeveire/ngx-core": "^21.0.0",
"lodash": "^4.17.21"
"@ibenvandeveire/ngx-core": "^21.0.0"
},
"sideEffects": false
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
computed,
Directive,
input,
InputSignal,
Signal,
} from '@angular/core';
import { get } from 'lodash';
import { computed, Directive, input, InputSignal, Signal } from '@angular/core';

@Directive({
selector: '[cypressTag]',
Expand All @@ -16,7 +9,12 @@ import { get } from 'lodash';
})
export class NgxCypressTagDirective<TagPath extends string> {
public tag: Signal<string> = computed(() => {
return get({}, this.cypressTag());
return this.cypressTag()
.split('.')
.reduce<unknown>(
(acc, key) => (acc == null ? undefined : (acc as Record<string, unknown>)[key]),
{}
) as string;
});

/**
Expand Down
Loading