Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editable date picker #3583

Merged
merged 118 commits into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from 116 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
73118b8
feat(date-picker): Initial changes to support edit field #3034
sboykova Nov 30, 2018
59caea3
refactor(themes): update date-picker theme after refactor
simeonoff Dec 5, 2018
2859891
feat(date-picker): Fixes in editable date-picker #3034
sboykova Dec 5, 2018
8925883
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 5, 2018
ce0369c
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 10, 2018
91db215
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 11, 2018
43f5a24
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 12, 2018
01eb95f
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 13, 2018
af3ba38
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 14, 2018
a0a35d9
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 17, 2018
5fc37c5
Merge branch 'master' into sboykova/editable-date-picker
sboykova Dec 20, 2018
512bcf9
feat(date-picker): Implementing edit mode #3034
sboykova Dec 20, 2018
a856cfc
feat(date-picker): More changes #3034
sboykova Dec 27, 2018
7e5d086
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 4, 2019
cd0935f
feat(date-picker): Added spinning of the date parts #3034
sboykova Jan 4, 2019
bddf128
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 8, 2019
a41e574
feat(date-picker): Added spinning functionality and other fixes #3034
sboykova Jan 8, 2019
fc248af
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 9, 2019
e24418d
feat(date-picker): Spinning issues fixes #3034
sboykova Jan 10, 2019
8dcabb4
chore(*): Some code changes
Jan 10, 2019
fcdc1dd
feat(date-picker): Resolved merged changes #3034
sboykova Jan 10, 2019
86054b2
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 10, 2019
e7a3ac6
feat(date-picker): Reworked parts in editable mode #3034
sboykova Jan 10, 2019
336c1d2
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 11, 2019
e62b9cd
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 11, 2019
fb86374
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Jan 11, 2019
3c1c122
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 14, 2019
f147215
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 14, 2019
8ac4095
fix(igxCalendar): add trackBy for months and years, #3595
wnvko Jan 18, 2019
fbb693f
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
wnvko Jan 18, 2019
f5551d4
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Jan 18, 2019
3bf82bb
feat(date-picker): Added spinning on mouse wheel #3583
sboykova Jan 21, 2019
b26d8db
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 21, 2019
457031c
feat(date-picker): Added more functionality #3583
sboykova Jan 22, 2019
d26bf7f
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 23, 2019
b382386
feat(date-picker): Fixes in editing and spinning date parts #3583
sboykova Jan 25, 2019
f086ec2
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 25, 2019
76eb70f
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 25, 2019
f1e3451
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Jan 25, 2019
7c69947
feat(date-picker): Added infinite loop when spinning #3583
sboykova Jan 29, 2019
0924665
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 29, 2019
58a8b14
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 29, 2019
585f6c5
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Jan 29, 2019
d6e6dfe
feat(date-picker): Fixes in editable date-picker #3583
sboykova Jan 30, 2019
6f7f6be
feat(date-picker): Fixes in edit mode #3583
sboykova Jan 30, 2019
6bff2f3
feat(date-picker): Fixes, refactoring #3583
sboykova Jan 30, 2019
4d1770d
feat(date-picker): Disabled/special dates handling #3583
sboykova Jan 31, 2019
35a68dc
Merge branch 'master' into sboykova/editable-date-picker
sboykova Jan 31, 2019
b5ae673
feat(date-picker): Fixes in editable mode #3583
sboykova Feb 4, 2019
a998567
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 4, 2019
dd893c8
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 5, 2019
5a51fa4
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 5, 2019
0e8ff8d
Merge branch 'master' into sboykova/editable-date-picker
rkaraivanov Feb 5, 2019
624534f
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 5, 2019
8577c9c
feat(date-picker): Fixes in tests #3583
sboykova Feb 5, 2019
5fd7697
feat(date-picker): Calendar and buttons added to new component #3583
sboykova Feb 6, 2019
3eca7ad
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 6, 2019
861a37f
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 6, 2019
39ace5c
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 7, 2019
cf0dfe9
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 7, 2019
8415391
feat(date-picker): Fixed spinning of long months names #3583
sboykova Feb 7, 2019
f1dee61
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 8, 2019
0c81914
feat(date-picker): Fixed existing tests, refactoring #3583
sboykova Feb 8, 2019
ae32eb8
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 8, 2019
554ace0
feat(date-picker): Reworked code, overlay settings exposed #3583
sboykova Feb 12, 2019
0685d77
feat(date-picker): Fixed styles bindings #3583
sboykova Feb 12, 2019
28ffae4
fix(date-picker): Fixes in edit mode #3583
sboykova Feb 12, 2019
50db6a3
fix(date-picker): Fixes, added tests for edit mode #3583
sboykova Feb 13, 2019
9772793
fix(date-picker): Added alt+up key behavior, added tests #3583
sboykova Feb 13, 2019
71f51ca
fix(date-picker): Fixed check for days in month #3583
sboykova Feb 13, 2019
ad7fa26
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 13, 2019
690dbdf
fix(date-picker): Fixes in edit mode #3583
sboykova Feb 13, 2019
cbdc9f3
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 13, 2019
12e2f46
fix(date-picker): Changed date-picker mode in grid #3583
sboykova Feb 13, 2019
f925e4d
fix(date-picker): Fixes in code and tests #3583
sboykova Feb 14, 2019
3d5a766
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 14, 2019
d28af69
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 14, 2019
9e31a3e
feat(date-picker): Added some API comments and fixes #3583
sboykova Feb 14, 2019
9281890
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 14, 2019
7acc4ed
feat(date-picker): Added info in docs, fixed method name #3583
sboykova Feb 14, 2019
f927f39
fix(igx-grid): Add filter-row date-picker in grid's outlet, #3034
sstoyanovIG Feb 14, 2019
ade8c26
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 15, 2019
176461f
feat(date-picker): fix broken behaviors after calendar merge #3583
SAndreeva Feb 15, 2019
e9f4a71
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 15, 2019
f84129a
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 18, 2019
160bbac
fix(date-picker): Requested changes done #3583
sboykova Feb 18, 2019
d8cf1a9
fix(date-picker): Fixes in date-picker #3583
sboykova Feb 18, 2019
5500306
Merge branch 'master' into sboykova/editable-date-picker
bkulov Feb 18, 2019
b738ad7
fix(date-picker): Fixes in code #3583
sboykova Feb 18, 2019
7c20997
Merge branch 'master' into sboykova/editable-date-picker
bkulov Feb 18, 2019
cd522bc
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 18, 2019
a6188fa
fix(date-picker): Fix in calendar opening #3583
sboykova Feb 18, 2019
81a6c6b
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 18, 2019
e01737c
fix(grid): Enabled key down event for date-picker editor #3583
sboykova Feb 18, 2019
a5808fe
Merge branch 'master' into sboykova/editable-date-picker
SAndreeva Feb 18, 2019
e68d2e9
fix(grid): failing tests #3583
SAndreeva Feb 18, 2019
3d49ebf
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
SAndreeva Feb 18, 2019
318756a
fix(grid): Removed not needed brackets #3583
sboykova Feb 18, 2019
1beae02
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 18, 2019
9c8fd5c
fix(grid): Removed unused openDialog event argument #3583
sboykova Feb 18, 2019
09beb01
fix(date-picker): Stopped propagation of spinning events #3583
sboykova Feb 18, 2019
c5a0234
fix(date-picker): Fixed empty mask #3583
sboykova Feb 18, 2019
c7c7ed1
fix(grid): failing test for locale #3583
SAndreeva Feb 18, 2019
bf1d606
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
SAndreeva Feb 18, 2019
21bb2b0
chore(*): try fixing flickering test #3583
SAndreeva Feb 18, 2019
d4b061a
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 19, 2019
42ec47d
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 19, 2019
e0833c1
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 19, 2019
5eabd70
test(date-picker): Added new tests, fixes #3583
sboykova Feb 19, 2019
f0fed13
test(date-picker): Fixed failing focus test #3583
sboykova Feb 19, 2019
499c49f
Merge branch 'master' into sboykova/editable-date-picker
kdinev Feb 19, 2019
e503237
test(grid): remove detectChanges #3583
Lipata Feb 19, 2019
3756838
Merge branch 'master' into sboykova/editable-date-picker
sboykova Feb 19, 2019
c060bb7
Merge branch 'sboykova/editable-date-picker' of https://github.com/Ig…
sboykova Feb 19, 2019
f7cce0b
test(date-picker): Added tests for editable date-picker #3583
sboykova Feb 19, 2019
342b8d6
test(grid): enter edit mode -> update -> exit edit mode -> check #3583
Lipata Feb 19, 2019
170ac12
test(grid): use API calls to methods instead of using shift+tab #3583
Lipata Feb 19, 2019
d8e623a
test(date-picker): Added more tests for editable date picker #3583
sboykova Feb 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ All notable changes for each version of this project will be documented in this
- `igxOverlay.attach(component, settings?)` method added. Use this method to obtain an unique Id of the created overlay where the provided component will be shown. Then call `igxOverlay.show(id, settings?)` method to show the component in overlay.
- `igxOverlay.show(component, settings)` is **depricated**. Use `igxOverlay.attach(component, settings?)` method to obtain an Id, and then call `igxOverlay.show(id, settings)` method to show a component in the overlay.

