@anglr/datetime 8.1.0-beta.20240827080139 → 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":"dateTime.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTime/dateTime.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AAClE,OAAO,EAAU,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,KAAK,EAAc,OAAO,EAAe,MAAM,MAAM,CAAC;AAG5E,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAMH,MAAM,OAAO,mBAAmB;IAE5B,0EAA0E;IAE1E;;OAEG;IACO,yBAAyB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEzE;;OAEG;IACO,yBAAyB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEzE;;OAEG;IACO,0BAA0B,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAE1E;;OAEG;IACO,qBAAqB,CAA8B;IAE7D;;OAEG;IACO,qBAAqB,CAA8B;IAE7D;;OAEG;IACO,YAAY,CAAuB;IAE7C;;OAEG;IACO,YAAY,CAAuB;IAE7C;;OAEG;IACO,YAAY,GAAwB,mBAAmB,CAAC,YAAY,CAAC;IAE/E;;OAEG;IACO,OAAO,GAAyB,MAAM,CAAC;IAEjD;;OAEG;IACO,OAAO,GAAmB,MAAM,CAAC,QAAQ,CAAmB,CAAC;IAEvE;;OAEG;IACO,cAAc,GAAmB,MAAM,CAAC,eAAe,CAAC,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;iBACnB;8BAiGc,WAAW;sBADrB,KAAK;gBAqBK,MAAM;sBADhB,KAAK;gBAeK,YAAY;sBADtB,KAAK;gBAeC,UAAU;sBADhB,KAAK;gBAOK,WAAW;sBADrB,KAAK;gBAwDK,WAAW;sBADrB,KAAK;gBAyEI,UAAU,MAYV,UAAU","sourcesContent":["import {Directive, inject, Input, OnDestroy} from '@angular/core';\nimport {Action1, BindThis, isBlank, isString} from '@jscrpt/common';\nimport {debounceTime, merge, Observable, Subject, Subscription} from 'rxjs';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {getSingleDateTimeValue} from '../../../../misc/utils';\nimport {DateApi, DateValue} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Directive that holds shared data for date time, like formats, restrictions\n */\n@Directive(\n{\n selector: '[dateTime]',\n standalone: true,\n})\nexport class DateTimeSADirective<TDate = unknown> implements OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting changes in max date time value\n */\n protected maxDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in min date time value\n */\n protected minDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in custom format value\n */\n protected customFormatChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subscription for max date instance value changes\n */\n protected maxDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Subscription for min date instance value changes\n */\n protected minDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Max allowed value of date time\n */\n protected ɵmaxDateTime: TDate|undefined|null;\n\n /**\n * Min allowed value of date time\n */\n protected ɵminDateTime: TDate|undefined|null;\n\n /**\n * Date time value format which is being worked with in this date time\n */\n protected ɵvalueFormat: DateTimeValueFormat = DateTimeValueFormat.DateInstance;\n\n /**\n * Format of string representation of date\n */\n protected ɵformat: keyof FormatProvider = 'date';\n\n /**\n * Date api instance, used for date time manipulation\n */\n protected dateApi: DateApi<TDate> = inject(DATE_API) as DateApi<TDate>;\n\n /**\n * Provider for available formats\n */\n protected formatProvider: FormatProvider = inject(FORMAT_PROVIDER);\n\n /**\n * Custom format string representation of date\n */\n protected ɵcustomFormat: string = this.dateApi.getFormat(this.formatProvider[this.ɵformat]);\n\n //######################### public properties #########################\n\n /**\n * Occurs when there are changes in max date time value\n */\n public get maxDateTimeChanges(): Observable<void>\n {\n return this.maxDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in min date time value\n */\n public get minDateTimeChanges(): Observable<void>\n {\n return this.minDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in custom format value\n */\n public get customFormatChanges(): Observable<void>\n {\n return this.customFormatChangesSubject.asObservable();\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets date time value format which is being worked with in this date time\n */\n @Input()\n public get valueFormat(): DateTimeValueFormat\n {\n return this.ɵvalueFormat;\n }\n public set valueFormat(value: DateTimeValueFormat)\n {\n if(isString(value))\n {\n this.ɵvalueFormat = DateTimeValueFormat[value] as unknown as DateTimeValueFormat;\n\n return;\n }\n\n this.ɵvalueFormat = value;\n }\n\n /**\n * Gets or sets format of string representation of date\n */\n @Input()\n public get format(): keyof FormatProvider\n {\n return this.ɵformat;\n }\n public set format(value: keyof FormatProvider)\n {\n this.ɵformat = value;\n this.customFormat = this.dateApi.getFormat(this.formatProvider[value]);\n }\n\n /**\n * Gets or sets custom format string representation of date\n */\n @Input()\n public get customFormat(): string\n {\n return this.ɵcustomFormat;\n }\n public set customFormat(value: string)\n {\n this.ɵcustomFormat = value;\n this.customFormatChangesSubject.next();\n }\n\n /**\n * Represents data format that is used as value of date time when `DateTimeValueFormat.DataString` is set to `valueFormat`\n */\n @Input()\n public dataFormat: string|undefined|null;\n\n /**\n * Gets or sets max allowed date for date time\n */\n @Input()\n public get maxDateTime(): TDate|undefined|null\n {\n return this.ɵmaxDateTime;\n }\n public set maxDateTime(value: TDate|undefined|null)\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.maxDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.maxDateInstanceChange = merge(value.valueChange, value.valueSet)\n .pipe(debounceTime(10))\n .subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.maxDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n val = v;\n }\n \n this.setMinMaxValue(val, this.maxDateSet);\n }\n\n /**\n * Gets or sets min allowed date for date time\n */\n @Input()\n public get minDateTime(): TDate|undefined|null\n {\n return this.ɵminDateTime;\n }\n public set minDateTime(value: TDate|undefined|null)\n {\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.minDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.minDateInstanceChange = merge(value.valueChange, value.valueSet)\n .pipe(debounceTime(10))\n .subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.minDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.minDateSet(null);\n\n return;\n }\n\n val = v;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets min date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected minDateSet(value: TDate|undefined|null): void\n {\n this.ɵminDateTime = value;\n this.minDateTimeChangesSubject.next();\n this.onMinDateTimeChange();\n }\n\n /**\n * Sets max date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected maxDateSet(value: TDate|undefined|null): void\n {\n this.ɵmaxDateTime = value;\n this.maxDateTimeChangesSubject.next();\n this.onMaxDateTimeChange();\n }\n\n /**\n * Sets min or max date time value\n * @param value - Value to be set\n * @param setter - Action used for setting value\n */\n protected setMinMaxValue(value: DateValue|TDate, setter: Action1<TDate|undefined|null>): void\n {\n const val = this.dateApi.getValue(value, this.dataFormat ?? this.customFormat);\n\n if(val.isValid())\n {\n setter(val.value);\n }\n else\n {\n setter(null);\n }\n }\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `valueFormat` input\n */\n public static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat|DateTimeValueFormat;\n\n /**\n * Custom input type for `maxDateTime` input\n */\n public static ngAcceptInputType_maxDateTime: DateValue|DateTimeBase;\n\n /**\n * Custom input type for `minDateTime` input\n */\n public static ngAcceptInputType_minDateTime: DateValue|DateTimeBase;\n}"]}
1
+ {"version":3,"file":"dateTime.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTime/dateTime.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AAClE,OAAO,EAAU,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAC,YA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,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACO,cAAc,CAAC,KAAsB,EAAE,MAAqC;QAElF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QAE/E,IAAG,GAAG,CAAC,OAAO,EAAE,EAChB,CAAC;YACG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;aAED,CAAC;YACG,MAAM,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACL,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;8GAvUQ,iBAAiB;kGAAjB,iBAAiB;;AAqRhB;IADT,QAAQ;;;;mDAMR;AAOS;IADT,QAAQ;;;;mDAMR;2FAtSQ,iBAAiB;kBAL7B,SAAS;mBACV;oBACI,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,IAAI;iBACnB;8BAiGc,WAAW;sBADrB,KAAK;gBAqBK,MAAM;sBADhB,KAAK;gBAeK,YAAY;sBADtB,KAAK;gBAeC,UAAU;sBADhB,KAAK;gBAOK,WAAW;sBADrB,KAAK;gBAwDK,WAAW;sBADrB,KAAK;gBAyEI,UAAU,MAYV,UAAU","sourcesContent":["import {Directive, inject, Input, OnDestroy} from '@angular/core';\nimport {Action1, BindThis, isBlank, isString} from '@jscrpt/common';\nimport {debounceTime, merge, Observable, Subject, Subscription} from 'rxjs';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {getSingleDateTimeValue} from '../../../../misc/utils';\nimport {DateApi, DateValue} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Directive that holds shared data for date time, like formats, restrictions\n */\n@Directive(\n{\n selector: '[dateTime]',\n standalone: true,\n})\nexport class DateTimeDirective<TDate = unknown> implements OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting changes in max date time value\n */\n protected maxDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in min date time value\n */\n protected minDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in custom format value\n */\n protected customFormatChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subscription for max date instance value changes\n */\n protected maxDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Subscription for min date instance value changes\n */\n protected minDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Max allowed value of date time\n */\n protected ɵmaxDateTime: TDate|undefined|null;\n\n /**\n * Min allowed value of date time\n */\n protected ɵminDateTime: TDate|undefined|null;\n\n /**\n * Date time value format which is being worked with in this date time\n */\n protected ɵvalueFormat: DateTimeValueFormat = DateTimeValueFormat.DateInstance;\n\n /**\n * Format of string representation of date\n */\n protected ɵformat: keyof FormatProvider = 'date';\n\n /**\n * Date api instance, used for date time manipulation\n */\n protected dateApi: DateApi<TDate> = inject(DATE_API) as DateApi<TDate>;\n\n /**\n * Provider for available formats\n */\n protected formatProvider: FormatProvider = inject(FORMAT_PROVIDER);\n\n /**\n * Custom format string representation of date\n */\n protected ɵcustomFormat: string = this.dateApi.getFormat(this.formatProvider[this.ɵformat]);\n\n //######################### public properties #########################\n\n /**\n * Occurs when there are changes in max date time value\n */\n public get maxDateTimeChanges(): Observable<void>\n {\n return this.maxDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in min date time value\n */\n public get minDateTimeChanges(): Observable<void>\n {\n return this.minDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in custom format value\n */\n public get customFormatChanges(): Observable<void>\n {\n return this.customFormatChangesSubject.asObservable();\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets date time value format which is being worked with in this date time\n */\n @Input()\n public get valueFormat(): DateTimeValueFormat\n {\n return this.ɵvalueFormat;\n }\n public set valueFormat(value: DateTimeValueFormat)\n {\n if(isString(value))\n {\n this.ɵvalueFormat = DateTimeValueFormat[value] as unknown as DateTimeValueFormat;\n\n return;\n }\n\n this.ɵvalueFormat = value;\n }\n\n /**\n * Gets or sets format of string representation of date\n */\n @Input()\n public get format(): keyof FormatProvider\n {\n return this.ɵformat;\n }\n public set format(value: keyof FormatProvider)\n {\n this.ɵformat = value;\n this.customFormat = this.dateApi.getFormat(this.formatProvider[value]);\n }\n\n /**\n * Gets or sets custom format string representation of date\n */\n @Input()\n public get customFormat(): string\n {\n return this.ɵcustomFormat;\n }\n public set customFormat(value: string)\n {\n this.ɵcustomFormat = value;\n this.customFormatChangesSubject.next();\n }\n\n /**\n * Represents data format that is used as value of date time when `DateTimeValueFormat.DataString` is set to `valueFormat`\n */\n @Input()\n public dataFormat: string|undefined|null;\n\n /**\n * Gets or sets max allowed date for date time\n */\n @Input()\n public get maxDateTime(): TDate|undefined|null\n {\n return this.ɵmaxDateTime;\n }\n public set maxDateTime(value: TDate|undefined|null)\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.maxDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.maxDateInstanceChange = merge(value.valueChange, value.valueSet)\n .pipe(debounceTime(10))\n .subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.maxDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n val = v;\n }\n \n this.setMinMaxValue(val, this.maxDateSet);\n }\n\n /**\n * Gets or sets min allowed date for date time\n */\n @Input()\n public get minDateTime(): TDate|undefined|null\n {\n return this.ɵminDateTime;\n }\n public set minDateTime(value: TDate|undefined|null)\n {\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.minDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.minDateInstanceChange = merge(value.valueChange, value.valueSet)\n .pipe(debounceTime(10))\n .subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.minDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.minDateSet(null);\n\n return;\n }\n\n val = v;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets min date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected minDateSet(value: TDate|undefined|null): void\n {\n this.ɵminDateTime = value;\n this.minDateTimeChangesSubject.next();\n this.onMinDateTimeChange();\n }\n\n /**\n * Sets max date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected maxDateSet(value: TDate|undefined|null): void\n {\n this.ɵmaxDateTime = value;\n this.maxDateTimeChangesSubject.next();\n this.onMaxDateTimeChange();\n }\n\n /**\n * Sets min or max date time value\n * @param value - Value to be set\n * @param setter - Action used for setting value\n */\n protected setMinMaxValue(value: DateValue|TDate, setter: Action1<TDate|undefined|null>): void\n {\n const val = this.dateApi.getValue(value, this.dataFormat ?? this.customFormat);\n\n if(val.isValid())\n {\n setter(val.value);\n }\n else\n {\n setter(null);\n }\n }\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `valueFormat` input\n */\n public static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat|DateTimeValueFormat;\n\n /**\n * Custom input type for `maxDateTime` input\n */\n public static ngAcceptInputType_maxDateTime: DateValue|DateTimeBase;\n\n /**\n * Custom input type for `minDateTime` input\n */\n public static ngAcceptInputType_minDateTime: DateValue|DateTimeBase;\n}"]}
@@ -1,24 +1,11 @@
1
1
  import { Directive, EventEmitter, inject } from '@angular/core';
