Skip to content

Commit

Permalink
#15328 - For checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Apr 22, 2024
1 parent 95539cb commit 3deda70
Show file tree
Hide file tree
Showing 74 changed files with 2,199 additions and 621 deletions.
2 changes: 1 addition & 1 deletion src/app/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const CHECKBOX_VALUE_ACCESSOR: any = {
'p-checkbox-checked': checked(),
'p-checkbox-disabled': disabled,
'p-checkbox-focused': focused,
'p-variant-filled': variant ? variant === 'filled' : config.inputStyle === 'filled'
'p-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'
}"
[class]="styleClass"
[attr.data-pc-name]="'checkbox'"
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4609,7 +4609,7 @@ export class TableRadioButton {
@Component({
selector: 'p-tableCheckbox',
template: `
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused, 'p-checkbox-disabled': disabled }" (click)="onClick($event)">
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused, 'p-checkbox-disabled': disabled, 'p-variant-filled': dt.config.inputStyle() === 'filled' }" (click)="onClick($event)">
<div class="p-hidden-accessible">
<input
type="checkbox"
Expand Down Expand Up @@ -4704,7 +4704,7 @@ export class TableCheckbox {
@Component({
selector: 'p-tableHeaderCheckbox',
template: `
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused, 'p-checkbox-disabled': isDisabled() }" (click)="onClick($event)">
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused, 'p-checkbox-disabled': isDisabled(), 'p-variant-filled': dt.config.inputStyle() === 'filled' }" (click)="onClick($event)">
<div class="p-hidden-accessible">
<input #cb type="checkbox" [tabindex]="disabled ? null : '0'" [attr.id]="inputId" [attr.name]="name" [checked]="checked" (focus)="onFocus()" (blur)="onBlur()" [disabled]="isDisabled()" [attr.aria-label]="ariaLabel" />
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ import {
<ng-template *ngTemplateOutlet="tree.togglerIconTemplate; context: { $implicit: node.expanded }"></ng-template>
</span>
</button>
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-disabled p-disabled': node.selectable === false }" *ngIf="tree.selectionMode == 'checkbox'" aria-hidden="true">
<div
class="p-checkbox p-component"
[ngClass]="{ 'p-checkbox-disabled p-disabled': node.selectable === false, 'p-variant-filled': tree?.config.inputStyle() === 'filled' }"
*ngIf="tree.selectionMode == 'checkbox'"
aria-hidden="true"
>
<div class="p-checkbox-box" [ngClass]="{ 'p-highlight': isSelected(), 'p-indeterminate': node.partialSelected }" role="checkbox">
<ng-container *ngIf="!tree.checkboxIconTemplate">
<CheckIcon *ngIf="!node.partialSelected && isSelected()" [styleClass]="'p-checkbox-icon'" />
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/treeselect/treeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const TREESELECT_VALUE_ACCESSOR: any = {
</span>
</button>
</div>
<div class="p-treeselect-items-wrapper" [ngStyle]="{ 'max-height': scrollHeight }" >
<div class="p-treeselect-items-wrapper" [ngStyle]="{ 'max-height': scrollHeight }">
<p-tree
#tree
[value]="options"
Expand Down Expand Up @@ -946,7 +946,7 @@ export class TreeSelect implements AfterContentInit {
'p-treeselect-chip': this.display === 'chip',
'p-disabled': this.disabled,
'p-focus': this.focused,
'p-variant-filled': this.variant ? this.variant === 'filled' : this.config.inputStyle === 'filled',
'p-variant-filled': this.variant ? this.variant === 'filled' : this.config.inputStyle() === 'filled'
};
}

Expand Down
13 changes: 11 additions & 2 deletions src/app/components/treetable/treetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,16 @@ export class TreeTable implements AfterContentInit, OnInit, OnDestroy, Blockable
});
}

constructor(@Inject(DOCUMENT) private document: Document, private renderer: Renderer2, public el: ElementRef, public cd: ChangeDetectorRef, public zone: NgZone, public tableService: TreeTableService, public filterService: FilterService) {}
constructor(
@Inject(DOCUMENT) private document: Document,
private renderer: Renderer2,
public el: ElementRef,
public cd: ChangeDetectorRef,
public zone: NgZone,
public tableService: TreeTableService,
public filterService: FilterService,
public config: PrimeNGConfig
) {}

