@anglr/datetime 5.0.0-beta.20221018120203 → 5.0.0-beta.20221019112435
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 +63 -1
- package/es2015/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
- package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js +0 -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 +195 -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 +78 -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 +195 -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/es2015/src/pipes/dateFormat.pipe.js +3 -9
- package/es2015/src/pipes/dateFormat.pipe.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 +0 -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 +192 -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 +75 -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 +188 -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/es2020/src/pipes/dateFormat.pipe.js +3 -9
- package/es2020/src/pipes/dateFormat.pipe.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 -6
- 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 +66 -0
- package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +80 -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 +35 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +21 -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 +48 -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/src/pipes/dateFormat.pipe.d.ts +28 -2
- package/src/pipes/dateFormat.pipe.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule as AngularCommonModule } from '@angular/common';
|
|
3
3
|
import { CommonDynamicModule, CastPipesModule, ClickOutsideModule, CommonUtilsModule } from '@anglr/common';
|
|
4
|
-
import {
|
|
4
|
+
import { DateTimePickerLegacyComponent } from '../components/picker/picker.component';
|
|
5
5
|
import { DateTimeDayPickerComponent } from '../components/dayPicker/dayPicker.component';
|
|
6
6
|
import { DateTimeMonthPickerComponent } from '../components/monthPicker/monthPicker.component';
|
|
7
7
|
import { DateTimeYearPickerComponent } from '../components/yearPicker/yearPicker.component';
|
|
@@ -12,10 +12,10 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
/**
|
|
13
13
|
* Angular module for date time picker components
|
|
14
14
|
*/
|
|
15
|
-
export class
|
|
15
|
+
export class DateTimeLegacyPickerModule {
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
DateTimeLegacyPickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeLegacyPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
18
|
+
DateTimeLegacyPickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimeLegacyPickerModule, declarations: [DateTimePickerLegacyComponent,
|
|
19
19
|
DateTimeRollerTimePickerComponent,
|
|
20
20
|
DateTimeDayPickerComponent,
|
|
21
21
|
DateTimeMonthPickerComponent,
|
|
@@ -26,14 +26,14 @@ DateTimePickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
26
26
|
CommonUtilsModule,
|
|
27
27
|
DatePipesModule,
|
|
28
28
|
CastPipesModule,
|
|
29
|
-
ClickOutsideModule], exports: [
|
|
30
|
-
|
|
29
|
+
ClickOutsideModule], exports: [DateTimePickerLegacyComponent] });
|
|
30
|
+
DateTimeLegacyPickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeLegacyPickerModule, imports: [AngularCommonModule,
|
|
31
31
|
CommonDynamicModule,
|
|
32
32
|
CommonUtilsModule,
|
|
33
33
|
DatePipesModule,
|
|
34
34
|
CastPipesModule,
|
|
35
35
|
ClickOutsideModule] });
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type:
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeLegacyPickerModule, decorators: [{
|
|
37
37
|
type: NgModule,
|
|
38
38
|
args: [{
|
|
39
39
|
imports: [
|
|
@@ -45,7 +45,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
45
45
|
ClickOutsideModule,
|
|
46
46
|
],
|
|
47
47
|
declarations: [
|
|
48
|
-
|
|
48
|
+
DateTimePickerLegacyComponent,
|
|
49
49
|
DateTimeRollerTimePickerComponent,
|
|
50
50
|
DateTimeDayPickerComponent,
|
|
51
51
|
DateTimeMonthPickerComponent,
|
|
@@ -54,7 +54,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
54
54
|
LoopScrollDirective,
|
|
55
55
|
],
|
|
56
56
|
exports: [
|
|
57
|
-
|
|
57
|
+
DateTimePickerLegacyComponent
|
|
58
58
|
]
|
|
59
59
|
}]
|
|
60
60
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.module.js","sourceRoot":"","sources":["../../../../../src/legacy/picker/modules/picker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC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0BAA0B;kBA1BtC,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,mBAAmB;wBACnB,mBAAmB;wBACnB,iBAAiB;wBACjB,eAAe;wBACf,eAAe;wBACf,kBAAkB;qBACrB;oBACD,YAAY,EACZ;wBACI,6BAA6B;wBAC7B,iCAAiC;wBACjC,0BAA0B;wBAC1B,4BAA4B;wBAC5B,2BAA2B;wBAC3B,uBAAuB;wBACvB,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,6BAA6B;qBAChC;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule as AngularCommonModule} from '@angular/common';\nimport {CommonDynamicModule, CastPipesModule, ClickOutsideModule, CommonUtilsModule} from '@anglr/common';\n\nimport {DateTimePickerLegacyComponent} from '../components/picker/picker.component';\nimport {DateTimeDayPickerComponent} from '../components/dayPicker/dayPicker.component';\nimport {DateTimeMonthPickerComponent} from '../components/monthPicker/monthPicker.component';\nimport {DateTimeYearPickerComponent} from '../components/yearPicker/yearPicker.component';\nimport {DatePipesModule} from '../../../modules/datePipes.module';\nimport {DateTimeRollerTimePickerComponent} from '../components/rollerTimePicker/rollerTimePicker.component';\nimport {LoopScrollDataDirective, LoopScrollDirective} from '../directives';\n\n/**\n * Angular module for date time picker components\n */\n@NgModule(\n{\n imports:\n [\n AngularCommonModule,\n CommonDynamicModule,\n CommonUtilsModule,\n DatePipesModule,\n CastPipesModule,\n ClickOutsideModule,\n ],\n declarations:\n [\n DateTimePickerLegacyComponent,\n DateTimeRollerTimePickerComponent,\n DateTimeDayPickerComponent,\n DateTimeMonthPickerComponent,\n DateTimeYearPickerComponent,\n LoopScrollDataDirective,\n LoopScrollDirective,\n ],\n exports:\n [\n DateTimePickerLegacyComponent\n ]\n})\nexport class DateTimeLegacyPickerModule\n{\n}"]}
|
|
@@ -2,7 +2,7 @@ import { Directive, ElementRef, EventEmitter, Inject, Injector, Input, Optional,
|
|
|
2
2
|
import { DOCUMENT } from '@angular/common';
|
|
3
3
|
import { POSITION, applyPositionResult } from '@anglr/common';
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
|
-
import {
|
|
5
|
+
import { DateTimePickerLegacyComponent } from '../../../picker/types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Directive for rendering datetime picker in selector
|
|
@@ -81,7 +81,7 @@ export class DateTimePickerRendererDirective {
|
|
|
81
81
|
}
|
|
82
82
|
// 1. Create a component reference from the component
|
|
83
83
|
this._pickerComponent = this._viewContainer
|
|
84
|
-
.createComponent(
|
|
84
|
+
.createComponent(DateTimePickerLegacyComponent, {
|
|
85
85
|
injector: this._injector
|
|
86
86
|
});
|
|
87
87
|
if (this._pickerComponent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimePickerRenderer.directive.js","sourceRoot":"","sources":["../../../../../../src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAgC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC5L,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAY,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"dateTimePickerRenderer.directive.js","sourceRoot":"","sources":["../../../../../../src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,UAAU,EAAmB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAgC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC5L,OAA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CAAC;gBAChD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;aACnL;iBAED;gBACI,OAAO;aACV;SACJ;IACL,CAAC;;4HA3KQ,+BAA+B,0EAwEpB,QAAQ,6BACR,QAAQ;gHAzEnB,+BAA+B;2FAA/B,+BAA+B;kBAJ3C,SAAS;mBACV;oBACI,QAAQ,EAAE,kBAAkB;iBAC/B;;0BAyEgB,MAAM;2BAAC,QAAQ;;0BAAG,QAAQ;;0BAC1B,MAAM;2BAAC,QAAQ;4CAtCrB,OAAO;sBADb,KAAK;gBAOC,KAAK;sBADX,KAAK;uBAAC,gBAAgB;gBAOhB,QAAQ;sBADd,KAAK;gBAOC,QAAQ;sBADd,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBASC,WAAW;sBADjB,MAAM","sourcesContent":["import {ComponentRef, Directive, ElementRef, EmbeddedViewRef, EventEmitter, Inject, Injector, Input, OnChanges, OnDestroy, OnInit, Optional, Output, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {POSITION, Position, applyPositionResult} from '@anglr/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeValue} from '../../../../interfaces/dateTime/datetime.interface';\nimport {DateTimeSelector, DateTimeSelectorOptions} from '../../interfaces';\nimport {DateTimePickerLegacyComponent} from '../../../picker/types';\n\n/**\n * Directive for rendering datetime picker in selector\n */\n@Directive(\n{\n selector: '[dateTimePicker]'\n})\nexport class DateTimePickerRendererDirective<TDate = any> implements OnInit, OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of component used for rendering picker\n */\n protected _pickerComponent?: ComponentRef<DateTimePickerLegacyComponent>;\n\n /**\n * Instance of HTML element for picker\n */\n protected _pickerElement?: HTMLElement;\n\n /**\n * Subscriptions created during initialization\n */\n protected _initSubscriptions: Subscription = new Subscription();\n\n //######################### protected properties #########################\n\n /**\n * Current options used by selector\n */\n protected get _options(): DateTimeSelectorOptions<DateTimeSelector<TDate>>\n {\n return this.options as DateTimeSelectorOptions<DateTimeSelector<TDate>>;\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Current options used by selector\n */\n @Input()\n public options!: Partial<DateTimeSelectorOptions<DateTimeSelector<TDate>>>;\n\n /**\n * Current selected value\n */\n @Input('dateTimePicker')\n public value!: DateTimeValue<TDate>|null;\n\n /**\n * Gets or sets minimal possible value for picker, that can be picked\n */\n @Input()\n public minValue!: TDate|null;\n\n /**\n * Gets or sets maximal possible value for picker, that can be picked\n */\n @Input()\n public maxValue!: TDate|null;\n\n /**\n * Selector element which is used during absolute positioning of picker\n */\n @Input()\n public selectorElement!: ElementRef<HTMLElement>;\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when value changes\n */\n @Output()\n public valueChange: EventEmitter<DateTimeValue<TDate>> = new EventEmitter<DateTimeValue<TDate>>();\n\n //######################### constructor #########################\n constructor(protected _viewContainer: ViewContainerRef,\n protected _injector: Injector,\n @Inject(POSITION) @Optional() protected _position: Position,\n @Inject(DOCUMENT) protected _document: Document)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._createPicker();\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(): void\n {\n this._createPicker();\n\n if(this._pickerComponent)\n {\n const picker = this._pickerComponent.instance;\n\n picker.value = this.value;\n picker.minValue = this.minValue;\n picker.maxValue = this.maxValue;\n picker.options = this.options;\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._destroyPicker();\n this._initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Destroys picker component\n */\n protected _destroyPicker(): void\n {\n if(this._pickerComponent)\n {\n this._pickerComponent.destroy();\n this._pickerComponent = undefined;\n this._pickerElement = undefined;\n }\n }\n\n /**\n * Creates picker component\n */\n protected _createPicker(): void\n {\n if(this._pickerComponent)\n {\n return;\n }\n\n // 1. Create a component reference from the component\n this._pickerComponent = this._viewContainer\n .createComponent(DateTimePickerLegacyComponent,\n {\n injector: this._injector\n });\n\n if(this._pickerComponent)\n {\n this._initSubscriptions.add(this._pickerComponent.instance.valueChange.subscribe(itm => this.valueChange.next(itm)));\n\n //absolutely position\n if(this._options.pickerAbsolute && this._position)\n {\n // 3. Get DOM element from component\n this._pickerElement = (this._pickerComponent.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n // 4. Append DOM element to the body\n this._document.querySelector(this._options.pickerAbsoluteContainer)?.appendChild(this._pickerElement);\n this._pickerElement.style.position = 'absolute';\n this._initSubscriptions.add(this._position.placeElement(this._pickerElement, this.selectorElement.nativeElement, this._options.positionOptions).subscribe(applyPositionResult));\n }\n else\n {\n return;\n }\n }\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetimeSelector.interface.js","sourceRoot":"","sources":["../../../../../src/legacy/selector/misc/datetimeSelector.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from '@angular/core';\nimport {PositionOptions} from '@anglr/common';\nimport {Observable} from 'rxjs';\n\nimport {DateTimeValue} from '../../../interfaces/dateTime/datetime.interface';\nimport {
|
|
1
|
+
{"version":3,"file":"datetimeSelector.interface.js","sourceRoot":"","sources":["../../../../../src/legacy/selector/misc/datetimeSelector.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from '@angular/core';\nimport {PositionOptions} from '@anglr/common';\nimport {Observable} from 'rxjs';\n\nimport {DateTimeValue} from '../../../interfaces/dateTime/datetime.interface';\nimport {DateTimePickerLegacyOptions} from '../../picker/misc/datetimePicker.interface';\n\n/**\n * Defintion of datetime selector component options\n */\nexport interface DateTimeSelectorOptions<TSelector = any, TPicker = any> extends DateTimePickerLegacyOptions<TPicker>\n{\n /**\n * Definition of type that is used for selector\n */\n selectorComponent: Type<TSelector>;\n\n /**\n * Indication whether close picker on value selection\n */\n pickerCloseOnValueSelect: boolean;\n\n /**\n * Indication whether picker is disabled\n */\n pickerDisabled: boolean;\n\n /**\n * Indication whether use absolute positioning of picker\n */\n pickerAbsolute: boolean;\n\n /**\n * Position options that are used in case of absolute picker\n */\n positionOptions: Partial<PositionOptions>;\n\n /**\n * Css selector for absolute picker container\n */\n pickerAbsoluteContainer: string;\n}\n\n/**\n * Describes datetime selector component used for displaying and selecting value\n */\nexport interface DateTimeSelector<TDate = any>\n{\n /**\n * Currently used format for displaying data\n */\n format: string;\n\n /**\n * Placeholder that is displayed when there is no value selected\n */\n placeholder: string|null;\n\n /**\n * Gets current value of datetime\n */\n readonly value: DateTimeValue<TDate>|null;\n\n /**\n * Gets formatted value\n */\n readonly formattedValue: string|null;\n\n /**\n * Gets indication whether is current value valid\n */\n readonly valid: boolean;\n\n /**\n * Occurs when value changes\n */\n readonly valueChange: Observable<void>;\n\n /**\n * Occurs when selector is touched by user\n */\n readonly touched: Observable<void>;\n\n /**\n * Occurs when selector requires picker to be displayed or hidden\n */\n readonly pickerRequest: Observable<boolean>;\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n setMinValue(value: TDate|null): void;\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n setMaxValue(value: TDate|null): void;\n\n /**\n * Sets value of datetime selector\n * @param value - Value to be set to this selector\n */\n setValue(value: DateTimeValue<TDate>|null): void;\n\n /**\n * Sets as 'control' disabled\n * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true\n */\n setDisabled(disabled?: boolean): void;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule as AngularCommonModule } from '@angular/common';
|
|
3
3
|
import { CommonDynamicModule } from '@anglr/common';
|
|
4
|
-
import {
|
|
4
|
+
import { DateTimeLegacyPickerModule } from '../../picker/modules/picker.module';
|
|
5
5
|
import { DateTimeSelectorComponent } from '../components/selector/selector.component';
|
|
6
6
|
import { InputDateTimeSelectorComponent } from '../components/inputDateTime/inputDateTime.component';
|
|
7
7
|
import { DateTimeSelectorControlValueAccessor } from '../directives/selectorControlValueAccessor/selectorControlValueAccessor.directive';
|
|
@@ -24,7 +24,7 @@ DateTimeSelectorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
|
|
|
24
24
|
DatetimeMaxValidatorDirective,
|
|
25
25
|
DateTimePickerRendererDirective], imports: [AngularCommonModule,
|
|
26
26
|
CommonDynamicModule,
|
|
27
|
-
|
|
27
|
+
DateTimeLegacyPickerModule], exports: [DateTimeSelectorComponent,
|
|
28
28
|
DateTimeSelectorControlValueAccessor,
|
|
29
29
|
DatetimeValidatorDirective,
|
|
30
30
|
DatetimeMinValidatorDirective,
|
|
@@ -32,14 +32,14 @@ DateTimeSelectorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
|
|
|
32
32
|
DateTimePickerRendererDirective] });
|
|
33
33
|
DateTimeSelectorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeSelectorModule, imports: [AngularCommonModule,
|
|
34
34
|
CommonDynamicModule,
|
|
35
|
-
|
|
35
|
+
DateTimeLegacyPickerModule] });
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeSelectorModule, decorators: [{
|
|
37
37
|
type: NgModule,
|
|
38
38
|
args: [{
|
|
39
39
|
imports: [
|
|
40
40
|
AngularCommonModule,
|
|
41
41
|
CommonDynamicModule,
|
|
42
|
-
|
|
42
|
+
DateTimeLegacyPickerModule,
|
|
43
43
|
],
|
|
44
44
|
declarations: [
|
|
45
45
|
DateTimeSelectorComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector.module.js","sourceRoot":"","sources":["../../../../../src/legacy/selector/modules/selector.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,IAAI,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAElD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"selector.module.js","sourceRoot":"","sources":["../../../../../src/legacy/selector/modules/selector.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,IAAI,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAElD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAC,yBAAyB,EAAC,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAC,8BAA8B,EAAC,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAC,oCAAoC,EAAC,MAAM,mFAAmF,CAAC;AACvI,OAAO,EAAC,0BAA0B,EAAC,MAAM,6DAA6D,CAAC;AACvG,OAAO,EAAC,6BAA6B,EAAC,MAAM,mEAAmE,CAAC;AAChH,OAAO,EAAC,6BAA6B,EAAC,MAAM,mEAAmE,CAAC;AAChH,OAAO,EAAC,+BAA+B,EAAC,MAAM,uEAAuE,CAAC;;AAEtH;;GAEG;AA6BH,MAAM,OAAO,sBAAsB;;mHAAtB,sBAAsB;oHAAtB,sBAAsB,iBAlB3B,yBAAyB;QACzB,8BAA8B;QAC9B,oCAAoC;QACpC,0BAA0B;QAC1B,6BAA6B;QAC7B,6BAA6B;QAC7B,+BAA+B,aAZ/B,mBAAmB;QACnB,mBAAmB;QACnB,0BAA0B,aAc1B,yBAAyB;QACzB,oCAAoC;QACpC,0BAA0B;QAC1B,6BAA6B;QAC7B,6BAA6B;QAC7B,+BAA+B;oHAG1B,sBAAsB,YAxB3B,mBAAmB;QACnB,mBAAmB;QACnB,0BAA0B;2FAsBrB,sBAAsB;kBA5BlC,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,mBAAmB;wBACnB,mBAAmB;wBACnB,0BAA0B;qBAC7B;oBACD,YAAY,EACZ;wBACI,yBAAyB;wBACzB,8BAA8B;wBAC9B,oCAAoC;wBACpC,0BAA0B;wBAC1B,6BAA6B;wBAC7B,6BAA6B;wBAC7B,+BAA+B;qBAClC;oBACD,OAAO,EACP;wBACI,yBAAyB;wBACzB,oCAAoC;wBACpC,0BAA0B;wBAC1B,6BAA6B;wBAC7B,6BAA6B;wBAC7B,+BAA+B;qBAClC;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule as AngularCommonModule} from '@angular/common';\nimport {CommonDynamicModule} from '@anglr/common';\n\nimport {DateTimeLegacyPickerModule} from '../../picker/modules/picker.module';\nimport {DateTimeSelectorComponent} from '../components/selector/selector.component';\nimport {InputDateTimeSelectorComponent} from '../components/inputDateTime/inputDateTime.component';\nimport {DateTimeSelectorControlValueAccessor} from '../directives/selectorControlValueAccessor/selectorControlValueAccessor.directive';\nimport {DatetimeValidatorDirective} from '../directives/datetimeValidator/datetimeValidator.directive';\nimport {DatetimeMinValidatorDirective} from '../directives/datetimeMinValidator/datetimeMinValidator.directive';\nimport {DatetimeMaxValidatorDirective} from '../directives/datetimeMaxValidator/datetimeMaxValidator.directive';\nimport {DateTimePickerRendererDirective} from '../directives/dateTimePickerRenderer/dateTimePickerRenderer.directive';\n\n/**\n * Angular module for date time selector components\n */\n@NgModule(\n{\n imports:\n [\n AngularCommonModule,\n CommonDynamicModule,\n DateTimeLegacyPickerModule,\n ],\n declarations:\n [\n DateTimeSelectorComponent,\n InputDateTimeSelectorComponent,\n DateTimeSelectorControlValueAccessor,\n DatetimeValidatorDirective,\n DatetimeMinValidatorDirective,\n DatetimeMaxValidatorDirective,\n DateTimePickerRendererDirective,\n ],\n exports:\n [\n DateTimeSelectorComponent,\n DateTimeSelectorControlValueAccessor,\n DatetimeValidatorDirective,\n DatetimeMinValidatorDirective,\n DatetimeMaxValidatorDirective,\n DateTimePickerRendererDirective,\n ]\n})\nexport class DateTimeSelectorModule\n{\n}"]}
|
|
@@ -13,9 +13,9 @@ import * as i1 from "../../../../services";
|
|
|
13
13
|
*/
|
|
14
14
|
export class DateTimeInputDirective extends DateTimeBase {
|
|
15
15
|
//######################### constructors #########################
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(elementRef, dateApi, formatProvider, valueProvider) {
|
|
17
17
|
super(dateApi, formatProvider);
|
|
18
|
-
this.
|
|
18
|
+
this.elementRef = elementRef;
|
|
19
19
|
this.valueProvider = valueProvider;
|
|
20
20
|
/**
|
|
21
21
|
* @inheritdoc
|
|
@@ -25,19 +25,19 @@ export class DateTimeInputDirective extends DateTimeBase {
|
|
|
25
25
|
* @inheritdoc
|
|
26
26
|
*/
|
|
27
27
|
this.blur = new EventEmitter();
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
28
|
+
this.elementRef.nativeElement.addEventListener('input', this.handleInput);
|
|
29
|
+
this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);
|
|
30
|
+
this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);
|
|
31
31
|
}
|
|
32
32
|
//######################### public properties - implementation of DateTimeInput #########################
|
|
33
33
|
/**
|
|
34
34
|
* @inheritdoc
|
|
35
35
|
*/
|
|
36
36
|
get rawValue() {
|
|
37
|
-
return this.
|
|
37
|
+
return this.elementRef.nativeElement.value;
|
|
38
38
|
}
|
|
39
39
|
set rawValue(value) {
|
|
40
|
-
this.
|
|
40
|
+
this.elementRef.nativeElement.value = value !== null && value !== void 0 ? value : '';
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* @inheritdoc
|
|
@@ -62,19 +62,25 @@ export class DateTimeInputDirective extends DateTimeBase {
|
|
|
62
62
|
* @inheritdoc
|
|
63
63
|
*/
|
|
64
64
|
get disabled() {
|
|
65
|
-
return this.
|
|
65
|
+
return this.elementRef.nativeElement.disabled;
|
|
66
66
|
}
|
|
67
67
|
set disabled(value) {
|
|
68
|
-
this.
|
|
68
|
+
this.elementRef.nativeElement.disabled = value;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Html element that represents input itself
|
|
72
|
+
*/
|
|
73
|
+
get element() {
|
|
74
|
+
return this.elementRef.nativeElement;
|
|
69
75
|
}
|
|
70
76
|
//######################### public methods - implementation of OnDestroy #########################
|
|
71
77
|
/**
|
|
72
78
|
* Called when component is destroyed
|
|
73
79
|
*/
|
|
74
80
|
ngOnDestroy() {
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
81
|
+
this.elementRef.nativeElement.removeEventListener('input', this.handleInput);
|
|
82
|
+
this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);
|
|
83
|
+
this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);
|
|
78
84
|
}
|
|
79
85
|
//######################### protected methods #########################
|
|
80
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAC,MAAM,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\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput, FormatProvider} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputDirective),\n },\n ],\n exportAs: 'dateTime',\n})\nexport class DateTimeInputDirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.element.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.element.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.element.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.element.nativeElement.disabled = value;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected element: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super(dateApi, formatProvider);\n\n this.element.nativeElement.addEventListener('input', this.handleInput);\n this.element.nativeElement.addEventListener('focus', this.handleFocus);\n this.element.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.element.nativeElement.removeEventListener('input', this.handleInput);\n this.element.nativeElement.removeEventListener('focus', this.handleFocus);\n this.element.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAcH,MAAM,OAAO,sBAAwC,SAAQ,YAAmB;IA6E5E,kEAAkE;IAClE,YAAsB,UAAwC,EAChC,OAAuB,EAChB,cAA8B,EAC7C,aAAuC;QAEzD,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QALb,eAAU,GAAV,UAAU,CAA8B;QAGxC,kBAAa,GAAb,aAAa,CAA0B;QAd7D;;WAEG;QACI,UAAK,GAA6B,IAAI,YAAY,EAAc,CAAC;QAExE;;WAEG;QACI,SAAI,GAA6B,IAAI,YAAY,EAAc,CAAC;QAUnE,IAAI,CAAC,UAAU,CAAC,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,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;mHAjMQ,sBAAsB,4CA+EX,QAAQ,aACR,eAAe;uGAhF1B,sBAAsB,yDAT/B;QAEI;YACI,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;SACxD;KACJ;;IA+JA,QAAQ;;;;yDAiBR;;IAMA,QAAQ;;qCACoB,UAAU;;yDAGtC;;IAMA,QAAQ;;qCACmB,UAAU;;wDAGrC;2FAjMQ,sBAAsB;kBAblC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;yBACxD;qBACJ;oBACD,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,eAAe;4EA6EzB,WAAW,MAuBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput, FormatProvider} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputDirective),\n },\n ],\n exportAs: 'dateTime',\n})\nexport class DateTimeInputDirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super(dateApi, formatProvider);\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Base abstract class for each date time period picker
|
|
4
|
+
*/
|
|
5
|
+
export class DateTimePeriodPickerBase {
|
|
6
|
+
constructor() {
|
|
7
|
+
//######################### protected properties #########################
|
|
8
|
+
/**
|
|
9
|
+
* Subject used for emitting of value changes
|
|
10
|
+
*/
|
|
11
|
+
this.valueChangeSubject = new Subject();
|
|
12
|
+
/**
|
|
13
|
+
* Subject used for scaling up
|
|
14
|
+
*/
|
|
15
|
+
this.scaleUpSubject = new Subject();
|
|
16
|
+
/**
|
|
17
|
+
* Subject used for scaling down
|
|
18
|
+
*/
|
|
19
|
+
this.scaleDownSubject = new Subject();
|
|
20
|
+
/**
|
|
21
|
+
* @inheritdoc
|
|
22
|
+
*/
|
|
23
|
+
this.canScaleUp = false;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritdoc
|
|
26
|
+
*/
|
|
27
|
+
this.canScaleDown = false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritdoc
|
|
31
|
+
*/
|
|
32
|
+
get valueChange() {
|
|
33
|
+
return this.valueChangeSubject.asObservable();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @inheritdoc
|
|
37
|
+
*/
|
|
38
|
+
get scaleUp() {
|
|
39
|
+
return this.scaleUpSubject.asObservable();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @inheritdoc
|
|
43
|
+
*/
|
|
44
|
+
get scaleDown() {
|
|
45
|
+
return this.scaleDownSubject.asObservable();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=dateTimePeriodPickerBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePeriodPickerBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/components/dateTimePeriodPickerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAMzC;;GAEG;AACH,MAAM,OAAgB,wBAAwB;IAA9C;QAEI,0EAA0E;QAE1E;;WAEG;QACO,uBAAkB,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAElE;;WAEG;QACO,mBAAc,GAAmB,IAAI,OAAO,EAAS,CAAC;QAEhE;;WAEG;QACO,qBAAgB,GAAmB,IAAI,OAAO,EAAS,CAAC;QAkClE;;WAEG;QACI,eAAU,GAAY,KAAK,CAAC;QAEnC;;WAEG;QACI,iBAAY,GAAY,KAAK,CAAC;IAyBzC,CAAC;IAvBG;;OAEG;IACH,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAEhB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;CACJ","sourcesContent":["import {Observable, Subject} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../misc/types';\nimport {DateApiObject} from '../../../services';\nimport {DateTimePicker} from '../interfaces';\n\n/**\n * Base abstract class for each date time period picker\n */\nexport abstract class DateTimePeriodPickerBase<TDate = unknown, TOptions = unknown> implements DateTimePicker<TDate, TOptions>\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting of value changes\n */\n protected valueChangeSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for scaling up\n */\n protected scaleUpSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Subject used for scaling down\n */\n protected scaleDownSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Date api instance for displayed date\n */\n protected displayDate: DateApiObject<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * @inheritdoc\n */\n public value: DateTimeObjectValue<TDate>|undefined|null;\n\n /**\n * @inheritdoc\n */\n public options: TOptions|undefined|null;\n\n /**\n * @inheritdoc\n */\n public display: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public maxDate: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public minDate: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public canScaleUp: boolean = false;\n\n /**\n * @inheritdoc\n */\n public canScaleDown: boolean = false;\n\n /**\n * @inheritdoc\n */\n public get valueChange(): Observable<void>\n {\n return this.valueChangeSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get scaleUp(): Observable<TDate>\n {\n return this.scaleUpSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get scaleDown(): Observable<TDate>\n {\n return this.scaleDownSubject.asObservable();\n }\n}"]}
|
package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef, EventEmitter, Output, Input, Inject, Optional } from '@angular/core';
|
|
2
|
+
import { POSITION } from '@anglr/common';
|
|
3
|
+
import { extend, isBlank, nameof } from '@jscrpt/common';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import { DATE_TIME_PICKER_OPTIONS } from '../../misc/tokens';
|
|
6
|
+
import { DayPickerSAComponent } from '../dayPicker/dayPicker.component';
|
|
7
|
+
import { DATE_API, FORMAT_PROVIDER } from '../../../../misc/tokens';
|
|
8
|
+
import { formatDateTime, parseDateTime } from '../../../../misc/utils';
|
|
9
|
+
import { DateTimeValueFormat } from '../../../../misc/enums';
|
|
10
|
+
import { DateTimeRestrictedBase } from '../../../dateTime/directives/dateTimeRestrictedBase';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
/**
|
|
13
|
+
* Text to be displayed when configuration, options are corrupted
|
|
14
|
+
*/
|
|
15
|
+
const CORRUPTED_CONFIG_TEXT = 'DateTime: Corrupted configuration for DateTimePicker!';
|
|
16
|
+
/**
|
|
17
|
+
* Default options for date time picker
|
|
18
|
+
*/
|
|
19
|
+
const defaultOptions = {
|
|
20
|
+
defaultPeriod: 'day',
|
|
21
|
+
periodsDefinition: {
|
|
22
|
+
'day': DayPickerSAComponent,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Component used for displaying date time picker
|
|
27
|
+
*/
|
|
28
|
+
export class DateTimePickerComponent extends DateTimeRestrictedBase {
|
|
29
|
+
//######################### constructor #########################
|
|
30
|
+
constructor(position, dateApi, formatProvider, options) {
|
|
31
|
+
super(dateApi, formatProvider);
|
|
32
|
+
this.position = position;
|
|
33
|
+
//######################### public properties - outputs #########################
|
|
34
|
+
/**
|
|
35
|
+
* @inheritdoc
|
|
36
|
+
*/
|
|
37
|
+
this.valueChange = new EventEmitter();
|
|
38
|
+
this.ɵOptions = extend(true, {}, defaultOptions, options);
|
|
39
|
+
if (options === null || options === void 0 ? void 0 : options.periodsDefinition) {
|
|
40
|
+
this.ɵOptions.periodsDefinition = options.periodsDefinition;
|
|
41
|
+
}
|
|
42
|
+
this.displayedPeriodName = this.ɵOptions.defaultPeriod;
|
|
43
|
+
this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
|
|
44
|
+
if (!this.displayedPeriodType) {
|
|
45
|
+
throw new Error(CORRUPTED_CONFIG_TEXT);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//######################### public properties - inputs #########################
|
|
49
|
+
/**
|
|
50
|
+
* @inheritdoc
|
|
51
|
+
*/
|
|
52
|
+
get value() {
|
|
53
|
+
return this.ɵValue;
|
|
54
|
+
}
|
|
55
|
+
set value(value) {
|
|
56
|
+
this.ɵValue = value;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Options for date time picker
|
|
60
|
+
*/
|
|
61
|
+
get options() {
|
|
62
|
+
return this.ɵOptions;
|
|
63
|
+
}
|
|
64
|
+
set options(value) {
|
|
65
|
+
this.ɵOptions = extend(true, {}, defaultOptions, value);
|
|
66
|
+
if (value === null || value === void 0 ? void 0 : value.periodsDefinition) {
|
|
67
|
+
this.ɵOptions.periodsDefinition = value.periodsDefinition;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//######################### public methods - implementation of OnChanges #########################
|
|
71
|
+
/**
|
|
72
|
+
* Called when input value changes
|
|
73
|
+
*/
|
|
74
|
+
ngOnChanges(changes) {
|
|
75
|
+
if (nameof('value') in changes) {
|
|
76
|
+
//empty value show now
|
|
77
|
+
if (isBlank(this.value)) {
|
|
78
|
+
const now = this.dateApi.now();
|
|
79
|
+
this.showPicker(this.displayedPeriodType, now.value);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//######################### public methods - implementation of OnDestroy #########################
|
|
85
|
+
/**
|
|
86
|
+
* Called when component is destroyed
|
|
87
|
+
*/
|
|
88
|
+
ngOnDestroy() {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
super.ngOnDestroy();
|
|
91
|
+
(_a = this.component) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
92
|
+
this.component = null;
|
|
93
|
+
(_b = this.periodChangesSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
94
|
+
this.periodChangesSubscription = null;
|
|
95
|
+
}
|
|
96
|
+
//######################### protected methods #########################
|
|
97
|
+
/**
|
|
98
|
+
* Shows picker
|
|
99
|
+
* @param type - Type of period that should be displayed
|
|
100
|
+
* @param displayDate - Display date to be shown
|
|
101
|
+
*/
|
|
102
|
+
showPicker(type, displayDate) {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
if (!this.pickerContainer) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
//create new component and destroy previous one
|
|
108
|
+
if (!this.component || (this.component && type != this.displayedPeriodType)) {
|
|
109
|
+
(_a = this.periodChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
110
|
+
this.periodChangesSubscription = new Subscription();
|
|
111
|
+
(_b = this.component) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
112
|
+
this.component = this.pickerContainer.createComponent(type);
|
|
113
|
+
this.periodChangesSubscription.add(this.component.instance.valueChange.subscribe(() => {
|
|
114
|
+
var _a;
|
|
115
|
+
const component = (_a = this.component) === null || _a === void 0 ? void 0 : _a.instance;
|
|
116
|
+
if (!component) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);
|
|
120
|
+
this.valueChange.emit();
|
|
121
|
+
}));
|
|
122
|
+
this.periodChangesSubscription.add(this.component.instance.scaleUp.subscribe(date => this.showPicker(this.getUpperType(), date)));
|
|
123
|
+
this.periodChangesSubscription.add(this.component.instance.scaleDown.subscribe(date => this.showPicker(this.getLowerType(), date)));
|
|
124
|
+
}
|
|
125
|
+
const component = this.component.instance;
|
|
126
|
+
component.canScaleDown = false,
|
|
127
|
+
component.canScaleUp = false;
|
|
128
|
+
component.display = displayDate;
|
|
129
|
+
// component.options
|
|
130
|
+
//TODO: maybe add support for format!
|
|
131
|
+
component.value = parseDateTime(this.value, this.dateApi, null, null);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets type that is above current period picker
|
|
135
|
+
*/
|
|
136
|
+
getUpperType() {
|
|
137
|
+
const periods = Object.keys(this.ɵOptions.periodsDefinition);
|
|
138
|
+
const index = periods.indexOf(this.displayedPeriodName);
|
|
139
|
+
if (index < 0) {
|
|
140
|
+
throw new Error(CORRUPTED_CONFIG_TEXT);
|
|
141
|
+
}
|
|
142
|
+
if (index >= periods.length) {
|
|
143
|
+
return this.displayedPeriodType;
|
|
144
|
+
}
|
|
145
|
+
this.displayedPeriodName = periods[index + 1];
|
|
146
|
+
this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
|
|
147
|
+
return this.displayedPeriodType;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Gets type that is below current period picker
|
|
151
|
+
*/
|
|
152
|
+
getLowerType() {
|
|
153
|
+
const periods = Object.keys(this.ɵOptions.periodsDefinition);
|
|
154
|
+
const index = periods.indexOf(this.displayedPeriodName);
|
|
155
|
+
if (index < 0) {
|
|
156
|
+
throw new Error(CORRUPTED_CONFIG_TEXT);
|
|
157
|
+
}
|
|
158
|
+
if (index <= 0) {
|
|
159
|
+
return this.displayedPeriodType;
|
|
160
|
+
}
|
|
161
|
+
this.displayedPeriodName = periods[index - 1];
|
|
162
|
+
this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
|
|
163
|
+
return this.displayedPeriodType;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: POSITION }, { token: DATE_API }, { token: FORMAT_PROVIDER }, { token: DATE_TIME_PICKER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
167
|
+
DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerComponent, selector: "date-time-picker", inputs: { value: "value", options: "options" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "pickerContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container #container></ng-container>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
169
|
+
type: Component,
|
|
170
|
+
args: [{ selector: 'date-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container #container></ng-container>" }]
|
|
171
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
172
|
+
type: Inject,
|
|
173
|
+
args: [POSITION]
|
|
174
|
+
}] }, { type: undefined, decorators: [{
|
|
175
|
+
type: Inject,
|
|
176
|
+
args: [DATE_API]
|
|
177
|
+
}] }, { type: undefined, decorators: [{
|
|
178
|
+
type: Inject,
|
|
179
|
+
args: [FORMAT_PROVIDER]
|
|
180
|
+
}] }, { type: undefined, decorators: [{
|
|
181
|
+
type: Inject,
|
|
182
|
+
args: [DATE_TIME_PICKER_OPTIONS]
|
|
183
|
+
}, {
|
|
184
|
+
type: Optional
|
|
185
|
+
}] }]; }, propDecorators: { pickerContainer: [{
|
|
186
|
+
type: ViewChild,
|
|
187
|
+
args: ['container', { read: ViewContainerRef, static: true }]
|
|
188
|
+
}], value: [{
|
|
189
|
+
type: Input
|
|
190
|
+
}], options: [{
|
|
191
|
+
type: Input
|
|
192
|
+
}], valueChange: [{
|
|
193
|
+
type: Output
|
|
194
|
+
}] } });
|
|
195
|
+
//# sourceMappingURL=dateTimePicker.component.js.map
|