@dereekb/dbx-form 9.25.16 → 10.0.1

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 (364) hide show
  1. package/_index.scss +1 -0
  2. package/calendar/lib/calendar.module.d.ts +1 -1
  3. package/calendar/lib/calendar.schedule.selection.cell.component.d.ts +1 -1
  4. package/calendar/lib/calendar.schedule.selection.component.d.ts +4 -4
  5. package/calendar/lib/calendar.schedule.selection.d.ts +1 -1
  6. package/calendar/lib/calendar.schedule.selection.days.component.d.ts +1 -1
  7. package/calendar/lib/calendar.schedule.selection.days.form.component.d.ts +2 -2
  8. package/calendar/lib/calendar.schedule.selection.dialog.button.component.d.ts +1 -6
  9. package/calendar/lib/calendar.schedule.selection.dialog.component.d.ts +1 -11
  10. package/calendar/lib/calendar.schedule.selection.popover.button.component.d.ts +2 -2
  11. package/calendar/lib/calendar.schedule.selection.popover.component.d.ts +1 -1
  12. package/calendar/lib/calendar.schedule.selection.popover.content.component.d.ts +1 -1
  13. package/calendar/lib/calendar.schedule.selection.range.component.d.ts +1 -1
  14. package/calendar/lib/calendar.schedule.selection.store.d.ts +4 -32
  15. package/calendar/lib/calendar.schedule.selection.store.provide.d.ts +1 -1
  16. package/calendar/lib/calendar.schedule.selection.toggle.button.component.d.ts +1 -1
  17. package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +2 -8
  18. package/esm2022/calendar/lib/calendar.module.mjs +155 -0
  19. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.cell.component.mjs +10 -10
  20. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.component.mjs +6 -6
  21. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.days.component.mjs +6 -6
  22. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.days.form.component.mjs +6 -6
  23. package/esm2022/calendar/lib/calendar.schedule.selection.dialog.button.component.mjs +36 -0
  24. package/esm2022/calendar/lib/calendar.schedule.selection.dialog.component.mjs +56 -0
  25. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.mjs +1 -1
  26. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.popover.button.component.mjs +6 -6
  27. package/esm2022/calendar/lib/calendar.schedule.selection.popover.component.mjs +38 -0
  28. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +6 -6
  29. package/esm2022/calendar/lib/calendar.schedule.selection.range.component.mjs +188 -0
  30. package/esm2022/calendar/lib/calendar.schedule.selection.store.mjs +785 -0
  31. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.store.provide.mjs +7 -7
  32. package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.toggle.button.component.mjs +6 -6
  33. package/esm2022/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +158 -0
  34. package/esm2022/calendar/lib/field/schedule/calendar.schedule.field.mjs +28 -0
  35. package/esm2022/calendar/lib/field/schedule/calendar.schedule.module.mjs +58 -0
  36. package/{esm2020 → esm2022}/lib/form/action/form.action.directive.mjs +4 -4
  37. package/{esm2020 → esm2022}/lib/form/action/form.action.module.mjs +5 -5
  38. package/{esm2020 → esm2022}/lib/form/action/transition/form.action.transition.module.mjs +5 -5
  39. package/{esm2020 → esm2022}/lib/form/action/transition/form.action.transition.safety.directive.mjs +4 -4
  40. package/{esm2020 → esm2022}/lib/form/form.module.mjs +5 -5
  41. package/{esm2020 → esm2022}/lib/form/io/form.changes.directive.mjs +4 -4
  42. package/{esm2020 → esm2022}/lib/form/io/form.input.directive.mjs +4 -4
  43. package/{esm2020 → esm2022}/lib/form/io/form.io.module.mjs +5 -5
  44. package/{esm2020 → esm2022}/lib/form/io/form.loading.directive.mjs +4 -4
  45. package/{esm2020 → esm2022}/lib/form.module.mjs +5 -5
  46. package/{esm2020 → esm2022}/lib/formly/field/checklist/checklist.item.field.component.mjs +9 -9
  47. package/{esm2020 → esm2022}/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +6 -6
  48. package/esm2022/lib/formly/field/checklist/checklist.item.field.module.mjs +67 -0
  49. package/{esm2020 → esm2022}/lib/formly/field/component/component.field.component.mjs +6 -6
  50. package/esm2022/lib/formly/field/component/component.field.module.mjs +32 -0
  51. package/esm2022/lib/formly/field/field.mjs +97 -0
  52. package/{esm2020 → esm2022}/lib/formly/field/form.field.module.mjs +5 -5
  53. package/{esm2020 → esm2022}/lib/formly/field/selection/list/list.field.component.mjs +4 -4
  54. package/esm2022/lib/formly/field/selection/list/list.field.module.mjs +76 -0
  55. package/esm2022/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +33 -0
  56. package/{esm2020 → esm2022}/lib/formly/field/selection/pickable/pickable.field.directive.mjs +4 -4
  57. package/esm2022/lib/formly/field/selection/pickable/pickable.field.module.mjs +93 -0
  58. package/esm2022/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +116 -0
  59. package/{esm2020 → esm2022}/lib/formly/field/selection/pickable/pickable.mjs +1 -1
  60. package/esm2022/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +68 -0
  61. package/esm2022/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +95 -0
  62. package/esm2022/lib/formly/field/selection/searchable/searchable.field.directive.mjs +278 -0
  63. package/esm2022/lib/formly/field/selection/searchable/searchable.field.module.mjs +91 -0
  64. package/{esm2020 → esm2022}/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +4 -4
  65. package/esm2022/lib/formly/field/selection/selection.field.mjs +39 -0
  66. package/{esm2020 → esm2022}/lib/formly/field/selection/selection.mjs +1 -1
  67. package/{esm2020 → esm2022}/lib/formly/field/selection/selection.module.mjs +5 -5
  68. package/{esm2020 → esm2022}/lib/formly/field/selection/sourceselect/sourceselect.field.component.mjs +4 -4
  69. package/esm2022/lib/formly/field/selection/sourceselect/sourceselect.field.module.mjs +93 -0
  70. package/{esm2020 → esm2022}/lib/formly/field/texteditor/texteditor.field.component.mjs +6 -6
  71. package/esm2022/lib/formly/field/texteditor/texteditor.field.module.mjs +51 -0
  72. package/{esm2020 → esm2022}/lib/formly/field/value/array/array.field.component.mjs +8 -8
  73. package/esm2022/lib/formly/field/value/array/array.field.module.mjs +62 -0
  74. package/esm2022/lib/formly/field/value/boolean/boolean.field.mjs +47 -0
  75. package/{esm2020 → esm2022}/lib/formly/field/value/boolean/boolean.field.module.mjs +5 -5
  76. package/esm2022/lib/formly/field/value/date/date.field.module.mjs +96 -0
  77. package/esm2022/lib/formly/field/value/date/datetime.field.component.mjs +488 -0
  78. package/esm2022/lib/formly/field/value/date/datetime.field.mjs +141 -0
  79. package/{esm2020 → esm2022}/lib/formly/field/value/date/datetime.field.service.mjs +9 -9
  80. package/esm2022/lib/formly/field/value/date/fixeddaterange.field.component.mjs +506 -0
  81. package/{esm2020 → esm2022}/lib/formly/field/value/number/number.field.module.mjs +5 -5
  82. package/esm2022/lib/formly/field/value/phone/phone.field.component.mjs +100 -0
  83. package/esm2022/lib/formly/field/value/phone/phone.field.module.mjs +66 -0
  84. package/{esm2020 → esm2022}/lib/formly/field/value/text/text.field.module.mjs +5 -5
  85. package/{esm2020 → esm2022}/lib/formly/field/value/value.module.mjs +5 -5
  86. package/{esm2020 → esm2022}/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +6 -6
  87. package/{esm2020 → esm2022}/lib/formly/field/wrapper/expandable.wrapper.component.mjs +6 -6
  88. package/{esm2020 → esm2022}/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +4 -4
  89. package/{esm2020 → esm2022}/lib/formly/field/wrapper/flex.wrapper.component.mjs +6 -6
  90. package/esm2022/lib/formly/field/wrapper/form.wrapper.module.mjs +86 -0
  91. package/{esm2020 → esm2022}/lib/formly/field/wrapper/info.wrapper.component.mjs +7 -7
  92. package/esm2022/lib/formly/field/wrapper/section.wrapper.component.mjs +27 -0
  93. package/{esm2020 → esm2022}/lib/formly/field/wrapper/style.wrapper.component.mjs +7 -7
  94. package/esm2022/lib/formly/field/wrapper/subsection.wrapper.component.mjs +27 -0
  95. package/{esm2020 → esm2022}/lib/formly/field/wrapper/toggle.wrapper.component.mjs +6 -6
  96. package/{esm2020 → esm2022}/lib/formly/field/wrapper/working.wrapper.component.mjs +6 -6
  97. package/esm2022/lib/formly/field/wrapper/wrapper.mjs +73 -0
  98. package/{esm2020 → esm2022}/lib/formly/form/form.form.module.mjs +5 -5
  99. package/{esm2020 → esm2022}/lib/formly/form/search.form.component.mjs +6 -6
  100. package/{esm2020 → esm2022}/lib/formly/formly.context.directive.mjs +4 -4
  101. package/esm2022/lib/formly/formly.context.mjs +100 -0
  102. package/{esm2020 → esm2022}/lib/formly/formly.directive.mjs +16 -16
  103. package/{esm2020 → esm2022}/lib/formly/formly.form.component.mjs +6 -6
  104. package/{esm2020 → esm2022}/lib/formly/formly.module.mjs +16 -16
  105. package/{esm2020 → esm2022}/lib/layout/form.layout.module.mjs +5 -5
  106. package/{esm2020 → esm2022}/lib/layout/form.spacer.component.mjs +6 -6
  107. package/{esm2020 → esm2022}/mapbox/lib/field/latlng/latlng.field.component.mjs +10 -10
  108. package/{esm2020 → esm2022}/mapbox/lib/field/latlng/latlng.field.marker.component.mjs +6 -6
  109. package/esm2022/mapbox/lib/field/latlng/latlng.field.mjs +35 -0
  110. package/esm2022/mapbox/lib/field/latlng/latlng.module.mjs +59 -0
  111. package/{mapbox/esm2020 → esm2022/mapbox}/lib/field/zoom/zoom.field.component.mjs +10 -10
  112. package/esm2022/mapbox/lib/field/zoom/zoom.field.mjs +23 -0
  113. package/esm2022/mapbox/lib/field/zoom/zoom.module.mjs +57 -0
  114. package/{mapbox/esm2020 → esm2022/mapbox}/lib/mapbox.module.mjs +5 -5
  115. package/{fesm2020 → fesm2022}/dereekb-dbx-form-calendar.mjs +188 -228
  116. package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -0
  117. package/{mapbox/fesm2020 → fesm2022}/dereekb-dbx-form-mapbox.mjs +76 -76
  118. package/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -0
  119. package/{fesm2020 → fesm2022}/dereekb-dbx-form.mjs +820 -831
  120. package/fesm2022/dereekb-dbx-form.mjs.map +1 -0
  121. package/lib/extension/_extension.scss +11 -6
  122. package/lib/extension/calendar/_calendar.scss +7 -5
  123. package/lib/form/_form.scss +3 -2
  124. package/lib/form/action/form.action.directive.d.ts +2 -2
  125. package/lib/form/action/transition/form.action.transition.safety.directive.d.ts +1 -1
  126. package/lib/form/form.angular.util.d.ts +1 -1
  127. package/lib/form/form.d.ts +1 -1
  128. package/lib/form/io/form.changes.directive.d.ts +1 -1
  129. package/lib/form/io/form.input.directive.d.ts +2 -2
  130. package/lib/form/io/form.loading.directive.d.ts +1 -1
  131. package/lib/formly/_formly.scss +7 -9
  132. package/lib/formly/field/_field.scss +7 -7
  133. package/lib/formly/field/checklist/_checklist.scss +3 -2
  134. package/lib/formly/field/checklist/checklist.field.d.ts +4 -4
  135. package/lib/formly/field/checklist/checklist.item.d.ts +1 -1
  136. package/lib/formly/field/checklist/checklist.item.field.component.d.ts +2 -2
  137. package/lib/formly/field/checklist/checklist.item.field.content.default.component.d.ts +4 -4
  138. package/lib/formly/field/checklist/checklist.item.field.d.ts +1 -1
  139. package/lib/formly/field/component/_component.scss +3 -2
  140. package/lib/formly/field/component/component.field.component.d.ts +2 -2
  141. package/lib/formly/field/component/component.field.d.ts +1 -1
  142. package/lib/formly/field/field.d.ts +5 -11
  143. package/lib/formly/field/selection/_selection.scss +5 -5
  144. package/lib/formly/field/selection/list/_list.scss +3 -2
  145. package/lib/formly/field/selection/list/list.field.component.d.ts +1 -1
  146. package/lib/formly/field/selection/pickable/_pickable.scss +3 -9
  147. package/lib/formly/field/selection/pickable/pickable.chip.field.component.d.ts +1 -1
  148. package/lib/formly/field/selection/pickable/pickable.d.ts +6 -22
  149. package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +3 -3
  150. package/lib/formly/field/selection/pickable/pickable.list.field.component.d.ts +4 -4
  151. package/lib/formly/field/selection/pickable/pickable.util.d.ts +2 -2
  152. package/lib/formly/field/selection/searchable/_searchable.scss +5 -5
  153. package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +1 -1
  154. package/lib/formly/field/selection/searchable/searchable.d.ts +4 -4
  155. package/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.d.ts +3 -3
  156. package/lib/formly/field/selection/searchable/searchable.field.d.ts +1 -1
  157. package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +1 -1
  158. package/lib/formly/field/selection/searchable/searchable.text.field.component.d.ts +1 -1
  159. package/lib/formly/field/selection/selection.d.ts +1 -5
  160. package/lib/formly/field/selection/selection.field.d.ts +1 -1
  161. package/lib/formly/field/selection/sourceselect/_sourceselect.scss +6 -15
  162. package/lib/formly/field/selection/sourceselect/sourceselect.d.ts +6 -6
  163. package/lib/formly/field/selection/sourceselect/sourceselect.field.component.d.ts +1 -1
  164. package/lib/formly/field/selection/sourceselect/sourceselect.field.module.d.ts +1 -1
  165. package/lib/formly/field/texteditor/_texteditor.scss +3 -2
  166. package/lib/formly/field/texteditor/texteditor.field.component.d.ts +2 -2
  167. package/lib/formly/field/value/_value.scss +10 -6
  168. package/lib/formly/field/value/array/_array.scss +7 -2
  169. package/lib/formly/field/value/array/array.field.component.d.ts +2 -2
  170. package/lib/formly/field/value/boolean/_boolean.scss +5 -4
  171. package/lib/formly/field/value/date/_date.scss +20 -37
  172. package/lib/formly/field/value/date/date.field.module.d.ts +1 -1
  173. package/lib/formly/field/value/date/datetime.field.component.d.ts +3 -13
  174. package/lib/formly/field/value/date/datetime.field.d.ts +5 -5
  175. package/lib/formly/field/value/date/fixeddaterange.field.component.d.ts +7 -7
  176. package/lib/formly/field/value/hidden.field.d.ts +1 -1
  177. package/lib/formly/field/value/number/_number.scss +35 -0
  178. package/lib/formly/field/value/number/number.field.d.ts +3 -3
  179. package/lib/formly/field/value/phone/_phone.scss +4 -3
  180. package/lib/formly/field/value/phone/phone.field.component.d.ts +1 -1
  181. package/lib/formly/field/value/phone/phone.field.module.d.ts +1 -1
  182. package/lib/formly/field/value/text/_text.scss +3 -2
  183. package/lib/formly/field/value/text/text.additional.field.d.ts +3 -3
  184. package/lib/formly/field/value/text/text.field.d.ts +2 -2
  185. package/lib/formly/field/wrapper/_wrapper.scss +5 -4
  186. package/lib/formly/field/wrapper/autotouch.wrapper.component.d.ts +1 -1
  187. package/lib/formly/field/wrapper/expandable.wrapper.component.d.ts +2 -2
  188. package/lib/formly/field/wrapper/expandable.wrapper.delegate.d.ts +1 -1
  189. package/lib/formly/field/wrapper/flex.wrapper.component.d.ts +1 -1
  190. package/lib/formly/field/wrapper/form.wrapper.module.d.ts +1 -1
  191. package/lib/formly/field/wrapper/info.wrapper.component.d.ts +1 -1
  192. package/lib/formly/field/wrapper/section.wrapper.component.d.ts +2 -2
  193. package/lib/formly/field/wrapper/style.wrapper.component.d.ts +2 -2
  194. package/lib/formly/field/wrapper/subsection.wrapper.component.d.ts +2 -2
  195. package/lib/formly/field/wrapper/toggle.wrapper.component.d.ts +1 -1
  196. package/lib/formly/field/wrapper/working.wrapper.component.d.ts +2 -2
  197. package/lib/formly/field/wrapper/wrapper.d.ts +1 -1
  198. package/lib/formly/form/_form.scss +17 -4
  199. package/lib/formly/form/search.form.component.d.ts +1 -1
  200. package/lib/formly/formly.context.directive.d.ts +1 -1
  201. package/lib/formly/formly.directive.d.ts +4 -4
  202. package/lib/formly/formly.form.component.d.ts +1 -1
  203. package/lib/formly/template/login.d.ts +1 -1
  204. package/lib/formly/template/timezone.d.ts +1 -1
  205. package/lib/layout/_layout.scss +3 -2
  206. package/lib/layout/form.spacer.component.d.ts +1 -1
  207. package/lib/style/_all-typography.scss +11 -3
  208. package/lib/style/_core.scss +1 -2
  209. package/lib/style/_mixin.scss +10 -0
  210. package/lib/style/_theming.scss +1 -1
  211. package/lib/validator/available.d.ts +1 -1
  212. package/mapbox/{esm2020 → esm2022}/lib/field/latlng/latlng.field.component.mjs +10 -10
  213. package/mapbox/{esm2020 → esm2022}/lib/field/latlng/latlng.field.marker.component.mjs +6 -6
  214. package/mapbox/esm2022/lib/field/latlng/latlng.field.mjs +35 -0
  215. package/mapbox/esm2022/lib/field/latlng/latlng.module.mjs +59 -0
  216. package/{esm2020/mapbox → mapbox/esm2022}/lib/field/zoom/zoom.field.component.mjs +10 -10
  217. package/mapbox/esm2022/lib/field/zoom/zoom.field.mjs +23 -0
  218. package/mapbox/esm2022/lib/field/zoom/zoom.module.mjs +57 -0
  219. package/{esm2020/mapbox → mapbox/esm2022}/lib/mapbox.module.mjs +5 -5
  220. package/{fesm2020 → mapbox/fesm2022}/dereekb-dbx-form-mapbox.mjs +76 -76
  221. package/mapbox/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -0
  222. package/mapbox/lib/field/latlng/latlng.field.component.d.ts +1 -1
  223. package/mapbox/lib/field/latlng/latlng.field.marker.component.d.ts +1 -1
  224. package/mapbox/lib/field/zoom/zoom.field.component.d.ts +1 -1
  225. package/mapbox/package.json +10 -28
  226. package/package.json +31 -31
  227. package/esm2020/calendar/lib/calendar.module.mjs +0 -155
  228. package/esm2020/calendar/lib/calendar.schedule.selection.dialog.button.component.mjs +0 -38
  229. package/esm2020/calendar/lib/calendar.schedule.selection.dialog.component.mjs +0 -65
  230. package/esm2020/calendar/lib/calendar.schedule.selection.popover.component.mjs +0 -37
  231. package/esm2020/calendar/lib/calendar.schedule.selection.range.component.mjs +0 -188
  232. package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +0 -814
  233. package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +0 -158
  234. package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +0 -29
  235. package/esm2020/calendar/lib/field/schedule/calendar.schedule.module.mjs +0 -58
  236. package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +0 -67
  237. package/esm2020/lib/formly/field/component/component.field.module.mjs +0 -32
  238. package/esm2020/lib/formly/field/field.mjs +0 -103
  239. package/esm2020/lib/formly/field/selection/list/list.field.module.mjs +0 -76
  240. package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +0 -33
  241. package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +0 -93
  242. package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +0 -116
  243. package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +0 -68
  244. package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +0 -95
  245. package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +0 -278
  246. package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +0 -91
  247. package/esm2020/lib/formly/field/selection/selection.field.mjs +0 -39
  248. package/esm2020/lib/formly/field/selection/sourceselect/sourceselect.field.module.mjs +0 -93
  249. package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +0 -51
  250. package/esm2020/lib/formly/field/value/array/array.field.module.mjs +0 -62
  251. package/esm2020/lib/formly/field/value/boolean/boolean.field.mjs +0 -47
  252. package/esm2020/lib/formly/field/value/date/date.field.module.mjs +0 -96
  253. package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +0 -488
  254. package/esm2020/lib/formly/field/value/date/datetime.field.mjs +0 -143
  255. package/esm2020/lib/formly/field/value/date/fixeddaterange.field.component.mjs +0 -506
  256. package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +0 -100
  257. package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +0 -66
  258. package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +0 -86
  259. package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +0 -26
  260. package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +0 -26
  261. package/esm2020/lib/formly/field/wrapper/wrapper.mjs +0 -78
  262. package/esm2020/lib/formly/formly.context.mjs +0 -100
  263. package/esm2020/mapbox/lib/field/latlng/latlng.field.mjs +0 -35
  264. package/esm2020/mapbox/lib/field/latlng/latlng.module.mjs +0 -59
  265. package/esm2020/mapbox/lib/field/zoom/zoom.field.mjs +0 -23
  266. package/esm2020/mapbox/lib/field/zoom/zoom.module.mjs +0 -57
  267. package/fesm2015/dereekb-dbx-form-calendar.mjs +0 -1955
  268. package/fesm2015/dereekb-dbx-form-calendar.mjs.map +0 -1
  269. package/fesm2015/dereekb-dbx-form-mapbox.mjs +0 -585
  270. package/fesm2015/dereekb-dbx-form-mapbox.mjs.map +0 -1
  271. package/fesm2015/dereekb-dbx-form.mjs +0 -6205
  272. package/fesm2015/dereekb-dbx-form.mjs.map +0 -1
  273. package/fesm2020/dereekb-dbx-form-calendar.mjs.map +0 -1
  274. package/fesm2020/dereekb-dbx-form-mapbox.mjs.map +0 -1
  275. package/fesm2020/dereekb-dbx-form.mjs.map +0 -1
  276. package/mapbox/esm2020/lib/field/latlng/latlng.field.mjs +0 -35
  277. package/mapbox/esm2020/lib/field/latlng/latlng.module.mjs +0 -59
  278. package/mapbox/esm2020/lib/field/zoom/zoom.field.mjs +0 -23
  279. package/mapbox/esm2020/lib/field/zoom/zoom.module.mjs +0 -57
  280. package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs +0 -585
  281. package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs.map +0 -1
  282. package/mapbox/fesm2020/dereekb-dbx-form-mapbox.mjs.map +0 -1
  283. /package/{esm2020 → esm2022}/calendar/dereekb-dbx-form-calendar.mjs +0 -0
  284. /package/{esm2020 → esm2022}/calendar/index.mjs +0 -0
  285. /package/{esm2020 → esm2022}/calendar/lib/calendar.schedule.selection.form.mjs +0 -0
  286. /package/{esm2020 → esm2022}/calendar/lib/field/index.mjs +0 -0
  287. /package/{esm2020 → esm2022}/calendar/lib/field/schedule/index.mjs +0 -0
  288. /package/{esm2020 → esm2022}/calendar/lib/index.mjs +0 -0
  289. /package/{esm2020 → esm2022}/dereekb-dbx-form.mjs +0 -0
  290. /package/{esm2020 → esm2022}/index.mjs +0 -0
  291. /package/{esm2020 → esm2022}/lib/form/action/index.mjs +0 -0
  292. /package/{esm2020 → esm2022}/lib/form/action/transition/index.mjs +0 -0
  293. /package/{esm2020 → esm2022}/lib/form/form.angular.util.mjs +0 -0
  294. /package/{esm2020 → esm2022}/lib/form/form.mjs +0 -0
  295. /package/{esm2020 → esm2022}/lib/form/index.mjs +0 -0
  296. /package/{esm2020 → esm2022}/lib/form/io/index.mjs +0 -0
  297. /package/{esm2020 → esm2022}/lib/formly/config/index.mjs +0 -0
  298. /package/{esm2020 → esm2022}/lib/formly/config/validation.mjs +0 -0
  299. /package/{esm2020 → esm2022}/lib/formly/field/checklist/checklist.field.mjs +0 -0
  300. /package/{esm2020 → esm2022}/lib/formly/field/checklist/checklist.item.field.mjs +0 -0
  301. /package/{esm2020 → esm2022}/lib/formly/field/checklist/checklist.item.mjs +0 -0
  302. /package/{esm2020 → esm2022}/lib/formly/field/checklist/index.mjs +0 -0
  303. /package/{esm2020 → esm2022}/lib/formly/field/component/component.field.mjs +0 -0
  304. /package/{esm2020 → esm2022}/lib/formly/field/component/index.mjs +0 -0
  305. /package/{esm2020 → esm2022}/lib/formly/field/index.mjs +0 -0
  306. /package/{esm2020 → esm2022}/lib/formly/field/selection/index.mjs +0 -0
  307. /package/{esm2020 → esm2022}/lib/formly/field/selection/list/index.mjs +0 -0
  308. /package/{esm2020 → esm2022}/lib/formly/field/selection/list/list.field.mjs +0 -0
  309. /package/{esm2020 → esm2022}/lib/formly/field/selection/pickable/index.mjs +0 -0
  310. /package/{esm2020 → esm2022}/lib/formly/field/selection/pickable/pickable.field.mjs +0 -0
  311. /package/{esm2020 → esm2022}/lib/formly/field/selection/pickable/pickable.util.mjs +0 -0
  312. /package/{esm2020 → esm2022}/lib/formly/field/selection/searchable/index.mjs +0 -0
  313. /package/{esm2020 → esm2022}/lib/formly/field/selection/searchable/searchable.field.mjs +0 -0
  314. /package/{esm2020 → esm2022}/lib/formly/field/selection/searchable/searchable.mjs +0 -0
  315. /package/{esm2020 → esm2022}/lib/formly/field/selection/searchable/text.chip.field.mjs +0 -0
  316. /package/{esm2020 → esm2022}/lib/formly/field/selection/sourceselect/index.mjs +0 -0
  317. /package/{esm2020 → esm2022}/lib/formly/field/selection/sourceselect/sourceselect.field.mjs +0 -0
  318. /package/{esm2020 → esm2022}/lib/formly/field/selection/sourceselect/sourceselect.mjs +0 -0
  319. /package/{esm2020 → esm2022}/lib/formly/field/texteditor/index.mjs +0 -0
  320. /package/{esm2020 → esm2022}/lib/formly/field/texteditor/texteditor.field.mjs +0 -0
  321. /package/{esm2020 → esm2022}/lib/formly/field/value/array/array.field.mjs +0 -0
  322. /package/{esm2020 → esm2022}/lib/formly/field/value/array/index.mjs +0 -0
  323. /package/{esm2020 → esm2022}/lib/formly/field/value/boolean/index.mjs +0 -0
  324. /package/{esm2020 → esm2022}/lib/formly/field/value/date/date.value.mjs +0 -0
  325. /package/{esm2020 → esm2022}/lib/formly/field/value/date/datetime.mjs +0 -0
  326. /package/{esm2020 → esm2022}/lib/formly/field/value/date/datetime.preset.mjs +0 -0
  327. /package/{esm2020 → esm2022}/lib/formly/field/value/date/index.mjs +0 -0
  328. /package/{esm2020 → esm2022}/lib/formly/field/value/hidden.field.mjs +0 -0
  329. /package/{esm2020 → esm2022}/lib/formly/field/value/index.mjs +0 -0
  330. /package/{esm2020 → esm2022}/lib/formly/field/value/number/index.mjs +0 -0
  331. /package/{esm2020 → esm2022}/lib/formly/field/value/number/number.field.mjs +0 -0
  332. /package/{esm2020 → esm2022}/lib/formly/field/value/phone/index.mjs +0 -0
  333. /package/{esm2020 → esm2022}/lib/formly/field/value/phone/phone.field.mjs +0 -0
  334. /package/{esm2020 → esm2022}/lib/formly/field/value/text/index.mjs +0 -0
  335. /package/{esm2020 → esm2022}/lib/formly/field/value/text/text.additional.field.mjs +0 -0
  336. /package/{esm2020 → esm2022}/lib/formly/field/value/text/text.address.field.mjs +0 -0
  337. /package/{esm2020 → esm2022}/lib/formly/field/value/text/text.field.mjs +0 -0
  338. /package/{esm2020 → esm2022}/lib/formly/field/wrapper/index.mjs +0 -0
  339. /package/{esm2020 → esm2022}/lib/formly/form/form.form.mjs +0 -0
  340. /package/{esm2020 → esm2022}/lib/formly/form/index.mjs +0 -0
  341. /package/{esm2020 → esm2022}/lib/formly/index.mjs +0 -0
  342. /package/{esm2020 → esm2022}/lib/formly/template/available.mjs +0 -0
  343. /package/{esm2020 → esm2022}/lib/formly/template/index.mjs +0 -0
  344. /package/{esm2020 → esm2022}/lib/formly/template/login.mjs +0 -0
  345. /package/{esm2020 → esm2022}/lib/formly/template/timezone.mjs +0 -0
  346. /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
  347. /package/{esm2020 → esm2022}/lib/layout/index.mjs +0 -0
  348. /package/{esm2020 → esm2022}/lib/validator/available.mjs +0 -0
  349. /package/{esm2020 → esm2022}/lib/validator/boolean.mjs +0 -0
  350. /package/{esm2020 → esm2022}/lib/validator/email.mjs +0 -0
  351. /package/{esm2020 → esm2022}/lib/validator/field.mjs +0 -0
  352. /package/{esm2020 → esm2022}/lib/validator/index.mjs +0 -0
  353. /package/{esm2020 → esm2022}/lib/validator/number.mjs +0 -0
  354. /package/{esm2020 → esm2022}/lib/validator/phone.mjs +0 -0
  355. /package/{esm2020 → esm2022}/mapbox/dereekb-dbx-form-mapbox.mjs +0 -0
  356. /package/{esm2020 → esm2022}/mapbox/index.mjs +0 -0
  357. /package/{esm2020 → esm2022}/mapbox/lib/field/index.mjs +0 -0
  358. /package/{esm2020 → esm2022}/mapbox/lib/field/latlng/index.mjs +0 -0
  359. /package/{esm2020 → esm2022}/mapbox/lib/field/zoom/index.mjs +0 -0
  360. /package/mapbox/{esm2020 → esm2022}/dereekb-dbx-form-mapbox.mjs +0 -0
  361. /package/mapbox/{esm2020 → esm2022}/index.mjs +0 -0
  362. /package/mapbox/{esm2020 → esm2022}/lib/field/index.mjs +0 -0
  363. /package/mapbox/{esm2020 → esm2022}/lib/field/latlng/index.mjs +0 -0
  364. /package/mapbox/{esm2020 → esm2022}/lib/field/zoom/index.mjs +0 -0
