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 { $t, updatePreset, updateSurfacePalette } from '@primeng/themes';
|
||||||
import Aura from '@primeng/themes/aura';
|
import Aura from '@primeng/themes/aura';
|
||||||
import Lara from '@primeng/themes/lara';
|
import Lara from '@primeng/themes/lara';
|
||||||
|
import Material from '@primeng/themes/material';
|
||||||
|
import Nora from '@primeng/themes/nora';
|
||||||
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';
|
|
||||||
|
|
||||||
export interface Preset {
|
const presets = {
|
||||||
Aura: AuraBaseDesignTokens;
|
|
||||||
Lara: LaraBaseDesignTokens;
|
|
||||||
Nora?: NoraBaseDesignTokens;
|
|
||||||
Material?: MaterialBaseDesignTokens
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const presets: Preset = {
|
|
||||||
Aura,
|
Aura,
|
||||||
Lara
|
Material,
|
||||||
|
Lara,
|
||||||
|
Nora
|
||||||
};
|
};
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -86,7 +78,9 @@ export class AppConfigurator {
|
|||||||
|
|
||||||
platformId = inject(PLATFORM_ID);
|
platformId = inject(PLATFORM_ID);
|
||||||
|
|
||||||
presets: any = Object.keys(presets);
|
primeng = inject(PrimeNG);
|
||||||
|
|
||||||
|
presets = Object.keys(presets);
|
||||||
|
|
||||||
menuModeOptions = [
|
menuModeOptions = [
|
||||||
{ label: 'Static', value: 'static' },
|
{ label: 'Static', value: 'static' },
|
||||||
@@ -266,7 +260,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: {
|
||||||
@@ -318,7 +312,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: {
|
||||||
@@ -352,9 +346,11 @@ export class AppConfigurator {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else if (this.layoutService.layoutConfig().preset === 'Material') {
|
} else if (this.layoutService.layoutConfig().preset === 'Material') {
|
||||||
|
this.primeng.inputVariant.set('filled');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: color?.palette,
|
primary: color.palette,
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
light: {
|
light: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -390,7 +386,7 @@ export class AppConfigurator {
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
semantic: {
|
semantic: {
|
||||||
primary: color?.palette,
|
primary: color.palette,
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
light: {
|
light: {
|
||||||
primary: {
|
primary: {
|
||||||
@@ -449,7 +445,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: any) => s.name === this.selectedSurfaceColor())?.palette;
|
const surfacePalette = this.surfaces.find((s) => 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user