@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.
Files changed (179) hide show
  1. package/changelog.md +56 -1
  2. package/es2015/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
  3. package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  4. package/es2015/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
  5. package/es2015/src/legacy/picker/components/picker/picker.component.js +4 -4
  6. package/es2015/src/legacy/picker/components/picker/picker.component.js.map +1 -1
  7. package/es2015/src/legacy/picker/components/pickerBase.component.js.map +1 -1
  8. package/es2015/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
  9. package/es2015/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  10. package/es2015/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
  11. package/es2015/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
  12. package/es2015/src/legacy/picker/misc/tokens.js.map +1 -1
  13. package/es2015/src/legacy/picker/modules/picker.module.js +9 -9
  14. package/es2015/src/legacy/picker/modules/picker.module.js.map +1 -1
  15. package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
  16. package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
  17. package/es2015/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
  18. package/es2015/src/legacy/selector/modules/selector.module.js +4 -4
  19. package/es2015/src/legacy/selector/modules/selector.module.js.map +1 -1
  20. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
  21. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  22. package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
  23. package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
  24. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +180 -0
  25. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
  26. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
  27. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  28. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +17 -0
  29. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
  30. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
  31. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  32. package/es2015/src/modules/dateTimePicker/components/index.js +5 -0
  33. package/es2015/src/modules/dateTimePicker/components/index.js.map +1 -0
  34. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +189 -0
  35. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
  36. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
  37. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  38. package/es2015/src/modules/dateTimePicker/directives/index.js +3 -0
  39. package/es2015/src/modules/dateTimePicker/directives/index.js.map +1 -0
  40. package/es2015/src/modules/dateTimePicker/index.js +6 -0
  41. package/es2015/src/modules/dateTimePicker/index.js.map +1 -0
  42. package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
  43. package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  44. package/es2015/src/modules/dateTimePicker/interfaces/index.js +2 -0
  45. package/es2015/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
  46. package/es2015/src/modules/dateTimePicker/misc/tokens.js +10 -0
  47. package/es2015/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
  48. package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
  49. package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
  50. package/es2015/src/modules/dateTimePicker/modules/index.js +2 -0
  51. package/es2015/src/modules/dateTimePicker/modules/index.js.map +1 -0
  52. package/es2015/src/modules/index.js +1 -0
  53. package/es2015/src/modules/index.js.map +1 -1
  54. package/es2020/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
  55. package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  56. package/es2020/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
  57. package/es2020/src/legacy/picker/components/picker/picker.component.js +4 -4
  58. package/es2020/src/legacy/picker/components/picker/picker.component.js.map +1 -1
  59. package/es2020/src/legacy/picker/components/pickerBase.component.js.map +1 -1
  60. package/es2020/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
  61. package/es2020/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  62. package/es2020/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
  63. package/es2020/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
  64. package/es2020/src/legacy/picker/misc/tokens.js.map +1 -1
  65. package/es2020/src/legacy/picker/modules/picker.module.js +9 -9
  66. package/es2020/src/legacy/picker/modules/picker.module.js.map +1 -1
  67. package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
  68. package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
  69. package/es2020/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
  70. package/es2020/src/legacy/selector/modules/selector.module.js +4 -4
  71. package/es2020/src/legacy/selector/modules/selector.module.js.map +1 -1
  72. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
  73. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  74. package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
  75. package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
  76. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +177 -0
  77. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
  78. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
  79. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  80. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +17 -0
  81. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
  82. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
  83. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
  84. package/es2020/src/modules/dateTimePicker/components/index.js +5 -0
  85. package/es2020/src/modules/dateTimePicker/components/index.js.map +1 -0
  86. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +183 -0
  87. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
  88. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
  89. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  90. package/es2020/src/modules/dateTimePicker/directives/index.js +3 -0
  91. package/es2020/src/modules/dateTimePicker/directives/index.js.map +1 -0
  92. package/es2020/src/modules/dateTimePicker/index.js +6 -0
  93. package/es2020/src/modules/dateTimePicker/index.js.map +1 -0
  94. package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
  95. package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
  96. package/es2020/src/modules/dateTimePicker/interfaces/index.js +2 -0
  97. package/es2020/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
  98. package/es2020/src/modules/dateTimePicker/misc/tokens.js +10 -0
  99. package/es2020/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
  100. package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
  101. package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
  102. package/es2020/src/modules/dateTimePicker/modules/index.js +2 -0
  103. package/es2020/src/modules/dateTimePicker/modules/index.js.map +1 -0
  104. package/es2020/src/modules/index.js +1 -0
  105. package/es2020/src/modules/index.js.map +1 -1
  106. package/package.json +7 -1
  107. package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts +8 -4
  108. package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts.map +1 -1
  109. package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts +2 -2
  110. package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  111. package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts +2 -2
  112. package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
  113. package/src/legacy/picker/components/picker/picker.component.d.ts +11 -11
  114. package/src/legacy/picker/components/picker/picker.component.d.ts.map +1 -1
  115. package/src/legacy/picker/components/pickerBase.component.d.ts +2 -2
  116. package/src/legacy/picker/components/pickerBase.component.d.ts.map +1 -1
  117. package/src/legacy/picker/components/pickerImplBase.component.d.ts +2 -2
  118. package/src/legacy/picker/components/pickerImplBase.component.d.ts.map +1 -1
  119. package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts +2 -2
  120. package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
  121. package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts +2 -2
  122. package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
  123. package/src/legacy/picker/misc/datetimePicker.interface.d.ts +2 -2
  124. package/src/legacy/picker/misc/datetimePicker.interface.d.ts.map +1 -1
  125. package/src/legacy/picker/misc/tokens.d.ts +2 -2
  126. package/src/legacy/picker/misc/tokens.d.ts.map +1 -1
  127. package/src/legacy/picker/modules/picker.module.d.ts +4 -4
  128. package/src/legacy/picker/modules/picker.module.d.ts.map +1 -1
  129. package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts +2 -2
  130. package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts.map +1 -1
  131. package/src/legacy/selector/misc/datetimeSelector.interface.d.ts +2 -2
  132. package/src/legacy/selector/misc/datetimeSelector.interface.d.ts.map +1 -1
  133. package/src/legacy/selector/modules/selector.module.d.ts +1 -1
  134. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +6 -2
  135. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  136. package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts +53 -0
  137. package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts.map +1 -0
  138. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +79 -0
  139. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -0
  140. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html +1 -0
  141. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts +17 -0
  142. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
  143. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.css +27 -0
  144. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +11 -0
  145. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -0
  146. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +23 -0
  147. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts +11 -0
  148. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts.map +1 -0
  149. package/src/modules/dateTimePicker/components/index.d.ts +5 -0
  150. package/src/modules/dateTimePicker/components/index.d.ts.map +1 -0
  151. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +79 -0
  152. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -0
  153. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts +31 -0
  154. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
  155. package/src/modules/dateTimePicker/directives/index.d.ts +3 -0
  156. package/src/modules/dateTimePicker/directives/index.d.ts.map +1 -0
  157. package/src/modules/dateTimePicker/index.d.ts +6 -0
  158. package/src/modules/dateTimePicker/index.d.ts.map +1 -0
  159. package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts +40 -0
  160. package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
  161. package/src/modules/dateTimePicker/interfaces/index.d.ts +2 -0
  162. package/src/modules/dateTimePicker/interfaces/index.d.ts.map +1 -0
  163. package/src/modules/dateTimePicker/misc/tokens.d.ts +12 -0
  164. package/src/modules/dateTimePicker/misc/tokens.d.ts.map +1 -0
  165. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts +12 -0
  166. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts.map +1 -0
  167. package/src/modules/dateTimePicker/modules/index.d.ts +2 -0
  168. package/src/modules/dateTimePicker/modules/index.d.ts.map +1 -0
  169. package/src/modules/index.d.ts +1 -0
  170. package/src/modules/index.d.ts.map +1 -1
  171. package/styles/components/_date-time-picker.scss +8 -0
  172. package/styles/core/_functions.scss +11 -0
  173. package/styles/core/_misc.scss +199 -0
  174. package/styles/core/_mixins.scss +23 -0
  175. package/styles/core/_theme.scss +3 -0
  176. package/styles/index.scss +2 -0
  177. package/styles/themes/dark.scss +19 -0
  178. package/styles/themes/light.scss +19 -0
  179. 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 { DateTimePickerComponent } from '../components/picker/picker.component';
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 DateTimePickerModule {
15
+ export class DateTimeLegacyPickerModule {
16
16
  }
17
- DateTimePickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
18
- DateTimePickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, declarations: [DateTimePickerComponent,
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: [DateTimePickerComponent] });
30
- DateTimePickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, imports: [AngularCommonModule,
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: DateTimePickerModule, decorators: [{
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
- DateTimePickerComponent,
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
- DateTimePickerComponent
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,YAAY,IAAI,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAE1G,OAAO,EAAC,uBAAuB,EAAC,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,4BAA4B,EAAC,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAC,2BAA2B,EAAC,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAC,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAC,iCAAiC,EAAC,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAC,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;;AAE3E;;GAEG;AA2BH,MAAM,OAAO,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBAbzB,uBAAuB;QACvB,iCAAiC;QACjC,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,uBAAuB;QACvB,mBAAmB,aAfnB,mBAAmB;QACnB,mBAAmB;QACnB,iBAAiB;QACjB,eAAe;QACf,eAAe;QACf,kBAAkB,aAclB,uBAAuB;kHAGlB,oBAAoB,YAtBzB,mBAAmB;QACnB,mBAAmB;QACnB,iBAAiB;QACjB,eAAe;QACf,eAAe;QACf,kBAAkB;2FAiBb,oBAAoB;kBA1BhC,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,mBAAmB;wBACnB,mBAAmB;wBACnB,iBAAiB;wBACjB,eAAe;wBACf,eAAe;wBACf,kBAAkB;qBACrB;oBACD,YAAY,EACZ;wBACI,uBAAuB;wBACvB,iCAAiC;wBACjC,0BAA0B;wBAC1B,4BAA4B;wBAC5B,2BAA2B;wBAC3B,uBAAuB;wBACvB,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,uBAAuB;qBAC1B;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule as AngularCommonModule} from '@angular/common';\nimport {CommonDynamicModule, CastPipesModule, ClickOutsideModule, CommonUtilsModule} from '@anglr/common';\n\nimport {DateTimePickerComponent} 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 DateTimePickerComponent,\n DateTimeRollerTimePickerComponent,\n DateTimeDayPickerComponent,\n DateTimeMonthPickerComponent,\n DateTimeYearPickerComponent,\n LoopScrollDataDirective,\n LoopScrollDirective,\n ],\n exports:\n [\n DateTimePickerComponent\n ]\n})\nexport class DateTimePickerModule\n{\n}"]}
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,YAAY,IAAI,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAE1G,OAAO,EAAC,6BAA6B,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,4BAA4B,EAAC,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAC,2BAA2B,EAAC,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAC,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAC,iCAAiC,EAAC,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAC,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;;AAE3E;;GAEG;AA2BH,MAAM,OAAO,0BAA0B;;uHAA1B,0BAA0B;wHAA1B,0BAA0B,iBAb/B,6BAA6B;QAC7B,iCAAiC;QACjC,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,uBAAuB;QACvB,mBAAmB,aAfnB,mBAAmB;QACnB,mBAAmB;QACnB,iBAAiB;QACjB,eAAe;QACf,eAAe;QACf,kBAAkB,aAclB,6BAA6B;wHAGxB,0BAA0B,YAtB/B,mBAAmB;QACnB,mBAAmB;QACnB,iBAAiB;QACjB,eAAe;QACf,eAAe;QACf,kBAAkB;2FAiBb,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 { DateTimePickerComponent } from '../../../picker/types';
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(DateTimePickerComponent, {
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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jC,oCAAoC;gBACpC,MAAA,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,0CAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBACtG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,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 {DateTimePickerComponent} 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<DateTimePickerComponent>;\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(DateTimePickerComponent,\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
+ {"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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AAC,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 {DateTimePickerOptions} from '../../picker/misc/datetimePicker.interface';\n\n/**\n * Defintion of datetime selector component options\n */\nexport interface DateTimeSelectorOptions<TSelector = any, TPicker = any> extends DateTimePickerOptions<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
+ {"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 { DateTimePickerModule } from '../../picker/modules/picker.module';
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
- DateTimePickerModule], exports: [DateTimeSelectorComponent,
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
- DateTimePickerModule] });
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
- DateTimePickerModule,
42
+ DateTimeLegacyPickerModule,
43
43
  ],
44
44
  declarations: [
45
45
  DateTimeSelectorComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"selector.module.js","sourceRoot":"","sources":["../../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,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 {DateTimePickerModule} 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 DateTimePickerModule,\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}"]}
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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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(element, dateApi, formatProvider, valueProvider) {
16
+ constructor(elementRef, dateApi, formatProvider, valueProvider) {
17
17
  super(dateApi, formatProvider);
18
- this.element = element;
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.element.nativeElement.addEventListener('input', this.handleInput);
29
- this.element.nativeElement.addEventListener('focus', this.handleFocus);
30
- this.element.nativeElement.addEventListener('blur', this.handleBlur);
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.element.nativeElement.value;
37
+ return this.elementRef.nativeElement.value;
38
38
  }
39
39
  set rawValue(value) {
40
- this.element.nativeElement.value = value !== null && value !== void 0 ? value : '';
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.element.nativeElement.disabled;
65
+ return this.elementRef.nativeElement.disabled;
66
66
  }
67
67
  set disabled(value) {
68
- this.element.nativeElement.disabled = value;
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.element.nativeElement.removeEventListener('input', this.handleInput);
76
- this.element.nativeElement.removeEventListener('focus', this.handleFocus);
77
- this.element.nativeElement.removeEventListener('blur', this.handleBlur);
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,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;IAqE5E,kEAAkE;IAClE,YAAsB,OAAqC,EAC7B,OAAuB,EAChB,cAA8B,EAC7C,aAAuC;QAEzD,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QALb,YAAO,GAAP,OAAO,CAA8B;QAGrC,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,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,C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;;yDAiBR;;IAMA,QAAQ;;qCACoB,UAAU;;yDAGtC;;IAMA,QAAQ;;qCACmB,UAAU;;wDAGrC;2FAzLQ,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;;0BAwEgB,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.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,s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EnB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAExB,OAAO;SACV;QAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAEtF,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IAEO,WAAW,CAAC,KAAiB;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,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 emitting of go up
14
+ */
15
+ this.goUpSubject = new Subject();
16
+ /**
17
+ * Subject used for emitting of go down
18
+ */
19
+ this.goDownSubject = new Subject();
20
+ /**
21
+ * @inheritdoc
22
+ */
23
+ this.canGoUp = false;
24
+ /**
25
+ * @inheritdoc
26
+ */
27
+ this.canGoDown = false;
28
+ }
29
+ /**
30
+ * @inheritdoc
31
+ */
32
+ get valueChange() {
33
+ return this.valueChangeSubject.asObservable();
34
+ }
35
+ /**
36
+ * @inheritdoc
37
+ */
38
+ get goUp() {
39
+ return this.goUpSubject.asObservable();
40
+ }
41
+ /**
42
+ * @inheritdoc
43
+ */
44
+ get goDown() {
45
+ return this.goDownSubject.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;AAKzC;;GAEG;AACH,MAAM,OAAgB,wBAAwB;IAA9C;QAEI,0EAA0E;QAE1E;;WAEG;QACO,uBAAkB,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAElE;;WAEG;QACO,gBAAW,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE7D;;WAEG;QACO,kBAAa,GAAmB,IAAI,OAAO,EAAS,CAAC;QAmB/D;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;IAyBtC,CAAC;IAvBG;;OAEG;IACH,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAEb,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC7C,CAAC;CACJ","sourcesContent":["import {Observable, Subject} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../misc/types';\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 emitting of go up\n */\n protected goUpSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Subject used for emitting of go down\n */\n protected goDownSubject: Subject<TDate> = new Subject<TDate>();\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 canGoUp: boolean = false;\n\n /**\n * @inheritdoc\n */\n public canGoDown: 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 goUp(): Observable<TDate>\n {\n return this.goUpSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get goDown(): Observable<TDate>\n {\n return this.goDownSubject.asObservable();\n }\n}"]}
@@ -0,0 +1,180 @@
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 } from '../../../../misc/tokens';
8
+ import { formatDateTime, parseDateTime } from '../../../../misc/utils';
9
+ import { DateTimeValueFormat } from '../../../../misc/enums';
10
+ import * as i0 from "@angular/core";
11
+ /**
12
+ * Text to be displayed when configuration, options are corrupted
13
+ */
14
+ const CORRUPTED_CONFIG_TEXT = 'DateTime: Corrupted configuration for DateTimePicker!';
15
+ /**
16
+ * Default options for date time picker
17
+ */
18
+ const defaultOptions = {
19
+ defaultPeriod: 'day',
20
+ periodsDefinition: {
21
+ 'day': DayPickerSAComponent,
22
+ },
23
+ };
24
+ /**
25
+ * Component used for displaying date time picker
26
+ */
27
+ export class DateTimePickerComponent {
28
+ //######################### constructor #########################
29
+ constructor(position, dateApi, options) {
30
+ this.position = position;
31
+ this.dateApi = dateApi;
32
+ //######################### public properties - outputs #########################
33
+ /**
34
+ * @inheritdoc
35
+ */
36
+ this.valueChange = new EventEmitter();
37
+ this.ɵOptions = extend(true, {}, defaultOptions, options);
38
+ if (options === null || options === void 0 ? void 0 : options.periodsDefinition) {
39
+ this.ɵOptions.periodsDefinition = options.periodsDefinition;
40
+ }
41
+ this.displayedPeriodName = this.ɵOptions.defaultPeriod;
42
+ this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
43
+ if (!this.displayedPeriodType) {
44
+ throw new Error(CORRUPTED_CONFIG_TEXT);
45
+ }
46
+ }
47
+ /**
48
+ * Options for date time picker
49
+ */
50
+ get options() {
51
+ return this.ɵOptions;
52
+ }
53
+ set options(value) {
54
+ this.ɵOptions = extend(true, {}, defaultOptions, value);
55
+ if (value === null || value === void 0 ? void 0 : value.periodsDefinition) {
56
+ this.ɵOptions.periodsDefinition = value.periodsDefinition;
57
+ }
58
+ }
59
+ //######################### public methods - implementation of OnChanges #########################
60
+ /**
61
+ * Called when input value changes
62
+ */
63
+ ngOnChanges(changes) {
64
+ if (nameof('value') in changes) {
65
+ //empty value show now
66
+ if (isBlank(this.value)) {
67
+ const now = this.dateApi.now();
68
+ this.showPicker(this.displayedPeriodType, now.value);
69
+ return;
70
+ }
71
+ }
72
+ }
73
+ //######################### public methods - implementation of OnDestroy #########################
74
+ /**
75
+ * Called when component is destroyed
76
+ */
77
+ ngOnDestroy() {
78
+ var _a, _b;
79
+ (_a = this.component) === null || _a === void 0 ? void 0 : _a.destroy();
80
+ this.component = null;
81
+ (_b = this.periodChangesSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
82
+ this.periodChangesSubscription = null;
83
+ }
84
+ //######################### protected methods #########################
85
+ /**
86
+ * Shows picker
87
+ * @param type - Type of period that should be displayed
88
+ * @param displayDate - Display date to be shown
89
+ */
90
+ showPicker(type, displayDate) {
91
+ var _a, _b;
92
+ if (!this.pickerContainer) {
93
+ return;
94
+ }
95
+ //create new component and destroy previous one
96
+ if (!this.component || (this.component && type != this.displayedPeriodType)) {
97
+ (_a = this.periodChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
98
+ this.periodChangesSubscription = new Subscription();
99
+ (_b = this.component) === null || _b === void 0 ? void 0 : _b.destroy();
100
+ this.component = this.pickerContainer.createComponent(type);
101
+ this.periodChangesSubscription.add(this.component.instance.valueChange.subscribe(() => {
102
+ var _a;
103
+ const component = (_a = this.component) === null || _a === void 0 ? void 0 : _a.instance;
104
+ if (!component) {
105
+ return;
106
+ }
107
+ this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);
108
+ this.valueChange.emit();
109
+ }));
110
+ this.periodChangesSubscription.add(this.component.instance.goUp.subscribe(date => this.showPicker(this.getUpperType(), date)));
111
+ this.periodChangesSubscription.add(this.component.instance.goDown.subscribe(date => this.showPicker(this.getLowerType(), date)));
112
+ }
113
+ const component = this.component.instance;
114
+ component.canGoDown = false,
115
+ component.canGoUp = false;
116
+ component.display = displayDate;
117
+ // component.options
118
+ //TODO: maybe add support for format!
119
+ component.value = parseDateTime(this.value, this.dateApi, null, null);
120
+ }
121
+ /**
122
+ * Gets type that is above current period picker
123
+ */
124
+ getUpperType() {
125
+ const periods = Object.keys(this.ɵOptions.periodsDefinition);
126
+ const index = periods.indexOf(this.displayedPeriodName);
127
+ if (index < 0) {
128
+ throw new Error(CORRUPTED_CONFIG_TEXT);
129
+ }
130
+ if (index >= periods.length) {
131
+ return this.displayedPeriodType;
132
+ }
133
+ this.displayedPeriodName = periods[index + 1];
134
+ this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
135
+ return this.displayedPeriodType;
136
+ }
137
+ /**
138
+ * Gets type that is below current period picker
139
+ */
140
+ getLowerType() {
141
+ const periods = Object.keys(this.ɵOptions.periodsDefinition);
142
+ const index = periods.indexOf(this.displayedPeriodName);
143
+ if (index < 0) {
144
+ throw new Error(CORRUPTED_CONFIG_TEXT);
145
+ }
146
+ if (index <= 0) {
147
+ return this.displayedPeriodType;
148
+ }
149
+ this.displayedPeriodName = periods[index - 1];
150
+ this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];
151
+ return this.displayedPeriodType;
152
+ }
153
+ }
154
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: POSITION }, { token: DATE_API }, { token: DATE_TIME_PICKER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
155
+ 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 }], usesOnChanges: true, ngImport: i0, template: "<ng-container #container></ng-container>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
157
+ type: Component,
158
+ args: [{ selector: 'date-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container #container></ng-container>" }]
159
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
160
+ type: Inject,
161
+ args: [POSITION]
162
+ }] }, { type: undefined, decorators: [{
163
+ type: Inject,
164
+ args: [DATE_API]
165
+ }] }, { type: undefined, decorators: [{
166
+ type: Inject,
167
+ args: [DATE_TIME_PICKER_OPTIONS]
168
+ }, {
169
+ type: Optional
170
+ }] }]; }, propDecorators: { pickerContainer: [{
171
+ type: ViewChild,
172
+ args: ['container', { read: ViewContainerRef, static: true }]
173
+ }], value: [{
174
+ type: Input
175
+ }], options: [{
176
+ type: Input
177
+ }], valueChange: [{
178
+ type: Output
179
+ }] } });
180
+ //# sourceMappingURL=dateTimePicker.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimePicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html"],"names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AO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAExD,IAAG,KAAK,GAAG,CAAC,EACZ;YACI,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;QAED,IAAG,KAAK,IAAI,CAAC,EACb;YACI,OAAO,IAAI,CAAC,mBAAmB,CAAC;SACnC;QAED,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAErF,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;;oHA/NQ,uBAAuB,kBAwEZ,QAAQ,aACR,QAAQ,aACR,wBAAwB;wGA1EnC,uBAAuB,0OAkCD,gBAAgB,gEC5EnD,0CAAwC;2FD0C3B,uBAAuB;kBANnC,SAAS;+BAEI,kBAAkB,mBAEX,uBAAuB,CAAC,MAAM;;0BA0ElC,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,wBAAwB;;0BAAG,QAAQ;4CAvC7C,eAAe;sBADxB,SAAS;uBAAC,WAAW,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAC;gBASvD,KAAK;sBADX,KAAK;gBAOK,OAAO;sBADjB,KAAK;gBAqBC,WAAW;sBADjB,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef, Type, EventEmitter, Output, Input, OnChanges, SimpleChanges, Inject, Optional, OnDestroy, ComponentRef} from '@angular/core';\nimport {Position, POSITION} from '@anglr/common';\nimport {extend, isBlank, nameof} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {DATE_TIME_PICKER_OPTIONS} from '../../misc/tokens';\nimport {DayPickerSAComponent} from '../dayPicker/dayPicker.component';\nimport {DateTimePickerOptions} from './dateTimePicker.interface';\nimport {DateTimePicker} from '../../interfaces';\nimport {DateApi} from '../../../../services';\nimport {DATE_API} from '../../../../misc/tokens';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\n\n/**\n * Text to be displayed when configuration, options are corrupted\n */\nconst CORRUPTED_CONFIG_TEXT = 'DateTime: Corrupted configuration for DateTimePicker!';\n\n/**\n * Default options for date time picker\n */\nconst defaultOptions: DateTimePickerOptions = \n{\n defaultPeriod: 'day',\n periodsDefinition:\n {\n 'day': DayPickerSAComponent,\n },\n};\n\n/**\n * Component used for displaying date time picker\n */\n@Component(\n{\n selector: 'date-time-picker',\n templateUrl: 'dateTimePicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimePickerComponent<TDate = unknown> implements DateTimeInputValue<TDate>, OnChanges, OnDestroy\n{\n //######################### protected properties #########################\n \n /**\n * Subscription for changes in date time period picker\n */\n protected periodChangesSubscription: Subscription|undefined|null;\n\n /**\n * Options for date time picker\n */\n protected ɵOptions: DateTimePickerOptions<TDate>;\n\n /**\n * Currently displayed period type\n */\n protected displayedPeriodType: Type<DateTimePicker<TDate>>;\n\n /**\n * Name of period which is currently displayed\n */\n protected displayedPeriodName: string;\n\n /**\n * Instance of created date time period picker\n */\n protected component: ComponentRef<DateTimePicker<TDate>>|undefined|null;\n \n //######################### protected properties - children #########################\n\n /**\n * Container used for displaying pickers for specific date time part\n */\n @ViewChild('container', {read: ViewContainerRef, static: true})\n protected pickerContainer: ViewContainerRef|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * @inheritdoc\n */\n @Input()\n public value: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Options for date time picker\n */\n @Input()\n public get options(): Partial<DateTimePickerOptions<TDate>>\n {\n return this.ɵOptions;\n }\n public set options(value: Partial<DateTimePickerOptions<TDate>>)\n {\n this.ɵOptions = extend(true, {}, defaultOptions, value);\n\n if(value?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = value.periodsDefinition;\n }\n }\n\n //######################### public properties - outputs #########################\n\n /**\n * @inheritdoc\n */\n @Output()\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(@Inject(POSITION) protected position: Position,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n @Inject(DATE_TIME_PICKER_OPTIONS) @Optional() options?: DateTimePickerOptions<TDate>,)\n {\n this.ɵOptions = extend(true, {}, defaultOptions, options);\n \n if(options?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = options.periodsDefinition;\n }\n\n this.displayedPeriodName = this.ɵOptions.defaultPeriod;\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n if(!this.displayedPeriodType)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<DateTimePickerComponent>('value') in changes)\n {\n //empty value show now\n if(isBlank(this.value))\n {\n const now = this.dateApi.now();\n\n this.showPicker(this.displayedPeriodType, now.value);\n\n return;\n }\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.component?.destroy();\n this.component = null;\n\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows picker\n * @param type - Type of period that should be displayed\n * @param displayDate - Display date to be shown\n */\n protected showPicker(type: Type<DateTimePicker<TDate>>, displayDate: TDate): void\n {\n if(!this.pickerContainer)\n {\n return;\n }\n\n //create new component and destroy previous one\n if(!this.component || (this.component && type != this.displayedPeriodType))\n {\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = new Subscription();\n this.component?.destroy();\n this.component = this.pickerContainer.createComponent(type);\n\n this.periodChangesSubscription.add(this.component.instance.valueChange.subscribe(() =>\n {\n const component = this.component?.instance;\n\n if(!component)\n {\n return;\n }\n\n this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);\n this.valueChange.emit();\n }));\n\n this.periodChangesSubscription.add(this.component.instance.goUp.subscribe(date => this.showPicker(this.getUpperType(), date)));\n this.periodChangesSubscription.add(this.component.instance.goDown.subscribe(date => this.showPicker(this.getLowerType(), date)));\n }\n\n const component = this.component.instance;\n\n component.canGoDown = false,\n component.canGoUp = false;\n component.display = displayDate;\n // component.options\n //TODO: maybe add support for format!\n component.value = parseDateTime(this.value, this.dateApi, null, null);\n }\n\n /**\n * Gets type that is above current period picker\n */\n protected getUpperType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index >= periods.length)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index + 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n\n /**\n * Gets type that is below current period picker\n */\n protected getLowerType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index <= 0)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index - 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n}","<ng-container #container></ng-container>"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dateTimePicker.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimePicker.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from '@angular/core';\nimport {Dictionary} from '@jscrpt/common';\n\nimport {DateTimePicker} from '../../interfaces';\n\n/**\n * Defintion of date time picker component options\n */\nexport interface DateTimePickerOptions<TDate = unknown>\n{\n /**\n * Definition of types for each period type for picker\n */\n periodsDefinition: Dictionary<Type<DateTimePicker<TDate>>>;\n\n /**\n * Name of default period for picker that is displayed after opening\n */\n defaultPeriod: string;\n}"]}