Merge remote-tracking branch 'origin/v19' into v19
# Conflicts: # src/app/layout/core/app.configurator.ts
This commit is contained in:
@@ -4,25 +4,17 @@ import { FormsModule } from '@angular/forms';
|
||||
import { $t, updatePreset, updateSurfacePalette } from '@primeng/themes';
|
||||
import Aura from '@primeng/themes/aura';
|
||||
import Lara from '@primeng/themes/lara';
|
||||
import Material from '@primeng/themes/material';
|
||||
import Nora from '@primeng/themes/nora';
|
||||
import { PrimeNG } from 'primeng/config';
|
||||
import { SelectButtonModule } from 'primeng/selectbutton';
|
||||
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';
|
||||
|
||||
export interface Preset {
|
||||
Aura: AuraBaseDesignTokens;
|
||||
Lara: LaraBaseDesignTokens;
|
||||
Nora?: NoraBaseDesignTokens;
|
||||
Material?: MaterialBaseDesignTokens
|
||||
|
||||
}
|
||||
|
||||
const presets: Preset = {
|
||||
const presets = {
|
||||
Aura,
|
||||
Lara
|
||||
Material,
|
||||
Lara,
|
||||
Nora
|
||||
};
|
||||
|
||||
@Component({
|
||||
@@ -86,7 +78,9 @@ export class AppConfigurator {
|
||||
|
||||
platformId = inject(PLATFORM_ID);
|
||||
|
||||
presets: any = Object.keys(presets);
|
||||
primeng = inject(PrimeNG);
|
||||
|
||||
presets = Object.keys(presets);
|
||||
|
||||
menuModeOptions = [
|
||||
{ label: 'Static', value: 'static' },
|
||||
@@ -266,7 +260,7 @@ export class AppConfigurator {
|
||||
getPresetExt() {
|
||||
const color = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor());
|
||||
|
||||
if (color?.name === 'noir') {
|
||||
if (color.name === 'noir') {
|
||||
return {
|
||||
semantic: {
|
||||
primary: {
|
||||
@@ -318,7 +312,7 @@ export class AppConfigurator {
|
||||
if (this.layoutService.layoutConfig().preset === 'Nora') {
|
||||
return {
|
||||
semantic: {
|
||||
primary: color?.palette,
|
||||
primary: color.palette,
|
||||
colorScheme: {
|
||||
light: {
|
||||
primary: {
|
||||
@@ -352,9 +346,11 @@ export class AppConfigurator {
|
||||
}
|
||||
};
|
||||
} else if (this.layoutService.layoutConfig().preset === 'Material') {
|
||||
this.primeng.inputVariant.set('filled');
|
||||
|
||||
return {
|
||||
semantic: {
|
||||
primary: color?.palette,
|
||||
primary: color.palette,
|
||||
colorScheme: {
|
||||
light: {
|
||||
primary: {
|
||||
@@ -390,7 +386,7 @@ export class AppConfigurator {
|
||||
} else {
|
||||
return {
|
||||
semantic: {
|
||||
primary: color?.palette,
|
||||
primary: color.palette,
|
||||
colorScheme: {
|
||||
light: {
|
||||
primary: {
|
||||
@@ -449,7 +445,7 @@ export class AppConfigurator {
|
||||
onPresetChange(event: any) {
|
||||
this.layoutService.layoutConfig.update((state) => ({ ...state, preset: event }));
|
||||
const preset = presets[event];
|
||||
const surfacePalette = this.surfaces.find((s: any) => s.name === this.selectedSurfaceColor())?.palette;
|
||||
const surfacePalette = this.surfaces.find((s) => s.name === this.selectedSurfaceColor())?.palette;
|
||||
if (this.layoutService.layoutConfig().preset === 'Material') {
|
||||
document.body.classList.add('material');
|
||||
this.config.ripple.set(true);
|
||||
|
||||
Reference in New Issue
Block a user