Skip to content

Commit e383fa2

Browse files
committed
Merge branch 'simeonoff/fix-13693' of https://github.com/IgniteUI/igniteui-angular into simeonoff/fix-13693
2 parents de1ef9c + 9bec587 commit e383fa2

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

projects/igniteui-angular/src/lib/core/density.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,18 @@ export class DisplayDensityBase implements DoCheck, OnInit {
8585
*/
8686
@Input()
8787
public get displayDensity(): DisplayDensity {
88-
if (!this.size) {
89-
return (
90-
this._displayDensity ??
91-
this.displayDensityOptions?.displayDensity ??
92-
DisplayDensity.comfortable
93-
);
94-
}
95-
9688
switch (this.size) {
9789
case '1':
9890
return DisplayDensity.compact;
9991
case '2':
10092
return DisplayDensity.cosy;
10193
case '3':
10294
default:
103-
return DisplayDensity.comfortable;
95+
return (
96+
this._displayDensity ??
97+
this.displayDensityOptions?.displayDensity ??
98+
DisplayDensity.comfortable
99+
);
104100
}
105101
}
106102

@@ -122,7 +118,7 @@ export class DisplayDensityBase implements DoCheck, OnInit {
122118
}
123119

124120
public get size() {
125-
return this._document.defaultView
121+
return globalThis.document?.defaultView
126122
.getComputedStyle(this._host.nativeElement)
127123
.getPropertyValue('--ig-size')
128124
.trim();
@@ -135,7 +131,8 @@ export class DisplayDensityBase implements DoCheck, OnInit {
135131

136132
protected oldDisplayDensityOptions: IDisplayDensityOptions = {
137133
displayDensity: DisplayDensity.comfortable,
138-
};
134+
}
135+
139136
protected _displayDensity: DisplayDensity;
140137

141138
constructor(

projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@
376376
align-items: center;
377377
justify-content: center;
378378
text-align: center;
379-
flex: 1 1 auto;
380379
height: var-get($theme, 'size');
381380
padding-inline: sizable(
382381
map.get($chip-padding, 'compact'),
@@ -411,9 +410,9 @@
411410

412411
igx-avatar,
413412
igx-circular-bar {
414-
max-width: 100%;
415413
max-height: 100%;
416414
width: sizable(rem(14px), rem(18px), rem(24px));
415+
max-width: sizable(rem(14px), rem(18px), rem(24px));
417416
height: sizable(rem(14px), rem(18px), rem(24px));
418417
}
419418

@@ -655,21 +654,41 @@
655654
}
656655

657656
%igx-chip__start {
658-
igx-avatar,
659-
igx-circular-bar {
657+
> igx-avatar,
658+
> igx-circular-bar {
660659
&:first-child {
661660
margin-inline-start: calc(#{sizable(rem(0), rem(4px), rem(8px))} * -1);
662661
}
663662
}
663+
664+
[igxPrefix],
665+
igx-prefix {
666+
&:first-of-type {
667+
igx-avatar,
668+
igx-circular-bar {
669+
margin-inline-start: calc(#{sizable(rem(0), rem(4px), rem(8px))} * -1);
670+
}
671+
}
672+
}
664673
}
665674

666675
%igx-chip__end {
667-
igx-avatar,
668-
igx-circular-bar {
676+
> igx-avatar,
677+
> igx-circular-bar {
669678
&:last-child {
670679
margin-inline-end: calc(#{sizable(rem(0), rem(4px), rem(8px))} * -1);
671680
}
672681
}
682+
683+
[igxPrefix],
684+
igx-prefix {
685+
&:first-of-type {
686+
igx-avatar,
687+
igx-circular-bar {
688+
margin-inline-end: calc(#{sizable(rem(0), rem(4px), rem(8px))} * -1);
689+
}
690+
}
691+
}
673692
}
674693

675694
%igx-chip__start,
@@ -694,8 +713,7 @@
694713

695714
%igx-chip__prefix,
696715
%igx-chip__suffix {
697-
@include ellipsis();
698-
display: inline-block;
716+
display: inline-flex;
699717
vertical-align: middle;
700718
max-width: $chip-max-width;
701719

projects/igniteui-angular/src/lib/core/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,11 +573,11 @@ export const formatCurrency = new CurrencyPipe(undefined).transform;
573573

574574
/** Converts pixel values to their rem counterparts for a base value */
575575
export const rem = (value: number | string) => {
576-
const base = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--ig-base-font-size'))
576+
const base = parseFloat(getComputedStyle(globalThis.document?.documentElement).getPropertyValue('--ig-base-font-size'))
577577
return Number(value) / base;
578578
}
579579

580580
/** Get the size of the component as derived from the CSS size variable */
581581
export function getComponentSize(el: Element) {
582-
return window.getComputedStyle(el).getPropertyValue('--component-size');
582+
return globalThis.window?.getComputedStyle(el).getPropertyValue('--component-size');
583583
}

0 commit comments

Comments
 (0)