Skip to content

Commit cc749c4

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into ddincheva/calendarKB
2 parents 9bf6560 + c95aa85 commit cc749c4

34 files changed

+429
-185
lines changed

CHANGELOG.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ All notable changes for each version of this project will be documented in this
44
## 10.2.0
55

66
### General
7-
- `IgxDatePicker`
8-
- Added `aria-labelledby` property for the input field. This will ensure the users of assistive technologies will also know what component is used for, upon input focus.
7+
- `IgxGridActions`
8+
- Added `asMenuItems` Input for grid actions - `igx-grid-editing-actions`, `igx-grid-pinning-actions`. When set to true will render the related action buttons as separate menu items with button and label.
99
- `IgxInputGroup`
1010
- **Breaking Change** - Removed `fluent`, `fluent_search`, `bootstrap`, and `indigo` as possible values for the `type` input property.
1111
- **Behavioral Change** - The styling of the input group is now dictated by the theme being used. The remaining `types` - `line`, `border`, and `box` will only have effect on the styling when used with the `material` theme. The `search` type will affect styling when used with all themes. Changing the theme at runtime will not change the styling of the input group, a page refresh is required.
1212
- `IgxOverlay`
1313
- **Breaking Change** - `target` property in `PositionSettings` has been deprecated. You can set the attaching target for the component to show in `OverlaySettings` instead.
14+
- `IgxToggleDirective`
15+
- `onAppended`, `onOpened` and `onClosed` events are emitting now arguments of `ToggleViewEventArgs` type.
16+
- `onOpening` and `onClosing` events are emitting now arguments of `ToggleViewCancelableEventArgs` type.
1417
- `IgxSelect`
1518
- Added `aria-labelledby` property for the items list container(marked as `role="listbox"`). This will ensure the users of assistive technologies will also know what the list items container is used for, upon opening.
1619
- `IgxDatePicker`
1720
- **Breaking Change** - Deprecated the `label` property.
18-
- `igxGridActions`
19-
- Added `asMenuItems` Input for grid actions - `igx-grid-editing-actions`, `igx-grid-pinning-actions`. When set to true will render the related action buttons as separate menu items with button and label.
21+
- Added `aria-labelledby` property for the input field. This will ensure the users of assistive technologies will also know what component is used for, upon input focus.
22+
- `igxNavigationDrawer`
23+
- Added `disableAnimation` property which enables/disables the animation, when toggling the drawer. Set to `false` by default.
24+
- `igxTabs`
25+
- Added `disableAnimation` property which enables/disables the transition animation of the tabs' content. Set to `false` by default.
26+
- `IgxExpansionPanel`
27+
- `IExpansionPanelEventArgs.panel` - Deprecated. Usе `owner` property to get a reference to the panel.
2028

2129

2230
### New Features
@@ -54,6 +62,9 @@ All notable changes for each version of this project will be documented in this
5462
- The component now utilizes the `IgxOverlayService` to position itself in the DOM.
5563
- An additional input property `outlet` has been added to allow users to specify custom Overlay Outlets using the `IgxOverlayOutletDirective`;
5664
- The `position` property now accepts values of type `IgxToastPosition` that work with strict templates.
65+
- `IgxExpansionPanelHeader`
66+
- `onInteraction` is now cancelable
67+
- Added `iconRef` property. This can be used to get a reference to the displayed expand/collapsed indicator. Returns `null` if `iconPosition` is set to `NONE`.
5768

5869
## 10.1.0
5970

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

+32-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { DisplayDensity } from '../core/density';
1919
import { AbsoluteScrollStrategy, ConnectedPositioningStrategy } from '../services/public_api';
2020
import { IgxSelectionAPIService } from '../core/selection';
2121
import { IgxIconService } from '../icon/public_api';
22-
import { CancelableEventArgs } from '../core/utils';
2322