2
2
  import { Subscription } from 'rxjs';
3
- import { DateTimeSADirective } from './dateTime/dateTime.directive';
3
+ import { DateTimeDirective } from './dateTime/dateTime.directive';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Base class for date time directives, contains basic shared data
7
7
  */
8
8
  export class DateTimeBase {
9
- //######################### protected properties #########################
10
- /**
11
- * Subscriptions created during initialization
12
- */
13
- initSubscriptions = new Subscription();
14
- /**
15
- * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue
16
- */
17
- ɵValue;
18
- /**
19
- * Instance of date time shared data, like formats and restrictions
20
- */
21
- dateTimeData = inject((DateTimeSADirective));
22
9
  //######################### public properties - implementation of DateTimeInputValue #########################
23
10
  /**
24
11
  * @inheritdoc
@@ -29,16 +16,25 @@ export class DateTimeBase {
29
16
  set value(value) {
30
17
  this.ɵValue = value;
31
18
  }
32
- /**
33
- * @inheritdoc
34
- */
35
- valueChange = new EventEmitter();
36
- /**
37
- * @inheritdoc
38
- */
39
- valueSet = new EventEmitter();
40
19
  //######################### constructor #########################
41
20
  constructor() {
21
+ //######################### protected properties #########################
22
+ /**
23
+ * Subscriptions created during initialization
24
+ */
25
+ this.initSubscriptions = new Subscription();
26
+ /**
27
+ * Instance of date time shared data, like formats and restrictions
28
+ */
29
+ this.dateTimeData = inject((DateTimeDirective));
30
+ /**
31
+ * @inheritdoc
32
+ */
33
+ this.valueChange = new EventEmitter();
34
+ /**
35
+ * @inheritdoc
36
+ */
37
+ this.valueSet = new EventEmitter();
42
38
  this.initSubscriptions.add(this.dateTimeData.maxDateTimeChanges.subscribe(() => this.onMaxDateTimeChange()));
43
39
  this.initSubscriptions.add(this.dateTimeData.minDateTimeChanges.subscribe(() => this.onMinDateTimeChange()));
44
40
  }
@@ -60,10 +56,10 @@ export class DateTimeBase {
60
56
  */
61
57
  onMinDateTimeChange() {
62
58
  }
63
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
64
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeBase, ngImport: i0 });
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimeBase, ngImport: i0 }); }
65
61
  }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeBase, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeBase, decorators: [{
67
63
  type: Directive
68
64
  }], ctorParameters: () => [] });
