Skip to content

Commit f463c1c

Browse files
authored
Merge branch 'master' into mkirova/fix-7788
2 parents a242175 + f125387 commit f463c1c

File tree

229 files changed

+6164
-1918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+6164
-1918
lines changed

.sassdocrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
"theme": "./node_modules/igniteui-sassdoc-theme/sassdoc/",
1010
"autofill": ["throws", "content"],
1111
"groups": {
12+
"global-themes": "Global Themes",
13+
"component-themes": "Component Themes",
1214
"undefined": "general"
1315
},
1416
"no-update-notifier": false,
1517
"verbose": false,
1618
"strict": false,
1719
"display": {
1820
"alias": true,
19-
"access": ["public", "private"]
21+
"access": ["public"]
2022
},
2123
"privatePrefix": true,
2224
"resolvedValue": true

CHANGELOG.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ All notable changes for each version of this project will be documented in this
77
### General
88
- `igxCombo`
99
- **Behavioral Change** - Change default positioning strategy from `ConnectedPositioningStrategy` to `AutoPositionStrategy`. The [`Auto`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay_position.html#auto) strategy will initially try to show the element like the Connected strategy does. If the element goes out of the viewport Auto will flip the starting point and the direction, i.e. if the direction is 'bottom', it will switch it to 'top' and so on. If after flipping direction the content goes out of the view, auto strategy will revert to initial start point and direction and will push the content into the view. Note after pushing the content it may hide the combo's input.
10+
- Make `onSearchInput` event cancellable. The event args type has been changed to `IComboSearchInputEventArgs`, which have the following properties: `searchText` - holds the text typed into the search input, `owner` - holds a reference to the combo component and `cancel` - indicates whether the event should be canceled.
1011
- `IgxOverlay`
11-
- Added new property - `closeOnEsc` - in `OverlaySettings`. The overlay can now be prevented from closing, on escape keypress, by setting the property to `false`, by default it's `true`.
12+
- Added new property `closeOnEscape` in `OverlaySettings` that controls whether the overlay should close on escape keypress. By default `closeOnEsc` is set to `false`.
13+
- **Behavioral Change** - `modal` overlays shown directly through the Overlay Service no longer close on Escape by default. That behavior can now be specified using the `closeOnEscape` property.
1214
- `igxDialog`
13-
- Added `closeOnEscapeKey` - with it, the dialog can be allowed or prevented from closing when `Esc` is pressed.
15+
- Added `closeOnEscape` - with it, the dialog can be allowed or prevented from closing when `Esc` is pressed.
1416
- `IgxNavbar`:
1517
- **Breaking Changes** - The `igx-action-icon` has been renamed to `igx-navbar-action`. It should get renamed in your components via `ng update`;
1618
- `igxGrid`
@@ -19,6 +21,29 @@ All notable changes for each version of this project will be documented in this
1921
- Removed `onDataPreLoad` event as it is specific for remote virtualization implementation, which is not supported for the `igxTreeGrid`. A more generic `onScroll` event is exposed and can be used instead.
2022
- `IgxTimePicker`
2123
- Added a disabled style for time parts outside of the minimum and maximum range.
24+
- `igxDatePicker`
25+
- Added new property - `editorTabIndex`, that allows setting tabindex for the default editor.
26+
27+
### New Theme
28+
Ignite UI for Angular now has a new theme based on our own design system.
29+
You can use one of the following mixins to include a dark or light indigo theme:
30+
`igx-indigo-light-theme` and `igx-indigo-dark-theme`
31+
32+
We also added two new palettes that go with the new theme, `$light-indigo-palette` and `$dark-indigo-palette`.
33+
34+
The following example shows how you can use the Indigo theme:
35+
36+
```scss
37+
// Light version
38+
.indigo-theme {
39+
@include igx-indigo-light-theme($light-indigo-palette);
40+
}
41+
42+
// Dark version
43+
.indigo-dark-theme {
44+
@include igx-indigo-dark-theme($dark-indigo-palette);
45+
}
46+
```
2247

2348
### New Features
2449
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
@@ -496,7 +521,7 @@ Ignite UI for angular now have a new theme that mimics Microsoft "Fluent" design
496521
Depending on your use case you can use one of the following mixins:
497522
`igx-fluent-theme` and `igx-fluent-dark-theme`
498523

499-
We also added two new pallets that go with the new theme, `$fluent-word-palette` and `$fluent-excel-palette`.
524+
We also added two new palettes that go with the new theme, `$fluent-word-palette` and `$fluent-excel-palette`.
500525

501526
Next example shows how you can use the Fluent theme.
502527

angularDocsPostDeploy.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if([System.IO.File]::Exists($filePath) -and [System.IO.Directory]::Exists($angul
6464
$folders = Get-ChildItem -Path $angularDocsRootFolder -Directory -Exclude $tagFolder,"sass","typescript" -Name | Sort-Object @{Expression = {[double]($_.Substring(0, $_.LastIndexOf('.'))) }};
6565
$textToUpdate = "";
6666
foreach($item in $folders) {
67-
$textToUpdate += '"' + $item.Name + '"';
67+
$textToUpdate += '"' + $item + '"';
6868
}
6969
$textToUpdate = "[" + $textToUpdate.Replace("`"`"","`"`,`"") + "]" ;
7070
Write-Host $textToUpdate;

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { configureTestSuite } from '../test-utils/configure-suite';
1818
import { DisplayDensity } from '../core/density';
1919
import { AbsoluteScrollStrategy, ConnectedPositioningStrategy } from '../services/public_api';
2020
import { IgxSelectionAPIService } from '../core/selection';
21+
import { CancelableEventArgs } from '../core/utils';
2122

2223
const CSS_CLASS_COMBO = 'igx-combo';
2324
const CSS_CLASS_COMBO_DROPDOWN = 'igx-combo__drop-down';
@@ -530,21 +531,42 @@ describe('igxCombo', () => {
530531
expect(matchSpy).toHaveBeenCalledTimes(1);
531532
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(0);
532533

534+
const args = {
535+
searchText: 'Fake',
536+
owner: combo,
537+
cancel: false
538+
};
533539
combo.handleInputChange('Fake');
534540
expect(matchSpy).toHaveBeenCalledTimes(2);
535541
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(1);
536-
expect(combo.onSearchInput.emit).toHaveBeenCalledWith('Fake');
542+
expect(combo.onSearchInput.emit).toHaveBeenCalledWith(args);
537543

544+
args.searchText = '';
538545
combo.handleInputChange('');
539546
expect(matchSpy).toHaveBeenCalledTimes(3);
540547
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(2);
541-
expect(combo.onSearchInput.emit).toHaveBeenCalledWith('');
548+
expect(combo.onSearchInput.emit).toHaveBeenCalledWith(args);
542549

543550
combo.filterable = false;
544551
combo.handleInputChange();
545552
expect(matchSpy).toHaveBeenCalledTimes(4);
546553
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(2);
547554
});
555+
it('should be able to cancel onSearchInput', () => {
556+
combo = new IgxComboComponent({ nativeElement: null }, mockCdr, mockSelection as any, mockComboService, null, mockInjector);
557+
combo.ngOnInit();
558+
combo.data = data;
559+
combo.filterable = true;
560+
combo.onSearchInput.subscribe((e) => {
561+
e.cancel = true;
562+
});
563+
const matchSpy = spyOn<any>(combo, 'checkMatch').and.callThrough();
564+
spyOn(combo.onSearchInput, 'emit').and.callThrough();
565+
566+
combo.handleInputChange('Item1');
567+
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(1);
568+
expect(matchSpy).toHaveBeenCalledTimes(0);
569+
});
548570
});
549571
describe('Initialization and rendering tests: ', () => {
550572
configureTestSuite();

projects/igniteui-angular/src/lib/combo/combo.component.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ export interface IComboSelectionChangeEventArgs extends CancelableEventArgs, IBa
9696
event?: Event;
9797
}
9898

99+
/** Event emitted when the igx-combo's search input changes */
100+
export interface IComboSearchInputEventArgs extends CancelableEventArgs, IBaseEventArgs {
101+
/** The text that has been typed into the search input */
102+
searchText: string;
103+
}
104+
99105
export interface IComboItemAdditionEvent extends IBaseEventArgs {
100106
oldCollection: any[];
101107
addedItem: any;
@@ -483,7 +489,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
483489
* ```
484490
*/
485491
@Output()
486-
public onSearchInput = new EventEmitter();
492+
public onSearchInput = new EventEmitter<IComboSearchInputEventArgs>();
487493

488494
/**
489495
* Emitted when new chunk of data is loaded from the virtualization
@@ -981,7 +987,16 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
981987
*/
982988
public handleInputChange(event?: string) {
983989
if (event !== undefined) {
984-
this.onSearchInput.emit(event);
990+
const args: IComboSearchInputEventArgs = {
991+
searchText: event,
992+
owner: this,
993+
cancel: false
994+
};
995+
this.onSearchInput.emit(args);
996+
if (args.cancel) {
997+
this.searchValue = null;
998+
return;
999+
}
9851000
}
9861001
this.checkMatch();
9871002
}
@@ -1436,8 +1451,8 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
14361451
/** Returns a string that should be populated in the combo's text box */
14371452
private concatDisplayText(selection: any[]): string {
14381453
const value = this.displayKey !== null && this.displayKey !== undefined ?
1439-
this.convertKeysToItems(selection).map(entry => entry[this.displayKey]).join(', ') :
1440-
selection.join(', ');
1454+
this.convertKeysToItems(selection).map(entry => entry[this.displayKey]).join(', ') :
1455+
selection.join(', ');
14411456
return value;
14421457
}
14431458

projects/igniteui-angular/src/lib/core/styles/base/elevations/_index.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,16 @@
150150

151151
@return $result;
152152
}
153+
154+
/// Default elevations.
155+
/// @type Map
156+
/// @prop {Color} $color-1 [rgba(0, 0, 0, .26)] - The color used for the umbra shadow.
157+
/// @prop {Color} $color-2 [rgba(0, 0, 0, .12)] - The color used for the penumbra shadow.
158+
/// @prop {Color} $color-3 [rgba(0, 0, 0, .08)] - The color used for the ambient shadow.
159+
/// @requires igx-elevations
160+
$elevations: igx-elevations(
161+
rgba(0, 0, 0, .26),
162+
rgba(0, 0, 0, .12),
163+
rgba(0, 0, 0, .08)
164+
) !default;
165+

projects/igniteui-angular/src/lib/core/styles/base/utilities/_bem.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,62 +314,71 @@ $bem--sep-mod-val: if(variable-exists(bem--sep-mod-val), $bem--sep-mod-val, '-')
314314
}
315315

316316
/// @alias bem-selector
317+
/// @see bem-selector
317318
@mixin bem($block, $e: null, $elem: null, $m: null, $mod: null, $mods: null) {
318319
#{bem-selector($block, $e: $e, $elem: $elem, $m: $m, $mod: $mod, $mods: $mods)} {
319320
@content;
320321
}
321322
}
322323

323324
/// @alias bem-block
325+
/// @see bem-block
324326
@mixin block($block) {
325327
@include bem-block($block) {
326328
@content;
327329
}
328330
}
329331

330332
/// @alias bem-elem
333+
/// @see bem-elem
331334
@mixin elem($elem, $m: null, $mod: null, $mods: null) {
332335
@include bem-elem($elem, $m: $m, $mod: $mod, $mods: $mods) {
333336
@content;
334337
}
335338
}
336339

337340
/// @alias bem-mod
341+
/// @see bem-mod
338342
@mixin mod($mod) {
339343
@include bem-mod($mod) {
340344
@content;
341345
}
342346
}
343347

344348
/// @alias bem-mods
349+
/// @see bem-mods
345350
@mixin mods($mods...) {
346351
@include bem-mods($mods...) {
347352
@content;
348353
}
349354
}
350355

351356
/// @alias bem-block
357+
/// @see bem-block
352358
@mixin b($block) {
353359
@include bem-block($block) {
354360
@content;
355361
}
356362
}
357363

358364
/// @alias bem-elem
365+
/// @see bem-elem
359366
@mixin e($elem, $m: null, $mod: null, $mods: null) {
360367
@include bem-elem($elem, $m: $m, $mod: $mod, $mods: $mods) {
361368
@content;
362369
}
363370
}
364371

365372
/// @alias bem-mod
373+
/// @see bem-mod
366374
@mixin m($mod) {
367375
@include bem-mod($mod) {
368376
@content;
369377
}
370378
}
371379

372380
/// @alias bem-mods
381+
/// @see bem-mods
373382
@mixin mx($mods...) {
374383
@include bem-mods($mods...) {
375384
@content;

projects/igniteui-angular/src/lib/core/styles/base/utilities/_functions.scss

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,51 @@
143143
@return $rgba;
144144
}
145145

146+
/// Converts a rgba color to a hexidecimal color.
147+
///
148+
/// An alias of hexrgba.
149+
/// @access public
150+
/// @alias hexrgba
151+
/// @see hexrgba
152+
@function to-opaque($rgba, $background: #fff) {
153+
@return hexrgba($rgba, $background);
154+
}
155+
146156
/// Returns a contrast color for a passed color.
147157
/// @access public
148158
/// @group Palettes
149-
/// @param {Color} $color - The color used to return a contrast color for.
159+
/// @param {Color} $background - The background color used to return a contrast/forground color for.
160+
/// @param {Color} $foreground - The foreground color used in case it has enough contrast against the provided background.
161+
/// @param {String} $contrast - The contrast level according to WCAG 2.0 standards.
150162
/// @returns {Color} - Returns either white or black depending on the luminance of the input color.
151-
@function text-contrast($color) {
152-
@if type-of($color) == 'color' {
153-
$lightContrast: contrast($color, white);
154-
$darkContrast: contrast($color, black);
163+
/// @link https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html
164+
@function text-contrast($background, $foreground: white, $contrast: 'AAA') {
165+
@if type-of($foreground) == 'color' and type-of($background) == 'color' {
166+
$level: map-get((
167+
'A': 3,
168+
'AA': 4.5,
169+
'AAA': 7
170+
), $contrast);
171+
172+
@if $level == null {
173+
@error "$contrast must be 'A', 'AA', or 'AAA'";
174+
}
155175

156-
@if ($lightContrast > $darkContrast) {
157-
@return white;
176+
@if contrast($background, $foreground) >= $level {
177+
@return $foreground;
158178
} @else {
159-
@return black;
179+
$lightContrast: contrast($background, white);
180+
$darkContrast: contrast($background, black);
181+
182+
@if ($lightContrast > $darkContrast) {
183+
@return white;
184+
} @else {
185+
@return black;
186+
}
160187
}
188+
} @else {
189+
@error 'Expected color for $background/$foreground but got #{$background}/#{$foreground}';
161190
}
162-
@return $color;
163191
}
164192

165193
/// Retrieves a contrast text color for a given color from a color palette.
@@ -171,7 +199,7 @@
171199
/// @requires igx-color
172200
/// @requires text-contrast
173201
/// @requires hexrgba
174-
/// @returns {Color} [#fff] - Returns white if now palette, color and/or variant matches found.
202+
/// @returns {Color} [#fff] - Returns white if no palette, color and/or variant matches found.
175203
@function igx-contrast-color($palette, $color, $variant: 500) {
176204
$_color: igx-color($palette, $color, $variant);
177205
@if $_color {
@@ -249,7 +277,7 @@
249277
}
250278

251279
/// Extends a Map object with the properties of another Map object.
252-
/// @access private
280+
/// @access public
253281
/// @param {Map...} $maps - The source map to get extended.
254282
/// @returns {Map} - Returns the merged maps.
255283
@function extend($maps...) {
@@ -311,6 +339,7 @@
311339
/// @param {Color} $error [#ff134a] - The error color used throughout the application.
312340
/// @param {Color} $grays [#000 | $igx-foreground-color] - The color used for generating the grays palette.
313341
/// @param {Color} $surface [#fff] - The color used as a background in components, such as cards, sheets, and menus.
342+
/// @param {String} $variant ['material'] - The palette variant that gets generated. Possible values are: 'material', 'fluent', 'bootstrap', and 'indigo-design'.
314343
/// @returns {Map} - A map consisting of 74 color variations, including the `primary`, `secondary`, `grays`,
315344
/// `info`, `success`, `warn`, and `error` colors.
316345
@function igx-palette(
@@ -321,10 +350,17 @@
321350
$warn: #fbb13c,
322351
$error: #ff134a,
323352
$grays: #000,
324-
$surface: #fff
353+
$surface: #fff,
354+
$variant: 'material'
325355
) {
326356
$saturations: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 'A100', 'A200', 'A400', 'A700');
327-
$shades: (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87);
357+
358+
$shades: map-get((
359+
'material': (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87),
360+
'fluent': (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87),
361+
'bootstrap': (50: .02, 100: .04, 200: .08, 300: .12, 400: .26, 500: .38, 600: .54, 700: .62, 800: .74, 900: .87),
362+
'indigo-design': (50: .02, 100: .03, 200: .06, 300: .15, 400: .21, 500: .4, 600: .52, 700: .64, 800: .77, 900: .9),
363+
), $variant);
328364

329365
$primary-palette: generate-palette($primary, $saturations);
330366
$secondary-palette: generate-palette($secondary, $saturations);
@@ -420,6 +456,8 @@
420456
@if function-exists($fn) {
421457
@if $result == null and ($fn == 'igx-color' or $fn == 'igx-contrast-color') {
422458
$result: call(get-function($fn), $extra, $args...);
459+
} @else if ($fn == 'hexrgba' or $fn == 'to-opaque') and type-of($args) == 'map' {
460+
$result: call(get-function($fn), $result, resolve-value($ctx: $args, $extra: $extra));
423461
} @else if $result != null {
424462
$result: call(get-function($fn), $result, $args...);
425463
} @else {

0 commit comments

Comments
 (0)