Update strict
This commit is contained in:
@@ -7,8 +7,20 @@ import Lara from '@primeng/themes/lara';
|
|||||||
import { PrimeNG } from 'primeng/config';
|
import { PrimeNG } from 'primeng/config';
|
||||||
import { SelectButtonModule } from 'primeng/selectbutton';
|
import { SelectButtonModule } from 'primeng/selectbutton';
|
||||||
import { LayoutService } from '../service/layout.service';
|
import { LayoutService } from '../service/layout.service';
|
||||||
|
import { AuraBaseDesignTokens} from '@primeng/themes/aura/base';
|
||||||
|
import { LaraBaseDesignTokens } from '@primeng/themes/lara/base';
|
||||||
|
import { NoraBaseDesignTokens } from '@primeng/themes/nora/base';
|
||||||
|
import { MaterialBaseDesignTokens } from '@primeng/themes/material/base';
|
||||||
|
|
||||||
const presets = {
|
export interface Preset {
|
||||||
|
Aura: AuraBaseDesignTokens;
|
||||||
|
Lara: LaraBaseDesignTokens;
|
||||||
|
Nora?: NoraBaseDesignTokens;
|
||||||
|
Material?: MaterialBaseDesignTokens
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const presets: Preset = {
|
||||||
Aura,
|
Aura,
|
||||||
Lara
|
Lara
|
||||||
};
|
};
|
||||||
@@ -74,7 +86,7 @@ export class AppConfigurator {
|
|||||||
|
|
||||||
platformId = inject(PLATFORM_ID);
|
platformId = inject(PLATFORM_ID);
|
||||||
|
|
||||||
presets = Object.keys(presets);
|
presets: any = Object.keys(presets);
|
||||||
|
|
||||||
menuModeOptions = [
|
menuModeOptions = [
|
||||||
{ label: 'Static', value: 'static' },
|
{ label: 'Static', value: 'static' },
|
||||||
@@ -254,7 +266,7 @@ export class AppConfigurator {
|
|||||||
getPresetExt() {
|
getPresetExt() {
|
||||||
const color = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor());
|
const color = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor());
|
||||||
|
|
||||||
if (color.name === 'noir') {
|
if (color?.name === 'noir') {
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -306,7 +318,7 @@ export class AppConfigurator {
|
|||||||
if (this.layoutService.layoutConfig().preset === 'Nora') {
|
if (this.layoutService.layoutConfig().preset === 'Nora') {
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: color.palette,
|
primary: color?.palette,
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
light: {
|
light: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -342,7 +354,7 @@ export class AppConfigurator {
|
|||||||
} else if (this.layoutService.layoutConfig().preset === 'Material') {
|
} else if (this.layoutService.layoutConfig().preset === 'Material') {
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: color.palette,
|
primary: color?.palette,
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
light: {
|
light: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -378,7 +390,7 @@ export class AppConfigurator {
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: color.palette,
|
primary: color?.palette,
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
light: {
|
light: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -437,7 +449,7 @@ export class AppConfigurator {
|
|||||||
onPresetChange(event: any) {
|
onPresetChange(event: any) {
|
||||||
this.layoutService.layoutConfig.update((state) => ({ ...state, preset: event }));
|
this.layoutService.layoutConfig.update((state) => ({ ...state, preset: event }));
|
||||||
const preset = presets[event];
|
const preset = presets[event];
|
||||||
const surfacePalette = this.surfaces.find((s) => s.name === this.selectedSurfaceColor())?.palette;
|
const surfacePalette = this.surfaces.find((s: any) => s.name === this.selectedSurfaceColor())?.palette;
|
||||||
if (this.layoutService.layoutConfig().preset === 'Material') {
|
if (this.layoutService.layoutConfig().preset === 'Material') {
|
||||||
document.body.classList.add('material');
|
document.body.classList.add('material');
|
||||||
this.config.ripple.set(true);
|
this.config.ripple.set(true);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export class AppLayout {
|
|||||||
const topbarEl = document.querySelector('.layout-menu-button');
|
const topbarEl = document.querySelector('.layout-menu-button');
|
||||||
const eventTarget = event.target as Node;
|
const eventTarget = event.target as Node;
|
||||||
|
|
||||||
return !(sidebarEl.isSameNode(eventTarget) || sidebarEl.contains(eventTarget) || topbarEl.isSameNode(eventTarget) || topbarEl.contains(eventTarget));
|
return !(sidebarEl?.isSameNode(eventTarget) || sidebarEl?.contains(eventTarget) || topbarEl?.isSameNode(eventTarget) || topbarEl?.contains(eventTarget));
|
||||||
}
|
}
|
||||||
|
|
||||||
hideMenu() {
|
hideMenu() {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import { LayoutService } from '../service/layout.service';
|
|||||||
})
|
})
|
||||||
export class AppMenuitem {
|
export class AppMenuitem {
|
||||||
|
|
||||||
@Input() item: MenuItem;
|
@Input() item!: MenuItem;
|
||||||
|
|
||||||
@Input() index!: number;
|
@Input() index!: number;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Subject } from 'rxjs';
|
|||||||
export interface layoutConfig {
|
export interface layoutConfig {
|
||||||
preset?: string;
|
preset?: string;
|
||||||
primary?: string;
|
primary?: string;
|
||||||
surface?: string;
|
surface?: string | undefined | null;
|
||||||
darkTheme?: boolean;
|
darkTheme?: boolean;
|
||||||
menuMode?: string;
|
menuMode?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {TextareaModule} from "primeng/textarea";
|
|||||||
import { ToggleButtonModule } from 'primeng/togglebutton';
|
import { ToggleButtonModule } from 'primeng/togglebutton';
|
||||||
import { CountryService } from '../service/country.service';
|
import { CountryService } from '../service/country.service';
|
||||||
import { NodeService } from '../service/node.service';
|
import { NodeService } from '../service/node.service';
|
||||||
|
import { TreeNode } from 'primeng/api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-input-demo',
|
selector: 'app-input-demo',
|
||||||
@@ -311,7 +312,7 @@ export class InputDemo implements OnInit {
|
|||||||
|
|
||||||
inputGroupValue: boolean = false;
|
inputGroupValue: boolean = false;
|
||||||
|
|
||||||
treeSelectNodes: any[] = null;
|
treeSelectNodes!: TreeNode[];
|
||||||
|
|
||||||
selectedNode: any = null;
|
selectedNode: any = null;
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ export class ListDemo {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getSeverity(product) {
|
getSeverity(product: Product) {
|
||||||
switch (product.inventoryStatus) {
|
switch (product.inventoryStatus) {
|
||||||
case 'INSTOCK':
|
case 'INSTOCK':
|
||||||
return 'success';
|
return 'success';
|
||||||
@@ -201,7 +201,7 @@ export class ListDemo {
|
|||||||
return 'danger';
|
return 'danger';
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return 'info';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import {MessageService } from 'primeng/api';
|
import { MessageService, ToastMessageOptions } from 'primeng/api';
|
||||||
import { ButtonModule } from 'primeng/button';
|
import { ButtonModule } from 'primeng/button';
|
||||||
import { InputTextModule } from 'primeng/inputtext';
|
import { InputTextModule } from 'primeng/inputtext';
|
||||||
import { ToastModule } from 'primeng/toast';
|
import { ToastModule } from 'primeng/toast';
|
||||||
@@ -53,7 +53,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
})
|
})
|
||||||
export class MessagesDemo {
|
export class MessagesDemo {
|
||||||
|
|
||||||
msgs = [];
|
msgs: ToastMessageOptions[] | null = [];
|
||||||
|
|
||||||
username: string | undefined
|
username: string | undefined
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ export class OverlayDemo implements OnInit {
|
|||||||
op.toggle(event);
|
op.toggle(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
onProductSelect(op, event: any) {
|
onProductSelect(op: Popover, event: any) {
|
||||||
op.hide();
|
op.hide();
|
||||||
this.messageService.add({ severity: 'info', summary: 'Product Selected', detail: event?.data.name, life: 3000 });
|
this.messageService.add({ severity: 'info', summary: 'Product Selected', detail: event?.data.name, life: 3000 });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"strict": false,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
"noPropertyAccessFromIndexSignature": true,
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user