69
65
  //# sourceMappingURL=dateTimeBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/directives/dateTimeBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,MAA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BADxB,SAAS","sourcesContent":["import {Directive, EventEmitter, inject, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../misc/types';\nimport {DateTimeSADirective} from './dateTime/dateTime.directive';\n\n/**\n * Base class for date time directives, contains basic shared data\n */\n@Directive()\nexport class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue\n */\n protected ɵValue: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Instance of date time shared data, like formats and restrictions\n */\n protected dateTimeData: DateTimeSADirective<TDate> = inject(DateTimeSADirective<TDate>);\n\n //######################### public properties - implementation of DateTimeInputValue #########################\n\n /**\n * @inheritdoc\n */\n public get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n this.ɵValue = value;\n }\n\n /**\n * @inheritdoc\n */\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * @inheritdoc\n */\n public valueSet: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor()\n {\n this.initSubscriptions.add(this.dateTimeData.maxDateTimeChanges.subscribe(() => this.onMaxDateTimeChange()));\n this.initSubscriptions.add(this.dateTimeData.minDateTimeChanges.subscribe(() => this.onMinDateTimeChange()));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\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;IAEvE;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;8GA1EQ,YAAY;kGAAZ,YAAY;;2FAAZ,YAAY;kBADxB,SAAS","sourcesContent":["import {Directive, EventEmitter, inject, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../misc/types';\nimport {DateTimeDirective} from './dateTime/dateTime.directive';\n\n/**\n * Base class for date time directives, contains basic shared data\n */\n@Directive()\nexport class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Current value of date time, could be string, timestamp, Date, TDate object, or ranged DateTimeValue\n */\n protected ɵValue: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Instance of date time shared data, like formats and restrictions\n */\n protected dateTimeData: DateTimeDirective<TDate> = inject(DateTimeDirective<TDate>);\n\n //######################### public properties - implementation of DateTimeInputValue #########################\n\n /**\n * @inheritdoc\n */\n public get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n this.ɵValue = value;\n }\n\n /**\n * @inheritdoc\n */\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * @inheritdoc\n */\n public valueSet: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor()\n {\n this.initSubscriptions.add(this.dateTimeData.maxDateTimeChanges.subscribe(() => this.onMaxDateTimeChange()));\n this.initSubscriptions.add(this.dateTimeData.minDateTimeChanges.subscribe(() => this.onMinDateTimeChange()));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n}\n"]}
