Skip to content

Commit

Permalink
fix: Conflict between picklist used inputicon-style and table loading…
Browse files Browse the repository at this point in the history
… mask

Fixes #17263
  • Loading branch information
mertsincan committed Feb 6, 2025
1 parent 280a9a7 commit cab3c60
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
12 changes: 10 additions & 2 deletions packages/primeng/src/base/style/basestyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ export class BaseStyle {

useStyle: UseStyle = inject(UseStyle);

theme = theme;
theme = undefined;

css = css;
css = undefined;

classes = {};

Expand All @@ -216,6 +216,14 @@ export class BaseStyle {
return this.load(this.theme, options, (computedStyle = '') => Theme.transformCSS(options.name || this.name, `${computedStyle}${style}`));
};

loadGlobalCSS = (options = {}) => {
return this.load(css, options);
};

loadGlobalTheme = (options: any = {}, style: string = '') => {
return this.load(theme, options, (computedStyle = '') => Theme.transformCSS(options.name || this.name, `${computedStyle}${style}`));
};

getCommonTheme = (params?) => {
return Theme.getCommon(this.name, params);
};
Expand Down
7 changes: 3 additions & 4 deletions packages/primeng/src/basecomponent/basecomponent.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { DOCUMENT, isPlatformServer } from '@angular/common';
import { ChangeDetectorRef, ContentChildren, Directive, ElementRef, inject, Injector, Input, PLATFORM_ID, QueryList, Renderer2, SimpleChanges } from '@angular/core';
import { ChangeDetectorRef, Directive, ElementRef, inject, Injector, Input, PLATFORM_ID, Renderer2, SimpleChanges } from '@angular/core';
import { Theme, ThemeService } from '@primeuix/styled';
import { getKeyValue, uuid } from '@primeuix/utils';
import { PrimeTemplate } from 'primeng/api';
import { Base, BaseStyle } from 'primeng/base';
import { PrimeNG } from 'primeng/config';
import { BaseComponentStyle } from './style/basecomponentstyle';
Expand Down Expand Up @@ -87,7 +86,7 @@ export class BaseComponent {
_loadStyles() {
const _load = () => {
if (!Base.isStyleNameLoaded('base')) {
this.baseStyle.loadCSS(this.styleOptions);
this.baseStyle.loadGlobalCSS(this.styleOptions);
Base.setLoadedStyleName('base');
}

Expand Down Expand Up @@ -115,7 +114,7 @@ export class BaseComponent {
this.baseStyle.load(primitive?.css, { name: 'primitive-variables', ...this.styleOptions });
this.baseStyle.load(semantic?.css, { name: 'semantic-variables', ...this.styleOptions });
this.baseStyle.load(global?.css, { name: 'global-variables', ...this.styleOptions });
this.baseStyle.loadTheme({ name: 'global-style', ...this.styleOptions }, style);
this.baseStyle.loadGlobalTheme({ name: 'global-style', ...this.styleOptions }, style);

Theme.setLoadedStyleName('common');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/primeng/src/config/themeprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ThemeProvider {
this.baseStyle.load(primitive?.css, { name: 'primitive-variables', ...styleOptions });
this.baseStyle.load(semantic?.css, { name: 'semantic-variables', ...styleOptions });
this.baseStyle.load(global?.css, { name: 'global-variables', ...styleOptions });
this.baseStyle.loadTheme({ name: 'global-style', ...styleOptions }, style);
this.baseStyle.loadGlobalTheme({ name: 'global-style', ...styleOptions }, style);

Theme.setLoadedStyleName('common');
}
Expand Down

0 comments on commit cab3c60

Please sign in to comment.