@festo-ui/angular 3.1.0-pre-20220203.2 → 3.1.0-pre-20220203.4

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 (231) hide show
  1. package/esm2020/festo-ui-angular.mjs +5 -0
  2. package/esm2020/index.mjs +18 -0
  3. package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +23 -0
  4. package/esm2020/lib/components/buttons/button/button.component.mjs +41 -0
  5. package/esm2020/lib/components/buttons/link-button/link-button.component.mjs +33 -0
  6. package/esm2020/lib/components/chips/chip/chip.component.mjs +37 -0
  7. package/esm2020/lib/components/chips/chip-container/chip-container.component.mjs +16 -0
  8. package/esm2020/lib/components/click-outside.directive.mjs +28 -0
  9. package/esm2020/lib/components/components.module.mjs +155 -0
  10. package/esm2020/lib/components/loading-indicator/loading-indicator.component.mjs +16 -0
  11. package/esm2020/lib/components/modals/alert/alert.component.mjs +52 -0
  12. package/esm2020/lib/components/modals/confirm/confirm.component.mjs +67 -0
  13. package/esm2020/lib/components/modals/index.mjs +2 -0
  14. package/esm2020/lib/components/modals/modal.service.mjs +112 -0
  15. package/esm2020/lib/components/modals/modals.module.mjs +28 -0
  16. package/esm2020/lib/components/modals/prompt/prompt.component.mjs +102 -0
  17. package/esm2020/lib/components/pagination/pagination.component.mjs +55 -0
  18. package/esm2020/lib/components/popovers/legend/legend.component.mjs +42 -0
  19. package/esm2020/lib/components/popovers/legend/legend.directive.mjs +31 -0
  20. package/esm2020/lib/components/popovers/popover/popover.component.mjs +31 -0
  21. package/esm2020/lib/components/popovers/popover-content/popover-content.component.mjs +82 -0
  22. package/esm2020/lib/components/popovers/popover-content/popover-content.directive.mjs +39 -0
  23. package/esm2020/lib/components/popovers/popover-menu/popover-menu.component.mjs +68 -0
  24. package/esm2020/lib/components/popovers/popover-ref.mjs +25 -0
  25. package/esm2020/lib/components/popovers/popover.defaults.mjs +60 -0
  26. package/esm2020/lib/components/popovers/popover.models.mjs +23 -0
  27. package/esm2020/lib/components/popovers/popover.service.mjs +123 -0
  28. package/esm2020/lib/components/popovers/tooltip/tooltip.directive.mjs +94 -0
  29. package/esm2020/lib/components/progress/progress.component.mjs +20 -0
  30. package/esm2020/lib/components/scroll/index.mjs +2 -0
  31. package/esm2020/lib/components/scroll/scrollable.directive.mjs +72 -0
  32. package/esm2020/lib/components/search-input/search-input.component.mjs +150 -0
  33. package/esm2020/lib/components/snackbar/snackbar-container.component.mjs +21 -0
  34. package/esm2020/lib/components/snackbar/snackbar-container.directive.mjs +83 -0
  35. package/esm2020/lib/components/snackbar/snackbar.component.mjs +79 -0
  36. package/esm2020/lib/components/snackbar/snackbar.models.mjs +2 -0
  37. package/esm2020/lib/components/snackbar/snackbar.module.mjs +26 -0
  38. package/esm2020/lib/components/snackbar/snackbar.service.mjs +23 -0
  39. package/esm2020/lib/components/stepper/stepper.component.mjs +22 -0
  40. package/esm2020/lib/components/table-header-cell/table-header-cell.directive.mjs +58 -0
  41. package/esm2020/lib/components/tabs/tab-pane/tab-pane.component.mjs +31 -0
  42. package/esm2020/lib/components/tabs/tabs.component.mjs +355 -0
  43. package/esm2020/lib/content/content.module.mjs +20 -0
  44. package/esm2020/lib/content/icon/icon.component.mjs +17 -0
  45. package/esm2020/lib/festo-angular.module.mjs +58 -0
  46. package/esm2020/lib/forms/checkbox/checkbox.component.mjs +149 -0
  47. package/esm2020/lib/forms/color-indicator/color-indicator.component.mjs +68 -0
  48. package/esm2020/lib/forms/color-picker/color-helper.mjs +121 -0
  49. package/esm2020/lib/forms/color-picker/color-picker.component.mjs +273 -0
  50. package/esm2020/lib/forms/container-host.mjs +27 -0
  51. package/esm2020/lib/forms/date-picker/date-picker.component.mjs +199 -0
  52. package/esm2020/lib/forms/date-range-picker/date-range-picker.component.mjs +224 -0
  53. package/esm2020/lib/forms/forms.module.mjs +146 -0
  54. package/esm2020/lib/forms/radio/radio.component.mjs +346 -0
  55. package/esm2020/lib/forms/segment/segment-control/segment-control.component.mjs +52 -0
  56. package/esm2020/lib/forms/segment/segment.component.mjs +109 -0
  57. package/esm2020/lib/forms/select/chip-text.pipe.mjs +34 -0
  58. package/esm2020/lib/forms/select/select-option/select-option.component.mjs +22 -0
  59. package/esm2020/lib/forms/select/select.component.mjs +257 -0
  60. package/esm2020/lib/forms/slider/slider.component.mjs +110 -0
  61. package/esm2020/lib/forms/switch/switch.component.mjs +120 -0
  62. package/esm2020/lib/forms/text-area/text-area.component.mjs +180 -0
  63. package/esm2020/lib/forms/text-editor/text-editor.component.mjs +286 -0
  64. package/esm2020/lib/forms/text-input/text-input.component.mjs +183 -0
  65. package/esm2020/lib/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.mjs +89 -0
  66. package/esm2020/lib/forms/time-picker/time-picker.component.mjs +188 -0
  67. package/esm2020/lib/forms/unique-selection-dispatcher.mjs +39 -0
  68. package/esm2020/lib/forms/value-accessor-base.mjs +41 -0
  69. package/esm2020/lib/layout/layout.module.mjs +18 -0
  70. package/esm2020/lib/wrappers/flatpickr/flatpickr.component.mjs +59 -0
  71. package/fesm2015/{festo-ui-angular.js → festo-ui-angular.mjs} +317 -521
  72. package/fesm2015/festo-ui-angular.mjs.map +1 -0
  73. package/fesm2020/festo-ui-angular.mjs +5383 -0
  74. package/fesm2020/festo-ui-angular.mjs.map +1 -0
  75. package/package.json +31 -16
  76. package/scss/base/components/breadcrumb/breadcrumb.component.scss +0 -1
  77. package/scss/base/components/modals/prompt/prompt.component.scss +0 -1
  78. package/scss/base/components/popovers/legend/legend.component.scss +2 -2
  79. package/scss/base/components/popovers/popover/styles.scss +3 -3
  80. package/scss/base/components/popovers/popover-content/popover-content.component.scss +1 -1
  81. package/scss/base/components/scroll/scroll-story-helper.scss +1 -3
  82. package/scss/base/components/snackbar/snackbar.component.scss +1 -1
  83. package/scss/base/components/stepper/stepper.component.scss +16 -15
  84. package/scss/base/forms/color-picker/color-picker.component.scss +12 -12
  85. package/scss/base/forms/date-picker/date-picker.component.scss +1 -1
  86. package/scss/base/forms/date-range-picker/date-range-picker.component.scss +1 -1
  87. package/scss/base/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.scss +1 -1
  88. package/scss/styles.scss +2 -2
  89. package/bundles/festo-ui-angular.umd.js +0 -6429
  90. package/bundles/festo-ui-angular.umd.js.map +0 -1
  91. package/esm2015/festo-ui-angular.js +0 -5
  92. package/esm2015/festo-ui-angular.js.map +0 -1
  93. package/esm2015/index.js +0 -18
  94. package/esm2015/index.js.map +0 -1
  95. package/esm2015/lib/components/breadcrumb/breadcrumb.component.js +0 -27
  96. package/esm2015/lib/components/breadcrumb/breadcrumb.component.js.map +0 -1
  97. package/esm2015/lib/components/buttons/button/button.component.js +0 -46
  98. package/esm2015/lib/components/buttons/button/button.component.js.map +0 -1
  99. package/esm2015/lib/components/buttons/link-button/link-button.component.js +0 -38
  100. package/esm2015/lib/components/buttons/link-button/link-button.component.js.map +0 -1
  101. package/esm2015/lib/components/chips/chip/chip.component.js +0 -42
  102. package/esm2015/lib/components/chips/chip/chip.component.js.map +0 -1
  103. package/esm2015/lib/components/chips/chip-container/chip-container.component.js +0 -21
  104. package/esm2015/lib/components/chips/chip-container/chip-container.component.js.map +0 -1
  105. package/esm2015/lib/components/click-outside.directive.js +0 -28
  106. package/esm2015/lib/components/click-outside.directive.js.map +0 -1
  107. package/esm2015/lib/components/components.module.js +0 -155
  108. package/esm2015/lib/components/components.module.js.map +0 -1
  109. package/esm2015/lib/components/loading-indicator/loading-indicator.component.js +0 -21
  110. package/esm2015/lib/components/loading-indicator/loading-indicator.component.js.map +0 -1
  111. package/esm2015/lib/components/modals/alert/alert.component.js +0 -57
  112. package/esm2015/lib/components/modals/alert/alert.component.js.map +0 -1
  113. package/esm2015/lib/components/modals/confirm/confirm.component.js +0 -73
  114. package/esm2015/lib/components/modals/confirm/confirm.component.js.map +0 -1
  115. package/esm2015/lib/components/modals/index.js +0 -2
  116. package/esm2015/lib/components/modals/index.js.map +0 -1
  117. package/esm2015/lib/components/modals/modal.service.js +0 -91
  118. package/esm2015/lib/components/modals/modal.service.js.map +0 -1
  119. package/esm2015/lib/components/modals/modals.module.js +0 -28
  120. package/esm2015/lib/components/modals/modals.module.js.map +0 -1
  121. package/esm2015/lib/components/modals/prompt/prompt.component.js +0 -110
  122. package/esm2015/lib/components/modals/prompt/prompt.component.js.map +0 -1
  123. package/esm2015/lib/components/pagination/pagination.component.js +0 -60
  124. package/esm2015/lib/components/pagination/pagination.component.js.map +0 -1
  125. package/esm2015/lib/components/popovers/legend/legend.component.js +0 -46
  126. package/esm2015/lib/components/popovers/legend/legend.component.js.map +0 -1
  127. package/esm2015/lib/components/popovers/legend/legend.directive.js +0 -31
  128. package/esm2015/lib/components/popovers/legend/legend.directive.js.map +0 -1
  129. package/esm2015/lib/components/popovers/popover/popover.component.js +0 -35
  130. package/esm2015/lib/components/popovers/popover/popover.component.js.map +0 -1
  131. package/esm2015/lib/components/popovers/popover-content/popover-content.component.js +0 -86
  132. package/esm2015/lib/components/popovers/popover-content/popover-content.component.js.map +0 -1
  133. package/esm2015/lib/components/popovers/popover-content/popover-content.directive.js +0 -39
  134. package/esm2015/lib/components/popovers/popover-content/popover-content.directive.js.map +0 -1
  135. package/esm2015/lib/components/popovers/popover-menu/popover-menu.component.js +0 -72
  136. package/esm2015/lib/components/popovers/popover-menu/popover-menu.component.js.map +0 -1
  137. package/esm2015/lib/components/popovers/popover-ref.js +0 -25
  138. package/esm2015/lib/components/popovers/popover-ref.js.map +0 -1
  139. package/esm2015/lib/components/popovers/popover.defaults.js +0 -60
  140. package/esm2015/lib/components/popovers/popover.defaults.js.map +0 -1
  141. package/esm2015/lib/components/popovers/popover.models.js +0 -23
  142. package/esm2015/lib/components/popovers/popover.models.js.map +0 -1
  143. package/esm2015/lib/components/popovers/popover.service.js +0 -117
  144. package/esm2015/lib/components/popovers/popover.service.js.map +0 -1
  145. package/esm2015/lib/components/popovers/tooltip/tooltip.directive.js +0 -96
  146. package/esm2015/lib/components/popovers/tooltip/tooltip.directive.js.map +0 -1
  147. package/esm2015/lib/components/progress/progress.component.js +0 -23
  148. package/esm2015/lib/components/progress/progress.component.js.map +0 -1
  149. package/esm2015/lib/components/scroll/index.js +0 -2
  150. package/esm2015/lib/components/scroll/index.js.map +0 -1
  151. package/esm2015/lib/components/scroll/scrollable.directive.js +0 -73
  152. package/esm2015/lib/components/scroll/scrollable.directive.js.map +0 -1
  153. package/esm2015/lib/components/search-input/search-input.component.js +0 -155
  154. package/esm2015/lib/components/search-input/search-input.component.js.map +0 -1
  155. package/esm2015/lib/components/snackbar/snackbar-container.component.js +0 -26
  156. package/esm2015/lib/components/snackbar/snackbar-container.component.js.map +0 -1
  157. package/esm2015/lib/components/snackbar/snackbar-container.directive.js +0 -83
  158. package/esm2015/lib/components/snackbar/snackbar-container.directive.js.map +0 -1
  159. package/esm2015/lib/components/snackbar/snackbar.component.js +0 -85
  160. package/esm2015/lib/components/snackbar/snackbar.component.js.map +0 -1
  161. package/esm2015/lib/components/snackbar/snackbar.models.js +0 -2
  162. package/esm2015/lib/components/snackbar/snackbar.models.js.map +0 -1
  163. package/esm2015/lib/components/snackbar/snackbar.module.js +0 -26
  164. package/esm2015/lib/components/snackbar/snackbar.module.js.map +0 -1
  165. package/esm2015/lib/components/snackbar/snackbar.service.js +0 -23
  166. package/esm2015/lib/components/snackbar/snackbar.service.js.map +0 -1
  167. package/esm2015/lib/components/stepper/stepper.component.js +0 -28
  168. package/esm2015/lib/components/stepper/stepper.component.js.map +0 -1
  169. package/esm2015/lib/components/table-header-cell/table-header-cell.directive.js +0 -58
  170. package/esm2015/lib/components/table-header-cell/table-header-cell.directive.js.map +0 -1
  171. package/esm2015/lib/components/tabs/tab-pane/tab-pane.component.js +0 -35
  172. package/esm2015/lib/components/tabs/tab-pane/tab-pane.component.js.map +0 -1
  173. package/esm2015/lib/components/tabs/tabs.component.js +0 -362
  174. package/esm2015/lib/components/tabs/tabs.component.js.map +0 -1
  175. package/esm2015/lib/content/content.module.js +0 -24
  176. package/esm2015/lib/content/content.module.js.map +0 -1
  177. package/esm2015/lib/content/icon/icon.component.js +0 -23
  178. package/esm2015/lib/content/icon/icon.component.js.map +0 -1
  179. package/esm2015/lib/festo-angular.module.js +0 -58
  180. package/esm2015/lib/festo-angular.module.js.map +0 -1
  181. package/esm2015/lib/forms/checkbox/checkbox.component.js +0 -156
  182. package/esm2015/lib/forms/checkbox/checkbox.component.js.map +0 -1
  183. package/esm2015/lib/forms/color-indicator/color-indicator.component.js +0 -72
  184. package/esm2015/lib/forms/color-indicator/color-indicator.component.js.map +0 -1
  185. package/esm2015/lib/forms/color-picker/color-helper.js +0 -121
  186. package/esm2015/lib/forms/color-picker/color-helper.js.map +0 -1
  187. package/esm2015/lib/forms/color-picker/color-picker.component.js +0 -280
  188. package/esm2015/lib/forms/color-picker/color-picker.component.js.map +0 -1
  189. package/esm2015/lib/forms/container-host.js +0 -27
  190. package/esm2015/lib/forms/container-host.js.map +0 -1
  191. package/esm2015/lib/forms/date-picker/date-picker.component.js +0 -205
  192. package/esm2015/lib/forms/date-picker/date-picker.component.js.map +0 -1
  193. package/esm2015/lib/forms/date-range-picker/date-range-picker.component.js +0 -230
  194. package/esm2015/lib/forms/date-range-picker/date-range-picker.component.js.map +0 -1
  195. package/esm2015/lib/forms/forms.module.js +0 -146
  196. package/esm2015/lib/forms/forms.module.js.map +0 -1
  197. package/esm2015/lib/forms/radio/radio.component.js +0 -353
  198. package/esm2015/lib/forms/radio/radio.component.js.map +0 -1
  199. package/esm2015/lib/forms/segment/segment-control/segment-control.component.js +0 -58
  200. package/esm2015/lib/forms/segment/segment-control/segment-control.component.js.map +0 -1
  201. package/esm2015/lib/forms/segment/segment.component.js +0 -116
  202. package/esm2015/lib/forms/segment/segment.component.js.map +0 -1
  203. package/esm2015/lib/forms/select/chip-text.pipe.js +0 -34
  204. package/esm2015/lib/forms/select/chip-text.pipe.js.map +0 -1
  205. package/esm2015/lib/forms/select/select-option/select-option.component.js +0 -29
  206. package/esm2015/lib/forms/select/select-option/select-option.component.js.map +0 -1
  207. package/esm2015/lib/forms/select/select.component.js +0 -265
  208. package/esm2015/lib/forms/select/select.component.js.map +0 -1
  209. package/esm2015/lib/forms/slider/slider.component.js +0 -116
  210. package/esm2015/lib/forms/slider/slider.component.js.map +0 -1
  211. package/esm2015/lib/forms/switch/switch.component.js +0 -127
  212. package/esm2015/lib/forms/switch/switch.component.js.map +0 -1
  213. package/esm2015/lib/forms/text-area/text-area.component.js +0 -186
  214. package/esm2015/lib/forms/text-area/text-area.component.js.map +0 -1
  215. package/esm2015/lib/forms/text-editor/text-editor.component.js +0 -294
  216. package/esm2015/lib/forms/text-editor/text-editor.component.js.map +0 -1
  217. package/esm2015/lib/forms/text-input/text-input.component.js +0 -189
  218. package/esm2015/lib/forms/text-input/text-input.component.js.map +0 -1
  219. package/esm2015/lib/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.js +0 -103
  220. package/esm2015/lib/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.js.map +0 -1
  221. package/esm2015/lib/forms/time-picker/time-picker.component.js +0 -194
  222. package/esm2015/lib/forms/time-picker/time-picker.component.js.map +0 -1
  223. package/esm2015/lib/forms/unique-selection-dispatcher.js +0 -39
  224. package/esm2015/lib/forms/unique-selection-dispatcher.js.map +0 -1
  225. package/esm2015/lib/forms/value-accessor-base.js +0 -41
  226. package/esm2015/lib/forms/value-accessor-base.js.map +0 -1
  227. package/esm2015/lib/layout/layout.module.js +0 -18
  228. package/esm2015/lib/layout/layout.module.js.map +0 -1
  229. package/esm2015/lib/wrappers/flatpickr/flatpickr.component.js +0 -63
  230. package/esm2015/lib/wrappers/flatpickr/flatpickr.component.js.map +0 -1
  231. package/fesm2015/festo-ui-angular.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-editor.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/forms/text-editor/text-editor.component.ts","../../../../../../../libs/angular/src/lib/forms/text-editor/text-editor.component.html"],"names":[],"mapp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;KACF,o3BC/CH,u9LA2HA;2FD1Ea,mBAAmB;kBAb/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,WAAW,EAAE,8BAA8B;oBAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;oBAC3C,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,oBAAoB,CAAC;4BAClD,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF;oJAmBuB,OAAO;sBAA5B,SAAS;uBAAC,SAAS;gBACI,SAAS;sBAAhC,SAAS;uBAAC,WAAW;gBACK,YAAY;sBAAtC,SAAS;uBAAC,cAAc;gBACI,cAAc;sBAA1C,SAAS;uBAAC,gBAAgB;gBACC,aAAa;sBAAxC,SAAS;uBAAC,eAAe;gBACJ,OAAO;sBAA5B,SAAS;uBAAC,SAAS;gBACA,KAAK;sBAAxB,SAAS;uBAAC,OAAO;gBACE,KAAK;sBAAxB,SAAS;uBAAC,OAAO;gBACK,QAAQ;sBAA9B,SAAS;uBAAC,UAAU;gBAEX,SAAS;sBAAlB,MAAM;gBACG,MAAM;sBAAf,MAAM;gBAEE,MAAM;sBAAd,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,QAAQ;sBAAhB,KAAK;gBACG,SAAS;sBAAjB,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBAEF,KAAK;sBADR,KAAK","sourcesContent":["import {\n Component,\n ViewEncapsulation,\n Input,\n AfterViewInit,\n SecurityContext,\n ElementRef,\n Renderer2,\n EventEmitter,\n Output,\n forwardRef,\n OnChanges,\n ViewChild,\n SimpleChanges,\n OnInit\n} from '@angular/core';\nimport QuillType from 'quill';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { ValueAccessorBaseDirective } from '../value-accessor-base';\n\nexport interface TextEditorConfiguration {\n toolbar?: {\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n alignCenter?: boolean;\n alignRight?: boolean;\n bulletList?: boolean;\n orderedList?: boolean;\n image?: boolean;\n link?: boolean;\n };\n}\n\n@Component({\n selector: 'fng-text-editor',\n templateUrl: './text-editor.component.html',\n styleUrls: ['./text-editor.component.scss'],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TextEditorComponent),\n multi: true\n }\n ]\n})\nexport class TextEditorComponent extends ValueAccessorBaseDirective<string> implements OnInit, AfterViewInit, OnChanges {\n id: string;\n quillEditor!: QuillType;\n editorElem!: HTMLElement;\n defaultConfig: TextEditorConfiguration = {\n toolbar: {\n bold: true,\n italic: true,\n underline: true,\n alignCenter: true,\n alignRight: true,\n bulletList: true,\n orderedList: true,\n image: true,\n link: true\n }\n };\n\n @ViewChild('btnBold') btnBold: ElementRef;\n @ViewChild('btnItalic') btnItalic: ElementRef;\n @ViewChild('btnUnderline') btnUnderline: ElementRef;\n @ViewChild('btnAlignCenter') btnAlignCenter: ElementRef;\n @ViewChild('btnAlignRight') btnAlignRight: ElementRef;\n @ViewChild('btnLink') btnLink: ElementRef;\n @ViewChild('btnUl') btnUl: ElementRef;\n @ViewChild('btnOl') btnOl: ElementRef;\n @ViewChild('btnImage') btnImage: ElementRef;\n\n @Output() fngChange = new EventEmitter<any>();\n @Output() change = new EventEmitter<any>();\n\n @Input() config: TextEditorConfiguration = this.defaultConfig;\n @Input() modules: any;\n @Input() label: string;\n @Input() readOnly: boolean;\n @Input() maxLength: number;\n @Input() error: string;\n @Input() hint: string;\n @Input()\n set value(value: string) {\n if (this.innerValue !== value) {\n this.innerValue = value;\n this.changed.forEach(f => {\n this.fngChange.emit(this.innerValue);\n this.change.emit(this.innerValue);\n return f(value);\n });\n }\n }\n\n get value() {\n return this.innerValue;\n }\n\n // needed to access editor content\n valueGetter = (editorElement: HTMLElement): string | any => {\n let html: string | null = editorElement.querySelector('.ql-editor').innerHTML;\n if (html === '<p><br></p>' || html === '<div><br></div>') {\n html = null;\n }\n return html;\n };\n\n // needed to access editor content\n valueSetter = (quillEditor: QuillType, value: any): any => {\n value = this.domSanitizer.sanitize(SecurityContext.HTML, value);\n value = this.handleWhitespace(value);\n return quillEditor.clipboard.convert(value);\n };\n\n constructor(public elementRef: ElementRef, private renderer: Renderer2, private domSanitizer: DomSanitizer) {\n super();\n }\n\n ngOnInit(): void {\n this.id = (Math.random() * Date.now()).toString().replace('.', '-');\n }\n\n ngAfterViewInit(): void {\n this.editorElem = this.elementRef.nativeElement.querySelector(`#editor-${this.id}`);\n\n this.quillEditor = new QuillType(this.editorElem, {\n modules: { toolbar: `#editor-toolbar-${this.id}`, ...this.modules },\n theme: 'snow',\n scrollingContainer: `#editor-container-${this.id}`\n });\n this.setEditorLabel();\n this.addWhitespaceMatcher();\n this.addImageMatcher();\n\n if (this.innerValue) {\n const content = this.valueSetter(this.quillEditor, this.innerValue);\n this.quillEditor.setContents(content, 'silent');\n this.quillEditor.getModule('history').clear();\n }\n\n this.handle();\n\n this.quillEditor.on('text-change', () => {\n this.value = this.valueGetter(this.editorElem);\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes?.config?.currentValue != null) {\n this.config = { toolbar: { ...this.defaultConfig.toolbar, ...changes.config.currentValue?.toolbar } };\n }\n\n if (!this.quillEditor) {\n return;\n }\n\n this.handle();\n }\n\n writeValue(value: string) {\n if (value === null || value === '') {\n return;\n }\n\n this.innerValue = value;\n\n if (!this.quillEditor) {\n return;\n }\n\n const content = this.valueSetter(this.quillEditor, value);\n this.quillEditor.setContents(content);\n }\n\n setDisabledState(isDisabled: boolean = this.disabled): void {\n this.disabled = isDisabled;\n if (this.quillEditor) {\n if (isDisabled) {\n this.quillEditor.disable();\n this.renderer.setAttribute(this.elementRef.nativeElement, 'disabled', 'disabled');\n } else {\n if (!this.readOnly) {\n this.quillEditor.enable();\n }\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'disabled');\n }\n }\n }\n\n setReadOnlyState() {\n this.quillEditor.enable(!this.readOnly);\n }\n\n delegate(event: any, action: string) {\n let btn: HTMLElement = null;\n switch (action) {\n case 'bold':\n btn = this.btnBold.nativeElement;\n btn.click();\n break;\n case 'italic':\n btn = this.btnItalic.nativeElement;\n btn.click();\n break;\n case 'underline':\n btn = this.btnUnderline.nativeElement;\n btn.click();\n break;\n case 'align-center':\n btn = this.btnAlignCenter.nativeElement;\n btn.click();\n break;\n case 'align-right':\n btn = this.btnAlignRight.nativeElement;\n btn.click();\n break;\n case 'link':\n btn = this.btnLink.nativeElement;\n btn.click();\n break;\n case 'ul':\n btn = this.btnUl.nativeElement;\n btn.click();\n break;\n case 'ol':\n btn = this.btnOl.nativeElement;\n btn.click();\n break;\n case 'image':\n btn = this.btnImage.nativeElement;\n btn.click();\n break;\n default:\n break;\n }\n }\n\n currentLength(): number {\n return this.value?.length;\n }\n\n hideDivider(name: string) {\n const linkOrImage = this.config.toolbar.image || this.config.toolbar.link;\n const lists = this.config.toolbar.bulletList || this.config.toolbar.orderedList;\n const typos = this.config.toolbar.bold || this.config.toolbar.italic || this.config.toolbar.underline;\n const textAlign = this.config.toolbar.alignCenter || this.config.toolbar.alignRight;\n switch (name) {\n case 'typo':\n return !typos || (!textAlign && !linkOrImage && !lists);\n case 'text-align':\n return !textAlign || (!linkOrImage && !lists);\n case 'lists':\n return !lists || !linkOrImage;\n case 'image':\n return !this.config.toolbar.image || !this.config.toolbar.link;\n default:\n break;\n }\n }\n\n private setEditorLabel() {\n const editorDiv = this.elementRef.nativeElement.querySelector('.ql-editor');\n this.renderer.setAttribute(editorDiv, 'role', 'textbox');\n this.renderer.setAttribute(editorDiv, 'aria-labelledby', `editor-label-${this.id}`);\n this.renderer.setAttribute(editorDiv, 'aria-multiline', 'true');\n }\n\n private handle() {\n this.setReadOnlyState();\n this.setDisabledState();\n }\n\n private addWhitespaceMatcher() {\n // set up a matcher that replaces placeholder ###tab### with \\t in delta again\n this.quillEditor.clipboard.addMatcher('p', (_node, delta) => {\n let str = JSON.stringify(delta);\n str = str.replace(/###tab###/g, '\\\\t');\n delta = JSON.parse(str);\n return delta;\n });\n }\n\n private addImageMatcher() {\n // set up a matcher that does allow/disallow to paste images corresponding to config settings\n this.quillEditor.clipboard.addMatcher('img', (_node, delta) => {\n // allowed, passthru delta\n if (this.config.toolbar.image === true) {\n return delta;\n }\n\n // not allowed, remove image by setting up a new delta\n const Delta = QuillType.import('quill-delta');\n return new Delta().insert('');\n });\n }\n\n private handleWhitespace(value: string): string {\n // set a placeholder for tab entity to avoid that quill removes it\n return value.replace(/&#9;/gi, '###tab###');\n }\n}\n","<label class=\"fwe-input-text\" [class.fwe-disabled]=\"disabled\">\n <div class=\"fng-editor-toolbar\" [id]=\"'editor-toolbar-' + id\">\n <span class=\"ql-formats fwe-d-none\">\n <select class=\"ql-size\" aria-hidden=\"true\">\n <option value=\"small\"></option>\n <option selected></option>\n <option value=\"large\"></option>\n <option value=\"huge\"></option>\n </select>\n </span>\n <span class=\"ql-formats fng-editor-toolbar-buttons-container fwe-mr-3\">\n <ng-container *ngIf=\"config?.toolbar?.bold\">\n <button type=\"button\" #btnBold class=\"ql-bold fwe-d-none action-bold\" aria-hidden=\"true\"></button>\n <button\n type=\"button\"\n class=\"fwe-btn fng-button\"\n [class.fwe-mr-3]=\"config?.toolbar?.underline || config?.toolbar?.italic\"\n (click)=\"delegate($event, 'bold')\"\n [disabled]=\"disabled\"\n >\n <div class=\"fng-button-text fng-text-bold\">B</div>\n </button>\n </ng-container>\n <ng-container *ngIf=\"config?.toolbar?.italic\">\n <button type=\"button\" #btnItalic class=\"ql-italic fwe-d-none action-italic\" aria-hidden=\"true\"></button>\n <button\n type=\"button\"\n class=\"fwe-btn fng-button\"\n [class.fwe-mr-3]=\"config?.toolbar?.underline\"\n (click)=\"delegate($event, 'italic')\"\n [disabled]=\"disabled\"\n >\n <div class=\"fng-button-text fng-text-italic\">I</div>\n </button>\n </ng-container>\n <ng-container *ngIf=\"config?.toolbar?.underline\">\n <button type=\"button\" #btnUnderline class=\"ql-underline fwe-d-none action-underline\" aria-hidden=\"true\"></button>\n <button type=\"button\" class=\"fwe-btn fng-button\" (click)=\"delegate($event, 'underline')\" [disabled]=\"disabled\">\n <div class=\"fng-button-text fng-text-underline\">U</div>\n </button>\n </ng-container>\n\n <div *ngIf=\"!hideDivider('typo')\" class=\"fng-divider-y fwe-mx-4\"></div>\n\n <ng-container *ngIf=\"config?.toolbar?.alignCenter\">\n <button\n type=\"button\"\n #btnAlignCenter\n class=\"ql-align fwe-d-none action-align-center\"\n aria-hidden=\"true\"\n value=\"center\"\n ></button>\n <button\n type=\"button\"\n class=\"fwe-btn fng-btn-toolbar-list fng-button\"\n [class.fwe-mr-3]=\"config?.toolbar?.alignRight\"\n (click)=\"delegate($event, 'align-center')\"\n [disabled]=\"disabled\"\n >\n <i class=\"fwe-icon fwe-icon-toolbar-list fng-icon-text-align-center fwe-pr-0\" [class.fng-gray]=\"disabled\"></i>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"config?.toolbar?.alignRight\">\n <button type=\"button\" #btnAlignRight class=\"ql-align fwe-d-none action-align-right\" aria-hidden=\"true\" value=\"right\"></button>\n <button\n type=\"button\"\n class=\"fwe-btn fng-btn-toolbar-list fng-button\"\n (click)=\"delegate($event, 'align-right')\"\n [disabled]=\"disabled\"\n >\n <i class=\"fwe-icon fwe-icon-toolbar-list fng-icon-text-align-right fwe-pr-0\" [class.fng-gray]=\"disabled\"></i>\n </button>\n </ng-container>\n\n <div *ngIf=\"!hideDivider('text-align')\" class=\"fng-divider-y fwe-mx-4\"></div>\n\n <ng-container *ngIf=\"config?.toolbar?.bulletList\">\n <button type=\"button\" #btnUl class=\"ql-list fwe-d-none action-ul\" aria-hidden=\"true\" value=\"bullet\"></button>\n <button\n type=\"button\"\n class=\"fwe-btn fng-btn-toolbar-list fng-button\"\n [class.fwe-mr-3]=\"config?.toolbar?.orderedList\"\n (click)=\"delegate($event, 'ul')\"\n [disabled]=\"disabled\"\n >\n <i class=\"fwe-icon fwe-icon-toolbar-list fwe-icon-list-list-view fwe-pr-0\"></i>\n </button>\n </ng-container>\n <ng-container *ngIf=\"config?.toolbar?.orderedList\">\n <button type=\"button\" #btnOl class=\"ql-list fwe-d-none action-ol\" aria-hidden=\"true\" value=\"ordered\"></button>\n <button type=\"button\" class=\"fwe-btn fng-btn-toolbar-list fng-button\" (click)=\"delegate($event, 'ol')\" [disabled]=\"disabled\">\n <i class=\"fwe-icon fwe-icon-toolbar-list fwe-icon-enumeration fwe-pr-0\"></i>\n </button>\n </ng-container>\n\n <div *ngIf=\"!hideDivider('lists')\" class=\"fng-divider-y fwe-mx-4\"></div>\n\n <ng-container *ngIf=\"config?.toolbar?.image\">\n <button type=\"button\" class=\"fwe-btn fng-btn-toolbar-list fng-button\" (click)=\"delegate($event, 'image')\" [disabled]=\"disabled\">\n <i class=\"fwe-icon fwe-icon-toolbar-list fwe-icon-image-image fwe-pr-0\"></i>\n </button>\n <button type=\"button\" #btnImage class=\"ql-image fwe-d-none\" aria-hidden=\"true\"></button>\n </ng-container>\n\n <div *ngIf=\"!hideDivider('image')\" class=\"fng-divider-y fwe-mx-4\"></div>\n\n <ng-container *ngIf=\"config?.toolbar?.link\">\n <button type=\"button\" class=\"fwe-btn fng-btn-toolbar-list fng-button\" (click)=\"delegate($event, 'link')\" [disabled]=\"disabled\">\n <i class=\"fwe-icon fwe-icon-toolbar-list fwe-icon-file-link fwe-pr-0\"></i>\n </button>\n <button type=\"button\" #btnLink class=\"ql-link fwe-d-none\" aria-hidden=\"true\"></button>\n </ng-container>\n </span>\n </div>\n <div class=\"fng-editor-container\" [id]=\"'editor-container-' + id\">\n <div class=\"fng-editor\" [id]=\"'editor-' + id\"></div>\n </div>\n <span class=\"fwe-input-text-label\" [id]=\"'editor-label-' + id\">{{ label }}</span>\n <span *ngIf=\"hint\" class=\"fng-text-editor-info\">{{ hint }}</span>\n <span *ngIf=\"error\" class=\"fng-text-editor-invalid\">{{ error }}</span>\n <span *ngIf=\"maxLength > 0 && value != null\" class=\"fwe-input-text-count\">{{ currentLength() }} / {{ maxLength }}</span>\n</label>\n"]}
@@ -1,189 +0,0 @@
1
- import { Component, Input, forwardRef, ViewChild, ElementRef, ViewEncapsulation } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "@angular/common";
6
- /**
7
- * A custom form element for text inputs.
8
- */
9
- export class TextInputComponent {
10
- constructor() {
11
- this.innerType = 'text';
12
- this.innerReadonly = false;
13
- this.innerDisabled = false;
14
- this.innerRequired = false;
15
- }
16
- /**
17
- * A string specifying the type of control to render.
18
- */
19
- get type() {
20
- return this.innerType;
21
- }
22
- set type(value) {
23
- const supported = ['text', 'number', 'password', 'date', 'time', 'datetime-local'];
24
- if (value != null && supported.indexOf(value) !== -1) {
25
- this.innerType = value;
26
- }
27
- else {
28
- this.innerType = 'text';
29
- }
30
- }
31
- get readonly() {
32
- return this.innerReadonly;
33
- }
34
- set readonly(value) {
35
- this.innerReadonly = coerceBooleanProperty(value);
36
- }
37
- /**
38
- * When true the control's disabled attribute is set
39
- * and it gets addeed the .disabled css class.
40
- */
41
- get disabled() {
42
- return this.innerDisabled;
43
- }
44
- set disabled(value) {
45
- this.innerDisabled = coerceBooleanProperty(value);
46
- if (this.focused) {
47
- this.focused = false;
48
- }
49
- }
50
- /**
51
- * The getter for value.
52
- */
53
- get value() {
54
- return this.innerValue;
55
- }
56
- /**
57
- * The setter for value.
58
- */
59
- set value(value) {
60
- if (value != null) {
61
- value = '' + value;
62
- }
63
- this.innerValue = value;
64
- this.focused = !!value;
65
- if (this.onChange != null) {
66
- this.onChange(value);
67
- }
68
- if (this.onTouched != null) {
69
- this.onTouched();
70
- }
71
- }
72
- get required() {
73
- return this.innerRequired;
74
- }
75
- set required(value) {
76
- this.innerRequired = coerceBooleanProperty(value);
77
- }
78
- /**
79
- * Called on component initialisation.
80
- */
81
- ngOnInit() {
82
- this.onBlur();
83
- }
84
- /**
85
- * Writes the value.
86
- * @param value The value.
87
- */
88
- writeValue(value) {
89
- if (value != null) {
90
- value = '' + value;
91
- }
92
- this.innerValue = value;
93
- this.focused = !!value;
94
- }
95
- /**
96
- * Registers a function to onChange.
97
- * @param fn The registered function.
98
- */
99
- registerOnChange(fn) {
100
- this.onChange = fn;
101
- }
102
- /**
103
- * Registers a function to onTouched.
104
- * @param fn The registered function.
105
- */
106
- registerOnTouched(fn) {
107
- this.onTouched = fn;
108
- }
109
- /**
110
- * Called when the text input is in focus.
111
- */
112
- onFocus() {
113
- this.focused = true;
114
- }
115
- onInput(event) {
116
- this.value = event.target.value;
117
- }
118
- /**
119
- * Called when the text input blurs.
120
- */
121
- onBlur() {
122
- if (this.focused) {
123
- this.focused = false;
124
- }
125
- }
126
- /**
127
- * Sets the disabled state.
128
- * @param isDisabled When true the control is disabled
129
- */
130
- setDisabledState(isDisabled) {
131
- this.disabled = isDisabled;
132
- }
133
- }
134
- TextInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
135
- TextInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: TextInputComponent, selector: "fng-text-input", inputs: { label: "label", type: "type", readonly: "readonly", step: "step", min: "min", max: "max", tabindex: "tabindex", placeholder: "placeholder", name: "name", disabled: "disabled", value: "value", required: "required", error: "error", hint: "hint" }, providers: [
136
- {
137
- provide: NG_VALUE_ACCESSOR,
138
- useExisting: forwardRef(() => TextInputComponent),
139
- multi: true
140
- }
141
- ], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }], ngImport: i0, template: "<label class=\"fwe-input-text\" [class.fwe-no-pointer-events]=\"readonly === true\">\n <input\n #inputElement\n [disabled]=\"disabled\"\n [required]=\"required === true || null\"\n [attr.readonly]=\"readonly === true || null\"\n [attr.placeholder]=\"placeholder || null\"\n [attr.type]=\"type\"\n [attr.step]=\"step\"\n [attr.min]=\"min\"\n [attr.max]=\"max\"\n [attr.name]=\"name || null\"\n [attr.tabindex]=\"tabindex\"\n [class.fng-has-value]=\"value != null && value !== ''\"\n autocomplete=\"off\"\n [value]=\"value\"\n (focus)=\"onFocus()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"fwe-input-text-label\">{{ label }}</span>\n <span *ngIf=\"hint; else projectedHint\" class=\"fwe-input-text-info\">{{ hint }}</span>\n <span *ngIf=\"error; else projectedError\" class=\"fwe-input-text-invalid\">{{ error }}</span>\n\n <ng-template #projectedHint>\n <span class=\"fwe-input-text-info fng-projected\"><ng-content select=\".fng-hint\"></ng-content></span>\n </ng-template>\n\n <ng-template #projectedError>\n <span class=\"fwe-input-text-invalid fng-projected\"><ng-content select=\".fng-error\"></ng-content></span>\n </ng-template>\n</label>\n", styles: ["fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text],fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password],fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date],fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local],fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]{border-bottom:1px solid var(--fwe-red)!important;box-shadow:none;outline:none}fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text]:focus,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password]:focus,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date]:focus,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local]:focus,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]:focus{border-bottom:1px solid var(--fwe-red)!important}fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text]:disabled,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password]:disabled,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date]:disabled,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local]:disabled,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]:disabled{border-bottom:1px solid var(--fwe-control-disabled)!important}fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text]:disabled~.fwe-input-text-label,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text]:disabled~.fwe-input-text-invalid,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=text]:disabled~.fwe-input-text-info,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password]:disabled~.fwe-input-text-label,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password]:disabled~.fwe-input-text-invalid,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=password]:disabled~.fwe-input-text-info,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date]:disabled~.fwe-input-text-label,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date]:disabled~.fwe-input-text-invalid,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=date]:disabled~.fwe-input-text-info,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local]:disabled~.fwe-input-text-label,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local]:disabled~.fwe-input-text-invalid,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=datetime-local]:disabled~.fwe-input-text-info,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]:disabled~.fwe-input-text-label,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]:disabled~.fwe-input-text-invalid,fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text input[type=number]:disabled~.fwe-input-text-info{color:var(--fwe-text-disabled)}fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text .fwe-input-text-info{display:none!important}fng-text-input:not(.ng-pristine).ng-invalid label.fwe-input-text .fwe-input-text-invalid{display:block!important}fng-text-input.ng-valid label.fwe-input-text input[type=text]:hover:not(:disabled),fng-text-input.ng-valid label.fwe-input-text input[type=password]:hover:not(:disabled),fng-text-input.ng-valid label.fwe-input-text input[type=date]:hover:not(:disabled),fng-text-input.ng-valid label.fwe-input-text input[type=time]:hover:not(:disabled),fng-text-input.ng-valid label.fwe-input-text input[type=datetime-local]:hover:not(:disabled),fng-text-input.ng-valid label.fwe-input-text input[type=number]:hover:not(:disabled){border-bottom:1px solid var(--fwe-hero)!important}fng-text-input label.fwe-input-text.fwe-no-pointer-events{pointer-events:none!important}.fwe-input-text-invalid.fng-projected:empty{display:none}.fwe-input-text-info.fng-projected:empty{display:none}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TextInputComponent, decorators: [{
143
- type: Component,
144
- args: [{
145
- selector: 'fng-text-input',
146
- templateUrl: './text-input.component.html',
147
- styleUrls: ['./text-input.component.scss'],
148
- providers: [
149
- {
150
- provide: NG_VALUE_ACCESSOR,
151
- useExisting: forwardRef(() => TextInputComponent),
152
- multi: true
153
- }
154
- ],
155
- encapsulation: ViewEncapsulation.None
156
- }]
157
- }], propDecorators: { label: [{
158
- type: Input
159
- }], type: [{
160
- type: Input
161
- }], readonly: [{
162
- type: Input
163
- }], step: [{
164
- type: Input
165
- }], min: [{
166
- type: Input
167
- }], max: [{
168
- type: Input
169
- }], tabindex: [{
170
- type: Input
171
- }], placeholder: [{
172
- type: Input
173
- }], name: [{
174
- type: Input
175
- }], disabled: [{
176
- type: Input
177
- }], value: [{
178
- type: Input
179
- }], required: [{
180
- type: Input
181
- }], error: [{
182
- type: Input
183
- }], hint: [{
184
- type: Input
185
- }], inputElement: [{
186
- type: ViewChild,
187
- args: ['inputElement']
188
- }] } });
189
- //# sourceMappingURL=text-input.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-input.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/forms/text-input/text-input.component.ts","../../../../../../../libs/angular/src/lib/forms/text-input/text-input.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAwB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;;;AAE9D;;GAEG;AAcH,MAAM,OAAO,kBAAkB;IAb/B;QAkCY,cAAS,GAAG,MAAM,CAAC;QASrB,kBAAa,GAAG,KAAK,CAAC;QAwBpB,kBAAa,GAAG,KAAK,CAAC;QAuCtB,kBAAa,GAAG,KAAK,CAAC;KA2FjC;IAlLC;;OAEG;IACH,IACI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,IAAI,IAAI,CAAC,KAAa;QACpB,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;QACnF,IAAI,KAAK,IAAI,IAAI,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;YACpD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;SACxB;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;SACzB;IACH,CAAC;IAGD,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a,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAKU,KAAK;sBAAb,KAAK;gBAMF,IAAI;sBADP,KAAK;gBAeF,QAAQ;sBADX,KAAK;gBASG,IAAI;sBAAZ,KAAK;gBACG,GAAG;sBAAX,KAAK;gBACG,GAAG;sBAAX,KAAK;gBACG,QAAQ;sBAAhB,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBAOF,QAAQ;sBADX,KAAK;gBA6BF,KAAK;sBADR,KAAK;gBAgBF,QAAQ;sBADX,KAAK;gBAYG,KAAK;sBAAb,KAAK;gBAKG,IAAI;sBAAZ,KAAK;gBAEqB,YAAY;sBAAtC,SAAS;uBAAC,cAAc","sourcesContent":["import { Component, OnInit, Input, forwardRef, ViewChild, ElementRef, ViewEncapsulation } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\n\n/**\n * A custom form element for text inputs.\n */\n@Component({\n selector: 'fng-text-input',\n templateUrl: './text-input.component.html',\n styleUrls: ['./text-input.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TextInputComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TextInputComponent implements OnInit, ControlValueAccessor {\n /**\n * The text input label.\n */\n @Input() label: string;\n\n /**\n * A string specifying the type of control to render.\n */\n @Input()\n get type(): string {\n return this.innerType;\n }\n set type(value: string) {\n const supported = ['text', 'number', 'password', 'date', 'time', 'datetime-local'];\n if (value != null && supported.indexOf(value) !== -1) {\n this.innerType = value;\n } else {\n this.innerType = 'text';\n }\n }\n protected innerType = 'text';\n\n @Input()\n get readonly(): boolean {\n return this.innerReadonly;\n }\n set readonly(value: boolean) {\n this.innerReadonly = coerceBooleanProperty(value);\n }\n private innerReadonly = false;\n\n @Input() step: number;\n @Input() min: number;\n @Input() max: number;\n @Input() tabindex: number;\n @Input() placeholder: string;\n @Input() name: string;\n\n /**\n * When true the control's disabled attribute is set\n * and it gets addeed the .disabled css class.\n */\n @Input()\n get disabled(): boolean {\n return this.innerDisabled;\n }\n set disabled(value: boolean) {\n this.innerDisabled = coerceBooleanProperty(value);\n\n if (this.focused) {\n this.focused = false;\n }\n }\n protected innerDisabled = false;\n\n /**\n * The inner value.\n */\n innerValue: string;\n\n /**\n * The getter for value.\n */\n get value(): string {\n return this.innerValue;\n }\n\n /**\n * The setter for value.\n */\n @Input()\n set value(value: string) {\n if (value != null) {\n value = '' + value;\n }\n this.innerValue = value;\n this.focused = !!value;\n if (this.onChange != null) {\n this.onChange(value);\n }\n if (this.onTouched != null) {\n this.onTouched();\n }\n }\n\n @Input()\n get required(): boolean {\n return this.innerRequired;\n }\n set required(value: boolean) {\n this.innerRequired = coerceBooleanProperty(value);\n }\n protected innerRequired = false;\n\n /**\n * Error description when invalid.\n */\n @Input() error: string;\n\n /**\n * Hint description when valid.\n */\n @Input() hint: string;\n\n @ViewChild('inputElement') inputElement: ElementRef;\n\n /**\n * When true the text input has focus.\n */\n focused: boolean;\n\n /**\n * Triggered on change.\n */\n onChange: (value: string) => void;\n\n /**\n * Triggered on touch.\n */\n onTouched: () => void;\n\n /**\n * Called on component initialisation.\n */\n ngOnInit(): void {\n this.onBlur();\n }\n\n /**\n * Writes the value.\n * @param value The value.\n */\n writeValue(value: string): void {\n if (value != null) {\n value = '' + value;\n }\n this.innerValue = value;\n this.focused = !!value;\n }\n\n /**\n * Registers a function to onChange.\n * @param fn The registered function.\n */\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a function to onTouched.\n * @param fn The registered function.\n */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * Called when the text input is in focus.\n */\n onFocus() {\n this.focused = true;\n }\n\n onInput(event: any) {\n this.value = event.target.value;\n }\n\n /**\n * Called when the text input blurs.\n */\n onBlur() {\n if (this.focused) {\n this.focused = false;\n }\n }\n\n /**\n * Sets the disabled state.\n * @param isDisabled When true the control is disabled\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n}\n","<label class=\"fwe-input-text\" [class.fwe-no-pointer-events]=\"readonly === true\">\n <input\n #inputElement\n [disabled]=\"disabled\"\n [required]=\"required === true || null\"\n [attr.readonly]=\"readonly === true || null\"\n [attr.placeholder]=\"placeholder || null\"\n [attr.type]=\"type\"\n [attr.step]=\"step\"\n [attr.min]=\"min\"\n [attr.max]=\"max\"\n [attr.name]=\"name || null\"\n [attr.tabindex]=\"tabindex\"\n [class.fng-has-value]=\"value != null && value !== ''\"\n autocomplete=\"off\"\n [value]=\"value\"\n (focus)=\"onFocus()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"fwe-input-text-label\">{{ label }}</span>\n <span *ngIf=\"hint; else projectedHint\" class=\"fwe-input-text-info\">{{ hint }}</span>\n <span *ngIf=\"error; else projectedError\" class=\"fwe-input-text-invalid\">{{ error }}</span>\n\n <ng-template #projectedHint>\n <span class=\"fwe-input-text-info fng-projected\"><ng-content select=\".fng-hint\"></ng-content></span>\n </ng-template>\n\n <ng-template #projectedError>\n <span class=\"fwe-input-text-invalid fng-projected\"><ng-content select=\".fng-error\"></ng-content></span>\n </ng-template>\n</label>\n"]}
@@ -1,103 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- export class TimePickerDropdownComponent {
5
- constructor() {
6
- this.showSeconds = false;
7
- this.timeFormat = '24';
8
- this.dateChange = new EventEmitter();
9
- }
10
- hide(event) {
11
- if (event.key === 'Escape' || event.key === 'Enter') {
12
- this.onDateChange(true, event.key === 'Escape');
13
- }
14
- }
15
- ngAfterViewInit() {
16
- if (this.hoursInput != null && this.hoursInput.nativeElement != null) {
17
- this.hoursInput.nativeElement.focus();
18
- }
19
- }
20
- onHourUp() {
21
- var _a;
22
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setHours(this.date.getHours() + 1);
23
- this.onDateChange(false, false);
24
- }
25
- onHourDown() {
26
- var _a;
27
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setHours(this.date.getHours() - 1);
28
- this.onDateChange(false, false);
29
- }
30
- onMinuteUp() {
31
- var _a;
32
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setMinutes(this.date.getMinutes() + 1);
33
- this.onDateChange(false, false);
34
- }
35
- onMinuteDown() {
36
- var _a;
37
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setMinutes(this.date.getMinutes() - 1);
38
- this.onDateChange(false, false);
39
- }
40
- onSecondUp() {
41
- var _a;
42
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setSeconds(this.date.getSeconds() + 1);
43
- this.onDateChange(false, false);
44
- }
45
- onSecondDown() {
46
- var _a;
47
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setSeconds(this.date.getSeconds() - 1);
48
- this.onDateChange(false, false);
49
- }
50
- onHourChange(event) {
51
- var _a;
52
- const max = +event.target.max;
53
- const min = +event.target.min;
54
- const hour = +event.target.value;
55
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setHours(hour > max ? max : hour < min ? min : hour);
56
- }
57
- onMinuteChange(event) {
58
- var _a;
59
- const max = +event.target.max;
60
- const min = +event.target.min;
61
- const minute = +event.target.value;
62
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setMinutes(minute > max ? max : minute < min ? min : minute);
63
- }
64
- onSecondChange(event) {
65
- var _a;
66
- const max = +event.target.max;
67
- const min = +event.target.min;
68
- const seconds = +event.target.value;
69
- (_a = this.date) === null || _a === void 0 ? void 0 : _a.setSeconds(seconds > max ? max : seconds < min ? min : seconds);
70
- }
71
- onDateChange(close, reset) {
72
- if (this.date != null) {
73
- this.date = new Date(this.date);
74
- this.dateChange.emit({ date: !reset ? new Date(this.date) : null, close });
75
- }
76
- }
77
- }
78
- TimePickerDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TimePickerDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
79
- TimePickerDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: TimePickerDropdownComponent, selector: "fng-time-picker-dropdown", inputs: { date: "date", showSeconds: "showSeconds", timeFormat: "timeFormat" }, outputs: { dateChange: "dateChange" }, host: { listeners: { "document:keydown": "hide($event)" } }, viewQueries: [{ propertyName: "hoursInput", first: true, predicate: ["hoursInput"], descendants: true }], ngImport: i0, template: "<div class=\"fwe-timepicker\" [class.fwe-timepicker-am-pm]=\"timeFormat === '12'\">\n <div class=\"fwe-timepicker-spinners\">\n <div class=\"fwe-timepicker-spinners-hours\">\n <button type=\"button\" aria-label=\"hour up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onHourUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input #hoursInput\n aria-label=\"hours value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n tabindex=\"1\"\n step=\"1\"\n [value]=\"date | date: (timeFormat === '12' ? 'hh' : 'HH')\"\n [attr.max]=\"timeFormat === '12' ? 12 : 23\"\n (input)=\"onHourChange($event)\"\n />\n <button type=\"button\" aria-label=\"hour down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onHourDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n <div class=\"fwe-timepicker-spinners-minutes\">\n <button type=\"button\" aria-label=\"minute up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onMinuteUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input\n aria-label=\"minutes value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n step=\"1\"\n tabindex=\"2\"\n [value]=\"date | date:'mm'\"\n (input)=\"onMinuteChange($event)\"\n />\n <button type=\"button\" aria-label=\"minute down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onMinuteDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n <div *ngIf=\"showSeconds\" class=\"fwe-timepicker-spinners-seconds\">\n <button type=\"button\" aria-label=\"seconds up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onSecondUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input\n aria-label=\"seconds value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n step=\"1\"\n tabindex=\"3\"\n [value]=\"date | date:'ss'\"\n (input)=\"onSecondChange($event)\"\n />\n <button type=\"button\" aria-label=\"seconds down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onSecondDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n </div>\n <span *ngIf=\"timeFormat === '12'\" class=\"fwe-badge fwe-badge-control\">\n {{ date | date:'a' }}\n </span>\n</div>\n", styles: [".border-hero{border-color:var(--fwe-hero)!important}.fwe-timepicker{width:100%;max-width:100%}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "date": i1.DatePipe }, encapsulation: i0.ViewEncapsulation.None });
80
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TimePickerDropdownComponent, decorators: [{
81
- type: Component,
82
- args: [{
83
- selector: 'fng-time-picker-dropdown',
84
- templateUrl: './time-picker-dropdown.component.html',
85
- styleUrls: ['./time-picker-dropdown.component.scss'],
86
- encapsulation: ViewEncapsulation.None
87
- }]
88
- }], propDecorators: { date: [{
89
- type: Input
90
- }], showSeconds: [{
91
- type: Input
92
- }], timeFormat: [{
93
- type: Input
94
- }], dateChange: [{
95
- type: Output
96
- }], hoursInput: [{
97
- type: ViewChild,
98
- args: ['hoursInput']
99
- }], hide: [{
100
- type: HostListener,
101
- args: ['document:keydown', ['$event']]
102
- }] } });
103
- //# sourceMappingURL=time-picker-dropdown.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time-picker-dropdown.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.ts","../../../../../../../../libs/angular/src/lib/forms/time-picker/time-picker-dropdown/time-picker-dropdown.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;;;AAQvB,MAAM,OAAO,2BAA2B;IANxC;QAQW,gBAAW,GAAG,KAAK,CAAC;QACpB,eAAU,GAAgB,IAAI,CAAC;QAC9B,eAAU,GAAG,IAAI,YAAY,EAAkC,CAAC;KA0E3E;IArEC,IAAI,CAAC,KAAoB;QACvB,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACnD,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;SACjD;IACH,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,IAAI,IAAI,EAAE;YACnE,IAAI,CAAC,UAAU,CAAC,aAA6B,CAAC,KAAK,EAAE,CAAC;SACxD;IACH,CAAC;IAED,QAAQ;;QACN,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ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I,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;SAC5E;IACH,CAAC;;wHA7EU,2BAA2B;4GAA3B,2BAA2B,8VClBxC,2tFAgEA;2FD9Ca,2BAA2B;kBANvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,WAAW,EAAE,uCAAuC;oBACpD,SAAS,EAAE,CAAC,uCAAuC,CAAC;oBACpD,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAEU,IAAI;sBAAZ,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBACG,UAAU;sBAAlB,KAAK;gBACI,UAAU;sBAAnB,MAAM;gBAEkB,UAAU;sBAAlC,SAAS;uBAAC,YAAY;gBAGvB,IAAI;sBADH,YAAY;uBAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\n\n@Component({\n selector: 'fng-time-picker-dropdown',\n templateUrl: './time-picker-dropdown.component.html',\n styleUrls: ['./time-picker-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimePickerDropdownComponent implements AfterViewInit {\n @Input() date: Date;\n @Input() showSeconds = false;\n @Input() timeFormat: '12' | '24' = '24';\n @Output() dateChange = new EventEmitter<{ date: Date; close: boolean }>();\n\n @ViewChild('hoursInput') hoursInput: ElementRef;\n\n @HostListener('document:keydown', ['$event'])\n hide(event: KeyboardEvent) {\n if (event.key === 'Escape' || event.key === 'Enter') {\n this.onDateChange(true, event.key === 'Escape');\n }\n }\n\n ngAfterViewInit() {\n if (this.hoursInput != null && this.hoursInput.nativeElement != null) {\n (this.hoursInput.nativeElement as HTMLElement).focus();\n }\n }\n\n onHourUp() {\n this.date?.setHours(this.date.getHours() + 1);\n this.onDateChange(false, false);\n }\n\n onHourDown() {\n this.date?.setHours(this.date.getHours() - 1);\n this.onDateChange(false, false);\n }\n\n onMinuteUp() {\n this.date?.setMinutes(this.date.getMinutes() + 1);\n this.onDateChange(false, false);\n }\n\n onMinuteDown() {\n this.date?.setMinutes(this.date.getMinutes() - 1);\n this.onDateChange(false, false);\n }\n\n onSecondUp() {\n this.date?.setSeconds(this.date.getSeconds() + 1);\n this.onDateChange(false, false);\n }\n\n onSecondDown() {\n this.date?.setSeconds(this.date.getSeconds() - 1);\n this.onDateChange(false, false);\n }\n\n onHourChange(event: KeyboardEvent) {\n const max = +(event.target as HTMLInputElement).max;\n const min = +(event.target as HTMLInputElement).min;\n const hour = +(event.target as HTMLInputElement).value;\n this.date?.setHours(hour > max ? max : hour < min ? min : hour);\n }\n\n onMinuteChange(event: KeyboardEvent) {\n const max = +(event.target as HTMLInputElement).max;\n const min = +(event.target as HTMLInputElement).min;\n const minute = +(event.target as HTMLInputElement).value;\n this.date?.setMinutes(minute > max ? max : minute < min ? min : minute);\n }\n\n onSecondChange(event: KeyboardEvent) {\n const max = +(event.target as HTMLInputElement).max;\n const min = +(event.target as HTMLInputElement).min;\n const seconds = +(event.target as HTMLInputElement).value;\n this.date?.setSeconds(seconds > max ? max : seconds < min ? min : seconds);\n }\n\n onDateChange(close: boolean, reset: boolean) {\n if (this.date != null) {\n this.date = new Date(this.date);\n this.dateChange.emit({ date: !reset ? new Date(this.date) : null, close });\n }\n }\n}\n","<div class=\"fwe-timepicker\" [class.fwe-timepicker-am-pm]=\"timeFormat === '12'\">\n <div class=\"fwe-timepicker-spinners\">\n <div class=\"fwe-timepicker-spinners-hours\">\n <button type=\"button\" aria-label=\"hour up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onHourUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input #hoursInput\n aria-label=\"hours value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n tabindex=\"1\"\n step=\"1\"\n [value]=\"date | date: (timeFormat === '12' ? 'hh' : 'HH')\"\n [attr.max]=\"timeFormat === '12' ? 12 : 23\"\n (input)=\"onHourChange($event)\"\n />\n <button type=\"button\" aria-label=\"hour down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onHourDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n <div class=\"fwe-timepicker-spinners-minutes\">\n <button type=\"button\" aria-label=\"minute up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onMinuteUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input\n aria-label=\"minutes value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n step=\"1\"\n tabindex=\"2\"\n [value]=\"date | date:'mm'\"\n (input)=\"onMinuteChange($event)\"\n />\n <button type=\"button\" aria-label=\"minute down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onMinuteDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n <div *ngIf=\"showSeconds\" class=\"fwe-timepicker-spinners-seconds\">\n <button type=\"button\" aria-label=\"seconds up\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onSecondUp()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-expand\"></i>\n </button>\n <input\n aria-label=\"seconds value\"\n class=\"fwe-timepicker-hide-spinners\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n step=\"1\"\n tabindex=\"3\"\n [value]=\"date | date:'ss'\"\n (input)=\"onSecondChange($event)\"\n />\n <button type=\"button\" aria-label=\"seconds down\" class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onSecondDown()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-arrows-collapse\"></i>\n </button>\n </div>\n </div>\n <span *ngIf=\"timeFormat === '12'\" class=\"fwe-badge fwe-badge-control\">\n {{ date | date:'a' }}\n </span>\n</div>\n"]}
@@ -1,194 +0,0 @@
1
- import { Overlay } from '@angular/cdk/overlay';
2
- import { ComponentPortal } from '@angular/cdk/portal';
3
- import { Component, ElementRef, forwardRef, HostBinding, HostListener, Input, ViewChild, ViewEncapsulation } from '@angular/core';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { Subject } from 'rxjs';
6
- import { takeUntil } from 'rxjs/operators';
7
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
8
- import { TimePickerDropdownComponent } from './time-picker-dropdown/time-picker-dropdown.component';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "@angular/cdk/overlay";
11
- import * as i2 from "@angular/common";
12
- export class TimePickerComponent {
13
- constructor(overlay) {
14
- this.overlay = overlay;
15
- this.innerRequired = false;
16
- this.display = 'block';
17
- this.innerDisabled = false;
18
- this.complete = new Subject();
19
- }
20
- get value() {
21
- return this.innerValue;
22
- }
23
- set value(date) {
24
- if (!this.disabled) {
25
- this.innerValue = date;
26
- if (this.onChange != null) {
27
- this.onChange(date);
28
- }
29
- if (this.onTouched != null) {
30
- this.onTouched();
31
- }
32
- }
33
- }
34
- get disabled() {
35
- return this.innerDisabled;
36
- }
37
- set disabled(value) {
38
- this.innerDisabled = coerceBooleanProperty(value);
39
- }
40
- get required() {
41
- return this.innerRequired;
42
- }
43
- set required(value) {
44
- this.innerRequired = coerceBooleanProperty(value);
45
- }
46
- get timeFormat() {
47
- let timeFormat = 'H:mm';
48
- if (this.options != null) {
49
- if (this.options.showSeconds) {
50
- timeFormat += ':ss';
51
- }
52
- if (this.options.timeFormat === '12') {
53
- timeFormat = timeFormat.toLowerCase() + ' a';
54
- }
55
- }
56
- return timeFormat;
57
- }
58
- hide(event) {
59
- if (event.key === 'Escape') {
60
- this.dispose();
61
- }
62
- }
63
- writeValue(date) {
64
- this.innerValue = date;
65
- }
66
- registerOnChange(fn) {
67
- this.onChange = fn;
68
- }
69
- registerOnTouched(fn) {
70
- this.onTouched = fn;
71
- }
72
- setDisabledState(isDisabled) {
73
- this.disabled = isDisabled;
74
- }
75
- toggle(event) {
76
- event.preventDefault();
77
- event.stopPropagation();
78
- if (!this.disabled) {
79
- if (this.timePickerRef == null && this.connector != null && this.connector.nativeElement != null) {
80
- const labelWidth = this.connector.nativeElement.clientWidth;
81
- this.timePickerRef = this.overlay.create({
82
- width: `${labelWidth}px`,
83
- panelClass: 'fng-first-child-fullwidth',
84
- hasBackdrop: true,
85
- backdropClass: 'fng-date-picker-backdrop',
86
- scrollStrategy: this.overlay.scrollStrategies.block(),
87
- positionStrategy: this.overlay
88
- .position()
89
- .flexibleConnectedTo(this.connector.nativeElement)
90
- .withPositions([
91
- {
92
- originX: 'center',
93
- originY: 'bottom',
94
- overlayX: 'center',
95
- overlayY: 'top',
96
- offsetY: -12
97
- },
98
- {
99
- originX: 'center',
100
- originY: 'top',
101
- overlayX: 'center',
102
- overlayY: 'bottom',
103
- offsetY: 4
104
- }
105
- ])
106
- .withFlexibleDimensions(false)
107
- .withPush(false)
108
- });
109
- const timePickerPortal = new ComponentPortal(TimePickerDropdownComponent);
110
- this.timePicker = this.timePickerRef.attach(timePickerPortal);
111
- this.timePicker.instance.timeFormat = this.options != null && this.options.timeFormat != null ? this.options.timeFormat : '24';
112
- this.timePicker.instance.showSeconds = this.options != null && this.options.showSeconds != null ? this.options.showSeconds : false;
113
- this.timePicker.instance.date = new Date(this.value);
114
- this.timePicker.instance.dateChange.pipe(takeUntil(this.complete)).subscribe(ev => {
115
- if (ev.date != null) {
116
- this.value = ev.date;
117
- }
118
- if (ev.close) {
119
- this.dispose();
120
- }
121
- });
122
- this.timePickerRef
123
- .backdropClick()
124
- .pipe(takeUntil(this.complete))
125
- .subscribe(() => this.dispose());
126
- }
127
- else {
128
- this.dispose();
129
- }
130
- }
131
- }
132
- dispose() {
133
- if (this.timePickerRef != null) {
134
- this.timePickerRef.detach();
135
- this.timePickerRef.dispose();
136
- this.timePickerRef = null;
137
- }
138
- if (this.complete != null) {
139
- this.complete.next();
140
- this.complete.complete();
141
- }
142
- }
143
- }
144
- TimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TimePickerComponent, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Component });
145
- TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: TimePickerComponent, selector: "fng-time-picker", inputs: { value: "value", disabled: "disabled", required: "required", hint: "hint", error: "error", options: "options", width: "width" }, host: { listeners: { "document:keydown": "hide($event)" }, properties: { "style.width": "this.width", "style.display": "this.display" } }, providers: [
146
- {
147
- provide: NG_VALUE_ACCESSOR,
148
- useExisting: forwardRef(() => TimePickerComponent),
149
- multi: true
150
- }
151
- ], viewQueries: [{ propertyName: "connector", first: true, predicate: ["connector"], descendants: true, static: true }], ngImport: i0, template: "<label #connector class=\"fng-time-picker fwe-input-text fwe-input-text-icon\" (click)=\"toggle($event)\">\n <i class=\"fwe-icon fwe-icon-time-time\" [class.fwe-color-hero]=\"timePickerRef != null\" [class.fwe-color-control-disabled]=\"disabled\"></i>\n <input\n aria-label=\"picked time\"\n type=\"text\"\n readonly\n [required]=\"required === true || null\"\n [class.fwe-border-hero]=\"timePickerRef != null\"\n [value]=\"value | date: timeFormat\"\n [disabled]=\"disabled\"\n />\n <span class=\"fwe-input-text-label\"><ng-content></ng-content></span>\n <span *ngIf=\"hint\" class=\"fwe-input-text-info\">{{ hint }}</span>\n <span *ngIf=\"error\" class=\"fwe-input-text-invalid\">{{ error }}</span>\n</label>\n", styles: [".fng-first-child-fullwidth fng-time-picker-dropdown{width:100%}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "date": i2.DatePipe }, encapsulation: i0.ViewEncapsulation.None });
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: TimePickerComponent, decorators: [{
153
- type: Component,
154
- args: [{
155
- selector: 'fng-time-picker',
156
- templateUrl: './time-picker.component.html',
157
- styleUrls: ['./time-picker.component.scss'],
158
- providers: [
159
- {
160
- provide: NG_VALUE_ACCESSOR,
161
- useExisting: forwardRef(() => TimePickerComponent),
162
- multi: true
163
- }
164
- ],
165
- encapsulation: ViewEncapsulation.None
166
- }]
167
- }], ctorParameters: function () { return [{ type: i1.Overlay }]; }, propDecorators: { value: [{
168
- type: Input
169
- }], disabled: [{
170
- type: Input
171
- }], required: [{
172
- type: Input
173
- }], hint: [{
174
- type: Input
175
- }], error: [{
176
- type: Input
177
- }], options: [{
178
- type: Input
179
- }], width: [{
180
- type: Input
181
- }, {
182
- type: HostBinding,
183
- args: ['style.width']
184
- }], display: [{
185
- type: HostBinding,
186
- args: ['style.display']
187
- }], connector: [{
188
- type: ViewChild,
189
- args: ['connector', { static: true }]
190
- }], hide: [{
191
- type: HostListener,
192
- args: ['document:keydown', ['$event']]
193
- }] } });
194
- //# sourceMappingURL=time-picker.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time-picker.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/forms/time-picker/time-picker.component.ts","../../../../../../../libs/angular/src/lib/forms/time-picker/time-picker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAgB,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,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C1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC;YAClD,KAAK,EAAE,IAAI;SACZ;KACF,gJCxBH,quBAeA;2FDYa,mBAAmB;kBAb/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,WAAW,EAAE,8BAA8B;oBAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;oBAC3C,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,oBAAoB,CAAC;4BAClD,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8FAMK,KAAK;sBADR,KAAK;gBAcF,QAAQ;sBADX,KAAK;gBASF,QAAQ;sBADX,KAAK;gBASG,IAAI;sBAAZ,KAAK;gBACG,KAAK;sBAAb,KAAK;gBACG,OAAO;sBAAf,KAAK;gBAGsB,KAAK;sBADhC,KAAK;;sBACL,WAAW;uBAAC,aAAa;gBACI,OAAO;sBAApC,WAAW;uBAAC,eAAe;gBAEc,SAAS;sBAAlD,SAAS;uBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBA6BxC,IAAI;sBADH,YAAY;uBAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Component, ComponentRef, ElementRef, forwardRef, HostBinding, HostListener, Input, ViewChild, ViewEncapsulation } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { TimePickerDropdownComponent } from './time-picker-dropdown/time-picker-dropdown.component';\n\nexport interface TimePickerOptions {\n timeFormat?: '12' | '24';\n showSeconds?: boolean;\n}\n\n@Component({\n selector: 'fng-time-picker',\n templateUrl: './time-picker.component.html',\n styleUrls: ['./time-picker.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimePickerComponent),\n multi: true\n }\n ],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimePickerComponent implements ControlValueAccessor {\n get value(): Date {\n return this.innerValue;\n }\n @Input()\n set value(date: Date) {\n if (!this.disabled) {\n this.innerValue = date;\n if (this.onChange != null) {\n this.onChange(date);\n }\n if (this.onTouched != null) {\n this.onTouched();\n }\n }\n }\n\n @Input()\n get disabled(): boolean {\n return this.innerDisabled;\n }\n set disabled(value: boolean) {\n this.innerDisabled = coerceBooleanProperty(value);\n }\n\n @Input()\n get required(): boolean {\n return this.innerRequired;\n }\n set required(value: boolean) {\n this.innerRequired = coerceBooleanProperty(value);\n }\n protected innerRequired = false;\n\n @Input() hint: string;\n @Input() error: string;\n @Input() options: TimePickerOptions;\n\n @Input()\n @HostBinding('style.width') width: string;\n @HostBinding('style.display') display: string = 'block';\n\n @ViewChild('connector', { static: true }) connector: ElementRef;\n\n get timeFormat(): string {\n let timeFormat = 'H:mm';\n if (this.options != null) {\n if (this.options.showSeconds) {\n timeFormat += ':ss';\n }\n if (this.options.timeFormat === '12') {\n timeFormat = timeFormat.toLowerCase() + ' a';\n }\n }\n return timeFormat;\n }\n\n timePickerRef: OverlayRef;\n\n protected innerValue: Date;\n protected innerDisabled = false;\n\n private complete = new Subject();\n private timePicker: ComponentRef<TimePickerDropdownComponent>;\n\n constructor(private overlay: Overlay) {}\n\n onTouched: () => void;\n onChange: (date: Date) => void;\n\n @HostListener('document:keydown', ['$event'])\n hide(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n this.dispose();\n }\n }\n\n writeValue(date: Date): void {\n this.innerValue = date;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n toggle(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n if (!this.disabled) {\n if (this.timePickerRef == null && this.connector != null && this.connector.nativeElement != null) {\n const labelWidth = (this.connector.nativeElement as HTMLElement).clientWidth;\n this.timePickerRef = this.overlay.create({\n width: `${labelWidth}px`,\n panelClass: 'fng-first-child-fullwidth',\n hasBackdrop: true,\n backdropClass: 'fng-date-picker-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.block(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.connector.nativeElement)\n .withPositions([\n {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: -12\n },\n {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: 4\n }\n ])\n .withFlexibleDimensions(false)\n .withPush(false)\n });\n const timePickerPortal = new ComponentPortal(TimePickerDropdownComponent);\n this.timePicker = this.timePickerRef.attach(timePickerPortal);\n this.timePicker.instance.timeFormat = this.options != null && this.options.timeFormat != null ? this.options.timeFormat : '24';\n this.timePicker.instance.showSeconds = this.options != null && this.options.showSeconds != null ? this.options.showSeconds : false;\n this.timePicker.instance.date = new Date(this.value);\n this.timePicker.instance.dateChange.pipe(takeUntil(this.complete)).subscribe(ev => {\n if (ev.date != null) {\n this.value = ev.date;\n }\n if (ev.close) {\n this.dispose();\n }\n });\n this.timePickerRef\n .backdropClick()\n .pipe(takeUntil(this.complete))\n .subscribe(() => this.dispose());\n } else {\n this.dispose();\n }\n }\n }\n\n private dispose() {\n if (this.timePickerRef != null) {\n this.timePickerRef.detach();\n this.timePickerRef.dispose();\n this.timePickerRef = null;\n }\n if (this.complete != null) {\n this.complete.next();\n this.complete.complete();\n }\n }\n}\n","<label #connector class=\"fng-time-picker fwe-input-text fwe-input-text-icon\" (click)=\"toggle($event)\">\n <i class=\"fwe-icon fwe-icon-time-time\" [class.fwe-color-hero]=\"timePickerRef != null\" [class.fwe-color-control-disabled]=\"disabled\"></i>\n <input\n aria-label=\"picked time\"\n type=\"text\"\n readonly\n [required]=\"required === true || null\"\n [class.fwe-border-hero]=\"timePickerRef != null\"\n [value]=\"value | date: timeFormat\"\n [disabled]=\"disabled\"\n />\n <span class=\"fwe-input-text-label\"><ng-content></ng-content></span>\n <span *ngIf=\"hint\" class=\"fwe-input-text-info\">{{ hint }}</span>\n <span *ngIf=\"error\" class=\"fwe-input-text-invalid\">{{ error }}</span>\n</label>\n"]}