@@ -1,1955 +0,0 @@
1
- import * as i4$1 from '@dereekb/dbx-form';
2
- import { formlyField, propsAndConfigForFieldConfig, flexLayoutWrapper, toggleField, AbstractSyncFormlyFormDirective, provideFormlyContext, DbxFormModule, DbxFormlyModule } from '@dereekb/dbx-form';
3
- import * as i0 from '@angular/core';
4
- import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Inject, Input, ViewChild, ElementRef, ChangeDetectionStrategy, EventEmitter, Output, InjectionToken, NgModule } from '@angular/core';
5
- import { FieldType } from '@ngx-formly/material';
6
- import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, combineLatest, EMPTY, startWith, throttleTime } from 'rxjs';
7
- import { filterMaybe, distinctUntilHasDifferentValues, SubscriptionObject, asObservableFromGetter, asObservable } from '@dereekb/rxjs';
8
- import { DateCellScheduleDayCode, expandDateCellScheduleDayCodesToDayOfWeekSet, dateCellTimingStartsAtForStartOfDay, dateCellTimingRelativeIndexFactory, dateCellDayOfWeekFactory, dateTimezoneUtcNormal, findMaxDate, findMinDate, isSameDateRange, isSameDateDay, isSameDate, dateCellTimingDateFactory, expandDateCellScheduleRange, formatToISO8601DayString, changeDateCellScheduleDateRangeToTimezone, isSameDateCellScheduleDateRange, dateCellTimingRelativeIndexArrayFactory, isInfiniteDateRange, copyDateCellScheduleDateFilterConfig, SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, dateCellScheduleDateFilter, fullDateCellScheduleRange, dateCellTimingTimezoneNormalInstance, expandDateCellScheduleDayCodes, fullWeekDateCellScheduleDayCodes, dateCellScheduleDayCodesAreSetsEquivalent, simplifyDateCellScheduleDayCodes, dateCellTimingStartDateFactory, isDateInDateRangeFunction, isDateWithinDateCellRangeFunction, dateCellScheduleEncodedWeek, enabledDaysFromDateCellScheduleDayCodes, dateCellScheduleDayCodesFromEnabledDays, formatToMonthDayString, dateRange, DateRangeType } from '@dereekb/date';
9
- import { isInAllowedDaysOfWeekSet, mapValuesToSet, unique, mergeArrays, iterableToArray, isIterable, firstValueFromIterable, minAndMaxNumber, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter } from '@dereekb/util';
10
- import { ComponentStore } from '@ngrx/component-store';
11
- import { startOfDay, endOfDay, isBefore, endOfWeek } from 'date-fns';
12
- import * as i1$1 from '@dereekb/dbx-web';
13
- import { AbstractPopoverDirective, AbstractDialogDirective, sanitizeDbxDialogContentConfig, DbxContentLayoutModule, DbxTextModule, DbxActionModule, DbxButtonModule, DbxDialogInteractionModule, DbxPopoverInteractionModule } from '@dereekb/dbx-web';
14
- import * as i3$1 from '@dereekb/dbx-core';
15
- import { switchMapDbxInjectionComponentConfig, DbxInjectionComponentModule, DbxDatePipeModule } from '@dereekb/dbx-core';
16
- import * as i3 from '@angular/forms';
17
- import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
18
- import * as i5 from '@angular/material/form-field';
19
- import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule } from '@angular/material/form-field';
20
- import * as i1 from '@dereekb/dbx-web/calendar';
21
- import { prepareAndSortCalendarEvents, DbxCalendarStore, DbxCalendarModule } from '@dereekb/dbx-web/calendar';
22
- import * as i4 from '@angular/common';
23
- import { CommonModule } from '@angular/common';
24
- import * as i7 from '@angular/material/datepicker';
25
- import { MatDatepickerModule } from '@angular/material/datepicker';
26
- import * as i6 from 'angular-calendar';
27
- import { CalendarModule, CalendarDayModule, CalendarWeekModule } from 'angular-calendar';
28
- import * as i7$1 from '@angular/flex-layout/extended';
29
- import * as i3$2 from '@angular/material/icon';
30
- import { MatIconModule } from '@angular/material/icon';
31
- import * as i1$2 from '@angular/material/dialog';
32
- import * as i1$3 from '@ngx-formly/core';
33
- import { FormlyModule } from '@ngx-formly/core';
34
- import { MatInputModule } from '@angular/material/input';
35
- import { MatButtonModule } from '@angular/material/button';
36
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
37
- import { FlexLayoutModule } from '@angular/flex-layout';
38
-
39
- function dateScheduleRangeField(config = {}) {
40
- var _a;
41
- const { key = 'schedule', appearance, hideCustomize, allowTextInput, filter, outputTimezone, timezone, initialSelectionState, computeSelectionResultRelativeToFilter, exclusions, defaultScheduleDays, minMaxDateRange, cellContentFactory, dialogContentConfig, customDetailsConfig } = config;
42
- const fieldConfig = Object.assign({}, formlyField(Object.assign({ key, type: 'date-schedule-range' }, propsAndConfigForFieldConfig(config, {
43
- label: (_a = config.label) !== null && _a !== void 0 ? _a : 'Schedule',
44
- allowTextInput,
45
- appearance,
46
- hideCustomize,
47
- outputTimezone,
48
- timezone,
49
- defaultScheduleDays,
50
- minMaxDateRange,
51
- filter,
52
- exclusions,
53
- dialogContentConfig,
54
- computeSelectionResultRelativeToFilter,
55
- initialSelectionState,
56
- cellContentFactory,
57
- customDetailsConfig
58
- }))));
59
- return fieldConfig;
60
- }
61
-
62
- var CalendarScheduleSelectionDayState;
63
- (function (CalendarScheduleSelectionDayState) {
64
- CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["NOT_APPLICABLE"] = 0] = "NOT_APPLICABLE";
65
- CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["DISABLED"] = 1] = "DISABLED";
66
- CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["NOT_SELECTED"] = 2] = "NOT_SELECTED";
67
- CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["SELECTED"] = 3] = "SELECTED";
68
- })(CalendarScheduleSelectionDayState || (CalendarScheduleSelectionDayState = {}));
69
- const defaultCalendarScheduleSelectionCellContentFactory = (day) => {
70
- var _a;
71
- let icon;
72
- let text;
73
- switch ((_a = day.meta) === null || _a === void 0 ? void 0 : _a.state) {
74
- case CalendarScheduleSelectionDayState.SELECTED:
75
- icon = 'check_box';
76
- break;
77
- case CalendarScheduleSelectionDayState.DISABLED:
78
- icon = 'block';
79
- break;
80
- case CalendarScheduleSelectionDayState.NOT_APPLICABLE:
81
- break;
82
- case CalendarScheduleSelectionDayState.NOT_SELECTED:
83
- icon = 'check_box_outline_blank';
84
- text = 'Add';
85
- break;
86
- }
87
- return {
88
- icon,
89
- text
90
- };
91
- };
92
-
93
- function initialCalendarScheduleSelectionState() {
94
- const defaultScheduleDays = new Set([DateCellScheduleDayCode.WEEKDAY, DateCellScheduleDayCode.WEEKEND]);
95
- const allowedDaysOfWeek = expandDateCellScheduleDayCodesToDayOfWeekSet(defaultScheduleDays);
96
- const defaultStartsAt = dateCellTimingStartsAtForStartOfDay(); // get midnight of the current timezone
97
- const { startsAt, timezone: systemTimezone } = defaultStartsAt;
98
- const indexFactory = dateCellTimingRelativeIndexFactory(defaultStartsAt);
99
- const indexDayOfWeek = dateCellDayOfWeekFactory(startsAt);
100
- return {
101
- selectionMode: 'multiple',
102
- start: startsAt,
103
- systemTimezone,
104
- indexFactory,
105
- toggledIndexes: new Set(),
106
- defaultScheduleDays,
107
- effectiveScheduleDays: defaultScheduleDays,
108
- allowedDaysOfWeek,
109
- indexDayOfWeek,
110
- isEnabledFilterDay: () => true,
111
- isEnabledDay: () => false,
112
- computeSelectionResultRelativeToFilter: true,
113
- cellContentFactory: defaultCalendarScheduleSelectionCellContentFactory
114
- };
115
- }
116
- /**
117
- * This is used in cases where the dates in the min/max date range need to be shifted to the filter's timezone.
118
- *
119
- * This is because the index factory is always in system timezone, but when selecting all/none with a filter we need to use the filter's timezone.
120
- *
121
- * @param x
122
- * @returns
123
- */
124
- function calendarScheduleMinAndMaxDateRangeRelativeToFilter(x) {
125
- var _a;
126
- let input = x;
127
- if (((_a = x.filter) === null || _a === void 0 ? void 0 : _a.timezone) && x.minMaxDateRange != null) {
128
- const filterNormal = dateTimezoneUtcNormal(x.filter.timezone);
129
- const transformFn = filterNormal.transformFunction('systemDateToTargetDate');
130
- input = {
131
- filter: x.filter,
132
- minMaxDateRange: {
133
- start: x.minMaxDateRange.start ? transformFn(x.minMaxDateRange.start) : undefined,
134
- end: x.minMaxDateRange.end ? transformFn(x.minMaxDateRange.end) : undefined
135
- }
136
- };
137
- }
138
- return calendarScheduleMinAndMaxDateRange(input);
139
- }
140
- function calendarScheduleMinAndMaxDateRange(x) {
141
- return {
142
- start: calendarScheduleMinDate(x) || undefined,
143
- end: calendarScheduleMaxDate(x) || undefined
144
- };
145
- }
146
- function calendarScheduleMinDate(x) {
147
- var _a, _b;
148
- return findMaxDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.start, (_b = x.minMaxDateRange) === null || _b === void 0 ? void 0 : _b.start]);
149
- }
150
- function calendarScheduleMaxDate(x) {
151
- var _a, _b;
152
- return findMinDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.end, (_b = x.minMaxDateRange) === null || _b === void 0 ? void 0 : _b.end]);
153
- }
154
- function calendarScheduleStartBeingUsedFromFilter(x) {
155
- var _a;
156
- return x.computeSelectionResultRelativeToFilter && ((_a = x.filter) === null || _a === void 0 ? void 0 : _a.start) != null; // may be using either
157
- }
158
- class DbxCalendarScheduleSelectionStore extends ComponentStore {
159
- constructor() {
160
- super(initialCalendarScheduleSelectionState());
161
- // MARK:
162
- this.toggleSelection = this.effect((input) => {
163
- return input.pipe(switchMap(() => this.nextToggleSelection$.pipe(first(), filterMaybe(), tap((x) => {
164
- this.selectAllDates(x);
165
- }))));
166
- });
167
- // MARK: Accessors
168
- this.selectionMode$ = this.state$.pipe(map((x) => x.selectionMode), distinctUntilChanged(), shareReplay(1));
169
- this.filter$ = this.state$.pipe(map((x) => x.filter), distinctUntilChanged(), shareReplay(1));
170
- this.minMaxDateRange$ = this.state$.pipe(map(calendarScheduleMinAndMaxDateRange), distinctUntilChanged(isSameDateRange), shareReplay(1));
171
- this.minDate$ = this.minMaxDateRange$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.start), distinctUntilChanged(isSameDateDay), shareReplay(1));
172
- this.maxDate$ = this.minMaxDateRange$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.end), distinctUntilChanged(isSameDateDay), shareReplay(1));
173
- this.hasConfiguredMinMaxRange$ = this.minMaxDateRange$.pipe(map((x) => x != null && x.start != null && x.end != null), distinctUntilChanged(), shareReplay(1));
174
- this.inputStart$ = this.state$.pipe(map((x) => x.inputStart), distinctUntilChanged(isSameDate), shareReplay(1));
175
- this.inputEnd$ = this.state$.pipe(map((x) => x.inputEnd), distinctUntilChanged(isSameDate), shareReplay(1));
176
- this.currentInputRange$ = this.state$.pipe(map(({ inputStart, inputEnd }) => ({ start: inputStart, end: inputEnd })), distinctUntilChanged((a, b) => isSameDateRange(a, b)), map((x) => ({ inputStart: x.start, inputEnd: x.end })), map((x) => {
177
- if (x.inputStart && x.inputEnd) {
178
- return x;
179
- }
180
- else {
181
- return undefined;
182
- }
183
- }), shareReplay(1));
184
- this.inputRange$ = this.currentInputRange$.pipe(filterMaybe(), shareReplay(1));
185
- /**
186
- * @deprecated This is not the same as the current selection value. This is the set of manually togged off dates. It will be removed in a future update.
187
- */
188
- this.selectedDates$ = this.state$.pipe(map((x) => x.toggledIndexes), distinctUntilChanged(), shareReplay(1));
189
- this.isEnabledFilterDayFunction$ = this.state$.pipe(map((x) => x.isEnabledFilterDay), distinctUntilChanged(), shareReplay(1));
190
- this.isEnabledDayFunction$ = this.state$.pipe(map((x) => x.isEnabledDay), distinctUntilChanged(), shareReplay(1));
191
- this.currentDateRange$ = this.state$.pipe(map(computeCalendarScheduleSelectionRange), distinctUntilChanged((a, b) => isSameDateRange(a, b)), shareReplay(1));
192
- this.computeSelectionResultRelativeToFilter$ = this.state$.pipe(map((x) => x.computeSelectionResultRelativeToFilter), shareReplay(1));
193
- this.startBeingUsedFromFilter$ = this.state$.pipe(
194
- //
195
- map(calendarScheduleStartBeingUsedFromFilter), distinctUntilChanged(), shareReplay(1));
196
- this.dateRange$ = this.currentDateRange$.pipe(filterMaybe(), shareReplay(1));
197
- this.allowedDaysOfWeek$ = this.state$.pipe(map((x) => x.allowedDaysOfWeek), distinctUntilHasDifferentValues(), shareReplay(1));
198
- this.isInAllowedDaysOfWeekFunction$ = this.allowedDaysOfWeek$.pipe(map((x) => isInAllowedDaysOfWeekSet(x)), shareReplay(1));
199
- this.scheduleDays$ = this.state$.pipe(map((x) => x.effectiveScheduleDays), distinctUntilHasDifferentValues(), shareReplay(1));
200
- this.outputTimezone$ = this.state$.pipe(map((x) => x.outputTimezone), distinctUntilChanged(), shareReplay(1));
201
- /**
202
- * The timezone of the output values.
203
- *
204
- * If an outputTimezone is not specified, this defaults to the system timezone.
205
- */
206
- this.effectiveOutputTimezone$ = this.state$.pipe(map((x) => x.outputTimezone || x.systemTimezone), distinctUntilChanged(), shareReplay(1));
207
- /**
208
- * An outputTimezoneNormal to use.
209
- *
210
- * If an outputTimezone is not specified, this is undefined.
211
- */
212
- this.effectiveOutputTimezoneNormal$ = this.state$.pipe(map((x) => (x.outputTimezoneNormal ? x.outputTimezoneNormal : undefined)), distinctUntilChanged(), shareReplay(1));
213
- this.currentSelectionValue$ = this.state$.pipe(map((x) => x.currentSelectionValue), distinctUntilChanged(), shareReplay(1));
214
- this.currentSelectionValueStart$ = this.currentSelectionValue$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.dateScheduleRange.start), distinctUntilChanged(isSameDate), shareReplay(1));
215
- this.currentSelectionValueDateCellTimingDateFactory$ = this.currentSelectionValue$.pipe(map((x) => (x ? dateCellTimingDateFactory({ startsAt: x.dateScheduleRange.start, timezone: x.dateScheduleRange.timezone }) : undefined)), shareReplay(1));
216
- this.currentSelectionValueDateCellDurationSpanExpansion$ = this.currentSelectionValue$.pipe(map((x) => (x ? expandDateCellScheduleRange({ dateCellScheduleRange: x.dateScheduleRange }) : [])), shareReplay(1));
217
- this.selectionValueSelectedIndexes$ = this.currentSelectionValueDateCellDurationSpanExpansion$.pipe(map((x) => new Set(x.map((y) => y.i))), distinctUntilHasDifferentValues(), shareReplay(1));
218
- this.selectionValueSelectedDates$ = this.currentSelectionValueDateCellTimingDateFactory$.pipe(switchMap((dateFactory) => {
219
- return dateFactory ? this.selectionValueSelectedIndexes$.pipe(map((x) => mapValuesToSet(x, (y) => formatToISO8601DayString(dateFactory(y))))) : of(new Set());
220
- }), shareReplay(1));
221
- this.selectionValue$ = this.currentSelectionValue$.pipe(filterMaybe(), shareReplay(1));
222
- this.currentSelectionValueWithTimezone$ = this.currentSelectionValue$.pipe(combineLatestWith(this.effectiveOutputTimezoneNormal$), map(([x, timezoneNormal]) => {
223
- let currentValueWithTimezone = x;
224
- if (x && timezoneNormal) {
225
- currentValueWithTimezone = {
226
- dateScheduleRange: changeDateCellScheduleDateRangeToTimezone(x.dateScheduleRange, timezoneNormal),
227
- minMaxRange: x.minMaxRange
228
- };
229
- }
230
- return currentValueWithTimezone;
231
- }), distinctUntilChanged(), shareReplay(1));
232
- this.selectionValueWithTimezone$ = this.currentSelectionValueWithTimezone$.pipe(filterMaybe(), shareReplay(1));
233
- this.selectionValueWithTimezoneDateCellDurationSpanExpansion$ = this.selectionValueWithTimezone$.pipe(map((x) => expandDateCellScheduleRange({ dateCellScheduleRange: x.dateScheduleRange })), shareReplay(1));
234
- this.nextToggleSelection$ = this.hasConfiguredMinMaxRange$.pipe(switchMap((hasConfiguredMinMaxRange) => {
235
- let obs;
236
- if (hasConfiguredMinMaxRange) {
237
- obs = this.currentSelectionValue$.pipe(map((x) => (x ? 'none' : 'all')));
238
- }
239
- else {
240
- obs = this.currentSelectionValue$.pipe(map((x) => (x ? 'none' : undefined)));
241
- }
242
- return obs;
243
- }), shareReplay(1));
244
- this.currentDateCellScheduleRangeValue$ = this.currentSelectionValueWithTimezone$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.dateScheduleRange), distinctUntilChanged(isSameDateCellScheduleDateRange), shareReplay(1));
245
- this.dateCellScheduleRangeValue$ = this.currentDateCellScheduleRangeValue$.pipe(filterMaybe(), shareReplay(1));
246
- this.cellContentFactory$ = this.state$.pipe(map((x) => x.cellContentFactory), distinctUntilChanged(), shareReplay(1));
247
- this.isCustomized$ = this.state$.pipe(map((x) => x.toggledIndexes.size > 0), distinctUntilChanged(), shareReplay(1));
248
- this.isViewReadonly$ = this.state$.pipe(map((x) => x.isViewReadonly), distinctUntilChanged(), shareReplay(1));
249
- // MARK: State Changes
250
- this.setMinMaxDateRange = this.updater(updateStateWithMinMaxDateRange);
251
- this.setDefaultWeek = this.updater(updateStateWithMinMaxDateRange);
252
- this.setFilter = this.updater(updateStateWithFilter);
253
- this.setExclusions = this.updater(updateStateWithExclusions);
254
- this.setComputeSelectionResultRelativeToFilter = this.updater(updateStateWithComputeSelectionResultRelativeToFilter);
255
- this.clearFilter = this.updater((state) => updateStateWithFilter(state, undefined));
256
- this.setOutputTimezone = this.updater(updateStateWithTimezoneValue);
257
- /**
258
- * Sets the "input" date range. This is the range that gets displayed on the date range picker.
259
- */
260
- this.setInputRange = this.updater(updateStateWithChangedRange);
261
- // NOTE: Selected dates are NOT selected indexes. They are the internal selected dates that are excluded from the selection.
262
- this.toggleSelectedDates = this.updater((state, toggle) => updateStateWithChangedDates(state, { toggle }));
263
- this.addSelectedDates = this.updater((state, add) => updateStateWithChangedDates(state, { add }));
264
- this.removeSelectedDates = this.updater((state, remove) => updateStateWithChangedDates(state, { remove }));
265
- this.setSelectedDates = this.updater((state, set) => updateStateWithChangedDates(state, { set }));
266
- this.selectAllDates = this.updater((state, selectAll = 'all') => updateStateWithChangedDates(state, { selectAll }));
267
- // NOTE: Selected indexes are the typical/expected indexes that are selected or not.
268
- this.setSelectedIndexes = this.updater((state, set) => updateStateWithChangedDates(state, { set, invertSetBehavior: true }));
269
- this.setInitialSelectionState = this.updater(updateStateWithInitialSelectionState);
270
- this.setDefaultScheduleDays = this.updater(updateStateWithChangedDefaultScheduleDays);
271
- this.setScheduleDays = this.updater(updateStateWithChangedScheduleDays);
272
- this.setAllowAllScheduleDays = this.updater((state) => updateStateWithChangedScheduleDays(state, [DateCellScheduleDayCode.WEEKDAY, DateCellScheduleDayCode.WEEKEND]));
273
- this.setDateScheduleRangeValue = this.updater((state, value) => updateStateWithDateCellScheduleRangeValue(state, value));
274
- this.setCellContentFactory = this.updater((state, cellContentFactory) => (Object.assign(Object.assign({}, state), { cellContentFactory })));
275
- /**
276
- * Sets the selection mode.
277
- */
278
- this.setSelectionMode = this.updater(updateStateWithSelectionMode);
279
- /**
280
- * Used by the parent view to propogate a readonly state.
281
- *
282
- * Should typically not be used by the user directly with the intention of the parent synchronizing to this state.
283
- */
284
- this.setViewReadonlyState = this.updater((state, isViewReadonly) => (Object.assign(Object.assign({}, state), { isViewReadonly })));
285
- // MARK: Compat
286
- /**
287
- * @deprecated use setOutputTimezone instead.
288
- */
289
- this.setTimezone = this.setOutputTimezone;
290
- /**
291
- * @deprecated use ouputTimezone$
292
- */
293
- this.currentTimezone$ = this.outputTimezone$;
294
- /**
295
- * @deprecated use effectiveOuputTimezone$
296
- */
297
- this.effectiveTimezone$ = this.effectiveOutputTimezone$;
298
- /**
299
- * @deprecated use effectiveOuputTimezoneNormal$
300
- */
301
- this.effectiveTimezoneNormal$ = this.effectiveOutputTimezoneNormal$;
302
- /**
303
- * @deprecated use currentSelectionValueDateCellDurationSpanExpansion$
304
- */
305
- this.currentSelectionValueDateBlockDurationSpan$ = this.currentSelectionValueDateCellDurationSpanExpansion$;
306
- /**
307
- * @deprecated use selectionValueWithTimezoneDateCellDurationSpanExpansion$
308
- */
309
- this.selectionValueWithTimezoneDateBlockDurationSpan$ = this.selectionValueWithTimezoneDateCellDurationSpanExpansion$;
310
- }
311
- }
312
- DbxCalendarScheduleSelectionStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
313
- DbxCalendarScheduleSelectionStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore });
314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore, decorators: [{
315
- type: Injectable
316
- }], ctorParameters: function () { return []; } });
317
- function updateStateWithInitialSelectionState(state, initialSelectionState) {
318
- const { toggledIndexes } = state;
319
- if (toggledIndexes.size === 0 && initialSelectionState === 'all') {
320
- state = updateStateWithChangedDates(state, { selectAll: initialSelectionState });
321
- }
322
- return Object.assign(Object.assign({}, state), { initialSelectionState });
323
- }
324
- function updateStateWithComputeSelectionResultRelativeToFilter(currentState, computeSelectionResultRelativeToFilter) {
325
- let state = Object.assign(Object.assign({}, currentState), { computeSelectionResultRelativeToFilter });
326
- if (Boolean(currentState.computeSelectionResultRelativeToFilter) !== Boolean(computeSelectionResultRelativeToFilter)) {
327
- state = updateStateWithChangedDates(state, {}); // recalculate if change occurs as it will affect the output value
328
- }
329
- return state;
330
- }
331
- function updateStateWithExclusions(state, inputExclusions) {
332
- let computedExclusions;
333
- if (inputExclusions) {
334
- const { indexFactory } = state;
335
- const indexArrayFactory = dateCellTimingRelativeIndexArrayFactory(indexFactory);
336
- computedExclusions = indexArrayFactory(inputExclusions);
337
- }
338
- state = Object.assign(Object.assign({}, state), { inputExclusions, computedExclusions });
339
- return updateStateWithFilter(state, state.filter);
340
- }
341
- function updateStateWithMinMaxDateRange(state, minMaxDateRange) {
342
- if (minMaxDateRange != null && !isInfiniteDateRange(minMaxDateRange)) {
343
- state = Object.assign(Object.assign({}, state), { minMaxDateRange: {
344
- start: minMaxDateRange.start != null ? startOfDay(minMaxDateRange.start) : undefined,
345
- end: minMaxDateRange.end != null ? endOfDay(minMaxDateRange.end) : undefined
346
- } });
347
- }
348
- else {
349
- state = Object.assign(Object.assign({}, state), { minMaxDateRange: undefined });
350
- }
351
- return updateStateWithFilter(state, state.filter);
352
- }
353
- function updateStateWithFilter(currentState, inputFilter) {
354
- const { computedExclusions: exclusions, minMaxDateRange, systemTimezone } = currentState;
355
- let isEnabledFilterDay = () => true;
356
- let filter = null;
357
- // create the filter using inputFilter, exclusions, and minMaxDateRange
358
- if (inputFilter || (exclusions === null || exclusions === void 0 ? void 0 : exclusions.length) || minMaxDateRange) {
359
- let enabledFilter;
360
- let filterStart = null; // the start date that will be used/set on the filter.
361
- if (inputFilter) {
362
- filter = copyDateCellScheduleDateFilterConfig(inputFilter); // copy filter
363
- let nextFilterTimezone; // only set if inputFilter.start or inputFilter.startsAt
364
- // configure filter start
365
- if (inputFilter.start) {
366
- filterStart = inputFilter.start;
367
- // if no timezone is specified, then use the system timezone and align filterStart to the start of the day.
368
- if (!inputFilter.timezone) {
369
- filterStart = SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.startOfDayInTargetTimezone(inputFilter.startsAt);
370
- nextFilterTimezone = systemTimezone;
371
- }
372
- else {
373
- nextFilterTimezone = inputFilter.timezone;
374
- }
375
- }
376
- else if (inputFilter.startsAt) {
377
- if (inputFilter.timezone) {
378
- // if no timezone is provided, use startsAt as-is
379
- const timezoneNormal = dateTimezoneUtcNormal(inputFilter.timezone);
380
- filterStart = timezoneNormal.startOfDayInTargetTimezone(inputFilter.startsAt);
381
- nextFilterTimezone = inputFilter.timezone;
382
- }
383
- else {
384
- // set to the start of today in the system timezone.
385
- filterStart = SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.startOfDayInTargetTimezone(inputFilter.startsAt);
386
- nextFilterTimezone = systemTimezone;
387
- }
388
- }
389
- filter.start = filterStart !== null && filterStart !== void 0 ? filterStart : undefined;
390
- filter.timezone = nextFilterTimezone;
391
- // configure exclusions
392
- if (exclusions === null || exclusions === void 0 ? void 0 : exclusions.length) {
393
- enabledFilter = Object.assign(Object.assign({}, filter), { ex: unique(mergeArrays([filter.ex, exclusions])) });
394
- }
395
- else {
396
- enabledFilter = filter;
397
- }
398
- }
399
- else {
400
- enabledFilter = {
401
- w: '89',
402
- ex: exclusions
403
- };
404
- }
405
- if (minMaxDateRange) {
406
- enabledFilter.minMaxDateRange = minMaxDateRange;
407
- enabledFilter.setStartAsMinDate = filterStart ? true : false; // If a start date is set, then it becomes the floor.
408
- }
409
- /**
410
- * If the input filter has a start date, use that as the relative start to ensure indexes are compared the same,
411
- * otherwise use the state's start. This is important for the index calculations.
412
- */
413
- let finalEnabledStart;
414
- let finalEnabledTimezone;
415
- // filter?.start ?? state.start;
416
- if (!enabledFilter.start) {
417
- // use the current state's start, but make sure it is in the proper timezone.
418
- if (enabledFilter.timezone) {
419
- const timezoneNormal = dateTimezoneUtcNormal(enabledFilter.timezone);
420
- finalEnabledStart = timezoneNormal.startOfDayInTargetTimezone(currentState.start); // get the start of the day for the current start
421
- finalEnabledTimezone = enabledFilter.timezone;
422
- }
423
- else {
424
- finalEnabledStart = currentState.start;
425
- finalEnabledTimezone = systemTimezone;
426
- }
427
- }
428
- else if (!enabledFilter.timezone) {
429
- finalEnabledTimezone = systemTimezone;
430
- const timezoneNormal = dateTimezoneUtcNormal(finalEnabledTimezone);
431
- finalEnabledStart = timezoneNormal.startOfDayInTargetTimezone(enabledFilter.start); // get the start of the day for the target timezone
432
- }
433
- else {
434
- finalEnabledStart = enabledFilter.start;
435
- finalEnabledTimezone = enabledFilter.timezone;
436
- }
437
- enabledFilter.start = finalEnabledStart;
438
- enabledFilter.timezone = finalEnabledTimezone;
439
- // create the filter
440
- isEnabledFilterDay = dateCellScheduleDateFilter(enabledFilter);
441
- }
442
- let nextState = Object.assign(Object.assign({}, currentState), { filter, isEnabledFilterDay });
443
- // For the same reason as above, use the filter's start date as the relative start if applicable.
444
- if (filter && filter.start) {
445
- let startForSystemTimezone = filter.start;
446
- if (filter.timezone) {
447
- const timezoneNormal = dateTimezoneUtcNormal(filter.timezone);
448
- startForSystemTimezone = timezoneNormal.systemDateToTargetDate(filter.start); // get the start of the day for the system timezone
449
- }
450
- nextState.start = startForSystemTimezone;
451
- nextState.indexFactory = dateCellTimingRelativeIndexFactory({ startsAt: startForSystemTimezone, timezone: systemTimezone });
452
- nextState.indexDayOfWeek = dateCellDayOfWeekFactory(startForSystemTimezone);
453
- }
454
- // attempt to re-apply the initial selection state once filter is applied
455
- if (nextState.initialSelectionState) {
456
- nextState = updateStateWithInitialSelectionState(nextState, nextState.initialSelectionState);
457
- }
458
- // re-calculate the selection given the filter
459
- const { inputStart, inputEnd } = nextState;
460
- if (inputStart && inputEnd) {
461
- nextState = updateStateWithChangedRange(nextState, { inputStart, inputEnd });
462
- }
463
- return nextState;
464
- }
465
- function updateStateWithTimezoneValue(state, timezone) {
466
- const { currentSelectionValue } = state;
467
- const timezoneNormal = timezone ? dateTimezoneUtcNormal({ timezone }) : undefined;
468
- if (timezoneNormal && currentSelectionValue) {
469
- // update the selection value to reflect the timezone changes.
470
- const { dateScheduleRange: currentDateCellScheduleRange } = currentSelectionValue;
471
- const start = timezoneNormal.targetDateToSystemDate(currentDateCellScheduleRange.start);
472
- const end = timezoneNormal.targetDateToSystemDate(currentDateCellScheduleRange.end);
473
- const newRange = Object.assign(Object.assign({}, currentSelectionValue.dateScheduleRange), { start,
474
- end });
475
- return updateStateWithDateCellScheduleRangeValue(Object.assign(Object.assign({}, state), { outputTimezone: timezone, outputTimezoneNormal: timezoneNormal }), newRange);
476
- }
477
- else {
478
- return Object.assign(Object.assign({}, state), { outputTimezone: timezone, outputTimezoneNormal: timezoneNormal }); // no change in value
479
- }
480
- }
481
- function updateStateWithDateCellScheduleRangeValue(state, inputChange) {
482
- var _a;
483
- const { currentSelectionValue, systemTimezone } = state;
484
- const currentDateCellScheduleRange = currentSelectionValue === null || currentSelectionValue === void 0 ? void 0 : currentSelectionValue.dateScheduleRange; // current range is always in system time
485
- let change;
486
- // When using timezones, always return from the start of the day. Inputs are converted to the system time and used as the start of the day.
487
- // Outputs remain accurate.
488
- if (inputChange) {
489
- // make sure a timezone is set. Input may not have a timezone attached. Default to system time.
490
- const inputChangeWithTimezoneSet = Object.assign(Object.assign({}, inputChange), { timezone: (_a = inputChange.timezone) !== null && _a !== void 0 ? _a : systemTimezone });
491
- // calculate the schedule range
492
- const fullChange = fullDateCellScheduleRange({ dateCellScheduleRange: inputChangeWithTimezoneSet });
493
- const inputNormal = dateCellTimingTimezoneNormalInstance(fullChange);
494
- const startInSystemTz = inputNormal.systemDateToTargetDate(fullChange.start);
495
- const endInSystemTz = startOfDay(inputNormal.systemDateToTargetDate(fullChange.end));
496
- // convert the start/end to system time
497
- change = {
498
- start: startInSystemTz,
499
- end: endInSystemTz,
500
- w: fullChange.w,
501
- ex: fullChange.ex,
502
- timezone: fullChange.timezone
503
- };
504
- }
505
- const isSameValue = isSameDateCellScheduleDateRange(currentDateCellScheduleRange, change);
506
- if (isSameValue) {
507
- return state;
508
- }
509
- else {
510
- if (change != null) {
511
- const nextState = Object.assign(Object.assign({}, state), { inputStart: change.start, inputEnd: change.end, toggledIndexes: new Set(change.ex) });
512
- return updateStateWithChangedScheduleDays(finalizeNewCalendarScheduleSelectionState(nextState), expandDateCellScheduleDayCodes(change.w || '89'));
513
- }
514
- else {
515
- return noSelectionCalendarScheduleSelectionState(state); // clear selection, retain disabled days
516
- }
517
- }
518
- }
519
- function updateStateWithChangedDefaultScheduleDays(state, change) {
520
- const { defaultScheduleDays: currentDefaultScheduleDays } = state;
521
- const defaultScheduleDays = new Set(change !== null && change !== void 0 ? change : fullWeekDateCellScheduleDayCodes());
522
- if (dateCellScheduleDayCodesAreSetsEquivalent(defaultScheduleDays, currentDefaultScheduleDays)) {
523
- return state; // no change
524
- }
525
- else {
526
- return finalizeUpdateStateWithChangedScheduleDays(state, Object.assign(Object.assign({}, state), { defaultScheduleDays }));
527
- }
528
- }
529
- function updateStateWithChangedScheduleDays(state, change) {
530
- const { scheduleDays: currentScheduleDays } = state;
531
- const scheduleDays = new Set(change !== null && change !== void 0 ? change : []);
532
- let newScheduleDays;
533
- if (currentScheduleDays != null && change != null) {
534
- if (dateCellScheduleDayCodesAreSetsEquivalent(scheduleDays, currentScheduleDays)) {
535
- newScheduleDays = undefined; //no change
536
- }
537
- else {
538
- newScheduleDays = scheduleDays;
539
- }
540
- }
541
- else if (currentScheduleDays !== change) {
542
- newScheduleDays = change ? scheduleDays : null; // set the new one, or clear it
543
- }
544
- if (newScheduleDays === undefined) {
545
- return state;
546
- }
547
- else {
548
- return finalizeUpdateStateWithChangedScheduleDays(state, Object.assign(Object.assign({}, state), { scheduleDays: newScheduleDays !== null && newScheduleDays !== void 0 ? newScheduleDays : undefined }));
549
- }
550
- }
551
- function updateStateWithSelectionMode(state, selectionMode) {
552
- const { selectionMode: currentSelectionMode } = state;
553
- if (currentSelectionMode !== selectionMode) {
554
- const nextState = Object.assign(Object.assign({}, state), { selectionMode });
555
- if (selectionMode === 'multiple') {
556
- return nextState;
557
- }
558
- else {
559
- const currentSelectionRange = computeCalendarScheduleSelectionDateCellRange(nextState);
560
- return currentSelectionRange ? updateStateWithChangedDates(nextState, { set: [currentSelectionRange.i], invertSetBehavior: true }) : nextState;
561
- }
562
- }
563
- else {
564
- return state;
565
- }
566
- }
567
- function finalizeUpdateStateWithChangedScheduleDays(previousState, nextState) {
568
- var _a;
569
- const previousScheduleDays = previousState.effectiveScheduleDays;
570
- const nextScheduleDays = (_a = nextState.scheduleDays) !== null && _a !== void 0 ? _a : nextState.defaultScheduleDays;
571
- if (dateCellScheduleDayCodesAreSetsEquivalent(nextScheduleDays, previousScheduleDays)) {
572
- return nextState; // the default or input schedule changed but the schedule is still the same, so no need for an update.
573
- }
574
- else {
575
- const effectiveScheduleDays = new Set(simplifyDateCellScheduleDayCodes(nextScheduleDays));
576
- const allowedDaysOfWeek = expandDateCellScheduleDayCodesToDayOfWeekSet(nextScheduleDays);
577
- return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, nextState), {
578
- // update the effective schedule days and allowed days of week
579
- effectiveScheduleDays,
580
- allowedDaysOfWeek }));
581
- }
582
- }
583
- function updateStateWithChangedDates(state, change) {
584
- var _a;
585
- const { selectionMode, allowedDaysOfWeek, indexFactory, indexDayOfWeek, inputStart: currentInputStart, inputEnd: currentInputEnd, minMaxDateRange, filter } = state;
586
- const { start: minDateFromFilter, end: maxDateFromFilter } = calendarScheduleMinAndMaxDateRangeRelativeToFilter(state);
587
- let inputStart = currentInputStart;
588
- let inputEnd = currentInputEnd;
589
- /**
590
- * This is a set of indexes that are internally "selected" so that they are excluded from the inputStart/inputEnd date range.
591
- *
592
- * Do not confuse this with the actual indexes that are selected.
593
- */
594
- let toggledIndexes;
595
- function asIndexes(indexes) {
596
- return iterableToArray(indexes).map(indexFactory);
597
- }
598
- // When using selection mode "single" we update the change to reflect the single selection.
599
- if (selectionMode === 'single') {
600
- function setFromFirstValue(input) {
601
- const firstValue = isIterable(input) ? firstValueFromIterable(input) : input;
602
- const set = new Set();
603
- if (firstValue != null) {
604
- set.add(firstValue);
605
- }
606
- return set;
607
- }
608
- if (change.set) {
609
- change = { set: setFromFirstValue(change.set), invertSetBehavior: true };
610
- }
611
- else if (change.toggle) {
612
- const nextSet = setFromFirstValue(change.toggle);
613
- if (nextSet.size) {
614
- const firstSetValueIndex = indexFactory(firstValueFromIterable(nextSet));
615
- if (state.toggledIndexes.has(firstSetValueIndex) || (inputStart && indexFactory(inputStart) === firstSetValueIndex)) {
616
- nextSet.clear(); // clear with the next set
617
- }
618
- change = { set: nextSet, invertSetBehavior: true };
619
- }
620
- }
621
- // set, selectAll, add, and remove are treated as they normally are.
622
- }
623
- if (change.reset || change.selectAll != null || change.set != null) {
624
- let set = (_a = change.set) !== null && _a !== void 0 ? _a : [];
625
- const selectAll = change.reset === true ? state.initialSelectionState : change.selectAll;
626
- switch (selectAll) {
627
- case 'all':
628
- if (minDateFromFilter != null && maxDateFromFilter != null) {
629
- inputStart = minDateFromFilter;
630
- inputEnd = maxDateFromFilter;
631
- set = [];
632
- }
633
- break;
634
- case 'none':
635
- inputStart = null;
636
- inputEnd = null;
637
- set = [];
638
- break;
639
- }
640
- const inputSetIndexes = asIndexes(set);
641
- toggledIndexes = new Set(inputSetIndexes);
642
- if (change.invertSetBehavior && !selectAll) {
643
- let minIndex;
644
- let maxIndex;
645
- if (minDateFromFilter != null && maxDateFromFilter != null) {
646
- // only applicable when the filter is set.
647
- minIndex = indexFactory(minDateFromFilter);
648
- maxIndex = indexFactory(maxDateFromFilter);
649
- inputStart = minDateFromFilter;
650
- inputEnd = maxDateFromFilter;
651
- }
652
- else {
653
- // when the filter is not set, use the least and greatest indexes from the input set.
654
- const minAndMax = minAndMaxNumber(inputSetIndexes);
655
- if (minAndMax != null) {
656
- minIndex = minAndMax.min;
657
- maxIndex = minAndMax.max;
658
- const dateFactory = dateCellTimingStartDateFactory(indexFactory._timing);
659
- inputStart = dateFactory(minAndMax.min);
660
- inputEnd = minAndMax.min === minAndMax.max ? inputStart : dateFactory(minAndMax.max);
661
- }
662
- else {
663
- // equivalent to an empty set / using "none" with selectAll.
664
- inputStart = null;
665
- inputEnd = null;
666
- toggledIndexes = new Set();
667
- }
668
- }
669
- // toggledIndexes should not include any indexes we want to include
670
- if (minIndex != null && maxIndex != null) {
671
- toggledIndexes = new Set(range(minIndex, maxIndex + 1).filter((x) => !toggledIndexes.has(x)));
672
- }
673
- }
674
- }
675
- else {
676
- toggledIndexes = new Set(state.toggledIndexes); // copy the set
677
- if (change.toggle) {
678
- const allowedToToggle = asIndexes(change.toggle).filter((i) => allowedDaysOfWeek.has(indexDayOfWeek(i)));
679
- toggleInSet(toggledIndexes, allowedToToggle);
680
- }
681
- let addToExclusion;
682
- let removeFromExclusion;
683
- if (change.add) {
684
- if (change.invertSetBehavior) {
685
- addToExclusion = change.add;
686
- }
687
- else {
688
- removeFromExclusion = change.add;
689
- }
690
- }
691
- if (change.remove) {
692
- if (change.invertSetBehavior) {
693
- removeFromExclusion = change.remove;
694
- }
695
- else {
696
- addToExclusion = change.remove;
697
- }
698
- }
699
- if (addToExclusion) {
700
- removeFromSet(toggledIndexes, asIndexes(addToExclusion));
701
- }
702
- if (removeFromExclusion) {
703
- addToSet(toggledIndexes, asIndexes(removeFromExclusion));
704
- }
705
- }
706
- const nextState = Object.assign(Object.assign({}, state), { inputStart, inputEnd, toggledIndexes });
707
- nextState.isEnabledDay = isEnabledDayInCalendarScheduleSelectionState(nextState);
708
- // Recalculate the range and simplified to exclusions
709
- const rangeAndExclusion = computeScheduleSelectionRangeAndExclusion(nextState);
710
- if (rangeAndExclusion) {
711
- return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, nextState), { toggledIndexes: new Set(rangeAndExclusion.excluded), inputStart: rangeAndExclusion.start, inputEnd: rangeAndExclusion.end }));
712
- }
713
- else {
714
- // no selected days
715
- return noSelectionCalendarScheduleSelectionState(nextState);
716
- }
717
- }
718
- function noSelectionCalendarScheduleSelectionState(state) {
719
- return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, state), { toggledIndexes: new Set(), inputStart: null, inputEnd: null }));
720
- }
721
- function updateStateWithChangedRange(state, change) {
722
- const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory } = state;
723
- const { start: minDate, end: maxDate } = calendarScheduleMinAndMaxDateRange(state);
724
- const inputStart = startOfDay(change.inputStart);
725
- const inputEnd = startOfDay(change.inputEnd); // midnight of the last day
726
- const isValidRange = minDate != null || maxDate != null ? isDateInDateRangeFunction({ start: minDate !== null && minDate !== void 0 ? minDate : undefined, end: maxDate !== null && maxDate !== void 0 ? maxDate : undefined }) : () => true;
727
- if (!isValidRange(inputStart) || !isValidRange(inputEnd) || (isSameDateDay(inputStart, currentInputStart) && isSameDateDay(inputEnd, currentInputEnd))) {
728
- return state; // if no change, return the current state.
729
- }
730
- // retain all indexes that are within the new range
731
- const minIndex = indexFactory(inputStart);
732
- const maxIndex = indexFactory(inputEnd) + 1;
733
- const currentIndexes = Array.from(state.toggledIndexes);
734
- const isInCurrentRange = isIndexNumberInIndexRangeFunction({ minIndex, maxIndex });
735
- const excludedIndexesInNewRange = currentIndexes.filter(isInCurrentRange);
736
- const toggledIndexes = new Set(excludedIndexesInNewRange);
737
- const nextState = Object.assign(Object.assign({}, state), { toggledIndexes, inputStart, inputEnd });
738
- return finalizeNewCalendarScheduleSelectionState(nextState);
739
- }
740
- function finalizeNewCalendarScheduleSelectionState(nextState) {
741
- nextState.isEnabledDay = isEnabledDayInCalendarScheduleSelectionState(nextState);
742
- nextState.currentSelectionValue = computeScheduleSelectionValue(nextState);
743
- return nextState;
744
- }
745
- function isEnabledDayInCalendarScheduleSelectionState(state) {
746
- const { allowedDaysOfWeek, indexFactory, inputStart, inputEnd, indexDayOfWeek, systemTimezone } = state;
747
- let isInStartAndEndRange;
748
- if (inputStart && inputEnd) {
749
- isInStartAndEndRange = isDateWithinDateCellRangeFunction({ startsAt: { startsAt: state.start, timezone: systemTimezone }, range: { start: inputStart, end: inputEnd } });
750
- }
751
- else {
752
- isInStartAndEndRange = () => false;
753
- }
754
- return (input) => {
755
- const index = indexFactory(input);
756
- const dayOfWeek = indexDayOfWeek(index);
757
- const isInSelectedRange = isInStartAndEndRange(index);
758
- const isSelected = state.toggledIndexes.has(index);
759
- const isAllowedDayOfWeek = allowedDaysOfWeek.has(dayOfWeek);
760
- const result = isAllowedDayOfWeek && ((isInSelectedRange && !isSelected) || (isSelected && !isInSelectedRange));
761
- return result;
762
- };
763
- }
764
- function computeScheduleSelectionValue(state) {
765
- const { indexFactory: systemIndexFactory, allowedDaysOfWeek, effectiveScheduleDays, indexDayOfWeek, computeSelectionResultRelativeToFilter, filter, systemTimezone } = state;
766
- let timezone = systemTimezone;
767
- const rangeAndExclusion = computeScheduleSelectionRangeAndExclusion(state);
768
- if (rangeAndExclusion == null) {
769
- return null;
770
- }
771
- const { start: rangeStart, end: rangeEnd, excluded: allExcluded, dateCellRange } = rangeAndExclusion;
772
- let filterOffsetExcludedRange = [];
773
- let indexOffset = dateCellRange.i;
774
- let start = rangeStart;
775
- let end = rangeEnd;
776
- // If computeSelectionResultRelativeToFilter is true, then we need to offset the values to be relative to that start.
777
- if (computeSelectionResultRelativeToFilter && (filter === null || filter === void 0 ? void 0 : filter.start)) {
778
- start = filter.start; // always start at the filter's start date
779
- let startInSystemTimezone = start;
780
- if (filter.timezone) {
781
- timezone = filter.timezone;
782
- const filterNormal = dateTimezoneUtcNormal(timezone);
783
- end = filterNormal.startOfDayInTargetTimezone(end);
784
- startInSystemTimezone = filterNormal.systemDateToTargetDate(start); // convert the start to the system timezone normal for deriving the index
785
- }
786
- const rangeStartIndex = systemIndexFactory(rangeStart);
787
- const startIndex = systemIndexFactory(startInSystemTimezone);
788
- const filterStartIndexOffset = rangeStartIndex - startIndex;
789
- filterOffsetExcludedRange = range(0, filterStartIndexOffset);
790
- indexOffset = indexOffset - filterStartIndexOffset;
791
- }
792
- const excluded = computeSelectionResultRelativeToFilter
793
- ? allExcluded.filter((x) => {
794
- const isExcludedIndex = allowedDaysOfWeek.has(indexDayOfWeek(x)); // ???
795
- return isExcludedIndex;
796
- })
797
- : allExcluded;
798
- const offsetExcluded = excluded.map((x) => x - indexOffset); // set to the proper offset
799
- const ex = [...filterOffsetExcludedRange, ...offsetExcluded];
800
- const w = dateCellScheduleEncodedWeek(effectiveScheduleDays);
801
- const d = []; // "included" blocks are never used/calculated.
802
- // Always ensure the end is after or equal to the start.
803
- if (isBefore(end, start)) {
804
- end = start; // end is start
805
- }
806
- const dateScheduleRange = {
807
- timezone,
808
- start,
809
- end,
810
- w,
811
- d,
812
- ex
813
- };
814
- return {
815
- dateScheduleRange,
816
- minMaxRange: { start, end }
817
- };
818
- }
819
- function computeScheduleSelectionRangeAndExclusion(state) {
820
- const { start: currentStart, isEnabledDay, isEnabledFilterDay, systemTimezone } = state;
821
- const dateFactory = dateCellTimingStartDateFactory({ startsAt: currentStart, timezone: systemTimezone });
822
- const dateCellRange = computeCalendarScheduleSelectionDateCellRange(state);
823
- if (dateCellRange == null) {
824
- return null; // returns null if no items are selected.
825
- }
826
- const start = dateFactory(dateCellRange.i);
827
- const end = dateFactory(dateCellRange.to);
828
- const excluded = range(dateCellRange.i, dateCellRange.to + 1).filter((x) => {
829
- const isExcludedIndex = !isEnabledDay(x) || !isEnabledFilterDay(x);
830
- return isExcludedIndex;
831
- });
832
- const result = {
833
- dateCellRange,
834
- start,
835
- end,
836
- excluded
837
- };
838
- return result;
839
- }
840
- function computeCalendarScheduleSelectionRange(state) {
841
- const dateFactory = dateCellTimingDateFactory({ startsAt: state.start, timezone: state.systemTimezone });
842
- const dateCellRange = computeCalendarScheduleSelectionDateCellRange(state);
843
- const dateRange = dateCellRange != null ? { start: dateFactory(dateCellRange.i), end: dateFactory(dateCellRange.to) } : undefined;
844
- return dateRange;
845
- }
846
- function computeCalendarScheduleSelectionDateCellRange(state) {
847
- const { allowedDaysOfWeek, indexFactory, inputStart, inputEnd, indexDayOfWeek, isEnabledDay, isEnabledFilterDay } = state;
848
- const enabledExclusionIndexes = Array.from(state.toggledIndexes).filter((i) => allowedDaysOfWeek.has(indexDayOfWeek(i)));
849
- const minAndMaxSelectedValues = minAndMaxNumber(enabledExclusionIndexes);
850
- let startRange;
851
- let endRange;
852
- if (minAndMaxSelectedValues) {
853
- startRange = minAndMaxSelectedValues.min;
854
- endRange = minAndMaxSelectedValues.max;
855
- }
856
- if (inputStart != null && inputEnd != null) {
857
- const inputStartIndex = indexFactory(inputStart);
858
- const inputEndIndex = indexFactory(inputEnd);
859
- startRange = startRange != null ? Math.min(inputStartIndex, startRange) : inputStartIndex;
860
- endRange = endRange != null ? Math.max(inputEndIndex, endRange) : inputEndIndex;
861
- }
862
- if (startRange != null && endRange != null) {
863
- const scanStartIndex = startRange;
864
- const scanEndIndex = endRange;
865
- // clear start and end
866
- startRange = undefined;
867
- endRange = undefined;
868
- // if the min is equal to the start index, then we are in the range and need to iterate dates until we find one that is not selected/excluded.
869
- for (let i = scanStartIndex; i <= scanEndIndex; i += 1) {
870
- if (isEnabledFilterDay(i) && isEnabledDay(i)) {
871
- startRange = i;
872
- break;
873
- }
874
- }
875
- // same with the max
876
- for (let i = scanEndIndex; i >= scanStartIndex; i -= 1) {
877
- if (isEnabledFilterDay(i) && isEnabledDay(i)) {
878
- endRange = i;
879
- break;
880
- }
881
- }
882
- }
883
- if (startRange != null && endRange != null) {
884
- return { i: startRange, to: endRange };
885
- }
886
- else {
887
- return undefined;
888
- }
889
- }
890
-
891
- /**
892
- * Token used by provideCalendarScheduleSelectionStoreIfDoesNotExist() to prevent injecting a parent DbxCalendarScheduleSelectionStore into the child view.
893
- */
894
- class DbxCalendarScheduleSelectionStoreProviderBlock {
895
- constructor(dbxCalendarScheduleSelectionStore) {
896
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
897
- }
898
- }
899
- DbxCalendarScheduleSelectionStoreProviderBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock, deps: [{ token: DbxCalendarScheduleSelectionStore, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
900
- DbxCalendarScheduleSelectionStoreProviderBlock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock });
901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock, decorators: [{
902
- type: Injectable
903
- }], ctorParameters: function () {
904
- return [{ type: DbxCalendarScheduleSelectionStore, decorators: [{
905
- type: SkipSelf
906
- }] }];
907
- } });
908
- class DbxCalendarScheduleSelectionStoreInjectionBlockDirective {
909
- }
910
- DbxCalendarScheduleSelectionStoreInjectionBlockDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
911
- DbxCalendarScheduleSelectionStoreInjectionBlockDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, selector: "[dbxCalendarScheduleSelectionStoreParentBlocker]", providers: [DbxCalendarScheduleSelectionStoreProviderBlock], ngImport: i0 });
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, decorators: [{
913
- type: Directive,
914
- args: [{
915
- selector: '[dbxCalendarScheduleSelectionStoreParentBlocker]',
916
- providers: [DbxCalendarScheduleSelectionStoreProviderBlock]
917
- }]
918
- }] });
919
- /**
920
- * Creates a Provider that initializes a new DbxCalendarScheduleSelectionStore if a parent does not exist.
921
- *
922
- * If a DbxCalendarScheduleSelectionStoreInjectionBlock is available in the context, and references the same dbxCalendarScheduleSelectionStore that is attempting to be injected, a new DbxCalendarScheduleSelectionStore is created.
923
- *
924
- * @returns
925
- */
926
- function provideCalendarScheduleSelectionStoreIfParentIsUnavailable() {
927
- return {
928
- provide: DbxCalendarScheduleSelectionStore,
929
- useFactory: (parentInjector, dbxCalendarScheduleSelectionStoreInjectionBlock, dbxCalendarScheduleSelectionStore) => {
930
- if (!dbxCalendarScheduleSelectionStore || (dbxCalendarScheduleSelectionStore && dbxCalendarScheduleSelectionStoreInjectionBlock != null && dbxCalendarScheduleSelectionStoreInjectionBlock.dbxCalendarScheduleSelectionStore === dbxCalendarScheduleSelectionStore)) {
931
- // create a new dbxCalendarScheduleSelectionStore to use
932
- const injector = Injector.create({ providers: [{ provide: DbxCalendarScheduleSelectionStore }], parent: parentInjector });
933
- dbxCalendarScheduleSelectionStore = injector.get(DbxCalendarScheduleSelectionStore);
934
- }
935
- return dbxCalendarScheduleSelectionStore;
936
- },
937
- deps: [Injector, [new Optional(), DbxCalendarScheduleSelectionStoreProviderBlock], [new Optional(), new SkipSelf(), DbxCalendarScheduleSelectionStore]]
938
- };
939
- }
940
-
941
- class DbxScheduleSelectionCalendarDateRangeComponent {
942
- constructor(dbxCalendarStore, dbxCalendarScheduleSelectionStore, matFormFieldDefaultOptions) {
943
- this.dbxCalendarStore = dbxCalendarStore;
944
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
945
- this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
946
- this._required = new BehaviorSubject(false);
947
- this.required$ = this._required.asObservable();
948
- this.timezone$ = this.dbxCalendarScheduleSelectionStore.effectiveOutputTimezone$;
949
- this.openPickerOnTextClick = true;
950
- this.label = 'Enter a date range';
951
- this.showCustomize = false;
952
- this._pickerOpened = new BehaviorSubject(false);
953
- this._requiredSub = new SubscriptionObject();
954
- this._syncSub = new SubscriptionObject();
955
- this._valueSub = new SubscriptionObject();
956
- this.range = new FormGroup({
957
- start: new FormControl(null),
958
- end: new FormControl(null)
959
- });
960
- this.errorStateMatcher = {
961
- isErrorState: (control, form) => {
962
- if (control) {
963
- return (control.invalid && (control.dirty || control.touched)) || (control.touched && this.range.invalid);
964
- }
965
- else {
966
- return false;
967
- }
968
- }
969
- };
970
- this.minDate$ = this.dbxCalendarScheduleSelectionStore.minDate$;
971
- this.maxDate$ = this.dbxCalendarScheduleSelectionStore.maxDate$;
972
- this.timezoneReleventDate$ = this.dbxCalendarScheduleSelectionStore.currentDateRange$.pipe(map((currentDateRange) => {
973
- var _a;
974
- return currentDateRange ? (_a = currentDateRange.start) !== null && _a !== void 0 ? _a : currentDateRange.end : undefined !== null && undefined !== void 0 ? undefined : new Date();
975
- }), shareReplay(1));
976
- this.isCustomized$ = this.dbxCalendarScheduleSelectionStore.isCustomized$;
977
- this.currentErrorMessage$ = this.range.statusChanges.pipe(filter((x) => x === 'INVALID' || x === 'VALID'), map((x) => {
978
- let currentErrorMessage;
979
- if (x === 'INVALID') {
980
- const { start, end } = this.range.controls;
981
- if (this.range.hasError('required')) {
982
- currentErrorMessage = 'Date range is required';
983
- }
984
- else if (start.hasError('matStartDateInvalid')) {
985
- currentErrorMessage = 'Invalid start date';
986
- }
987
- else if (start.hasError('matDatepickerMin')) {
988
- currentErrorMessage = 'Start date is too early';
989
- }
990
- else if (start.hasError('matDatepickerMax')) {
991
- currentErrorMessage = 'Start date is too late';
992
- }
993
- else if (end.hasError('matStartDateInvalid')) {
994
- currentErrorMessage = 'Invalid end date';
995
- }
996
- else if (end.hasError('matDatepickerMin')) {
997
- currentErrorMessage = 'End date is too early';
998
- }
999
- else if (end.hasError('matDatepickerMax')) {
1000
- currentErrorMessage = 'End date is too late';
1001
- }
1002
- }
1003
- return currentErrorMessage;
1004
- }), shareReplay(1));
1005
- this.pickerOpened$ = this._pickerOpened.asObservable();
1006
- this.defaultDatePickerFilter = () => true;
1007
- this.datePickerFilter$ = combineLatest([this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$, this.dbxCalendarScheduleSelectionStore.isInAllowedDaysOfWeekFunction$]).pipe(map(([isEnabled, isAllowedDayOfWeek]) => {
1008
- const fn = (date) => {
1009
- const result = date ? isAllowedDayOfWeek(date) && isEnabled(date) : true;
1010
- return result;
1011
- };
1012
- return fn;
1013
- }), shareReplay(1));
1014
- }
1015
- set disabled(disabled) {
1016
- if (disabled) {
1017
- this.range.disable();
1018
- }
1019
- else {
1020
- this.range.enable();
1021
- }
1022
- }
1023
- ngOnInit() {
1024
- this._syncSub.subscription = this.dbxCalendarScheduleSelectionStore.currentInputRange$.subscribe((x) => {
1025
- var _a, _b;
1026
- this.range.setValue({
1027
- start: (_a = x === null || x === void 0 ? void 0 : x.inputStart) !== null && _a !== void 0 ? _a : null,
1028
- end: (_b = x === null || x === void 0 ? void 0 : x.inputEnd) !== null && _b !== void 0 ? _b : null
1029
- });
1030
- });
1031
- this._valueSub.subscription = this._pickerOpened
1032
- .pipe(distinctUntilChanged(), switchMap((opened) => {
1033
- let obs;
1034
- if (opened) {
1035
- obs = EMPTY;
1036
- }
1037
- else {
1038
- obs = this.range.valueChanges.pipe(startWith(this.range.value));
1039
- }
1040
- return obs;
1041
- }), filter((x) => Boolean(x.start && x.end)), distinctUntilChanged((a, b) => isSameDateDay(a.start, b.start) && isSameDateDay(a.end, b.end)), throttleTime(100, undefined, { trailing: true }))
1042
- .subscribe((x) => {
1043
- if (x.start && x.end) {
1044
- this.dbxCalendarScheduleSelectionStore.setInputRange({ inputStart: x.start, inputEnd: x.end });
1045
- }
1046
- });
1047
- // add a required validator when needed
1048
- this._requiredSub.subscription = this._required.subscribe((x) => {
1049
- const validators = x
1050
- ? [
1051
- (control) => {
1052
- const range = control.value;
1053
- if (!range || !range.start || !range.end) {
1054
- return { required: true };
1055
- }
1056
- return null;
1057
- }
1058
- ]
1059
- : [];
1060
- this.range.setValidators(validators);
1061
- });
1062
- }
1063
- ngOnDestroy() {
1064
- this._required.complete();
1065
- this._pickerOpened.complete();
1066
- this._requiredSub.destroy();
1067
- this._syncSub.destroy();
1068
- this._valueSub.destroy();
1069
- }
1070
- get required() {
1071
- return this._required.value;
1072
- }
1073
- set required(required) {
1074
- this._required.next(required);
1075
- }
1076
- clickedDateRangeInput() {
1077
- if (this.openPickerOnTextClick) {
1078
- this.picker.open();
1079
- }
1080
- }
1081
- pickerOpened() {
1082
- this._pickerOpened.next(true);
1083
- }
1084
- pickerClosed() {
1085
- this._pickerOpened.next(false);
1086
- }
1087
- }
1088
- DbxScheduleSelectionCalendarDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }, { token: MAT_FORM_FIELD_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
1089
- DbxScheduleSelectionCalendarDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: { openPickerOnTextClick: "openPickerOnTextClick", label: "label", hint: "hint", disabled: "disabled", showCustomize: "showCustomize", required: "required" }, viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }], ngImport: i0, template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\">\n <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n <div class=\"dbx-schedule-selection-calendar-date-range-field-content\">\n <!-- Primary Content -->\n <div class=\"dbx-flex\">\n <div *ngIf=\"showCustomize && (isCustomized$ | async)\" class=\"date-range-field-customized\">\n <span class=\"dbx-accent-bg date-range-field-customized-text\">Custom</span>\n </div>\n <dbx-button-spacer></dbx-button-spacer>\n <mat-datepicker-toggle class=\"mat-datepicker-button-highlight\" matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <dbx-button-spacer></dbx-button-spacer>\n <mat-date-range-input (click)=\"clickedDateRangeInput()\" [required]=\"required$ | async\" [dateFilter]=\"(datePickerFilter$ | async) ?? defaultDatePickerFilter\" [formGroup]=\"range\" [rangePicker]=\"picker\">\n <input [errorStateMatcher]=\"errorStateMatcher\" matStartDate formControlName=\"start\" placeholder=\"Start date\" />\n <input [errorStateMatcher]=\"errorStateMatcher\" matEndDate formControlName=\"end\" placeholder=\"End date\" />\n </mat-date-range-input>\n <span *ngIf=\"timezone$ | async\" class=\"dbx-schedule-selection-timezone dbx-faint dbx-nowrap dbx-icon-spacer\">{{ timezone$ | async | timezoneAbbreviation: (timezoneReleventDate$ | async) }}</span>\n <div *ngIf=\"showCustomize\">\n <dbx-button-spacer></dbx-button-spacer>\n <ng-content select=\"[customizeButton]\"></ng-content>\n </div>\n <mat-date-range-picker #picker (opened)=\"pickerOpened()\" (closed)=\"pickerClosed()\"></mat-date-range-picker>\n </div>\n <!-- Custom Content -->\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n <mat-error *ngIf=\"currentErrorMessage$ | async\">{{ currentErrorMessage$ | async }}</mat-error>\n <mat-hint>{{ hint }}</mat-hint>\n</mat-form-field>\n", dependencies: [{ kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: i7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i7.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i7.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i7.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i7.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TimezoneAbbreviationPipe, name: "timezoneAbbreviation" }] });
1090
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, decorators: [{
1091
- type: Component,
1092
- args: [{ selector: 'dbx-schedule-selection-calendar-date-range', template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\">\n <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n <div class=\"dbx-schedule-selection-calendar-date-range-field-content\">\n <!-- Primary Content -->\n <div class=\"dbx-flex\">\n <div *ngIf=\"showCustomize && (isCustomized$ | async)\" class=\"date-range-field-customized\">\n <span class=\"dbx-accent-bg date-range-field-customized-text\">Custom</span>\n </div>\n <dbx-button-spacer></dbx-button-spacer>\n <mat-datepicker-toggle class=\"mat-datepicker-button-highlight\" matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <dbx-button-spacer></dbx-button-spacer>\n <mat-date-range-input (click)=\"clickedDateRangeInput()\" [required]=\"required$ | async\" [dateFilter]=\"(datePickerFilter$ | async) ?? defaultDatePickerFilter\" [formGroup]=\"range\" [rangePicker]=\"picker\">\n <input [errorStateMatcher]=\"errorStateMatcher\" matStartDate formControlName=\"start\" placeholder=\"Start date\" />\n <input [errorStateMatcher]=\"errorStateMatcher\" matEndDate formControlName=\"end\" placeholder=\"End date\" />\n </mat-date-range-input>\n <span *ngIf=\"timezone$ | async\" class=\"dbx-schedule-selection-timezone dbx-faint dbx-nowrap dbx-icon-spacer\">{{ timezone$ | async | timezoneAbbreviation: (timezoneReleventDate$ | async) }}</span>\n <div *ngIf=\"showCustomize\">\n <dbx-button-spacer></dbx-button-spacer>\n <ng-content select=\"[customizeButton]\"></ng-content>\n </div>\n <mat-date-range-picker #picker (opened)=\"pickerOpened()\" (closed)=\"pickerClosed()\"></mat-date-range-picker>\n </div>\n <!-- Custom Content -->\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n <mat-error *ngIf=\"currentErrorMessage$ | async\">{{ currentErrorMessage$ | async }}</mat-error>\n <mat-hint>{{ hint }}</mat-hint>\n</mat-form-field>\n" }]
1093
- }], ctorParameters: function () {
1094
- return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }, { type: undefined, decorators: [{
1095
- type: Inject,
1096
- args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
1097
- }] }];
1098
- }, propDecorators: { openPickerOnTextClick: [{
1099
- type: Input
1100
- }], picker: [{
1101
- type: ViewChild,
1102
- args: ['picker']
1103
- }], label: [{
1104
- type: Input
1105
- }], hint: [{
1106
- type: Input
1107
- }], disabled: [{
1108
- type: Input
1109
- }], showCustomize: [{
1110
- type: Input
1111
- }], required: [{
1112
- type: Input
1113
- }] } });
1114
-
1115
- function dbxScheduleSelectionCalendarDateDaysFormFields() {
1116
- const fields = dbxScheduleSelectionCalendarDateDaysFormDayFields();
1117
- return [flexLayoutWrapper(fields, { relative: true, size: 3 })];
1118
- }
1119
- function dbxScheduleSelectionCalendarDateDaysFormDayFields() {
1120
- return getDaysOfWeekNames(false).map((dayOfWeekName) => {
1121
- return toggleField({
1122
- key: dayOfWeekName.toLowerCase(),
1123
- label: dayOfWeekName
1124
- });
1125
- });
1126
- }
1127
-
1128
- class DbxScheduleSelectionCalendarDateDaysFormComponent extends AbstractSyncFormlyFormDirective {
1129
- constructor() {
1130
- super(...arguments);
1131
- this.fields = dbxScheduleSelectionCalendarDateDaysFormFields();
1132
- }
1133
- }
1134
- DbxScheduleSelectionCalendarDateDaysFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1135
- DbxScheduleSelectionCalendarDateDaysFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDaysFormComponent, selector: "dbx-schedule-selection-calendar-date-days-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
1136
- <dbx-formly></dbx-formly>
1137
- `, isInline: true, dependencies: [{ kind: "component", type: i4$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
1138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, decorators: [{
1139
- type: Component,
1140
- args: [{
1141
- template: `
1142
- <dbx-formly></dbx-formly>
1143
- `,
1144
- selector: 'dbx-schedule-selection-calendar-date-days-form',
1145
- providers: [provideFormlyContext()]
1146
- }]
1147
- }] });
1148
-
1149
- class DbxScheduleSelectionCalendarDateDaysComponent {
1150
- constructor(dbxCalendarStore, dbxCalendarScheduleSelectionStore) {
1151
- this.dbxCalendarStore = dbxCalendarStore;
1152
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1153
- this.template$ = this.dbxCalendarScheduleSelectionStore.scheduleDays$.pipe(map(enabledDaysFromDateCellScheduleDayCodes), shareReplay(1));
1154
- this.isFormModified = (value) => {
1155
- const newSetValue = new Set(dateCellScheduleDayCodesFromEnabledDays(value));
1156
- return this.dbxCalendarScheduleSelectionStore.scheduleDays$.pipe(map((currentSet) => {
1157
- const result = !dateCellScheduleDayCodesAreSetsEquivalent(newSetValue, currentSet);
1158
- return result;
1159
- }));
1160
- };
1161
- this.updateScheduleDays = (value) => {
1162
- this.dbxCalendarScheduleSelectionStore.setScheduleDays(new Set(dateCellScheduleDayCodesFromEnabledDays(value)));
1163
- return of(true);
1164
- };
1165
- }
1166
- }
1167
- DbxScheduleSelectionCalendarDateDaysComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
1168
- DbxScheduleSelectionCalendarDateDaysComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDaysComponent, selector: "dbx-schedule-selection-calendar-date-days", ngImport: i0, template: `
1169
- <div class="dbx-schedule-selection-calendar-date-days" dbxAction dbxActionAutoTrigger dbxActionEnforceModified [instantTrigger]="true" [dbxActionHandler]="updateScheduleDays">
1170
- <dbx-schedule-selection-calendar-date-days-form dbxActionForm [dbxFormSource]="template$" [dbxActionFormModified]="isFormModified"></dbx-schedule-selection-calendar-date-days-form>
1171
- </div>
1172
- `, isInline: true, dependencies: [{ kind: "directive", type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3$1.DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: ["dbxActionEnforceModified"] }, { kind: "directive", type: i3$1.DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: ["dbxActionAutoTrigger", "triggerDebounce", "triggerThrottle", "triggerErrorThrottle", "fastTrigger", "instantTrigger", "triggerLimit"] }, { kind: "directive", type: i4$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "dbxActionFormMapValue", "formDisabledOnWorking"] }, { kind: "directive", type: i4$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDaysFormComponent, selector: "dbx-schedule-selection-calendar-date-days-form" }] });
1173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysComponent, decorators: [{
1174
- type: Component,
1175
- args: [{
1176
- selector: 'dbx-schedule-selection-calendar-date-days',
1177
- template: `
1178
- <div class="dbx-schedule-selection-calendar-date-days" dbxAction dbxActionAutoTrigger dbxActionEnforceModified [instantTrigger]="true" [dbxActionHandler]="updateScheduleDays">
1179
- <dbx-schedule-selection-calendar-date-days-form dbxActionForm [dbxFormSource]="template$" [dbxActionFormModified]="isFormModified"></dbx-schedule-selection-calendar-date-days-form>
1180
- </div>
1181
- `
1182
- }]
1183
- }], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; } });
1184
-
1185
- class DbxScheduleSelectionCalendarDatePopoverContentComponent {
1186
- }
1187
- DbxScheduleSelectionCalendarDatePopoverContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1188
- DbxScheduleSelectionCalendarDatePopoverContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverContentComponent, selector: "dbx-schedule-selection-calendar-date-popover-content", ngImport: i0, template: `
1189
- <dbx-content-container padding="min" topPadding="normal">
1190
- <dbx-schedule-selection-calendar-date-range [openPickerOnTextClick]="false"></dbx-schedule-selection-calendar-date-range>
1191
- <dbx-label-block header="Allowed Days Of Week">
1192
- <dbx-schedule-selection-calendar-date-days></dbx-schedule-selection-calendar-date-days>
1193
- </dbx-label-block>
1194
- </dbx-content-container>
1195
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.DbxContentContainerDirective, selector: "dbx-content-container,[dbxContentContainer],.dbx-content-container", inputs: ["grow", "padding", "topPadding"] }, { kind: "component", type: i1$1.DbxLabelBlockComponent, selector: "dbx-label-block", inputs: ["header"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDaysComponent, selector: "dbx-schedule-selection-calendar-date-days" }, { kind: "component", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: ["openPickerOnTextClick", "label", "hint", "disabled", "showCustomize", "required"] }] });
1196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverContentComponent, decorators: [{
1197
- type: Component,
1198
- args: [{
1199
- selector: 'dbx-schedule-selection-calendar-date-popover-content',
1200
- template: `
1201
- <dbx-content-container padding="min" topPadding="normal">
1202
- <dbx-schedule-selection-calendar-date-range [openPickerOnTextClick]="false"></dbx-schedule-selection-calendar-date-range>
1203
- <dbx-label-block header="Allowed Days Of Week">
1204
- <dbx-schedule-selection-calendar-date-days></dbx-schedule-selection-calendar-date-days>
1205
- </dbx-label-block>
1206
- </dbx-content-container>
1207
- `
1208
- }]
1209
- }] });
1210
-
1211
- const DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY = 'calendarselection';
1212
- class DbxScheduleSelectionCalendarDatePopoverComponent extends AbstractPopoverDirective {
1213
- static openPopover(popoverService, { origin, injector }, popoverKey) {
1214
- return popoverService.open({
1215
- key: popoverKey !== null && popoverKey !== void 0 ? popoverKey : DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY,
1216
- origin,
1217
- componentClass: DbxScheduleSelectionCalendarDatePopoverComponent,
1218
- injector
1219
- });
1220
- }
1221
- }
1222
- DbxScheduleSelectionCalendarDatePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1223
- DbxScheduleSelectionCalendarDatePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
1224
- <dbx-popover-content>
1225
- <dbx-popover-scroll-content>
1226
- <dbx-schedule-selection-calendar-date-popover-content></dbx-schedule-selection-calendar-date-popover-content>
1227
- </dbx-popover-scroll-content>
1228
- </dbx-popover-content>
1229
- `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxPopoverContentComponent, selector: "dbx-popover-content" }, { kind: "component", type: i1$1.DbxPopoverScrollContentComponent, selector: "dbx-popover-scroll-content" }, { kind: "component", type: DbxScheduleSelectionCalendarDatePopoverContentComponent, selector: "dbx-schedule-selection-calendar-date-popover-content" }] });
1230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverComponent, decorators: [{
1231
- type: Component,
1232
- args: [{
1233
- template: `
1234
- <dbx-popover-content>
1235
- <dbx-popover-scroll-content>
1236
- <dbx-schedule-selection-calendar-date-popover-content></dbx-schedule-selection-calendar-date-popover-content>
1237
- </dbx-popover-scroll-content>
1238
- </dbx-popover-content>
1239
- `
1240
- }]
1241
- }] });
1242
-
1243
- class DbxScheduleSelectionCalendarDatePopoverButtonComponent {
1244
- constructor(popoverService, dbxCalendarScheduleSelectionStore, injector) {
1245
- this.popoverService = popoverService;
1246
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1247
- this.injector = injector;
1248
- this.disabled$ = this.dbxCalendarScheduleSelectionStore.isViewReadonly$;
1249
- this.buttonText$ = this.dbxCalendarScheduleSelectionStore.currentDateRange$.pipe(map((x) => {
1250
- if ((x === null || x === void 0 ? void 0 : x.start) && x.end) {
1251
- const startString = formatToMonthDayString(x.start);
1252
- const endString = formatToMonthDayString(x.end);
1253
- return startString === endString ? startString : `${formatToMonthDayString(x.start)} - ${formatToMonthDayString(x.end)}`;
1254
- }
1255
- else {
1256
- return 'Pick a Date Range';
1257
- }
1258
- }), shareReplay(1));
1259
- }
1260
- openPopover() {
1261
- DbxScheduleSelectionCalendarDatePopoverComponent.openPopover(this.popoverService, { origin: this.buttonPopoverOrigin, injector: this.injector });
1262
- }
1263
- }
1264
- DbxScheduleSelectionCalendarDatePopoverButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, deps: [{ token: i1$1.DbxPopoverService }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1265
- DbxScheduleSelectionCalendarDatePopoverButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, selector: "dbx-schedule-selection-calendar-date-popover-button", viewQueries: [{ propertyName: "buttonPopoverOrigin", first: true, predicate: ["buttonPopoverOrigin"], descendants: true, read: ElementRef }], ngImport: i0, template: `
1266
- <dbx-button #buttonPopoverOrigin icon="date_range" [disabled]="disabled$ | async" [raised]="true" color="accent" [text]="buttonText$ | async" (buttonClick)="openPopover()"></dbx-button>
1267
- `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
1268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, decorators: [{
1269
- type: Component,
1270
- args: [{
1271
- selector: 'dbx-schedule-selection-calendar-date-popover-button',
1272
- template: `
1273
- <dbx-button #buttonPopoverOrigin icon="date_range" [disabled]="disabled$ | async" [raised]="true" color="accent" [text]="buttonText$ | async" (buttonClick)="openPopover()"></dbx-button>
1274
- `
1275
- }]
1276
- }], ctorParameters: function () { return [{ type: i1$1.DbxPopoverService }, { type: DbxCalendarScheduleSelectionStore }, { type: i0.Injector }]; }, propDecorators: { buttonPopoverOrigin: [{
1277
- type: ViewChild,
1278
- args: ['buttonPopoverOrigin', { read: ElementRef }]
1279
- }] } });
1280
-
1281
- class DbxScheduleSelectionCalendarCellComponent {
1282
- constructor(dbxCalendarScheduleSelectionStore) {
1283
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1284
- this.content = {};
1285
- }
1286
- get icon() {
1287
- return this.content.icon;
1288
- }
1289
- get text() {
1290
- return this.content.text;
1291
- }
1292
- set day(day) {
1293
- this.dbxCalendarScheduleSelectionStore.cellContentFactory$.pipe(first()).subscribe((fn) => {
1294
- this.content = fn(day);
1295
- });
1296
- }
1297
- }
1298
- DbxScheduleSelectionCalendarCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarCellComponent, deps: [{ token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
1299
- DbxScheduleSelectionCalendarCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarCellComponent, selector: "dbx-schedule-selection-calendar-cell", inputs: { day: "day" }, host: { classAttribute: "dbx-schedule-selection-calendar-cell" }, ngImport: i0, template: `
1300
- <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
1301
- <span>{{ text }}</span>
1302
- `, isInline: true, dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarCellComponent, decorators: [{
1304
- type: Component,
1305
- args: [{
1306
- selector: 'dbx-schedule-selection-calendar-cell',
1307
- template: `
1308
- <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
1309
- <span>{{ text }}</span>
1310
- `,
1311
- host: {
1312
- class: 'dbx-schedule-selection-calendar-cell'
1313
- },
1314
- changeDetection: ChangeDetectionStrategy.OnPush
1315
- }]
1316
- }], ctorParameters: function () { return [{ type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { day: [{
1317
- type: Input
1318
- }] } });
1319
-
1320
- /**
1321
- * Toggle button for selecting and clearing the current selection.
1322
- */
1323
- class DbxScheduleSelectionCalendarSelectionToggleButtonComponent {
1324
- constructor(popoverService, dbxCalendarScheduleSelectionStore, injector) {
1325
- this.popoverService = popoverService;
1326
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1327
- this.injector = injector;
1328
- this._disabled = new BehaviorSubject(false);
1329
- this.disableButton$ = this._disabled.pipe(switchMap((disabled) => {
1330
- if (disabled) {
1331
- return of(true);
1332
- }
1333
- else {
1334
- return this.dbxCalendarScheduleSelectionStore.nextToggleSelection$.pipe(map((x) => !x));
1335
- }
1336
- }), distinctUntilChanged(), shareReplay(1));
1337
- this.buttonDisplay$ = this.dbxCalendarScheduleSelectionStore.selectionMode$.pipe(switchMap((selectionMode) => {
1338
- return this.dbxCalendarScheduleSelectionStore.nextToggleSelection$.pipe(map((x) => {
1339
- let buttonDisplay;
1340
- switch (x) {
1341
- case 'all':
1342
- buttonDisplay = {
1343
- icon: 'select_all',
1344
- text: 'Select All'
1345
- };
1346
- break;
1347
- default:
1348
- case 'none':
1349
- buttonDisplay = {
1350
- icon: 'clear',
1351
- text: selectionMode === 'multiple' ? 'Clear All' : 'Clear'
1352
- };
1353
- break;
1354
- }
1355
- return buttonDisplay;
1356
- }));
1357
- }), shareReplay(1));
1358
- }
1359
- ngOnDestroy() {
1360
- this._disabled.complete();
1361
- }
1362
- toggleSelection() {
1363
- this.dbxCalendarScheduleSelectionStore.toggleSelection();
1364
- }
1365
- set disabled(disabled) {
1366
- this._disabled.next(disabled);
1367
- }
1368
- }
1369
- DbxScheduleSelectionCalendarSelectionToggleButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, deps: [{ token: i1$1.DbxPopoverService }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1370
- DbxScheduleSelectionCalendarSelectionToggleButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, selector: "dbx-schedule-selection-calendar-selection-toggle-button", inputs: { disabled: "disabled" }, ngImport: i0, template: `
1371
- <dbx-button [disabled]="disableButton$ | async" [buttonDisplay]="buttonDisplay$ | async" [raised]="true" (buttonClick)="toggleSelection()"></dbx-button>
1372
- `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
1373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, decorators: [{
1374
- type: Component,
1375
- args: [{
1376
- selector: 'dbx-schedule-selection-calendar-selection-toggle-button',
1377
- template: `
1378
- <dbx-button [disabled]="disableButton$ | async" [buttonDisplay]="buttonDisplay$ | async" [raised]="true" (buttonClick)="toggleSelection()"></dbx-button>
1379
- `
1380
- }]
1381
- }], ctorParameters: function () { return [{ type: i1$1.DbxPopoverService }, { type: DbxCalendarScheduleSelectionStore }, { type: i0.Injector }]; }, propDecorators: { disabled: [{
1382
- type: Input
1383
- }] } });
1384
-
1385
- function dbxScheduleSelectionCalendarBeforeMonthViewRenderFactory(inputModifyFn) {
1386
- const modifyFn = inputModifyFn || (() => { });
1387
- return (state$) => {
1388
- return (renderEvent) => {
1389
- const { body } = renderEvent;
1390
- // use latest/current state
1391
- state$.pipe(first()).subscribe((calendarScheduleState) => {
1392
- const { isEnabledDay, indexFactory, isEnabledFilterDay, allowedDaysOfWeek } = calendarScheduleState;
1393
- body.forEach((viewDay) => {
1394
- const { date } = viewDay;
1395
- const i = indexFactory(date);
1396
- const day = date.getDay();
1397
- let state;
1398
- if (!isEnabledFilterDay(i)) {
1399
- viewDay.cssClass = 'cal-day-not-applicable';
1400
- state = CalendarScheduleSelectionDayState.NOT_APPLICABLE;
1401
- }
1402
- else if (!allowedDaysOfWeek.has(day)) {
1403
- viewDay.cssClass = 'cal-day-disabled';
1404
- state = CalendarScheduleSelectionDayState.DISABLED;
1405
- }
1406
- else if (isEnabledDay(i)) {
1407
- viewDay.cssClass = 'cal-day-selected';
1408
- state = CalendarScheduleSelectionDayState.SELECTED;
1409
- }
1410
- else {
1411
- viewDay.cssClass = 'cal-day-not-selected';
1412
- state = CalendarScheduleSelectionDayState.NOT_SELECTED;
1413
- }
1414
- const meta = {
1415
- state,
1416
- i
1417
- };
1418
- viewDay.meta = meta;
1419
- modifyFn(viewDay, calendarScheduleState);
1420
- });
1421
- });
1422
- };
1423
- };
1424
- }
1425
- class DbxScheduleSelectionCalendarComponent {
1426
- constructor(calendarStore, dbxCalendarScheduleSelectionStore) {
1427
- this.calendarStore = calendarStore;
1428
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1429
- this._inputReadonly = new BehaviorSubject(undefined);
1430
- this._config = new BehaviorSubject({});
1431
- this._centerRangeSub = new SubscriptionObject();
1432
- this.config$ = this._config.pipe(distinctUntilChanged(), shareReplay(1));
1433
- this.readonly$ = this.config$.pipe(switchMap((x) => (x.readonly != null ? asObservableFromGetter(x.readonly) : of(undefined))), combineLatestWith(this._inputReadonly), map(([configReadonly, inputReadonly]) => {
1434
- return (configReadonly !== null && configReadonly !== void 0 ? configReadonly : false) || (inputReadonly !== null && inputReadonly !== void 0 ? inputReadonly : false);
1435
- }), shareReplay(1));
1436
- this.showButtonsOnReadonly$ = this.config$.pipe(map((x) => { var _a; return (_a = x.showButtonsOnReadonly) !== null && _a !== void 0 ? _a : false; }), distinctUntilChanged(), shareReplay(1));
1437
- this.showButtons$ = this.showButtonsOnReadonly$.pipe(switchMap((x) => {
1438
- if (x) {
1439
- return of(true);
1440
- }
1441
- else {
1442
- return this.readonly$.pipe(map((x) => !x));
1443
- }
1444
- }), distinctUntilChanged(), shareReplay(1));
1445
- this.showClearSelectionButton$ = this.config$.pipe(map((config) => { var _a; return (_a = config.showClearSelectionButton) !== null && _a !== void 0 ? _a : true; }), combineLatestWith(this.showButtons$), map((x) => reduceBooleansWithAnd(x)), distinctUntilChanged(), shareReplay(1));
1446
- this.datePopoverButtonInjectionConfig$ = this.config$.pipe(map((x) => x.buttonInjectionConfig), switchMapDbxInjectionComponentConfig(DbxScheduleSelectionCalendarDatePopoverButtonComponent), combineLatestWith(this.showButtons$), map(([config, showButton]) => (showButton ? config : undefined)), shareReplay(1));
1447
- this.clickEvent = new EventEmitter();
1448
- // refresh any time the selected day function updates
1449
- this.state$ = this.dbxCalendarScheduleSelectionStore.state$;
1450
- this.beforeMonthViewRender$ = this.config$.pipe(switchMap((x) => {
1451
- let factory;
1452
- if (x.beforeMonthViewRenderFunctionFactory) {
1453
- factory = asObservable(x.beforeMonthViewRenderFunctionFactory);
1454
- }
1455
- else {
1456
- factory = asObservable(x.customizeDay).pipe(map((x) => dbxScheduleSelectionCalendarBeforeMonthViewRenderFactory(x)));
1457
- }
1458
- return factory.pipe(map((x) => x(this.state$)));
1459
- }), shareReplay(1));
1460
- this.refresh$ = combineLatest([this.state$, this.beforeMonthViewRender$]).pipe(throttleTime(20, undefined, { leading: true, trailing: true }), map(() => undefined));
1461
- this.events$ = this.calendarStore.visibleEvents$.pipe(map(prepareAndSortCalendarEvents), shareReplay(1));
1462
- this.viewDate$ = this.calendarStore.date$;
1463
- }
1464
- ngOnInit() {
1465
- this.dbxCalendarScheduleSelectionStore.setViewReadonlyState(this.readonly$); // sync the readonly state
1466
- this.calendarStore.setNavigationRangeLimit(this.dbxCalendarScheduleSelectionStore.minMaxDateRange$); // set navigation limit to the min/max allowed dates.
1467
- this.calendarStore.setShowPageButtons(true);
1468
- // when a new filter is set, if the first two pages of selectable indexes fit within the calendar month, focus on that calendar month.
1469
- this._centerRangeSub.subscription = this.dbxCalendarScheduleSelectionStore.currentDateRange$
1470
- .pipe(first(), switchMap((x) => {
1471
- let result = x
1472
- ? of([x, true])
1473
- : this.dbxCalendarScheduleSelectionStore.minMaxDateRange$.pipe(first(), map((y) => [y, false]));
1474
- return result;
1475
- }))
1476
- .subscribe(([x, isFromSelectedDateRange]) => {
1477
- if (x === null || x === void 0 ? void 0 : x.start) {
1478
- let tapDay;
1479
- const startMonth = dateRange({ date: x.start, type: DateRangeType.CALENDAR_MONTH });
1480
- const monthToFocus = endOfWeek(startMonth.start);
1481
- if (x.end != null) {
1482
- const endMonth = dateRange({ date: x.end, type: DateRangeType.CALENDAR_MONTH });
1483
- if (isSameDate(startMonth.start, endMonth.start)) {
1484
- tapDay = monthToFocus;
1485
- }
1486
- }
1487
- if (!tapDay && isFromSelectedDateRange) {
1488
- tapDay = monthToFocus;
1489
- }
1490
- if (tapDay) {
1491
- this.calendarStore.tapDay(tapDay);
1492
- }
1493
- }
1494
- });
1495
- }
1496
- ngOnDestroy() {
1497
- this.clickEvent.complete();
1498
- this._inputReadonly.complete();
1499
- this._config.complete();
1500
- this._centerRangeSub.destroy();
1501
- }
1502
- get config() {
1503
- return this._config.value;
1504
- }
1505
- set config(config) {
1506
- this._config.next(config !== null && config !== void 0 ? config : {});
1507
- }
1508
- set readonly(readonly) {
1509
- this._inputReadonly.next(readonly);
1510
- }
1511
- dayClicked({ date }) {
1512
- this.readonly$.pipe(first()).subscribe((readonly) => {
1513
- if (!readonly) {
1514
- this.dbxCalendarScheduleSelectionStore.toggleSelectedDates(date);
1515
- }
1516
- });
1517
- }
1518
- eventClicked(action, event) {
1519
- this.clickEvent.emit({ action, event });
1520
- }
1521
- beforeMonthViewRender(renderEvent) {
1522
- this.beforeMonthViewRender$.pipe(first()).subscribe((x) => {
1523
- x(renderEvent);
1524
- });
1525
- }
1526
- }
1527
- DbxScheduleSelectionCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
1528
- DbxScheduleSelectionCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarComponent, selector: "dbx-schedule-selection-calendar", inputs: { config: "config", readonly: "readonly" }, outputs: { clickEvent: "clickEvent" }, providers: [DbxCalendarStore], ngImport: i0, template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\" [ngClass]=\"(readonly$ | async) ? 'dbx-schedule-selection-calendar-readonly' : ''\">\n <ng-container controls>\n <ng-container *ngIf=\"showClearSelectionButton$ | async\">\n <dbx-schedule-selection-calendar-selection-toggle-button [disabled]=\"readonly$ | async\"></dbx-schedule-selection-calendar-selection-toggle-button>\n <dbx-button-spacer></dbx-button-spacer>\n </ng-container>\n <dbx-injection [config]=\"datePopoverButtonInjectionConfig$ | async\"></dbx-injection>\n </ng-container>\n <div class=\"dbx-calendar-content dbx-calendar-content-month\">\n <mwl-calendar-month-view [refresh]=\"refresh$\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\" (beforeViewRender)=\"beforeMonthViewRender($event)\" [cellTemplate]=\"monthDayCellTemplate\"></mwl-calendar-month-view>\n </div>\n</dbx-calendar-base>\n\n<!-- Cell -->\n<ng-template #monthDayCellTemplate let-day=\"day\" let-locale=\"locale\">\n <div class=\"cal-cell-top\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{ day.badgeTotal }}</span>\n <span class=\"cal-day-number\">{{ day.date | calendarDate: 'monthViewDayNumber':locale }}</span>\n </div>\n <dbx-schedule-selection-calendar-cell [day]=\"day\"></dbx-schedule-selection-calendar-cell>\n</ng-template>\n", dependencies: [{ kind: "component", type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: i1.DbxCalendarBaseComponent, selector: "dbx-calendar-base" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: i6.CalendarMonthViewComponent, selector: "mwl-calendar-month-view", inputs: ["viewDate", "events", "excludeDays", "activeDayIsOpen", "activeDay", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "cellTemplate", "openDayEventsTemplate", "eventTitleTemplate", "eventActionsTemplate", "weekendDays"], outputs: ["beforeViewRender", "dayClicked", "eventClicked", "columnHeaderClicked", "eventTimesChanged"] }, { kind: "directive", type: i7$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: DbxScheduleSelectionCalendarCellComponent, selector: "dbx-schedule-selection-calendar-cell", inputs: ["day"] }, { kind: "component", type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, selector: "dbx-schedule-selection-calendar-selection-toggle-button", inputs: ["disabled"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.ɵCalendarDatePipe, name: "calendarDate" }] });
1529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarComponent, decorators: [{
1530
- type: Component,
1531
- args: [{ selector: 'dbx-schedule-selection-calendar', providers: [DbxCalendarStore], template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\" [ngClass]=\"(readonly$ | async) ? 'dbx-schedule-selection-calendar-readonly' : ''\">\n <ng-container controls>\n <ng-container *ngIf=\"showClearSelectionButton$ | async\">\n <dbx-schedule-selection-calendar-selection-toggle-button [disabled]=\"readonly$ | async\"></dbx-schedule-selection-calendar-selection-toggle-button>\n <dbx-button-spacer></dbx-button-spacer>\n </ng-container>\n <dbx-injection [config]=\"datePopoverButtonInjectionConfig$ | async\"></dbx-injection>\n </ng-container>\n <div class=\"dbx-calendar-content dbx-calendar-content-month\">\n <mwl-calendar-month-view [refresh]=\"refresh$\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\" (beforeViewRender)=\"beforeMonthViewRender($event)\" [cellTemplate]=\"monthDayCellTemplate\"></mwl-calendar-month-view>\n </div>\n</dbx-calendar-base>\n\n<!-- Cell -->\n<ng-template #monthDayCellTemplate let-day=\"day\" let-locale=\"locale\">\n <div class=\"cal-cell-top\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{ day.badgeTotal }}</span>\n <span class=\"cal-day-number\">{{ day.date | calendarDate: 'monthViewDayNumber':locale }}</span>\n </div>\n <dbx-schedule-selection-calendar-cell [day]=\"day\"></dbx-schedule-selection-calendar-cell>\n</ng-template>\n" }]
1532
- }], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { clickEvent: [{
1533
- type: Output
1534
- }], config: [{
1535
- type: Input
1536
- }], readonly: [{
1537
- type: Input
1538
- }] } });
1539
-
1540
- /**
1541
- * Token used to configure the default DbxDialogContentFooterConfig for DbxScheduleSelectionCalendarDateDialogComponent.
1542
- *
1543
- * @deprecated use DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CONTENT_CONFIG_TOKEN instead.
1544
- */
1545
- const DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CLOSE_CONFIG_TOKEN = new InjectionToken('DbxScheduleSelectionCalendarDatePopupCloseConfig');
1546
- /**
1547
- * Token used to configure the default DbxScheduleSelectionCalendarDatePopupConfig for DbxScheduleSelectionCalendarDateDialogComponent.
1548
- */
1549
- const DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CONTENT_CONFIG_TOKEN = new InjectionToken('DbxScheduleSelectionCalendarDatePopupContentConfig');
1550
- class DbxScheduleSelectionCalendarDateDialogComponent extends AbstractDialogDirective {
1551
- get contentConfig() {
1552
- return this.data.contentConfig;
1553
- }
1554
- get closeConfig() {
1555
- var _a;
1556
- return (_a = this.contentConfig) === null || _a === void 0 ? void 0 : _a.closeConfig;
1557
- }
1558
- static openDialog(matDialog, config) {
1559
- const { injector, contentConfig: inputContentConfig, closeConfig: inputCloseConfig } = config;
1560
- const defaultCloseConfig = injector.get(DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CLOSE_CONFIG_TOKEN, null);
1561
- const defaultContentConfig = injector.get(DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CONTENT_CONFIG_TOKEN, null);
1562
- const contentConfig = mergeObjects([defaultContentConfig, inputContentConfig], KeyValueTypleValueFilter.NULL);
1563
- const closeConfig = mergeObjects([defaultCloseConfig, contentConfig === null || contentConfig === void 0 ? void 0 : contentConfig.closeConfig, inputCloseConfig], KeyValueTypleValueFilter.NULL);
1564
- contentConfig.closeConfig = closeConfig;
1565
- return matDialog.open(DbxScheduleSelectionCalendarDateDialogComponent, Object.assign(Object.assign({ height: 'calc(var(--vh100) * 0.9)', width: '80vw', minHeight: 400, minWidth: 360 }, sanitizeDbxDialogContentConfig(contentConfig.dialogConfig)), { injector, data: {
1566
- config,
1567
- contentConfig
1568
- } }));
1569
- }
1570
- }
1571
- DbxScheduleSelectionCalendarDateDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1572
- DbxScheduleSelectionCalendarDateDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDialogComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
1573
- <dbx-dialog-content class="dbx-schedule-selection-calendar-date-dialog">
1574
- <dbx-dialog-content-close (close)="close()"></dbx-dialog-content-close>
1575
- <dbx-schedule-selection-calendar></dbx-schedule-selection-calendar>
1576
- <dbx-dialog-content-footer [config]="closeConfig" (close)="close()"></dbx-dialog-content-footer>
1577
- </dbx-dialog-content>
1578
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.DbxDialogContentDirective, selector: "dbx-dialog-content,[dbxDialogContent].dbx-dialog-content", inputs: ["width"] }, { kind: "component", type: i1$1.DbxDialogContentFooterComponent, selector: "dbx-dialog-content-footer", inputs: ["closeText", "buttonColor", "config"], outputs: ["close"] }, { kind: "component", type: i1$1.DbxDialogContentCloseComponent, selector: "dbx-dialog-content-close", outputs: ["close"] }, { kind: "component", type: DbxScheduleSelectionCalendarComponent, selector: "dbx-schedule-selection-calendar", inputs: ["config", "readonly"], outputs: ["clickEvent"] }] });
1579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogComponent, decorators: [{
1580
- type: Component,
1581
- args: [{
1582
- template: `
1583
- <dbx-dialog-content class="dbx-schedule-selection-calendar-date-dialog">
1584
- <dbx-dialog-content-close (close)="close()"></dbx-dialog-content-close>
1585
- <dbx-schedule-selection-calendar></dbx-schedule-selection-calendar>
1586
- <dbx-dialog-content-footer [config]="closeConfig" (close)="close()"></dbx-dialog-content-footer>
1587
- </dbx-dialog-content>
1588
- `
1589
- }]
1590
- }] });
1591
-
1592
- class DbxScheduleSelectionCalendarDateDialogButtonComponent {
1593
- constructor(matDialog, injector) {
1594
- this.matDialog = matDialog;
1595
- this.injector = injector;
1596
- this.buttonText = 'Customize';
1597
- }
1598
- clickCustomize() {
1599
- DbxScheduleSelectionCalendarDateDialogComponent.openDialog(this.matDialog, { injector: this.injector, contentConfig: this.contentConfig, closeConfig: this.closeConfig });
1600
- }
1601
- }
1602
- DbxScheduleSelectionCalendarDateDialogButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogButtonComponent, deps: [{ token: i1$2.MatDialog }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1603
- DbxScheduleSelectionCalendarDateDialogButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDialogButtonComponent, selector: "dbx-schedule-selection-calendar-date-dialog-button", inputs: { buttonText: "buttonText", disabled: "disabled", contentConfig: "contentConfig", closeConfig: "closeConfig" }, ngImport: i0, template: `
1604
- <dbx-button [raised]="true" color="accent" [text]="buttonText" [disabled]="disabled" (buttonClick)="clickCustomize()"></dbx-button>
1605
- `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }] });
1606
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogButtonComponent, decorators: [{
1607
- type: Component,
1608
- args: [{
1609
- selector: 'dbx-schedule-selection-calendar-date-dialog-button',
1610
- template: `
1611
- <dbx-button [raised]="true" color="accent" [text]="buttonText" [disabled]="disabled" (buttonClick)="clickCustomize()"></dbx-button>
1612
- `
1613
- }]
1614
- }], ctorParameters: function () { return [{ type: i1$2.MatDialog }, { type: i0.Injector }]; }, propDecorators: { buttonText: [{
1615
- type: Input
1616
- }], disabled: [{
1617
- type: Input
1618
- }], contentConfig: [{
1619
- type: Input
1620
- }], closeConfig: [{
1621
- type: Input
1622
- }] } });
1623
-
1624
- class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
1625
- constructor(compact, dbxCalendarScheduleSelectionStore, ngZone) {
1626
- super();
1627
- this.compact = compact;
1628
- this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
1629
- this.ngZone = ngZone;
1630
- this._syncSub = new SubscriptionObject();
1631
- this._valueSub = new SubscriptionObject();
1632
- this._timezoneSub = new SubscriptionObject();
1633
- this._minMaxDateRangeSub = new SubscriptionObject();
1634
- this._defaultWeekSub = new SubscriptionObject();
1635
- this._filterSub = new SubscriptionObject();
1636
- this._exclusionsSub = new SubscriptionObject();
1637
- this._formControlObs = new BehaviorSubject(undefined);
1638
- this.formControl$ = this._formControlObs.pipe(filterMaybe());
1639
- this.value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
1640
- this.disableCustomize$ = this.value$.pipe(map((x) => (this.allowCustomizeWithoutDateRange ? false : !x)), distinctUntilChanged(), shareReplay(1));
1641
- }
1642
- get formGroupName() {
1643
- return this.field.key;
1644
- }
1645
- get formGroup() {
1646
- return this.form;
1647
- }
1648
- get label() {
1649
- var _a;
1650
- return (_a = this.field.props) === null || _a === void 0 ? void 0 : _a.label;
1651
- }
1652
- get description() {
1653
- return this.props.description;
1654
- }
1655
- get isReadonlyOrDisabled() {
1656
- return this.props.readonly || this.disabled;
1657
- }
1658
- get openPickerOnTextClick() {
1659
- return this.props.allowTextInput !== true; // Opposite of allowTextInput
1660
- }
1661
- get allowCustomizeWithoutDateRange() {
1662
- var _a;
1663
- return (_a = this.props.allowCustomizeWithoutDateRange) !== null && _a !== void 0 ? _a : false;
1664
- }
1665
- get showCustomize() {
1666
- return !this.props.hideCustomize;
1667
- }
1668
- get defaultScheduleDays() {
1669
- return this.props.defaultScheduleDays;
1670
- }
1671
- get minMaxDateRange() {
1672
- return this.props.minMaxDateRange;
1673
- }
1674
- get filter() {
1675
- return this.props.filter;
1676
- }
1677
- get exclusions() {
1678
- return this.props.exclusions;
1679
- }
1680
- get outputTimezone() {
1681
- return this.props.outputTimezone || this.props.timezone;
1682
- }
1683
- get initialSelectionState() {
1684
- return this.props.initialSelectionState;
1685
- }
1686
- get computeSelectionResultRelativeToFilter() {
1687
- return this.props.computeSelectionResultRelativeToFilter;
1688
- }
1689
- get dialogContentConfig() {
1690
- return this.props.dialogContentConfig;
1691
- }
1692
- get customDetailsConfig() {
1693
- return this.props.customDetailsConfig;
1694
- }
1695
- get cellContentFactory() {
1696
- return this.props.cellContentFactory;
1697
- }
1698
- ngOnInit() {
1699
- this._formControlObs.next(this.formControl);
1700
- this._syncSub.subscription = this.value$.pipe(distinctUntilChanged(isSameDateCellScheduleDateRange)).subscribe((x) => {
1701
- this.dbxCalendarScheduleSelectionStore.setDateScheduleRangeValue(x);
1702
- });
1703
- this._valueSub.subscription = this.dbxCalendarScheduleSelectionStore.currentDateCellScheduleRangeValue$.subscribe((x) => {
1704
- this.formControl.setValue(x);
1705
- });
1706
- const { outputTimezone, minMaxDateRange, filter, exclusions, defaultScheduleDays } = this;
1707
- if (filter != null) {
1708
- this._filterSub.subscription = this.dbxCalendarScheduleSelectionStore.setFilter(asObservable(filter));
1709
- }
1710
- if (defaultScheduleDays != null) {
1711
- this._defaultWeekSub.subscription = this.dbxCalendarScheduleSelectionStore.setDefaultScheduleDays(asObservable(defaultScheduleDays));
1712
- }
1713
- if (minMaxDateRange != null) {
1714
- this._minMaxDateRangeSub.subscription = this.dbxCalendarScheduleSelectionStore.setMinMaxDateRange(asObservable(minMaxDateRange));
1715
- }
1716
- if (exclusions != null) {
1717
- this._exclusionsSub.subscription = this.dbxCalendarScheduleSelectionStore.setExclusions(asObservable(exclusions));
1718
- }
1719
- if (outputTimezone != null) {
1720
- this.dbxCalendarScheduleSelectionStore.setOutputTimezone(asObservable(this.outputTimezone));
1721
- }
1722
- if (this.initialSelectionState !== undefined) {
1723
- this.dbxCalendarScheduleSelectionStore.setInitialSelectionState(this.initialSelectionState);
1724
- }
1725
- if (this.computeSelectionResultRelativeToFilter != null) {
1726
- this.dbxCalendarScheduleSelectionStore.setComputeSelectionResultRelativeToFilter(this.computeSelectionResultRelativeToFilter);
1727
- }
1728
- if (this.cellContentFactory != null) {
1729
- this.dbxCalendarScheduleSelectionStore.setCellContentFactory(this.cellContentFactory);
1730
- }
1731
- }
1732
- ngOnDestroy() {
1733
- super.ngOnDestroy();
1734
- this._syncSub.destroy();
1735
- this._valueSub.destroy();
1736
- this._filterSub.destroy();
1737
- this._timezoneSub.destroy();
1738
- this._minMaxDateRangeSub.destroy();
1739
- this._exclusionsSub.destroy();
1740
- this._formControlObs.complete();
1741
- }
1742
- }
1743
- DbxFormCalendarDateScheduleRangeFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarDateScheduleRangeFieldComponent, deps: [{ token: i1$1.CompactContextStore, optional: true }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1744
- DbxFormCalendarDateScheduleRangeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormCalendarDateScheduleRangeFieldComponent, selector: "ng-component", providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
1745
- <div class="dbx-schedule-selection-field">
1746
- <dbx-schedule-selection-calendar-date-range [openPickerOnTextClick]="openPickerOnTextClick" [showCustomize]="showCustomize" [required]="required" [disabled]="isReadonlyOrDisabled" [label]="label" [hint]="description">
1747
- <dbx-schedule-selection-calendar-date-dialog-button customizeButton [disabled]="disableCustomize$ | async" [contentConfig]="dialogContentConfig"></dbx-schedule-selection-calendar-date-dialog-button>
1748
- <dbx-injection [config]="customDetailsConfig"></dbx-injection>
1749
- </dbx-schedule-selection-calendar-date-range>
1750
- </div>
1751
- `, isInline: true, dependencies: [{ kind: "component", type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: ["openPickerOnTextClick", "label", "hint", "disabled", "showCustomize", "required"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDialogButtonComponent, selector: "dbx-schedule-selection-calendar-date-dialog-button", inputs: ["buttonText", "disabled", "contentConfig", "closeConfig"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
1752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarDateScheduleRangeFieldComponent, decorators: [{
1753
- type: Component,
1754
- args: [{
1755
- template: `
1756
- <div class="dbx-schedule-selection-field">
1757
- <dbx-schedule-selection-calendar-date-range [openPickerOnTextClick]="openPickerOnTextClick" [showCustomize]="showCustomize" [required]="required" [disabled]="isReadonlyOrDisabled" [label]="label" [hint]="description">
1758
- <dbx-schedule-selection-calendar-date-dialog-button customizeButton [disabled]="disableCustomize$ | async" [contentConfig]="dialogContentConfig"></dbx-schedule-selection-calendar-date-dialog-button>
1759
- <dbx-injection [config]="customDetailsConfig"></dbx-injection>
1760
- </dbx-schedule-selection-calendar-date-range>
1761
- </div>
1762
- `,
1763
- providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()]
1764
- }]
1765
- }], ctorParameters: function () {
1766
- return [{ type: i1$1.CompactContextStore, decorators: [{
1767
- type: Optional
1768
- }] }, { type: DbxCalendarScheduleSelectionStore }, { type: i0.NgZone }];
1769
- } });
1770
-
1771
- const declarations = [
1772
- //
1773
- DbxScheduleSelectionCalendarComponent,
1774
- DbxScheduleSelectionCalendarDateDaysComponent,
1775
- DbxScheduleSelectionCalendarDateDaysFormComponent,
1776
- DbxScheduleSelectionCalendarDateRangeComponent,
1777
- DbxScheduleSelectionCalendarDatePopoverButtonComponent,
1778
- DbxScheduleSelectionCalendarCellComponent,
1779
- DbxScheduleSelectionCalendarDatePopoverComponent,
1780
- DbxScheduleSelectionCalendarDatePopoverContentComponent,
1781
- DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
1782
- DbxScheduleSelectionCalendarDateDialogComponent,
1783
- DbxScheduleSelectionCalendarDateDialogButtonComponent,
1784
- DbxScheduleSelectionCalendarSelectionToggleButtonComponent
1785
- ];
1786
- class DbxFormCalendarModule {
1787
- }
1788
- DbxFormCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1789
- DbxFormCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, declarations: [
1790
- //
1791
- DbxScheduleSelectionCalendarComponent,
1792
- DbxScheduleSelectionCalendarDateDaysComponent,
1793
- DbxScheduleSelectionCalendarDateDaysFormComponent,
1794
- DbxScheduleSelectionCalendarDateRangeComponent,
1795
- DbxScheduleSelectionCalendarDatePopoverButtonComponent,
1796
- DbxScheduleSelectionCalendarCellComponent,
1797
- DbxScheduleSelectionCalendarDatePopoverComponent,
1798
- DbxScheduleSelectionCalendarDatePopoverContentComponent,
1799
- DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
1800
- DbxScheduleSelectionCalendarDateDialogComponent,
1801
- DbxScheduleSelectionCalendarDateDialogButtonComponent,
1802
- DbxScheduleSelectionCalendarSelectionToggleButtonComponent
1803
- ], imports: [
1804
- //
1805
- DbxInjectionComponentModule,
1806
- DbxContentLayoutModule,
1807
- DbxTextModule,
1808
- DbxActionModule,
1809
- DbxFormModule,
1810
- DbxFormlyModule,
1811
- DbxCalendarModule,
1812
- CommonModule,
1813
- MatIconModule,
1814
- MatButtonModule,
1815
- FormsModule,
1816
- ReactiveFormsModule,
1817
- MatFormFieldModule,
1818
- MatButtonToggleModule,
1819
- DbxButtonModule,
1820
- MatDatepickerModule,
1821
- DbxDialogInteractionModule,
1822
- DbxPopoverInteractionModule,
1823
- CalendarModule,
1824
- CalendarDayModule,
1825
- FlexLayoutModule,
1826
- CalendarWeekModule,
1827
- DbxDatePipeModule
1828
- ], exports: [
1829
- //
1830
- DbxScheduleSelectionCalendarComponent,
1831
- DbxScheduleSelectionCalendarDateDaysComponent,
1832
- DbxScheduleSelectionCalendarDateDaysFormComponent,
1833
- DbxScheduleSelectionCalendarDateRangeComponent,
1834
- DbxScheduleSelectionCalendarDatePopoverButtonComponent,
1835
- DbxScheduleSelectionCalendarCellComponent,
1836
- DbxScheduleSelectionCalendarDatePopoverComponent,
1837
- DbxScheduleSelectionCalendarDatePopoverContentComponent,
1838
- DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
1839
- DbxScheduleSelectionCalendarDateDialogComponent,
1840
- DbxScheduleSelectionCalendarDateDialogButtonComponent,
1841
- DbxScheduleSelectionCalendarSelectionToggleButtonComponent
1842
- ] });
1843
- DbxFormCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, imports: [
1844
- //
1845
- DbxInjectionComponentModule,
1846
- DbxContentLayoutModule,
1847
- DbxTextModule,
1848
- DbxActionModule,
1849
- DbxFormModule,
1850
- DbxFormlyModule,
1851
- DbxCalendarModule,
1852
- CommonModule,
1853
- MatIconModule,
1854
- MatButtonModule,
1855
- FormsModule,
1856
- ReactiveFormsModule,
1857
- MatFormFieldModule,
1858
- MatButtonToggleModule,
1859
- DbxButtonModule,
1860
- MatDatepickerModule,
1861
- DbxDialogInteractionModule,
1862
- DbxPopoverInteractionModule,
1863
- CalendarModule,
1864
- CalendarDayModule,
1865
- FlexLayoutModule,
1866
- CalendarWeekModule,
1867
- DbxDatePipeModule
1868
- ] });
1869
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, decorators: [{
1870
- type: NgModule,
1871
- args: [{
1872
- imports: [
1873
- //
1874
- DbxInjectionComponentModule,
1875
- DbxContentLayoutModule,
1876
- DbxTextModule,
1877
- DbxActionModule,
1878
- DbxFormModule,
1879
- DbxFormlyModule,
1880
- DbxCalendarModule,
1881
- CommonModule,
1882
- MatIconModule,
1883
- MatButtonModule,
1884
- FormsModule,
1885
- ReactiveFormsModule,
1886
- MatFormFieldModule,
1887
- MatButtonToggleModule,
1888
- DbxButtonModule,
1889
- MatDatepickerModule,
1890
- DbxDialogInteractionModule,
1891
- DbxPopoverInteractionModule,
1892
- CalendarModule,
1893
- CalendarDayModule,
1894
- FlexLayoutModule,
1895
- CalendarWeekModule,
1896
- DbxDatePipeModule
1897
- ],
1898
- declarations,
1899
- exports: declarations
1900
- }]
1901
- }] });
1902
-
1903
- class DbxFormDateScheduleRangeFieldModule {
1904
- }
1905
- DbxFormDateScheduleRangeFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1906
- DbxFormDateScheduleRangeFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, declarations: [DbxFormCalendarDateScheduleRangeFieldComponent], imports: [DbxInjectionComponentModule,
1907
- CommonModule,
1908
- MatIconModule,
1909
- DbxFormCalendarModule,
1910
- MatButtonModule,
1911
- DbxTextModule,
1912
- FormsModule,
1913
- ReactiveFormsModule,
1914
- MatInputModule, i1$3.FormlyModule] });
1915
- DbxFormDateScheduleRangeFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, imports: [DbxInjectionComponentModule,
1916
- CommonModule,
1917
- MatIconModule,
1918
- DbxFormCalendarModule,
1919
- MatButtonModule,
1920
- DbxTextModule,
1921
- FormsModule,
1922
- ReactiveFormsModule,
1923
- MatInputModule,
1924
- FormlyModule.forChild({
1925
- types: [{ name: 'date-schedule-range', component: DbxFormCalendarDateScheduleRangeFieldComponent }]
1926
- })] });
1927
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, decorators: [{
1928
- type: NgModule,
1929
- args: [{
1930
- imports: [
1931
- DbxInjectionComponentModule,
1932
- CommonModule,
1933
- MatIconModule,
1934
- DbxFormCalendarModule,
1935
- MatButtonModule,
1936
- DbxTextModule,
1937
- FormsModule,
1938
- ReactiveFormsModule,
1939
- MatInputModule,
1940
- FormlyModule.forChild({
1941
- types: [{ name: 'date-schedule-range', component: DbxFormCalendarDateScheduleRangeFieldComponent }]
1942
- })
1943
- ],
1944
- declarations: [DbxFormCalendarDateScheduleRangeFieldComponent]
1945
- }]
1946
- }] });
1947
-
1948
- // export * from './selection';
1949
-
1950
- /**
1951
- * Generated bundle index. Do not edit.
1952
- */
1953
-
1954
- export { CalendarScheduleSelectionDayState, DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CLOSE_CONFIG_TOKEN, DEFAULT_DBX_SCHEDULE_SELECTION_CALENDAR_DATE_POPUP_CONTENT_CONFIG_TOKEN, DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY, DbxCalendarScheduleSelectionStore, DbxCalendarScheduleSelectionStoreInjectionBlockDirective, DbxCalendarScheduleSelectionStoreProviderBlock, DbxFormCalendarDateScheduleRangeFieldComponent, DbxFormCalendarModule, DbxFormDateScheduleRangeFieldModule, DbxScheduleSelectionCalendarCellComponent, DbxScheduleSelectionCalendarComponent, DbxScheduleSelectionCalendarDateDaysComponent, DbxScheduleSelectionCalendarDateDaysFormComponent, DbxScheduleSelectionCalendarDateDialogButtonComponent, DbxScheduleSelectionCalendarDateDialogComponent, DbxScheduleSelectionCalendarDatePopoverButtonComponent, DbxScheduleSelectionCalendarDatePopoverComponent, DbxScheduleSelectionCalendarDatePopoverContentComponent, DbxScheduleSelectionCalendarDateRangeComponent, DbxScheduleSelectionCalendarSelectionToggleButtonComponent, calendarScheduleMaxDate, calendarScheduleMinAndMaxDateRange, calendarScheduleMinDate, calendarScheduleStartBeingUsedFromFilter, computeCalendarScheduleSelectionDateCellRange, computeCalendarScheduleSelectionRange, computeScheduleSelectionRangeAndExclusion, computeScheduleSelectionValue, dateScheduleRangeField, dbxScheduleSelectionCalendarBeforeMonthViewRenderFactory, dbxScheduleSelectionCalendarDateDaysFormDayFields, dbxScheduleSelectionCalendarDateDaysFormFields, defaultCalendarScheduleSelectionCellContentFactory, finalizeNewCalendarScheduleSelectionState, finalizeUpdateStateWithChangedScheduleDays, initialCalendarScheduleSelectionState, isEnabledDayInCalendarScheduleSelectionState, noSelectionCalendarScheduleSelectionState, provideCalendarScheduleSelectionStoreIfParentIsUnavailable, updateStateWithChangedDates, updateStateWithChangedDefaultScheduleDays, updateStateWithChangedRange, updateStateWithChangedScheduleDays, updateStateWithComputeSelectionResultRelativeToFilter, updateStateWithDateCellScheduleRangeValue, updateStateWithExclusions, updateStateWithFilter, updateStateWithInitialSelectionState, updateStateWithMinMaxDateRange, updateStateWithSelectionMode, updateStateWithTimezoneValue };
1955
- //# sourceMappingURL=dereekb-dbx-form-calendar.mjs.map