Skip to content

Commit 0d03ebb

Browse files
MKirovaMKirova
authored andcommitted
chore(*): merge from base
2 parents 860fcea + d645faa commit 0d03ebb

24 files changed

+432
-45
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,22 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
460460
});
461461
};
462462

463-
this.viewButtons.changes.pipe(takeUntil(this.queryListNotifier$)).subscribe(() => initButtons());
464-
this.templateButtons.changes.pipe(takeUntil(this.queryListNotifier$)).subscribe(() => initButtons());
465-
initButtons();
466-
467-
this._cdr.detectChanges();
468-
469463
this.mutationObserver = this.setMutationsObserver();
470464

471-
this.mutationObserver.observe(this._el.nativeElement, this.observerConfig);
465+
this.viewButtons.changes.pipe(takeUntil(this.queryListNotifier$)).subscribe(() => {
466+
this.mutationObserver.disconnect();
467+
initButtons();
468+
this.mutationObserver?.observe(this._el.nativeElement, this.observerConfig);
469+
});
470+
this.templateButtons.changes.pipe(takeUntil(this.queryListNotifier$)).subscribe(() => {
471+
this.mutationObserver.disconnect();
472+
initButtons();
473+
this.mutationObserver?.observe(this._el.nativeElement, this.observerConfig);
474+
});
475+
476+
initButtons();
477+
this._cdr.detectChanges();
478+
this.mutationObserver?.observe(this._el.nativeElement, this.observerConfig);
472479
}
473480