- `igx-date-picker`
- **Feature** Added editable `mode` to enable the input field value editing and spinning of the date parts. Example:
```html
<igx-date-picker #editableDatePicker1 mode="editable" [value]="date" format="dd.MM.y" mask="M/d/y">
</igx-date-picker>
```
**Components roundness**
- Ignite UI for Angular now allows you to change the shape of components by changing their border-radius.

Expand Down
46 changes: 18 additions & 28 deletions projects/igniteui-angular/src/lib/calendar/calendar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@
</ng-template>

<ng-template let-result #defaultMonth>
<span tabindex="0" #monthsBtn (keydown)="activeViewYearKB($event)" (click)="activeViewYear()" class="igx-calendar-picker__date">
<span tabindex="0" #monthsBtn (keydown)="activeViewYearKB($event)" (click)="activeViewYear()"
class="igx-calendar-picker__date">
{{ formattedMonth(viewDate) }}
</span>
<span tabindex="0" #yearsBtn (keydown)="activeViewDecadeKB($event)" (click)="activeViewDecade()" class="igx-calendar-picker__date">
<span tabindex="0" #yearsBtn (keydown)="activeViewDecadeKB($event)" (click)="activeViewDecade()"
class="igx-calendar-picker__date">
{{ formattedYear(viewDate) }}
</span>
</ng-template>

