Skip to content

Commit 9f0aeeb

Browse files
authored
Merge branch 'master' into 12.0.x
2 parents a91bfbc + 602f972 commit 9f0aeeb

File tree

9 files changed

+159
-92
lines changed

9 files changed

+159
-92
lines changed

CHANGELOG.md

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,19 @@ All notable changes for each version of this project will be documented in this
6161
- `onDataPreLoad` -> `dataPreLoad`
6262
- `IgxInputGroupComponent`
6363
- **Breaking Change** - `disabled` property removed. Use the underlying `IgxInputDirective.disabled` to control the disabled state of the input group. Please make sure to update via `ng update` to migrate an usage of `disabled` in your template files. Please make sure to check out the [update guide](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general/update-guide#from-111x-to-120x).
64-
6564
- `IgxDateTimeEditor`
66-
- **Feature** - `value` accepts ISO 8601 string format.
67-
- **Breaking Change** - `value` type could be `Date` or `string`.
6865
- **Breaking Change** - `onValueChange` event is renamed to `valueChange`.
6966
- **Breaking Change** - `isSpinLoop` property is renamed to `spinLoop`.
70-
- **Feature** - `spinDelta` input property which allows a user to provide different delta values that will be used for spinning. All parts default to `1`.
71-
- `increment` and `decrement` methods now accept an optional `delta` parameter which targets the currently spun date portion. It takes precedence over the values set in `spinDelta`.
7267
- `IgxDatePicker`
73-
- **Feature** - `value` accepts ISO 8601 string format.
74-
- **Feature** - The actions template now exposes the Calendar component as implicit context:
75-
```html
76-
<igx-date-picker>
77-
<ng-template igxPickerActions let-calendar>
78-
<button igxButton="flat" (click)="calendar.viewDate = today">Today</button>
79-
</ng-template>
80-
</igx-date-picker>
81-
```
82-
- **Breaking Change** - `value` type could be `Date` or `string`.
8368
- **Breaking Change** - `onSelection` event is renamed to `valueChange`.
84-
- **Breaking Change** - new way to define custom elements in the `igx-date-picker` while the following properties are deleted or deprecated: `formatter`, `context`, `labelInternal`, `template`.
69+
- **Breaking Change** - new way to define custom elements in the `igx-date-picker` while the following properties are deleted or deprecated: `context`, `labelInternal`, `template`.
8570
```html
86-
<igx-date-picker #datePicker [(value)]="date" [displayFormat]="'longDate'" [inputFormat]="dd/MM/yyyy">
71+
<igx-date-picker #datePicker [(value)]="date" [displayFormat]="'longDate'" [inputFormat]="'dd/MM/yyyy'">
8772
<label igxLabel>Date: </label>
88-
<igx-picker-toggle igxPrefix (click)="datePicker.toggle()">
73+
<igx-picker-toggle igxPrefix>
8974
calendar_view_day
9075
</igx-picker-toggle>
91-
<igx-picker-clear igxSuffix (click)="datePicker.clear()">
76+
<igx-picker-clear igxSuffix>
9277
delete
9378
</igx-picker-clear>
9479
</igx-date-picker>
@@ -99,22 +84,23 @@ All notable changes for each version of this project will be documented in this
9984
- **Breaking Change** - `monthsViewNumber` is renamed to `displayMonthsCount`.
10085
- **Breaking Change** - `vertical` is renamed to `headerOrientation`.
10186
- **Breaking Change** - `displayData` is renamed to `displayFormat`.
102-
- **Breaking Change** - `dropDownOverlaySettings` and `modalOverlaySettings` are replaced by the `overlaySettings`.
87+
- **Breaking Change** - `dropDownOverlaySettings` and `modalOverlaySettings` are replaced by `overlaySettings`.
10388
- **Breaking Change** - `onValidationFailed` event is renamed to `validationFailed`.
10489
- **Breaking Change** - `onDisabledDate` event is removed.
10590
- **Breaking Change** - `onOpening`, `onOpened`, `onClosing` and `onClosed` events are renamed respectively to `opening`, `opened`, `closing` and `closed`.
91+
- **Breaking Change** - `igxDatePickerActions` is renamed to `igxPickerActions`
92+
- **Behavioral Change** - Upon opening, the focused date will always be the selected/bound date. If there is no selected/bound date, the date picker will focus today's date. If `minValue` and/or `maxValue` are applied and today's date (or the bound date) is outside of the specified range, the focused date will be respectively `minValue` or `maxValue`.
10693
- `IgxTimePicker`
107-
- **Feature** - `value` accepts ISO 8601 string format.
10894
- **Breaking Change** - `value` type could be `Date` or `string`.
10995
- **Breaking Change** - `onValueChanged` event is renamed to `valueChange`.
11096
- **Breaking Change** - new way to define custom elements in the `igx-time-picker` while the following properties are deleted or deprecated: `context`, `promptChar`, `displayTime`, `template`.
11197
```html
11298
<igx-time-picker #timePicker [(value)]="time" [displayFormat]="'mediumTime'" [inputFormat]="hh:mm:ss">
11399
<label igxLabel>Time: </label>
114-
<igx-picker-toggle igxPrefix (click)="timePicker.toggle()">
100+
<igx-picker-toggle igxPrefix>
115101
alarm
116102
</igx-picker-toggle>
117-
<igx-picker-clear igxSuffix (click)="timePicker.clear()">
103+
<igx-picker-clear igxSuffix>
118104
delete
119105
</igx-picker-clear>
120106
</igx-time-picker>
@@ -125,17 +111,8 @@ All notable changes for each version of this project will be documented in this
125111
- **Breaking Change** - `vertical` is renamed to `headerOrientation`.
126112
- **Breaking Change** - `onOpening`, `onOpened`, `onClosing` and `onClosed` events are renamed respectively to `opening`, `opened`, `closing` and `closed`.
127113
- **Breaking Change** - `onValidationFailed` event is renamed to `validationFailed`.
114+
- **Behavioral Change** - The dropdown/dialog displays time portions within `minValue` and `maxValue` range if set or time between 00:00 and 24:00 in the provided `inputFormat`. The displayed values for each time portion are calculated based on the items delta always starting from zero. If the `minValue` or `maxValue` does not match the items delta, the displayed values will start/end from the next/last possible value that matches the delta. Upon opening, the selected time will be the bound value. In cases when there is not a bound value, it is outside the min/max range or does not match the items delta, the selected time will be the closest possible time that matches the items delta.
128115
- `IgxDateRangePicker`
129-
- **Feature** - `value` start and end accept ISO 8601 string format.
130-
- **Feature** - The actions template now exposes the Calendar component as implicit context:
131-
```html
132-
<igx-date-range-picker>
133-
<ng-template igxPickerActions let-calendar>
134-
<button igxButton="flat" (click)="calendar.viewDate = today">Today</button>
135-
</ng-template>
136-
</igx-date-range-picker>
137-
```
138-
- **Breaking Change** - `value` start and end types could be `Date` or `string`.
139116
- **Breaking Change** - `rangeSelected` event is renamed to `valueChange`.
140117
- **Breaking Change** - `onOpening`, `onOpened`, `onClosing` and `onClosed` events are renamed respectively to `opening`, `opened`, `closing` and `closed`.
141118
- **Breaking Change** - `monthsViewNumber` is renamed to `displayMonthsCount`.
@@ -244,6 +221,40 @@ All notable changes for each version of this project will be documented in this
244221
}
245222
}
246223
```
224+
- `IgxDateTimeEditor`
225+
- `value` accepts ISO 8601 string format.
226+
- `spinDelta` input property which allows a user to provide different delta values that will be used for spinning. All parts default to `1`.
227+
- `increment` and `decrement` methods now accept an optional `delta` parameter which targets the currently spun date portion. It takes precedence over the values set in `spinDelta`.
228+
- `IgxDatePicker`
229+
- `value` accepts ISO 8601 string format.
230+
- The actions template now exposes the Calendar component as implicit context:
231+
```html
232+
<igx-date-picker>
233+
<ng-template igxPickerActions let-calendar>
234+
<button igxButton="flat" (click)="calendar.viewDate = today">Today</button>
235+
</ng-template>
236+
</igx-date-picker>
237+
```
238+
- `IgxTimePicker`
239+
- `value` accepts ISO 8601 string format.
240+
- The `igxPickerActions` directive can now be used to provide custom buttons to the picker's pop-up:
241+
```html
242+
<igx-time-picker #timePicker>
243+
<ng-template igxPickerActions>
244+
<button igxButton="flat" (click)="timePicker.close()">Close</button>
245+
</ng-template>
246+
</igx-time-picker>
247+
```
248+
- `IgxDateRangePicker`
249+
- `value` start and end accept ISO 8601 string format.
250+
- The `igxPickerActions` directive can now be used to template the pickers `Done` button:
251+
```html
252+
<igx-date-range-picker #rangePicker>
253+
<ng-template igxPickerActions>
254+
<button igxButton="flat" (click)="rangePicker.close()">Close</button>
255+
</ng-template>
256+
</igx-date-range-picker>
257+
```
247258

248259
### Themes:
249260
- Breaking Changes:

projects/igniteui-angular/migrations/update-12_0_0/index.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,4 +1852,30 @@ export class SimpleComponent {
18521852
`
18531853
);
18541854
});
1855+
1856+
it('Should move disabled input group to textarea w/ igxInput', async () => {
1857+
appTree.create(
1858+
`/testSrc/appPrefix/component/test.component.html`,
1859+
`
1860+
<igx-input-group [disabled]="true">
1861+
<textarea igxInput [(ngModel)]="name">Some Text</textarea>
1862+
</igx-input-group>
1863+
`
1864+
);
1865+
1866+
const tree = await schematicRunner
1867+
.runSchematicAsync(migrationName, {}, appTree)
1868+
.toPromise();
1869+
// this is the expected output
1870+
// putting just the disabled attribute on an igx-input-group is an invalid scenario
1871+
expect(
1872+
tree.readContent('/testSrc/appPrefix/component/test.component.html')
1873+
).toEqual(
1874+
`
1875+
<igx-input-group>
1876+
<textarea igxInput [(ngModel)]="name" [disabled]="true">Some Text</textarea>
1877+
</igx-input-group>
1878+
`
1879+
);
1880+
});
18551881
});