2423
const CSS_CLASS_COMBO = 'igx-combo';
2524
const CSS_CLASS_COMBO_DROPDOWN = 'igx-combo__drop-down';
@@ -602,6 +601,38 @@ describe('igxCombo', () => {
602601
expect(combo.onSearchInput.emit).toHaveBeenCalledTimes(1);
603602
expect(matchSpy).toHaveBeenCalledTimes(1);
604603
});
604+
it('should not open on click if combo is disabled', () => {
605+
combo = new IgxComboComponent(elementRef, mockCdr, mockSelection as any, mockComboService,
606+
mockIconService, null, null, mockInjector);
607+
const dropdown = jasmine.createSpyObj('IgxComboDropDownComponent', ['open', 'close', 'toggle']);
608+
const spyObj = jasmine.createSpyObj('event', ['stopPropagation', 'preventDefault']);
609+
spyOn(mockIconService, 'addSvgIconFromText').and.returnValue(null);
610+
combo.ngOnInit();
611+
combo.dropdown = dropdown;
612+
dropdown.collapsed = true;
613+
614+
combo.disabled = true;
615+
combo.onInputClick(spyObj);
616+
expect(combo.dropdown.collapsed).toBeTruthy();
617+
});
618+
it('should not clear value when combo is disabled', () => {
619+
const selectionService = new IgxSelectionAPIService();
620+
combo = new IgxComboComponent(elementRef, mockCdr, selectionService, mockComboService,
621+
mockIconService, null, null, mockInjector);
622+
const dropdown = jasmine.createSpyObj('IgxComboDropDownComponent', ['selectItem']);
623+
const spyObj = jasmine.createSpyObj('event', ['stopPropagation']);
624+
spyOn(mockIconService, 'addSvgIconFromText').and.returnValue(null);
625+
combo.ngOnInit();
626+
combo.data = data;
627+
combo.dropdown = dropdown;
628+
combo.disabled = true;
629+
spyOnProperty(combo, 'totalItemCount').and.returnValue(combo.data.length);
630+
631+
const item = combo.data.slice(0, 1);
632+
combo.selectItems(item, true);
633+
combo.handleClearItems(spyObj);
634+
expect(combo.value).toEqual(item[0]);
635+
});
605636
});
606637
describe('Initialization and rendering tests: ', () => {
607638
configureTestSuite();
@@ -2541,13 +2572,6 @@ describe('igxCombo', () => {
25412572
expect(combo.valid).toEqual(IgxComboState.INITIAL);
25422573
expect(combo.comboInput.valid).toEqual(IgxInputState.INITIAL);
25432574
});
2544-
it('should not open on click if combo is disabled', () => {
2545-
combo.disabled = true;
2546-
fixture.detectChanges();
2547-
UIInteractions.simulateClickEvent(combo.comboInput.nativeElement);
2548-
fixture.detectChanges();
2549-
expect(combo.dropdown.collapsed).toBeTruthy();
2550-
});
25512575
it('should be possible to be enabled/disabled when used as a form control', () => {
25522576
const form = fixture.componentInstance.reactiveForm;
25532577
const comboFormReference = form.controls.townCombo;

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

+3
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,9 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
13241324
* @hidden @internal
13251325
*/
13261326
public handleClearItems(event: Event): void {
1327+
if (this.disabled) {
1328+
return;
1329+
}
13271330
this.deselectAllItems(true, event);
13281331
if (this.collapsed) {
13291332
this.getEditElement().focus();

projects/igniteui-angular/src/lib/core/styles/components/action-strip/_action-strip-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
55
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
66
////
7-
///
7+
88
/// If only background color is specified, text/icon color will be assigned automatically to a contrasting color.
99
/// @param {Map} $palette [$default-palette] - The palette used as basis for styling the component.
1010
/// @param {Map} $schema [$light-schema] - The schema used as basis for styling the component.

projects/igniteui-angular/src/lib/core/styles/components/navdrawer/_navdrawer-component.scss

+4
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@
8484
@include e(item, header) {
8585
@extend %item--header !optional;
8686
}
87+
88+
@include m(disable-animation) {
89+
@extend %disable-animation !optional;
90+
}
8791
}

projects/igniteui-angular/src/lib/core/styles/components/navdrawer/_navdrawer-theme.scss

+4
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@
434434
transition: none;
435435
visibility: hidden;
436436
}
437+
438+
%disable-animation {
439+
transition-duration: 0s;
440+
}
437441
}
438442

439443
/// Adds typography styles for the igx-navdrawer component.

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.component.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ describe('IgxDateRangePicker', () => {
410410
verifyDateRangeInSingleInput();
411411
expect(dateRange.collapsed).toBeTruthy();
412412
expect(dateRange.onClosing.emit).toHaveBeenCalledTimes(1);
413-
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ cancel: false, event: undefined });
413+
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ owner: dateRange, cancel: false, event: undefined });
414414
expect(dateRange.onClosed.emit).toHaveBeenCalledTimes(1);
415415
expect(dateRange.onClosed.emit).toHaveBeenCalledWith({ owner: dateRange });
416416
}));
@@ -473,7 +473,7 @@ describe('IgxDateRangePicker', () => {
473473
fixture.detectChanges();
474474
expect(dateRange.collapsed).toBeFalsy();
475475
expect(dateRange.onOpening.emit).toHaveBeenCalledTimes(1);
476-
expect(dateRange.onOpening.emit).toHaveBeenCalledWith({ cancel: false });
476+
expect(dateRange.onOpening.emit).toHaveBeenCalledWith({ owner: dateRange, cancel: false, event: undefined });
477477
expect(dateRange.onOpened.emit).toHaveBeenCalledTimes(1);
478478
expect(dateRange.onOpened.emit).toHaveBeenCalledWith({ owner: dateRange });
479479

@@ -490,7 +490,7 @@ describe('IgxDateRangePicker', () => {
490490
verifyDateRangeInSingleInput();
491491
expect(dateRange.collapsed).toBeTruthy();
492492
expect(dateRange.onClosing.emit).toHaveBeenCalledTimes(1);
493-
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ cancel: false, event: undefined });
493+
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ owner: dateRange, cancel: false, event: undefined });
494494
expect(dateRange.onClosed.emit).toHaveBeenCalledTimes(1);
495495
expect(dateRange.onClosed.emit).toHaveBeenCalledWith({ owner: dateRange });
496496
}));
@@ -506,7 +506,7 @@ describe('IgxDateRangePicker', () => {
506506
fixture.detectChanges();
507507
expect(dateRange.collapsed).toBeFalsy();
508508
expect(dateRange.onOpening.emit).toHaveBeenCalledTimes(1);
509-
expect(dateRange.onOpening.emit).toHaveBeenCalledWith({ cancel: false });
509+
expect(dateRange.onOpening.emit).toHaveBeenCalledWith({ owner: dateRange, cancel: false, event: undefined });
510510
expect(dateRange.onOpened.emit).toHaveBeenCalledTimes(1);
511511
expect(dateRange.onOpened.emit).toHaveBeenCalledWith({ owner: dateRange });
512512

@@ -522,7 +522,7 @@ describe('IgxDateRangePicker', () => {
522522
fixture.detectChanges();
523523
expect(dateRange.collapsed).toBeTruthy();
524524
expect(dateRange.onClosing.emit).toHaveBeenCalledTimes(1);
525-
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ cancel: false, event: undefined });
525+
expect(dateRange.onClosing.emit).toHaveBeenCalledWith({ owner: dateRange, cancel: false, event: undefined });
526526
expect(dateRange.onClosed.emit).toHaveBeenCalledTimes(1);
527527
expect(dateRange.onClosed.emit).toHaveBeenCalledWith({ owner: dateRange });
528528
}));

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.component.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,12 @@ export class IgxDateRangePickerComponent extends DisplayDensityBase
659659