<div *ngIf="selection === 'single'" class="igx-calendar__header">
<div *ngIf="selection === 'single' && hasHeader" class="igx-calendar__header">
<h5 class="igx-calendar__header-year">{{ formattedYear(headerDate) }}</h5>
<h2 class="igx-calendar__header-date">
<ng-container *ngTemplateOutlet="headerTemplate ? headerTemplate : defaultHeader; context: headerContext">
</ng-container>
</h2>
</div>

<div *ngIf="isDefaultView" class="igx-calendar__body" [@animateView]="activeView" (swiperight)="previousMonth()" (swipeleft)="nextMonth()">
<div *ngIf="isDefaultView" class="igx-calendar__body" [@animateView]="activeView" (swiperight)="previousMonth()"
(swipeleft)="nextMonth()">
<div class="igx-calendar-picker">
<div tabindex="0" class="igx-calendar-picker__prev" (keydown)="previousMonthKB($event)" (click)="previousMonth()">
<div tabindex="0" class="igx-calendar-picker__prev" (keydown)="previousMonthKB($event)"
(click)="previousMonth()">
<igx-icon fontSet="material">keyboard_arrow_left</igx-icon>
</div>
<div>
Expand All @@ -34,31 +38,17 @@ <h2 class="igx-calendar__header-date">
</div>
</div>

<igx-days-view [changeDaysView]="true" #days
[animationAction]="monthAction"
[locale]="locale"
[value]="value"
[weekStart]="weekStart"
[formatOptions]="formatOptions"
[viewDate]="viewDate"
[selection]="selection"
[disabledDates]="disabledDates"
[specialDates]="specialDates"
(onViewChanged)="viewChanged($event)"
(onDateSelection)="childClicked($event)">
<igx-days-view [changeDaysView]="true" #days [animationAction]="monthAction" [locale]="locale" [value]="value"
[weekStart]="weekStart" [formatOptions]="formatOptions" [viewDate]="viewDate" [selection]="selection"
[disabledDates]="disabledDates" [specialDates]="specialDates" (onViewChanged)="viewChanged($event)"
(onDateSelection)="childClicked($event)">
</igx-days-view>
</div>

<igx-months-view *ngIf="isYearView" [@animateView]="activeView" #months
[date]="viewDate"
[locale]="locale"
[monthFormat]="formatOptions.month"
(onSelection)="changeMonth($event)" >
<igx-months-view *ngIf="isYearView" [@animateView]="activeView" #months [date]="viewDate" [locale]="locale"
[monthFormat]="formatOptions.month" (onSelection)="changeMonth($event)">
</igx-months-view>