@@ -1,21 +1,25 @@
1
1
  import { Directive, forwardRef, Inject } from '@angular/core';
2
2
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { isNumber } from '@jscrpt/common';
3
4
  import { Subscription } from 'rxjs';
4
5
  import { DATE_TIME_INPUT } from '../../../../misc/tokens';
6
+ import { DateTimeDirective } from '../dateTime/dateTime.directive';
7
+ import { DateTimeValueFormat } from '../../../../misc/enums';
5
8
  import * as i0 from "@angular/core";
9
+ import * as i1 from "../dateTime/dateTime.directive";
6
10
  /**
7
11
  * Control value accessor that is used for getting and setting value for date time
8
12
  */
9
- export class DateTimeControlValueAccessorSADirective {
10
- input;
11
- //######################### protected properties #########################
12
- /**
13
- * Subscriptions created during initialization
14
- */
15
- initSubscriptions = new Subscription();
13
+ export class DateTimeControlValueAccessorDirective {
16
14
  //######################### constructor #########################
17
- constructor(input) {
15
+ constructor(input, dateTime) {
18
16
  this.input = input;
17
+ this.dateTime = dateTime;
18
+ //######################### protected properties #########################
19
+ /**
20
+ * Subscriptions created during initialization
21
+ */
22
+ this.initSubscriptions = new Subscription();
19
23
  }
20
24
  //######################### public methods - implementation of OnDestroy #########################
21
25
  /**
@@ -29,13 +33,29 @@ export class DateTimeControlValueAccessorSADirective {
29
33
  * @inheritdoc
30
34
  */
31
35
  writeValue(value) {
36
+ if (this.dateTime.valueFormat == DateTimeValueFormat.UnixTimestamp) {
37
+ if (!isNumber(value)) {
38
+ throw new Error('DateTimeControlValueAccessorDirective: value is not a number!');
39
+ }
40
+ else {
41
+ value = value * 1000;
42
+ }
43
+ }
32
44
  this.input.value = value;
33
45
  }
34
46
  /**
35
47
  * @inheritdoc
36
48
  */
37
49
  registerOnChange(fn) {
38
- this.initSubscriptions.add(this.input.valueChange.subscribe(() => fn(this.input.value)));
50
+ this.initSubscriptions.add(this.input.valueChange.subscribe(() => {
51
+ const value = this.input.value;
52
+ if (this.dateTime.valueFormat == DateTimeValueFormat.UnixTimestamp && isNumber(value)) {
53
+ fn(value / 1000);
54
+ }
55
+ else {
56
+ fn(this.input.value);
57
+ }
58
+ }));
39
59
  }
40
60
  /**
41
61
  * @inheritdoc
@@ -49,23 +69,23 @@ export class DateTimeControlValueAccessorSADirective {
49
69
  setDisabledState(isDisabled) {
50
70
  this.input.disabled = isDisabled;
51
71
  }
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, deps: [{ token: DATE_TIME_INPUT }], target: i0.ɵɵFactoryTarget.Directive });
53
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeControlValueAccessorSADirective, isStandalone: true, selector: "[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]", providers: [
72
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeControlValueAccessorDirective, deps: [{ token: DATE_TIME_INPUT }, { token: i1.DateTimeDirective }], target: i0.ɵɵFactoryTarget.Directive }); }
73
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimeControlValueAccessorDirective, isStandalone: true, selector: "[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]", providers: [
54
74
  {
55
75
  provide: NG_VALUE_ACCESSOR,
56
- useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),
76
+ useExisting: forwardRef(() => DateTimeControlValueAccessorDirective),
57
77
  multi: true,
58
78
  },
59
- ], ngImport: i0 });
79
+ ], ngImport: i0 }); }
60
80
  }
61
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, decorators: [{
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeControlValueAccessorDirective, decorators: [{
62
82
  type: Directive,
63
83
  args: [{
64
84
  selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',
65
85
  providers: [
66
86
  {
67
87
  provide: NG_VALUE_ACCESSOR,
68
- useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),
88
+ useExisting: forwardRef(() => DateTimeControlValueAccessorDirective),
69
89
  multi: true,
70
90
  },
71
91
  ],
@@ -74,5 +94,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
74
94
  }], ctorParameters: () => [{ type: undefined, decorators: [{
75
95
  type: Inject,
76
96
  args: [DATE_TIME_INPUT]
77
- }] }] });
97
+ }] }, { type: i1.DateTimeDirective }] });
78
98
  //# sourceMappingURL=dateTimeControlValueAccessor.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACzF,OAAO,EAAuB,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;;AAGxD;;GAEG;AAeH,MAAM,OAAO,uCAAuC;IAUD;IAR/C,0EAA0E;IAE1E;;OAEG;IACO,iBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE/D,iEAAiE;IACjE,YAA+C,KAA2B;QAA3B,UAAK,GAAL,KAAK,CAAsB;IAE1E,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED,6GAA6G;IAE7G;;OAEG;IACI,UAAU,CAAC,KAAqD;QAEnE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,EAAkE;QAEtF,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,EAAc;QAEnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,UAAmB;QAEvC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IACrC,CAAC;uGAxDQ,uCAAuC,kBAU5B,eAAe;2FAV1B,uCAAuC,sHAVhD;YAEI;gBACI,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,uCAAuC,CAAC;gBACtE,KAAK,EAAE,IAAI;aACd;SACJ;;2FAGQ,uCAAuC;kBAdnD,SAAS;mBACV;oBACI,QAAQ,EAAE,yEAAyE;oBACnF,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,wCAAwC,CAAC;4BACtE,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\n\n/**\n * Control value accessor that is used for getting and setting value for date time\n */\n@Directive(\n{\n selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class DateTimeControlValueAccessorSADirective<TDate = unknown> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.input.value = value;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: DateTimeInputOutputValue<TDate>|undefined|null) => void): void\n {\n this.initSubscriptions.add(this.input.valueChange.subscribe(() => fn(this.input.value)));\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.initSubscriptions.add(this.input.focus.subscribe(() => fn()));\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.input.disabled = isDisabled;\n }\n}"]}
1
+ {"version":3,"file":"dateTimeControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAA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from '@angular/forms';\nimport {isNumber} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {DateTimeDirective} from '../dateTime/dateTime.directive';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\n\n/**\n * Control value accessor that is used for getting and setting value for date time\n */\n@Directive(\n{\n selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTimeControlValueAccessorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class DateTimeControlValueAccessorDirective<TDate = unknown> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n protected dateTime: DateTimeDirective<TDate>,)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n if(this.dateTime.valueFormat == DateTimeValueFormat.UnixTimestamp)\n {\n if(!isNumber(value))\n {\n throw new Error('DateTimeControlValueAccessorDirective: value is not a number!');\n }\n else\n {\n value = value * 1000;\n }\n }\n\n this.input.value = value;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: DateTimeInputOutputValue<TDate>|undefined|null) => void): void\n {\n this.initSubscriptions.add(this.input.valueChange.subscribe(() =>\n {\n const value = this.input.value;\n\n if(this.dateTime.valueFormat == DateTimeValueFormat.UnixTimestamp && isNumber(value))\n {\n fn(value / 1000);\n }\n else\n {\n fn(this.input.value);\n }\n }));\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.initSubscriptions.add(this.input.focus.subscribe(() => fn()));\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.input.disabled = isDisabled;\n }\n}"]}
@@ -12,15 +12,7 @@ import * as i1 from "../../../../services";
12
12
  /**
13
13
  * Directive that is used for setting up date time input
14
14
  */
15
- export class DateTimeInputSADirective extends DateTimeBase {
16
- elementRef;
17
- dateApi;
18
- valueProvider;
19
- //######################### protected properties #########################
20
- /**
21
- * Internal representation of current date time value
22
- */
23
- internalValue;
15
+ export class DateTimeInputDirective extends DateTimeBase {
24
16
  //######################### public properties - implementation of DateTimeInput #########################
25
17
  /**
26
18
  * @inheritdoc
@@ -65,20 +57,20 @@ export class DateTimeInputSADirective extends DateTimeBase {
65
57
  get element() {
66
58
  return this.elementRef.nativeElement;
67
59
  }
68
- /**
69
- * @inheritdoc
70
- */
71
- focus = new EventEmitter();
72
- /**
73
- * @inheritdoc
74
- */
75
- blur = new EventEmitter();
76
60
  //######################### constructors #########################
77
61
  constructor(elementRef, dateApi, valueProvider) {
78
62
  super();
79
63
  this.elementRef = elementRef;
80
64
  this.dateApi = dateApi;
81
65
  this.valueProvider = valueProvider;
66
+ /**
67
+ * @inheritdoc
68
+ */
69
+ this.focus = new EventEmitter();
70
+ /**
71
+ * @inheritdoc
72
+ */
73
+ this.blur = new EventEmitter();
82
74
  this.elementRef.nativeElement.addEventListener('input', this.handleInput);
83
75
  this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);
84
76
  this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);
@@ -132,40 +124,40 @@ export class DateTimeInputSADirective extends DateTimeBase {
132
124
  handleBlur(event) {
133
125
  this.blur.emit(event);
134
126
  }
135
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeInputSADirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
136
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeInputSADirective, isStandalone: true, selector: "input[dateTime][dateTimeInput]", providers: [
127
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeInputDirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive }); }
128
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimeInputDirective, isStandalone: true, selector: "input[dateTime][dateTimeInput]", providers: [
137
129
  {
138
130
  provide: DATE_TIME_INPUT,
139
- useExisting: forwardRef(() => DateTimeInputSADirective),
131
+ useExisting: forwardRef(() => DateTimeInputDirective),
140
132
  },
141
- ], exportAs: ["dateTime"], usesInheritance: true, ngImport: i0 });
133
+ ], exportAs: ["dateTime"], usesInheritance: true, ngImport: i0 }); }
142
134
  }
