Skip to content

Commit f458e08

Browse files
author
Konstantin Dinev
authored
Merge branch 'master' into ikitanov/fix-15306-master
2 parents 75e625f + d01b020 commit f458e08

File tree

17 files changed

+154
-70
lines changed

17 files changed

+154
-70
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@types/source-map": "0.5.2",
7575
"express": "^4.21.1",
7676
"fflate": "^0.8.1",
77-
"igniteui-theming": "^17.0.0",
77+
"igniteui-theming": "^17.1.0",
7878
"igniteui-trial-watermark": "^3.0.2",
7979
"lodash-es": "^4.17.21",
8080
"rxjs": "^7.8.2",

projects/igniteui-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"tslib": "^2.3.0",
7474
"igniteui-trial-watermark": "^3.0.2",
7575
"lodash-es": "^4.17.21",
76-
"igniteui-theming": "^17.0.0",
76+
"igniteui-theming": "^17.1.0",
7777
"@igniteui/material-icons-extended": "^3.1.0"
7878
},
7979
"peerDependencies": {

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

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,14 @@
268268
$box-shadow-focus: map.get((
269269
'material': null,
270270
'fluent': null,
271-
'bootstrap': 0 0 0 rem(2px) var-get($theme, 'focus-outline-color'),
271+
'bootstrap': 0 0 0 rem(4px) var-get($theme, 'focus-outline-color'),
272272
'indigo': 0 0 0 rem(3px) var-get($theme, 'focus-outline-color')
273273
), $variant);
274274

275275
$box-shadow-focus-selected: map.get((
276276
'material': null,
277277
'fluent': null,
278-
'bootstrap': 0 0 0 rem(2px) var-get($theme, 'focus-selected-outline-color'),
278+
'bootstrap': 0 0 0 rem(4px) var-get($theme, 'focus-selected-outline-color'),
279279
'indigo': 0 0 0 rem(3px) var-get($theme, 'focus-selected-outline-color')
280280
), $variant);
281281

@@ -378,19 +378,21 @@
378378
}
379379

380380
igx-avatar,
381-
igx-circular-bar,
382381
igx-icon {
383382
--component-size: var(--chip-size);
384383
}
385384

385+
igx-circular-bar {
386+
--diameter: #{sizable(rem(14px), rem(18px), rem(24px))};
387+
}
388+
386389
@if $variant == 'indigo' {
387390
igx-icon {
388391
--size: #{sizable(rem(14px), rem(14px), rem(16px))}
389392
}
390393
}
391394

