@anglr/datetime 8.1.0 → 9.0.0-beta.20241004120552

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 (169) hide show
  1. package/changelog.md +61 -1
  2. package/date-fns/src/services/dateFnsDateApi.service.d.ts +58 -130
  3. package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
  4. package/es2022/date-fns/src/services/dateFnsDateApi.service.js +60 -143
  5. package/es2022/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
  6. package/es2022/moment/src/services/momentDateApi.service.js +58 -140
  7. package/es2022/moment/src/services/momentDateApi.service.js.map +1 -1
  8. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js +17 -30
  9. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js.map +1 -1
  10. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js +9 -9
  11. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -1
  12. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +16 -26
  13. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -1
  14. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +8 -8
  15. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -1
  16. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +9 -9
  17. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -1
  18. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +7 -11
  19. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -1
  20. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +8 -8
  21. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -1
  22. package/es2022/src/directives/withNow/withNow.directive.js +11 -11
  23. package/es2022/src/directives/withNow/withNow.directive.js.map +1 -1
  24. package/es2022/src/directives/withTime/withTime.directive.js +10 -10
  25. package/es2022/src/directives/withTime/withTime.directive.js.map +1 -1
  26. package/es2022/src/directives/withToday/withToday.directive.js +11 -11
  27. package/es2022/src/directives/withToday/withToday.directive.js.map +1 -1
  28. package/es2022/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
  29. package/es2022/src/misc/enums.js +8 -4
  30. package/es2022/src/misc/enums.js.map +1 -1
  31. package/es2022/src/misc/utils.js +7 -6
  32. package/es2022/src/misc/utils.js.map +1 -1
  33. package/es2022/src/misc/validators.js.map +1 -1
  34. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js +36 -59
  35. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +1 -1
  36. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js +5 -5
  37. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +1 -1
  38. package/es2022/src/modules/calendar/modules/monthCalendar.module.js +7 -11
  39. package/es2022/src/modules/calendar/modules/monthCalendar.module.js.map +1 -1
  40. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js +3 -4
  41. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js.map +1 -1
  42. package/es2022/src/modules/datePipes.module.js +6 -6
  43. package/es2022/src/modules/datePipes.module.js.map +1 -1
  44. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js +41 -72
  45. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -1
  46. package/es2022/src/modules/dateTime/directives/dateTimeBase.js +21 -25
  47. package/es2022/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  48. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js +36 -16
  49. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +1 -1
  50. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -26
  51. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  52. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +12 -13
  53. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  54. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +12 -13
  55. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  56. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +12 -13
  57. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  58. package/es2022/src/modules/dateTime/modules/dateTime.module.js +27 -27
  59. package/es2022/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  60. package/es2022/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +39 -58
  61. package/es2022/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -1
  62. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +21 -57
  63. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  64. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +14 -14
  65. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -1
  66. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js +4 -5
  67. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +1 -1
  68. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js +27 -24
  69. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  70. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js +12 -9
  71. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +1 -1
  72. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +11 -40
  73. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -1
  74. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js +40 -55
  75. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +1 -1
  76. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +8 -14
  77. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +1 -1
  78. package/es2022/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js.map +1 -1
  79. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js +9 -10
  80. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -1
  81. package/es2022/src/pipes/dateConvert.pipe.js +4 -5
  82. package/es2022/src/pipes/dateConvert.pipe.js.map +1 -1
  83. package/es2022/src/pipes/dateFormat.pipe.js +4 -6
  84. package/es2022/src/pipes/dateFormat.pipe.js.map +1 -1
  85. package/es2022/src/services/dateApi/dateApi.interface.js.map +1 -1
  86. package/es2022/src/services/datePositionParser/datePositionParser.service.js +16 -17
  87. package/es2022/src/services/datePositionParser/datePositionParser.service.js.map +1 -1
  88. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js +3 -9
  89. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +1 -1
  90. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js +3 -5
  91. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js.map +1 -1
  92. package/lerna.json +4 -0
  93. package/moment/src/services/momentDateApi.service.d.ts +59 -132
  94. package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
  95. package/package.json +41 -43
  96. package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts +3 -3
  97. package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts.map +1 -1
  98. package/src/directives/datePickerInput/datePickerInput.directive.d.ts +3 -3
  99. package/src/directives/datePickerInput/datePickerInput.directive.d.ts.map +1 -1
  100. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts +7 -7
  101. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts.map +1 -1
  102. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts +3 -3
  103. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts.map +1 -1
  104. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts +3 -3
  105. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts.map +1 -1
  106. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts +7 -7
  107. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts.map +1 -1
  108. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts +3 -3
  109. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts.map +1 -1
  110. package/src/directives/withNow/withNow.directive.d.ts +5 -5
  111. package/src/directives/withNow/withNow.directive.d.ts.map +1 -1
  112. package/src/directives/withTime/withTime.directive.d.ts +5 -5
  113. package/src/directives/withTime/withTime.directive.d.ts.map +1 -1
  114. package/src/directives/withToday/withToday.directive.d.ts +5 -5
  115. package/src/directives/withToday/withToday.directive.d.ts.map +1 -1
  116. package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts +1 -1
  117. package/src/misc/enums.d.ts +8 -4
  118. package/src/misc/enums.d.ts.map +1 -1
  119. package/src/misc/utils.d.ts +3 -3
  120. package/src/misc/utils.d.ts.map +1 -1
  121. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.d.ts +1 -1
  122. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.d.ts.map +1 -1
  123. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.html +17 -9
  124. package/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.d.ts +1 -1
  125. package/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.d.ts.map +1 -1
  126. package/src/modules/calendar/modules/monthCalendar.module.d.ts +3 -4
  127. package/src/modules/calendar/modules/monthCalendar.module.d.ts.map +1 -1
  128. package/src/modules/datePipes.module.d.ts +1 -1
  129. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +3 -3
  130. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -1
  131. package/src/modules/dateTime/directives/dateTimeBase.d.ts +3 -3
  132. package/src/modules/dateTime/directives/dateTimeBase.d.ts.map +1 -1
  133. package/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.d.ts +6 -4
  134. package/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.d.ts.map +1 -1
  135. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +3 -3
  136. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  137. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts +3 -3
  138. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts.map +1 -1
  139. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts +3 -3
  140. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts.map +1 -1
  141. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts +3 -3
  142. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts.map +1 -1
  143. package/src/modules/dateTime/modules/dateTime.module.d.ts +1 -1
  144. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +4 -4
  145. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -1
  146. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html +1 -1
  147. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +3 -3
  148. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  149. package/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.d.ts +3 -3
  150. package/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
  151. package/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.d.ts +3 -3
  152. package/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
  153. package/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.d.ts +3 -3
  154. package/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
  155. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +5 -5
  156. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -1
  157. package/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.d.ts +7 -7
  158. package/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.d.ts.map +1 -1
  159. package/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.d.ts +3 -3
  160. package/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.d.ts.map +1 -1
  161. package/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.d.ts.map +1 -1
  162. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts +3 -3
  163. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts.map +1 -1
  164. package/src/pipes/dateConvert.pipe.d.ts +1 -1
  165. package/src/pipes/dateFormat.pipe.d.ts +1 -1
  166. package/src/services/dateApi/dateApi.interface.d.ts +5 -1
  167. package/src/services/dateApi/dateApi.interface.d.ts.map +1 -1
  168. package/src/services/dateValueProvider/dateValueProvider.service.d.ts.map +1 -1
  169. package/version.bak +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;;;;AAG1D;;GAEG;AAiBH,MAAM,OAAO,oBAAsC,SAAQ,wBAA+C;IAEtG,0EAA0E;IAE1E;;OAEG;IACO,aAAa,GAAqB,EAAE,CAAC;IAE/C,8FAA8F;IAE9F;;OAEG;IACO,QAAQ,GAAa,EAAE,CAAC;IAElC,iEAAiE;IACjE;QAEI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC;IAED,2FAA2F;IAE3F;;;OAGG;IACO,SAAS,CAAC,OAAuB;QAEvC,IAAG,OAAO,CAAC,QAAQ,EACnB;YACI,OAAO;SACV;QAED,cAAc;QACd,IAAG,CAAC,IAAI,CAAC,MAAM,EACf;YACI,uBAAuB;YACvB,IAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,EAC/B;gBACI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;aACrF;YAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9C,IAA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jC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACO,QAAQ;QAEd,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED;;;;OAIG;IACO,YAAY,CAAC,GAAyB,EAAE,MAAa;QAE3D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;uGAhLQ,oBAAoB;2FAApB,oBAAoB,yJC3BjC,4uCAoBM,2CDEE,YAAY,+PACZ,eAAe;;2FAIV,oBAAoB;kBAhBhC,SAAS;+BAEI,YAAY,QAGtB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker, DayData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'day-picker',\n templateUrl: 'dayPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayPickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<DayData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties #########################\n\n /**\n * Stored this picker month data\n */\n protected thisMonthData: DayData<TDate>[] = [];\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Names of days\n */\n protected weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor()\n {\n super();\n\n this.weekdays = this.dateApi.weekdaysShort();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects day as value of date time picker\n * @param dayData - Day data that were selected\n */\n protected selectDay(dayData: DayData<TDate>): void\n {\n if(dayData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(dayData.dateObj.year());\n this.singleValue.month(dayData.dateObj.month());\n this.singleValue.dayOfMonth(dayData.day);\n\n //other month was selected\n if(dayData.otherMonth)\n {\n this.displayDate?.month(dayData.dateObj.month());\n }\n\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n\n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed month to next month\n */\n protected nextMonth(): void\n {\n this.displayDate?.addMonths(1).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed month to previous month\n */\n protected previousMonth(): void\n {\n this.displayDate?.subtractMonths(1).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same month only data change\n if(this.displayedDate && this.displayDate?.isSameMonth(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n this.thisMonthData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n const currentMonthDate = this.displayDate.value;\n const today = this.dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n\n const data: DayData<TDate> =\n {\n active: false,\n disabled: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day,\n dateObj: this.displayDate.clone(),\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this.thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousMonth()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'monthName'}} {{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextMonth()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div class=\"weekday\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"selectDay(day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"go-down-button\" *ngIf=\"canScaleDown\">\r\n <div [class.clickable]=\"canScaleDown\" (mousedown)=\"displayDate ? scaleDownSubject.next(displayDate.value) : undefined\">{{singleValue?.isValid() ? (singleValue?.value | dateFormat: 'time') : '0:00'}}</div>\r\n</div>"]}
