@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,73 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, 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 ConfirmComponent {
5
- constructor(cd) {
6
- this.cd = cd;
7
- this.hasScrollableContent = true;
8
- this.close = new EventEmitter();
9
- this.cancel = new EventEmitter();
10
- this.ok = new EventEmitter();
11
- }
12
- onKeyUp(event) {
13
- event.preventDefault();
14
- event.stopPropagation();
15
- if (event.key === 'Esc' || event.key === 'Escape') {
16
- this.onClose();
17
- }
18
- }
19
- ngAfterViewInit() {
20
- if (this.closeBtn) {
21
- this.closeBtn.nativeElement.focus();
22
- }
23
- if (this.content) {
24
- const el = this.content.nativeElement;
25
- const clientHeight = el.getBoundingClientRect().height;
26
- const scrollHeight = el.scrollHeight;
27
- this.hasScrollableContent = this.shouldScroll(clientHeight, scrollHeight);
28
- this.cd.detectChanges();
29
- }
30
- }
31
- onClose() {
32
- this.close.emit();
33
- }
34
- onOk() {
35
- this.ok.emit();
36
- }
37
- onCancel() {
38
- this.cancel.emit();
39
- }
40
- shouldScroll(clientHeight, scrollHeight) {
41
- return scrollHeight > clientHeight;
42
- }
43
- }
44
- ConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ConfirmComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
45
- ConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: ConfirmComponent, selector: "fng-confirm", inputs: { data: "data" }, outputs: { close: "close", cancel: "cancel", ok: "ok" }, host: { listeners: { "window:keyup": "onKeyUp($event)" } }, viewQueries: [{ propertyName: "closeBtn", first: true, predicate: ["closeBtn"], descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "<div class=\"fwe-modal\" [ngClass]=\"{ 'fwe-modal--with-scrollable-content': hasScrollableContent }\">\n <div class=\"fwe-modal-close\">\n <button type=\"button\" aria-label=\"Close\" #closeBtn class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onClose()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-close-small\"></i>\n <span class=\"fwe-sr-only\">Close</span>\n </button>\n </div>\n <div class=\"fwe-modal-header\">\n <h2 *ngIf=\"data?.subtitle\" class=\"fwe-modal-h2\">{{ data?.subtitle }}</h2>\n <h1 class=\"fwe-modal-h1\">{{ data?.title }}</h1>\n </div>\n <div class=\"fwe-modal-body\" #content>\n <p>{{ data?.body }}</p>\n </div>\n <div class=\"fwe-modal-footer\" *ngIf=\"data?.cancel || data?.ok\">\n <div class=\"fwe-modal-buttons\" [ngClass]=\"{ 'fwe-modal-buttons--full-width': !hasScrollableContent }\">\n <button *ngIf=\"data?.cancel\" type=\"button\" aria-label=\"Cancel\" class=\"fwe-btn fwe-btn-lg\" (click)=\"onCancel()\">\n {{ data?.cancel }}\n </button>\n <button *ngIf=\"data?.ok\" type=\"button\" aria-label=\"Ok\" class=\"fwe-btn fwe-btn-lg fwe-btn-hero\" (click)=\"onOk()\">\n {{ data?.ok }}\n </button>\n </div>\n </div>\n</div>\n", styles: [""], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ConfirmComponent, decorators: [{
47
- type: Component,
48
- args: [{
49
- selector: 'fng-confirm',
50
- templateUrl: './confirm.component.html',
51
- styleUrls: ['./confirm.component.scss'],
52
- changeDetection: ChangeDetectionStrategy.OnPush,
53
- encapsulation: ViewEncapsulation.None
54
- }]
55
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { data: [{
56
- type: Input
57
- }], close: [{
58
- type: Output
59
- }], cancel: [{
60
- type: Output
61
- }], ok: [{
62
- type: Output
63
- }], closeBtn: [{
64
- type: ViewChild,
65
- args: ['closeBtn']
66
- }], content: [{
67
- type: ViewChild,
68
- args: ['content']
69
- }], onKeyUp: [{
70
- type: HostListener,
71
- args: ['window:keyup', ['$event']]
72
- }] } });
73
- //# sourceMappingURL=confirm.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/components/modals/confirm/confirm.component.ts","../../../../../../../../libs/angular/src/lib/components/modals/confirm/confirm.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;;;AAmBvB,MAAM,OAAO,gBAAgB;IAqB3B,YAAoB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;QApBzC,yBAAoB,GAAY,IAAI,CAAC;QAG3B,UAAK,GAAG,IAAI,YAAY,EAAO,CAAC;QAChC,WAAM,GAAG,IAAI,YAAY,EAAO,CAAC;QACjC,OAAE,GAAG,IAAI,YAAY,EAAO,CAAC;IAeK,CAAC;IAT7C,OAAO,CAAC,KAAoB;QAC1B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QAExB,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;YACjD,IAAI,CAAC,OAAO,EAAE,CAAC;SAChB;IACH,CAAC;IAID,eAAe;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;YAChB,IAAI,CAAC,QAAQ,CAAC,aAA6B,CAAC,KAAK,EAAE,CAAC;SACtD;QAED,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,MAAM,EAAE,GAAgB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YACnD,MAAM,YAAY,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;YACvD,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC;YACrC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAC1E,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;SACzB;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAEO,YAAY,CAAC,YAAoB,EAAE,YAAoB;QAC7D,OAAO,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;;6GAnDU,gBAAgB;iGAAhB,gBAAgB,6XC/B7B,qtCAyBA;2FDMa,gBAAgB;kBAP5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,WAAW,EAAE,0BAA0B;oBACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;oBACvC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;wGAIU,IAAI;sBAAZ,KAAK;gBACI,KAAK;sBAAd,MAAM;gBACG,MAAM;sBAAf,MAAM;gBACG,EAAE;sBAAX,MAAM;gBAEgB,QAAQ;sBAA9B,SAAS;uBAAC,UAAU;gBACC,OAAO;sBAA5B,SAAS;uBAAC,SAAS;gBAGpB,OAAO;sBADN,YAAY;uBAAC,cAAc,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { Modal } from '../index';\n\nexport interface ConfirmData {\n title: string;\n subtitle?: string;\n body: string;\n cancel?: string;\n ok?: string;\n}\n\n@Component({\n selector: 'fng-confirm',\n templateUrl: './confirm.component.html',\n styleUrls: ['./confirm.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class ConfirmComponent implements AfterViewInit, Modal<ConfirmData, any> {\n hasScrollableContent: boolean = true;\n\n @Input() data: ConfirmData;\n @Output() close = new EventEmitter<any>();\n @Output() cancel = new EventEmitter<any>();\n @Output() ok = new EventEmitter<any>();\n\n @ViewChild('closeBtn') closeBtn: ElementRef;\n @ViewChild('content') content: ElementRef;\n\n @HostListener('window:keyup', ['$event'])\n onKeyUp(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.key === 'Esc' || event.key === 'Escape') {\n this.onClose();\n }\n }\n\n constructor(private cd: ChangeDetectorRef) {}\n\n ngAfterViewInit() {\n if (this.closeBtn) {\n (this.closeBtn.nativeElement as HTMLElement).focus();\n }\n\n if (this.content) {\n const el: HTMLElement = this.content.nativeElement;\n const clientHeight = el.getBoundingClientRect().height;\n const scrollHeight = el.scrollHeight;\n this.hasScrollableContent = this.shouldScroll(clientHeight, scrollHeight);\n this.cd.detectChanges();\n }\n }\n\n onClose() {\n this.close.emit();\n }\n\n onOk() {\n this.ok.emit();\n }\n\n onCancel() {\n this.cancel.emit();\n }\n\n private shouldScroll(clientHeight: number, scrollHeight: number): boolean {\n return scrollHeight > clientHeight;\n }\n}\n","<div class=\"fwe-modal\" [ngClass]=\"{ 'fwe-modal--with-scrollable-content': hasScrollableContent }\">\n <div class=\"fwe-modal-close\">\n <button type=\"button\" aria-label=\"Close\" #closeBtn class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onClose()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-close-small\"></i>\n <span class=\"fwe-sr-only\">Close</span>\n </button>\n </div>\n <div class=\"fwe-modal-header\">\n <h2 *ngIf=\"data?.subtitle\" class=\"fwe-modal-h2\">{{ data?.subtitle }}</h2>\n <h1 class=\"fwe-modal-h1\">{{ data?.title }}</h1>\n </div>\n <div class=\"fwe-modal-body\" #content>\n <p>{{ data?.body }}</p>\n </div>\n <div class=\"fwe-modal-footer\" *ngIf=\"data?.cancel || data?.ok\">\n <div class=\"fwe-modal-buttons\" [ngClass]=\"{ 'fwe-modal-buttons--full-width': !hasScrollableContent }\">\n <button *ngIf=\"data?.cancel\" type=\"button\" aria-label=\"Cancel\" class=\"fwe-btn fwe-btn-lg\" (click)=\"onCancel()\">\n {{ data?.cancel }}\n </button>\n <button *ngIf=\"data?.ok\" type=\"button\" aria-label=\"Ok\" class=\"fwe-btn fwe-btn-lg fwe-btn-hero\" (click)=\"onOk()\">\n {{ data?.ok }}\n </button>\n </div>\n </div>\n</div>\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/components/modals/index.ts"],"names":[],"mappings":"","sourcesContent":["import { EventEmitter, OnChanges } from '@angular/core';\nimport { GlobalPositionStrategy } from '@angular/cdk/overlay';\n\nexport type ModalUserAction = 'ok' | 'cancel' | 'close' | 'backdrop' | 'navigated';\n\nexport interface Modal<TData, TResult> extends Partial<OnChanges> {\n data: TData;\n close: EventEmitter<any>;\n cancel: EventEmitter<any>;\n ok: EventEmitter<TResult>;\n}\n\nexport interface ModalOptions {\n hasBackdrop?: boolean;\n shouldCloseOnBackdrop?: boolean;\n backdropClass?: string;\n positionStrategy?: GlobalPositionStrategy;\n overlayClass?: string;\n closeOnNavigation?: boolean;\n}\n\nexport interface ModalResult<TResult> {\n userAction: ModalUserAction;\n result?: TResult;\n}\n"]}
@@ -1,91 +0,0 @@
1
- import { Injectable, SimpleChange } from '@angular/core';
2
- import { NavigationStart, Router } from '@angular/router';
3
- import { Overlay } from '@angular/cdk/overlay';
4
- import { ComponentPortal } from '@angular/cdk/portal';
5
- import { filter, takeUntil } from 'rxjs/operators';
6
- import { AlertComponent } from './alert/alert.component';
7
- import { ConfirmComponent } from './confirm/confirm.component';
8
- import { Subject } from 'rxjs';
9
- import { PromptComponent } from './prompt/prompt.component';
10
- import * as i0 from "@angular/core";
11
- import * as i1 from "@angular/cdk/overlay";
12
- import * as i2 from "@angular/router";
13
- export class ModalService {
14
- constructor(overlay, router) {
15
- this.overlay = overlay;
16
- this.router = router;
17
- }
18
- alert(data, options) {
19
- return this.open(data, AlertComponent, Object.assign({ backdropClass: 'fwe-modal-backdrop', hasBackdrop: true, shouldCloseOnBackdrop: true }, options));
20
- }
21
- confirm(data, options) {
22
- options = options || Object.assign({ backdropClass: 'fwe-modal-backdrop', hasBackdrop: true, shouldCloseOnBackdrop: true }, options);
23
- return this.open(data, ConfirmComponent, options);
24
- }
25
- prompt(data, options) {
26
- options = options || Object.assign({ backdropClass: 'fwe-modal-backdrop', hasBackdrop: true, shouldCloseOnBackdrop: true }, options);
27
- return this.open(data, PromptComponent, options);
28
- }
29
- open(data, modal, options) {
30
- return new Promise((resolve, reject) => {
31
- const complete = new Subject();
32
- const positionStrategy = options.positionStrategy || this.overlay.position().global().centerHorizontally().centerVertically();
33
- const scrollStrategy = this.overlay.scrollStrategies.block();
34
- const overlayRef = this.overlay.create(Object.assign({ panelClass: options.overlayClass, positionStrategy,
35
- scrollStrategy, backdropClass: 'fwe-modal-backdrop', hasBackdrop: true }, options));
36
- if (options.closeOnNavigation) {
37
- this.router.events
38
- .pipe(filter(e => e instanceof NavigationStart), takeUntil(complete))
39
- .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'navigated' })));
40
- }
41
- if (options.shouldCloseOnBackdrop) {
42
- overlayRef
43
- .backdropClick()
44
- .pipe(takeUntil(complete))
45
- .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'backdrop' })));
46
- }
47
- const modalPortal = new ComponentPortal(modal);
48
- const componentRef = overlayRef.attach(modalPortal);
49
- if (componentRef != null && componentRef.instance != null) {
50
- componentRef.instance.data = data;
51
- if (componentRef.instance.close != null) {
52
- componentRef.instance.close
53
- .pipe(takeUntil(complete))
54
- .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'close' })));
55
- }
56
- if (componentRef.instance.cancel != null) {
57
- componentRef.instance.cancel
58
- .pipe(takeUntil(complete))
59
- .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'cancel' })));
60
- }
61
- if (componentRef.instance.ok != null) {
62
- componentRef.instance.ok
63
- .pipe(takeUntil(complete))
64
- .subscribe(result => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'ok', result })));
65
- }
66
- if (componentRef.instance.ngOnChanges != null) {
67
- componentRef.instance.ngOnChanges({ data: new SimpleChange(null, data, true) });
68
- }
69
- }
70
- else {
71
- this.dispose(overlayRef, complete).then(() => reject(new Error('Could not attach component to overlay.')));
72
- }
73
- });
74
- }
75
- dispose(overlayRef, complete) {
76
- return new Promise(resolve => {
77
- complete.next();
78
- complete.complete();
79
- complete.unsubscribe();
80
- overlayRef.dispose();
81
- resolve();
82
- });
83
- }
84
- }
85
- ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ModalService, deps: [{ token: i1.Overlay }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
86
- ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ModalService, providedIn: 'root' });
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ModalService, decorators: [{
88
- type: Injectable,
89
- args: [{ providedIn: 'root' }]
90
- }], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i2.Router }]; } });
91
- //# sourceMappingURL=modal.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/components/modals/modal.service.ts"],"names":[],"mappings":"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","sourcesContent":["import { Injectable, SimpleChange } from '@angular/core';\nimport { NavigationStart, Router } from '@angular/router';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal, ComponentType } from '@angular/cdk/portal';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport { Modal, ModalOptions, ModalResult } from './index';\nimport { AlertComponent, AlertData } from './alert/alert.component';\nimport { ConfirmComponent, ConfirmData } from './confirm/confirm.component';\nimport { Subject } from 'rxjs';\nimport { PromptComponent, PromptData } from './prompt/prompt.component';\n\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n constructor(protected overlay: Overlay, private router: Router) {}\n\n alert(data: AlertData, options?: ModalOptions) {\n return this.open<AlertData, any, AlertComponent>(data, AlertComponent, {\n backdropClass: 'fwe-modal-backdrop',\n hasBackdrop: true,\n shouldCloseOnBackdrop: true,\n ...options\n });\n }\n\n confirm(data: ConfirmData, options?: ModalOptions) {\n options = options || {\n backdropClass: 'fwe-modal-backdrop',\n hasBackdrop: true,\n shouldCloseOnBackdrop: true,\n ...options\n };\n return this.open<ConfirmData, any, ConfirmComponent>(data, ConfirmComponent, options);\n }\n\n prompt(data: PromptData, options?: ModalOptions) {\n options = options || {\n backdropClass: 'fwe-modal-backdrop',\n hasBackdrop: true,\n shouldCloseOnBackdrop: true,\n ...options\n };\n return this.open<PromptData, any, PromptComponent>(data, PromptComponent, options);\n }\n\n open<TData, TResult, TModal extends Modal<TData, TResult>>(\n data: TData,\n modal: ComponentType<TModal>,\n options: ModalOptions\n ): Promise<ModalResult<TResult>> {\n return new Promise((resolve, reject) => {\n const complete = new Subject<boolean>();\n const positionStrategy = options.positionStrategy || this.overlay.position().global().centerHorizontally().centerVertically();\n const scrollStrategy = this.overlay.scrollStrategies.block();\n const overlayRef = this.overlay.create({\n panelClass: options.overlayClass,\n positionStrategy,\n scrollStrategy,\n backdropClass: 'fwe-modal-backdrop',\n hasBackdrop: true,\n ...options\n });\n\n if (options.closeOnNavigation) {\n this.router.events\n .pipe(\n filter(e => e instanceof NavigationStart),\n takeUntil(complete)\n )\n .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'navigated' })));\n }\n\n if (options.shouldCloseOnBackdrop) {\n overlayRef\n .backdropClick()\n .pipe(takeUntil(complete))\n .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'backdrop' })));\n }\n\n const modalPortal = new ComponentPortal(modal);\n const componentRef = overlayRef.attach(modalPortal);\n if (componentRef != null && componentRef.instance != null) {\n componentRef.instance.data = data;\n if (componentRef.instance.close != null) {\n componentRef.instance.close\n .pipe(takeUntil(complete))\n .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'close' })));\n }\n if (componentRef.instance.cancel != null) {\n componentRef.instance.cancel\n .pipe(takeUntil(complete))\n .subscribe(() => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'cancel' })));\n }\n if (componentRef.instance.ok != null) {\n componentRef.instance.ok\n .pipe(takeUntil(complete))\n .subscribe(result => this.dispose(overlayRef, complete).then(() => resolve({ userAction: 'ok', result })));\n }\n if (componentRef.instance.ngOnChanges != null) {\n componentRef.instance.ngOnChanges({ data: new SimpleChange(null, data, true) });\n }\n } else {\n this.dispose(overlayRef, complete).then(() => reject(new Error('Could not attach component to overlay.')));\n }\n });\n }\n\n private dispose(overlayRef: OverlayRef, complete: Subject<boolean>) {\n return new Promise<void>(resolve => {\n complete.next();\n complete.complete();\n complete.unsubscribe();\n overlayRef.dispose();\n resolve();\n });\n }\n}\n"]}
@@ -1,28 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { RouterModule } from '@angular/router';
4
- import { OverlayModule } from '@angular/cdk/overlay';
5
- import { FestoAngularFormsModule } from '../../forms/forms.module';
6
- import { AlertComponent } from './alert/alert.component';
7
- import { ConfirmComponent } from './confirm/confirm.component';
8
- import { PromptComponent } from './prompt/prompt.component';
9
- import * as i0 from "@angular/core";
10
- export * from './index';
11
- export * from './alert/alert.component';
12
- export * from './confirm/confirm.component';
13
- export * from './prompt/prompt.component';
14
- export class FestoAngularModalsModule {
15
- }
16
- FestoAngularModalsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: FestoAngularModalsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
17
- FestoAngularModalsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: FestoAngularModalsModule, declarations: [AlertComponent, ConfirmComponent, PromptComponent], imports: [CommonModule, RouterModule, OverlayModule, FestoAngularFormsModule], exports: [AlertComponent, ConfirmComponent, PromptComponent] });
18
- FestoAngularModalsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: FestoAngularModalsModule, providers: [], imports: [[CommonModule, RouterModule, OverlayModule, FestoAngularFormsModule]] });
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: FestoAngularModalsModule, decorators: [{
20
- type: NgModule,
21
- args: [{
22
- declarations: [AlertComponent, ConfirmComponent, PromptComponent],
23
- imports: [CommonModule, RouterModule, OverlayModule, FestoAngularFormsModule],
24
- exports: [AlertComponent, ConfirmComponent, PromptComponent],
25
- providers: []
26
- }]
27
- }] });
28
- //# sourceMappingURL=modals.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modals.module.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/components/modals/modals.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;;AAE5D,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAQ1C,MAAM,OAAO,wBAAwB;;qHAAxB,wBAAwB;sHAAxB,wBAAwB,iBALpB,cAAc,EAAE,gBAAgB,EAAE,eAAe,aACtD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,uBAAuB,aAClE,cAAc,EAAE,gBAAgB,EAAE,eAAe;sHAGhD,wBAAwB,aAFxB,EAAE,YAFJ,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,uBAAuB,CAAC;2FAIlE,wBAAwB;kBANpC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,cAAc,EAAE,gBAAgB,EAAE,eAAe,CAAC;oBACjE,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,uBAAuB,CAAC;oBAC7E,OAAO,EAAE,CAAC,cAAc,EAAE,gBAAgB,EAAE,eAAe,CAAC;oBAC5D,SAAS,EAAE,EAAE;iBACd","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { OverlayModule } from '@angular/cdk/overlay';\n\nimport { FestoAngularFormsModule } from '../../forms/forms.module';\nimport { AlertComponent } from './alert/alert.component';\nimport { ConfirmComponent } from './confirm/confirm.component';\nimport { PromptComponent } from './prompt/prompt.component';\n\nexport * from './index';\nexport * from './alert/alert.component';\nexport * from './confirm/confirm.component';\nexport * from './prompt/prompt.component';\n\n@NgModule({\n declarations: [AlertComponent, ConfirmComponent, PromptComponent],\n imports: [CommonModule, RouterModule, OverlayModule, FestoAngularFormsModule],\n exports: [AlertComponent, ConfirmComponent, PromptComponent],\n providers: []\n})\nexport class FestoAngularModalsModule {}\n"]}
@@ -1,110 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
2
- import { FormBuilder } from '@angular/forms';
3
- import { Subject } from 'rxjs';
4
- import { takeUntil } from 'rxjs/operators';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/forms";
7
- import * as i2 from "../../../forms/text-input/text-input.component";
8
- import * as i3 from "@angular/common";
9
- export class PromptComponent {
10
- constructor(formBuilder) {
11
- this.formBuilder = formBuilder;
12
- this.close = new EventEmitter();
13
- this.cancel = new EventEmitter();
14
- this.ok = new EventEmitter();
15
- this.error = '';
16
- this.complete = new Subject();
17
- }
18
- get text() {
19
- var _a, _b;
20
- return (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('text')) === null || _b === void 0 ? void 0 : _b.value;
21
- }
22
- get valid() {
23
- var _a, _b;
24
- return (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.get('text')) === null || _b === void 0 ? void 0 : _b.valid;
25
- }
26
- onKeyUp(event) {
27
- event.preventDefault();
28
- event.stopPropagation();
29
- if (event.key === 'Esc' || event.key === 'Escape') {
30
- this.onClose();
31
- }
32
- }
33
- ngOnInit() {
34
- var _a, _b, _c;
35
- const text = ((_a = this.data) === null || _a === void 0 ? void 0 : _a.value) || '';
36
- this.form = this.formBuilder.group({
37
- text: this.formBuilder.control(text, (_b = this.data) === null || _b === void 0 ? void 0 : _b.validatorOrOpts, (_c = this.data) === null || _c === void 0 ? void 0 : _c.asyncValidator)
38
- });
39
- if (text) {
40
- this.form.get('text').markAsDirty();
41
- }
42
- this.form
43
- .get('text')
44
- .statusChanges.pipe(takeUntil(this.complete))
45
- .subscribe(sc => {
46
- if (sc === 'INVALID') {
47
- this.handleErrors();
48
- }
49
- else {
50
- this.error = '';
51
- }
52
- });
53
- }
54
- ngAfterViewInit() {
55
- if (this.closeBtn) {
56
- this.closeBtn.nativeElement.focus();
57
- }
58
- }
59
- ngOnDestroy() {
60
- this.complete.next(true);
61
- this.complete.unsubscribe();
62
- }
63
- onClose() {
64
- this.close.emit();
65
- }
66
- onOk() {
67
- if (this.valid) {
68
- this.ok.emit(this.text);
69
- }
70
- }
71
- onCancel() {
72
- this.cancel.emit();
73
- }
74
- handleErrors() {
75
- const e = this.form.get('text').errors;
76
- const key = Object.keys(e)[0];
77
- if (this.data.errors != null && this.data.errors[key]) {
78
- this.error = this.data.errors[key];
79
- }
80
- else {
81
- this.error = 'Prompt input is invalid.';
82
- }
83
- }
84
- }
85
- PromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PromptComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
86
- PromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: PromptComponent, selector: "fng-prompt", inputs: { data: "data" }, outputs: { close: "close", cancel: "cancel", ok: "ok" }, host: { listeners: { "window:keyup": "onKeyUp($event)" } }, viewQueries: [{ propertyName: "closeBtn", first: true, predicate: ["closeBtn"], descendants: true }], ngImport: i0, template: "<div class=\"fwe-modal\">\n <div class=\"fwe-modal-close\">\n <button type=\"button\" aria-label=\"Close\" #closeBtn class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onClose()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-close-small\"></i>\n <span class=\"fwe-sr-only\">Close</span>\n </button>\n </div>\n <div class=\"fwe-modal-header\">\n <h2 *ngIf=\"data?.subtitle\" class=\"fwe-modal-h2\">{{ data?.subtitle }}</h2>\n <h1 class=\"fwe-modal-h1\">{{ data?.title }}</h1>\n </div>\n <form [formGroup]=\"form\" class=\"fwe-modal-body\">\n <fng-text-input formControlName=\"text\" [label]=\"data?.label\" [hint]=\"data?.hint\" type=\"text\" [error]=\"error\"></fng-text-input>\n </form>\n <div class=\"fwe-modal-footer\" *ngIf=\"data?.cancel || data?.ok\">\n <div class=\"fwe-modal-buttons\">\n <button *ngIf=\"data?.cancel\" type=\"button\" aria-label=\"Cancel\" class=\"fwe-btn\" (click)=\"onCancel()\">\n {{ data?.cancel }}\n </button>\n <button *ngIf=\"data?.ok\" type=\"button\" aria-label=\"Ok\" class=\"fwe-btn fwe-btn-hero\" (click)=\"onOk()\">\n {{ data?.ok }}\n </button>\n </div>\n </div>\n</div>\n", styles: [""], components: [{ type: i2.TextInputComponent, selector: "fng-text-input", inputs: ["label", "type", "readonly", "step", "min", "max", "tabindex", "placeholder", "name", "disabled", "value", "required", "error", "hint"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], encapsulation: i0.ViewEncapsulation.None });
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PromptComponent, decorators: [{
88
- type: Component,
89
- args: [{
90
- selector: 'fng-prompt',
91
- templateUrl: './prompt.component.html',
92
- styleUrls: ['./prompt.component.scss'],
93
- encapsulation: ViewEncapsulation.None
94
- }]
95
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { data: [{
96
- type: Input
97
- }], close: [{
98
- type: Output
99
- }], cancel: [{
100
- type: Output
101
- }], ok: [{
102
- type: Output
103
- }], closeBtn: [{
104
- type: ViewChild,
105
- args: ['closeBtn']
106
- }], onKeyUp: [{
107
- type: HostListener,
108
- args: ['window:keyup', ['$event']]
109
- }] } });
110
- //# sourceMappingURL=prompt.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/components/modals/prompt/prompt.component.ts","../../../../../../../../libs/angular/src/lib/components/modals/prompt/prompt.component.html"],"names":[],"mappings":"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","sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { AbstractControlOptions, AsyncValidatorFn, FormBuilder, FormGroup, ValidatorFn } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { Modal } from '../index';\n\nexport interface PromptData {\n title: string;\n subtitle?: string;\n label: string;\n hint?: string;\n errors?: { [key: string]: string };\n cancel?: string;\n ok?: string;\n value?: string;\n validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null;\n asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null;\n}\n\n@Component({\n selector: 'fng-prompt',\n templateUrl: './prompt.component.html',\n styleUrls: ['./prompt.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PromptComponent implements OnInit, AfterViewInit, OnDestroy, Modal<PromptData, any> {\n @Input() data: PromptData;\n @Output() close = new EventEmitter<any>();\n @Output() cancel = new EventEmitter<any>();\n @Output() ok = new EventEmitter<any>();\n\n @ViewChild('closeBtn') closeBtn: ElementRef;\n\n form: FormGroup;\n error = '';\n\n get text(): string {\n return this.form?.get('text')?.value;\n }\n\n get valid(): boolean {\n return this.form?.get('text')?.valid;\n }\n\n private complete: Subject<boolean> = new Subject();\n\n constructor(private formBuilder: FormBuilder) {}\n\n @HostListener('window:keyup', ['$event'])\n onKeyUp(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.key === 'Esc' || event.key === 'Escape') {\n this.onClose();\n }\n }\n\n ngOnInit(): void {\n const text = this.data?.value || '';\n\n this.form = this.formBuilder.group({\n text: this.formBuilder.control(text, this.data?.validatorOrOpts, this.data?.asyncValidator)\n });\n\n if (text) {\n this.form.get('text').markAsDirty();\n }\n\n this.form\n .get('text')\n .statusChanges.pipe(takeUntil(this.complete))\n .subscribe(sc => {\n if (sc === 'INVALID') {\n this.handleErrors();\n } else {\n this.error = '';\n }\n });\n }\n\n ngAfterViewInit() {\n if (this.closeBtn) {\n (this.closeBtn.nativeElement as HTMLElement).focus();\n }\n }\n\n ngOnDestroy(): void {\n this.complete.next(true);\n this.complete.unsubscribe();\n }\n\n onClose() {\n this.close.emit();\n }\n\n onOk() {\n if (this.valid) {\n this.ok.emit(this.text);\n }\n }\n\n onCancel() {\n this.cancel.emit();\n }\n\n private handleErrors() {\n const e = this.form.get('text').errors;\n const key = Object.keys(e)[0];\n if (this.data.errors != null && this.data.errors[key]) {\n this.error = this.data.errors[key];\n } else {\n this.error = 'Prompt input is invalid.';\n }\n }\n}\n","<div class=\"fwe-modal\">\n <div class=\"fwe-modal-close\">\n <button type=\"button\" aria-label=\"Close\" #closeBtn class=\"fwe-btn fwe-btn-link fwe-dark\" (click)=\"onClose()\">\n <i aria-hidden=\"true\" class=\"fwe-icon fwe-icon-close-small\"></i>\n <span class=\"fwe-sr-only\">Close</span>\n </button>\n </div>\n <div class=\"fwe-modal-header\">\n <h2 *ngIf=\"data?.subtitle\" class=\"fwe-modal-h2\">{{ data?.subtitle }}</h2>\n <h1 class=\"fwe-modal-h1\">{{ data?.title }}</h1>\n </div>\n <form [formGroup]=\"form\" class=\"fwe-modal-body\">\n <fng-text-input formControlName=\"text\" [label]=\"data?.label\" [hint]=\"data?.hint\" type=\"text\" [error]=\"error\"></fng-text-input>\n </form>\n <div class=\"fwe-modal-footer\" *ngIf=\"data?.cancel || data?.ok\">\n <div class=\"fwe-modal-buttons\">\n <button *ngIf=\"data?.cancel\" type=\"button\" aria-label=\"Cancel\" class=\"fwe-btn\" (click)=\"onCancel()\">\n {{ data?.cancel }}\n </button>\n <button *ngIf=\"data?.ok\" type=\"button\" aria-label=\"Ok\" class=\"fwe-btn fwe-btn-hero\" (click)=\"onOk()\">\n {{ data?.ok }}\n </button>\n </div>\n </div>\n</div>\n"]}
@@ -1,60 +0,0 @@
1
- import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- export var PaginationType;
5
- (function (PaginationType) {
6
- PaginationType["Numeric"] = "NUMERIC";
7
- PaginationType["Dots"] = "DOTS";
8
- })(PaginationType || (PaginationType = {}));
9
- export class PaginationComponent {
10
- constructor() {
11
- this.PaginationType = PaginationType;
12
- this.type = PaginationType.Numeric;
13
- this.pageCurrent = 0;
14
- this.changePage = new EventEmitter();
15
- this.dotArray = [];
16
- }
17
- set pageMax(value) {
18
- this.innerPageMax = value;
19
- this.dotArray = [...Array(value).fill(0).keys()];
20
- }
21
- get pageMax() {
22
- return this.innerPageMax;
23
- }
24
- onBtnDown() {
25
- if (this.pageCurrent > 1) {
26
- this.pageCurrent--;
27
- this.changePage.emit(this.pageCurrent);
28
- }
29
- }
30
- onBtnUp() {
31
- if (this.pageCurrent < this.pageMax) {
32
- this.pageCurrent++;
33
- this.changePage.emit(this.pageCurrent);
34
- }
35
- }
36
- onDotClick(index) {
37
- this.pageCurrent = index + 1;
38
- this.changePage.emit(this.pageCurrent);
39
- }
40
- }
41
- PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
42
- PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: PaginationComponent, selector: "fng-pagination", inputs: { type: "type", pageCurrent: "pageCurrent", pageMax: "pageMax" }, outputs: { changePage: "changePage" }, ngImport: i0, template: "<ng-container *ngIf=\"type === PaginationType.Numeric\">\n <div class=\"fwe-pagination fwe-p-m\" [class.fwe-d-none]=\"pageMax < 2\">\n <button class=\"fwe-navigate-btn-down\" (click)=\"onBtnDown()\" [class.fwe-disabled]=\"pageCurrent <= 1\"></button>\n <span class=\"fwe-page-current\">{{ pageCurrent }}</span>\n <span class=\"fwe-page-max\">{{ pageMax }}</span>\n <button class=\"fwe-navigate-btn-up\" (click)=\"onBtnUp()\" [class.fwe-disabled]=\"pageCurrent >= pageMax\"></button>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"type === PaginationType.Dots\">\n <div class=\"fwe-p-m\" [class.fwe-d-none]=\"pageMax < 2\">\n <div class=\"fwe-pagination\">\n <span\n *ngFor=\"let index of dotArray\"\n class=\"fwe-page-dot\"\n [class.fwe-selected]=\"index + 1 === pageCurrent\"\n (click)=\"onDotClick(index)\"\n ></span>\n </div>\n </div>\n</ng-container>\n", styles: [""], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PaginationComponent, decorators: [{
44
- type: Component,
45
- args: [{
46
- selector: 'fng-pagination',
47
- templateUrl: './pagination.component.html',
48
- styleUrls: ['./pagination.component.scss'],
49
- encapsulation: ViewEncapsulation.None
50
- }]
51
- }], propDecorators: { type: [{
52
- type: Input
53
- }], pageCurrent: [{
54
- type: Input
55
- }], pageMax: [{
56
- type: Input
57
- }], changePage: [{
58
- type: Output
59
- }] } });
60
- //# sourceMappingURL=pagination.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular/src/lib/components/pagination/pagination.component.ts","../../../../../../../libs/angular/src/lib/components/pagination/pagination.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;;AAE1F,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAQD,MAAM,OAAO,mBAAmB;IANhC;QAOE,mBAAc,GAAG,cAAc,CAAC;QAEvB,SAAI,GAAmB,cAAc,CAAC,OAAO,CAAC;QAC9C,gBAAW,GAAG,CAAC,CAAC;QAUf,eAAU,GAAG,IAAI,YAAY,EAAU,CAAC;QAGlD,aAAQ,GAAa,EAAE,CAAC;KAoBzB;IAhCC,IACI,OAAO,CAAC,KAAa;QACvB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAOD,SAAS;QACP,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE;YACxB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACxC;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE;YACnC,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACxC;IACH,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,IAAI,CAAC,WAAW,GAAG,KAAK,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;;gHApCU,mBAAmB;oGAAnB,mBAAmB,uKCbhC,05BAqBA;2FDRa,mBAAmB;kBAN/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,WAAW,EAAE,6BAA6B;oBAC1C,SAAS,EAAE,CAAC,6BAA6B,CAAC;oBAC1C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BAIU,IAAI;sBAAZ,KAAK;gBACG,WAAW;sBAAnB,KAAK;gBAEF,OAAO;sBADV,KAAK;gBASI,UAAU;sBAAnB,MAAM","sourcesContent":["import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\n\nexport enum PaginationType {\n Numeric = 'NUMERIC',\n Dots = 'DOTS'\n}\n\n@Component({\n selector: 'fng-pagination',\n templateUrl: './pagination.component.html',\n styleUrls: ['./pagination.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PaginationComponent {\n PaginationType = PaginationType;\n\n @Input() type: PaginationType = PaginationType.Numeric;\n @Input() pageCurrent = 0;\n @Input()\n set pageMax(value: number) {\n this.innerPageMax = value;\n this.dotArray = [...Array(value).fill(0).keys()];\n }\n get pageMax() {\n return this.innerPageMax;\n }\n\n @Output() changePage = new EventEmitter<number>();\n\n innerPageMax: number;\n dotArray: number[] = [];\n\n onBtnDown() {\n if (this.pageCurrent > 1) {\n this.pageCurrent--;\n this.changePage.emit(this.pageCurrent);\n }\n }\n\n onBtnUp() {\n if (this.pageCurrent < this.pageMax) {\n this.pageCurrent++;\n this.changePage.emit(this.pageCurrent);\n }\n }\n\n onDotClick(index: number) {\n this.pageCurrent = index + 1;\n this.changePage.emit(this.pageCurrent);\n }\n}\n","<ng-container *ngIf=\"type === PaginationType.Numeric\">\n <div class=\"fwe-pagination fwe-p-m\" [class.fwe-d-none]=\"pageMax < 2\">\n <button class=\"fwe-navigate-btn-down\" (click)=\"onBtnDown()\" [class.fwe-disabled]=\"pageCurrent <= 1\"></button>\n <span class=\"fwe-page-current\">{{ pageCurrent }}</span>\n <span class=\"fwe-page-max\">{{ pageMax }}</span>\n <button class=\"fwe-navigate-btn-up\" (click)=\"onBtnUp()\" [class.fwe-disabled]=\"pageCurrent >= pageMax\"></button>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"type === PaginationType.Dots\">\n <div class=\"fwe-p-m\" [class.fwe-d-none]=\"pageMax < 2\">\n <div class=\"fwe-pagination\">\n <span\n *ngFor=\"let index of dotArray\"\n class=\"fwe-page-dot\"\n [class.fwe-selected]=\"index + 1 === pageCurrent\"\n (click)=\"onDotClick(index)\"\n ></span>\n </div>\n </div>\n</ng-container>\n"]}
@@ -1,46 +0,0 @@
1
- import { Component, Input, ViewChild, TemplateRef } from '@angular/core';
2
- import { PopoverTypes } from '../popover.models';
3
- import { PopoverService } from '../popover.service';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "../popover.service";
6
- import * as i2 from "@angular/common";
7
- export class LegendComponent {
8
- constructor(popoverService) {
9
- this.popoverService = popoverService;
10
- this.items = [];
11
- this.options = {};
12
- }
13
- show(origin) {
14
- if (0 < this.items.length) {
15
- this.popoverRef = this.popoverService.open({
16
- content: this.templateRef,
17
- origin,
18
- options: {
19
- type: PopoverTypes.Legend,
20
- hasBackdrop: true
21
- }
22
- });
23
- }
24
- }
25
- hide() {
26
- this.popoverRef.close();
27
- }
28
- }
29
- LegendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: LegendComponent, deps: [{ token: i1.PopoverService }], target: i0.ɵɵFactoryTarget.Component });
30
- LegendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: LegendComponent, selector: "fng-legend", inputs: { items: "items", options: "options" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["tpl"], descendants: true }], ngImport: i0, template: "<ng-template #tpl>\n <dl *ngIf=\"0 < items.length\" class=\"fng-legend\">\n <div *ngFor=\"let item of items\" class=\"fng-legend-content\">\n <dt>{{ item?.name }}</dt>\n <dd>{{ item?.text }}</dd>\n </div>\n </dl>\n</ng-template>\n", styles: [".fwe-triangle.fwe-triangle-right,.fwe-triangle.fwe-triangle-left,.fwe-triangle.fwe-triangle-bottom,.fwe-triangle.fwe-triangle-top{width:17px;height:17px;position:absolute;overflow:hidden}.fwe-triangle.fwe-triangle-right:after,.fwe-triangle.fwe-triangle-left:after,.fwe-triangle.fwe-triangle-bottom:after,.fwe-triangle.fwe-triangle-top:after{content:\"\";position:absolute;width:12px;height:12px;background:var(--fwe-white);transform:rotate(45deg);box-shadow:0 1px 4px #3333}.fwe-popover.fwe-popover-menu,.fwe-popover{background-color:var(--fwe-white);box-shadow:0 1px 4px #3333;border-radius:4px}.fwe-popover{padding:8px;font-size:14px;line-height:1rem}.fwe-popover-container{position:relative;display:inline-block}.fwe-triangle.fwe-triangle-top{left:50%;top:-17px;transform:translate(-8px)}.fwe-triangle.fwe-triangle-top:after{top:11px;left:3px}.fwe-triangle.fwe-triangle-bottom{left:50%;top:100%;transform:translate(-8px)}.fwe-triangle.fwe-triangle-bottom:after{top:-6px;left:3px}.fwe-triangle.fwe-triangle-left{left:-17px;top:50%;transform:translateY(-8px)}.fwe-triangle.fwe-triangle-left:after{top:2px;left:11px}.fwe-triangle.fwe-triangle-right{left:100%;top:50%;transform:translateY(-8px)}.fwe-triangle.fwe-triangle-right:after{top:2px;left:-6px}.fwe-popover.fwe-popover-menu{font-size:16px;line-height:1.5rem;padding:16px}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item{border-bottom:none;min-height:36px;padding:0}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button{width:100%;margin-left:inherit;padding:0 8px 0 0;text-align:left;height:32px;max-height:32px;display:inline-flex}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button:hover{color:var(--fwe-black)}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button i{display:inline-flex;align-items:center;justify-content:center;flex-wrap:nowrap;height:24px;width:32px}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button i:before{display:inline-flex}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button span{display:inline-flex;height:24px}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item button [class*=\" fwe-icon-\"]{margin-left:inherit}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item:hover{color:var(--fwe-black);background-color:#3333331a}.fwe-popover.fwe-popover-menu .fwe-list-group .fwe-list-group-item:active{background-color:#3333}.fwe-popover .fwe-popover-legend{display:table;margin:16px;line-height:24px}.fwe-popover .fwe-popover-legend .fwe-popover-legend-content{display:table-row}.fwe-popover .fwe-popover-legend .fwe-popover-legend-content dt{display:table-cell;margin:0;padding-right:8px}.fwe-popover .fwe-popover-legend .fwe-popover-legend-content dd{display:table-cell;margin:0}.fng-legend{display:table;margin:16px;line-height:24px}.fng-legend .fng-legend-content{display:table-row}.fng-legend .fng-legend-content dt{display:table-cell;margin:0;padding-right:8px}.fng-legend .fng-legend-content dd{display:table-cell;margin:0}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: LegendComponent, decorators: [{
32
- type: Component,
33
- args: [{
34
- selector: 'fng-legend',
35
- templateUrl: './legend.component.html',
36
- styleUrls: ['./legend.component.scss']
37
- }]
38
- }], ctorParameters: function () { return [{ type: i1.PopoverService }]; }, propDecorators: { items: [{
39
- type: Input
40
- }], options: [{
41
- type: Input
42
- }], templateRef: [{
43
- type: ViewChild,
44
- args: ['tpl']
45
- }] } });
46
- //# sourceMappingURL=legend.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legend.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/components/popovers/legend/legend.component.ts","../../../../../../../../libs/angular/src/lib/components/popovers/legend/legend.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;;;;AAgBpD,MAAM,OAAO,eAAe;IAM1B,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QALzC,UAAK,GAAiB,EAAE,CAAC;QACzB,YAAO,GAAyB,EAAE,CAAC;IAIS,CAAC;IAEtD,IAAI,CAAC,MAAmB;QACtB,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACzB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;gBACzC,OAAO,EAAE,IAAI,CAAC,WAAW;gBACzB,MAAM;gBACN,OAAO,EAAE;oBACP,IAAI,EAAE,YAAY,CAAC,MAAM;oBACzB,WAAW,EAAE,IAAI;iBAClB;aACF,CAAC,CAAC;SACJ;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;;4GAvBU,eAAe;gGAAf,eAAe,sMCnB5B,0PAQA;2FDWa,eAAe;kBAL3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,WAAW,EAAE,yBAAyB;oBACtC,SAAS,EAAE,CAAC,yBAAyB,CAAC;iBACvC;qGAEU,KAAK;sBAAb,KAAK;gBACG,OAAO;sBAAf,KAAK;gBACY,WAAW;sBAA5B,SAAS;uBAAC,KAAK","sourcesContent":["import { Component, Input, ViewChild, TemplateRef } from '@angular/core';\nimport { PopoverRef } from '../popover-ref';\nimport { PopoverTypes } from '../popover.models';\nimport { PopoverService } from '../popover.service';\n\nexport interface PopoverLegendOptions {\n maxWidth?: string | number;\n}\n\nexport interface LegendItem {\n name: string;\n text: string;\n}\n\n@Component({\n selector: 'fng-legend',\n templateUrl: './legend.component.html',\n styleUrls: ['./legend.component.scss']\n})\nexport class LegendComponent {\n @Input() items: LegendItem[] = [];\n @Input() options: PopoverLegendOptions = {};\n @ViewChild('tpl') templateRef: TemplateRef<any>;\n private popoverRef: PopoverRef;\n\n constructor(private popoverService: PopoverService) {}\n\n show(origin: HTMLElement) {\n if (0 < this.items.length) {\n this.popoverRef = this.popoverService.open({\n content: this.templateRef,\n origin,\n options: {\n type: PopoverTypes.Legend,\n hasBackdrop: true\n }\n });\n }\n }\n\n hide() {\n this.popoverRef.close();\n }\n}\n","<ng-template #tpl>\n <dl *ngIf=\"0 < items.length\" class=\"fng-legend\">\n <div *ngFor=\"let item of items\" class=\"fng-legend-content\">\n <dt>{{ item?.name }}</dt>\n <dd>{{ item?.text }}</dd>\n </div>\n </dl>\n</ng-template>\n"]}
@@ -1,31 +0,0 @@
1
- import { Directive, ElementRef, ContentChild, HostListener } from '@angular/core';
2
- import { PopoverContentComponent } from '../popover-content/popover-content.component';
3
- import * as i0 from "@angular/core";
4
- export class LegendDirective {
5
- constructor(elmenetRef) {
6
- this.elmenetRef = elmenetRef;
7
- }
8
- ngOnInit() {
9
- this.origin = this.elmenetRef.nativeElement;
10
- }
11
- show() {
12
- if (null != this.ref) {
13
- this.ref.show(this.origin);
14
- }
15
- }
16
- }
17
- LegendDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: LegendDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
18
- LegendDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.0", type: LegendDirective, selector: "[fngLegend]", host: { listeners: { "click": "show()" } }, queries: [{ propertyName: "ref", first: true, predicate: ["fngContent"], descendants: true }], ngImport: i0 });
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: LegendDirective, decorators: [{
20
- type: Directive,
21
- args: [{
22
- selector: '[fngLegend]'
23
- }]
24
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { ref: [{
25
- type: ContentChild,
26
- args: ['fngContent']
27
- }], show: [{
28
- type: HostListener,
29
- args: ['click']
30
- }] } });
31
- //# sourceMappingURL=legend.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legend.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/components/popovers/legend/legend.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;;AAKvF,MAAM,OAAO,eAAe;IAI1B,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C,QAAQ;QACN,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAC9C,CAAC;IAGD,IAAI;QACF,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE;YACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC5B;IACH,CAAC;;4GAfU,eAAe;gGAAf,eAAe;2FAAf,eAAe;kBAH3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;iBACxB;iGAE6B,GAAG;sBAA9B,YAAY;uBAAC,YAAY;gBAU1B,IAAI;sBADH,YAAY;uBAAC,OAAO","sourcesContent":["import { Directive, ElementRef, ContentChild, HostListener, OnInit } from '@angular/core';\n\nimport { PopoverContentComponent } from '../popover-content/popover-content.component';\n\n@Directive({\n selector: '[fngLegend]'\n})\nexport class LegendDirective implements OnInit {\n @ContentChild('fngContent') ref: PopoverContentComponent;\n private origin: HTMLElement;\n\n constructor(private elmenetRef: ElementRef) {}\n\n ngOnInit(): void {\n this.origin = this.elmenetRef.nativeElement;\n }\n\n @HostListener('click')\n show() {\n if (null != this.ref) {\n this.ref.show(this.origin);\n }\n }\n}\n"]}
@@ -1,35 +0,0 @@
1
- import { Component, TemplateRef } from '@angular/core';
2
- import { PopoverRef } from '../popover-ref';
3
- import { PopoverContentTypes } from '../popover.models';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "../popover-ref";
6
- import * as i2 from "@angular/common";
7
- export class PopoverComponent {
8
- constructor(popoverRef) {
9
- this.popoverRef = popoverRef;
10
- this.type = PopoverContentTypes.Text;
11
- }
12
- ngOnInit() {
13
- this.content = this.popoverRef.content;
14
- if ('string' === typeof this.content) {
15
- this.type = PopoverContentTypes.Text;
16
- }
17
- if (this.content instanceof TemplateRef) {
18
- this.type = PopoverContentTypes.Template;
19
- this.context = {
20
- close: this.popoverRef.close.bind(this.popoverRef)
21
- };
22
- }
23
- }
24
- }
25
- PopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PopoverComponent, deps: [{ token: i1.PopoverRef }], target: i0.ɵɵFactoryTarget.Component });
26
- PopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: PopoverComponent, selector: "fng-popover", ngImport: i0, template: "<div class=\"fwe-popover-container\">\n <div class=\"fwe-triangle\"></div>\n <div class=\"fwe-popover\">\n <ng-container [ngSwitch]=\"type\">\n <div class=\"fwe-popover-content\" *ngSwitchCase=\"'text'\" [innerHTML]=\"content\"></div>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container *ngTemplateOutlet=\"content; context: context\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'component'\">\n <ng-container *ngComponentOutlet=\"content\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [""], directives: [{ type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }] });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: PopoverComponent, decorators: [{
28
- type: Component,
29
- args: [{
30
- selector: 'fng-popover',
31
- templateUrl: './popover.component.html',
32
- styleUrls: ['./popover.component.scss']
33
- }]
34
- }], ctorParameters: function () { return [{ type: i1.PopoverRef }]; } });
35
- //# sourceMappingURL=popover.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular/src/lib/components/popovers/popover/popover.component.ts","../../../../../../../../libs/angular/src/lib/components/popovers/popover/popover.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;;;;AAOxE,MAAM,OAAO,gBAAgB;IAK3B,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAJ1C,SAAI,GAAwB,mBAAmB,CAAC,IAAI,CAAC;IAIR,CAAC;IAE9C,QAAQ;QACN,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACvC,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE;YACpC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;SACtC;QAED,IAAI,IAAI,CAAC,OAAO,YAAY,WAAW,EAAE;YACvC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,QAAQ,CAAC;YACzC,IAAI,CAAC,OAAO,GAAG;gBACb,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;aACnD,CAAC;SACH;IACH,CAAC;;6GAnBU,gBAAgB;iGAAhB,gBAAgB,mDCV7B,ilBAcA;2FDJa,gBAAgB;kBAL5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,WAAW,EAAE,0BAA0B;oBACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;iBACxC","sourcesContent":["import { Component, OnInit, TemplateRef } from '@angular/core';\n\nimport { PopoverRef } from '../popover-ref';\nimport { PopoverContent, PopoverContentTypes } from '../popover.models';\n\n@Component({\n selector: 'fng-popover',\n templateUrl: './popover.component.html',\n styleUrls: ['./popover.component.scss']\n})\nexport class PopoverComponent implements OnInit {\n type: PopoverContentTypes = PopoverContentTypes.Text;\n content: PopoverContent;\n context: any;\n\n constructor(private popoverRef: PopoverRef) {}\n\n ngOnInit() {\n this.content = this.popoverRef.content;\n if ('string' === typeof this.content) {\n this.type = PopoverContentTypes.Text;\n }\n\n if (this.content instanceof TemplateRef) {\n this.type = PopoverContentTypes.Template;\n this.context = {\n close: this.popoverRef.close.bind(this.popoverRef)\n };\n }\n }\n}\n","<div class=\"fwe-popover-container\">\n <div class=\"fwe-triangle\"></div>\n <div class=\"fwe-popover\">\n <ng-container [ngSwitch]=\"type\">\n <div class=\"fwe-popover-content\" *ngSwitchCase=\"'text'\" [innerHTML]=\"content\"></div>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container *ngTemplateOutlet=\"content; context: context\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'component'\">\n <ng-container *ngComponentOutlet=\"content\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n"]}