660660
/** @hidden @internal */
661661
public handleOpening(event: CancelableBrowserEventArgs & IBaseEventArgs): void {
662-
this.onOpening.emit(event);
663-
this._collapsed = false;
662+
const args = { owner: this, cancel: event.cancel, event: event.event };
663+
this.onOpening.emit(args);
664+
event.cancel = args.cancel;
665+
if (!args.cancel) {
666+
this._collapsed = false;
667+
}
664668
}
665669

666670
/** @hidden @internal */
@@ -675,7 +679,12 @@ export class IgxDateRangePickerComponent extends DisplayDensityBase
675679
this.value = null;
676680
}
677681

678-
this.onClosing.emit(event);
682+
const args = { owner: this, cancel: event.cancel, event: event.event };
683+
this.onClosing.emit(args);
684+
event.cancel = args.cancel;
685+
if (args.cancel) {
686+
return;
687+
}
679688

680689
if (this.mode === InteractionMode.DropDown && event.event && !this.element.nativeElement.contains(event.event.target)) {
681690
// outside click

projects/igniteui-angular/src/lib/directives/toggle/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ handlers when the toggle is opened and respectively closed.
2929
```html
3030
<button (click)="toggleRef.toggle()">Toggle</button>
3131
<div igxToggle #toggleRef="toggle"
32-
(onOpening)="eventHandler()" (onAppended)="eventHandler()" (onOpened)="eventHandler()"
33-
(onClosing)="eventHandler()" (onClosed)="eventHandler()" >
32+
(onOpening)="eventHandler($event)" (onAppended)="eventHandler($event)" (onOpened)="eventHandler($event)"
33+
(onClosing)="eventHandler($event)" (onClosed)="eventHandler($event)" >
3434
<p>Some content that user would like to make it togglable.</p>
3535
</div>
3636
```
@@ -40,11 +40,11 @@ handlers when the toggle is opened and respectively closed.
4040
### Outputs
4141
| Name | Return Type | Description |
4242
|:--:|:---|:---|
43-
| `onAppended` | `void` | Emits an event after content is appended to the overlay. |
44-
| `onOpening` | `void` | Emits an event before the toggle container is opened. |
45-
| `onOpened` | `void` | Emits an event after the toggle container is opened. |
46-
| `onClosing` | `void` | Emits an event before the toggle container is closed. |
47-
| `onClosed` | `void` | Emits an event after the toggle container is closed. |
43+
| `onAppended` | `ToggleViewEventArgs` | Emits an event after content is appended to the overlay. |
44+
| `onOpening` | `ToggleViewCancelableEventArgs` | Emits an event before the toggle container is opened. |
45+
| `onOpened` | `ToggleViewEventArgs` | Emits an event after the toggle container is opened. |
46+
| `onClosing` | `ToggleViewCancelableEventArgs` | Emits an event before the toggle container is closed. |
47+
| `onClosed` | `ToggleViewEventArgs` | Emits an event after the toggle container is closed. |
4848
### Methods
4949
| Name | Arguments | Return Type | Description |
5050
|:----------:|:------|:------|:------|

projects/igniteui-angular/src/lib/directives/toggle/toggle.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ describe('IgxToggle', () => {
573573
fixture.detectChanges();
574574

575575
expect(toggle.onClosing.emit).toHaveBeenCalledTimes(1);
576-
expect(toggle.onClosing.emit).toHaveBeenCalledWith({ cancel: false, event: new Event('click') });
576+
expect(toggle.onClosing.emit).toHaveBeenCalledWith({ id: '0', owner: toggle, cancel: false, event: new Event('click') });
577577
expect(toggle.onClosed.emit).toHaveBeenCalledTimes(1);
578578
}));
579579

0 commit comments

Comments
 (0)