392-
igx-avatar,
393-
igx-circular-bar {
395+
igx-avatar {
394396
max-height: 100%;
395397
width: sizable(rem(14px), rem(18px), rem(24px));
396398
max-width: sizable(rem(14px), rem(18px), rem(24px));
@@ -427,9 +429,17 @@
427429
%igx-chip%igx-chip--primary {
428430
&:focus {
429431
%igx-chip__item {
430-
color: contrast-color($color: 'primary', $variant: 800);
431-
background: color($color: 'primary', $variant: 800);
432-
border-color: color($color: 'primary', $variant: 800);
432+
@if $variant != 'bootstrap' and $variant != 'indigo' {
433+
color: contrast-color($color: 'primary', $variant: 800);
434+
background: color($color: 'primary', $variant: 800);
435+
border-color: color($color: 'primary', $variant: 800);
436+
}
437+
438+
@if $variant == "bootstrap" {
439+
color: contrast-color($color: 'primary', $variant: 500);
440+
background: color($color: 'primary', $variant: 500);
441+
border-color: color($color: 'primary', $variant: 500);
442+
}
433443

434444
@if $variant == 'indigo' {
435445
color: contrast-color($color: 'primary', $variant: 900);
@@ -439,7 +449,7 @@
439449
}
440450

441451
@if $variant == 'bootstrap' {
442-
box-shadow: 0 0 0 rem(2px) color($color: 'primary', $variant: 200);
452+
box-shadow: 0 0 0 rem(4px) color($color: 'primary', $variant: 500, $opacity: .38);
443453
}
444454
}
445455
}
@@ -472,15 +482,18 @@
472482
background: color($color: 'info', $variant: 800);
473483
border-color: color($color: 'info', $variant: 800);
474484

475-
@if $variant == 'indigo' {
485+
@if $variant == 'indigo' or $variant == 'bootstrap' {
476486
color: contrast-color($color: 'info', $variant: 500);
477487
background: color($color: 'info', $variant: 500);
478488
border-color: color($color: 'info', $variant: 500);
489+
}
490+
491+
@if $variant == 'indigo' {
479492
box-shadow: 0 0 0 rem(3px) color($color: 'info', $variant: if($theme-variant == 'light', 100, 800));
480493
}
481494

482495
@if $variant == 'bootstrap' {
483-
box-shadow: 0 0 0 rem(2px) color($color: 'info', $variant: 200);
496+
box-shadow: 0 0 0 rem(4px) color($color: 'info', $variant: 500, $opacity: .38);
484497
}
485498
}
486499
}
@@ -517,15 +530,19 @@
517530
background: color($color: 'success', $variant: 800);
518531
border-color: color($color: 'success', $variant: 800);
519532

520-
@if $variant == 'indigo' {
521-
color: contrast-color($color: 'success', $variant: 900);
533+
@if $variant == 'indigo' or $variant == 'bootstrap' {
522534
background: color($color: 'success', $variant: 500);
523535
border-color: color($color: 'success', $variant: 500);
524536
box-shadow: 0 0 0 rem(3px) color($color: 'success', $variant: if($theme-variant == 'light', 200, 800));
525537
}
526538

539+
@if $variant == 'indigo' {
540+
color: contrast-color($color: 'success', $variant: 900);
541+
}
542+
527543
@if $variant == 'bootstrap' {
528-
box-shadow: 0 0 0 rem(2px) color($color: 'success', $variant: 200);
544+
color: contrast-color($color: 'success', $variant: 600);
545+
box-shadow: 0 0 0 rem(4px) color($color: 'success', $variant: 500, $opacity: .38);
529546
}
530547
}
531548
}
@@ -558,15 +575,18 @@
558575
background: color($color: 'warn', $variant: 800);
559576
border-color: color($color: 'warn', $variant: 800);
560577

561-
@if $variant == 'indigo' {
578+
@if $variant == 'indigo' or $variant == 'bootstrap' {
562579
color: contrast-color($color: 'warn', $variant: 900);
563580
background: color($color: 'warn', $variant: 500);
564581
border-color: color($color: 'warn', $variant: 500);
582+
}
583+
584+
@if $variant == 'indigo' {
565585
box-shadow: 0 0 0 rem(3px) color($color: 'warn', $variant: if($theme-variant == 'light', 100, 900));
566586
}
567587

568588
@if $variant == 'bootstrap' {
569-
box-shadow: 0 0 0 rem(2px) color($color: 'warn', $variant: 200);
589+
box-shadow: 0 0 0 rem(4px) color($color: 'warn', $variant: 500, $opacity: .38);
570590
}
571591
}
572592
}
@@ -603,15 +623,19 @@
603623
background: color($color: 'error', $variant: 800);
604624
border-color: color($color: 'error', $variant: 800);
605625

606-
@if $variant == 'indigo' {
607-
color: contrast-color($color: 'error', $variant: 900);
626+
@if $variant == 'indigo' or $variant == 'bootstrap' {
608627
background: color($color: 'error', $variant: 500);
609628
border-color: color($color: 'error', $variant: 500);
629+
}
630+
631+
@if $variant == 'indigo' {
632+
color: contrast-color($color: 'error', $variant: 900);
610633
box-shadow: 0 0 0 rem(3px) color($color: 'error', $variant: if($theme-variant == 'light', 100, 900));
611634
}
612635

613636
@if $variant == 'bootstrap' {
614-
box-shadow: 0 0 0 rem(2px) color($color: 'error', $variant: 200);
637+
color: contrast-color($color: 'error', $variant: 600);
638+
box-shadow: 0 0 0 rem(4px) color($color: 'error', $variant: 500, $opacity: .38);
615639
}
616640
}
617641
}

projects/igniteui-angular/src/lib/core/styles/components/tree/_tree-theme.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@
288288
}
289289