143
135
  __decorate([
144
136
  BindThis,
145
137
  __metadata("design:type", Function),
146
138
  __metadata("design:paramtypes", []),
147
139
  __metadata("design:returntype", void 0)
148
- ], DateTimeInputSADirective.prototype, "handleInput", null);
140
+ ], DateTimeInputDirective.prototype, "handleInput", null);
149
141
  __decorate([
150
142
  BindThis,
151
143
  __metadata("design:type", Function),
152
144
  __metadata("design:paramtypes", [FocusEvent]),
153
145
  __metadata("design:returntype", void 0)
154
- ], DateTimeInputSADirective.prototype, "handleFocus", null);
146
+ ], DateTimeInputDirective.prototype, "handleFocus", null);
155
147
  __decorate([
156
148
  BindThis,
157
149
  __metadata("design:type", Function),
158
150
  __metadata("design:paramtypes", [FocusEvent]),
159
151
  __metadata("design:returntype", void 0)
160
- ], DateTimeInputSADirective.prototype, "handleBlur", null);
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeInputSADirective, decorators: [{
152
+ ], DateTimeInputDirective.prototype, "handleBlur", null);
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeInputDirective, decorators: [{
162
154
  type: Directive,
163
155
  args: [{
164
156
  selector: 'input[dateTime][dateTimeInput]',
165
157
  providers: [
166
158
  {
167
159
  provide: DATE_TIME_INPUT,
168
- useExisting: forwardRef(() => DateTimeInputSADirective),
160
+ useExisting: forwardRef(() => DateTimeInputDirective),
169
161
  },
170
162
  ],
171
163
  standalone: true,
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;;;AAE3D,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,wBAA0C,SAAQ,YAAmB;IAgFxD;IACkB;IAClB;IAhFtB,0EAA0E;IAE1E;;OAEG;IACO,aAAa,CAA4C;IAEnE,yGAAyG;IAEzG;;OAEG;IACH,IAAW,QAAQ;QAEf,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC;IAC/C,CAAC;IAC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AU;iBACvB;;0BAkFgB,MAAM;2BAAC,QAAQ;yEAyClB,WAAW,MAyBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, getInternalValue} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n\n this.valueSet.next();\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateTimeFormat: DateTimeValueFormat|undefined|null = null,): void\n {\n this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider, dateTimeFormat);\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueSet.next();\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue, DateTimeValueFormat.FormattedString);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n\n this.valueSet.next();\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;;;AAE3D,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,sBAAwC,SAAQ,YAAmB;IAS5E,yGAAyG;IAEzG;;OAEG;IACH,IAAW,QAAQ;QAEf,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC;IAC/C,CAAC;IACD,IAAW,QAAQ,CAAC,KAA4B;QAE5C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,KAAK,IAAI,EAA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AW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, getInternalValue} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputDirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputDirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n\n this.valueSet.next();\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateTimeFormat: DateTimeValueFormat|undefined|null = null,): void\n {\n this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider, dateTimeFormat);\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueSet.next();\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue, DateTimeValueFormat.FormattedString);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n\n this.valueSet.next();\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
@@ -7,17 +7,16 @@ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time max value
9
9
  */
