Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@
justify-content: center;
border-radius: var-get($theme, 'item-border-radius');
color: var-get($theme, 'item-text-color');
background: var-get($theme, 'item-background');

@if $bootstrap-theme or $variant == 'fluent' {
border-bottom: var-get($theme, 'border-width') solid var-get($theme, 'border-color');
Expand All @@ -436,9 +435,6 @@
}

&:hover {
color: var-get($theme, 'item-text-color-hover');
background: var-get($theme, 'item-background-hover');

%igx-list__item-lines {
color: currentColor;
}
Expand Down Expand Up @@ -544,9 +540,15 @@
align-items: center;
position: relative;
border-radius: var-get($theme, 'item-border-radius');
background: inherit;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SisIvanova I have a feeling that this is important especially when panning items. Take a look at the scoped styles PR and how the sample has been updated there to support panning so this can be tested before merging.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was to fix the background being applied to both the wrapper and the nested component, which causes a bug in indigo theme where the background has some opacity. This was already fixed by you in the scoped-styles branch. I updated the sample with the panning option so that you and @didimmova can easily test if everything looks good.

background: var-get($theme, 'item-background');
z-index: 2;
gap: if($variant == 'indigo', rem(8px), rem(16px));

&:hover,
&:focus-within {
color: var-get($theme, 'item-text-color-hover');
background: var-get($theme, 'item-background-hover');
}
}

%igx-list-header,
Expand Down
12 changes: 11 additions & 1 deletion src/app/list/list.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
<section class="sample-content" [igSize]="properties.size">
<article class="sample-column">
<h5 class="sample-title">Angular List</h5>
<igx-list>
<igx-list [allowLeftPanning]="properties.enablePanning" [allowRightPanning]="properties.enablePanning">
<ng-template igxListItemLeftPanning>
<div class="pan pan--left">
<igx-icon>delete</igx-icon>Delete
</div>
</ng-template>
<ng-template igxListItemRightPanning>
<div class="pan pan--right">
<igx-icon>call</igx-icon>Dial
</div>
</ng-template>
<igx-list-item [isHeader]="true" selected>Employees List</igx-list-item>
@for (employee of employeeItems; track employee) {
<igx-list-item [selected]="employee.selected">
Expand Down
18 changes: 18 additions & 0 deletions src/app/list/list.sample.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
.sample-title {
text-align: center;
}

.pan {
display: flex;
color: white;
width: 100%;
padding-left: 10px;
align-items: center;
}

.pan--left {
flex-direction: row-reverse;
background-color:orange;
}

.pan--right {
flex-direction: row;
background-color:limegreen;
}
25 changes: 23 additions & 2 deletions src/app/list/list.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
PropertyChangeService,
PropertyPanelConfig,
} from '../properties-panel/property-change.service';
import { HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
import Hammer from 'hammerjs';

defineComponents(
IgcListComponent,
Expand Down Expand Up @@ -79,15 +81,27 @@ interface Employee {
IgxAvatarComponent,
IgxButtonModule,
IgxButtonDirective,
IgSizeDirective
IgSizeDirective,
HammerModule
],
providers: [
{
provide: HAMMER_GESTURE_CONFIG,
useClass: class {
public overrides = {
pan: { direction: Hammer.DIRECTION_HORIZONTAL }
}
}
}
]
})
export class ListSampleComponent {
public panelConfig: PropertyPanelConfig = {
size: {
control: {
type: 'button-group',
options: ['small', 'medium', 'large']
options: ['small', 'medium', 'large'],
defaultValue: 'medium'
}
},
hideTitle: {
Expand Down Expand Up @@ -145,6 +159,13 @@ export class ListSampleComponent {
type: 'boolean',
defaultValue: false
}
},
enablePanning: {
label: 'Item Panning',
control: {
type: 'boolean',
defaultValue: false
}
}
}

Expand Down
Loading