projects/igniteui-angular/migrations/update-12_0_0/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ See https://www.infragistics.com/products/ignite-ui-angular/angular/components/t
472472
const INPUT_GROUP_CHANGES = {
473473
GROUP_TAG: 'igx-input-group',
474474
ATTRIBUTES: ['[disabled]', 'disabled'],
475-
INPUT_TAG: 'input',
475+
INPUT_TAG: ['input', 'textarea'],
476476
DIRECTIVE: 'igxInput'
477477
};
478478

projects/igniteui-angular/src/lib/date-common/util/date-time.util.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,32 @@ describe(`DateTimeUtil Unit tests`, () => {
4444
expect(resDict[DatePart.Date]).toEqual(jasmine.objectContaining({ start: 3, end: 5 }));
4545
expect(resDict[DatePart.Year]).toEqual(jasmine.objectContaining({ start: 6, end: 8 }));
4646

47+
// d/M/y should be 00/00/0000
48+
result = DateTimeUtil.parseDateTimeFormat('d/M/y');
49+
resDict = reduceToDictionary(result);
50+
expect(result.length).toEqual(5);
51+
expect(resDict[DatePart.Date]).toEqual(jasmine.objectContaining({ start: 0, end: 2 }));
52+
expect(resDict[DatePart.Month]).toEqual(jasmine.objectContaining({ start: 3, end: 5 }));
53+
expect(resDict[DatePart.Year]).toEqual(jasmine.objectContaining({ start: 6, end: 10 }));
54+
55+
// d/M/yyy should be 00/00/0000
56+
result = DateTimeUtil.parseDateTimeFormat('d/M/yyy');
57+
resDict = reduceToDictionary(result);
58+
expect(result.length).toEqual(5);
59+
expect(resDict[DatePart.Date]).toEqual(jasmine.objectContaining({ start: 0, end: 2 }));
60+
expect(resDict[DatePart.Month]).toEqual(jasmine.objectContaining({ start: 3, end: 5 }));
61+
expect(resDict[DatePart.Year]).toEqual(jasmine.objectContaining({ start: 6, end: 10 }));
62+
63+
64+
// d/M/yyyy should 00/00/0000
65+
result = DateTimeUtil.parseDateTimeFormat('d/M/yyyy');
66+
resDict = reduceToDictionary(result);
67+
expect(result.length).toEqual(5);
68+
expect(resDict[DatePart.Date]).toEqual(jasmine.objectContaining({ start: 0, end: 2 }));
69+
expect(resDict[DatePart.Month]).toEqual(jasmine.objectContaining({ start: 3, end: 5 }));
70+
expect(resDict[DatePart.Year]).toEqual(jasmine.objectContaining({ start: 6, end: 10 }));
71+
72+
4773
// H:m:s should be 00:00:00
4874
result = DateTimeUtil.parseDateTimeFormat('H:m:s');
4975
resDict = reduceToDictionary(result);

projects/igniteui-angular/src/lib/date-common/util/date-time.util.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ export abstract class DateTimeUtil {
113113
if (!dateTimeParts.filter(p => p.format.includes(currentPart.format)).length) {
114114
DateTimeUtil.addCurrentPart(currentPart, dateTimeParts);
115115
}
116+
// formats like "y" or "yyy" are treated like "yyyy" while editing
117+
const yearPart = dateTimeParts.filter(p => p.type === DatePart.Year)[0];
118+
if (yearPart && yearPart.format !== 'yy') {
119+
yearPart.end += 4 - yearPart.format.length;
120+
yearPart.format = 'yyyy';
121+
}
116122

117123
return dateTimeParts;
118124
}

0 commit comments

Comments
 (0)