10
- export class DateTimeMaxValidatorSADirective extends DateTimeBase {
11
- dateApi;
12
- //######################### private fields #########################
13
- /**
14
- * Function used for validations
15
- */
16
- _validator = () => null;
10
+ export class DateTimeMaxValidatorDirective extends DateTimeBase {
17
11
  //######################### constructor #########################
18
12
  constructor(dateApi) {
19
13
  super();
20
14
  this.dateApi = dateApi;
15
+ //######################### private fields #########################
16
+ /**
17
+ * Function used for validations
18
+ */
19
+ this._validator = () => null;
21
20
  }
22
21
  //######################### public methods - implementation of OnInit #########################
23
22
  /**
@@ -42,23 +41,23 @@ export class DateTimeMaxValidatorSADirective extends DateTimeBase {
42
41
  onMaxDateTimeChange() {
43
42
  this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
44
43
  }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeMaxValidatorSADirective, isStandalone: true, selector: "[dateTime][maxDateTime][validate]", providers: [
44
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeMaxValidatorDirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive }); }
45
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimeMaxValidatorDirective, isStandalone: true, selector: "[dateTime][maxDateTime][validate]", providers: [
47
46
  {
48
47
  provide: NG_VALIDATORS,
49
- useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),
48
+ useExisting: forwardRef(() => DateTimeMaxValidatorDirective),
50
49
  multi: true
51
50
  },
52
- ], usesInheritance: true, ngImport: i0 });
51
+ ], usesInheritance: true, ngImport: i0 }); }
53
52
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeMaxValidatorDirective, decorators: [{
55
54
  type: Directive,
56
55
  args: [{
57
56
  selector: '[dateTime][maxDateTime][validate]',
58
57
  providers: [
59
58
  {
60
59
  provide: NG_VALIDATORS,
61
- useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),
60
+ useExisting: forwardRef(() => DateTimeMaxValidatorDirective),
62
61
  multi: true
63
62
  },
64
63
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeMaxValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iB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4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMaxValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time max value\n */\n@Directive(\n{\n selector: '[dateTime][maxDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMaxValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeMaxValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAeH,MAAM,OAAO,6BAA+C,SAAQ,YAAmB;IASnF,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;QAR/D,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAM7C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;8GA7CQ,6BAA6B,kBAUlB,QAAQ;kGAVnB,6BAA6B,gFAVtC;YAEI;gBACI,OAAO,EAAE,aAAa;gBACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;gBAC5D,KAAK,EAAE,IAAI;aACd;SACJ;;2FAGQ,6BAA6B;kBAdzC,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMaxValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time max value\n */\n@Directive(\n{\n selector: '[dateTime][maxDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMaxValidatorDirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMaxValidatorDirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}
@@ -7,17 +7,16 @@ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time min value
9
9
  */
10
- export class DateTimeMinValidatorSADirective extends DateTimeBase {
11
- dateApi;
12
- //######################### private fields #########################
13
- /**
14
- * Function used for validations
15
- */
16
- _validator = () => null;
10
+ export class DateTimeMinValidatorDirective extends DateTimeBase {
17
11
  //######################### constructor #########################
18
12
  constructor(dateApi) {
19
13
  super();
20
14
  this.dateApi = dateApi;
15
+ //######################### private fields #########################
16
+ /**
17
+ * Function used for validations
18
+ */
19
+ this._validator = () => null;
21
20
  }
22
21
  //######################### public methods - implementation of OnInit #########################
23
22
  /**
@@ -42,23 +41,23 @@ export class DateTimeMinValidatorSADirective extends DateTimeBase {
42
41
  onMinDateTimeChange() {
43
42
  this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
44
43
  }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMinValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeMinValidatorSADirective, isStandalone: true, selector: "[dateTime][minDateTime][validate]", providers: [
44
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeMinValidatorDirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive }); }
45
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: DateTimeMinValidatorDirective, isStandalone: true, selector: "[dateTime][minDateTime][validate]", providers: [
47
46
  {
48
47
  provide: NG_VALIDATORS,
49
- useExisting: forwardRef(() => DateTimeMinValidatorSADirective),
48
+ useExisting: forwardRef(() => DateTimeMinValidatorDirective),
50
49
  multi: true
51
50
  },
52
- ], usesInheritance: true, ngImport: i0 });
51
+ ], usesInheritance: true, ngImport: i0 }); }
53
52
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMinValidatorSADirective, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: DateTimeMinValidatorDirective, decorators: [{
55
54
  type: Directive,
56
55
  args: [{
57
56
  selector: '[dateTime][minDateTime][validate]',
58
57
  providers: [
59
58
  {
60
59
  provide: NG_VALIDATORS,
61
- useExisting: forwardRef(() => DateTimeMinValidatorSADirective),
60
+ useExisting: forwardRef(() => DateTimeMinValidatorDirective),
62
61
  multi: true
63
62
  },
64
63
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeMinValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;A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,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMinValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time min value\n */\n@Directive(\n{\n selector: '[dateTime][minDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMinValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMinValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeMinValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAeH,MAAM,OAAO,6BAA+C,SAAQ,YAAmB;IASnF,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;QAR/D,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAM7C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;8GA7CQ,6BAA6B,kBAUlB,QAAQ;kGAVnB,6BAA6B,gFAVtC;YAEI;gBACI,OAAO,EAAE,aAAa;gBACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;gBAC5D,KAAK,EAAE,IAAI;aACd;SACJ;;2FAGQ,6BAA6B;kBAdzC,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMinValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time min value\n */\n@Directive(\n{\n selector: '[dateTime][minDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMinValidatorDirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMinValidatorDirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}