1
+ {"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html"],"names":[],"mapp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EnF;;OAEG;IACO,QAAQ;QAEd,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED;;;;OAIG;IACO,YAAY,CAAC,GAAyB,EAAE,MAAa;QAE3D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;8GAhLQ,kBAAkB;kGAAlB,kBAAkB,yJC3B/B,4uCAoBM,2CDEE,YAAY,+PACZ,eAAe;;2FAIV,kBAAkB;kBAhB9B,SAAS;+BAEI,YAAY,QAGtB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker, DayData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'day-picker',\n templateUrl: 'dayPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayPickerComponent<TDate = unknown> extends DateTimePeriodPickerBase<DayData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties #########################\n\n /**\n * Stored this picker month data\n */\n protected thisMonthData: DayData<TDate>[] = [];\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Names of days\n */\n protected weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor()\n {\n super();\n\n this.weekdays = this.dateApi.weekdaysShort();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects day as value of date time picker\n * @param dayData - Day data that were selected\n */\n protected selectDay(dayData: DayData<TDate>): void\n {\n if(dayData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(dayData.dateObj.year());\n this.singleValue.month(dayData.dateObj.month());\n this.singleValue.dayOfMonth(dayData.day);\n\n //other month was selected\n if(dayData.otherMonth)\n {\n this.displayDate?.month(dayData.dateObj.month());\n }\n\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n\n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed month to next month\n */\n protected nextMonth(): void\n {\n this.displayDate?.addMonths(1).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed month to previous month\n */\n protected previousMonth(): void\n {\n this.displayDate?.subtractMonths(1).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same month only data change\n if(this.displayedDate && this.displayDate?.isSameMonth(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n this.thisMonthData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n const currentMonthDate = this.displayDate.value;\n const today = this.dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n\n const data: DayData<TDate> =\n {\n active: false,\n disabled: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day,\n dateObj: this.displayDate.clone(),\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this.thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousMonth()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'monthName'}} {{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextMonth()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div class=\"weekday\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"selectDay(day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"go-down-button\" *ngIf=\"canScaleDown\">\r\n <div [class.clickable]=\"canScaleDown\" (mousedown)=\"displayDate ? scaleDownSubject.next(displayDate.value) : undefined\">{{singleValue?.isValid() ? (singleValue?.value | dateFormat: 'time') : '0:00'}}</div>\r\n</div>"]}
@@ -9,8 +9,7 @@ import * as i2 from "../../../../pipes/dateFormat.pipe";
9
9
  /**
10
10
  * Component used for displaying month picker
11
11
  */