290290
igx-circular-bar {
291-
--circular-bar: #{sizable(#{map.get($circular-bar-size, 'compact')}, #{map.get($circular-bar-size, 'cosy')}, #{map.get($circular-bar-size, 'comfortable')})};
292-
width: var(--circular-bar);
293-
height: var(--circular-bar);
291+
--diameter: #{sizable(#{map.get($circular-bar-size, 'compact')}, #{map.get($circular-bar-size, 'cosy')}, #{map.get($circular-bar-size, 'comfortable')})};
294292
}
295293
}
296294

projects/igniteui-angular/src/lib/data-operations/filtering-expressions-tree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export enum FilteringExpressionsTreeType {
88
Advanced
99
}
1010

11+
/* marshalByValue */
1112
export declare interface IExpressionTree {
1213
filteringOperands: (IExpressionTree | IFilteringExpression)[];
1314
operator: FilteringLogic;

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ export class IgxGridForOfDirective<T, U extends T[] = T[]> extends IgxForOfDirec
18001800
changes.forEachItem((item) => {
18011801
if (item.previousIndex !== null &&
18021802
(numRemovedItems < 2 || !identityChanges.length || identityChanges[item.currentIndex])
1803-
&& this.igxForScrollOrientation !== "horizontal") {
1803+
&& this.igxForScrollOrientation !== "horizontal" && this.individualSizeCache.length > 0) {
18041804
// Reuse cache on those who have previousIndex.
18051805
// When there are more than one removed items currently the changes are not readable so ones with identity change
18061806
// should be racalculated.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { getUUID } from './random';
2+
3+
describe('Random (crypto.randomUuid()) fallback unit tests', () => {
4+
let originalRandomUuid = crypto.randomUUID;
5+
6+
beforeAll(() => {
7+
crypto.randomUUID = null; // Mock crypto.randomUUID to simulate a non-secure context
8+
});
9+
10+
it('should generate a valid UUID', () => {
11+
const uuid = getUUID();
12+
expect(uuid).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
13+
});
14+
15+
it('should generate unique UUIDs', () => {
16+
const uuids = new Set();
17+
for (let i = 0; i < 100; i++) {
18+
uuids.add(getUUID());
19+
}
20+
expect(uuids.size).toBe(100); // All UUIDs should be unique
21+
});
22+
23+
afterAll(() => {
24+
crypto.randomUUID = originalRandomUuid; // Restore the original function
25+
});
26+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Use the function to get a random UUID string when secure context is not guaranteed making crypto.randomUUID unavailable.
3+
* @returns A random UUID string.
4+
*/
5+
export function getUUID(): `${string}-${string}-${string}-${string}-${string}` {
6+
if (typeof crypto.randomUUID === 'function') {
7+
return crypto.randomUUID();
8+
}
9+
// Secure fallback using crypto.getRandomValues()
10+
const bytes = new Uint8Array(16);
11+
crypto.getRandomValues(bytes);
12+
13+
// Set version (4) and variant (RFC 4122)
14+
bytes[6] = (bytes[6] & 0x0f) | 0x40; // Version 4
15+
bytes[8] = (bytes[8] & 0x3f) | 0x80; // Variant 1
16+
17+
const a = [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
18+
return `${a.slice(0, 8)}-${a.slice(8, 12)}-${a.slice(12, 16)}-${a.slice(16, 20)}-${a.slice(20)}`;
19+
}

projects/igniteui-angular/src/lib/grids/filtering/excel-style/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { isTree } from '../../../data-operations/expressions-tree-util';
22
import { FilteringLogic, IFilteringExpression } from '../../../data-operations/filtering-expression.interface';
33
import { IFilteringExpressionsTree } from '../../../data-operations/filtering-expressions-tree';
4+
import { getUUID } from '../../common/random';
45

56
/**
67
* @hidden @internal
@@ -30,7 +31,7 @@ export class ExpressionUI {
3031

3132
constructor() {
3233
// Use IDs to identify expressions clearly and use to track them in template @for cycles.
33-
this.expressionId = crypto.randomUUID();
34+
this.expressionId = getUUID();
3435
}
3536
}
3637

0 commit comments

Comments
 (0)