@energinet/watt 4.2.4 → 4.2.6

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 (233) hide show
  1. package/esm2022/badge/watt-badge.component.js +3 -3
  2. package/esm2022/badge/watt-badge.component.js.map +1 -1
  3. package/esm2022/breadcrumbs/watt-breadcrumbs.component.js +6 -6
  4. package/esm2022/breadcrumbs/watt-breadcrumbs.component.js.map +1 -1
  5. package/esm2022/button/watt-button.component.js +3 -3
  6. package/esm2022/button/watt-button.component.js.map +1 -1
  7. package/esm2022/card/watt-card-title.component.js +3 -3
  8. package/esm2022/card/watt-card-title.component.js.map +1 -1
  9. package/esm2022/card/watt-card.component.js +3 -3
  10. package/esm2022/card/watt-card.component.js.map +1 -1
  11. package/esm2022/checkbox/watt-checkbox.component.js +3 -3
  12. package/esm2022/checkbox/watt-checkbox.component.js.map +1 -1
  13. package/esm2022/chip/watt-action-chip.component.js +3 -3
  14. package/esm2022/chip/watt-action-chip.component.js.map +1 -1
  15. package/esm2022/chip/watt-chip.component.js +3 -3
  16. package/esm2022/chip/watt-chip.component.js.map +1 -1
  17. package/esm2022/chip/watt-chip.directive.js +3 -3
  18. package/esm2022/chip/watt-chip.directive.js.map +1 -1
  19. package/esm2022/chip/watt-date-chip.component.js +3 -3
  20. package/esm2022/chip/watt-date-chip.component.js.map +1 -1
  21. package/esm2022/chip/watt-date-range-chip.component.js +6 -6
  22. package/esm2022/chip/watt-date-range-chip.component.js.map +1 -1
  23. package/esm2022/chip/watt-filter-chip.component.js +3 -3
  24. package/esm2022/chip/watt-filter-chip.component.js.map +1 -1
  25. package/esm2022/chip/watt-menu-chip.component.js +3 -3
  26. package/esm2022/chip/watt-menu-chip.component.js.map +1 -1
  27. package/esm2022/clipboard/watt-clipboard-intl.service.js +3 -3
  28. package/esm2022/clipboard/watt-clipboard-intl.service.js.map +1 -1
  29. package/esm2022/clipboard/watt-copy-to-clipboard.directive.js +3 -3
  30. package/esm2022/clipboard/watt-copy-to-clipboard.directive.js.map +1 -1
  31. package/esm2022/code/watt-code-intl.service.js +3 -3
  32. package/esm2022/code/watt-code-intl.service.js.map +1 -1
  33. package/esm2022/code/watt-code.component.js +3 -3
  34. package/esm2022/code/watt-code.component.js.map +1 -1
  35. package/esm2022/core/breakpoints/breakpoints-observer.js +3 -3
  36. package/esm2022/core/breakpoints/breakpoints-observer.js.map +1 -1
  37. package/esm2022/core/color/color-helper.service.js +3 -3
  38. package/esm2022/core/color/color-helper.service.js.map +1 -1
  39. package/esm2022/core/date/watt-date.pipe.js +3 -3
  40. package/esm2022/core/date/watt-date.pipe.js.map +1 -1
  41. package/esm2022/core/date/watt-locale.service.js +3 -3
  42. package/esm2022/core/date/watt-locale.service.js.map +1 -1
  43. package/esm2022/data/watt-data-actions.component.js +3 -3
  44. package/esm2022/data/watt-data-actions.component.js.map +1 -1
  45. package/esm2022/data/watt-data-filters.component.js +3 -3
  46. package/esm2022/data/watt-data-filters.component.js.map +1 -1
  47. package/esm2022/data/watt-data-intl.service.js +3 -3
  48. package/esm2022/data/watt-data-intl.service.js.map +1 -1
  49. package/esm2022/data/watt-data-table.component.js +3 -3
  50. package/esm2022/data/watt-data-table.component.js.map +1 -1
  51. package/esm2022/datetime-field/watt-datetime-field.component.js +3 -3
  52. package/esm2022/datetime-field/watt-datetime-field.component.js.map +1 -1
  53. package/esm2022/description-list/watt-description-list-item.component.js +3 -3
  54. package/esm2022/description-list/watt-description-list-item.component.js.map +1 -1
  55. package/esm2022/description-list/watt-description-list.component.js +3 -3
  56. package/esm2022/description-list/watt-description-list.component.js.map +1 -1
  57. package/esm2022/drawer/watt-drawer-actions.component.js +3 -3
  58. package/esm2022/drawer/watt-drawer-actions.component.js.map +1 -1
  59. package/esm2022/drawer/watt-drawer-content.component.js +3 -3
  60. package/esm2022/drawer/watt-drawer-content.component.js.map +1 -1
  61. package/esm2022/drawer/watt-drawer-heading.component.js +3 -3
  62. package/esm2022/drawer/watt-drawer-heading.component.js.map +1 -1
  63. package/esm2022/drawer/watt-drawer-topbar.component.js +3 -3
  64. package/esm2022/drawer/watt-drawer-topbar.component.js.map +1 -1
  65. package/esm2022/drawer/watt-drawer.component.js +3 -3
  66. package/esm2022/drawer/watt-drawer.component.js.map +1 -1
  67. package/esm2022/dropdown/watt-dropdown.component.js +3 -3
  68. package/esm2022/dropdown/watt-dropdown.component.js.map +1 -1
  69. package/esm2022/dropzone/watt-dropzone-intl.js +3 -3
  70. package/esm2022/dropzone/watt-dropzone-intl.js.map +1 -1
  71. package/esm2022/dropzone/watt-dropzone-validators.js +6 -6
  72. package/esm2022/dropzone/watt-dropzone-validators.js.map +1 -1
  73. package/esm2022/dropzone/watt-dropzone.js +3 -3
  74. package/esm2022/dropzone/watt-dropzone.js.map +1 -1
  75. package/esm2022/empty-state/icons/explore.js +3 -3
  76. package/esm2022/empty-state/icons/explore.js.map +1 -1
  77. package/esm2022/empty-state/icons/no-results.js +3 -3
  78. package/esm2022/empty-state/icons/no-results.js.map +1 -1
  79. package/esm2022/empty-state/icons/not-found.js +3 -3
  80. package/esm2022/empty-state/icons/not-found.js.map +1 -1
  81. package/esm2022/empty-state/icons/power.js +3 -3
  82. package/esm2022/empty-state/icons/power.js.map +1 -1
  83. package/esm2022/empty-state/watt-empty-state.component.js +3 -3
  84. package/esm2022/empty-state/watt-empty-state.component.js.map +1 -1
  85. package/esm2022/expandable-card/watt-expandable-card.component.js +9 -9
  86. package/esm2022/expandable-card/watt-expandable-card.component.js.map +1 -1
  87. package/esm2022/field/watt-field-error.component.js +3 -3
  88. package/esm2022/field/watt-field-error.component.js.map +1 -1
  89. package/esm2022/field/watt-field-hint.component.js +3 -3
  90. package/esm2022/field/watt-field-hint.component.js.map +1 -1
  91. package/esm2022/field/watt-field-intl.service.js +3 -3
  92. package/esm2022/field/watt-field-intl.service.js.map +1 -1
  93. package/esm2022/field/watt-field-warning.component.js +3 -3
  94. package/esm2022/field/watt-field-warning.component.js.map +1 -1
  95. package/esm2022/field/watt-field.component.js +3 -3
  96. package/esm2022/field/watt-field.component.js.map +1 -1
  97. package/esm2022/file-field/watt-file-field.component.js +3 -3
  98. package/esm2022/file-field/watt-file-field.component.js.map +1 -1
  99. package/esm2022/icon/flags/watt-flag-ch.js +3 -3
  100. package/esm2022/icon/flags/watt-flag-ch.js.map +1 -1
  101. package/esm2022/icon/flags/watt-flag-de.js +3 -3
  102. package/esm2022/icon/flags/watt-flag-de.js.map +1 -1
  103. package/esm2022/icon/flags/watt-flag-dk.js +3 -3
  104. package/esm2022/icon/flags/watt-flag-dk.js.map +1 -1
  105. package/esm2022/icon/flags/watt-flag-fi.js +3 -3
  106. package/esm2022/icon/flags/watt-flag-fi.js.map +1 -1
  107. package/esm2022/icon/flags/watt-flag-gb.js +3 -3
  108. package/esm2022/icon/flags/watt-flag-gb.js.map +1 -1
  109. package/esm2022/icon/flags/watt-flag-nl.js +3 -3
  110. package/esm2022/icon/flags/watt-flag-nl.js.map +1 -1
  111. package/esm2022/icon/flags/watt-flag-no.js +3 -3
  112. package/esm2022/icon/flags/watt-flag-no.js.map +1 -1
  113. package/esm2022/icon/flags/watt-flag-pl.js +3 -3
  114. package/esm2022/icon/flags/watt-flag-pl.js.map +1 -1
  115. package/esm2022/icon/flags/watt-flag-se.js +3 -3
  116. package/esm2022/icon/flags/watt-flag-se.js.map +1 -1
  117. package/esm2022/icon/flags/watt-flag.js +3 -3
  118. package/esm2022/icon/flags/watt-flag.js.map +1 -1
  119. package/esm2022/icon/icon.component.js +3 -3
  120. package/esm2022/icon/icon.component.js.map +1 -1
  121. package/esm2022/menu/watt-menu-group.component.js +3 -3
  122. package/esm2022/menu/watt-menu-group.component.js.map +1 -1
  123. package/esm2022/menu/watt-menu-item.component.js +3 -3
  124. package/esm2022/menu/watt-menu-item.component.js.map +1 -1
  125. package/esm2022/menu/watt-menu-trigger.directive.js +3 -3
  126. package/esm2022/menu/watt-menu-trigger.directive.js.map +1 -1
  127. package/esm2022/menu/watt-menu.component.js +3 -3
  128. package/esm2022/menu/watt-menu.component.js.map +1 -1
  129. package/esm2022/modal/watt-modal.component.js +6 -6
  130. package/esm2022/modal/watt-modal.component.js.map +1 -1
  131. package/esm2022/modal/watt-modal.service.js +3 -3
  132. package/esm2022/modal/watt-modal.service.js.map +1 -1
  133. package/esm2022/paginator/watt-paginator-intl.service.js +3 -3
  134. package/esm2022/paginator/watt-paginator-intl.service.js.map +1 -1
  135. package/esm2022/paginator/watt-paginator.component.js +3 -3
  136. package/esm2022/paginator/watt-paginator.component.js.map +1 -1
  137. package/esm2022/phone-field/watt-phone-field-intl.service.js +3 -3
  138. package/esm2022/phone-field/watt-phone-field-intl.service.js.map +1 -1
  139. package/esm2022/phone-field/watt-phone-field.component.js +3 -3
  140. package/esm2022/phone-field/watt-phone-field.component.js.map +1 -1
  141. package/esm2022/picker/__shared/placeholder-mask/watt-placeholder-mask.component.js +3 -3
  142. package/esm2022/picker/__shared/placeholder-mask/watt-placeholder-mask.component.js.map +1 -1
  143. package/esm2022/picker/__shared/watt-picker-base.js +3 -3
  144. package/esm2022/picker/__shared/watt-picker-base.js.map +1 -1
  145. package/esm2022/picker/datepicker/watt-datepicker-intl.service.js +3 -3
  146. package/esm2022/picker/datepicker/watt-datepicker-intl.service.js.map +1 -1
  147. package/esm2022/picker/datepicker/watt-datepicker.component.js +3 -3
  148. package/esm2022/picker/datepicker/watt-datepicker.component.js.map +1 -1
  149. package/esm2022/picker/timepicker/watt-timepicker.component.js +3 -3
  150. package/esm2022/picker/timepicker/watt-timepicker.component.js.map +1 -1
  151. package/esm2022/progress-tracker/watt-progress-tracker-step.component.js +3 -3
  152. package/esm2022/progress-tracker/watt-progress-tracker-step.component.js.map +1 -1
  153. package/esm2022/progress-tracker/watt-progress-tracker.component.js +3 -3
  154. package/esm2022/progress-tracker/watt-progress-tracker.component.js.map +1 -1
  155. package/esm2022/query-params/watt-query-params.directive.js +3 -3
  156. package/esm2022/query-params/watt-query-params.directive.js.map +1 -1
  157. package/esm2022/radio/watt-radio-group.component.js +3 -3
  158. package/esm2022/radio/watt-radio-group.component.js.map +1 -1
  159. package/esm2022/radio/watt-radio.component.js +3 -3
  160. package/esm2022/radio/watt-radio.component.js.map +1 -1
  161. package/esm2022/search/watt-search.component.js +3 -3
  162. package/esm2022/search/watt-search.component.js.map +1 -1
  163. package/esm2022/segmented-buttons/watt-segmented-button.component.js +3 -3
  164. package/esm2022/segmented-buttons/watt-segmented-button.component.js.map +1 -1
  165. package/esm2022/segmented-buttons/watt-segmented-buttons.component.js +3 -3
  166. package/esm2022/segmented-buttons/watt-segmented-buttons.component.js.map +1 -1
  167. package/esm2022/shell/nav-list/watt-expand-on-active-link.directive.js +3 -3
  168. package/esm2022/shell/nav-list/watt-expand-on-active-link.directive.js.map +1 -1
  169. package/esm2022/shell/nav-list/watt-nav-list-item.component.js +3 -3
  170. package/esm2022/shell/nav-list/watt-nav-list-item.component.js.map +1 -1
  171. package/esm2022/shell/nav-list/watt-nav-list.component.js +3 -3
  172. package/esm2022/shell/nav-list/watt-nav-list.component.js.map +1 -1
  173. package/esm2022/shell/shell.component.js +3 -3
  174. package/esm2022/shell/shell.component.js.map +1 -1
  175. package/esm2022/slide-toggle/watt-slide-toggle.component.js +3 -3
  176. package/esm2022/slide-toggle/watt-slide-toggle.component.js.map +1 -1
  177. package/esm2022/slider/watt-slider.component.js +3 -3
  178. package/esm2022/slider/watt-slider.component.js.map +1 -1
  179. package/esm2022/spinner/watt-spinner.component.js +3 -3
  180. package/esm2022/spinner/watt-spinner.component.js.map +1 -1
  181. package/esm2022/stepper/watt-stepper-step.component.js +3 -3
  182. package/esm2022/stepper/watt-stepper-step.component.js.map +1 -1
  183. package/esm2022/stepper/watt-stepper.component.js +3 -3
  184. package/esm2022/stepper/watt-stepper.component.js.map +1 -1
  185. package/esm2022/table/watt-table.component.js +9 -9
  186. package/esm2022/table/watt-table.component.js.map +1 -1
  187. package/esm2022/tabs/watt-link-tab.component.js +3 -3
  188. package/esm2022/tabs/watt-link-tab.component.js.map +1 -1
  189. package/esm2022/tabs/watt-link-tabs.component.js +3 -3
  190. package/esm2022/tabs/watt-link-tabs.component.js.map +1 -1
  191. package/esm2022/tabs/watt-tab.component.js +3 -3
  192. package/esm2022/tabs/watt-tab.component.js.map +1 -1
  193. package/esm2022/tabs/watt-tabs-action.component.js +3 -3
  194. package/esm2022/tabs/watt-tabs-action.component.js.map +1 -1
  195. package/esm2022/tabs/watt-tabs.component.js +3 -3
  196. package/esm2022/tabs/watt-tabs.component.js.map +1 -1
  197. package/esm2022/text-field/watt-text-field.component.js +3 -3
  198. package/esm2022/text-field/watt-text-field.component.js.map +1 -1
  199. package/esm2022/textarea-field/watt-textarea-field.component.js +3 -3
  200. package/esm2022/textarea-field/watt-textarea-field.component.js.map +1 -1
  201. package/esm2022/toast/watt-toast.component.js +3 -3
  202. package/esm2022/toast/watt-toast.component.js.map +1 -1
  203. package/esm2022/toast/watt-toast.service.js +3 -3
  204. package/esm2022/toast/watt-toast.service.js.map +1 -1
  205. package/esm2022/tooltip/watt-tooltip.component.js +3 -3
  206. package/esm2022/tooltip/watt-tooltip.component.js.map +1 -1
  207. package/esm2022/tooltip/watt-tooltip.directive.js +3 -3
  208. package/esm2022/tooltip/watt-tooltip.directive.js.map +1 -1
  209. package/esm2022/utils/css/css-custom-properties.service.js +3 -3
  210. package/esm2022/utils/css/css-custom-properties.service.js.map +1 -1
  211. package/esm2022/utils/intersection-observer/watt-intersection-observer.service.js +3 -3
  212. package/esm2022/utils/intersection-observer/watt-intersection-observer.service.js.map +1 -1
  213. package/esm2022/utils/resize-observer/watt-resize-observer.directive.js +3 -3
  214. package/esm2022/utils/resize-observer/watt-resize-observer.directive.js.map +1 -1
  215. package/esm2022/utils/resize-observer/watt-resize-observer.service.js +3 -3
  216. package/esm2022/utils/resize-observer/watt-resize-observer.service.js.map +1 -1
  217. package/esm2022/validation-message/watt-validation-message.component.js +3 -3
  218. package/esm2022/validation-message/watt-validation-message.component.js.map +1 -1
  219. package/esm2022/vater/vater-flex.component.js +3 -3
  220. package/esm2022/vater/vater-flex.component.js.map +1 -1
  221. package/esm2022/vater/vater-layout.directive.js +3 -3
  222. package/esm2022/vater/vater-layout.directive.js.map +1 -1
  223. package/esm2022/vater/vater-spacer.component.js +3 -3
  224. package/esm2022/vater/vater-spacer.component.js.map +1 -1
  225. package/esm2022/vater/vater-stack.component.js +3 -3
  226. package/esm2022/vater/vater-stack.component.js.map +1 -1
  227. package/esm2022/vater/vater-utility.directive.js +3 -3
  228. package/esm2022/vater/vater-utility.directive.js.map +1 -1
  229. package/esm2022/year-field/watt-year-field.component.js +3 -3
  230. package/esm2022/year-field/watt-year-field.component.js.map +1 -1
  231. package/esm2022/yearmonth-field/watt-yearmonth-field.component.js +3 -3
  232. package/esm2022/yearmonth-field/watt-yearmonth-field.component.js.map +1 -1
  233. package/package.json +8 -8
