@anglr/datetime 5.0.0-beta.20221018120203 → 5.0.0-beta.20221019093146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +56 -1
- package/es2015/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
- package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/picker/picker.component.js +4 -4
- package/es2015/src/legacy/picker/components/picker/picker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/pickerBase.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
- package/es2015/src/legacy/picker/misc/tokens.js.map +1 -1
- package/es2015/src/legacy/picker/modules/picker.module.js +9 -9
- package/es2015/src/legacy/picker/modules/picker.module.js.map +1 -1
- package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
- package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
- package/es2015/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
- package/es2015/src/legacy/selector/modules/selector.module.js +4 -4
- package/es2015/src/legacy/selector/modules/selector.module.js.map +1 -1
- package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
- package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +180 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +17 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/index.js +5 -0
- package/es2015/src/modules/dateTimePicker/components/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +189 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/index.js +3 -0
- package/es2015/src/modules/dateTimePicker/directives/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/index.js +6 -0
- package/es2015/src/modules/dateTimePicker/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/interfaces/index.js +2 -0
- package/es2015/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/misc/tokens.js +10 -0
- package/es2015/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
- package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/modules/index.js +2 -0
- package/es2015/src/modules/dateTimePicker/modules/index.js.map +1 -0
- package/es2015/src/modules/index.js +1 -0
- package/es2015/src/modules/index.js.map +1 -1
- package/es2020/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
- package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/picker/picker.component.js +4 -4
- package/es2020/src/legacy/picker/components/picker/picker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/pickerBase.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
- package/es2020/src/legacy/picker/misc/tokens.js.map +1 -1
- package/es2020/src/legacy/picker/modules/picker.module.js +9 -9
- package/es2020/src/legacy/picker/modules/picker.module.js.map +1 -1
- package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
- package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
- package/es2020/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
- package/es2020/src/legacy/selector/modules/selector.module.js +4 -4
- package/es2020/src/legacy/selector/modules/selector.module.js.map +1 -1
- package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
- package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
- package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +177 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +17 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/index.js +5 -0
- package/es2020/src/modules/dateTimePicker/components/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +183 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/index.js +3 -0
- package/es2020/src/modules/dateTimePicker/directives/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/index.js +6 -0
- package/es2020/src/modules/dateTimePicker/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/interfaces/index.js +2 -0
- package/es2020/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/misc/tokens.js +10 -0
- package/es2020/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/modules/index.js +2 -0
- package/es2020/src/modules/dateTimePicker/modules/index.js.map +1 -0
- package/es2020/src/modules/index.js +1 -0
- package/es2020/src/modules/index.js.map +1 -1
- package/package.json +7 -1
- package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts +8 -4
- package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts.map +1 -1
- package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/picker/picker.component.d.ts +11 -11
- package/src/legacy/picker/components/picker/picker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/pickerBase.component.d.ts +2 -2
- package/src/legacy/picker/components/pickerBase.component.d.ts.map +1 -1
- package/src/legacy/picker/components/pickerImplBase.component.d.ts +2 -2
- package/src/legacy/picker/components/pickerImplBase.component.d.ts.map +1 -1
- package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts +2 -2
- package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/misc/datetimePicker.interface.d.ts +2 -2
- package/src/legacy/picker/misc/datetimePicker.interface.d.ts.map +1 -1
- package/src/legacy/picker/misc/tokens.d.ts +2 -2
- package/src/legacy/picker/misc/tokens.d.ts.map +1 -1
- package/src/legacy/picker/modules/picker.module.d.ts +4 -4
- package/src/legacy/picker/modules/picker.module.d.ts.map +1 -1
- package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts +2 -2
- package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts.map +1 -1
- package/src/legacy/selector/misc/datetimeSelector.interface.d.ts +2 -2
- package/src/legacy/selector/misc/datetimeSelector.interface.d.ts.map +1 -1
- package/src/legacy/selector/modules/selector.module.d.ts +1 -1
- package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +6 -2
- package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
- package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts +53 -0
- package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +79 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts +17 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.css +27 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +11 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +23 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts +11 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/index.d.ts +5 -0
- package/src/modules/dateTimePicker/components/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +79 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts +31 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/index.d.ts +3 -0
- package/src/modules/dateTimePicker/directives/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/index.d.ts +6 -0
- package/src/modules/dateTimePicker/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts +40 -0
- package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/interfaces/index.d.ts +2 -0
- package/src/modules/dateTimePicker/interfaces/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/misc/tokens.d.ts +12 -0
- package/src/modules/dateTimePicker/misc/tokens.d.ts.map +1 -0
- package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts +12 -0
- package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts.map +1 -0
- package/src/modules/dateTimePicker/modules/index.d.ts +2 -0
- package/src/modules/dateTimePicker/modules/index.d.ts.map +1 -0
- package/src/modules/index.d.ts +1 -0
- package/src/modules/index.d.ts.map +1 -1
- package/styles/components/_date-time-picker.scss +8 -0
- package/styles/core/_functions.scss +11 -0
- package/styles/core/_misc.scss +199 -0
- package/styles/core/_mixins.scss +23 -0
- package/styles/core/_theme.scss +3 -0
- package/styles/index.scss +2 -0
- package/styles/themes/dark.scss +19 -0
- package/styles/themes/light.scss +19 -0
- package/version.bak +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { DateTimePeriodPickerBase } from '../dateTimePeriodPickerBase';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Component used for displaying day picker
|
|
6
|
+
*/
|
|
7
|
+
export class DayPickerSAComponent extends DateTimePeriodPickerBase {
|
|
8
|
+
}
|
|
9
|
+
DayPickerSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DayPickerSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
DayPickerSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: DayPickerSAComponent, isStandalone: true, selector: "day-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<!-- <div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div> -->\r\n\r\nDAY", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DayPickerSAComponent, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{ selector: 'day-picker', host: {
|
|
14
|
+
'[class.date-time-period]': 'true',
|
|
15
|
+
}, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- <div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div> -->\r\n\r\nDAY" }]
|
|
16
|
+
}] });
|
|
17
|
+
//# sourceMappingURL=dayPicker.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAGjE,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;;AAErE;;GAEG;AAYH,MAAM,OAAO,oBAAsC,SAAQ,wBAA+B;;iHAA7E,oBAAoB;qGAApB,oBAAoB,yJCnBjC,+xCAsBG;2FDHU,oBAAoB;kBAXhC,SAAS;+BAEI,YAAY,QAGtB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,mBACC,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\n\nimport {DateTimePicker} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'day-picker',\n templateUrl: 'dayPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayPickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<TDate> implements DateTimePicker<TDate>\n{\n}","<!-- <div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div> -->\r\n\r\nDAY"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.interfaces.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../../../legacy/picker/interfaces';\n\n/**\n * Specific css classes for day picker\n */\nexport interface DayPickerCssClasses extends CommonPickerCssClasses\n{\n /**\n * Element displaying weekday name\n */\n weekdayName?: string;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './dateTimePeriodPickerBase';\nexport * from './dateTimePicker/dateTimePicker.component';\nexport * from './dateTimePicker/dateTimePicker.interface';\nexport * from './dayPicker/dayPicker.component';\n"]}
|
package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Directive, ElementRef, Inject, Input, Optional, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import { POSITION, applyPositionResult, PositionPlacement } from '@anglr/common';
|
|
5
|
+
import { extend, nameof, isDescendant, BindThis } from '@jscrpt/common';
|
|
6
|
+
import { lastValueFrom, Subscription } from 'rxjs';
|
|
7
|
+
import { DATE_TIME_INPUT } from '../../../../misc/tokens';
|
|
8
|
+
import { DateTimePickerComponent } from '../../components';
|
|
9
|
+
import { DATE_TIME_PICKER_DIRECTIVE_OPTIONS } from '../../misc/tokens';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* Default options for date time picker directive
|
|
13
|
+
*/
|
|
14
|
+
const defaultOptions = {
|
|
15
|
+
absolute: true,
|
|
16
|
+
alwaysVisible: false,
|
|
17
|
+
closeOnValueSelect: true,
|
|
18
|
+
disabled: false,
|
|
19
|
+
positionOptions: PositionPlacement.BottomStart,
|
|
20
|
+
showOnFocus: true,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Directive that is used for displaying and attaching date time picker
|
|
24
|
+
*/
|
|
25
|
+
export class DateTimePickerDirective {
|
|
26
|
+
//######################### constructor #########################
|
|
27
|
+
constructor(viewContainer, element, input, document, position, options) {
|
|
28
|
+
this.viewContainer = viewContainer;
|
|
29
|
+
this.element = element;
|
|
30
|
+
this.input = input;
|
|
31
|
+
this.document = document;
|
|
32
|
+
this.position = position;
|
|
33
|
+
//######################### protected properties #########################
|
|
34
|
+
/**
|
|
35
|
+
* Indication whether is value changes disabled
|
|
36
|
+
*/
|
|
37
|
+
this.valueChangeDisabled = false;
|
|
38
|
+
/**
|
|
39
|
+
* Subscriptions created during initialization
|
|
40
|
+
*/
|
|
41
|
+
this.initSubscriptions = new Subscription();
|
|
42
|
+
this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);
|
|
43
|
+
}
|
|
44
|
+
//######################### public properties - inputs #########################
|
|
45
|
+
/**
|
|
46
|
+
* Gets or sets options for date time picker directive
|
|
47
|
+
*/
|
|
48
|
+
get withPickerOptions() {
|
|
49
|
+
return this.ɵWithPickerOptions;
|
|
50
|
+
}
|
|
51
|
+
set withPickerOptions(value) {
|
|
52
|
+
this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);
|
|
53
|
+
}
|
|
54
|
+
//######################### public methods - implementation of OnInit #########################
|
|
55
|
+
/**
|
|
56
|
+
* Initialize component
|
|
57
|
+
*/
|
|
58
|
+
ngOnInit() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
if (this.withPickerOptions.alwaysVisible) {
|
|
61
|
+
this.showPicker();
|
|
62
|
+
}
|
|
63
|
+
this.initSubscriptions.add(this.input.valueChange.subscribe(() => this.setPickerValue()));
|
|
64
|
+
this.initSubscriptions.add(this.input.focus.subscribe(() => {
|
|
65
|
+
if (this.withPickerOptions.showOnFocus) {
|
|
66
|
+
this.showPicker();
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//######################### public methods - implementation of OnDestroy #########################
|
|
72
|
+
/**
|
|
73
|
+
* Called when component is destroyed
|
|
74
|
+
*/
|
|
75
|
+
ngOnDestroy() {
|
|
76
|
+
this.hidePicker();
|
|
77
|
+
this.initSubscriptions.unsubscribe();
|
|
78
|
+
}
|
|
79
|
+
//######################### public methods #########################
|
|
80
|
+
/**
|
|
81
|
+
* Hides date time picker
|
|
82
|
+
*/
|
|
83
|
+
showPicker() {
|
|
84
|
+
var _a;
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
if (this.withPickerOptions.disabled || this.componentRef) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.componentRef = this.viewContainer.createComponent((DateTimePickerComponent));
|
|
90
|
+
this.componentElement = ((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.hostView).rootNodes[0];
|
|
91
|
+
this.component = this.componentRef.instance;
|
|
92
|
+
if (this.withPickerOptions.absolute) {
|
|
93
|
+
this.document.body.append(this.componentElement);
|
|
94
|
+
}
|
|
95
|
+
this.valueChangeSubscription = this.component.valueChange.subscribe(() => {
|
|
96
|
+
if (this.component) {
|
|
97
|
+
this.valueChangeDisabled = true;
|
|
98
|
+
this.input.value = this.component.value;
|
|
99
|
+
this.input.valueChange.emit();
|
|
100
|
+
this.valueChangeDisabled = false;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
this.document.addEventListener('click', this.handleClickOutside);
|
|
104
|
+
const result = yield lastValueFrom(this.position.placeElement(this.componentElement, this.element.nativeElement, {
|
|
105
|
+
placement: this.withPickerOptions.positionOptions,
|
|
106
|
+
}));
|
|
107
|
+
applyPositionResult(result);
|
|
108
|
+
this.setPickerValue();
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Shows date time picker
|
|
113
|
+
*/
|
|
114
|
+
hidePicker() {
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
if (this.withPickerOptions.alwaysVisible) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
(_a = this.valueChangeSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
120
|
+
this.valueChangeSubscription = null;
|
|
121
|
+
this.component = null;
|
|
122
|
+
(_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
123
|
+
this.componentRef = null;
|
|
124
|
+
(_c = this.componentElement) === null || _c === void 0 ? void 0 : _c.remove();
|
|
125
|
+
this.componentElement = null;
|
|
126
|
+
this.document.removeEventListener('click', this.handleClickOutside);
|
|
127
|
+
}
|
|
128
|
+
//######################### protected methods #########################
|
|
129
|
+
/**
|
|
130
|
+
* Sets all picker value
|
|
131
|
+
*/
|
|
132
|
+
setPickerValue() {
|
|
133
|
+
if (this.valueChangeDisabled) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (this.componentRef) {
|
|
137
|
+
this.componentRef.setInput(nameof('value'), this.input.value);
|
|
138
|
+
// this.componentRef.changeDetectorRef.markForCheck();
|
|
139
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Handles clicking outside of picker
|
|
144
|
+
* @param event - Event that occured
|
|
145
|
+
*/
|
|
146
|
+
handleClickOutside(event) {
|
|
147
|
+
if (!this.componentElement) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (this.componentElement != event.target &&
|
|
151
|
+
!isDescendant(this.componentElement, event.target) &&
|
|
152
|
+
(!this.input.element || (this.input.element != event.target &&
|
|
153
|
+
!isDescendant(this.input.element, event.target)))) {
|
|
154
|
+
this.hidePicker();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
DateTimePickerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: DATE_TIME_INPUT }, { token: DOCUMENT }, { token: POSITION }, { token: DATE_TIME_PICKER_DIRECTIVE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
159
|
+
DateTimePickerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerDirective, selector: "[dateTime][withPicker]", inputs: { withPickerOptions: "withPickerOptions" }, exportAs: ["dateTimePicker"], ngImport: i0 });
|
|
160
|
+
__decorate([
|
|
161
|
+
BindThis,
|
|
162
|
+
__metadata("design:type", Function),
|
|
163
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
|
164
|
+
__metadata("design:returntype", void 0)
|
|
165
|
+
], DateTimePickerDirective.prototype, "handleClickOutside", null);
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerDirective, decorators: [{
|
|
167
|
+
type: Directive,
|
|
168
|
+
args: [{
|
|
169
|
+
selector: '[dateTime][withPicker]',
|
|
170
|
+
exportAs: 'dateTimePicker'
|
|
171
|
+
}]
|
|
172
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
173
|
+
type: Inject,
|
|
174
|
+
args: [DATE_TIME_INPUT]
|
|
175
|
+
}] }, { type: Document, decorators: [{
|
|
176
|
+
type: Inject,
|
|
177
|
+
args: [DOCUMENT]
|
|
178
|
+
}] }, { type: undefined, decorators: [{
|
|
179
|
+
type: Inject,
|
|
180
|
+
args: [POSITION]
|
|
181
|
+
}] }, { type: undefined, decorators: [{
|
|
182
|
+
type: Inject,
|
|
183
|
+
args: [DATE_TIME_PICKER_DIRECTIVE_OPTIONS]
|
|
184
|
+
}, {
|
|
185
|
+
type: Optional
|
|
186
|
+
}] }]; }, propDecorators: { withPickerOptions: [{
|
|
187
|
+
type: Input
|
|
188
|
+
}], handleClickOutside: [] } });
|
|
189
|
+
//# sourceMappingURL=dateTimePicker.directive.js.map
|
package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,SAAS,EAAE,UAAU,EAAmB,MAAM,EAAE,KAAK,EAAqB,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjJ,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAW,QAAQ,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACzF,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAGjD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAA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ive, ElementRef, EmbeddedViewRef, Inject, Input, OnDestroy, OnInit, Optional, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {Position, POSITION, applyPositionResult, PositionPlacement} from '@anglr/common';\nimport {extend, nameof, isDescendant, BindThis} from '@jscrpt/common';\nimport {lastValueFrom, Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimePickerComponent} from '../../components';\nimport {DateTimePickerDirectiveOptions} from './dateTimePicker.interface';\nimport {DATE_TIME_PICKER_DIRECTIVE_OPTIONS} from '../../misc/tokens';\n\n/**\n * Default options for date time picker directive\n */\nconst defaultOptions: DateTimePickerDirectiveOptions =\n{\n absolute: true,\n alwaysVisible: false,\n closeOnValueSelect: true,\n disabled: false,\n positionOptions: PositionPlacement.BottomStart,\n showOnFocus: true,\n};\n\n/**\n * Directive that is used for displaying and attaching date time picker\n */\n@Directive(\n{\n selector: '[dateTime][withPicker]',\n exportAs: 'dateTimePicker'\n})\nexport class DateTimePickerDirective<TDate = unknown> implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Indication whether is value changes disabled\n */\n protected valueChangeDisabled: boolean = false;\n\n /**\n * Options for date time picker directive\n */\n protected ɵWithPickerOptions: DateTimePickerDirectiveOptions;\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Date time picker component reference\n */\n protected componentRef: ComponentRef<DateTimePickerComponent<TDate>>|undefined|null;\n\n /**\n * Instance of date time picker component\n */\n protected component: DateTimePickerComponent<TDate>|undefined|null;\n\n /**\n * Instance of date time picker element\n */\n protected componentElement: HTMLElement|undefined|null;\n\n /**\n * Subscription for value changes in picker\n */\n protected valueChangeSubscription: Subscription|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets options for date time picker directive\n */\n @Input()\n public get withPickerOptions(): Partial<DateTimePickerDirectiveOptions>\n {\n return this.ɵWithPickerOptions;\n }\n public set withPickerOptions(value: Partial<DateTimePickerDirectiveOptions>)\n {\n this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);\n }\n\n //######################### constructor #########################\n constructor(protected viewContainer: ViewContainerRef,\n protected element: ElementRef<HTMLElement>,\n @Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DOCUMENT) protected document: Document,\n @Inject(POSITION) protected position: Position,\n @Inject(DATE_TIME_PICKER_DIRECTIVE_OPTIONS) @Optional() options?: DateTimePickerDirectiveOptions,)\n {\n this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n this.showPicker();\n }\n\n this.initSubscriptions.add(this.input.valueChange.subscribe(() => this.setPickerValue()));\n\n this.initSubscriptions.add(this.input.focus.subscribe(() =>\n {\n if(this.withPickerOptions.showOnFocus)\n {\n this.showPicker();\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.hidePicker();\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Hides date time picker\n */\n public async showPicker(): Promise<void>\n {\n if(this.withPickerOptions.disabled || this.componentRef)\n {\n return;\n }\n\n this.componentRef = this.viewContainer.createComponent(DateTimePickerComponent<TDate>);\n this.componentElement = (this.componentRef?.hostView as EmbeddedViewRef<DateTimePickerComponent<TDate>>).rootNodes[0] as HTMLElement;\n this.component = this.componentRef.instance;\n\n if(this.withPickerOptions.absolute)\n {\n this.document.body.append(this.componentElement);\n }\n\n this.valueChangeSubscription = this.component.valueChange.subscribe(() =>\n {\n if(this.component)\n {\n this.valueChangeDisabled = true;\n this.input.value = this.component.value;\n this.input.valueChange.emit();\n this.valueChangeDisabled = false;\n }\n });\n\n this.document.addEventListener('click', this.handleClickOutside);\n\n const result = await lastValueFrom(this.position.placeElement(this.componentElement, this.element.nativeElement,\n {\n placement: this.withPickerOptions.positionOptions,\n }));\n\n applyPositionResult(result);\n this.setPickerValue();\n }\n\n /**\n * Shows date time picker\n */\n public hidePicker(): void\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n return;\n }\n\n this.valueChangeSubscription?.unsubscribe();\n this.valueChangeSubscription = null;\n\n this.component = null;\n\n this.componentRef?.destroy();\n this.componentRef = null;\n\n this.componentElement?.remove();\n this.componentElement = null;\n\n this.document.removeEventListener('click', this.handleClickOutside);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets all picker value\n */\n protected setPickerValue(): void\n {\n if(this.valueChangeDisabled)\n {\n return;\n }\n\n if(this.componentRef)\n {\n this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n // this.componentRef.changeDetectorRef.markForCheck();\n this.componentRef.changeDetectorRef.detectChanges();\n }\n }\n\n /**\n * Handles clicking outside of picker\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickOutside(event: MouseEvent): void\n {\n if(!this.componentElement)\n {\n return;\n }\n\n if(this.componentElement != event.target &&\n !isDescendant(this.componentElement, event.target as HTMLElement) &&\n (!this.input.element || (this.input.element != event.target &&\n !isDescendant(this.input.element, event.target as HTMLElement))))\n {\n this.hidePicker();\n }\n }\n}"]}
|
package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {PositionPlacement} from '@anglr/common';\n\n/**\n * Defintion of date time picker directive options\n */\nexport interface DateTimePickerDirectiveOptions\n{\n /**\n * Indication whether close picker on value selection\n */\n closeOnValueSelect: boolean;\n\n /**\n * Indication whether display picker when date time input gets focus\n */\n showOnFocus: boolean;\n\n /**\n * Indication whether is picker always visible, mostly used for debugging\n */\n alwaysVisible: boolean;\n\n /**\n * Indication whether picker is disabled, if true, you cant display picker\n */\n disabled: boolean;\n\n /**\n * Indication whether use absolute global positioning of picker\n */\n absolute: boolean;\n\n /**\n * Position options that are used to position picker\n */\n positionOptions: Partial<PositionPlacement>;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC","sourcesContent":["export * from './dateTimePicker/dateTimePicker.directive';\nexport * from './dateTimePicker/dateTimePicker.interface';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/dateTimePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC","sourcesContent":["export * from './components';\nexport * from './directives';\nexport * from './interfaces';\nexport * from './misc/tokens';\nexport * from './modules';\n"]}
|
package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../../misc/types';\n\n/**\n * Describes date time picker API for each date time period\n */\nexport interface DateTimePicker<TDate = unknown, TOptions = unknown>\n{\n /**\n * Value of date time picker\n */\n value: DateTimeObjectValue<TDate>|undefined|null;\n\n /**\n * Options for date time picker period\n */\n options: TOptions|undefined|null;\n\n /**\n * Date that describes which date should be displayed\n */\n display: TDate|undefined|null;\n\n /**\n * Indication whether picker can display lower granularity picker\n */\n canGoUp: boolean;\n\n /**\n * Indication whether picker can display higher granularity picker\n */\n canGoDown: boolean;\n\n /**\n * Occurs when date time picker value changes\n */\n readonly valueChange: Observable<void>; \n\n /**\n * Occurs when period with lower granularity should be displayed\n */\n readonly goUp: Observable<TDate>;\n\n /**\n * Occurs when period with higher granularity should be displayed\n */\n readonly goDown: Observable<TDate>;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC","sourcesContent":["export * from './dateTimePicker/dateTimePicker.interface';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Injection token for global options for date time picker directive
|
|
4
|
+
*/
|
|
5
|
+
export const DATE_TIME_PICKER_DIRECTIVE_OPTIONS = new InjectionToken('DATE_TIME_PICKER_DIRECTIVE_OPTIONS');
|
|
6
|
+
/**
|
|
7
|
+
* Injection token for global options for date time picker component
|
|
8
|
+
*/
|
|
9
|
+
export const DATE_TIME_PICKER_OPTIONS = new InjectionToken('DATE_TIME_PICKER_OPTIONS');
|
|
10
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAK7C;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAA4D,IAAI,cAAc,CAA0C,oCAAoC,CAAC,CAAC;AAE7M;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmD,IAAI,cAAc,CAAiC,0BAA0B,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {DateTimePickerOptions} from '../components/dateTimePicker/dateTimePicker.interface';\nimport {DateTimePickerDirectiveOptions} from '../directives/dateTimePicker/dateTimePicker.interface';\n\n/**\n * Injection token for global options for date time picker directive\n */\nexport const DATE_TIME_PICKER_DIRECTIVE_OPTIONS: InjectionToken<Partial<DateTimePickerDirectiveOptions>> = new InjectionToken<Partial<DateTimePickerDirectiveOptions>>('DATE_TIME_PICKER_DIRECTIVE_OPTIONS');\n\n/**\n * Injection token for global options for date time picker component\n */\nexport const DATE_TIME_PICKER_OPTIONS: InjectionToken<Partial<DateTimePickerOptions>> = new InjectionToken<Partial<DateTimePickerOptions>>('DATE_TIME_PICKER_OPTIONS');"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { DateTimePickerComponent } from '../components';
|
|
3
|
+
import { DateTimePickerDirective } from '../directives';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Module for components that are used as date time picker
|
|
7
|
+
*/
|
|
8
|
+
export class DateTimePickerModule {
|
|
9
|
+
}
|
|
10
|
+
DateTimePickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
|
+
DateTimePickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, declarations: [DateTimePickerComponent,
|
|
12
|
+
DateTimePickerDirective], exports: [DateTimePickerComponent,
|
|
13
|
+
DateTimePickerDirective] });
|
|
14
|
+
DateTimePickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, decorators: [{
|
|
16
|
+
type: NgModule,
|
|
17
|
+
args: [{
|
|
18
|
+
declarations: [
|
|
19
|
+
DateTimePickerComponent,
|
|
20
|
+
DateTimePickerDirective,
|
|
21
|
+
],
|
|
22
|
+
exports: [
|
|
23
|
+
DateTimePickerComponent,
|
|
24
|
+
DateTimePickerDirective,
|
|
25
|
+
],
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
//# sourceMappingURL=dateTimePicker.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.module.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/modules/dateTimePicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;;AAEtD;;GAEG;AAcH,MAAM,OAAO,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBATzB,uBAAuB;QACvB,uBAAuB,aAIvB,uBAAuB;QACvB,uBAAuB;kHAGlB,oBAAoB;2FAApB,oBAAoB;kBAbhC,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,uBAAuB;wBACvB,uBAAuB;qBAC1B;oBACD,OAAO,EACP;wBACI,uBAAuB;wBACvB,uBAAuB;qBAC1B;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateTimePickerComponent} from '../components';\nimport {DateTimePickerDirective} from '../directives';\n\n/**\n * Module for components that are used as date time picker\n */\n@NgModule(\n{\n declarations:\n [\n DateTimePickerComponent,\n DateTimePickerDirective,\n ],\n exports:\n [\n DateTimePickerComponent,\n DateTimePickerDirective,\n ],\n})\nexport class DateTimePickerModule\n{\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './dateTimePicker.module';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC","sourcesContent":["export * from './datePipes.module';\nexport * from './dateTime';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './datePipes.module';\nexport * from './dateTime';\nexport * from './dateTimePicker';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeInput.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/dateTimeInput/dateTimeInput.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {EventEmitter} from '@angular/core';\n\nimport {DateTimeInputOutputValue} from '../../misc/types';\n\n/**\n * Defines date time input value API\n */\nexport interface DateTimeInputValue<TDate = unknown>\n{\n /**\n * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue\n */\n value: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Occurs when value changes\n */\n valueChange: EventEmitter<void>;\n}\n/**\n * Defines date time input and communication API for it\n */\nexport interface DateTimeInput<TDate = unknown> extends DateTimeInputValue<TDate>\n{\n /**\n * Value of date time, raw string value which is visible to user\n */\n rawValue: string|undefined|null;\n\n /**\n * Indication whether is date time disabled\n */\n disabled: boolean;\n\n /**\n * Occurs when input gains focus\n */\n focus: EventEmitter<FocusEvent>;\n\n /**\n * Occurs when input loses focus\n */\n blur: EventEmitter<FocusEvent>;\n}"]}
|
|
1
|
+
{"version":3,"file":"dateTimeInput.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/dateTimeInput/dateTimeInput.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {EventEmitter} from '@angular/core';\n\nimport {DateTimeInputOutputValue} from '../../misc/types';\n\n/**\n * Defines date time input value API\n */\nexport interface DateTimeInputValue<TDate = unknown>\n{\n /**\n * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue\n */\n value: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Occurs when value changes\n */\n readonly valueChange: EventEmitter<void>;\n}\n/**\n * Defines date time input and communication API for it\n */\nexport interface DateTimeInput<TDate = unknown> extends DateTimeInputValue<TDate>\n{\n /**\n * Value of date time, raw string value which is visible to user\n */\n readonly rawValue: string|undefined|null;\n\n /**\n * Indication whether is date time disabled\n */\n disabled: boolean;\n\n /**\n * Occurs when input gains focus\n */\n readonly focus: EventEmitter<FocusEvent>;\n\n /**\n * Occurs when input loses focus\n */\n readonly blur: EventEmitter<FocusEvent>;\n\n /**\n * Html element that represents input itself\n */\n readonly element: HTMLElement;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/legacy/picker/components/dayPicker/dayPicker.component.ts","../../../../../../src/legacy/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WA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B,mBAGf,uBAAuB,CAAC,MAAM;;0BA4BlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../../../../interfaces/dateTime/datetime.interface';\nimport {DATE_API} from '../../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../../services/dateApi/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n /**\n * Value used for displaying time\n */\n public get timeValue(): DateTimeValue<TDate> | null\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from!) || this.displayDate.isSameMonth(this._value.to!)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>"]}
|
|
1
|
+
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/legacy/picker/components/dayPicker/dayPicker.component.ts","../../../../../../src/legacy/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;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ectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../../../../interfaces/dateTime/datetime.interface';\nimport {DATE_API} from '../../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../../services/dateApi/dateApi.interface';\nimport {DateTimeLegacyPicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimeLegacyPicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n /**\n * Value used for displaying time\n */\n public get timeValue(): DateTimeValue<TDate> | null\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from!) || this.displayDate.isSameMonth(this._value.to!)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../../src/legacy/picker/components/monthPicker/monthPicker.component.ts","../../../../../../src/legacy/picker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,4BAA0C,SAAQ,mBAAmE;IAE9H,iEAAiE;IACjE,YAA8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AAa,EAAE,CAAC;QAErB,qBAAqB;QACrB,IAAG,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG,CAAC,CAAC,EAClH;YACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC9B;IACL,CAAC;IAED,uEAAuE;IAEvE;;;OAGG;IACO,YAAY,CAAC,MAAyB;QAE5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;IAClE,CAAC;IAED;;;OAGG;IACO,wBAAwB,CAAC,GAAyB;QAExD,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAyB,EAAE,MAAa;QAE5D,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;;yHAhHQ,4BAA4B,kBAGjB,QAAQ;6GAHnB,4BAA4B,qFCjCzC,gxBAYM;2FDqBO,4BAA4B;kBAPxC,SAAS;+BAEI,wBAAwB,mBAGjB,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../../services/dateApi/dateApi.interface';\nimport {
|
|
1
|
+
{"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../../src/legacy/picker/components/monthPicker/monthPicker.component.ts","../../../../../../src/legacy/picker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,4BAA0C,SAAQ,mBAAmE;IAE9H,iEAAiE;IACjE,YAA8B,OAAuB,EACzC,cAAiC;QAEzC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAE/B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;IAED,wFAAwF;IAExF;;;;OAIG;IACI,QAAQ,CAAC,KAAY;QAExB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,WAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAY,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,KAAY;QAE5B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,WAAY,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAEnC,IAAI,CAAC,OAAO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C,UAAU,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAyB,EAAE,MAAa;QAE5D,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;;yHAhHQ,4BAA4B,kBAGjB,QAAQ;6GAHnB,4BAA4B,qFCjCzC,gxBAYM;2FDqBO,4BAA4B;kBAPxC,SAAS;+BAEI,wBAAwB,mBAGjB,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../../services/dateApi/dateApi.interface';\nimport {DateTimeLegacyPicker, MonthData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {MonthPickerCssClasses} from './monthPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: MonthPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying month picker\n */\n@Component(\n{\n selector: 'date-time-month-picker',\n templateUrl: 'monthPicker.component.html',\n styleUrls: ['monthPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements DateTimeLegacyPicker<TDate, MonthPickerCssClasses>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed year to next year\n * @param event - Event that occured\n * @internal\n */\n public nextYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.addYears(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed year to previous year\n * @param event - Event that occured\n * @internal\n */\n public previousYear(event: Event)\n {\n event.preventDefault();\n this.displayDate!.subtractYears(1);\n\n this.display(this.displayDate!);\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n\n const monthOfYear = this.displayDate.startOfYear().updateOriginal();\n this.periodData = [];\n\n for(let x = 0; x < 12; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: monthOfYear.value,\n name: monthOfYear.format('MMM')\n });\n\n monthOfYear.addMonths(1);\n }\n\n this.displayDate.resetOriginal();\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameYear(this._value.from!) || this.displayDate.isSameYear(this._value.to!)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfMonth().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameYear(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameMonth(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this.periodData[val.month()];\n }\n}","<div [ngClass]=\"cssClasses.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses.previousPeriod | asRequired\" (mousedown)=\"previousYear($event)\"></div>\r\n <div [ngClass]=\"cssClasses.periodValue | asRequired\" [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.format('yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses.nextPeriod | asRequired\" (mousedown)=\"nextYear($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses.periodData | asRequired\">\r\n <div *ngFor=\"let month of periodData\"\r\n [ngClass]=\"cssClasses.periodDatum | asRequired\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"select($event, month)\">{{month.name}}</div>\r\n</div>"]}
|
|
@@ -26,7 +26,7 @@ const defaultConfiguration = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Component used for displaying date time picker
|
|
28
28
|
*/
|
|
29
|
-
export class
|
|
29
|
+
export class DateTimePickerLegacyComponent {
|
|
30
30
|
//######################### constructor #########################
|
|
31
31
|
constructor(configuration, _dateApi, _changeDetector) {
|
|
32
32
|
this._dateApi = _dateApi;
|
|
@@ -210,9 +210,9 @@ export class DateTimePickerComponent {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type:
|
|
213
|
+
DateTimePickerLegacyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerLegacyComponent, deps: [{ token: DATE_TIME_PICKER_CONFIGURATION, optional: true }, { token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
214
|
+
DateTimePickerLegacyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerLegacyComponent, selector: "date-time-picker", inputs: { options: "options", value: "value", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div [@scaleUpDown]=\"activePickerIndex\">\r\n <ng-template [ngComponentOutletEx]=\"activePickerComponent!\" (ngComponentOutletExCreated)=\"pickerCreated($event!)\"></ng-template>\r\n</div>", styles: [":host\r\n{\r\n display: inline-block;\r\n}"], dependencies: [{ kind: "directive", type: i1.NgComponentOutletEx, selector: "[ngComponentOutletEx]", inputs: ["ngComponentOutletEx", "ngComponentOutletExInjector", "ngComponentOutletExContent"], outputs: ["ngComponentOutletExCreated"], exportAs: ["ngComponentOutletEx"] }], animations: [scaleUpDownTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerLegacyComponent, decorators: [{
|
|
216
216
|
type: Component,
|
|
217
217
|
args: [{ selector: 'date-time-picker', animations: [scaleUpDownTrigger], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [@scaleUpDown]=\"activePickerIndex\">\r\n <ng-template [ngComponentOutletEx]=\"activePickerComponent!\" (ngComponentOutletExCreated)=\"pickerCreated($event!)\"></ng-template>\r\n</div>", styles: [":host\r\n{\r\n display: inline-block;\r\n}"] }]
|
|
218
218
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|