ngOnChanges(simpleChange: SimpleChanges) {
if (simpleChange.value) {
Expand Down Expand Up @@ -2931,7 +2940,7 @@ export class TTContextMenuRow {
@Component({
selector: 'p-treeTableCheckbox',
template: `
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused }" (click)="onClick($event)">
<div class="p-checkbox p-component" [ngClass]="{ 'p-checkbox-focused': focused, 'p-variant-filled': tt.config.inputStyle() === 'filled' }" (click)="onClick($event)">
<div class="p-hidden-accessible">
<input type="checkbox" [checked]="checked" (focus)="onFocus()" (blur)="onBlur()" tabindex="-1" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tristatecheckbox/tristatecheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const TRISTATECHECKBOX_VALUE_ACCESSOR: any = {
template: `
<div
[ngStyle]="style"
[ngClass]="{ 'p-checkbox p-component': true, 'p-checkbox-disabled': disabled, 'p-checkbox-focused': focused, 'p-variant-filled': variant ? variant === 'filled' : config.inputStyle === 'filled' }"
[ngClass]="{ 'p-checkbox p-component': true, 'p-checkbox-disabled': disabled, 'p-checkbox-focused': focused, 'p-variant-filled': variant === 'filled' || config.inputStyle() === 'filled' }"
[class]="styleClass"
(click)="onClick($event, input)"
[attr.data-pc-name]="'tristatecheckbox'"
Expand Down
41 changes: 32 additions & 9 deletions src/assets/components/themes/arya-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -851,24 +851,23 @@
background: #2396f2;
color: #212529;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-input-filled .p-checkbox .p-checkbox-box {
.p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-input-filled .p-checkbox .p-checkbox-box.p-highlight {
.p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #64B5F6;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
background: #2396f2;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-checkbox-label {
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -3428,6 +3427,18 @@
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #64B5F6;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #2396f2;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight {
background: rgba(100, 181, 246, 0.16);
color: rgba(255, 255, 255, 0.87);
Expand Down Expand Up @@ -3625,6 +3636,18 @@
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #64B5F6;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #2396f2;
}
.p-treetable .p-treetable-tbody > tr:focus-visible {
outline: 0.15rem solid #93cbf9;
outline-offset: -0.15rem;
Expand Down
41 changes: 32 additions & 9 deletions src/assets/components/themes/arya-green/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -851,24 +851,23 @@
background: #54b358;
color: #212529;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-input-filled .p-checkbox .p-checkbox-box {
.p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-input-filled .p-checkbox .p-checkbox-box.p-highlight {
.p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #81C784;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
background: #54b358;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-checkbox-label {
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -3428,6 +3427,18 @@
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #81C784;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #54b358;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight {
background: rgba(129, 199, 132, 0.16);
color: rgba(255, 255, 255, 0.87);
Expand Down Expand Up @@ -3625,6 +3636,18 @@
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #81C784;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #54b358;
}
.p-treetable .p-treetable-tbody > tr:focus-visible {
outline: 0.15rem solid #a7d8a9;
outline-offset: -0.15rem;
Expand Down
41 changes: 32 additions & 9 deletions src/assets/components/themes/arya-orange/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -851,24 +851,23 @@
background: #ffc50c;
color: #212529;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-input-filled .p-checkbox .p-checkbox-box {
.p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-input-filled .p-checkbox .p-checkbox-box.p-highlight {
.p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #FFD54F;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
background: #ffc50c;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-checkbox-label {
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -3428,6 +3427,18 @@
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #FFD54F;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #ffc50c;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight {
background: rgba(255, 213, 79, 0.16);
color: rgba(255, 255, 255, 0.87);
Expand Down Expand Up @@ -3625,6 +3636,18 @@
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #FFD54F;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #ffc50c;
}
.p-treetable .p-treetable-tbody > tr:focus-visible {
outline: 0.15rem solid #ffe284;
outline-offset: -0.15rem;
Expand Down
41 changes: 32 additions & 9 deletions src/assets/components/themes/arya-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -851,24 +851,23 @@
background: #a241b2;
color: #ffffff;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-input-filled .p-checkbox .p-checkbox-box {
.p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-input-filled .p-checkbox .p-checkbox-box.p-highlight {
.p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #BA68C8;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-input-filled .p-checkbox:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
.p-checkbox.p-variant-filled:not(.p-checkbox-disabled) .p-checkbox-box.p-highlight:hover {
background: #a241b2;
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
border-color: #ef9a9a;
}

.p-checkbox-label {
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -3428,6 +3427,18 @@
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #BA68C8;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #a241b2;
}
.p-tree .p-tree-container .p-treenode .p-treenode-content.p-highlight {
background: rgba(186, 104, 200, 0.16);
color: rgba(255, 255, 255, 0.87);
Expand Down Expand Up @@ -3625,6 +3636,18 @@
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox .p-indeterminate .p-checkbox-icon {
color: rgba(255, 255, 255, 0.87);
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled .p-checkbox-box.p-highlight {
background: #BA68C8;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box:hover {
background-color: #383838;
}
.p-treetable .p-treetable-tbody > tr > td p-treetablecheckbox .p-checkbox.p-variant-filled:not(.p-disabled) .p-checkbox-box.p-highlight:hover {
background: #a241b2;
}
.p-treetable .p-treetable-tbody > tr:focus-visible {
outline: 0.15rem solid #cf95d9;
outline-offset: -0.15rem;
Expand Down
Loading

0 comments on commit 3deda70

Please sign in to comment.