474481
/**

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,6 @@
257257

258258
$variant: map.get($theme, '_meta', 'variant');
259259

260-
$chip-height: (
261-
comfortable: rem(32px),
262-
cosy: rem(24px),
263-
compact: rem(20px)
264-
);
265-
266260
$chip-padding: (
267261
comfortable: rem(12px),
268262
cosy: rem(6px),

projects/igniteui-angular/src/lib/core/styles/components/query-builder/_query-builder-theme.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,20 @@
213213
);
214214
}
215215

216-
> igx-chip igx-prefix {
217-
display: flex;
216+
> igx-chip {
217+
@if $variant != 'indigo-design' {
218+
.igx-chip__item {
219+
border-block: none;
220+
}
221+
}
222+
223+
.igx-filter-tree__expression-column {
224+
padding-inline: pad-inline(rem(3px), rem(6px), rem(8px));
225+
}
226+
227+
igx-prefix {
228+
display: flex;
229+
}
218230
}
219231
}
220232

projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,26 @@ describe('IgxDateTimeEditor', () => {
378378
inputElement = fixture.debugElement.query(By.css('input'));
379379
dateTimeEditorDirective = inputElement.injector.get(IgxDateTimeEditorDirective);
380380
});
381+
381382
it('should properly update mask with inputFormat onInit', () => {
382383
fixture = TestBed.createComponent(IgxDateTimeEditorBaseTestComponent);
383384
fixture.detectChanges();
384385
expect(fixture.componentInstance.dateEditor.elementRef.nativeElement.value).toEqual('09/11/2009');
385386
});
387+
388+
it('should update value and mask according to the display format and ISO string date as value', () => {
389+
fixture.componentInstance.dateTimeFormat = 'dd/MM/yy';
390+
fixture.componentInstance.displayFormat = 'shortDate';
391+
dateTimeEditorDirective.value = new Date(2003, 3, 5).toISOString();
392+
fixture.detectChanges();
393+
inputElement.triggerEventHandler('focus', {});
394+
fixture.detectChanges();
395+
expect(dateTimeEditorDirective.mask).toEqual('00/00/00');
396+
expect(inputElement.nativeElement.value).toEqual('05/04/03');
397+
UIInteractions.simulateTyping('1', inputElement);
398+
expect(inputElement.nativeElement.value).toEqual('15/04/03');
399+
});
400+
386401
it('should correctly display input format during user input', () => {
387402
fixture.componentInstance.dateTimeFormat = 'dd/MM/yy';
388403
fixture.detectChanges();

projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
9090
@Input()
9191
public set minValue(value: string | Date) {
9292
this._minValue = value;
93-
this.onValidatorChange();
93+
this._onValidatorChange();
9494
}
9595

9696
/**
@@ -111,7 +111,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
111111
@Input()
112112
public set maxValue(value: string | Date) {
113113
this._maxValue = value;
114-
this.onValidatorChange();
114+
this._onValidatorChange();
115115
}
116116

117117
/**
@@ -166,14 +166,14 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
166166
* ```
167167
*/
168168
@Input()
169-
public set value(value: Date | string) {
169+
public set value(value: Date | string | undefined | null) {
170170
this._value = value;
171171
this.setDateValue(value);
172172
this.onChangeCallback(value);
173173
this.updateMask();
174174
}
175175

176-
public get value(): Date | string {
176+
public get value(): Date | string | undefined | null {
177177
return this._value;
178178
}
179179

@@ -218,7 +218,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
218218
private document: Document;
219219
private _isFocused: boolean;
220220
private _defaultInputFormat: string;
221-
private _value: Date | string;
221+
private _value?: Date | string;
222222
private _minValue: Date | string;
223223
private _maxValue: Date | string;
224224
private _inputDateParts: DatePartInfo[];
@@ -230,9 +230,9 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
230230
minutes: 1,
231231
seconds: 1
232232
};
233-
private onTouchCallback: (...args: any[]) => void = noop;
233+
234234
private onChangeCallback: (...args: any[]) => void = noop;
235-
private onValidatorChange: (...args: any[]) => void = noop;
235+
private _onValidatorChange: (...args: any[]) => void = noop;
236236

237237
private get datePartDeltas(): DatePartDeltas {
238238
return Object.assign({}, this._datePartDeltas, this.spinDelta);
@@ -392,7 +392,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
392392

393393
/** @hidden @internal */
394394
public registerOnValidatorChange?(fn: () => void): void {
395-
this.onValidatorChange = fn;
395+
this._onValidatorChange = fn;
396396
}
397397

398398
/** @hidden @internal */
@@ -402,7 +402,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
402402

403403
/** @hidden @internal */
404404
public override registerOnTouched(fn: any): void {
405-
this.onTouchCallback = fn;
405+
this._onTouchedCallback = fn;
406406
}
407407

408408
/** @hidden @internal */
@@ -472,7 +472,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
472472
return;
473473
}
474474
this._isFocused = true;
475-
this.onTouchCallback();
475+
this._onTouchedCallback();
476476
this.updateMask();
477477
super.onFocus();
478478
this.nativeElement.select();
@@ -552,7 +552,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
552552

553553
private getMaskedValue(): string {
554554
let mask = this.emptyMask;
555-
if (DateTimeUtil.isValidDate(this.value)) {
555+
if (DateTimeUtil.isValidDate(this.value) || DateTimeUtil.parseIsoDate(this.value)) {
556556
for (const part of this._inputDateParts) {
557557
if (part.type === DatePart.Literal) {
558558
continue;

projects/igniteui-angular/src/lib/directives/mask/mask.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
143143

144144
private readonly defaultMask = 'CCCCCCCCCC';
145145

146-
private _onTouchedCallback: () => void = noop;
146+
protected _onTouchedCallback: () => void = noop;
147147
private _onChangeCallback: (_: any) => void = noop;
148148

149149
constructor(

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
4848
* ```html
4949
* <div
5050
* igxToggle
51-
* (onOpened)='onToggleOpened($event)'>
51+
* (opened)='onToggleOpened($event)'>
5252
* </div>
5353
* ```
5454
*/
@@ -67,7 +67,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
6767
* ```html
6868
* <div
6969
* igxToggle
70-
* (onOpening)='onToggleOpening($event)'>
70+
* (opening)='onToggleOpening($event)'>
7171
* </div>
7272
* ```
7373
*/
@@ -86,7 +86,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
8686
* ```html
8787
* <div
8888
* igxToggle
89-
* (onClosed)='onToggleClosed($event)'>
89+
* (closed)='onToggleClosed($event)'>
9090
* </div>
9191
* ```
9292
*/
@@ -124,7 +124,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
124124
* ```html
125125
* <div
126126
* igxToggle
127-
* (onAppended)='onToggleAppended()'>
127+
* (appended)='onToggleAppended()'>
128128
* </div>
129129
* ```
130130
*/
@@ -376,7 +376,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
376376

377377
// in case event is not canceled this will close the toggle and we need to unsubscribe.
378378
// Otherwise if for some reason, e.g. close on outside click, close() gets called before
379-
// onClosed was fired we will end with calling onClosing more than once
379+
// closed was fired we will end with calling closing more than once
380380
if (!e.cancel) {
381381
this.clearSubscription(this._overlayClosingSub);
382382
}

projects/igniteui-angular/src/lib/grids/common/crud.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ export class IgxRowCrudState extends IgxCellCrudState {
421421
nonCancelableArgs = this.rowEditDone(rowEditArgs.oldValue, event);
422422
} else {
423423
const rowAddArgs = this.row.createEditEventArgs(true, event);
424+
rowAddArgs.rowData = this.row.newData ?? this.row.data;
424425
this.grid.rowAdd.emit(rowAddArgs);
425426
if (rowAddArgs.cancel) {
426427
return rowAddArgs;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ export class IgxExcelStyleSearchComponent implements AfterViewInit, OnDestroy {
234234
});
235235
esf.columnChange.pipe(takeUntil(this.destroy$)).subscribe(() => {
236236
this.virtDir?.resetScrollPosition();
237+
238+
if (this.virtDir) {
239+
this.virtDir.state.startIndex = 0;
240+
}
237241
});
238242

239243
esf.listDataLoaded.pipe(takeUntil(this.destroy$)).subscribe(() => {

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3213,7 +3213,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
32133213
/**
32143214
* @hidden @internal
32153215
*/
3216-
public get template(): TemplateRef<any> {
3216+
public get template(): TemplateRef<IgxGridTemplateContext> {
32173217
if (this.isLoading && (this.hasZeroResultFilter || this.hasNoData)) {
32183218
return this.loadingGridTemplate ? this.loadingGridTemplate : this.loadingGridDefaultTemplate;
32193219
}

0 commit comments

Comments
 (0)