Skip to content

Commit

Permalink
Merge pull request #117 from ngneat/update-ng-17
Browse files Browse the repository at this point in the history
feat: 🎸 update to ng17
  • Loading branch information
NetanelBasal authored Nov 28, 2023
2 parents 4e8a0bd + b827e4e commit 4a900e4
Show file tree
Hide file tree
Showing 5 changed files with 13,939 additions and 35,024 deletions.
2 changes: 1 addition & 1 deletion libs/dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tslib": "2.3.1"
},
"peerDependencies": {
"@angular/core": ">=14.0.0"
"@angular/core": ">=17.0.0"
},
"keywords": [
"angular",
Expand Down
6 changes: 4 additions & 2 deletions libs/dialog/src/lib/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,24 @@ import { NODES_TO_INSERT } from './providers';
[ngStyle]="styles"
role="dialog"
>
@if (config.draggable) {
<div
*ngIf="config.draggable"
class="ngneat-drag-marker"
dialogDraggable
[dialogDragEnabled]="true"
[dialogDragTarget]="dialog"
[dragConstraint]="config.dragConstraint"
></div>
<div class="ngneat-close-dialog" *ngIf="config.closeButton" (click)="closeDialog()">
} @if (config.closeButton) {
<div class="ngneat-close-dialog" (click)="closeDialog()">
<svg viewBox="0 0 329.26933 329" xmlns="http://www.w3.org/2000/svg">
<path
fill="currentColor"
d="m194.800781 164.769531 128.210938-128.214843c8.34375-8.339844 8.34375-21.824219 0-30.164063-8.339844-8.339844-21.824219-8.339844-30.164063 0l-128.214844 128.214844-128.210937-128.214844c-8.34375-8.339844-21.824219-8.339844-30.164063 0-8.34375 8.339844-8.34375 21.824219 0 30.164063l128.210938 128.214843-128.210938 128.214844c-8.34375 8.339844-8.34375 21.824219 0 30.164063 4.15625 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921875-2.089844 15.082031-6.25l128.210937-128.214844 128.214844 128.214844c4.160156 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921874-2.089844 15.082031-6.25 8.34375-8.339844 8.34375-21.824219 0-30.164063zm0 0"
/>
</svg>
</div>
}
</div>
</div>
`,
Expand Down
42 changes: 23 additions & 19 deletions libs/dialog/src/lib/providers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOCUMENT } from '@angular/common';
import { inject, InjectionToken, Provider } from '@angular/core';
import { inject, InjectionToken, makeEnvironmentProviders } from '@angular/core';

import { DialogConfig, GlobalDialogConfig } from './types';

Expand Down Expand Up @@ -68,26 +68,30 @@ export const GLOBAL_DIALOG_CONFIG = new InjectionToken<Partial<GlobalDialogConfi

export const NODES_TO_INSERT = new InjectionToken<Element[]>('Nodes inserted into the dialog');

export function provideDialogConfig(config: Partial<GlobalDialogConfig>): Provider {
return {
provide: GLOBAL_DIALOG_CONFIG,
useFactory() {
const defaultConfig = defaultGlobalConfig();
return {
...defaultConfig,
...config,
sizes: {
...defaultConfig.sizes,
...config.sizes,
},
};
export function provideDialogConfig(config: Partial<GlobalDialogConfig>) {
return makeEnvironmentProviders([
{
provide: GLOBAL_DIALOG_CONFIG,
useFactory() {
const defaultConfig = defaultGlobalConfig();
return {
...defaultConfig,
...config,
sizes: {
...defaultConfig.sizes,
...config.sizes,
},
};
},
},
};
]);
}

export function provideDialogDocRef(doc: Document) {
return {
provide: DIALOG_DOCUMENT_REF,
useValue: doc,
};
return makeEnvironmentProviders([
{
provide: DIALOG_DOCUMENT_REF,
useValue: doc,
},
]);
}
Loading

0 comments on commit 4a900e4

Please sign in to comment.