12
- export class MonthPickerSAComponent extends DateTimePeriodPickerBase {
13
- formatProvider;
12
+ export class MonthPickerComponent extends DateTimePeriodPickerBase {
14
13
  //######################### constructor #########################
15
14
  constructor(formatProvider) {
16
15
  super();
@@ -102,10 +101,10 @@ export class MonthPickerSAComponent extends DateTimePeriodPickerBase {
102
101
  isSamePeriod(val, target) {
103
102
  return val.isSameMonth(target);
104
103
  }
105
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MonthPickerSAComponent, deps: [{ token: FORMAT_PROVIDER }], target: i0.ɵɵFactoryTarget.Component });
106
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: MonthPickerSAComponent, isStandalone: true, selector: "month-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousYear()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextYear()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let month of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(month.dateObj.value) : selectMonth(month)\">{{month.name}}</div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: DatePipesModule }, { kind: "pipe", type: i2.DateFormatPipe, name: "dateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonthPickerComponent, deps: [{ token: FORMAT_PROVIDER }], target: i0.ɵɵFactoryTarget.Component }); }
105
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: MonthPickerComponent, isStandalone: true, selector: "month-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousYear()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextYear()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let month of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(month.dateObj.value) : selectMonth(month)\">{{month.name}}</div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: DatePipesModule }, { kind: "pipe", type: i2.DateFormatPipe, name: "dateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
107
106
  }
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MonthPickerSAComponent, decorators: [{
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MonthPickerComponent, decorators: [{
109
108
  type: Component,
110
109
  args: [{ selector: 'month-picker', host: {
111
110
  '[class.date-time-period]': 'true',
@@ -1 +1 @@
1
- {"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/monthPicker/monthPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,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AAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAEjC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACO,QAAQ;QAEd,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED;;;;OAIG;IACO,YAAY,CAAC,GAAyB,EAAE,MAAa;QAE3D,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;uGAhIQ,sBAAsB,kBAGX,eAAe;2FAH1B,sBAAsB,2JC7BnC,wxBAYM,2CDYE,YAAY,2JACZ,eAAe;;2FAIV,sBAAsB;kBAhBlC,SAAS;+BAEI,cAAc,QAGxB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,eAAe","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker, MonthData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\nimport {FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {FormatProvider} from '../../../../interfaces';\n\n/**\n * Component used for displaying month picker\n */\n@Component(\n{\n selector: 'month-picker',\n templateUrl: 'monthPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MonthPickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<MonthData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### constructor #########################\n constructor(@Inject(FORMAT_PROVIDER) protected formatProvider: FormatProvider,)\n {\n super();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects month as value of day time picker\n * @param monthData - Month data that were selected\n */\n protected selectMonth(monthData: MonthData<TDate>): void\n {\n if(monthData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(monthData.dateObj.year());\n this.singleValue.month(monthData.dateObj.month());\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n\n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed year to next year\n */\n protected nextYear(): void\n {\n this.displayDate?.addYears(1).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed year to previous year\n */\n protected previousYear(): void\n {\n this.displayDate?.subtractYears(1).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same year only data change\n if(this.displayedDate && this.displayDate?.isSameYear(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n const monthOfYear = this.displayDate.startOfYear().updateOriginal();\n\n for(let x = 0; x < 12; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: monthOfYear.value,\n name: monthOfYear.format(this.dateApi.getFormat(this.formatProvider.monthNameShort)),\n dateObj: monthOfYear.clone(),\n });\n\n monthOfYear.addMonths(1);\n }\n\n this.displayDate.resetOriginal();\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameMonth(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousYear()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextYear()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let month of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(month.dateObj.value) : selectMonth(month)\">{{month.name}}</div>\r\n</div>"]}
1
+ {"version":3,"file":"monthPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/monthPicker/monthPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/monthPicker/monthPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;;;;AAGxD;;GAEG;AAiBH,MAAM,OAAO,oBAAsC,SAAQ,wBAAiD;IAExG,iEAAiE;IACjE,YAA+C,cAA8B;QAEzE,KAAK,EAAE,CAAC;QAFmC,mBAAc,GAAd,cAAc,CAAgB;IAG7E,CAAC;IAED,2FAA2F;IAE3F;;;OAGG;IACO,WAAW,CAAC,SAA2B;QAE7C,IAAG,SAAS,CAAC,QAAQ,EACrB,CAAC;YACG,OAAO;QACX,CAAC;QAED,cAAc;QACd,IAAG,CAAC,IAAI,CAAC,MAAM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rC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM;;0BAKlC,MAAM;2BAAC,eAAe","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker, MonthData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\nimport {FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {FormatProvider} from '../../../../interfaces';\n\n/**\n * Component used for displaying month picker\n */\n@Component(\n{\n selector: 'month-picker',\n templateUrl: 'monthPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MonthPickerComponent<TDate = unknown> extends DateTimePeriodPickerBase<MonthData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### constructor #########################\n constructor(@Inject(FORMAT_PROVIDER) protected formatProvider: FormatProvider,)\n {\n super();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects month as value of day time picker\n * @param monthData - Month data that were selected\n */\n protected selectMonth(monthData: MonthData<TDate>): void\n {\n if(monthData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(monthData.dateObj.year());\n this.singleValue.month(monthData.dateObj.month());\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n\n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed year to next year\n */\n protected nextYear(): void\n {\n this.displayDate?.addYears(1).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed year to previous year\n */\n protected previousYear(): void\n {\n this.displayDate?.subtractYears(1).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same year only data change\n if(this.displayedDate && this.displayDate?.isSameYear(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n const monthOfYear = this.displayDate.startOfYear().updateOriginal();\n\n for(let x = 0; x < 12; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: monthOfYear.value,\n name: monthOfYear.format(this.dateApi.getFormat(this.formatProvider.monthNameShort)),\n dateObj: monthOfYear.clone(),\n });\n\n monthOfYear.addMonths(1);\n }\n\n this.displayDate.resetOriginal();\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameMonth(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousYear()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextYear()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let month of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"month.active\"\r\n [class.disabled]=\"month.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(month.dateObj.value) : selectMonth(month)\">{{month.name}}</div>\r\n</div>"]}
@@ -4,31 +4,34 @@ import { ClickOutsideSADirective } from '@anglr/common';
4
4
  import { DatePipesModule } from '../../../datePipes.module';
5
5
  import { hours, minutes } from './rollerTimePicker.data';
6
6
  import { DateTimePeriodPickerBase } from '../dateTimePeriodPickerBase';
7
- import { LoopScrollDataSADirective, LoopScrollSADirective } from '../../directives';
7
+ import { LoopScrollDataDirective, LoopScrollDirective } from '../../directives';
8
8
  import * as i0 from "@angular/core";
9
9
  import * as i1 from "@angular/common";
10
10
  import * as i2 from "../../../../pipes/dateFormat.pipe";
11
11
  /**
12
12
  * Component used for rendering roller time picker
13
13
  */
14
- export class RollerTimePickerSAComponent extends DateTimePeriodPickerBase {
15
- //######################### protected properties - template bindings #########################
16
- /**
17
- * Array of available hours
18
- */
19
- hours = hours;
20
- /**
21
- * Array of available minutes
22
- */
23
- minutes = minutes;
24
- /**
25
- * Indication whether are minutes open
26
- */
27
- minutesOpen = false;
28
- /**
29
- * Indication whether are hours open
30
- */
31
- hoursOpen = false;
14
+ export class RollerTimePickerComponent extends DateTimePeriodPickerBase {
15
+ constructor() {
16
+ super(...arguments);
17
+ //######################### protected properties - template bindings #########################
18
+ /**
19
+ * Array of available hours
20
+ */
21
+ this.hours = hours;
22
+ /**
23
+ * Array of available minutes
24
+ */
25
+ this.minutes = minutes;
26
+ /**
27
+ * Indication whether are minutes open
28
+ */
29
+ this.minutesOpen = false;
30
+ /**
31
+ * Indication whether are hours open
32
+ */
33
+ this.hoursOpen = false;
34
+ }
32
35
  /**
33
36
  * Current value of hour
34
37
  */
@@ -109,10 +112,10 @@ export class RollerTimePickerSAComponent extends DateTimePeriodPickerBase {
109
112
  isSamePeriod() {
110
113
  return false;
111
114
  }
112
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: RollerTimePickerSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
113
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: RollerTimePickerSAComponent, isStandalone: true, selector: "roller-time-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (mousedown)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (mousedown)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: DatePipesModule }, { kind: "pipe", type: i2.DateFormatPipe, name: "dateFormat" }, { kind: "directive", type: ClickOutsideSADirective, selector: "[clickOutside]", inputs: ["clickOutside", "clickOutsideElement"], outputs: ["clickOutsideChange"] }, { kind: "directive", type: LoopScrollDataSADirective, selector: "[loopScrollData]", inputs: ["loopScrollData", "clone"] }, { kind: "directive", type: LoopScrollSADirective, selector: "[loopScroll]", inputs: ["loopScroll", "open"], outputs: ["loopScrollChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RollerTimePickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
116
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: RollerTimePickerComponent, isStandalone: true, selector: "roller-time-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (mousedown)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (mousedown)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "ngmodule", type: DatePipesModule }, { kind: "pipe", type: i2.DateFormatPipe, name: "dateFormat" }, { kind: "directive", type: ClickOutsideSADirective, selector: "[clickOutside]", inputs: ["clickOutside", "clickOutsideElement"], outputs: ["clickOutsideChange"] }, { kind: "directive", type: LoopScrollDataDirective, selector: "[loopScrollData]", inputs: ["loopScrollData", "clone"] }, { kind: "directive", type: LoopScrollDirective, selector: "[loopScroll]", inputs: ["loopScroll", "open"], outputs: ["loopScrollChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
114
117
  }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: RollerTimePickerSAComponent, decorators: [{
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: RollerTimePickerComponent, decorators: [{
116
119
  type: Component,
117
120
  args: [{ selector: 'roller-time-picker', host: {
118
121
  '[class.date-time-period]': 'true',
@@ -120,8 +123,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
120
123
  CommonModule,
121
124
  DatePipesModule,
122
125
  ClickOutsideSADirective,
123
- LoopScrollDataSADirective,
124
- LoopScrollSADirective,
126
+ LoopScrollDataDirective,
127
+ LoopScrollDirective,
125
128
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (mousedown)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (mousedown)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n" }]
126
129
  }] });
127
130
  //# sourceMappingURL=rollerTimePicker.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rollerTimePicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.ts","../../../../../../src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAiB,yBAAyB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;;;;AAElG;;GAEG;AAoBH,MAAM,OAAO,2BAA6C,SAAQ,wBAAkD;IAEhH,8FAA8F;IAE9F;;OAEG;IACO,KAAK,GAAqB,KAAK,CAAC;IAE1C;;OAEG;IACO,OAAO,GAAqB,OAAO,CAAC;IAE9C;;OAEG;IACO,WAAW,GAAY,KAAK,CAAC;IAEvC;;OAEG;IACO,SAAS,GAAY,KAAK,CAAC;IAErC;;OAEG;IACH,IAAc,IAAI;QAEd,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,IAAc,IAAI,CAAC,KAAa;QAE5B,uBAAuB;QACvB,IAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,EAC/B;YACI,IAAI,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QAED,IAAG,IAAI,CAAC,MAAM,IAAI,KAA0B,EAC5C;YACI,OAAO;SACV;QAED,IAAI,CAAC,MAAM,GAAG,KAA0B,CAAC;QAEzC,IAAG,KAAK,EACR;YACI,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;SAC5B;QAED,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACO,QAAQ;IAElB,CAAC;IAED;;OAEG;IACO,YAAY;QAElB,OAAO,KAAK,CAAC;IACjB,CAAC;uGAzIQ,2BAA2B;2FAA3B,2BAA2B,iKChCxC,y4FAmEA,2CD3CQ,YAAY,gNACZ,eAAe,8FACf,uBAAuB,6IACvB,yBAAyB,kGACzB,qBAAqB;;2FAIhB,2BAA2B;kBAnBvC,SAAS;+BAEI,oBAAoB,QAG9B;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;wBACf,uBAAuB;wBACvB,yBAAyB;wBACzB,qBAAqB;qBACxB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ClickOutsideSADirective} from '@anglr/common';\n\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {hours, minutes} from './rollerTimePicker.data';\nimport {DateTimePicker, PeriodData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {LoopScrollData, LoopScrollDataSADirective, LoopScrollSADirective} from '../../directives';\n\n/**\n * Component used for rendering roller time picker\n */\n@Component(\n{\n selector: 'roller-time-picker',\n templateUrl: 'rollerTimePicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ClickOutsideSADirective,\n LoopScrollDataSADirective,\n LoopScrollSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RollerTimePickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<PeriodData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Array of available hours\n */\n protected hours: LoopScrollData[] = hours;\n\n /**\n * Array of available minutes\n */\n protected minutes: LoopScrollData[] = minutes;\n\n /**\n * Indication whether are minutes open\n */\n protected minutesOpen: boolean = false;\n\n /**\n * Indication whether are hours open\n */\n protected hoursOpen: boolean = false;\n\n /**\n * Current value of hour\n */\n protected get hour(): number\n {\n return this.singleValue?.hour() ?? 0;\n }\n protected set hour(value: number)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue?.hour(value);\n }\n\n /**\n * Current value of minute\n */\n protected get minute(): number\n {\n return this.singleValue?.minute() ?? 0;\n }\n protected set minute(value: number)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue?.minute(value);\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Sets hour\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as hour\n * @returns \n */\n protected setHour<TData = unknown>(event: MouseEvent|null, value: TData): void\n {\n if(!this.hoursOpen && event)\n {\n return;\n }\n\n if(this.hour == value as unknown as number)\n {\n this.hoursOpen = false;\n\n return;\n }\n\n this.hour = value as unknown as number;\n \n if(event)\n {\n this.hoursOpen = false;\n }\n\n this.singleValue?.updateOriginal();\n this.valueChangeSubject.next();\n }\n\n /**\n * Sets minute\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as minute\n * @returns \n */\n protected setMinute<TData = unknown>(event: MouseEvent|null, value: TData): void\n {\n if(!this.minutesOpen && event)\n {\n return;\n }\n\n if(this.minute == value as unknown as number)\n {\n return;\n }\n\n this.minute = value as unknown as number;\n \n if(event)\n {\n this.minutesOpen = false;\n }\n\n this.singleValue?.updateOriginal();\n this.valueChangeSubject.next();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n }\n\n /**\n * Tests whether provided value is in same period target value\n */\n protected isSamePeriod(): boolean\n {\n return false;\n }\n}","<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (mousedown)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (mousedown)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"rollerTimePicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.ts","../../../../../../src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAiB,uBAAuB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;;;;AAE9F;;GAEG;AAoBH,MAAM,OAAO,yBAA2C,SAAQ,wBAAkD;IAnBlH;;QAqBI,8FAA8F;QAE9F;;WAEG;QACO,UAAK,GAAqB,KAAK,CAAC;QAE1C;;WAEG;QACO,YAAO,GAAqB,OAAO,CAAC;QAE9C;;W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O;QACX,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,KAA0B,CAAC;QAEvC,IAAG,KAAK,EACR,CAAC;YACG,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACO,SAAS,CAAkB,KAAsB,EAAE,KAAY;QAErE,IAAG,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,EAC7B,CAAC;YACG,OAAO;QACX,CAAC;QAED,IAAG,IAAI,CAAC,MAAM,IAAI,KAA0B,EAC5C,CAAC;YACG,OAAO;QACX,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,KAA0B,CAAC;QAEzC,IAAG,KAAK,EACR,CAAC;YACG,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACO,QAAQ;IAElB,CAAC;IAED;;OAEG;IACO,YAAY;QAElB,OAAO,KAAK,CAAC;IACjB,CAAC;8GAzIQ,yBAAyB;kGAAzB,yBAAyB,iKChCtC,y4FAmEA,2CD3CQ,YAAY,gNACZ,eAAe,8FACf,uBAAuB,6IACvB,uBAAuB,kGACvB,mBAAmB;;2FAId,yBAAyB;kBAnBrC,SAAS;+BAEI,oBAAoB,QAG9B;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;wBACf,uBAAuB;wBACvB,uBAAuB;wBACvB,mBAAmB;qBACtB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ClickOutsideSADirective} from '@anglr/common';\n\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {hours, minutes} from './rollerTimePicker.data';\nimport {DateTimePicker, PeriodData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {LoopScrollData, LoopScrollDataDirective, LoopScrollDirective} from '../../directives';\n\n/**\n * Component used for rendering roller time picker\n */\n@Component(\n{\n selector: 'roller-time-picker',\n templateUrl: 'rollerTimePicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ClickOutsideSADirective,\n LoopScrollDataDirective,\n LoopScrollDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RollerTimePickerComponent<TDate = unknown> extends DateTimePeriodPickerBase<PeriodData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Array of available hours\n */\n protected hours: LoopScrollData[] = hours;\n\n /**\n * Array of available minutes\n */\n protected minutes: LoopScrollData[] = minutes;\n\n /**\n * Indication whether are minutes open\n */\n protected minutesOpen: boolean = false;\n\n /**\n * Indication whether are hours open\n */\n protected hoursOpen: boolean = false;\n\n /**\n * Current value of hour\n */\n protected get hour(): number\n {\n return this.singleValue?.hour() ?? 0;\n }\n protected set hour(value: number)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue?.hour(value);\n }\n\n /**\n * Current value of minute\n */\n protected get minute(): number\n {\n return this.singleValue?.minute() ?? 0;\n }\n protected set minute(value: number)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue?.minute(value);\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Sets hour\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as hour\n * @returns \n */\n protected setHour<TData = unknown>(event: MouseEvent|null, value: TData): void\n {\n if(!this.hoursOpen && event)\n {\n return;\n }\n\n if(this.hour == value as unknown as number)\n {\n this.hoursOpen = false;\n\n return;\n }\n\n this.hour = value as unknown as number;\n \n if(event)\n {\n this.hoursOpen = false;\n }\n\n this.singleValue?.updateOriginal();\n this.valueChangeSubject.next();\n }\n\n /**\n * Sets minute\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as minute\n * @returns \n */\n protected setMinute<TData = unknown>(event: MouseEvent|null, value: TData): void\n {\n if(!this.minutesOpen && event)\n {\n return;\n }\n\n if(this.minute == value as unknown as number)\n {\n return;\n }\n\n this.minute = value as unknown as number;\n \n if(event)\n {\n this.minutesOpen = false;\n }\n\n this.singleValue?.updateOriginal();\n this.valueChangeSubject.next();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n }\n\n /**\n * Tests whether provided value is in same period target value\n */\n protected isSamePeriod(): boolean\n {\n return false;\n }\n}","<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (mousedown)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (mousedown)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (mousedown)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n"]}
@@ -7,12 +7,15 @@ import * as i1 from "@angular/common";
7
7
  /**
8
8
  * Component used for displaying year picker
9
9
  */
10
- export class YearPickerSAComponent extends DateTimePeriodPickerBase {
11
- //######################### protected properties - template bindings #########################
12
- /**
13
- * Displayed decade period
14
- */
15
- period = '';
10
+ export class YearPickerComponent extends DateTimePeriodPickerBase {
11
+ constructor() {
12
+ super(...arguments);
13
+ //######################### protected properties - template bindings #########################
14
+ /**
15
+ * Displayed decade period
16
+ */
17
+ this.period = '';
18
+ }
16
19
  //######################### protected methods - template bindings #########################
17
20
  /**
18
21
  * Selects year as value of day time picker
@@ -104,10 +107,10 @@ export class YearPickerSAComponent extends DateTimePeriodPickerBase {
104
107
  isSamePeriod(val, target) {
105
108
  return val.isSameYear(target);
106
109
  }
107
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: YearPickerSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
108
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: YearPickerSAComponent, isStandalone: true, selector: "year-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousDecade()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{period}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextDecade()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let year of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"year.active\"\r\n [class.disabled]=\"year.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(year.dateObj.value) : selectYear(year)\">{{year.value}}</div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: DatePipesModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: YearPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
111
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: YearPickerComponent, isStandalone: true, selector: "year-picker", host: { properties: { "class.date-time-period": "true" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousDecade()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{period}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextDecade()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let year of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"year.active\"\r\n [class.disabled]=\"year.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(year.dateObj.value) : selectYear(year)\">{{year.value}}</div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: DatePipesModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
109
112
  }
110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: YearPickerSAComponent, decorators: [{
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: YearPickerComponent, decorators: [{
111
114
  type: Component,
112
115
  args: [{ selector: 'year-picker', host: {
113
116
  '[class.date-time-period]': 'true',
@@ -1 +1 @@
1
- {"version":3,"file":"yearPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/yearPicker/yearPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/yearPicker/yearPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;A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AAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACO,QAAQ;QAEd,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED;;;;OAIG;IACO,YAAY,CAAC,GAAyB,EAAE,MAAa;QAE3D,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;uGAzIQ,qBAAqB;2FAArB,qBAAqB,0JC3BlC,qvBAYM,2CDUE,YAAY,2JACZ,eAAe;;2FAIV,qBAAqB;kBAhBjC,SAAS;+BAEI,aAAa,QAGvB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker, YearData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\n\n/**\n * Component used for displaying year picker\n */\n@Component(\n{\n selector: 'year-picker',\n templateUrl: 'yearPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class YearPickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<YearData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Displayed decade period\n */\n protected period: string = '';\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects year as value of day time picker\n * @param yearData - Year data that were selected\n */\n protected selectYear(yearData: YearData<TDate>): void\n {\n if(yearData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(yearData.dateObj.year());\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n \n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed decade to next decade\n */\n public nextDecade(): void\n {\n this.displayDate?.addYears(10).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed decade to previous decade\n */\n public previousDecade(): void\n {\n this.displayDate?.subtractYears(10).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same decade only data change\n if(this.displayedDate && this.displayDate?.isSameDecade(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n let year = this.displayDate.startOfYear().year();\n\n while(year % 10 !== 0)\n {\n year--;\n }\n\n this.displayDate.year(year).updateOriginal();\n\n for(let x = 0; x < 10; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: this.displayDate.value,\n value: year,\n dateObj: this.displayDate.clone(),\n });\n\n year++;\n this.displayDate.addYears(1);\n }\n\n this.displayDate.resetOriginal();\n this.period = `${this.displayDate.year()} - ${this.displayDate.year() + 10}`;\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameYear(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousDecade()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{period}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextDecade()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let year of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"year.active\"\r\n [class.disabled]=\"year.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(year.dateObj.value) : selectYear(year)\">{{year.value}}</div>\r\n</div>"]}
1
+ {"version":3,"file":"yearPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/yearPicker/yearPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/yearPicker/yearPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;;;AAG1D;;GAEG;AAiBH,MAAM,OAAO,mBAAqC,SAAQ,wBAAgD;IAhB1G;;QAkBI,8FAA8F;QAE9F;;WAEG;QACO,WAAM,GAAW,EAAE,CAAC;KAmIjC;IAjIG,2FAA2F;IAE3F;;;OAGG;IACO,UAAU,CAAC,QAAyB;QAE1C,IAAG,QAAQ,CAAC,QAAQ,EACpB,CAAC;YACG,OAAO;QACX,CAAC;QAED,cAAc;QACd,IAAG,CAAC,IAAI,CAAC,MAAM,EACf,CAAC;YACG,uBAAuB;YACvB,IAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,EAC/B,CAAC;gBACG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YACtF,CAAC;YAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CA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/common';\n\nimport {DateTimePicker, YearData} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DateApiObject} from '../../../../services';\n\n/**\n * Component used for displaying year picker\n */\n@Component(\n{\n selector: 'year-picker',\n templateUrl: 'yearPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class YearPickerComponent<TDate = unknown> extends DateTimePeriodPickerBase<YearData<TDate>, TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Displayed decade period\n */\n protected period: string = '';\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Selects year as value of day time picker\n * @param yearData - Year data that were selected\n */\n protected selectYear(yearData: YearData<TDate>): void\n {\n if(yearData.disabled)\n {\n return;\n }\n\n //single value\n if(!this.ranged)\n {\n //no value selected yet\n if(!this.singleValue?.isValid())\n {\n this.singleValue = this.displayDate?.clone() ?? this.dateApi.getValue(new Date());\n }\n\n this.singleValue.year(yearData.dateObj.year());\n this.singleValue.updateOriginal();\n }\n else\n {\n //TODO: range\n }\n \n this.valueChangeSubject.next();\n this.render();\n this.changeDetector.detectChanges();\n }\n\n /**\n * Changes displayed decade to next decade\n */\n public nextDecade(): void\n {\n this.displayDate?.addYears(10).updateOriginal();\n\n this.render();\n }\n\n /**\n * Changes displayed decade to previous decade\n */\n public previousDecade(): void\n {\n this.displayDate?.subtractYears(10).updateOriginal();\n\n this.render();\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders current day picker data\n */\n protected render(): void\n {\n //same decade only data change\n if(this.displayedDate && this.displayDate?.isSameDecade(this.displayedDate))\n {\n this.setActive();\n this.updateMinMax();\n\n return;\n }\n\n this.displayedDate = this.displayDate?.value;\n this.periodData = [];\n\n if(!this.displayDate)\n {\n return;\n }\n\n let year = this.displayDate.startOfYear().year();\n\n while(year % 10 !== 0)\n {\n year--;\n }\n\n this.displayDate.year(year).updateOriginal();\n\n for(let x = 0; x < 10; x++)\n {\n this.periodData.push(\n {\n active: false,\n disabled: false,\n date: this.displayDate.value,\n value: year,\n dateObj: this.displayDate.clone(),\n });\n\n year++;\n this.displayDate.addYears(1);\n }\n\n this.displayDate.resetOriginal();\n this.period = `${this.displayDate.year()} - ${this.displayDate.year() + 10}`;\n\n this.setActive();\n this.updateMinMax();\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected onRender(): void\n {\n this.render();\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameYear(target);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousDecade()\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"displayDate && canScaleUp ? scaleUpSubject.next(displayDate.value) : undefined\">{{period}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextDecade()\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div *ngFor=\"let year of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.active]=\"year.active\"\r\n [class.disabled]=\"year.disabled\"\r\n (mousedown)=\"canScaleDown && displayDate ? scaleDownSubject.next(year.dateObj.value) : selectYear(year)\">{{year.value}}</div>\r\n</div>"]}
@@ -26,37 +26,7 @@ const defaultOptions = {
26
26
  /**
27
27
  * Directive that is used for displaying and attaching date time picker
28
28
  */
29
- export class DateTimePickerSADirective extends DateTimeBase {
30
- viewContainer;
31
- element;
32
- input;
33
- document;
34
- position;
35
- //######################### protected properties #########################
36
- /**
37
- * Indication whether is value changes disabled
38
- */
39
- valueChangeDisabled = false;
40
- /**
41
- * Options for date time picker directive
42
- */
43
- ɵWithPickerOptions;
44
- /**
45
- * Date time picker component reference
46
- */
47
- componentRef;
48
- /**
49
- * Instance of date time picker component
50
- */
51
- component;
52
- /**
53
- * Instance of date time picker element
54
- */
55
- componentElement;
56
- /**
57
- * Subscription for changes in picker
58
- */
59
- pickerChangesSubscription;
29
+ export class DateTimePickerDirective extends DateTimeBase {
60
30
  //######################### public properties - inputs #########################
61
31
  /**
62
32
  * Gets or sets options for date time picker directive
@@ -67,10 +37,6 @@ export class DateTimePickerSADirective extends DateTimeBase {
67
37
  set withPickerOptions(value) {
68
38
  this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);
69
39
  }
70
- /**
71
- * Options for date time picker component
72
- */
73
- pickerOptions;
74
40
  //######################### constructor #########################
75
41
  constructor(viewContainer, element, input, document, position, options) {
76
42
  super();
@@ -79,6 +45,11 @@ export class DateTimePickerSADirective extends DateTimeBase {
79
45
  this.input = input;
80
46
  this.document = document;
81
47
  this.position = position;
48
+ //######################### protected properties #########################
49
+ /**
50
+ * Indication whether is value changes disabled
51
+ */
52
+ this.valueChangeDisabled = false;
82
53
  this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);
83
54
  }
84
55
  //######################### public methods - implementation of OnInit #########################
@@ -241,22 +212,22 @@ export class DateTimePickerSADirective extends DateTimeBase {
241
212
  this.componentRef.setInput(nameof('minDateTime'), this.dateTimeData.minDateTime);
242
213
  this.componentRef.changeDetectorRef.detectChanges();
243
214
  }
244
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimePickerSADirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: DATE_TIME_INPUT }, { token: DOCUMENT }, { token: POSITION }, { token: DATE_TIME_PICKER_DIRECTIVE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
245
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimePickerSADirective, isStandalone: true, selector: "[dateTime][withPicker]", inputs: { withPickerOptions: "withPickerOptions", pickerOptions: "pickerOptions" }, exportAs: ["dateTimePicker"], usesInheritance: true, ngImport: i0 });
215
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: DATE_TIME_INPUT }, { token: DOCUMENT }, { token: POSITION }, { token: DATE_TIME_PICKER_DIRECTIVE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
216
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimePickerDirective, isStandalone: true, selector: "[dateTime][withPicker]", inputs: { withPickerOptions: "withPickerOptions", pickerOptions: "pickerOptions" }, exportAs: ["dateTimePicker"], usesInheritance: true, ngImport: i0 }); }
246
217
  }
247
218
  __decorate([
248
219
  BindThis,
249
220
  __metadata("design:type", Function),
250
221
  __metadata("design:paramtypes", [MouseEvent]),
251
222
  __metadata("design:returntype", void 0)
252
- ], DateTimePickerSADirective.prototype, "handleClickOutside", null);
223
+ ], DateTimePickerDirective.prototype, "handleClickOutside", null);
253
224
  __decorate([
254
225
  BindThis,
255
226
  __metadata("design:type", Function),
256
227
  __metadata("design:paramtypes", [MouseEvent]),
257
228
  __metadata("design:returntype", void 0)
258
- ], DateTimePickerSADirective.prototype, "handleClickInside", null);
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimePickerSADirective, decorators: [{
229
+ ], DateTimePickerDirective.prototype, "handleClickInside", null);
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimePickerDirective, decorators: [{
260
231
  type: Directive,
261
232
  args: [{
262
233
  selector: '[dateTime][withPicker]',
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimePicker.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimeP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pB,CAAC,CAAC;IACP,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB;YACI,OAAO;SACV;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAA0B,aAAa,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;IAED;;OAEG;IACgB,mBAAmB;QAElC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB;YACI,OAAO;SACV;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAA0B,aAAa,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;uGAxSQ,yBAAyB,4EA0Dd,eAAe,aACf,QAAQ,aACR,QAAQ,aAER,kCAAkC;2FA9D7C,yBAAyB;;AAkOxB;IADT,QAAQ;;qCAC2B,UAAU;;mEAc7C;AAOS;IADT,QAAQ;;qCAC0B,UAAU;;kEAI5C;2FA3PQ,yBAAyB;kBANrC,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;oBAClC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,gBAAgB;iBAC7B;;0BA2DgB,MAAM;2BAAC,eAAe;;0BACtB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BAEf,MAAM;2BAAC,kCAAkC;;0BAAG,QAAQ;yCAtBtD,iBAAiB;sBAD3B,KAAK;gBAcC,aAAa;sBADnB,KAAK;gBA8KI,kBAAkB,MAqBlB,iBAAiB","sourcesContent":["import {ComponentRef, Directive, ElementRef, EmbeddedViewRef, Inject, Input, OnDestroy, OnInit, Optional, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {Position, POSITION, applyPositionResult, PositionPlacement, PositionResult} from '@anglr/common';\nimport {extend, nameof, isDescendant, BindThis, renderToBody} from '@jscrpt/common';\nimport {Observable, Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimePickerComponent} from '../../components';\nimport {DateTimePickerOptions} from '../../components/dateTimePicker/dateTimePicker.interface';\nimport {DateTimePickerDirectiveOptions} from './dateTimePicker.interface';\nimport {DATE_TIME_PICKER_DIRECTIVE_OPTIONS} from '../../misc/tokens';\nimport {DateTimeBase} from '../../../dateTime/directives';\n\n/**\n * Default options for date time picker directive\n */\nconst defaultOptions: DateTimePickerDirectiveOptions =\n{\n absolute: true,\n alwaysVisible: false,\n closeOnValueSelect: false,\n closeOnBlur: true,\n disabled: false,\n positionOptions: PositionPlacement.BottomStart,\n showOnFocus: true,\n targetElement: null,\n pickerCssClass: null,\n};\n\n/**\n * Directive that is used for displaying and attaching date time picker\n */\n@Directive(\n{\n selector: '[dateTime][withPicker]',\n standalone: true,\n exportAs: 'dateTimePicker',\n})\nexport class DateTimePickerSADirective<TDate = unknown> extends DateTimeBase<TDate> implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Indication whether is value changes disabled\n */\n protected valueChangeDisabled: boolean = false;\n\n /**\n * Options for date time picker directive\n */\n protected ɵWithPickerOptions: DateTimePickerDirectiveOptions;\n\n /**\n * Date time picker component reference\n */\n protected componentRef: ComponentRef<DateTimePickerComponent<TDate>>|undefined|null;\n\n /**\n * Instance of date time picker component\n */\n protected component: DateTimePickerComponent<TDate>|undefined|null;\n\n /**\n * Instance of date time picker element\n */\n protected componentElement: HTMLElement|undefined|null;\n\n /**\n * Subscription for changes in picker\n */\n protected pickerChangesSubscription: Subscription|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets options for date time picker directive\n */\n @Input()\n public get withPickerOptions(): Partial<DateTimePickerDirectiveOptions>\n {\n return this.ɵWithPickerOptions;\n }\n public set withPickerOptions(value: Partial<DateTimePickerDirectiveOptions>)\n {\n this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);\n }\n\n /**\n * Options for date time picker component\n */\n @Input()\n public pickerOptions: Partial<DateTimePickerOptions<TDate>>|undefined|null;\n\n //######################### constructor #########################\n constructor(protected viewContainer: ViewContainerRef,\n protected element: ElementRef<HTMLElement>,\n @Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DOCUMENT) protected document: Document,\n @Inject(POSITION) protected position: Position,\n\n @Inject(DATE_TIME_PICKER_DIRECTIVE_OPTIONS) @Optional() options?: DateTimePickerDirectiveOptions,)\n {\n super();\n\n this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n this.showPicker();\n }\n\n this.initSubscriptions.add(this.input.valueChange.subscribe(() =>\n {\n this.setPickerValue();\n this.componentRef?.changeDetectorRef.detectChanges();\n }));\n\n this.initSubscriptions.add(this.input.focus.subscribe(() =>\n {\n if(this.withPickerOptions.showOnFocus)\n {\n this.showPicker();\n }\n }));\n\n this.initSubscriptions.add(this.input.blur.subscribe(() =>\n {\n if(this.withPickerOptions.closeOnBlur)\n {\n this.hidePicker();\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.hidePicker();\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Hides date time picker\n */\n public async showPicker(): Promise<void>\n {\n if(this.withPickerOptions.disabled || this.componentRef)\n {\n return;\n }\n\n this.componentRef = this.viewContainer.createComponent(DateTimePickerComponent<TDate>);\n this.componentElement = (this.componentRef?.hostView as EmbeddedViewRef<DateTimePickerComponent<TDate>>).rootNodes[0] as HTMLElement;\n this.component = this.componentRef.instance;\n\n if(this.withPickerOptions.absolute)\n {\n renderToBody(this.document, this.componentElement, this.withPickerOptions.targetElement);\n }\n\n this.pickerChangesSubscription = new Subscription();\n this.pickerChangesSubscription.add(this.component.valueChange.subscribe(() =>\n {\n if(this.component)\n {\n this.valueChangeDisabled = true;\n this.input.value = this.component.value;\n this.input.valueChange.emit();\n this.valueChangeDisabled = false;\n\n if(this.ɵWithPickerOptions.closeOnValueSelect)\n {\n this.hidePicker();\n }\n }\n }));\n\n this.document.addEventListener('click', this.handleClickOutside);\n this.componentElement.addEventListener('mousedown', this.handleClickInside);\n this.componentElement.style.position = 'absolute';\n\n if(this.ɵWithPickerOptions.pickerCssClass)\n {\n this.componentElement.classList.add(this.ɵWithPickerOptions.pickerCssClass);\n }\n\n this.pickerChangesSubscription.add(this.positionPicker(this.componentElement, true).subscribe(result => applyPositionResult(result)));\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('options'), this.pickerOptions);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('valueFormat'), this.dateTimeData.valueFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('format'), this.dateTimeData.format);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('customFormat'), this.dateTimeData.customFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('dataFormat'), this.dateTimeData.dataFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('minDateTime'), this.dateTimeData.minDateTime);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('maxDateTime'), this.dateTimeData.maxDateTime);\n this.setPickerValue();\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /**\n * Shows date time picker\n */\n public hidePicker(): void\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n return;\n }\n\n this.componentElement?.removeEventListener('mousedown', this.handleClickInside);\n \n this.pickerChangesSubscription?.unsubscribe();\n this.pickerChangesSubscription = null;\n \n this.component = null;\n\n this.componentRef?.destroy();\n this.componentRef = null;\n\n this.componentElement?.remove();\n this.componentElement = null;\n\n this.document.removeEventListener('click', this.handleClickOutside);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets all picker value\n */\n protected setPickerValue(): void\n {\n if(this.valueChangeDisabled)\n {\n return;\n }\n\n if(this.componentRef)\n {\n this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n }\n }\n\n /**\n * Handles clicking outside of picker\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickOutside(event: MouseEvent): void\n {\n if(!this.componentElement)\n {\n return;\n }\n\n if(this.componentElement != event.target &&\n !isDescendant(this.componentElement, event.target as HTMLElement) &&\n (!this.input.element || (this.input.element != event.target &&\n !isDescendant(this.input.element, event.target as HTMLElement))))\n {\n this.hidePicker();\n }\n }\n\n /**\n * Handles clicking inside of picker element\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickInside(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n }\n\n /**\n * Runs placement of picker component\n * @param componentElement - Element to be positioned\n * @param watch - Indication whether watch for changes and update position\n */\n protected positionPicker(componentElement: HTMLElement, watch: boolean): Observable<PositionResult<HTMLElement>>\n {\n return this.position.placeElement(componentElement, this.element.nativeElement,\n {\n flip: true,\n placement: this.withPickerOptions.positionOptions,\n autoUpdate: watch,\n });\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n if(!this.componentRef)\n {\n return;\n }\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('maxDateTime'), this.dateTimeData.maxDateTime);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n if(!this.componentRef)\n {\n return;\n }\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('minDateTime'), this.dateTimeData.minDateTime);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n}"]}
1
+ {"version":3,"file":"dateTimePicker.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,SAAS,EAAE,UAAU,EAAmB,MAAM,EAAE,KAAK,EAAqB,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjJ,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAW,QAAQ,EAAE,mBAAmB,EAAE,iBAAiB,EAAiB,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAa,YAAY,EAAC,MAAM,MAAM,CAAC;AAG9C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAC,kCAAkC,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;;AAE1D;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,KAAK;IACpB,kBAAkB,EAAE,KAAK;IACzB,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,iBAAiB,CAAC,WAAW;IAC9C,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;CACvB,CAAC;AAEF;;GAEG;AAOH,MAAM,OAAO,uBAAyC,SAAQ,YAAmB;IAkC7E,gFAAgF;IAEhF;;OAEG;IACH,IACW,iBAAiB;QAExB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IACD,IAAW,iBAAiB,CAAC,KAA8C;QAEvE,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,E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IACP,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB,CAAC;YACG,OAAO;QACX,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAA0B,aAAa,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;IAED;;OAEG;IACgB,mBAAmB;QAElC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB,CAAC;YACG,OAAO;QACX,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAA0B,aAAa,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;8GAxSQ,uBAAuB,4EA0DZ,eAAe,aACf,QAAQ,aACR,QAAQ,aAER,kCAAkC;kGA9D7C,uBAAuB;;AAkOtB;IADT,QAAQ;;qCAC2B,UAAU;;iEAc7C;AAOS;IADT,QAAQ;;qCAC0B,UAAU;;gEAI5C;2FA3PQ,uBAAuB;kBANnC,SAAS;mBACV;oBACI,QAAQ,EAAE,wBAAwB;oBAClC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,gBAAgB;iBAC7B;;0BA2DgB,MAAM;2BAAC,eAAe;;0BACtB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BAEf,MAAM;2BAAC,kCAAkC;;0BAAG,QAAQ;yCAtBtD,iBAAiB;sBAD3B,KAAK;gBAcC,aAAa;sBADnB,KAAK;gBA8KI,kBAAkB,MAqBlB,iBAAiB","sourcesContent":["import {ComponentRef, Directive, ElementRef, EmbeddedViewRef, Inject, Input, OnDestroy, OnInit, Optional, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {Position, POSITION, applyPositionResult, PositionPlacement, PositionResult} from '@anglr/common';\nimport {extend, nameof, isDescendant, BindThis, renderToBody} from '@jscrpt/common';\nimport {Observable, Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimePickerComponent} from '../../components';\nimport {DateTimePickerOptions} from '../../components/dateTimePicker/dateTimePicker.interface';\nimport {DateTimePickerDirectiveOptions} from './dateTimePicker.interface';\nimport {DATE_TIME_PICKER_DIRECTIVE_OPTIONS} from '../../misc/tokens';\nimport {DateTimeBase} from '../../../dateTime/directives';\n\n/**\n * Default options for date time picker directive\n */\nconst defaultOptions: DateTimePickerDirectiveOptions =\n{\n absolute: true,\n alwaysVisible: false,\n closeOnValueSelect: false,\n closeOnBlur: true,\n disabled: false,\n positionOptions: PositionPlacement.BottomStart,\n showOnFocus: true,\n targetElement: null,\n pickerCssClass: null,\n};\n\n/**\n * Directive that is used for displaying and attaching date time picker\n */\n@Directive(\n{\n selector: '[dateTime][withPicker]',\n standalone: true,\n exportAs: 'dateTimePicker',\n})\nexport class DateTimePickerDirective<TDate = unknown> extends DateTimeBase<TDate> implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Indication whether is value changes disabled\n */\n protected valueChangeDisabled: boolean = false;\n\n /**\n * Options for date time picker directive\n */\n protected ɵWithPickerOptions: DateTimePickerDirectiveOptions;\n\n /**\n * Date time picker component reference\n */\n protected componentRef: ComponentRef<DateTimePickerComponent<TDate>>|undefined|null;\n\n /**\n * Instance of date time picker component\n */\n protected component: DateTimePickerComponent<TDate>|undefined|null;\n\n /**\n * Instance of date time picker element\n */\n protected componentElement: HTMLElement|undefined|null;\n\n /**\n * Subscription for changes in picker\n */\n protected pickerChangesSubscription: Subscription|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets options for date time picker directive\n */\n @Input()\n public get withPickerOptions(): Partial<DateTimePickerDirectiveOptions>\n {\n return this.ɵWithPickerOptions;\n }\n public set withPickerOptions(value: Partial<DateTimePickerDirectiveOptions>)\n {\n this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);\n }\n\n /**\n * Options for date time picker component\n */\n @Input()\n public pickerOptions: Partial<DateTimePickerOptions<TDate>>|undefined|null;\n\n //######################### constructor #########################\n constructor(protected viewContainer: ViewContainerRef,\n protected element: ElementRef<HTMLElement>,\n @Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DOCUMENT) protected document: Document,\n @Inject(POSITION) protected position: Position<HTMLElement>,\n\n @Inject(DATE_TIME_PICKER_DIRECTIVE_OPTIONS) @Optional() options?: DateTimePickerDirectiveOptions,)\n {\n super();\n\n this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n this.showPicker();\n }\n\n this.initSubscriptions.add(this.input.valueChange.subscribe(() =>\n {\n this.setPickerValue();\n this.componentRef?.changeDetectorRef.detectChanges();\n }));\n\n this.initSubscriptions.add(this.input.focus.subscribe(() =>\n {\n if(this.withPickerOptions.showOnFocus)\n {\n this.showPicker();\n }\n }));\n\n this.initSubscriptions.add(this.input.blur.subscribe(() =>\n {\n if(this.withPickerOptions.closeOnBlur)\n {\n this.hidePicker();\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.hidePicker();\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Hides date time picker\n */\n public async showPicker(): Promise<void>\n {\n if(this.withPickerOptions.disabled || this.componentRef)\n {\n return;\n }\n\n this.componentRef = this.viewContainer.createComponent(DateTimePickerComponent<TDate>);\n this.componentElement = (this.componentRef?.hostView as EmbeddedViewRef<DateTimePickerComponent<TDate>>).rootNodes[0] as HTMLElement;\n this.component = this.componentRef.instance;\n\n if(this.withPickerOptions.absolute)\n {\n renderToBody(this.document, this.componentElement, this.withPickerOptions.targetElement);\n }\n\n this.pickerChangesSubscription = new Subscription();\n this.pickerChangesSubscription.add(this.component.valueChange.subscribe(() =>\n {\n if(this.component)\n {\n this.valueChangeDisabled = true;\n this.input.value = this.component.value;\n this.input.valueChange.emit();\n this.valueChangeDisabled = false;\n\n if(this.ɵWithPickerOptions.closeOnValueSelect)\n {\n this.hidePicker();\n }\n }\n }));\n\n this.document.addEventListener('click', this.handleClickOutside);\n this.componentElement.addEventListener('mousedown', this.handleClickInside);\n this.componentElement.style.position = 'absolute';\n\n if(this.ɵWithPickerOptions.pickerCssClass)\n {\n this.componentElement.classList.add(this.ɵWithPickerOptions.pickerCssClass);\n }\n\n this.pickerChangesSubscription.add(this.positionPicker(this.componentElement, true).subscribe(result => applyPositionResult(result)));\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('options'), this.pickerOptions);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('valueFormat'), this.dateTimeData.valueFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('format'), this.dateTimeData.format);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('customFormat'), this.dateTimeData.customFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('dataFormat'), this.dateTimeData.dataFormat);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('minDateTime'), this.dateTimeData.minDateTime);\n this.componentRef.setInput(nameof<DateTimePickerComponent>('maxDateTime'), this.dateTimeData.maxDateTime);\n this.setPickerValue();\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /**\n * Shows date time picker\n */\n public hidePicker(): void\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n return;\n }\n\n this.componentElement?.removeEventListener('mousedown', this.handleClickInside);\n \n this.pickerChangesSubscription?.unsubscribe();\n this.pickerChangesSubscription = null;\n \n this.component = null;\n\n this.componentRef?.destroy();\n this.componentRef = null;\n\n this.componentElement?.remove();\n this.componentElement = null;\n\n this.document.removeEventListener('click', this.handleClickOutside);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets all picker value\n */\n protected setPickerValue(): void\n {\n if(this.valueChangeDisabled)\n {\n return;\n }\n\n if(this.componentRef)\n {\n this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n }\n }\n\n /**\n * Handles clicking outside of picker\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickOutside(event: MouseEvent): void\n {\n if(!this.componentElement)\n {\n return;\n }\n\n if(this.componentElement != event.target &&\n !isDescendant(this.componentElement, event.target as HTMLElement) &&\n (!this.input.element || (this.input.element != event.target &&\n !isDescendant(this.input.element, event.target as HTMLElement))))\n {\n this.hidePicker();\n }\n }\n\n /**\n * Handles clicking inside of picker element\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickInside(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n }\n\n /**\n * Runs placement of picker component\n * @param componentElement - Element to be positioned\n * @param watch - Indication whether watch for changes and update position\n */\n protected positionPicker(componentElement: HTMLElement, watch: boolean): Observable<PositionResult<HTMLElement>>\n {\n return this.position.placeElement(componentElement, this.element.nativeElement,\n {\n flip: true,\n placement: this.withPickerOptions.positionOptions,\n autoUpdate: watch,\n });\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n if(!this.componentRef)\n {\n return;\n }\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('maxDateTime'), this.dateTimeData.maxDateTime);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n if(!this.componentRef)\n {\n return;\n }\n\n this.componentRef.setInput(nameof<DateTimePickerComponent>('minDateTime'), this.dateTimeData.minDateTime);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n}"]}