<igx-years-view *ngIf="isDecadeView" [@animateView]="activeView" #decade
[date]="viewDate"
[locale]="locale"
[yearFormat]="formatOptions.year"
(onSelection)="changeYear($event)">
</igx-years-view>
<igx-years-view *ngIf="isDecadeView" [@animateView]="activeView" #decade [date]="viewDate" [locale]="locale"
[yearFormat]="formatOptions.year" (onSelection)="changeYear($event)">
</igx-years-view>
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export class IgxCalendarComponent extends IgxDaysViewComponent {
@Input()
public id = `igx-calendar-${NEXT_ID++}`;

@Input()
public hasHeader = true;

/**
* Gets whether the `day`, `month` and `year` should be rendered
* according to the locale and formatOptions, if any.
Expand Down Expand Up @@ -146,19 +149,19 @@ export class IgxCalendarComponent extends IgxDaysViewComponent {
/**
* @hidden
*/
@ViewChild('decade', {read: IgxYearsViewComponent})
@ViewChild('decade', { read: IgxYearsViewComponent })
public dacadeView: IgxYearsViewComponent;

/**
* @hidden
*/
@ViewChild('months', {read: IgxMonthsViewComponent})
@ViewChild('months', { read: IgxMonthsViewComponent })
public monthsView: IgxMonthsViewComponent;

/**
* @hidden
*/
@ViewChild('days', {read: IgxDaysViewComponent})
@ViewChild('days', { read: IgxDaysViewComponent })
public daysView: IgxDaysViewComponent;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,10 +1014,8 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
setTimeout(() => {
date.nativeElement.focus();
}, parseInt(slideInRight.options.params.duration, 10));
} else if (this.callback) {
setTimeout(() => {
this.callback(this.dates, this._nextDate);
}, parseInt(slideInRight.options.params.duration, 10));
} else if (this.callback && (event.toState === 'next' || event.toState === 'prev')) {
this.callback(this.dates, this._nextDate);
}
}
}
Expand All @@ -1028,6 +1026,8 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
@HostListener('keydown.arrowup', ['$event'])
public onKeydownArrowUp(event: KeyboardEvent) {
event.preventDefault();
event.stopPropagation();

this.focusPreviousUpDate(event.target);
}

Expand All @@ -1037,6 +1037,8 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
@HostListener('keydown.arrowdown', ['$event'])
public onKeydownArrowDown(event: KeyboardEvent) {
event.preventDefault();
event.stopPropagation();

this.focusNextDownDate(event.target);
}

Expand All @@ -1055,6 +1057,8 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
@HostListener('keydown.arrowright', ['$event'])
public onKeydownArrowRight(event: KeyboardEvent) {
event.preventDefault();
event.stopPropagation();

this.focusNextDate(event.target);
}