@@ -44,10 +44,10 @@ export class VaterLayoutDirective {
44
44
  this.justifyClass(),
45
45
  this.offsetClass(),
46
46
  ].filter(Boolean), ...(ngDevMode ? [{ debugName: "class" }] : []));
47
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
48
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.6", type: VaterLayoutDirective, isStandalone: true, inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()", "class.vater-wrap": "wrap()", "attr.align": "null", "attr.direction": "null", "attr.gap": "null", "attr.justify": "null", "attr.offset": "null", "attr.wrap": "null" } }, ngImport: i0 });
47
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
48
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: VaterLayoutDirective, isStandalone: true, inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()", "class.vater-wrap": "wrap()", "attr.align": "null", "attr.direction": "null", "attr.gap": "null", "attr.justify": "null", "attr.offset": "null", "attr.wrap": "null" } }, ngImport: i0 });
49
49
  }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterLayoutDirective, decorators: [{
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterLayoutDirective, decorators: [{
51
51
  type: Directive,
52
52
  args: [{
53
53
  host: {
@@ -1 +1 @@
1
- {"version":3,"file":"vater-layout.directive.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-layout.directive.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;AAe7E,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,EAAE;QACf,IAAI,CAAC,YAAY,EAAE;QACnB,IAAI,CAAC,WAAW,EAAE;KACnB,CAAC,MAAM,CAAC,OAAO,CAAC,iDAClB,CAAC;uGAjCS,oBAAoB;2FAApB,oBAAoB;;2FAApB,oBAAoB;kBAZhC,SAAS;mBAAC;oBACT,IAAI,EAAE;wBACJ,SAAS,EAAE,SAAS;wBACpB,oBAAoB,EAAE,QAAQ;wBAC9B,cAAc,EAAE,MAAM;wBACtB,kBAAkB,EAAE,MAAM;wBAC1B,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,MAAM;wBACxB,eAAe,EAAE,MAAM;wBACvB,aAAa,EAAE,MAAM;qBACtB;iBACF","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { booleanAttribute, computed, Directive, input } from '@angular/core';\nimport { Align, Direction, Justify, Spacing } from './types';\n\n@Directive({\n host: {\n '[class]': 'class()',\n '[class.vater-wrap]': 'wrap()',\n '[attr.align]': 'null',\n '[attr.direction]': 'null',\n '[attr.gap]': 'null',\n '[attr.justify]': 'null',\n '[attr.offset]': 'null',\n '[attr.wrap]': 'null',\n },\n})\nexport class VaterLayoutDirective {\n /** Cross axis alignment of the flex items. */\n align = input<Align>();\n\n /** Direction of the flex items. Defaults to `column`. */\n direction = input<Direction>('column');\n\n /** Spacing between the flex items. */\n gap = input<Spacing>();\n\n /** Main axis alignment of the flex items. */\n justify = input<Justify>();\n\n /** Offset to apply along the main axis. */\n offset = input<Spacing>();\n\n /** Whether the flex items should wrap. */\n wrap = input(false, { transform: booleanAttribute });\n\n // Computed class names\n protected alignClass = computed(() => this.align() && `vater-align-${this.align()}`);\n protected directionClass = computed(() => this.direction() && `vater-${this.direction()}`);\n protected gapClass = computed(() => this.gap() && `vater-gap-${this.gap()}`);\n protected justifyClass = computed(() => this.justify() && `vater-justify-${this.justify()}`);\n protected offsetClass = computed(() => this.offset() && `vater-offset-${this.offset()}`);\n protected class = computed(() =>\n [\n this.alignClass(),\n this.directionClass(),\n this.gapClass(),\n this.justifyClass(),\n this.offsetClass(),\n ].filter(Boolean)\n );\n}\n"]}
1
+ {"version":3,"file":"vater-layout.directive.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-layout.directive.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;AAe7E,MAAM,OAAO,oBAAoB;IAC/B,8CAA8C;IAC9C,KAAK,GAAG,KAAK,2DAAS,CAAC;IAEvB,yDAAyD;IACzD,SAAS,GAAG,KAAK,CAAY,QAAQ,qDAAC,CAAC;IAEvC,sCAAsC;IACtC,GAAG,GAAG,KAAK,yDAAW,CAAC;IAEvB,6CAA6C;IAC7C,OAAO,GAAG,KAAK,6DAAW,CAAC;IAE3B,2CAA2C;IAC3C,MAAM,GAAG,KAAK,4DAAW,CAAC;IAE1B,0CAA0C;IAC1C,IAAI,GAAG,KAAK,CAAC,KAAK,wCAAI,SAAS,EAAE,gBAAgB,OAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC,CAAC;IAErD,uBAAuB;IACb,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,eAAe,IAAI,CAAC,KAAK,EAAE,EAAE,sDAAC,CAAC;IAC3E,cAAc,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,SAAS,IAAI,CAAC,SAAS,EAAE,EAAE,0DAAC,CAAC;IACjF,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE,oDAAC,CAAC;IACnE,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,iBAAiB,IAAI,CAAC,OAAO,EAAE,EAAE,wDAAC,CAAC;IACnF,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,gBAAgB,IAAI,CAAC,MAAM,EAAE,EAAE,uDAAC,CAAC;IAC/E,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC9B;QACE,IAAI,CAAC,UAAU,EAAE;QACjB,IAAI,CAAC,cAAc,EAAE;QACrB,IAAI,CAAC,QAAQ,EAAE;QACf,IAAI,CAAC,YAAY,EAAE;QACnB,IAAI,CAAC,WAAW,EAAE;KACnB,CAAC,MAAM,CAAC,OAAO,CAAC,iDAClB,CAAC;wGAjCS,oBAAoB;4FAApB,oBAAoB;;4FAApB,oBAAoB;kBAZhC,SAAS;mBAAC;oBACT,IAAI,EAAE;wBACJ,SAAS,EAAE,SAAS;wBACpB,oBAAoB,EAAE,QAAQ;wBAC9B,cAAc,EAAE,MAAM;wBACtB,kBAAkB,EAAE,MAAM;wBAC1B,YAAY,EAAE,MAAM;wBACpB,gBAAgB,EAAE,MAAM;wBACxB,eAAe,EAAE,MAAM;wBACvB,aAAa,EAAE,MAAM;qBACtB;iBACF","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { booleanAttribute, computed, Directive, input } from '@angular/core';\nimport { Align, Direction, Justify, Spacing } from './types';\n\n@Directive({\n host: {\n '[class]': 'class()',\n '[class.vater-wrap]': 'wrap()',\n '[attr.align]': 'null',\n '[attr.direction]': 'null',\n '[attr.gap]': 'null',\n '[attr.justify]': 'null',\n '[attr.offset]': 'null',\n '[attr.wrap]': 'null',\n },\n})\nexport class VaterLayoutDirective {\n /** Cross axis alignment of the flex items. */\n align = input<Align>();\n\n /** Direction of the flex items. Defaults to `column`. */\n direction = input<Direction>('column');\n\n /** Spacing between the flex items. */\n gap = input<Spacing>();\n\n /** Main axis alignment of the flex items. */\n justify = input<Justify>();\n\n /** Offset to apply along the main axis. */\n offset = input<Spacing>();\n\n /** Whether the flex items should wrap. */\n wrap = input(false, { transform: booleanAttribute });\n\n // Computed class names\n protected alignClass = computed(() => this.align() && `vater-align-${this.align()}`);\n protected directionClass = computed(() => this.direction() && `vater-${this.direction()}`);\n protected gapClass = computed(() => this.gap() && `vater-gap-${this.gap()}`);\n protected justifyClass = computed(() => this.justify() && `vater-justify-${this.justify()}`);\n protected offsetClass = computed(() => this.offset() && `vater-offset-${this.offset()}`);\n protected class = computed(() =>\n [\n this.alignClass(),\n this.directionClass(),\n this.gapClass(),\n this.justifyClass(),\n this.offsetClass(),\n ].filter(Boolean)\n );\n}\n"]}
@@ -19,10 +19,10 @@
19
19
  import { Component, ViewEncapsulation } from '@angular/core';
20
20
  import * as i0 from "@angular/core";
21
21
  export class VaterSpacerComponent {
22
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterSpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
23
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: VaterSpacerComponent, isStandalone: true, selector: "vater-spacer, [vater-spacer]", ngImport: i0, template: '<ng-content />', isInline: true, styles: ["vater-spacer,[vater-spacer]{flex:1;align-self:stretch}\n"], encapsulation: i0.ViewEncapsulation.None });
22
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterSpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
23
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: VaterSpacerComponent, isStandalone: true, selector: "vater-spacer, [vater-spacer]", ngImport: i0, template: '<ng-content />', isInline: true, styles: ["vater-spacer,[vater-spacer]{flex:1;align-self:stretch}\n"], encapsulation: i0.ViewEncapsulation.None });
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterSpacerComponent, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterSpacerComponent, decorators: [{
26
26
  type: Component,
27
27
  args: [{ selector: 'vater-spacer, [vater-spacer]', encapsulation: ViewEncapsulation.None, template: '<ng-content />', styles: ["vater-spacer,[vater-spacer]{flex:1;align-self:stretch}\n"] }]
28
28
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"vater-spacer.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-spacer.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;AAc7D,MAAM,OAAO,oBAAoB;uGAApB,oBAAoB;2FAApB,oBAAoB,wFAFrB,gBAAgB;;2FAEf,oBAAoB;kBAZhC,SAAS;+BACE,8BAA8B,iBACzB,iBAAiB,CAAC,IAAI,YAQ3B,gBAAgB","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'vater-spacer, [vater-spacer]',\n encapsulation: ViewEncapsulation.None,\n styles: `\n vater-spacer,\n [vater-spacer] {\n flex: 1;\n align-self: stretch;\n }\n `,\n template: '<ng-content />',\n})\nexport class VaterSpacerComponent {}\n"]}
1
+ {"version":3,"file":"vater-spacer.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-spacer.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;AAc7D,MAAM,OAAO,oBAAoB;wGAApB,oBAAoB;4FAApB,oBAAoB,wFAFrB,gBAAgB;;4FAEf,oBAAoB;kBAZhC,SAAS;+BACE,8BAA8B,iBACzB,iBAAiB,CAAC,IAAI,YAQ3B,gBAAgB","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'vater-spacer, [vater-spacer]',\n encapsulation: ViewEncapsulation.None,\n styles: `\n vater-spacer,\n [vater-spacer] {\n flex: 1;\n align-self: stretch;\n }\n `,\n template: '<ng-content />',\n})\nexport class VaterSpacerComponent {}\n"]}
@@ -23,10 +23,10 @@ import * as i0 from "@angular/core";
23
23
  import * as i1 from "./vater-layout.directive";
24
24
  import * as i2 from "./vater-utility.directive";
25
25
  export class VaterStackComponent {
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterStackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
27
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: VaterStackComponent, isStandalone: true, selector: "vater-stack, [vater-stack]", hostDirectives: [{ directive: i1.VaterLayoutDirective, inputs: ["align", "align", "direction", "direction", "justify", "justify", "wrap", "wrap", "gap", "gap", "offset", "offset"] }, { directive: i2.VaterUtilityDirective, inputs: ["center", "center", "fill", "fill", "inset", "inset", "scrollable", "scrollable"] }], ngImport: i0, template: `<ng-content />`, isInline: true, styles: ["vater-stack,[vater-stack]{display:flex;line-height:normal}\n"], encapsulation: i0.ViewEncapsulation.None });
26
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterStackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
27
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: VaterStackComponent, isStandalone: true, selector: "vater-stack, [vater-stack]", hostDirectives: [{ directive: i1.VaterLayoutDirective, inputs: ["align", "align", "direction", "direction", "justify", "justify", "wrap", "wrap", "gap", "gap", "offset", "offset"] }, { directive: i2.VaterUtilityDirective, inputs: ["center", "center", "fill", "fill", "inset", "inset", "scrollable", "scrollable"] }], ngImport: i0, template: `<ng-content />`, isInline: true, styles: ["vater-stack,[vater-stack]{display:flex;line-height:normal}\n"], encapsulation: i0.ViewEncapsulation.None });
28
28
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterStackComponent, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterStackComponent, decorators: [{
30
30
  type: Component,
31
31
  args: [{ selector: 'vater-stack, [vater-stack]', encapsulation: ViewEncapsulation.None, hostDirectives: [
32
32
  {
@@ -1 +1 @@
1
- {"version":3,"file":"vater-stack.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-stack.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;;;;AAwBhE,MAAM,OAAO,mBAAmB;uGAAnB,mBAAmB;2FAAnB,mBAAmB,mZAFpB,gBAAgB;;2FAEf,mBAAmB;kBAtB/B,SAAS;+BACE,4BAA4B,iBACvB,iBAAiB,CAAC,IAAI,kBACrB;wBACd;4BACE,SAAS,EAAE,oBAAoB;4BAC/B,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC;yBACnE;wBACD;4BACE,SAAS,EAAE,qBAAqB;4BAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC;yBAClD;qBACF,YAQS,gBAAgB","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\nimport { VaterUtilityDirective } from './vater-utility.directive';\nimport { VaterLayoutDirective } from './vater-layout.directive';\n\n@Component({\n selector: 'vater-stack, [vater-stack]',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [\n {\n directive: VaterLayoutDirective,\n inputs: ['align', 'direction', 'justify', 'wrap', 'gap', 'offset'],\n },\n {\n directive: VaterUtilityDirective,\n inputs: ['center', 'fill', 'inset', 'scrollable'],\n },\n ],\n styles: `\n vater-stack,\n [vater-stack] {\n display: flex;\n line-height: normal;\n }\n `,\n template: `<ng-content />`,\n})\nexport class VaterStackComponent {}\n"]}
1
+ {"version":3,"file":"vater-stack.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-stack.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;;;;AAwBhE,MAAM,OAAO,mBAAmB;wGAAnB,mBAAmB;4FAAnB,mBAAmB,mZAFpB,gBAAgB;;4FAEf,mBAAmB;kBAtB/B,SAAS;+BACE,4BAA4B,iBACvB,iBAAiB,CAAC,IAAI,kBACrB;wBACd;4BACE,SAAS,EAAE,oBAAoB;4BAC/B,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC;yBACnE;wBACD;4BACE,SAAS,EAAE,qBAAqB;4BAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC;yBAClD;qBACF,YAQS,gBAAgB","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\nimport { VaterUtilityDirective } from './vater-utility.directive';\nimport { VaterLayoutDirective } from './vater-layout.directive';\n\n@Component({\n selector: 'vater-stack, [vater-stack]',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [\n {\n directive: VaterLayoutDirective,\n inputs: ['align', 'direction', 'justify', 'wrap', 'gap', 'offset'],\n },\n {\n directive: VaterUtilityDirective,\n inputs: ['center', 'fill', 'inset', 'scrollable'],\n },\n ],\n styles: `\n vater-stack,\n [vater-stack] {\n display: flex;\n line-height: normal;\n }\n `,\n template: `<ng-content />`,\n})\nexport class VaterStackComponent {}\n"]}
@@ -32,10 +32,10 @@ export class VaterUtilityDirective {
32
32
  fillClass = computed(() => this.fill() && `vater-fill-${this.fill()}`, ...(ngDevMode ? [{ debugName: "fillClass" }] : []));
33
33
  insetClass = computed(() => this.inset() && `vater-inset-${this.inset()}`, ...(ngDevMode ? [{ debugName: "insetClass" }] : []));
34
34
  class = computed(() => [this.fillClass(), this.insetClass()].filter(Boolean), ...(ngDevMode ? [{ debugName: "class" }] : []));
35
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterUtilityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
36
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.6", type: VaterUtilityDirective, isStandalone: true, selector: "[vater]", inputs: { center: { classPropertyName: "center", publicName: "center", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, inset: { classPropertyName: "inset", publicName: "inset", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()", "class.vater-center": "center()", "class.vater-scrollable": "scrollable()", "attr.center": "null", "attr.fill": "null", "attr.inset": "null", "attr.scrollable": "null" } }, ngImport: i0 });
35
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterUtilityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
36
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: VaterUtilityDirective, isStandalone: true, selector: "[vater]", inputs: { center: { classPropertyName: "center", publicName: "center", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, inset: { classPropertyName: "inset", publicName: "inset", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()", "class.vater-center": "center()", "class.vater-scrollable": "scrollable()", "attr.center": "null", "attr.fill": "null", "attr.inset": "null", "attr.scrollable": "null" } }, ngImport: i0 });
37
37
  }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: VaterUtilityDirective, decorators: [{
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: VaterUtilityDirective, decorators: [{
39
39
  type: Directive,
40
40
  args: [{
41
41
  selector: '[vater]',
@@ -1 +1 @@
1
- {"version":3,"file":"vater-utility.directive.js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,EAAE,cAAc;wBAC1C,eAAe,EAAE,MAAM;wBACvB,aAAa,EAAE,MAAM;wBACrB,cAAc,EAAE,MAAM;wBACtB,mBAAmB,EAAE,MAAM;qBAC5B;iBACF","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { booleanAttribute, computed, Directive, input } from '@angular/core';\nimport { Fill, Inset } from './types';\n\n/* eslint-disable @angular-eslint/no-input-rename */\n@Directive({\n selector: '[vater]',\n host: {\n '[class]': 'class()',\n '[class.vater-center]': 'center()',\n '[class.vater-scrollable]': 'scrollable()',\n '[attr.center]': 'null',\n '[attr.fill]': 'null',\n '[attr.inset]': 'null',\n '[attr.scrollable]': 'null',\n },\n})\nexport class VaterUtilityDirective {\n /** Center the element horizontally and vertically. */\n center = input(false, { transform: booleanAttribute });\n\n /** Stretch the element to fill the available space in one or both directions. */\n fill = input<Fill>();\n\n /** Position the element absolute with the provided inset value. */\n inset = input<Inset>();\n\n /** Make the element scrollable. */\n scrollable = input(false, { transform: booleanAttribute });\n\n // Computed class names\n protected fillClass = computed(() => this.fill() && `vater-fill-${this.fill()}`);\n protected insetClass = computed(() => this.inset() && `vater-inset-${this.inset()}`);\n protected class = computed(() => [this.fillClass(), this.insetClass()].filter(Boolean));\n}\n"]}
1
+ {"version":3,"file":"vater-utility.directive.js","sourceRoot":"","sources":["../../../../libs/watt/package/vater/vater-utility.directive.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EAAE,gBA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":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { booleanAttribute, computed, Directive, input } from '@angular/core';\nimport { Fill, Inset } from './types';\n\n/* eslint-disable @angular-eslint/no-input-rename */\n@Directive({\n selector: '[vater]',\n host: {\n '[class]': 'class()',\n '[class.vater-center]': 'center()',\n '[class.vater-scrollable]': 'scrollable()',\n '[attr.center]': 'null',\n '[attr.fill]': 'null',\n '[attr.inset]': 'null',\n '[attr.scrollable]': 'null',\n },\n})\nexport class VaterUtilityDirective {\n /** Center the element horizontally and vertically. */\n center = input(false, { transform: booleanAttribute });\n\n /** Stretch the element to fill the available space in one or both directions. */\n fill = input<Fill>();\n\n /** Position the element absolute with the provided inset value. */\n inset = input<Inset>();\n\n /** Make the element scrollable. */\n scrollable = input(false, { transform: booleanAttribute });\n\n // Computed class names\n protected fillClass = computed(() => this.fill() && `vater-fill-${this.fill()}`);\n protected insetClass = computed(() => this.inset() && `vater-inset-${this.inset()}`);\n protected class = computed(() => [this.fillClass(), this.insetClass()].filter(Boolean));\n}\n"]}
@@ -136,8 +136,8 @@ export class WattYearField {
136
136
  const isSame = selectedDate.isSame(max, 'year');
137
137
  return isSame || isAfter;
138
138
  }
139
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: WattYearField, deps: [], target: i0.ɵɵFactoryTarget.Component });
140
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", type: WattYearField, isStandalone: true, selector: "watt-year-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughYears: { classPropertyName: "canStepThroughYears", publicName: "canStepThroughYears", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearChange: "yearChange", blur: "blur" }, providers: [
139
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattYearField, deps: [], target: i0.ɵɵFactoryTarget.Component });
140
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattYearField, isStandalone: true, selector: "watt-year-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughYears: { classPropertyName: "canStepThroughYears", publicName: "canStepThroughYears", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearChange: "yearChange", blur: "blur" }, providers: [
141
141
  {
142
142
  provide: NG_VALUE_ACCESSOR,
143
143
  useExisting: forwardRef(() => WattYearField),
@@ -195,7 +195,7 @@ export class WattYearField {
195
195
  }
196
196
  `, isInline: true, styles: ["watt-year-field{display:block;width:100%}watt-year-field:has(.watt-year-field__step-through){display:flex;flex-align:flex-start}watt-year-field:has(.watt-year-field__step-through) .watt-year-field__step-through{display:flex}watt-year-field:has(.watt-year-field__has-label) .watt-year-field__step-through{margin-top:28px}.watt-year-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
197
197
  }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: WattYearField, decorators: [{
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattYearField, decorators: [{
199
199
  type: Component,
200
200
  args: [{ selector: 'watt-year-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
201
201
  {
@@ -1 +1 @@
1
- {"version":3,"file":"watt-year-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/year-field/watt-year-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB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,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAEhD,OAAO,MAAM,IAAI,OAAO,CAAC;IAC3B,CAAC;uGAlIU,aAAa;2FAAb,aAAa,6nBA9Fb;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC;gBAC5C,KAAK,EAAE,IAAI;aACZ;SACF,0BAoCS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDT,+iBArFS,mBAAmB,0kBAAE,WAAW,8YAAE,mBAAmB,sIAAE,kBAAkB;;2FAuFxE,aAAa;kBAlGzB,SAAS;+BACE,iBAAiB,iBACZ,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,aACpC;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC;4BAC5C,KAAK,EAAE,IAAI;yBACZ;qBACF,WACQ,CAAC,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,YAmC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDT","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n input,\n output,\n signal,\n computed,\n Component,\n forwardRef,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n booleanAttribute,\n} from '@angular/core';\n\nimport {\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { share } from 'rxjs';\nimport { MatCalendar } from '@angular/material/datepicker';\nimport { outputFromObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\n\nimport { dayjs } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nexport const YEAR_FORMAT = 'YYYY';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-year-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattYearField),\n multi: true,\n },\n ],\n imports: [ReactiveFormsModule, MatCalendar, WattButtonComponent, WattFieldComponent],\n styles: [\n `\n watt-year-field {\n display: block;\n width: 100%;\n\n &:has(.watt-year-field__step-through) {\n display: flex;\n flex-align: flex-start;\n\n .watt-year-field__step-through {\n display: flex;\n }\n }\n\n &:has(.watt-year-field__has-label) {\n .watt-year-field__step-through {\n margin-top: 28px;\n }\n }\n }\n\n .watt-year-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"control\" [anchorName]=\"anchorName\">\n <input\n #field\n readonly\n [formControl]=\"control\"\n (focus)=\"handleFocus(picker)\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-year-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n @if (isOpen()) {\n <mat-calendar\n startView=\"multi-year\"\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (yearSelected)=\"handleSelectedChange(field, $event)\"\n />\n }\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n\n @if (canStepThroughYears()) {\n <span class=\"watt-year-field__step-through\" [class.watt-year-field__has-label]=\"!!label()\">\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevYear(field)\"\n [disabled]=\"control.disabled || isPrevYearButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextYear(field)\"\n [disabled]=\"control.disabled || isNextYearButtonDisabled()\"\n />\n </span>\n }\n `,\n})\nexport class WattYearField implements ControlValueAccessor {\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattYearField.instance++;\n protected anchorName = `--watt-year-field-popover-anchor-${this.instance}`;\n\n // The format of the inner FormControl is different from that of the outer FormControl\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private valueChanges = this.control.valueChanges.pipe(takeUntilDestroyed(), share());\n private year = toSignal(this.valueChanges);\n protected selected = computed(() => {\n const date = dayjs(this.year(), YEAR_FORMAT, true);\n if (date.isValid()) return date.toDate();\n return undefined;\n });\n\n // This is used to reset the MatCalendar component by destroying and then recreating it\n // whenever the picker is opened. There is no methods to do it programatically.\n protected isOpen = signal(false);\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** Enable buttons to step through years. */\n canStepThroughYears = input(false, { transform: booleanAttribute });\n\n /** Emits when the selected year has changed. */\n yearChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n isPrevYearButtonDisabled = computed(() => this.isPrevYearBeforeOrEqualToMinDate());\n isNextYearButtonDisabled = computed(() => this.isNextYearAfterOrEqualToMaxDate());\n\n protected handleFocus = (picker: HTMLElement) => {\n this.isOpen.set(true);\n picker.showPopover();\n };\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus()); // keep focus on input element while using the picker\n } else {\n picker.hidePopover();\n this.isOpen.set(false);\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (field: HTMLInputElement, date: Date) => {\n field.value = dayjs(date).format(YEAR_FORMAT);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n setTimeout(() => field.blur());\n };\n\n // Implementation for ControlValueAccessor\n writeValue = (value: string | null) => this.control.setValue(value ?? '');\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: string | null) => void) => this.valueChanges.subscribe(fn);\n\n /**\n * @ignore\n */\n protected prevYear(field: HTMLInputElement): void {\n this.changeYear(field, -1);\n }\n /**\n * @ignore\n */\n protected nextYear(field: HTMLInputElement): void {\n this.changeYear(field, 1);\n }\n\n /**\n * @ignore\n */\n private changeYear(field: HTMLInputElement, value: number): void {\n const currentDate = dayjs(field.value, YEAR_FORMAT, true);\n\n if (!currentDate.isValid()) return;\n\n const newDate = currentDate.add(value, 'year');\n this.handleSelectedChange(field, newDate.toDate());\n }\n\n /**\n * @ignore\n */\n isPrevYearBeforeOrEqualToMinDate(): boolean {\n const min = this.min();\n\n if (!min) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isBefore = selectedDate.isBefore(min, 'year');\n const isSame = selectedDate.isSame(min, 'year');\n\n return isSame || isBefore;\n }\n\n /**\n * @ignore\n */\n isNextYearAfterOrEqualToMaxDate(): boolean {\n const max = this.max();\n\n if (!max) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isAfter = selectedDate.isAfter(max, 'year');\n const isSame = selectedDate.isSame(max, 'year');\n\n return isSame || isAfter;\n }\n}\n"]}
1
+ {"version":3,"file":"watt-year-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/year-field/watt-year-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAElC,2DAA2D;AAmG3D,MAAM,OAAO,aAAa;IACxB,2FAA2F;IAC3F,2FAA2F;IACnF,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,QAAQ,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAC;IAClC,UAAU,GAAG,oCAAoC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAE3E,sFAAsF;IAC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;;;;;;;;;;;;;;;;;;;;;;;GAkDT","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n input,\n output,\n signal,\n computed,\n Component,\n forwardRef,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n booleanAttribute,\n} from '@angular/core';\n\nimport {\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { share } from 'rxjs';\nimport { MatCalendar } from '@angular/material/datepicker';\nimport { outputFromObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\n\nimport { dayjs } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nexport const YEAR_FORMAT = 'YYYY';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-year-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattYearField),\n multi: true,\n },\n ],\n imports: [ReactiveFormsModule, MatCalendar, WattButtonComponent, WattFieldComponent],\n styles: [\n `\n watt-year-field {\n display: block;\n width: 100%;\n\n &:has(.watt-year-field__step-through) {\n display: flex;\n flex-align: flex-start;\n\n .watt-year-field__step-through {\n display: flex;\n }\n }\n\n &:has(.watt-year-field__has-label) {\n .watt-year-field__step-through {\n margin-top: 28px;\n }\n }\n }\n\n .watt-year-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"control\" [anchorName]=\"anchorName\">\n <input\n #field\n readonly\n [formControl]=\"control\"\n (focus)=\"handleFocus(picker)\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-year-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n @if (isOpen()) {\n <mat-calendar\n startView=\"multi-year\"\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (yearSelected)=\"handleSelectedChange(field, $event)\"\n />\n }\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n\n @if (canStepThroughYears()) {\n <span class=\"watt-year-field__step-through\" [class.watt-year-field__has-label]=\"!!label()\">\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevYear(field)\"\n [disabled]=\"control.disabled || isPrevYearButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextYear(field)\"\n [disabled]=\"control.disabled || isNextYearButtonDisabled()\"\n />\n </span>\n }\n `,\n})\nexport class WattYearField implements ControlValueAccessor {\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattYearField.instance++;\n protected anchorName = `--watt-year-field-popover-anchor-${this.instance}`;\n\n // The format of the inner FormControl is different from that of the outer FormControl\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private valueChanges = this.control.valueChanges.pipe(takeUntilDestroyed(), share());\n private year = toSignal(this.valueChanges);\n protected selected = computed(() => {\n const date = dayjs(this.year(), YEAR_FORMAT, true);\n if (date.isValid()) return date.toDate();\n return undefined;\n });\n\n // This is used to reset the MatCalendar component by destroying and then recreating it\n // whenever the picker is opened. There is no methods to do it programatically.\n protected isOpen = signal(false);\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** Enable buttons to step through years. */\n canStepThroughYears = input(false, { transform: booleanAttribute });\n\n /** Emits when the selected year has changed. */\n yearChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n isPrevYearButtonDisabled = computed(() => this.isPrevYearBeforeOrEqualToMinDate());\n isNextYearButtonDisabled = computed(() => this.isNextYearAfterOrEqualToMaxDate());\n\n protected handleFocus = (picker: HTMLElement) => {\n this.isOpen.set(true);\n picker.showPopover();\n };\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus()); // keep focus on input element while using the picker\n } else {\n picker.hidePopover();\n this.isOpen.set(false);\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (field: HTMLInputElement, date: Date) => {\n field.value = dayjs(date).format(YEAR_FORMAT);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n setTimeout(() => field.blur());\n };\n\n // Implementation for ControlValueAccessor\n writeValue = (value: string | null) => this.control.setValue(value ?? '');\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: string | null) => void) => this.valueChanges.subscribe(fn);\n\n /**\n * @ignore\n */\n protected prevYear(field: HTMLInputElement): void {\n this.changeYear(field, -1);\n }\n /**\n * @ignore\n */\n protected nextYear(field: HTMLInputElement): void {\n this.changeYear(field, 1);\n }\n\n /**\n * @ignore\n */\n private changeYear(field: HTMLInputElement, value: number): void {\n const currentDate = dayjs(field.value, YEAR_FORMAT, true);\n\n if (!currentDate.isValid()) return;\n\n const newDate = currentDate.add(value, 'year');\n this.handleSelectedChange(field, newDate.toDate());\n }\n\n /**\n * @ignore\n */\n isPrevYearBeforeOrEqualToMinDate(): boolean {\n const min = this.min();\n\n if (!min) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isBefore = selectedDate.isBefore(min, 'year');\n const isSame = selectedDate.isSame(min, 'year');\n\n return isSame || isBefore;\n }\n\n /**\n * @ignore\n */\n isNextYearAfterOrEqualToMaxDate(): boolean {\n const max = this.max();\n\n if (!max) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isAfter = selectedDate.isAfter(max, 'year');\n const isSame = selectedDate.isSame(max, 'year');\n\n return isSame || isAfter;\n }\n}\n"]}
@@ -134,8 +134,8 @@ export class WattYearMonthField {
134
134
  const isSame = selectedDate.isSame(max, 'month');
135
135
  return isSame || isAfter;
136
136
  }
137
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: WattYearMonthField, deps: [], target: i0.ɵɵFactoryTarget.Component });
138
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", type: WattYearMonthField, isStandalone: true, selector: "watt-yearmonth-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, startView: { classPropertyName: "startView", publicName: "startView", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughMonths: { classPropertyName: "canStepThroughMonths", publicName: "canStepThroughMonths", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { monthChange: "monthChange", blur: "blur" }, providers: [
137
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattYearMonthField, deps: [], target: i0.ɵɵFactoryTarget.Component });
138
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattYearMonthField, isStandalone: true, selector: "watt-yearmonth-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, startView: { classPropertyName: "startView", publicName: "startView", isSignal: true, isRequired: false, transformFunction: null }, canStepThroughMonths: { classPropertyName: "canStepThroughMonths", publicName: "canStepThroughMonths", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { monthChange: "monthChange", blur: "blur" }, providers: [
139
139
  {
140
140
  provide: NG_VALUE_ACCESSOR,
141
141
  useExisting: forwardRef(() => WattYearMonthField),
@@ -196,7 +196,7 @@ export class WattYearMonthField {
196
196
  }
197
197
  `, isInline: true, styles: ["watt-yearmonth-field{display:block;width:100%}watt-yearmonth-field input{text-transform:capitalize}watt-yearmonth-field:has(.watt-yearmonth-field__step-through){display:flex;flex-align:flex-start}watt-yearmonth-field:has(.watt-yearmonth-field__step-through) .watt-yearmonth-field__step-through{display:flex}watt-yearmonth-field:has(.watt-yearmonth-field__has-label) .watt-yearmonth-field__step-through{margin-top:28px}.watt-yearmonth-field-picker{position:fixed;position-area:bottom span-right;position-try-fallbacks:flip-block;width:296px;height:354px;inset:unset;margin:unset;border:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
198
198
  }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: WattYearMonthField, decorators: [{
199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattYearMonthField, decorators: [{
200
200
  type: Component,
201
201
  args: [{ selector: 'watt-yearmonth-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
202
202
  {
@@ -1 +1 @@
1
- {"version":3,"file":"watt-yearmonth-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/yearmonth-field/watt-yearmonth-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,U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CAAC;QAEvB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE5C,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEjD,OAAO,MAAM,IAAI,OAAO,CAAC;IAC3B,CAAC;uGAvIU,kBAAkB;2FAAlB,kBAAkB,2wBArGlB;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;gBACjD,KAAK,EAAE,IAAI;aACZ;SACF,0BAwCS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDT,spBA5FS,mBAAmB,0kBAAE,WAAW,8YAAE,mBAAmB,sIAAE,kBAAkB;;2FA8FxE,kBAAkB;kBAzG9B,SAAS;+BACE,sBAAsB,iBACjB,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,aACpC;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC;4BACjD,KAAK,EAAE,IAAI;yBACZ;qBACF,WACQ,CAAC,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,YAuC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDT","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { outputFromObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { map, share } from 'rxjs';\nimport { MatCalendar, MatCalendarView } from '@angular/material/datepicker';\n\nimport { dayjs } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport { YearMonth } from './year-month';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-yearmonth-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattYearMonthField),\n multi: true,\n },\n ],\n imports: [ReactiveFormsModule, MatCalendar, WattButtonComponent, WattFieldComponent],\n styles: [\n `\n watt-yearmonth-field {\n display: block;\n width: 100%;\n\n & input {\n text-transform: capitalize;\n }\n\n &:has(.watt-yearmonth-field__step-through) {\n display: flex;\n flex-align: flex-start;\n\n .watt-yearmonth-field__step-through {\n display: flex;\n }\n }\n\n &:has(.watt-yearmonth-field__has-label) {\n .watt-yearmonth-field__step-through {\n margin-top: 28px;\n }\n }\n }\n\n .watt-yearmonth-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"control\" [anchorName]=\"anchorName\">\n <input\n #field\n readonly\n [formControl]=\"control\"\n (focus)=\"handleFocus(picker)\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-yearmonth-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n @if (isOpen()) {\n <mat-calendar\n [startView]=\"startView()\"\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (monthSelected)=\"handleSelectedChange(field, $event)\"\n />\n }\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n\n @if (canStepThroughMonths()) {\n <span\n class=\"watt-yearmonth-field__step-through\"\n [class.watt-yearmonth-field__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevMonth(field)\"\n [disabled]=\"control.disabled || isPrevMonthButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextMonth(field)\"\n [disabled]=\"control.disabled || isNextMonthButtonDisabled()\"\n />\n </span>\n }\n `,\n})\nexport class WattYearMonthField implements ControlValueAccessor {\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattYearMonthField.instance++;\n protected anchorName = `--watt-yearmonth-field-popover-anchor-${this.instance}`;\n\n // The format of the inner FormControl is different from that of the outer FormControl\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private yearMonthChanges = this.control.valueChanges.pipe(map(YearMonth.fromView));\n private valueChanges = this.yearMonthChanges.pipe(\n map((yearMonth) => yearMonth.toModel()),\n takeUntilDestroyed(),\n share()\n );\n\n private yearMonth = toSignal(this.yearMonthChanges);\n protected selected = computed(() => this.yearMonth()?.toDate());\n\n // This is used to reset the MatCalendar component by destroying and then recreating it\n // whenever the picker is opened. There is no methods to do it programatically.\n protected isOpen = signal(false);\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** Whether the calendar should be started in month or year view. */\n startView = input<Extract<MatCalendarView, 'multi-year' | 'year'>>('multi-year');\n\n /** Enable buttons to step through months. */\n canStepThroughMonths = input(false, { transform: booleanAttribute });\n\n /** Emits when the selected month has changed. */\n monthChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n isPrevMonthButtonDisabled = computed(() => this.isPrevMonthBeforeOrEqualToMinDate());\n isNextMonthButtonDisabled = computed(() => this.isNextMonthAfterOrEqualToMaxDate());\n\n protected handleFocus = (picker: HTMLElement) => {\n this.isOpen.set(true);\n picker.showPopover();\n };\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus()); // keep focus on input element while using the picker\n } else {\n picker.hidePopover();\n this.isOpen.set(false);\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (field: HTMLInputElement, date: Date) => {\n field.value = YearMonth.fromDate(date).toView();\n field.dispatchEvent(new Event('input', { bubbles: true }));\n setTimeout(() => field.blur());\n };\n\n // Implementation for ControlValueAccessor\n writeValue = (value: string | null) => this.control.setValue(YearMonth.fromModel(value).toView());\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: string | null) => void) => this.valueChanges.subscribe(fn);\n\n /**\n * @ignore\n */\n protected prevMonth(field: HTMLInputElement): void {\n this.changeMonth(field, -1);\n }\n /**\n * @ignore\n */\n protected nextMonth(field: HTMLInputElement): void {\n this.changeMonth(field, 1);\n }\n\n /**\n * @ignore\n */\n private changeMonth(field: HTMLInputElement, value: number): void {\n const currentDate = YearMonth.fromView(field.value).toDate();\n\n if (!currentDate) return;\n\n const newDate = dayjs(currentDate).add(value, 'month');\n this.handleSelectedChange(field, newDate.toDate());\n }\n\n /**\n * @ignore\n */\n isPrevMonthBeforeOrEqualToMinDate(): boolean {\n const min = this.min();\n\n if (!min) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isBefore = selectedDate.isBefore(min, 'month');\n const isSame = selectedDate.isSame(min, 'month');\n\n return isSame || isBefore;\n }\n\n /**\n * @ignore\n */\n isNextMonthAfterOrEqualToMaxDate(): boolean {\n const max = this.max();\n\n if (!max) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isAfter = selectedDate.isAfter(max, 'month');\n const isSame = selectedDate.isSame(max, 'month');\n\n return isSame || isAfter;\n }\n}\n"]}
1
+ {"version":3,"file":"watt-yearmonth-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/yearmonth-field/watt-yearmonth-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,WAAW,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AkB,2wBArGlB;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;gBACjD,KAAK,EAAE,IAAI;aACZ;SACF,0BAwCS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDT,spBA5FS,mBAAmB,0kBAAE,WAAW,8YAAE,mBAAmB,sIAAE,kBAAkB;;4FA8FxE,kBAAkB;kBAzG9B,SAAS;+BACE,sBAAsB,iBACjB,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,aACpC;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC;4BACjD,KAAK,EAAE,IAAI;yBACZ;qBACF,WACQ,CAAC,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,YAuC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDT","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControl,\n NG_VALUE_ACCESSOR,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { outputFromObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { map, share } from 'rxjs';\nimport { MatCalendar, MatCalendarView } from '@angular/material/datepicker';\n\nimport { dayjs } from '@energinet/watt/core/date';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport { YearMonth } from './year-month';\n\n/* eslint-disable @angular-eslint/component-class-suffix */\n@Component({\n selector: 'watt-yearmonth-field',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattYearMonthField),\n multi: true,\n },\n ],\n imports: [ReactiveFormsModule, MatCalendar, WattButtonComponent, WattFieldComponent],\n styles: [\n `\n watt-yearmonth-field {\n display: block;\n width: 100%;\n\n & input {\n text-transform: capitalize;\n }\n\n &:has(.watt-yearmonth-field__step-through) {\n display: flex;\n flex-align: flex-start;\n\n .watt-yearmonth-field__step-through {\n display: flex;\n }\n }\n\n &:has(.watt-yearmonth-field__has-label) {\n .watt-yearmonth-field__step-through {\n margin-top: 28px;\n }\n }\n }\n\n .watt-yearmonth-field-picker {\n position: fixed;\n position-area: bottom span-right;\n position-try-fallbacks: flip-block;\n width: 296px;\n height: 354px;\n inset: unset;\n margin: unset;\n border: 0;\n }\n `,\n ],\n template: `\n <watt-field [label]=\"label()\" [control]=\"control\" [anchorName]=\"anchorName\">\n <input\n #field\n readonly\n [formControl]=\"control\"\n (focus)=\"handleFocus(picker)\"\n (blur)=\"handleBlur(picker, $event)\"\n />\n <watt-button icon=\"date\" variant=\"icon\" (click)=\"field.focus()\" />\n <div\n #picker\n class=\"watt-elevation watt-yearmonth-field-picker\"\n popover=\"manual\"\n tabindex=\"0\"\n [style.position-anchor]=\"anchorName\"\n >\n @if (isOpen()) {\n <mat-calendar\n [startView]=\"startView()\"\n [startAt]=\"selected()\"\n [selected]=\"selected()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n (monthSelected)=\"handleSelectedChange(field, $event)\"\n />\n }\n </div>\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n </watt-field>\n\n @if (canStepThroughMonths()) {\n <span\n class=\"watt-yearmonth-field__step-through\"\n [class.watt-yearmonth-field__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevMonth(field)\"\n [disabled]=\"control.disabled || isPrevMonthButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextMonth(field)\"\n [disabled]=\"control.disabled || isNextMonthButtonDisabled()\"\n />\n </span>\n }\n `,\n})\nexport class WattYearMonthField implements ControlValueAccessor {\n // Popovers exists on an entirely different layer, meaning that for anchor positioning they\n // look at the entire tree for the anchor name. This gives each field a unique anchor name.\n private static instance = 0;\n private instance = WattYearMonthField.instance++;\n protected anchorName = `--watt-yearmonth-field-popover-anchor-${this.instance}`;\n\n // The format of the inner FormControl is different from that of the outer FormControl\n protected control = new FormControl('', { nonNullable: true });\n\n // `registerOnChange` may subscribe to this component after it has been destroyed, thus\n // triggering an NG0911 from the `takeUntilDestroyed` operator. By sharing the observable,\n // the observable will already be closed and `subscribe` becomes a proper noop.\n private yearMonthChanges = this.control.valueChanges.pipe(map(YearMonth.fromView));\n private valueChanges = this.yearMonthChanges.pipe(\n map((yearMonth) => yearMonth.toModel()),\n takeUntilDestroyed(),\n share()\n );\n\n private yearMonth = toSignal(this.yearMonthChanges);\n protected selected = computed(() => this.yearMonth()?.toDate());\n\n // This is used to reset the MatCalendar component by destroying and then recreating it\n // whenever the picker is opened. There is no methods to do it programatically.\n protected isOpen = signal(false);\n\n /** Set the label text for `watt-field`. */\n label = input('');\n\n /** The minimum selectable date. */\n min = input<Date>();\n\n /** The maximum selectable date. */\n max = input<Date>();\n\n /** Whether the calendar should be started in month or year view. */\n startView = input<Extract<MatCalendarView, 'multi-year' | 'year'>>('multi-year');\n\n /** Enable buttons to step through months. */\n canStepThroughMonths = input(false, { transform: booleanAttribute });\n\n /** Emits when the selected month has changed. */\n monthChange = outputFromObservable(this.valueChanges);\n\n /** Emits when the field loses focus. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n isPrevMonthButtonDisabled = computed(() => this.isPrevMonthBeforeOrEqualToMinDate());\n isNextMonthButtonDisabled = computed(() => this.isNextMonthAfterOrEqualToMaxDate());\n\n protected handleFocus = (picker: HTMLElement) => {\n this.isOpen.set(true);\n picker.showPopover();\n };\n\n protected handleBlur = (picker: HTMLElement, event: FocusEvent) => {\n if (event.relatedTarget instanceof HTMLElement && picker.contains(event.relatedTarget)) {\n const target = event.target as HTMLInputElement; // safe type assertion\n setTimeout(() => target.focus()); // keep focus on input element while using the picker\n } else {\n picker.hidePopover();\n this.isOpen.set(false);\n this.blur.emit(event);\n }\n };\n\n protected handleSelectedChange = (field: HTMLInputElement, date: Date) => {\n field.value = YearMonth.fromDate(date).toView();\n field.dispatchEvent(new Event('input', { bubbles: true }));\n setTimeout(() => field.blur());\n };\n\n // Implementation for ControlValueAccessor\n writeValue = (value: string | null) => this.control.setValue(YearMonth.fromModel(value).toView());\n setDisabledState = (x: boolean) => (x ? this.control.disable() : this.control.enable());\n registerOnTouched = (fn: () => void) => this.blur.subscribe(fn);\n registerOnChange = (fn: (value: string | null) => void) => this.valueChanges.subscribe(fn);\n\n /**\n * @ignore\n */\n protected prevMonth(field: HTMLInputElement): void {\n this.changeMonth(field, -1);\n }\n /**\n * @ignore\n */\n protected nextMonth(field: HTMLInputElement): void {\n this.changeMonth(field, 1);\n }\n\n /**\n * @ignore\n */\n private changeMonth(field: HTMLInputElement, value: number): void {\n const currentDate = YearMonth.fromView(field.value).toDate();\n\n if (!currentDate) return;\n\n const newDate = dayjs(currentDate).add(value, 'month');\n this.handleSelectedChange(field, newDate.toDate());\n }\n\n /**\n * @ignore\n */\n isPrevMonthBeforeOrEqualToMinDate(): boolean {\n const min = this.min();\n\n if (!min) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isBefore = selectedDate.isBefore(min, 'month');\n const isSame = selectedDate.isSame(min, 'month');\n\n return isSame || isBefore;\n }\n\n /**\n * @ignore\n */\n isNextMonthAfterOrEqualToMaxDate(): boolean {\n const max = this.max();\n\n if (!max) return false;\n\n const selectedDate = dayjs(this.selected());\n\n const isAfter = selectedDate.isAfter(max, 'month');\n const isSame = selectedDate.isSame(max, 'month');\n\n return isSame || isAfter;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@energinet/watt",
4
- "version": "4.2.4",
4
+ "version": "4.2.6",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  ".": {
@@ -234,13 +234,13 @@
234
234
  },
235
235
  "peerDependencies": {
236
236
  "@analogjs/vite-plugin-angular": "^2.1.3",
237
- "@angular/cdk": "^20.2.9",
238
- "@angular/common": "^20.3.6",
239
- "@angular/compiler": "^20.3.6",
240
- "@angular/core": "^20.3.6",
241
- "@angular/forms": "^20.3.6",
242
- "@angular/material": "^20.2.9",
243
- "@angular/router": "^20.3.6",
237
+ "@angular/cdk": "^20.2.14",
238
+ "@angular/common": "^20.3.15",
239
+ "@angular/compiler": "^20.3.15",
240
+ "@angular/core": "^20.3.15",
241
+ "@angular/forms": "^20.3.15",
242
+ "@angular/material": "^20.2.14",
243
+ "@angular/router": "^20.3.15",
244
244
  "@maskito/angular": "^2.5.0",
245
245
  "@maskito/core": "^2.5.0",
246
246
  "@maskito/kit": "^2.5.0",