Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed primefaces#16576 - Column Filter missing primary color #16588

Open
wants to merge 7 commits into
base: v18
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/primeng/src/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { Ripple } from 'primeng/ripple';
import { transformToBoolean } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { AccordionStyle } from './style/accordionstyle';
import { styleClassAttribute } from "primeng/base";

/**
* Custom tab open event.
Expand Down Expand Up @@ -715,7 +716,7 @@ export class Accordion extends BaseComponent implements BlockableUI, AfterConten
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Icon of a collapsed tab.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { Scroller } from 'primeng/scroller';
import { Nullable } from 'primeng/ts-helpers';
import { AutoCompleteCompleteEvent, AutoCompleteDropdownClickEvent, AutoCompleteLazyLoadEvent, AutoCompleteSelectEvent, AutoCompleteUnselectEvent } from './autocomplete.interface';
import { AutoCompleteStyle } from './style/autocompletestyle';
import {styleClassAttribute} from "primeng/base";

export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -311,7 +312,7 @@ export class AutoComplete extends BaseComponent implements AfterViewChecked, Aft
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Style class of the overlay panel element.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/avatar/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, inject,
import { SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { AvatarStyle } from './style/avatarstyle';
import {styleClassAttribute} from "primeng/base";

/**
* Avatar represents people using icons, labels and images.
Expand Down Expand Up @@ -69,7 +70,7 @@ export class Avatar extends BaseComponent {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Establishes a string value that labels the component.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/avatargroup/avatargroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ChangeDetectionStrategy, Component, HostBinding, inject, Input, NgModul
import { SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { AvatarGroupStyle } from './style/avatargroupstyle';
import {styleClassAttribute} from "primeng/base";

/**
* AvatarGroup is a helper component for Avatar.
Expand All @@ -26,7 +27,7 @@ export class AvatarGroup extends BaseComponent {
* Style class of the component
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Inline style of the component.
* @group Props
Expand Down
16 changes: 16 additions & 0 deletions packages/primeng/src/base/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ export default {
this._loadedStyleNames.clear();
}
};

export function styleClassAttribute(value: any): string | undefined{
if(typeof value === 'string'){
return value;
}else if(Array.isArray(value)){
return value.join(' ');
}else if(value){
return Object.keys(value)
.filter(key => value[key])
.join(' ');
}else{
return value
}
}


1 change: 1 addition & 0 deletions packages/primeng/src/base/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as Base } from './base';
export { styleClassAttribute } from './base';
export * from './style/basestyle';
3 changes: 1 addition & 2 deletions packages/primeng/src/basecomponent/basecomponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ export class BaseComponent {
const classes = this.parent ? this.parent.componentStyle?.classes?.[arg] : this.componentStyle?.classes?.[arg];

if (typeof classes === 'function') {
return classes({ instance: this });
return classes({instance: this});
}

return typeof classes === 'string' ? classes : arg;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/blockui/blockui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { ZIndexUtils } from 'primeng/utils';
import { BlockUiStyle } from './style/blockuistyle';
import {styleClassAttribute} from "primeng/base";

/**
* BlockUI can either block other components or the whole page.
Expand Down Expand Up @@ -52,7 +53,7 @@ export class BlockUI extends BaseComponent implements AfterViewInit, OnDestroy {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Current blocked state as a boolean.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/breadcrumb/breadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ChevronRightIcon, HomeIcon } from 'primeng/icons';
import { TooltipModule } from 'primeng/tooltip';
import { BreadcrumbItemClickEvent } from './breadcrumb.interface';
import { BreadCrumbStyle } from './style/breadcrumbstyle';
import {styleClassAttribute} from "primeng/base";

/**
* Breadcrumb provides contextual information about page hierarchy.
Expand Down Expand Up @@ -150,7 +151,7 @@ export class Breadcrumb extends BaseComponent implements AfterContentInit {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* MenuItem configuration for the home icon.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { SpinnerIcon } from 'primeng/icons';
import { Ripple } from 'primeng/ripple';
import { ButtonProps } from './button.interface';
import { ButtonStyle } from './style/buttonstyle';
import {styleClassAttribute} from "primeng/base";

type ButtonIconPosition = 'left' | 'right' | 'top' | 'bottom';

Expand Down Expand Up @@ -567,7 +568,7 @@ export class Button extends BaseComponent implements AfterContentInit {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Style class of the badge.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { ZIndexUtils } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { CalendarMonthChangeEvent, CalendarResponsiveOptions, CalendarTypeView, CalendarYearChangeEvent, LocaleSettings, Month, NavigationState } from './calendar.interface';
import { CalendarStyle } from './style/calendarstyle';
import {styleClassAttribute} from "primeng/base";

export const CALENDAR_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -533,7 +534,7 @@ export class Calendar extends BaseComponent implements OnInit, OnDestroy, Contro
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Inline style of the input field.
* @group Props
Expand Down
4 changes: 2 additions & 2 deletions packages/primeng/src/card/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { equals } from '@primeuix/utils';
import { BlockableUI, Footer, Header, SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { CardStyle } from './style/cardstyle';

import { styleClassAttribute } from "primeng/base";
/**
* Card is a flexible container component.
* @group Components
Expand Down Expand Up @@ -67,7 +67,7 @@ export class Card extends BaseComponent implements BlockableUI {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;

@ContentChild(Header) headerFacet: TemplateRef<any> | undefined;

Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } fro
import { Ripple } from 'primeng/ripple';
import { CarouselPageEvent, CarouselResponsiveOptions } from './carousel.interface';
import { CarouselStyle } from './style/carouselstyle';
import {styleClassAttribute} from "primeng/base";

/**
* Carousel is a content slider featuring various customization options.
Expand Down Expand Up @@ -287,7 +288,7 @@ export class Carousel extends BaseComponent implements AfterContentInit {
* Style class of the viewport container.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Used to pass all properties of the ButtonProps to the Button component.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/cascadeselect/cascadeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { Ripple } from 'primeng/ripple';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { CascadeSelectBeforeHideEvent, CascadeSelectBeforeShowEvent, CascadeSelectChangeEvent, CascadeSelectHideEvent, CascadeSelectShowEvent } from './cascadeselect.interface';
import { CascadeSelectStyle } from './style/cascadeselectstyle';
import { styleClassAttribute } from "primeng/base";

export const CASCADESELECT_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -392,7 +393,7 @@ export class CascadeSelect extends BaseComponent implements OnInit {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Inline style of the component.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { CheckIcon, MinusIcon } from 'primeng/icons';
import { Nullable } from 'primeng/ts-helpers';
import { CheckboxChangeEvent } from './checkbox.interface';
import { CheckboxStyle } from './style/checkboxstyle';
import {styleClassAttribute} from "primeng/base";

export const CHECKBOX_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -134,7 +135,7 @@ export class Checkbox extends BaseComponent implements ControlValueAccessor {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Style class of the input element.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/chip/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BaseComponent } from 'primeng/basecomponent';
import { TimesCircleIcon } from 'primeng/icons';
import { ChipProps } from './chip.interface';
import { ChipStyle } from './style/chipstyle';
import { styleClassAttribute } from "primeng/base";

/**
* Chip represents people using icons, labels and images.
Expand Down Expand Up @@ -75,7 +76,7 @@ export class Chip extends BaseComponent {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Whether to display a remove icon.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/colorpicker/colorpicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { ColorPickerChangeEvent } from './colorpicker.interface';
import { ColorPickerStyle } from './style/colorpickerstyle';
import { styleClassAttribute } from "primeng/base";

export const COLORPICKER_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -97,7 +98,7 @@ export class ColorPicker extends BaseComponent implements ControlValueAccessor,
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Whether to display as an overlay or not.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Ripple } from 'primeng/ripple';
import { Nullable } from 'primeng/ts-helpers';
import { Subscription } from 'rxjs';
import { ConfirmDialogStyle } from './style/confirmdialogstyle';
import {styleClassAttribute} from "primeng/base";

const showAnimation = animation([style({ transform: '{{transform}}', opacity: 0 }), animate('{{transition}}', style({ transform: 'none', opacity: 1 }))]);

Expand Down Expand Up @@ -142,7 +143,7 @@ export class ConfirmDialog extends BaseComponent implements OnInit, OnDestroy {
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Specify the CSS class(es) for styling the mask element
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/confirmpopup/confirmpopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { ConfirmPopupStyle } from './style/confirmpopupstyle';
import {styleClassAttribute} from "primeng/base";

/**
* ConfirmPopup displays a confirmation overlay displayed relatively to its target.
Expand Down Expand Up @@ -163,7 +164,7 @@ export class ConfirmPopup extends BaseComponent implements AfterContentInit, OnD
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Defines if the component is visible.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { TooltipModule } from 'primeng/tooltip';
import { VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { ContextMenuStyle } from './style/contextmenustyle';
import {styleClassAttribute} from "primeng/base";

@Component({
selector: 'p-contextMenuSub, p-contextmenu-sub',
Expand Down Expand Up @@ -435,7 +436,7 @@ export class ContextMenu extends BaseComponent implements OnInit, OnDestroy {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/dataview/dataview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { Nullable } from 'primeng/ts-helpers';
import { Subscription } from 'rxjs';
import { DataViewLayoutChangeEvent, DataViewLazyLoadEvent, DataViewPageEvent, DataViewPaginatorState, DataViewSortEvent } from './dataview.interface';
import { DataViewStyle } from './style/dataviewstyle';
import {styleClassAttribute} from "primeng/base";

/**
* DataView displays data in grid or list layout with pagination and sorting features.
Expand Down Expand Up @@ -236,7 +237,7 @@ export class DataView extends BaseComponent implements OnInit, OnDestroy, Blocka
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Style class of the grid.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { ZIndexUtils } from 'primeng/utils';
import { Subscription } from 'rxjs';
import { DatePickerMonthChangeEvent, DatePickerResponsiveOptions, DatePickerTypeView, DatePickerYearChangeEvent, LocaleSettings, Month, NavigationState } from './datepicker.interface';
import { DatePickerStyle } from './style/datepickerstyle';
import {styleClassAttribute} from "primeng/base";

export const DATEPICKER_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -554,7 +555,7 @@ export class DatePicker extends BaseComponent implements OnInit, OnDestroy, Cont
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Inline style of the input field.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { Ripple } from 'primeng/ripple';
import { Nullable, VoidListener } from 'primeng/ts-helpers';
import { ZIndexUtils } from 'primeng/utils';
import { DialogStyle } from './style/dialogstyle';
import {styleClassAttribute} from "primeng/base";

const showAnimation = animation([style({ transform: '{{transform}}', opacity: 0 }), animate('{{transition}}')]);

Expand Down Expand Up @@ -231,7 +232,7 @@ export class Dialog extends BaseComponent implements OnInit, OnDestroy {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Style class of the mask.
* @group Props
Expand Down
3 changes: 2 additions & 1 deletion packages/primeng/src/divider/divider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ChangeDetectionStrategy, Component, HostBinding, inject, Input, NgModul
import { SharedModule } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { DividerStyle } from './style/dividerstyle';
import {styleClassAttribute} from "primeng/base";

/**
* Divider is used to separate contents.
Expand Down Expand Up @@ -51,7 +52,7 @@ export class Divider extends BaseComponent {
* Style class of the component.
* @group Props
*/
@Input() styleClass: string | undefined;
@Input({ transform: styleClassAttribute }) styleClass: string | undefined;
/**
* Specifies the orientation.
* @group Props
Expand Down
Loading
Loading