Expand All @@ -1064,6 +1068,7 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
@HostListener('keydown.home', ['$event'])
public onKeydownHome(event: KeyboardEvent) {
event.preventDefault();
event.stopPropagation();

const dates = this.dates.filter(d => d.isCurrentMonth);
for (let i = 0; i < dates.length; i++) {
Expand All @@ -1080,6 +1085,7 @@ export class IgxDaysViewComponent implements ControlValueAccessor, DoCheck {
@HostListener('keydown.end', ['$event'])
public onKeydownEnd(event: KeyboardEvent) {
event.preventDefault();
event.stopPropagation();

const dates = this.dates.filter(d => d.isCurrentMonth);
for (let i = dates.length - 1; i >= 0; i--) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="igx-calendar__body">
<div class="igx-calendar__body-row--wrap">
<div [igxCalendarMonth]="month" [date]="date" (onMonthSelection)="selectMonth($event)" [index]="i" *ngFor="let month of months; index as i;">
<div [igxCalendarMonth]="month" [date]="date" (onMonthSelection)="selectMonth($event)" [index]="i" *ngFor="let month of months; index as i; trackBy: monthTracker">
{{ formattedMonth(month) | titlecase }}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ export class IgxMonthsViewComponent implements ControlValueAccessor {
}
}

/**
* @hidden
*/
public monthTracker(index, item): string {
return `${item.getMonth()}}`;
}


/**
*@hidden
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="igx-calendar__body">
<div class="igx-calendar__body-column" (wheel)="scroll($event)" (pan)="pan($event)">
<span [igxCalendarYear]="year" [date]="date" (onYearSelection)="selectYear($event)" *ngFor="let year of decade">
<span [igxCalendarYear]="year" [date]="date" (onYearSelection)="selectYear($event)" *ngFor="let year of decade; trackBy: yearTracker">
{{ formattedYear(year) }}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ export class IgxYearsViewComponent implements ControlValueAccessor {
this._onTouchedCallback = fn;
}

/**
* @hidden
*/
public yearTracker(index, item): string {
return `${item.getFullYear()}}`;
}

/**
* @hidden
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
$this: bem--selector-to-string(&);
@include register-component(str-slice($this, 2, -1));

.igx-dialog__window {
@extend %date-picker-display !optional;
@extend %date-picker !optional;

@include e(buttons) {
@extend %date-picker__buttons !optional;
}

@include m(vertical) {
.igx-dialog__window {
@extend %date-picker-display--vertical !optional;
}
@extend %date-picker--vertical !optional;
}

@include m(dropdown) {
@extend %date-picker--dropdown !optional;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,116 @@
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
////

/// Date Picker
/// @param {Map} $palette [$default-palette] - The palette used as basis for styling the component.
/// @param {Map} $schema [$light-schema] - The schema used as basis for styling the component.
///
/// @requires $default-palette
/// @requires $light-schema
/// @requires apply-palette
/// @requires extend
@function igx-date-picker-theme(
$palette: $default-palette,
$schema: $light-schema
) {
$name: 'igx-date-picker';
$theme: apply-palette(map-get($schema, $name), $palette);
@return extend($theme, (name: $name, palette: $palette));
}

/// @param {Map} $theme - The theme used to style the component.
/// @param {Map} $theme - The calendar theme used to style the component.
/// @requires $elevations
/// @requires igx-elevation
/// @requires rem
@mixin igx-date-picker($theme) {
%date-picker-display {
width: 340px;
%date-picker {
min-width: 200px;
max-width: 340px;
box-shadow: igx-elevation($elevations, 24);
border-radius: rem(4px);
background: --var($theme, 'content-background');
overflow: hidden;

%cal-display {
background: --var($theme, 'content-background');
}

%cal-header-display {
background-color: --var($theme, 'header-background');
color: --var($theme, 'header-text-color');
}

%cal-picker-arrow {
color: --var($theme, 'picker-arrow-color');

&:hover {
color: --var($theme, 'picker-arrow-hover-color');
}
}

%cal-picker-date {
color: --var($theme, 'picker-text-color');

&:hover,
&:focus {
color: --var($theme, 'picker-text-hover-color');
}
}

%cal-value {
color: --var($theme, 'content-text-color');
}

%cal-value--label {
color: --var($theme, 'inactive-text-color');
}

%cal-value--weekend {
color: --var($theme, 'weekend-text-color');
}

%cal-value--special {
color: --var($theme, 'date-special-text-color');
background: --var($theme, 'date-special-background');
}

%cal-value--disabled {
color: --var($theme, 'date-disabled-text-color');
}

%cal-value--year-current {
color: --var($theme, 'year-current-text-color');
}

%cal-value--year-hover {
color: --var($theme, 'year-hover-text-color');
}

%cal-value--month-hover {
color: --var($theme, 'month-hover-text-color');
}

%cal-value--month-current {
color: --var($theme, 'month-current-text-color');
}

%cal-value--inactive {
color: --var($theme, 'inactive-text-color');
}

%cal-value--selected {
color: --var($theme, 'date-selected-text-color');
background-color: --var($theme, 'date-selected-background') !important;
}

%cal-value--current {
color: --var($theme, 'date-current-text-color');
}

%cal-value--hover {
background-color: --var($theme, 'date-hover-background');
}
}

%date-picker-display--vertical {
width: 540px;
%date-picker--vertical {
min-width: 368px; /* 168px for header + 200px for the content */
max-width: 540px;
}

%date-picker--dropdown {
display: flex;
flex: 1 0 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
box-shadow: igx-elevation($elevations, 3);
}
}

%date-picker__buttons {
display: flex;
justify-content: flex-end;
padding: rem(8px);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
}

@if not(index($exclude, 'igx-date-picker')) {
@include igx-date-picker(igx-date-picker-theme($palette, $schema));
@include igx-date-picker(igx-calendar-theme($palette, $schema));
}

@if not(index($exclude, 'igx-dialog')) {
Expand Down
Loading