@firestitch/common 13.0.0 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/app/directives/autofocus.directive.d.ts +13 -13
  2. package/app/directives/index.d.ts +4 -4
  3. package/app/directives/model-change.directive.d.ts +16 -16
  4. package/app/directives/prevent-default.directive.d.ts +6 -6
  5. package/app/directives/stop-propagation.directive.d.ts +6 -6
  6. package/app/fs-common.module.d.ts +19 -19
  7. package/app/pipes/bytes.pipe.d.ts +7 -7
  8. package/app/pipes/currency.pipe.d.ts +9 -9
  9. package/app/pipes/index.d.ts +2 -2
  10. package/app/pipes/number.pipe.d.ts +7 -7
  11. package/app/pipes/ordinal-number.pipe.d.ts +7 -7
  12. package/app/pipes/truncate.pipe.d.ts +8 -8
  13. package/app/pipes/util.pipe.d.ts +24 -24
  14. package/app/services/array.service.d.ts +61 -61
  15. package/app/services/math.service.d.ts +9 -9
  16. package/app/services/util.service.d.ts +89 -89
  17. package/app/services/vaildate.service.d.ts +16 -16
  18. package/esm2020/app/directives/autofocus.directive.mjs +50 -50
  19. package/esm2020/app/directives/index.mjs +5 -5
  20. package/esm2020/app/directives/model-change.directive.mjs +37 -37
  21. package/esm2020/app/directives/prevent-default.directive.mjs +18 -18
  22. package/esm2020/app/directives/stop-propagation.directive.mjs +18 -18
  23. package/esm2020/app/fs-common.module.mjs +97 -97
  24. package/esm2020/app/pipes/bytes.pipe.mjs +16 -16
  25. package/esm2020/app/pipes/currency.pipe.mjs +22 -22
  26. package/esm2020/app/pipes/index.mjs +2 -2
  27. package/esm2020/app/pipes/number.pipe.mjs +16 -16
  28. package/esm2020/app/pipes/ordinal-number.pipe.mjs +16 -16
  29. package/esm2020/app/pipes/truncate.pipe.mjs +17 -17
  30. package/esm2020/app/pipes/util.pipe.mjs +59 -59
  31. package/esm2020/app/services/array.service.mjs +224 -224
  32. package/esm2020/app/services/math.service.mjs +20 -20
  33. package/esm2020/app/services/util.service.mjs +250 -250
  34. package/esm2020/app/services/vaildate.service.mjs +27 -27
  35. package/esm2020/firestitch-common.mjs +4 -4
  36. package/esm2020/libs/array/compare/compare.mjs +7 -7
  37. package/esm2020/libs/array/compare/index.mjs +1 -1
  38. package/esm2020/libs/array/filter/filter.mjs +26 -26
  39. package/esm2020/libs/array/filter/index.mjs +1 -1
  40. package/esm2020/libs/array/find/find.mjs +5 -5
  41. package/esm2020/libs/array/find/index.mjs +1 -1
  42. package/esm2020/libs/array/inArray/inArray.mjs +11 -11
  43. package/esm2020/libs/array/inArray/index.mjs +1 -1
  44. package/esm2020/libs/array/index/index.mjs +7 -7
  45. package/esm2020/libs/array/index.mjs +13 -13
  46. package/esm2020/libs/array/indexOf/index.mjs +1 -1
  47. package/esm2020/libs/array/indexOf/indexOf.mjs +15 -15
  48. package/esm2020/libs/array/keyExists/index.mjs +1 -1
  49. package/esm2020/libs/array/keyExists/keyExists.mjs +3 -3
  50. package/esm2020/libs/array/ksort/index.mjs +1 -1
  51. package/esm2020/libs/array/ksort/ksort.mjs +7 -7
  52. package/esm2020/libs/array/list/index.mjs +1 -1
  53. package/esm2020/libs/array/list/list.mjs +12 -12
  54. package/esm2020/libs/array/nameValue/index.mjs +1 -1
  55. package/esm2020/libs/array/nameValue/nameValue.mjs +20 -20
  56. package/esm2020/libs/array/remove/index.mjs +1 -1
  57. package/esm2020/libs/array/remove/remove.mjs +8 -8
  58. package/esm2020/libs/array/rsort/index.mjs +1 -1
  59. package/esm2020/libs/array/rsort/rsort.mjs +4 -4
  60. package/esm2020/libs/array/sort/index.mjs +1 -1
  61. package/esm2020/libs/array/sort/sort.mjs +26 -26
  62. package/esm2020/libs/format/acronym/acronym.mjs +21 -21
  63. package/esm2020/libs/format/acronym/index.mjs +1 -1
  64. package/esm2020/libs/format/bytes/bytes.mjs +17 -17
  65. package/esm2020/libs/format/bytes/index.mjs +1 -1
  66. package/esm2020/libs/format/currency/currency.mjs +8 -8
  67. package/esm2020/libs/format/currency/index.mjs +1 -1
  68. package/esm2020/libs/format/index.mjs +5 -5
  69. package/esm2020/libs/format/number/index.mjs +1 -1
  70. package/esm2020/libs/format/number/number.mjs +7 -7
  71. package/esm2020/libs/format/truncate/index.mjs +1 -1
  72. package/esm2020/libs/format/truncate/truncate.mjs +11 -11
  73. package/esm2020/libs/index.mjs +5 -5
  74. package/esm2020/libs/rxjs/delayedRetry.mjs +19 -19
  75. package/esm2020/libs/rxjs/keyboard-shortcut.mjs +17 -17
  76. package/esm2020/libs/util/boolean/boolean.mjs +3 -3
  77. package/esm2020/libs/util/boolean/index.mjs +1 -1
  78. package/esm2020/libs/util/clone/clone.mjs +20 -20
  79. package/esm2020/libs/util/clone/index.mjs +1 -1
  80. package/esm2020/libs/util/debounce/debounce.mjs +16 -16
  81. package/esm2020/libs/util/debounce/index.mjs +1 -1
  82. package/esm2020/libs/util/get-normalized-path/get-normalized-path.mjs +5 -5
  83. package/esm2020/libs/util/get-normalized-path/index.mjs +1 -1
  84. package/esm2020/libs/util/guid/guid.mjs +18 -18
  85. package/esm2020/libs/util/guid/index.mjs +1 -1
  86. package/esm2020/libs/util/index.mjs +24 -24
  87. package/esm2020/libs/util/is-array-equal/index.mjs +2 -2
  88. package/esm2020/libs/util/is-array-equal/is-array-equal.mjs +21 -21
  89. package/esm2020/libs/util/is-class/index.mjs +1 -1
  90. package/esm2020/libs/util/is-class/is-class.mjs +17 -17
  91. package/esm2020/libs/util/is-empty/index.mjs +1 -1
  92. package/esm2020/libs/util/is-empty/is-empty.mjs +11 -11
  93. package/esm2020/libs/util/is-numeric/index.mjs +1 -1
  94. package/esm2020/libs/util/is-numeric/is-numeric.mjs +4 -4
  95. package/esm2020/libs/util/is-object/index.mjs +1 -1
  96. package/esm2020/libs/util/is-object/is-object.mjs +3 -3
  97. package/esm2020/libs/util/keys/index.mjs +1 -1
  98. package/esm2020/libs/util/keys/keys.mjs +37 -37
  99. package/esm2020/libs/util/length/index.mjs +1 -1
  100. package/esm2020/libs/util/length/length.mjs +9 -9
  101. package/esm2020/libs/util/ordinal-number/index.mjs +2 -2
  102. package/esm2020/libs/util/ordinal-number/ordinal-number.mjs +7 -7
  103. package/esm2020/libs/util/queue/index.mjs +3 -3
  104. package/esm2020/libs/util/queue/operation.mjs +14 -14
  105. package/esm2020/libs/util/queue/queue-stats.mjs +1 -1
  106. package/esm2020/libs/util/queue/queue.enum.mjs +5 -5
  107. package/esm2020/libs/util/queue/queue.mjs +164 -164
  108. package/esm2020/libs/util/remove-query-params/index.mjs +1 -1
  109. package/esm2020/libs/util/remove-query-params/remove-query-params.mjs +3 -3
  110. package/esm2020/libs/util/resolve/index.mjs +1 -1
  111. package/esm2020/libs/util/resolve/resolve.mjs +9 -9
  112. package/esm2020/libs/util/round/index.mjs +1 -1
  113. package/esm2020/libs/util/round/round.mjs +5 -5
  114. package/esm2020/libs/util/source-loader/index.mjs +2 -2
  115. package/esm2020/libs/util/source-loader/source-loader.mjs +154 -154
  116. package/esm2020/libs/util/stringify/index.mjs +1 -1
  117. package/esm2020/libs/util/stringify/stringify.mjs +3 -3
  118. package/esm2020/libs/util/throttle/index.mjs +1 -1
  119. package/esm2020/libs/util/throttle/throttle.mjs +12 -12
  120. package/esm2020/libs/util/to-string/index.mjs +1 -1
  121. package/esm2020/libs/util/to-string/to-string.mjs +6 -6
  122. package/esm2020/libs/util/uuid/index.mjs +1 -1
  123. package/esm2020/libs/util/uuid/uuid.mjs +4 -4
  124. package/esm2020/libs/util/value/index.mjs +1 -1
  125. package/esm2020/libs/util/value/value.mjs +8 -8
  126. package/esm2020/libs/validate/email/email.mjs +3 -3
  127. package/esm2020/libs/validate/email/index.mjs +1 -1
  128. package/esm2020/libs/validate/index.mjs +3 -3
  129. package/esm2020/libs/validate/phone/index.mjs +1 -1
  130. package/esm2020/libs/validate/phone/phone.mjs +4 -4
  131. package/esm2020/libs/validate/url/index.mjs +1 -1
  132. package/esm2020/libs/validate/url/url.mjs +11 -11
  133. package/esm2020/public_api.mjs +16 -16
  134. package/fesm2015/firestitch-common.mjs +1659 -1658
  135. package/fesm2015/firestitch-common.mjs.map +1 -1
  136. package/fesm2020/firestitch-common.mjs +1654 -1654
  137. package/fesm2020/firestitch-common.mjs.map +1 -1
  138. package/firestitch-common.d.ts +5 -5
  139. package/libs/array/compare/compare.d.ts +1 -1
  140. package/libs/array/compare/index.d.ts +1 -1
  141. package/libs/array/filter/filter.d.ts +1 -1
  142. package/libs/array/filter/index.d.ts +1 -1
  143. package/libs/array/find/find.d.ts +1 -1
  144. package/libs/array/find/index.d.ts +1 -1
  145. package/libs/array/inArray/inArray.d.ts +1 -1
  146. package/libs/array/inArray/index.d.ts +1 -1
  147. package/libs/array/index/index.d.ts +1 -1
  148. package/libs/array/index.d.ts +13 -13
  149. package/libs/array/indexOf/index.d.ts +1 -1
  150. package/libs/array/indexOf/indexOf.d.ts +1 -1
  151. package/libs/array/keyExists/index.d.ts +1 -1
  152. package/libs/array/keyExists/keyExists.d.ts +1 -1
  153. package/libs/array/ksort/index.d.ts +1 -1
  154. package/libs/array/ksort/ksort.d.ts +1 -1
  155. package/libs/array/list/index.d.ts +1 -1
  156. package/libs/array/list/list.d.ts +1 -1
  157. package/libs/array/nameValue/index.d.ts +1 -1
  158. package/libs/array/nameValue/nameValue.d.ts +1 -1
  159. package/libs/array/remove/index.d.ts +1 -1
  160. package/libs/array/remove/remove.d.ts +1 -1
  161. package/libs/array/rsort/index.d.ts +1 -1
  162. package/libs/array/rsort/rsort.d.ts +1 -1
  163. package/libs/array/sort/index.d.ts +1 -1
  164. package/libs/array/sort/sort.d.ts +1 -1
  165. package/libs/format/acronym/acronym.d.ts +1 -1
  166. package/libs/format/acronym/index.d.ts +1 -1
  167. package/libs/format/bytes/bytes.d.ts +1 -1
  168. package/libs/format/bytes/index.d.ts +1 -1
  169. package/libs/format/currency/currency.d.ts +1 -1
  170. package/libs/format/currency/index.d.ts +1 -1
  171. package/libs/format/index.d.ts +5 -5
  172. package/libs/format/number/index.d.ts +1 -1
  173. package/libs/format/number/number.d.ts +1 -1
  174. package/libs/format/truncate/index.d.ts +1 -1
  175. package/libs/format/truncate/truncate.d.ts +1 -1
  176. package/libs/index.d.ts +5 -5
  177. package/libs/rxjs/delayedRetry.d.ts +2 -2
  178. package/libs/rxjs/keyboard-shortcut.d.ts +2 -2
  179. package/libs/util/boolean/boolean.d.ts +1 -1
  180. package/libs/util/boolean/index.d.ts +1 -1
  181. package/libs/util/clone/clone.d.ts +1 -1
  182. package/libs/util/clone/index.d.ts +1 -1
  183. package/libs/util/debounce/debounce.d.ts +1 -1
  184. package/libs/util/debounce/index.d.ts +1 -1
  185. package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
  186. package/libs/util/get-normalized-path/index.d.ts +1 -1
  187. package/libs/util/guid/guid.d.ts +1 -1
  188. package/libs/util/guid/index.d.ts +1 -1
  189. package/libs/util/index.d.ts +23 -23
  190. package/libs/util/is-array-equal/index.d.ts +1 -1
  191. package/libs/util/is-array-equal/is-array-equal.d.ts +1 -1
  192. package/libs/util/is-class/index.d.ts +1 -1
  193. package/libs/util/is-class/is-class.d.ts +1 -1
  194. package/libs/util/is-empty/index.d.ts +1 -1
  195. package/libs/util/is-empty/is-empty.d.ts +1 -1
  196. package/libs/util/is-numeric/index.d.ts +1 -1
  197. package/libs/util/is-numeric/is-numeric.d.ts +1 -1
  198. package/libs/util/is-object/index.d.ts +1 -1
  199. package/libs/util/is-object/is-object.d.ts +1 -1
  200. package/libs/util/keys/index.d.ts +1 -1
  201. package/libs/util/keys/keys.d.ts +37 -37
  202. package/libs/util/length/index.d.ts +1 -1
  203. package/libs/util/length/length.d.ts +1 -1
  204. package/libs/util/ordinal-number/index.d.ts +1 -1
  205. package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
  206. package/libs/util/queue/index.d.ts +3 -3
  207. package/libs/util/queue/operation.d.ts +7 -7
  208. package/libs/util/queue/queue-stats.d.ts +5 -5
  209. package/libs/util/queue/queue.d.ts +39 -39
  210. package/libs/util/queue/queue.enum.d.ts +4 -4
  211. package/libs/util/remove-query-params/index.d.ts +1 -1
  212. package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
  213. package/libs/util/resolve/index.d.ts +1 -1
  214. package/libs/util/resolve/resolve.d.ts +1 -1
  215. package/libs/util/round/index.d.ts +1 -1
  216. package/libs/util/round/round.d.ts +1 -1
  217. package/libs/util/source-loader/index.d.ts +1 -1
  218. package/libs/util/source-loader/source-loader.d.ts +11 -11
  219. package/libs/util/stringify/index.d.ts +1 -1
  220. package/libs/util/stringify/stringify.d.ts +1 -1
  221. package/libs/util/throttle/index.d.ts +1 -1
  222. package/libs/util/throttle/throttle.d.ts +1 -1
  223. package/libs/util/to-string/index.d.ts +1 -1
  224. package/libs/util/to-string/to-string.d.ts +1 -1
  225. package/libs/util/uuid/index.d.ts +1 -1
  226. package/libs/util/uuid/uuid.d.ts +1 -1
  227. package/libs/util/value/index.d.ts +1 -1
  228. package/libs/util/value/value.d.ts +1 -1
  229. package/libs/validate/email/email.d.ts +1 -1
  230. package/libs/validate/email/index.d.ts +1 -1
  231. package/libs/validate/index.d.ts +3 -3
  232. package/libs/validate/phone/index.d.ts +1 -1
  233. package/libs/validate/phone/phone.d.ts +1 -1
  234. package/libs/validate/url/index.d.ts +1 -1
  235. package/libs/validate/url/url.d.ts +7 -7
  236. package/package.json +1 -1
  237. package/public_api.d.ts +14 -14
@@ -6,1702 +6,1702 @@ import * as i1$1 from '@angular/forms';
6
6
  import { Subject, Observable, of, combineLatest, iif, throwError, timer, fromEvent, merge } from 'rxjs';
7
7
  import { debounceTime, takeUntil, take, map, delay, finalize, shareReplay, retryWhen, tap, concatMap, distinctUntilChanged, share, filter as filter$1 } from 'rxjs/operators';
8
8
 
9
- class FsAutofocusDirective {
10
- constructor(_matInput, _el) {
11
- this._matInput = _matInput;
12
- this._el = _el;
13
- this.fsAutofocus = true;
14
- }
15
- ngAfterViewInit() {
16
- if (this.fsAutofocus || this.fsAutofocus === undefined) {
17
- this.focus();
18
- }
19
- }
20
- focus() {
21
- setTimeout(() => {
22
- const tmpEl = document.createElement('input');
23
- tmpEl.style.width = '0';
24
- tmpEl.style.height = '0';
25
- tmpEl.style.margin = '0';
26
- tmpEl.style.padding = '0';
27
- tmpEl.style.border = '0';
28
- tmpEl.style.opacity = '0';
29
- document.body.appendChild(tmpEl);
30
- tmpEl.focus();
31
- if (this._matInput) {
32
- this._matInput.focus();
33
- }
34
- else if (this._el.nativeElement.focus) {
35
- this._el.nativeElement.focus();
36
- }
37
- document.body.removeChild(tmpEl);
38
- }, 50);
39
- }
40
- }
41
- FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
42
- FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutofocusDirective, selector: "[fsAutofocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus" }, ngImport: i0 });
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: '[fsAutofocus],[autofocus]',
47
- }]
48
- }], ctorParameters: function () { return [{ type: i1.MatInput, decorators: [{
49
- type: Optional
50
- }, {
51
- type: Host
52
- }] }, { type: i0.ElementRef }]; }, propDecorators: { fsAutofocus: [{
53
- type: Input
9
+ class FsAutofocusDirective {
10
+ constructor(_matInput, _el) {
11
+ this._matInput = _matInput;
12
+ this._el = _el;
13
+ this.fsAutofocus = true;
14
+ }
15
+ ngAfterViewInit() {
16
+ if (this.fsAutofocus || this.fsAutofocus === undefined) {
17
+ this.focus();
18
+ }
19
+ }
20
+ focus() {
21
+ setTimeout(() => {
22
+ const tmpEl = document.createElement('input');
23
+ tmpEl.style.width = '0';
24
+ tmpEl.style.height = '0';
25
+ tmpEl.style.margin = '0';
26
+ tmpEl.style.padding = '0';
27
+ tmpEl.style.border = '0';
28
+ tmpEl.style.opacity = '0';
29
+ document.body.appendChild(tmpEl);
30
+ tmpEl.focus();
31
+ if (this._matInput) {
32
+ this._matInput.focus();
33
+ }
34
+ else if (this._el.nativeElement.focus) {
35
+ this._el.nativeElement.focus();
36
+ }
37
+ document.body.removeChild(tmpEl);
38
+ }, 50);
39
+ }
40
+ }
41
+ FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
42
+ FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutofocusDirective, selector: "[fsAutofocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus" }, ngImport: i0 });
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, decorators: [{
44
+ type: Directive,
45
+ args: [{
46
+ selector: '[fsAutofocus],[autofocus]',
47
+ }]
48
+ }], ctorParameters: function () { return [{ type: i1.MatInput, decorators: [{
49
+ type: Optional
50
+ }, {
51
+ type: Host
52
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { fsAutofocus: [{
53
+ type: Input
54
54
  }] } });
55
55
 
56
- class FsModelChangeDirective {
57
- constructor(_ngModel) {
58
- this._ngModel = _ngModel;
59
- this.fsModelChange = new EventEmitter();
60
- this._destroy$ = new Subject();
61
- }
62
- ngOnInit() {
63
- this._ngModel.update
64
- .pipe(debounceTime(this.fsModelChangeOptions.debounce), takeUntil(this._destroy$))
65
- .subscribe((value) => {
66
- this.fsModelChange.emit(value);
67
- });
68
- }
69
- ngOnDestroy() {
70
- this._destroy$.next();
71
- this._destroy$.complete();
72
- }
73
- }
74
- FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
75
- FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, decorators: [{
77
- type: Directive,
78
- args: [{
79
- selector: '[fsModelChange]',
80
- }]
81
- }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
82
- type: Input
83
- }], fsModelChange: [{
84
- type: Output
56
+ class FsModelChangeDirective {
57
+ constructor(_ngModel) {
58
+ this._ngModel = _ngModel;
59
+ this.fsModelChange = new EventEmitter();
60
+ this._destroy$ = new Subject();
61
+ }
62
+ ngOnInit() {
63
+ this._ngModel.update
64
+ .pipe(debounceTime(this.fsModelChangeOptions?.debounce || 500), takeUntil(this._destroy$))
65
+ .subscribe((value) => {
66
+ this.fsModelChange.emit(value);
67
+ });
68
+ }
69
+ ngOnDestroy() {
70
+ this._destroy$.next();
71
+ this._destroy$.complete();
72
+ }
73
+ }
74
+ FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
75
+ FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, decorators: [{
77
+ type: Directive,
78
+ args: [{
79
+ selector: '[fsModelChange]',
80
+ }]
81
+ }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
82
+ type: Input
83
+ }], fsModelChange: [{
84
+ type: Output
85
85
  }] } });
86
86
 
87
- class FsPreventDefaultDirective {
88
- preventClick(event) {
89
- event.preventDefault();
90
- }
91
- }
92
- FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
- FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
95
- type: Directive,
96
- args: [{
97
- selector: '[fsPreventDefault]',
98
- }]
99
- }], propDecorators: { preventClick: [{
100
- type: HostListener,
101
- args: ['click', ['$event']]
87
+ class FsPreventDefaultDirective {
88
+ preventClick(event) {
89
+ event.preventDefault();
90
+ }
91
+ }
92
+ FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
+ FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
95
+ type: Directive,
96
+ args: [{
97
+ selector: '[fsPreventDefault]',
98
+ }]
99
+ }], propDecorators: { preventClick: [{
100
+ type: HostListener,
101
+ args: ['click', ['$event']]
102
102
  }] } });
103
103
 
104
- class FsStopPropagationDirective {
105
- preventClick(event) {
106
- event.stopPropagation();
107
- }
108
- }
109
- FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
110
- FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
112
- type: Directive,
113
- args: [{
114
- selector: '[fsStopPropagation]',
115
- }]
116
- }], propDecorators: { preventClick: [{
117
- type: HostListener,
118
- args: ['click', ['$event']]
104
+ class FsStopPropagationDirective {
105
+ preventClick(event) {
106
+ event.stopPropagation();
107
+ }
108
+ }
109
+ FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
110
+ FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
112
+ type: Directive,
113
+ args: [{
114
+ selector: '[fsStopPropagation]',
115
+ }]
116
+ }], propDecorators: { preventClick: [{
117
+ type: HostListener,
118
+ args: ['click', ['$event']]
119
119
  }] } });
120
120
 
121
- function guid(pattern, options = { case: 'lower', numbers: true }) {
122
- pattern = pattern || 'xxxxxx';
123
- let s = '';
124
- if (options.numbers !== false) {
125
- s = '0123456789';
126
- }
127
- if (!options.case || options.case === 'lower' || options.case === 'mixed') {
128
- s = s.concat('abcdefghijklmnopqrstuvwxyz');
129
- }
130
- if (options.case === 'upper' || options.case === 'mixed') {
131
- s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
132
- }
133
- const chars = s.match(/(.{1,1})/g);
134
- return pattern.replace(/[x]/g, function (c) {
135
- const i = (Math.random() * chars.length) | 0;
136
- return chars[i];
137
- });
138
- }
139
-
140
- function isEmpty(value, options) {
141
- options = options || {};
142
- return value === undefined ||
143
- value === null ||
144
- value === false ||
145
- value === '' ||
146
- String(value).length === 0 ||
147
- (Array.isArray(value) && value.length === 0) ||
148
- (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
149
- (!options.zero && (value === 0 || value === '0'));
150
- }
151
-
152
- function stringify(value) {
153
- return JSON.stringify(value);
154
- }
155
-
156
- class FsUtilStringifyPipe {
157
- constructor() { }
158
- transform(value) {
159
- return stringify(value);
160
- }
161
- }
162
- FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
163
- FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
165
- type: Pipe,
166
- args: [{
167
- name: 'fsUtilStringify',
168
- }]
169
- }], ctorParameters: function () { return []; } });
170
- class FsUtilGuidPipe {
171
- constructor() { }
172
- transform() {
173
- return guid();
174
- }
175
- }
176
- FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
177
- FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
179
- type: Pipe,
180
- args: [{
181
- name: 'fsUtilGuid',
182
- }]
183
- }], ctorParameters: function () { return []; } });
184
- class FsUtilIsEmptyPipe {
185
- transform(value) {
186
- return isEmpty(value);
187
- }
188
- }
189
- FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
190
- FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
192
- type: Pipe,
193
- args: [{
194
- name: 'fsUtilIsEmpty',
195
- }]
196
- }] });
197
- class FsUtilIsNotEmptyPipe {
198
- transform(value) {
199
- return !isEmpty(value);
200
- }
201
- }
202
- FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
203
- FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
205
- type: Pipe,
206
- args: [{
207
- name: 'fsUtilIsNotEmpty',
208
- }]
121
+ function guid(pattern, options = { case: 'lower', numbers: true }) {
122
+ pattern = pattern || 'xxxxxx';
123
+ let s = '';
124
+ if (options.numbers !== false) {
125
+ s = '0123456789';
126
+ }
127
+ if (!options.case || options.case === 'lower' || options.case === 'mixed') {
128
+ s = s.concat('abcdefghijklmnopqrstuvwxyz');
129
+ }
130
+ if (options.case === 'upper' || options.case === 'mixed') {
131
+ s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
132
+ }
133
+ const chars = s.match(/(.{1,1})/g);
134
+ return pattern.replace(/[x]/g, function (c) {
135
+ const i = (Math.random() * chars.length) | 0;
136
+ return chars[i];
137
+ });
138
+ }
139
+
140
+ function isEmpty(value, options) {
141
+ options = options || {};
142
+ return value === undefined ||
143
+ value === null ||
144
+ value === false ||
145
+ value === '' ||
146
+ String(value).length === 0 ||
147
+ (Array.isArray(value) && value.length === 0) ||
148
+ (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
149
+ (!options.zero && (value === 0 || value === '0'));
150
+ }
151
+
152
+ function stringify(value) {
153
+ return JSON.stringify(value);
154
+ }
155
+
156
+ class FsUtilStringifyPipe {
157
+ constructor() { }
158
+ transform(value) {
159
+ return stringify(value);
160
+ }
161
+ }
162
+ FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
163
+ FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
165
+ type: Pipe,
166
+ args: [{
167
+ name: 'fsUtilStringify',
168
+ }]
169
+ }], ctorParameters: function () { return []; } });
170
+ class FsUtilGuidPipe {
171
+ constructor() { }
172
+ transform() {
173
+ return guid();
174
+ }
175
+ }
176
+ FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
177
+ FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
179
+ type: Pipe,
180
+ args: [{
181
+ name: 'fsUtilGuid',
182
+ }]
183
+ }], ctorParameters: function () { return []; } });
184
+ class FsUtilIsEmptyPipe {
185
+ transform(value) {
186
+ return isEmpty(value);
187
+ }
188
+ }
189
+ FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
190
+ FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
192
+ type: Pipe,
193
+ args: [{
194
+ name: 'fsUtilIsEmpty',
195
+ }]
196
+ }] });
197
+ class FsUtilIsNotEmptyPipe {
198
+ transform(value) {
199
+ return !isEmpty(value);
200
+ }
201
+ }
202
+ FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
203
+ FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
205
+ type: Pipe,
206
+ args: [{
207
+ name: 'fsUtilIsNotEmpty',
208
+ }]
209
209
  }] });
210
210
 
211
- function compare(query, item) {
212
- let value = true;
213
- for (const key in query) {
214
- value = value && item[key] == query[key];
215
- }
216
- return value;
217
- }
218
-
219
- function filter(array, query) {
220
- if (typeof query !== 'function') {
221
- const queryObj = query;
222
- query = (item) => {
223
- return compare(queryObj, item);
224
- };
225
- }
226
- const isarray = Array.isArray(array);
227
- const list = isarray ? [] : {};
228
- if (isarray) {
229
- array.forEach(function (item, idx) {
230
- if (query(item)) {
231
- list.push(item);
232
- }
233
- });
234
- }
235
- else {
236
- Object.keys(array).forEach(key => {
237
- if (query(array[key])) {
238
- list[key] = array[key];
239
- }
240
- });
241
- }
242
- return list;
243
- }
244
-
245
- function inArray(values, array) {
246
- if (!Array.isArray(values)) {
247
- values = [values];
248
- }
249
- for (let i = 0, len = values.length; i < len; i++) {
250
- if (array.indexOf(values[i]) >= 0) {
251
- return true;
252
- }
253
- }
254
- return false;
255
- }
256
-
257
- function index(array, name, value = null) {
258
- const list = {};
259
- array.forEach(function (item) {
260
- list[item[name]] = value ? item[value] : item;
261
- });
262
- return list;
263
- }
264
-
265
- function indexOf(array, query) {
266
- if (typeof query !== 'function') {
267
- const queryObj = query;
268
- query = (item) => {
269
- return compare(queryObj, item);
270
- };
271
- }
272
- for (let i = 0, len = array.length; i < len; i++) {
273
- if (query(array[i])) {
274
- return i;
275
- }
276
- }
277
- return -1;
278
- }
279
-
280
- function keyExists(array, key) {
281
- return array.hasOwnProperty(key);
282
- }
283
-
284
- function ksort(unordered) {
285
- Object.keys(unordered).sort().forEach(function (key) {
286
- const value = unordered[key];
287
- delete unordered[key];
288
- unordered[key] = value;
289
- });
290
- }
291
-
292
- function list(array, property, index = null) {
293
- const resultList = index ? {} : [];
294
- array.forEach(function (item, idx) {
295
- if (index) {
296
- resultList[item[index]] = item[property];
297
- }
298
- else {
299
- resultList.push(item[property]);
300
- }
301
- });
302
- return resultList;
303
- }
304
-
305
- function nameValue(array, name, value) {
306
- const list = [];
307
- if (name || value) {
308
- const nameFn = typeof name === 'function' ? name : function (item) {
309
- return item[name];
310
- };
311
- const valueFn = typeof value === 'function' ? value : function (item) {
312
- return item[value];
313
- };
314
- array.forEach(function (item) {
315
- list.push({ name: nameFn(item), value: valueFn(item) });
316
- });
317
- }
318
- else {
319
- array.forEach(function (n, v) {
320
- list.push({ name: n, value: v });
321
- });
322
- }
323
- return list;
324
- }
325
-
326
- function remove(array, query) {
327
- const idx = indexOf(array, query);
328
- if (idx >= 0) {
329
- return array.splice(idx, 1);
330
- }
331
- return idx;
332
- }
333
-
334
- function sort(array, query, reverse = false) {
335
- if (typeof query !== 'function') {
336
- const queryStr = query;
337
- query = function (a, b) {
338
- if (reverse) {
339
- if (a[queryStr] < b[queryStr]) {
340
- return 1;
341
- }
342
- else if (a[queryStr] > b[queryStr]) {
343
- return -1;
344
- }
345
- }
346
- else {
347
- if (a[queryStr] > b[queryStr]) {
348
- return 1;
349
- }
350
- else if (a[queryStr] < b[queryStr]) {
351
- return -1;
352
- }
353
- }
354
- return 0;
355
- };
356
- }
357
- array.sort(query);
358
- return array;
359
- }
360
-
361
- function rsort(array, query) {
362
- return sort(array, query, true);
363
- }
364
-
365
- function find(array, query) {
366
- const data = filter(array, query);
367
- return data.length ? data[0] : null;
368
- }
369
-
370
- function boolean(value) {
371
- return String(value).toLowerCase() !== 'false' && !!value;
372
- }
373
-
374
- function clone(obj) {
375
- if (obj instanceof Date) {
376
- return new Date(obj);
377
- }
378
- else if (Array.isArray(obj)) {
379
- const arr = [];
380
- for (let i = 0; i < obj.length; i++) {
381
- arr[i] = clone(obj[i]);
382
- }
383
- return arr;
384
- }
385
- else if (typeof (obj) === 'object') {
386
- const cloned = {};
387
- for (let key in obj) {
388
- cloned[key] = clone(obj[key]);
389
- }
390
- return cloned;
391
- }
392
- return obj;
393
- }
394
-
395
- function debounce(func, wait, immediate) {
396
- let timeout;
397
- return function () {
398
- const context = this, args = arguments;
399
- const later = function () {
400
- timeout = null;
401
- if (!immediate)
402
- func.apply(context, args);
403
- };
404
- const callNow = immediate && !timeout;
405
- clearTimeout(timeout);
406
- timeout = setTimeout(later, wait);
407
- if (callNow)
408
- func.apply(context, args);
409
- };
410
- }
411
-
412
- function removeQueryParams(path) {
413
- return path.split('?')[0];
414
- }
415
-
416
- function getNormalizedPath(locationSrv) {
417
- const path = locationSrv.prepareExternalUrl(locationSrv.path());
418
- return removeQueryParams(path);
419
- }
420
-
421
- function isArrayEqual(arr1, arr2) {
422
- if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
423
- return false;
424
- }
425
- const sortFn = (a, b) => {
426
- if (a < b) {
427
- return -1;
428
- }
429
- else if (a > b) {
430
- return 1;
431
- }
432
- else {
433
- return 0;
434
- }
435
- };
436
- arr1 = [...arr1].sort(sortFn);
437
- arr2 = [...arr2].sort(sortFn);
438
- return arr1.every((value, index) => {
439
- return value === arr2[index];
440
- });
441
- }
442
-
443
- function isClass(value, cls) {
444
- if (typeof value === 'object') {
445
- if (typeof cls === 'string') {
446
- if (value.constructor) {
447
- if (value.constructor.name === cls) {
448
- return true;
449
- }
450
- }
451
- }
452
- else {
453
- if (value instanceof cls) {
454
- return true;
455
- }
456
- }
457
- }
458
- return false;
459
- }
460
-
461
- function isNumeric(value) {
462
- const str = String(value);
463
- return str.length && !!str.match(/^-?\d*\.?\d*$/);
464
- }
465
-
466
- function isObject(value) {
467
- return !!value && typeof value === 'object' && !Array.isArray(value);
468
- }
469
-
470
- const KEY_CANCEL$1 = 3;
471
- const KEY_HELP$1 = 6;
472
- const KEY_BACKSPACE$1 = 8;
473
- const KEY_TAB$1 = 9;
474
- const KEY_CLEAR$1 = 12;
475
- const KEY_RETURN$1 = 13;
476
- const KEY_ENTER$1 = 14;
477
- const KEY_SHIFT$1 = 16;
478
- const KEY_CONTROL$1 = 17;
479
- const KEY_ALT$1 = 18;
480
- const KEY_PAUSE$1 = 19;
481
- const KEY_CAPS_LOCK$1 = 20;
482
- const KEY_ESCAPE$1 = 27;
483
- const KEY_SPACE$1 = 32;
484
- const KEY_PAGE_UP$1 = 33;
485
- const KEY_PAGE_DOWN$1 = 34;
486
- const KEY_END$1 = 35;
487
- const KEY_HOME$1 = 36;
488
- const KEY_LEFT$1 = 37;
489
- const KEY_UP$1 = 38;
490
- const KEY_RIGHT$1 = 39;
491
- const KEY_DOWN$1 = 40;
492
- const KEY_PRINTSCREEN$1 = 44;
493
- const KEY_INSERT$1 = 45;
494
- const KEY_DELETE$1 = 46;
495
- const KEY_0$1 = 48;
496
- const KEY_1$1 = 49;
497
- const KEY_2$1 = 50;
498
- const KEY_3$1 = 51;
499
- const KEY_4$1 = 52;
500
- const KEY_5$1 = 53;
501
- const KEY_6$1 = 54;
502
- const KEY_7$1 = 55;
503
- const KEY_8$1 = 56;
504
- const KEY_9$1 = 57;
505
- const KEY_SEMICOLON$1 = 59;
211
+ function compare(query, item) {
212
+ let value = true;
213
+ for (const key in query) {
214
+ value = value && item[key] == query[key];
215
+ }
216
+ return value;
217
+ }
218
+
219
+ function filter(array, query) {
220
+ if (typeof query !== 'function') {
221
+ const queryObj = query;
222
+ query = (item) => {
223
+ return compare(queryObj, item);
224
+ };
225
+ }
226
+ const isarray = Array.isArray(array);
227
+ const list = isarray ? [] : {};
228
+ if (isarray) {
229
+ array.forEach(function (item, idx) {
230
+ if (query(item)) {
231
+ list.push(item);
232
+ }
233
+ });
234
+ }
235
+ else {
236
+ Object.keys(array).forEach(key => {
237
+ if (query(array[key])) {
238
+ list[key] = array[key];
239
+ }
240
+ });
241
+ }
242
+ return list;
243
+ }
244
+
245
+ function inArray(values, array) {
246
+ if (!Array.isArray(values)) {
247
+ values = [values];
248
+ }
249
+ for (let i = 0, len = values.length; i < len; i++) {
250
+ if (array.indexOf(values[i]) >= 0) {
251
+ return true;
252
+ }
253
+ }
254
+ return false;
255
+ }
256
+
257
+ function index(array, name, value = null) {
258
+ const list = {};
259
+ array.forEach(function (item) {
260
+ list[item[name]] = value ? item[value] : item;
261
+ });
262
+ return list;
263
+ }
264
+
265
+ function indexOf(array, query) {
266
+ if (typeof query !== 'function') {
267
+ const queryObj = query;
268
+ query = (item) => {
269
+ return compare(queryObj, item);
270
+ };
271
+ }
272
+ for (let i = 0, len = array.length; i < len; i++) {
273
+ if (query(array[i])) {
274
+ return i;
275
+ }
276
+ }
277
+ return -1;
278
+ }
279
+
280
+ function keyExists(array, key) {
281
+ return array.hasOwnProperty(key);
282
+ }
283
+
284
+ function ksort(unordered) {
285
+ Object.keys(unordered).sort().forEach(function (key) {
286
+ const value = unordered[key];
287
+ delete unordered[key];
288
+ unordered[key] = value;
289
+ });
290
+ }
291
+
292
+ function list(array, property, index = null) {
293
+ const resultList = index ? {} : [];
294
+ array.forEach(function (item, idx) {
295
+ if (index) {
296
+ resultList[item[index]] = item[property];
297
+ }
298
+ else {
299
+ resultList.push(item[property]);
300
+ }
301
+ });
302
+ return resultList;
303
+ }
304
+
305
+ function nameValue(array, name, value) {
306
+ const list = [];
307
+ if (name || value) {
308
+ const nameFn = typeof name === 'function' ? name : function (item) {
309
+ return item[name];
310
+ };
311
+ const valueFn = typeof value === 'function' ? value : function (item) {
312
+ return item[value];
313
+ };
314
+ array.forEach(function (item) {
315
+ list.push({ name: nameFn(item), value: valueFn(item) });
316
+ });
317
+ }
318
+ else {
319
+ array.forEach(function (n, v) {
320
+ list.push({ name: n, value: v });
321
+ });
322
+ }
323
+ return list;
324
+ }
325
+
326
+ function remove(array, query) {
327
+ const idx = indexOf(array, query);
328
+ if (idx >= 0) {
329
+ return array.splice(idx, 1);
330
+ }
331
+ return idx;
332
+ }
333
+
334
+ function sort(array, query, reverse = false) {
335
+ if (typeof query !== 'function') {
336
+ const queryStr = query;
337
+ query = function (a, b) {
338
+ if (reverse) {
339
+ if (a[queryStr] < b[queryStr]) {
340
+ return 1;
341
+ }
342
+ else if (a[queryStr] > b[queryStr]) {
343
+ return -1;
344
+ }
345
+ }
346
+ else {
347
+ if (a[queryStr] > b[queryStr]) {
348
+ return 1;
349
+ }
350
+ else if (a[queryStr] < b[queryStr]) {
351
+ return -1;
352
+ }
353
+ }
354
+ return 0;
355
+ };
356
+ }
357
+ array.sort(query);
358
+ return array;
359
+ }
360
+
361
+ function rsort(array, query) {
362
+ return sort(array, query, true);
363
+ }
364
+
365
+ function find(array, query) {
366
+ const data = filter(array, query);
367
+ return data.length ? data[0] : null;
368
+ }
369
+
370
+ function boolean(value) {
371
+ return String(value).toLowerCase() !== 'false' && !!value;
372
+ }
373
+
374
+ function clone(obj) {
375
+ if (obj instanceof Date) {
376
+ return new Date(obj);
377
+ }
378
+ else if (Array.isArray(obj)) {
379
+ const arr = [];
380
+ for (let i = 0; i < obj.length; i++) {
381
+ arr[i] = clone(obj[i]);
382
+ }
383
+ return arr;
384
+ }
385
+ else if (typeof (obj) === 'object') {
386
+ const cloned = {};
387
+ for (let key in obj) {
388
+ cloned[key] = clone(obj[key]);
389
+ }
390
+ return cloned;
391
+ }
392
+ return obj;
393
+ }
394
+
395
+ function debounce(func, wait, immediate) {
396
+ let timeout;
397
+ return function () {
398
+ const context = this, args = arguments;
399
+ const later = function () {
400
+ timeout = null;
401
+ if (!immediate)
402
+ func.apply(context, args);
403
+ };
404
+ const callNow = immediate && !timeout;
405
+ clearTimeout(timeout);
406
+ timeout = setTimeout(later, wait);
407
+ if (callNow)
408
+ func.apply(context, args);
409
+ };
410
+ }
411
+
412
+ function removeQueryParams(path) {
413
+ return path.split('?')[0];
414
+ }
415
+
416
+ function getNormalizedPath(locationSrv) {
417
+ const path = locationSrv.prepareExternalUrl(locationSrv.path());
418
+ return removeQueryParams(path);
419
+ }
420
+
421
+ function isArrayEqual(arr1, arr2) {
422
+ if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
423
+ return false;
424
+ }
425
+ const sortFn = (a, b) => {
426
+ if (a < b) {
427
+ return -1;
428
+ }
429
+ else if (a > b) {
430
+ return 1;
431
+ }
432
+ else {
433
+ return 0;
434
+ }
435
+ };
436
+ arr1 = [...arr1].sort(sortFn);
437
+ arr2 = [...arr2].sort(sortFn);
438
+ return arr1.every((value, index) => {
439
+ return value === arr2[index];
440
+ });
441
+ }
442
+
443
+ function isClass(value, cls) {
444
+ if (typeof value === 'object') {
445
+ if (typeof cls === 'string') {
446
+ if (value.constructor) {
447
+ if (value.constructor.name === cls) {
448
+ return true;
449
+ }
450
+ }
451
+ }
452
+ else {
453
+ if (value instanceof cls) {
454
+ return true;
455
+ }
456
+ }
457
+ }
458
+ return false;
459
+ }
460
+
461
+ function isNumeric(value) {
462
+ const str = String(value);
463
+ return str.length && !!str.match(/^-?\d*\.?\d*$/);
464
+ }
465
+
466
+ function isObject(value) {
467
+ return !!value && typeof value === 'object' && !Array.isArray(value);
468
+ }
469
+
470
+ const KEY_CANCEL$1 = 3;
471
+ const KEY_HELP$1 = 6;
472
+ const KEY_BACKSPACE$1 = 8;
473
+ const KEY_TAB$1 = 9;
474
+ const KEY_CLEAR$1 = 12;
475
+ const KEY_RETURN$1 = 13;
476
+ const KEY_ENTER$1 = 14;
477
+ const KEY_SHIFT$1 = 16;
478
+ const KEY_CONTROL$1 = 17;
479
+ const KEY_ALT$1 = 18;
480
+ const KEY_PAUSE$1 = 19;
481
+ const KEY_CAPS_LOCK$1 = 20;
482
+ const KEY_ESCAPE$1 = 27;
483
+ const KEY_SPACE$1 = 32;
484
+ const KEY_PAGE_UP$1 = 33;
485
+ const KEY_PAGE_DOWN$1 = 34;
486
+ const KEY_END$1 = 35;
487
+ const KEY_HOME$1 = 36;
488
+ const KEY_LEFT$1 = 37;
489
+ const KEY_UP$1 = 38;
490
+ const KEY_RIGHT$1 = 39;
491
+ const KEY_DOWN$1 = 40;
492
+ const KEY_PRINTSCREEN$1 = 44;
493
+ const KEY_INSERT$1 = 45;
494
+ const KEY_DELETE$1 = 46;
495
+ const KEY_0$1 = 48;
496
+ const KEY_1$1 = 49;
497
+ const KEY_2$1 = 50;
498
+ const KEY_3$1 = 51;
499
+ const KEY_4$1 = 52;
500
+ const KEY_5$1 = 53;
501
+ const KEY_6$1 = 54;
502
+ const KEY_7$1 = 55;
503
+ const KEY_8$1 = 56;
504
+ const KEY_9$1 = 57;
505
+ const KEY_SEMICOLON$1 = 59;
506
506
  const KEY_EQUALS$1 = 61;
507
507
 
508
- function length(object) {
509
- if (Array.isArray(object)) {
510
- return object.length;
511
- }
512
- if (object instanceof Object) {
513
- return Object.keys(object).length;
514
- }
515
- return 0;
516
- }
517
-
518
- function ordinalNumber(value) {
519
- value = String(value);
520
- const index = value.match `1?.$`;
521
- const endings = [, 'st', 'nd', 'rd'];
522
- const ending = endings[index] || 'th';
523
- return value + ending;
524
- }
525
-
526
- class Operation {
527
- constructor(target, name) {
528
- this.ready$ = new Subject();
529
- this.name = name ? name : guid();
530
- if (target instanceof Observable) {
531
- this.target = target;
532
- }
533
- else {
534
- this.target = of(target);
535
- }
536
- }
537
- }
538
-
539
- var QueueState;
540
- (function (QueueState) {
541
- QueueState["Idle"] = "idle";
542
- QueueState["Processing"] = "processing";
508
+ function length(object) {
509
+ if (Array.isArray(object)) {
510
+ return object.length;
511
+ }
512
+ if (object instanceof Object) {
513
+ return Object.keys(object).length;
514
+ }
515
+ return 0;
516
+ }
517
+
518
+ function ordinalNumber(value) {
519
+ value = String(value);
520
+ const index = value.match `1?.$`;
521
+ const endings = [, 'st', 'nd', 'rd'];
522
+ const ending = endings[index] || 'th';
523
+ return value + ending;
524
+ }
525
+
526
+ class Operation {
527
+ constructor(target, name) {
528
+ this.ready$ = new Subject();
529
+ this.name = name ? name : guid();
530
+ if (target instanceof Observable) {
531
+ this.target = target;
532
+ }
533
+ else {
534
+ this.target = of(target);
535
+ }
536
+ }
537
+ }
538
+
539
+ var QueueState;
540
+ (function (QueueState) {
541
+ QueueState["Idle"] = "idle";
542
+ QueueState["Processing"] = "processing";
543
543
  })(QueueState || (QueueState = {}));
544
544
 
545
- class Queue {
546
- constructor(_limit = Infinity) {
547
- this._limit = _limit;
548
- this._queueStats = {
549
- completed: 0,
550
- total: 0,
551
- errors: [],
552
- };
553
- this._doneQueueStats = {
554
- completed: 0,
555
- total: 0,
556
- errors: [],
557
- };
558
- this._completeQueueStats = {
559
- completed: 0,
560
- total: 0,
561
- errors: [],
562
- };
563
- this._done = new Subject();
564
- this._queue = [];
565
- this._inProgress = [];
566
- this._state = QueueState.Idle;
567
- this._destroy$ = new Subject();
568
- // if(_targets) {
569
- // _targets.forEach((target) => {
570
- // this.push(target);
571
- // });
572
- // }
573
- }
574
- get total() {
575
- return this._queueStats.total;
576
- }
577
- get completed() {
578
- return this._queueStats.completed;
579
- }
580
- get pending() {
581
- return this._queue.length;
582
- }
583
- get inProgress() {
584
- return this._inProgress.length;
585
- }
586
- get errors() {
587
- return this._queueStats.errors;
588
- }
589
- get state() {
590
- return this._state;
591
- }
592
- get empty() {
593
- return !this._queue.length && !this._inProgress.length;
594
- }
595
- get pendingOperations() {
596
- return this._queue
597
- .map((operation) => operation.name);
598
- }
599
- get inProgressOperations() {
600
- return this._inProgress
601
- .map((operation) => operation.name);
602
- }
603
- isProcessing() {
604
- return this._state === QueueState.Processing;
605
- }
606
- isIdle() {
607
- return this._state === QueueState.Idle;
608
- }
609
- setLimit(value) {
610
- this._limit = value;
611
- }
612
- /**
613
- * @depreated
614
- */
615
- subscribe(fun, err, complete) {
616
- this.observe$
617
- .subscribe(fun, err, complete);
618
- }
619
- get observe$() {
620
- return this._done
621
- .pipe(takeUntil(this._destroy$));
622
- }
623
- get complete$() {
624
- if (!this.isProcessing()) {
625
- return of({ total: 0, completed: 0, errors: [] });
626
- }
627
- return this.observe$
628
- .pipe(take(1), map(() => (this._completeQueueStats)));
629
- }
630
- complete(fun, err, complete) {
631
- this.complete$.subscribe(fun, err, complete);
632
- }
633
- push(target, name) {
634
- const operation = new Operation(target, name);
635
- this._queueStats.total++;
636
- this._doneQueueStats.total++;
637
- this._completeQueueStats.total++;
638
- this._state = QueueState.Processing;
639
- if (this._inProgress.length < this._limit) {
640
- this._processOperation(operation);
641
- }
642
- else {
643
- this._queue.push(operation);
644
- }
645
- return operation.ready$;
646
- }
647
- clear() {
648
- this._queue = [];
649
- this._state = QueueState.Idle;
650
- this._queueStats = {
651
- total: 0,
652
- errors: [],
653
- completed: 0,
654
- };
655
- this._clearDoneQueueStats();
656
- }
657
- destroy() {
658
- this._done.complete();
659
- this.clear();
660
- }
661
- _processOperation(operation) {
662
- this._inProgress.push(operation);
663
- operation.target
664
- .pipe(delay(200), // Hack to prevent extra quick proccess execution
665
- finalize(() => {
666
- const opIndex = this._inProgress.indexOf(operation);
667
- this._inProgress.splice(opIndex, 1);
668
- if (this.empty) {
669
- this._state = QueueState.Idle;
670
- this._done.next(this._doneQueueStats);
671
- this._clearDoneQueueStats();
672
- }
673
- else {
674
- if (this._queue.length) {
675
- const queueItem = this._queue.shift();
676
- this._processOperation(queueItem);
677
- }
678
- }
679
- }), takeUntil(this._destroy$)).subscribe({
680
- next: (data) => {
681
- operation.ready$.next(data);
682
- },
683
- error: (error) => {
684
- this._queueStats.errors.push(error);
685
- this._doneQueueStats.errors.push(error);
686
- this._completeQueueStats.errors.push(error);
687
- operation.ready$.error(error);
688
- },
689
- complete: () => {
690
- this._queueStats.completed++;
691
- this._doneQueueStats.completed++;
692
- this._completeQueueStats.completed++;
693
- operation.ready$.complete();
694
- }
695
- });
696
- }
697
- _clearDoneQueueStats() {
698
- this._doneQueueStats = {
699
- total: 0,
700
- errors: [],
701
- completed: 0,
702
- };
703
- }
704
- }
705
-
706
- function resolve(promise, defaults = []) {
707
- const result = defaults;
708
- return new Promise(resolve => {
709
- promise.then(function (data) {
710
- Object.keys(data).forEach(key => result[key] = data[key]);
711
- resolve(result);
712
- });
713
- });
714
- }
715
-
716
- function round(num, decimalPlaces = 0) {
717
- num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
718
- const p = Math.pow(10, decimalPlaces);
719
- return Math.round(num * p) / p;
720
- }
721
-
722
- const fsSourceLoader = (function () {
723
- let _document;
724
- let _headElement;
725
- const _sources = new Map();
726
- const _loadedResources = new Map();
727
- // bad way but don't want to bother developer
728
- setDocument(document);
729
- // but developer can set document at any time
730
- function setDocument(document) {
731
- _document = document;
732
- _headElement = _document?.head;
733
- }
734
- /**
735
- * register a list of the resources for future loading
736
- *
737
- * example:
738
- * sourceLoader.registerResources({
739
- * froala: [
740
- * '/assets/js/froala/froala_editor.min.js',
741
- * '/assets/css/froala_editor.pkgd.min.css',
742
- * ],
743
- * froala_align: '/assets/js/froala/plugins/align.min.js',
744
- * froala_colors: '/assets/js/froala/plugins/colors.min.js',
745
- * froala_image: '/assets/js/froala/plugins/image.min.js',
746
- * });
747
- *
748
- */
749
- function registerResources(resources) {
750
- Object.entries(resources)
751
- .forEach(([name, path]) => {
752
- if (typeof path === 'string') {
753
- path = [path];
754
- }
755
- if (!_sources.has(name)) {
756
- _sources.set(name, new Set());
757
- }
758
- const resourcesList = _sources.get(name);
759
- path.forEach((p) => {
760
- resourcesList.add(p);
761
- });
762
- });
763
- }
764
- /**
765
- * load any resource previously registered
766
- *
767
- * sourceLoader.loadResource('froala')
768
- *
769
- * or load any js/css file
770
- *
771
- * sourceLoader.loadResource('/assets/my-source.js')
772
- *
773
- */
774
- function loadResource(name) {
775
- if (_loadedResources.has(name)) {
776
- return _loadedResources.get(name);
777
- }
778
- if (_sources.has(name)) {
779
- const sourcesForLoading = [..._sources.get(name)]
780
- .map((path) => {
781
- return _loadResource(path);
782
- })
783
- .filter((v) => !!v);
784
- return combineLatest(sourcesForLoading);
785
- }
786
- return _loadResource(name);
787
- }
788
- /**
789
- * the same as `loadResource` but you can pass list of the resources for loading
790
- */
791
- function loadResources(listOfResources) {
792
- const resourcesToLoad = listOfResources
793
- .reduce((acc, name) => {
794
- const loading$ = loadResource(name);
795
- if (loading$) {
796
- acc.push(loading$);
797
- }
798
- return acc;
799
- }, []);
800
- return combineLatest(resourcesToLoad);
801
- }
802
- ///
803
- function _loadResource(path) {
804
- if (_isStylesUrl(path)) {
805
- return _loadStyles(path);
806
- }
807
- if (_isJavascriptUrl(path)) {
808
- return _loadJs(path);
809
- }
810
- console.warn(`Resource ${path} can not be identified and loaded`);
811
- return null;
812
- }
813
- function _loadJs(scriptPath) {
814
- if (!_loadedResources.has(scriptPath)) {
815
- const obs$ = new Observable((obs) => {
816
- const script = document.createElement('script');
817
- script.src = scriptPath;
818
- _headElement.appendChild(script);
819
- script.onload = () => {
820
- obs.next();
821
- obs.complete();
822
- };
823
- script.onerror = (err) => {
824
- obs.error(err);
825
- };
826
- }).pipe(shareReplay(1));
827
- _loadedResources.set(scriptPath, obs$);
828
- }
829
- return _loadedResources.get(scriptPath);
830
- }
831
- function _loadStyles(stylePath) {
832
- if (!_loadedResources.has(stylePath)) {
833
- const obs$ = new Observable((obs) => {
834
- const style = document.createElement('link');
835
- style.id = stylePath;
836
- style.rel = 'stylesheet';
837
- style.href = `${stylePath}`;
838
- _headElement.appendChild(style);
839
- style.onload = () => {
840
- obs.next();
841
- obs.complete();
842
- };
843
- style.onerror = (err) => {
844
- obs.error(err);
845
- };
846
- });
847
- _loadedResources.set(stylePath, obs$);
848
- }
849
- return _loadedResources.get(stylePath);
850
- }
851
- function _isJavascriptUrl(url) {
852
- return url.endsWith('.js');
853
- }
854
- function _isStylesUrl(url) {
855
- return url.endsWith('.css');
856
- }
857
- return {
858
- setDocument,
859
- registerResources,
860
- loadResource,
861
- loadResources,
862
- loadJs: _loadJs,
863
- loadStyles: _loadStyles,
864
- };
865
- })();
866
- function loadStyles(path) {
867
- return fsSourceLoader.loadStyles(path);
868
- }
869
- ;
870
- function loadJs(path) {
871
- return fsSourceLoader.loadJs(path);
872
- }
545
+ class Queue {
546
+ constructor(_limit = Infinity) {
547
+ this._limit = _limit;
548
+ this._queueStats = {
549
+ completed: 0,
550
+ total: 0,
551
+ errors: [],
552
+ };
553
+ this._doneQueueStats = {
554
+ completed: 0,
555
+ total: 0,
556
+ errors: [],
557
+ };
558
+ this._completeQueueStats = {
559
+ completed: 0,
560
+ total: 0,
561
+ errors: [],
562
+ };
563
+ this._done = new Subject();
564
+ this._queue = [];
565
+ this._inProgress = [];
566
+ this._state = QueueState.Idle;
567
+ this._destroy$ = new Subject();
568
+ // if(_targets) {
569
+ // _targets.forEach((target) => {
570
+ // this.push(target);
571
+ // });
572
+ // }
573
+ }
574
+ get total() {
575
+ return this._queueStats.total;
576
+ }
577
+ get completed() {
578
+ return this._queueStats.completed;
579
+ }
580
+ get pending() {
581
+ return this._queue.length;
582
+ }
583
+ get inProgress() {
584
+ return this._inProgress.length;
585
+ }
586
+ get errors() {
587
+ return this._queueStats.errors;
588
+ }
589
+ get state() {
590
+ return this._state;
591
+ }
592
+ get empty() {
593
+ return !this._queue.length && !this._inProgress.length;
594
+ }
595
+ get pendingOperations() {
596
+ return this._queue
597
+ .map((operation) => operation.name);
598
+ }
599
+ get inProgressOperations() {
600
+ return this._inProgress
601
+ .map((operation) => operation.name);
602
+ }
603
+ isProcessing() {
604
+ return this._state === QueueState.Processing;
605
+ }
606
+ isIdle() {
607
+ return this._state === QueueState.Idle;
608
+ }
609
+ setLimit(value) {
610
+ this._limit = value;
611
+ }
612
+ /**
613
+ * @depreated
614
+ */
615
+ subscribe(fun, err, complete) {
616
+ this.observe$
617
+ .subscribe(fun, err, complete);
618
+ }
619
+ get observe$() {
620
+ return this._done
621
+ .pipe(takeUntil(this._destroy$));
622
+ }
623
+ get complete$() {
624
+ if (!this.isProcessing()) {
625
+ return of({ total: 0, completed: 0, errors: [] });
626
+ }
627
+ return this.observe$
628
+ .pipe(take(1), map(() => (this._completeQueueStats)));
629
+ }
630
+ complete(fun, err, complete) {
631
+ this.complete$.subscribe(fun, err, complete);
632
+ }
633
+ push(target, name) {
634
+ const operation = new Operation(target, name);
635
+ this._queueStats.total++;
636
+ this._doneQueueStats.total++;
637
+ this._completeQueueStats.total++;
638
+ this._state = QueueState.Processing;
639
+ if (this._inProgress.length < this._limit) {
640
+ this._processOperation(operation);
641
+ }
642
+ else {
643
+ this._queue.push(operation);
644
+ }
645
+ return operation.ready$;
646
+ }
647
+ clear() {
648
+ this._queue = [];
649
+ this._state = QueueState.Idle;
650
+ this._queueStats = {
651
+ total: 0,
652
+ errors: [],
653
+ completed: 0,
654
+ };
655
+ this._clearDoneQueueStats();
656
+ }
657
+ destroy() {
658
+ this._done.complete();
659
+ this.clear();
660
+ }
661
+ _processOperation(operation) {
662
+ this._inProgress.push(operation);
663
+ operation.target
664
+ .pipe(delay(200), // Hack to prevent extra quick proccess execution
665
+ finalize(() => {
666
+ const opIndex = this._inProgress.indexOf(operation);
667
+ this._inProgress.splice(opIndex, 1);
668
+ if (this.empty) {
669
+ this._state = QueueState.Idle;
670
+ this._done.next(this._doneQueueStats);
671
+ this._clearDoneQueueStats();
672
+ }
673
+ else {
674
+ if (this._queue.length) {
675
+ const queueItem = this._queue.shift();
676
+ this._processOperation(queueItem);
677
+ }
678
+ }
679
+ }), takeUntil(this._destroy$)).subscribe({
680
+ next: (data) => {
681
+ operation.ready$.next(data);
682
+ },
683
+ error: (error) => {
684
+ this._queueStats.errors.push(error);
685
+ this._doneQueueStats.errors.push(error);
686
+ this._completeQueueStats.errors.push(error);
687
+ operation.ready$.error(error);
688
+ },
689
+ complete: () => {
690
+ this._queueStats.completed++;
691
+ this._doneQueueStats.completed++;
692
+ this._completeQueueStats.completed++;
693
+ operation.ready$.complete();
694
+ }
695
+ });
696
+ }
697
+ _clearDoneQueueStats() {
698
+ this._doneQueueStats = {
699
+ total: 0,
700
+ errors: [],
701
+ completed: 0,
702
+ };
703
+ }
704
+ }
705
+
706
+ function resolve(promise, defaults = []) {
707
+ const result = defaults;
708
+ return new Promise(resolve => {
709
+ promise.then(function (data) {
710
+ Object.keys(data).forEach(key => result[key] = data[key]);
711
+ resolve(result);
712
+ });
713
+ });
714
+ }
715
+
716
+ function round(num, decimalPlaces = 0) {
717
+ num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
718
+ const p = Math.pow(10, decimalPlaces);
719
+ return Math.round(num * p) / p;
720
+ }
721
+
722
+ const fsSourceLoader = (function () {
723
+ let _document;
724
+ let _headElement;
725
+ const _sources = new Map();
726
+ const _loadedResources = new Map();
727
+ // bad way but don't want to bother developer
728
+ setDocument(document);
729
+ // but developer can set document at any time
730
+ function setDocument(document) {
731
+ _document = document;
732
+ _headElement = _document?.head;
733
+ }
734
+ /**
735
+ * register a list of the resources for future loading
736
+ *
737
+ * example:
738
+ * sourceLoader.registerResources({
739
+ * froala: [
740
+ * '/assets/js/froala/froala_editor.min.js',
741
+ * '/assets/css/froala_editor.pkgd.min.css',
742
+ * ],
743
+ * froala_align: '/assets/js/froala/plugins/align.min.js',
744
+ * froala_colors: '/assets/js/froala/plugins/colors.min.js',
745
+ * froala_image: '/assets/js/froala/plugins/image.min.js',
746
+ * });
747
+ *
748
+ */
749
+ function registerResources(resources) {
750
+ Object.entries(resources)
751
+ .forEach(([name, path]) => {
752
+ if (typeof path === 'string') {
753
+ path = [path];
754
+ }
755
+ if (!_sources.has(name)) {
756
+ _sources.set(name, new Set());
757
+ }
758
+ const resourcesList = _sources.get(name);
759
+ path.forEach((p) => {
760
+ resourcesList.add(p);
761
+ });
762
+ });
763
+ }
764
+ /**
765
+ * load any resource previously registered
766
+ *
767
+ * sourceLoader.loadResource('froala')
768
+ *
769
+ * or load any js/css file
770
+ *
771
+ * sourceLoader.loadResource('/assets/my-source.js')
772
+ *
773
+ */
774
+ function loadResource(name) {
775
+ if (_loadedResources.has(name)) {
776
+ return _loadedResources.get(name);
777
+ }
778
+ if (_sources.has(name)) {
779
+ const sourcesForLoading = [..._sources.get(name)]
780
+ .map((path) => {
781
+ return _loadResource(path);
782
+ })
783
+ .filter((v) => !!v);
784
+ return combineLatest(sourcesForLoading);
785
+ }
786
+ return _loadResource(name);
787
+ }
788
+ /**
789
+ * the same as `loadResource` but you can pass list of the resources for loading
790
+ */
791
+ function loadResources(listOfResources) {
792
+ const resourcesToLoad = listOfResources
793
+ .reduce((acc, name) => {
794
+ const loading$ = loadResource(name);
795
+ if (loading$) {
796
+ acc.push(loading$);
797
+ }
798
+ return acc;
799
+ }, []);
800
+ return combineLatest(resourcesToLoad);
801
+ }
802
+ ///
803
+ function _loadResource(path) {
804
+ if (_isStylesUrl(path)) {
805
+ return _loadStyles(path);
806
+ }
807
+ if (_isJavascriptUrl(path)) {
808
+ return _loadJs(path);
809
+ }
810
+ console.warn(`Resource ${path} can not be identified and loaded`);
811
+ return null;
812
+ }
813
+ function _loadJs(scriptPath) {
814
+ if (!_loadedResources.has(scriptPath)) {
815
+ const obs$ = new Observable((obs) => {
816
+ const script = document.createElement('script');
817
+ script.src = scriptPath;
818
+ _headElement.appendChild(script);
819
+ script.onload = () => {
820
+ obs.next();
821
+ obs.complete();
822
+ };
823
+ script.onerror = (err) => {
824
+ obs.error(err);
825
+ };
826
+ }).pipe(shareReplay(1));
827
+ _loadedResources.set(scriptPath, obs$);
828
+ }
829
+ return _loadedResources.get(scriptPath);
830
+ }
831
+ function _loadStyles(stylePath) {
832
+ if (!_loadedResources.has(stylePath)) {
833
+ const obs$ = new Observable((obs) => {
834
+ const style = document.createElement('link');
835
+ style.id = stylePath;
836
+ style.rel = 'stylesheet';
837
+ style.href = `${stylePath}`;
838
+ _headElement.appendChild(style);
839
+ style.onload = () => {
840
+ obs.next();
841
+ obs.complete();
842
+ };
843
+ style.onerror = (err) => {
844
+ obs.error(err);
845
+ };
846
+ });
847
+ _loadedResources.set(stylePath, obs$);
848
+ }
849
+ return _loadedResources.get(stylePath);
850
+ }
851
+ function _isJavascriptUrl(url) {
852
+ return url.endsWith('.js');
853
+ }
854
+ function _isStylesUrl(url) {
855
+ return url.endsWith('.css');
856
+ }
857
+ return {
858
+ setDocument,
859
+ registerResources,
860
+ loadResource,
861
+ loadResources,
862
+ loadJs: _loadJs,
863
+ loadStyles: _loadStyles,
864
+ };
865
+ })();
866
+ function loadStyles(path) {
867
+ return fsSourceLoader.loadStyles(path);
868
+ }
873
869
  ;
870
+ function loadJs(path) {
871
+ return fsSourceLoader.loadJs(path);
872
+ }
873
+ ;
874
+
875
+ function throttle(func, wait) {
876
+ let waiting = false; // Initially, we're not waiting
877
+ return function () {
878
+ if (!waiting) { // If we're not waiting
879
+ func.apply(null, arguments); // Execute users function
880
+ waiting = true; // Prevent future invocations
881
+ setTimeout(function () {
882
+ waiting = false; // And allow future invocations
883
+ }, wait);
884
+ }
885
+ };
886
+ }
887
+
888
+ function toString(value) {
889
+ if (value === null || value === undefined) {
890
+ return '';
891
+ }
892
+ return `${value}`;
893
+ }
894
+
895
+ function uuid() {
896
+ return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
897
+ }
898
+
899
+ function value(object, key, def) {
900
+ if (typeof object === 'object' || Array.isArray(object)) {
901
+ if (object.hasOwnProperty(key)) {
902
+ return object[key];
903
+ }
904
+ }
905
+ return def;
906
+ }
874
907
 
875
- function throttle(func, wait) {
876
- let waiting = false; // Initially, we're not waiting
877
- return function () {
878
- if (!waiting) { // If we're not waiting
879
- func.apply(null, arguments); // Execute users function
880
- waiting = true; // Prevent future invocations
881
- setTimeout(function () {
882
- waiting = false; // And allow future invocations
883
- }, wait);
884
- }
885
- };
886
- }
887
-
888
- function toString(value) {
889
- if (value === null || value === undefined) {
890
- return '';
891
- }
892
- return `${value}`;
893
- }
894
-
895
- function uuid() {
896
- return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
897
- }
898
-
899
- function value(object, key, def) {
900
- if (typeof object === 'object' || Array.isArray(object)) {
901
- if (object.hasOwnProperty(key)) {
902
- return object[key];
903
- }
904
- }
905
- return def;
906
- }
907
-
908
- function number(value, decimals) {
909
- if (isNumeric(decimals)) {
910
- value = round(value, decimals);
911
- }
912
- return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
913
- }
914
-
915
- function acronym(str, length = 2) {
916
- const splittedString = str
917
- .replace(/[^a-zA-Z0-9]+/g, ' ')
918
- .split(' ');
919
- let result = '';
920
- for (let i = 0; i < length; i++) {
921
- if (!splittedString[i]) {
922
- if (splittedString.length === 1) {
923
- for (let j = 1; j < length; j++) {
924
- if (!splittedString[i - 1][j]) {
925
- break;
926
- }
927
- result += splittedString[i - 1][j].toUpperCase();
928
- }
929
- }
930
- break;
931
- }
932
- result += splittedString[i][0].toUpperCase();
933
- }
934
- return result;
935
- }
936
-
937
- function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
938
- const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
939
- amount = round(amount, digitsInfo[1]);
940
- return new CurrencyPipe(locale)
941
- .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
942
- }
943
-
944
- function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
945
- value = value || '';
946
- if (completeWords) {
947
- limit = value.substr(0, limit).lastIndexOf(' ');
948
- }
949
- let result = `${value.substr(0, limit)}`;
950
- if (result !== value) {
951
- result += ellipsis;
952
- }
953
- return result;
954
- }
955
-
956
- function email(value) {
957
- return !!String(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
958
- }
959
-
960
- function phone(value) {
961
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
962
- return valid || !String(value).length;
963
- }
964
-
965
- /**
966
- * Check validity of the url.
967
- * Protocol (http/https) isn't required.
968
- * @param value
969
- * @returns {boolean}
970
- */
971
- function url(value) {
972
- const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
973
- const regexp = new RegExp(expression);
974
- return !!String(value).match(regexp);
975
- }
976
-
977
- function delayedRetry(delayMs, maxRetry = 5, message) {
978
- let retries = 0;
979
- return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
980
- retries++;
981
- if (retries <= maxRetry) {
982
- console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
983
- }
984
- }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
985
- }
986
- const getErrorMessage = (maxRetry, defaultMessage) => {
987
- if (!defaultMessage) {
988
- return `Failed to load Resource for ${maxRetry} times. Giving up.`;
989
- }
990
- else {
991
- return defaultMessage;
992
- }
908
+ function number(value, decimals) {
909
+ if (isNumeric(decimals)) {
910
+ value = round(value, decimals);
911
+ }
912
+ return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
913
+ }
914
+
915
+ function acronym(str, length = 2) {
916
+ const splittedString = str
917
+ .replace(/[^a-zA-Z0-9]+/g, ' ')
918
+ .split(' ');
919
+ let result = '';
920
+ for (let i = 0; i < length; i++) {
921
+ if (!splittedString[i]) {
922
+ if (splittedString.length === 1) {
923
+ for (let j = 1; j < length; j++) {
924
+ if (!splittedString[i - 1][j]) {
925
+ break;
926
+ }
927
+ result += splittedString[i - 1][j].toUpperCase();
928
+ }
929
+ }
930
+ break;
931
+ }
932
+ result += splittedString[i][0].toUpperCase();
933
+ }
934
+ return result;
935
+ }
936
+
937
+ function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
938
+ const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
939
+ amount = round(amount, digitsInfo[1]);
940
+ return new CurrencyPipe(locale)
941
+ .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
942
+ }
943
+
944
+ function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
945
+ value = value || '';
946
+ if (completeWords) {
947
+ limit = value.substr(0, limit).lastIndexOf(' ');
948
+ }
949
+ let result = `${value.substr(0, limit)}`;
950
+ if (result !== value) {
951
+ result += ellipsis;
952
+ }
953
+ return result;
954
+ }
955
+
956
+ function email(value) {
957
+ return !!String(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
958
+ }
959
+
960
+ function phone(value) {
961
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
962
+ return valid || !String(value).length;
963
+ }
964
+
965
+ /**
966
+ * Check validity of the url.
967
+ * Protocol (http/https) isn't required.
968
+ * @param value
969
+ * @returns {boolean}
970
+ */
971
+ function url(value) {
972
+ const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
973
+ const regexp = new RegExp(expression);
974
+ return !!String(value).match(regexp);
975
+ }
976
+
977
+ function delayedRetry(delayMs, maxRetry = 5, message) {
978
+ let retries = 0;
979
+ return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
980
+ retries++;
981
+ if (retries <= maxRetry) {
982
+ console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
983
+ }
984
+ }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
985
+ }
986
+ const getErrorMessage = (maxRetry, defaultMessage) => {
987
+ if (!defaultMessage) {
988
+ return `Failed to load Resource for ${maxRetry} times. Giving up.`;
989
+ }
990
+ else {
991
+ return defaultMessage;
992
+ }
993
993
  };
994
994
 
995
- function bytes(bytes, decimals, unit) {
996
- if (!bytes) {
997
- return '0 MB';
998
- }
999
- const e = typeof unit === 'string' ?
1000
- 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
1001
- Math.floor(Math.log(bytes) / Math.log(1024));
1002
- if (!isNumeric(decimals)) {
1003
- decimals = (bytes / 1024) > 1000 ? 2 : 0;
1004
- }
1005
- return `${(bytes / Math.pow(1024, e))
1006
- .toFixed(decimals)}`
1007
- .replace(/\.00/, '')
1008
- + ' '
1009
- + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1010
- }
1011
-
1012
- class FsFormatBytesPipe {
1013
- transform(value, decimals, unit) {
1014
- return bytes(value, decimals, unit);
1015
- }
1016
- }
1017
- FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1018
- FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1019
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1020
- type: Pipe,
1021
- args: [{
1022
- name: 'fsFormatBytes',
1023
- }]
995
+ function bytes(bytes, decimals, unit) {
996
+ if (!bytes) {
997
+ return '0 MB';
998
+ }
999
+ const e = typeof unit === 'string' ?
1000
+ 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
1001
+ Math.floor(Math.log(bytes) / Math.log(1024));
1002
+ if (!isNumeric(decimals)) {
1003
+ decimals = (bytes / 1024) > 1000 ? 2 : 0;
1004
+ }
1005
+ return `${(bytes / Math.pow(1024, e))
1006
+ .toFixed(decimals)}`
1007
+ .replace(/\.00/, '')
1008
+ + ' '
1009
+ + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1010
+ }
1011
+
1012
+ class FsFormatBytesPipe {
1013
+ transform(value, decimals, unit) {
1014
+ return bytes(value, decimals, unit);
1015
+ }
1016
+ }
1017
+ FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1018
+ FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1020
+ type: Pipe,
1021
+ args: [{
1022
+ name: 'fsFormatBytes',
1023
+ }]
1024
1024
  }] });
1025
1025
 
1026
- class FsFormatCurrencyPipe {
1027
- constructor(locale) {
1028
- this.locale = locale;
1029
- }
1030
- transform(amount, precision = 2, currencyCode) {
1031
- return currency(amount, precision, currencyCode);
1032
- }
1033
- }
1034
- FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1035
- FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1036
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1037
- type: Pipe,
1038
- args: [{
1039
- name: 'fsFormatCurrency',
1040
- }]
1041
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1042
- type: Inject,
1043
- args: [LOCALE_ID]
1026
+ class FsFormatCurrencyPipe {
1027
+ constructor(locale) {
1028
+ this.locale = locale;
1029
+ }
1030
+ transform(amount, precision = 2, currencyCode) {
1031
+ return currency(amount, precision, currencyCode);
1032
+ }
1033
+ }
1034
+ FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1035
+ FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1037
+ type: Pipe,
1038
+ args: [{
1039
+ name: 'fsFormatCurrency',
1040
+ }]
1041
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1042
+ type: Inject,
1043
+ args: [LOCALE_ID]
1044
1044
  }] }]; } });
1045
1045
 
1046
- class FsFormatNumberPipe {
1047
- transform(value, decimals) {
1048
- return number(value, decimals);
1049
- }
1050
- }
1051
- FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1052
- FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1053
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1054
- type: Pipe,
1055
- args: [{
1056
- name: 'fsFormatNumber'
1057
- }]
1046
+ class FsFormatNumberPipe {
1047
+ transform(value, decimals) {
1048
+ return number(value, decimals);
1049
+ }
1050
+ }
1051
+ FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1052
+ FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1054
+ type: Pipe,
1055
+ args: [{
1056
+ name: 'fsFormatNumber'
1057
+ }]
1058
1058
  }] });
1059
1059
 
1060
- class FsFormatOrdinalNumberPipe {
1061
- transform(value) {
1062
- return ordinalNumber(value);
1063
- }
1064
- }
1065
- FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1066
- FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1067
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1068
- type: Pipe,
1069
- args: [{
1070
- name: 'fsFormatOrdinalNumber',
1071
- }]
1060
+ class FsFormatOrdinalNumberPipe {
1061
+ transform(value) {
1062
+ return ordinalNumber(value);
1063
+ }
1064
+ }
1065
+ FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1066
+ FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1068
+ type: Pipe,
1069
+ args: [{
1070
+ name: 'fsFormatOrdinalNumber',
1071
+ }]
1072
1072
  }] });
1073
1073
 
1074
- class FsFormatTruncatePipe {
1075
- constructor() { }
1076
- transform(value, limit, completeWords, ellipsis) {
1077
- return truncate(value, limit, completeWords, ellipsis);
1078
- }
1079
- }
1080
- FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1081
- FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1082
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1083
- type: Pipe,
1084
- args: [{
1085
- name: 'fsFormatTruncate'
1086
- }]
1074
+ class FsFormatTruncatePipe {
1075
+ constructor() { }
1076
+ transform(value, limit, completeWords, ellipsis) {
1077
+ return truncate(value, limit, completeWords, ellipsis);
1078
+ }
1079
+ }
1080
+ FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1081
+ FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1083
+ type: Pipe,
1084
+ args: [{
1085
+ name: 'fsFormatTruncate'
1086
+ }]
1087
1087
  }], ctorParameters: function () { return []; } });
1088
1088
 
1089
- class FsArray {
1090
- /**
1091
- * @deprecated use import { nameValue } from @firestitch/common/array; instead
1092
- */
1093
- nameValue(array, name, value) {
1094
- console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1095
- let list = [];
1096
- if (name || value) {
1097
- let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1098
- let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1099
- array.forEach(function (item) {
1100
- list.push({ name: nameFn(item), value: valueFn(item) });
1101
- });
1102
- }
1103
- else {
1104
- array.forEach(function (name, value) {
1105
- list.push({ name: name, value: value });
1106
- });
1107
- }
1108
- return list;
1109
- }
1110
- /**
1111
- * @deprecated use import { remove } from @firestitch/common/array; instead
1112
- */
1113
- remove(array, query) {
1114
- console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1115
- let idx = this.indexOf(array, query);
1116
- if (idx >= 0) {
1117
- return array.splice(idx, 1);
1118
- }
1119
- return idx;
1120
- }
1121
- /**
1122
- * @deprecated use import { indexOf } from @firestitch/common/array; instead
1123
- */
1124
- indexOf(array, query) {
1125
- console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1126
- if (typeof query !== 'function') {
1127
- let queryObj = query;
1128
- query = (item) => {
1129
- return this.compare(queryObj, item);
1130
- };
1131
- }
1132
- for (let i = 0, len = array.length; i < len; i++) {
1133
- if (query(array[i])) {
1134
- return i;
1135
- }
1136
- }
1137
- return -1;
1138
- }
1139
- /**
1140
- * @deprecated use import { compare } from @firestitch/common/array; instead
1141
- */
1142
- compare(query, item) {
1143
- console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1144
- let value = true;
1145
- for (let key in query) {
1146
- value = value && item[key] == query[key];
1147
- }
1148
- return value;
1149
- }
1150
- /**
1151
- * @deprecated use import { filter } from @firestitch/common/array; instead
1152
- */
1153
- filter(array, query) {
1154
- console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1155
- if (typeof query !== 'function') {
1156
- let queryObj = query;
1157
- query = (item) => {
1158
- return this.compare(queryObj, item);
1159
- };
1160
- }
1161
- let isarray = Array.isArray(array);
1162
- let list = isarray ? [] : {};
1163
- if (isarray)
1164
- array.forEach(function (item, idx) {
1165
- if (query(item)) {
1166
- list.push(item);
1167
- }
1168
- });
1169
- else
1170
- Object.keys(array).forEach(key => {
1171
- if (query(array[key])) {
1172
- list[key] = array[key];
1173
- }
1174
- });
1175
- return list;
1176
- }
1177
- /**
1178
- * @deprecated use import { index } from @firestitch/common/array; instead
1179
- */
1180
- index(array, property) {
1181
- console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1182
- let list = {};
1183
- array.forEach(function (item, idx) {
1184
- list[item[property]] = item;
1185
- });
1186
- return list;
1187
- }
1188
- /**
1189
- * @deprecated use import { sort } from @firestitch/common/array; instead
1190
- */
1191
- sort(array, query, reverse = false) {
1192
- console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1193
- if (typeof query !== 'function') {
1194
- let queryStr = query;
1195
- query = function (a, b) {
1196
- if (reverse) {
1197
- if (a[queryStr] < b[queryStr]) {
1198
- return 1;
1199
- }
1200
- else if (a[queryStr] > b[queryStr]) {
1201
- return -1;
1202
- }
1203
- }
1204
- else {
1205
- if (a[queryStr] > b[queryStr]) {
1206
- return 1;
1207
- }
1208
- else if (a[queryStr] < b[queryStr]) {
1209
- return -1;
1210
- }
1211
- }
1212
- return 0;
1213
- };
1214
- }
1215
- array.sort(query);
1216
- return array;
1217
- }
1218
- /**
1219
- * @deprecated use import { rsort } from @firestitch/common/array; instead
1220
- */
1221
- rsort(array, query) {
1222
- console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1223
- return this.sort(array, query, true);
1224
- }
1225
- /**
1226
- * @deprecated use import { list } from @firestitch/common/array; instead
1227
- */
1228
- list(array, property, index = null) {
1229
- console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1230
- let list = index ? {} : [];
1231
- array.forEach(function (item, idx) {
1232
- if (index) {
1233
- list[item[index]] = item[property];
1234
- }
1235
- else {
1236
- list.push(item[property]);
1237
- }
1238
- });
1239
- return list;
1240
- }
1241
- /**
1242
- * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1243
- */
1244
- applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1245
- console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1246
- let keyed = {};
1247
- objects.forEach(function (object) {
1248
- if (!object[parent_property]) {
1249
- object[depth_property] = 0;
1250
- }
1251
- keyed[object[id_property]] = object;
1252
- });
1253
- Object.keys(keyed).forEach(key => {
1254
- Object.keys(keyed).forEach(key => {
1255
- let object = keyed[key];
1256
- if (!keyed[key][depth_property]) {
1257
- if (keyed[key][parent_property]) {
1258
- keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1259
- }
1260
- }
1261
- });
1262
- });
1263
- return keyed;
1264
- }
1265
- /**
1266
- * @deprecated use import { inArray } from @firestitch/common/array; instead
1267
- */
1268
- inArray(values, array) {
1269
- console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1270
- if (!Array.isArray(values)) {
1271
- values = [values];
1272
- }
1273
- for (let i = 0, len = values.length; i < len; i++) {
1274
- if (array.indexOf(values[i]) >= 0) {
1275
- return true;
1276
- }
1277
- }
1278
- return false;
1279
- }
1280
- /**
1281
- * @deprecated use import { keyExists } from @firestitch/common/array; instead
1282
- */
1283
- keyExists(array, key) {
1284
- console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1285
- return array.hasOwnProperty(key);
1286
- }
1287
- /**
1288
- * @deprecated use import { length } from @firestitch/common/array; instead
1289
- */
1290
- length(array) {
1291
- console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1292
- return array.length;
1293
- }
1294
- /**
1295
- * @deprecated use import { ksort } from @firestitch/common/array; instead
1296
- */
1297
- ksort(unordered) {
1298
- console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1299
- Object.keys(unordered).sort().forEach(function (key) {
1300
- let value = unordered[key];
1301
- delete unordered[key];
1302
- unordered[key] = value;
1303
- });
1304
- }
1305
- }
1306
- FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1307
- FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray });
1308
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, decorators: [{
1309
- type: Injectable
1089
+ class FsArray {
1090
+ /**
1091
+ * @deprecated use import { nameValue } from @firestitch/common/array; instead
1092
+ */
1093
+ nameValue(array, name, value) {
1094
+ console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1095
+ let list = [];
1096
+ if (name || value) {
1097
+ let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1098
+ let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1099
+ array.forEach(function (item) {
1100
+ list.push({ name: nameFn(item), value: valueFn(item) });
1101
+ });
1102
+ }
1103
+ else {
1104
+ array.forEach(function (name, value) {
1105
+ list.push({ name: name, value: value });
1106
+ });
1107
+ }
1108
+ return list;
1109
+ }
1110
+ /**
1111
+ * @deprecated use import { remove } from @firestitch/common/array; instead
1112
+ */
1113
+ remove(array, query) {
1114
+ console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1115
+ let idx = this.indexOf(array, query);
1116
+ if (idx >= 0) {
1117
+ return array.splice(idx, 1);
1118
+ }
1119
+ return idx;
1120
+ }
1121
+ /**
1122
+ * @deprecated use import { indexOf } from @firestitch/common/array; instead
1123
+ */
1124
+ indexOf(array, query) {
1125
+ console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1126
+ if (typeof query !== 'function') {
1127
+ let queryObj = query;
1128
+ query = (item) => {
1129
+ return this.compare(queryObj, item);
1130
+ };
1131
+ }
1132
+ for (let i = 0, len = array.length; i < len; i++) {
1133
+ if (query(array[i])) {
1134
+ return i;
1135
+ }
1136
+ }
1137
+ return -1;
1138
+ }
1139
+ /**
1140
+ * @deprecated use import { compare } from @firestitch/common/array; instead
1141
+ */
1142
+ compare(query, item) {
1143
+ console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1144
+ let value = true;
1145
+ for (let key in query) {
1146
+ value = value && item[key] == query[key];
1147
+ }
1148
+ return value;
1149
+ }
1150
+ /**
1151
+ * @deprecated use import { filter } from @firestitch/common/array; instead
1152
+ */
1153
+ filter(array, query) {
1154
+ console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1155
+ if (typeof query !== 'function') {
1156
+ let queryObj = query;
1157
+ query = (item) => {
1158
+ return this.compare(queryObj, item);
1159
+ };
1160
+ }
1161
+ let isarray = Array.isArray(array);
1162
+ let list = isarray ? [] : {};
1163
+ if (isarray)
1164
+ array.forEach(function (item, idx) {
1165
+ if (query(item)) {
1166
+ list.push(item);
1167
+ }
1168
+ });
1169
+ else
1170
+ Object.keys(array).forEach(key => {
1171
+ if (query(array[key])) {
1172
+ list[key] = array[key];
1173
+ }
1174
+ });
1175
+ return list;
1176
+ }
1177
+ /**
1178
+ * @deprecated use import { index } from @firestitch/common/array; instead
1179
+ */
1180
+ index(array, property) {
1181
+ console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1182
+ let list = {};
1183
+ array.forEach(function (item, idx) {
1184
+ list[item[property]] = item;
1185
+ });
1186
+ return list;
1187
+ }
1188
+ /**
1189
+ * @deprecated use import { sort } from @firestitch/common/array; instead
1190
+ */
1191
+ sort(array, query, reverse = false) {
1192
+ console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1193
+ if (typeof query !== 'function') {
1194
+ let queryStr = query;
1195
+ query = function (a, b) {
1196
+ if (reverse) {
1197
+ if (a[queryStr] < b[queryStr]) {
1198
+ return 1;
1199
+ }
1200
+ else if (a[queryStr] > b[queryStr]) {
1201
+ return -1;
1202
+ }
1203
+ }
1204
+ else {
1205
+ if (a[queryStr] > b[queryStr]) {
1206
+ return 1;
1207
+ }
1208
+ else if (a[queryStr] < b[queryStr]) {
1209
+ return -1;
1210
+ }
1211
+ }
1212
+ return 0;
1213
+ };
1214
+ }
1215
+ array.sort(query);
1216
+ return array;
1217
+ }
1218
+ /**
1219
+ * @deprecated use import { rsort } from @firestitch/common/array; instead
1220
+ */
1221
+ rsort(array, query) {
1222
+ console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1223
+ return this.sort(array, query, true);
1224
+ }
1225
+ /**
1226
+ * @deprecated use import { list } from @firestitch/common/array; instead
1227
+ */
1228
+ list(array, property, index = null) {
1229
+ console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1230
+ let list = index ? {} : [];
1231
+ array.forEach(function (item, idx) {
1232
+ if (index) {
1233
+ list[item[index]] = item[property];
1234
+ }
1235
+ else {
1236
+ list.push(item[property]);
1237
+ }
1238
+ });
1239
+ return list;
1240
+ }
1241
+ /**
1242
+ * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1243
+ */
1244
+ applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1245
+ console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1246
+ let keyed = {};
1247
+ objects.forEach(function (object) {
1248
+ if (!object[parent_property]) {
1249
+ object[depth_property] = 0;
1250
+ }
1251
+ keyed[object[id_property]] = object;
1252
+ });
1253
+ Object.keys(keyed).forEach(key => {
1254
+ Object.keys(keyed).forEach(key => {
1255
+ let object = keyed[key];
1256
+ if (!keyed[key][depth_property]) {
1257
+ if (keyed[key][parent_property]) {
1258
+ keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1259
+ }
1260
+ }
1261
+ });
1262
+ });
1263
+ return keyed;
1264
+ }
1265
+ /**
1266
+ * @deprecated use import { inArray } from @firestitch/common/array; instead
1267
+ */
1268
+ inArray(values, array) {
1269
+ console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1270
+ if (!Array.isArray(values)) {
1271
+ values = [values];
1272
+ }
1273
+ for (let i = 0, len = values.length; i < len; i++) {
1274
+ if (array.indexOf(values[i]) >= 0) {
1275
+ return true;
1276
+ }
1277
+ }
1278
+ return false;
1279
+ }
1280
+ /**
1281
+ * @deprecated use import { keyExists } from @firestitch/common/array; instead
1282
+ */
1283
+ keyExists(array, key) {
1284
+ console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1285
+ return array.hasOwnProperty(key);
1286
+ }
1287
+ /**
1288
+ * @deprecated use import { length } from @firestitch/common/array; instead
1289
+ */
1290
+ length(array) {
1291
+ console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1292
+ return array.length;
1293
+ }
1294
+ /**
1295
+ * @deprecated use import { ksort } from @firestitch/common/array; instead
1296
+ */
1297
+ ksort(unordered) {
1298
+ console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1299
+ Object.keys(unordered).sort().forEach(function (key) {
1300
+ let value = unordered[key];
1301
+ delete unordered[key];
1302
+ unordered[key] = value;
1303
+ });
1304
+ }
1305
+ }
1306
+ FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1307
+ FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray });
1308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, decorators: [{
1309
+ type: Injectable
1310
1310
  }] });
1311
1311
 
1312
- class FsMath {
1313
- /**
1314
- * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1315
- */
1316
- round(number, precision) {
1317
- console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1318
- precision = precision || 0;
1319
- let factor = Math.pow(10, precision);
1320
- let tempNumber = number * factor;
1321
- let roundedTempNumber = Math.round(tempNumber);
1322
- return roundedTempNumber / factor;
1323
- }
1324
- }
1325
- FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1326
- FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath });
1327
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, decorators: [{
1328
- type: Injectable
1312
+ class FsMath {
1313
+ /**
1314
+ * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1315
+ */
1316
+ round(number, precision) {
1317
+ console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1318
+ precision = precision || 0;
1319
+ let factor = Math.pow(10, precision);
1320
+ let tempNumber = number * factor;
1321
+ let roundedTempNumber = Math.round(tempNumber);
1322
+ return roundedTempNumber / factor;
1323
+ }
1324
+ }
1325
+ FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1326
+ FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath });
1327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, decorators: [{
1328
+ type: Injectable
1329
1329
  }] });
1330
1330
 
1331
- const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1332
- /*
1333
- Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1334
- There might be a better way to organise constatns but I need to know use-cases
1335
- */
1336
- class FsUtil {
1337
- constructor() {
1338
- this.intervals = {};
1339
- }
1340
- /**
1341
- * @deprecated use @firestitch/common/util/guid instead
1342
- */
1343
- guid(pattern) {
1344
- console.warn('@deprecated use @firestitch/common/util/guid instead');
1345
- pattern = pattern || 'xxxxxx';
1346
- return pattern.replace(/[xy]/g, function (c) {
1347
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1348
- return v.toString(16);
1349
- });
1350
- }
1351
- /**
1352
- * @deprecated use import { uuid } from @firestitch/common/util; instead
1353
- */
1354
- uuid() {
1355
- console.warn('@deprecated use @firestitch/common/util/uuid instead');
1356
- return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1357
- }
1358
- /**
1359
- * @deprecated use import { resolve } from @firestitch/common/util; instead
1360
- */
1361
- resolve(promise, defaults = []) {
1362
- console.warn('@deprecated use @firestitch/common/util/resolve instead');
1363
- const result = defaults;
1364
- return new Promise(resolve => {
1365
- promise.then(function (data) {
1366
- Object.keys(data).forEach(key => result[key] = data[key]);
1367
- resolve(result);
1368
- });
1369
- });
1370
- }
1371
- /**
1372
- * @deprecated use _.toInteger() instead
1373
- */
1374
- int(value) {
1375
- console.warn('@deprecated use _.toInteger() instead');
1376
- value = parseInt(value);
1377
- if (isNaN(value)) {
1378
- value = 0;
1379
- }
1380
- return value;
1381
- }
1382
- /**
1383
- * @deprecated use _.toFinite() instead
1384
- */
1385
- float(value) {
1386
- console.warn('@deprecated use _.toFinite() instead');
1387
- value = parseFloat(value);
1388
- if (isNaN(value)) {
1389
- value = 0;
1390
- }
1391
- return value;
1392
- }
1393
- /**
1394
- * @deprecated use _.toString() instead
1395
- */
1396
- string(string) {
1397
- console.warn('@deprecated use _.toString() instead');
1398
- if (string === null || string === undefined) {
1399
- string = '';
1400
- }
1401
- return (string).toString();
1402
- }
1403
- /**
1404
- * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1405
- */
1406
- isEmpty(value, options) {
1407
- console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1408
- options = options || {};
1409
- return value === undefined ||
1410
- value === null ||
1411
- value === false ||
1412
- value === '' ||
1413
- !this.string(value).length ||
1414
- (this.isObject(value) &&
1415
- (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1416
- (!options.zero && (value === 0 || value === '0'));
1417
- }
1418
- /**
1419
- * @deprecated use _.isInteger() instead
1420
- */
1421
- isInt(value, type) {
1422
- console.warn('@deprecated use _.isInteger() instead');
1423
- const int = !!this.string(value).match(/^\d+$/);
1424
- if (!int) {
1425
- return false;
1426
- }
1427
- if (type) {
1428
- return Number.isInteger(value);
1429
- }
1430
- return true;
1431
- }
1432
- /**
1433
- * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1434
- */
1435
- each(object, func) {
1436
- console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1437
- if (!this.isArray(object) && !this.isObject(object)) {
1438
- return;
1439
- }
1440
- Object.keys(object).forEach(function (key) {
1441
- func(object[key], key);
1442
- });
1443
- }
1444
- /**
1445
- * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1446
- * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1447
- */
1448
- isObject(value) {
1449
- console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1450
- return value !== null && typeof value === 'object' && !this.isArray(value);
1451
- }
1452
- /**
1453
- * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1454
- */
1455
- isString(value) {
1456
- console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1457
- return typeof value === 'string' || value instanceof String;
1458
- }
1459
- /**
1460
- * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1461
- */
1462
- isArray(value) {
1463
- console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1464
- return value instanceof Array;
1465
- }
1466
- /**
1467
- * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1468
- */
1469
- isNumeric(value) {
1470
- console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1471
- return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1472
- }
1473
- /**
1474
- * @deprecated use import { isClass } from @firestitch/common/util; instead
1475
- */
1476
- isClass(value, cls) {
1477
- console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1478
- if (this.isObject(value)) {
1479
- if (this.isString(cls)) {
1480
- if (value.constructor) {
1481
- if (value.constructor.name === cls) {
1482
- return true;
1483
- }
1484
- }
1485
- }
1486
- else {
1487
- if (value instanceof cls) {
1488
- return true;
1489
- }
1490
- }
1491
- }
1492
- return false;
1493
- }
1494
- /**
1495
- * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1496
- */
1497
- isBoolean(value) {
1498
- console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1499
- return value === true || value === false;
1500
- }
1501
- /**
1502
- * @deprecated use import { value } from @firestitch/common/util; instead
1503
- */
1504
- value(object, key, def) {
1505
- console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1506
- if (this.isObject(object) || this.isArray(object)) {
1507
- if (object.hasOwnProperty(key)) {
1508
- return object[key];
1509
- }
1510
- }
1511
- return def;
1512
- }
1513
- throttle(func, wait) {
1514
- console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1515
- let waiting = false; // Initially, we're not waiting
1516
- return function () {
1517
- if (!waiting) { // If we're not waiting
1518
- func.apply(null, arguments); // Execute users function
1519
- waiting = true; // Prevent future invocations
1520
- setTimeout(function () {
1521
- waiting = false; // And allow future invocations
1522
- }, wait);
1523
- }
1524
- };
1525
- }
1526
- /**
1527
- * @deprecated use import { debounce } from @firestitch/common/util; instead
1528
- */
1529
- debounce(func, wait, immediate) {
1530
- console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1531
- var timeout;
1532
- return function () {
1533
- var context = this, args = arguments;
1534
- var later = function () {
1535
- timeout = null;
1536
- if (!immediate)
1537
- func.apply(context, args);
1538
- };
1539
- var callNow = immediate && !timeout;
1540
- clearTimeout(timeout);
1541
- timeout = setTimeout(later, wait);
1542
- if (callNow)
1543
- func.apply(context, args);
1544
- };
1545
- }
1546
- /**
1547
- * @deprecated use import { length } from @firestitch/common/util; instead
1548
- */
1549
- length(object) {
1550
- console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1551
- if (this.isObject(object)) {
1552
- return Object.keys(object).length;
1553
- }
1554
- if (this.isArray(object)) {
1555
- return object.length;
1556
- }
1557
- return 0;
1558
- }
1559
- /**
1560
- * @deprecated use import { boolean } from @firestitch/common/util; instead
1561
- */
1562
- boolean(value) {
1563
- console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1564
- return this.string(value).toLowerCase() !== 'false' && !!value;
1565
- }
1566
- /**
1567
- * @deprecated use import { stringify } from @firestitch/common/util; instead
1568
- */
1569
- stringify(value) {
1570
- console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1571
- return JSON.stringify(value);
1572
- }
1573
- }
1574
- FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1575
- FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil });
1576
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, decorators: [{
1577
- type: Injectable
1331
+ const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1332
+ /*
1333
+ Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1334
+ There might be a better way to organise constatns but I need to know use-cases
1335
+ */
1336
+ class FsUtil {
1337
+ constructor() {
1338
+ this.intervals = {};
1339
+ }
1340
+ /**
1341
+ * @deprecated use @firestitch/common/util/guid instead
1342
+ */
1343
+ guid(pattern) {
1344
+ console.warn('@deprecated use @firestitch/common/util/guid instead');
1345
+ pattern = pattern || 'xxxxxx';
1346
+ return pattern.replace(/[xy]/g, function (c) {
1347
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1348
+ return v.toString(16);
1349
+ });
1350
+ }
1351
+ /**
1352
+ * @deprecated use import { uuid } from @firestitch/common/util; instead
1353
+ */
1354
+ uuid() {
1355
+ console.warn('@deprecated use @firestitch/common/util/uuid instead');
1356
+ return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1357
+ }
1358
+ /**
1359
+ * @deprecated use import { resolve } from @firestitch/common/util; instead
1360
+ */
1361
+ resolve(promise, defaults = []) {
1362
+ console.warn('@deprecated use @firestitch/common/util/resolve instead');
1363
+ const result = defaults;
1364
+ return new Promise(resolve => {
1365
+ promise.then(function (data) {
1366
+ Object.keys(data).forEach(key => result[key] = data[key]);
1367
+ resolve(result);
1368
+ });
1369
+ });
1370
+ }
1371
+ /**
1372
+ * @deprecated use _.toInteger() instead
1373
+ */
1374
+ int(value) {
1375
+ console.warn('@deprecated use _.toInteger() instead');
1376
+ value = parseInt(value);
1377
+ if (isNaN(value)) {
1378
+ value = 0;
1379
+ }
1380
+ return value;
1381
+ }
1382
+ /**
1383
+ * @deprecated use _.toFinite() instead
1384
+ */
1385
+ float(value) {
1386
+ console.warn('@deprecated use _.toFinite() instead');
1387
+ value = parseFloat(value);
1388
+ if (isNaN(value)) {
1389
+ value = 0;
1390
+ }
1391
+ return value;
1392
+ }
1393
+ /**
1394
+ * @deprecated use _.toString() instead
1395
+ */
1396
+ string(string) {
1397
+ console.warn('@deprecated use _.toString() instead');
1398
+ if (string === null || string === undefined) {
1399
+ string = '';
1400
+ }
1401
+ return (string).toString();
1402
+ }
1403
+ /**
1404
+ * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1405
+ */
1406
+ isEmpty(value, options) {
1407
+ console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1408
+ options = options || {};
1409
+ return value === undefined ||
1410
+ value === null ||
1411
+ value === false ||
1412
+ value === '' ||
1413
+ !this.string(value).length ||
1414
+ (this.isObject(value) &&
1415
+ (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1416
+ (!options.zero && (value === 0 || value === '0'));
1417
+ }
1418
+ /**
1419
+ * @deprecated use _.isInteger() instead
1420
+ */
1421
+ isInt(value, type) {
1422
+ console.warn('@deprecated use _.isInteger() instead');
1423
+ const int = !!this.string(value).match(/^\d+$/);
1424
+ if (!int) {
1425
+ return false;
1426
+ }
1427
+ if (type) {
1428
+ return Number.isInteger(value);
1429
+ }
1430
+ return true;
1431
+ }
1432
+ /**
1433
+ * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1434
+ */
1435
+ each(object, func) {
1436
+ console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1437
+ if (!this.isArray(object) && !this.isObject(object)) {
1438
+ return;
1439
+ }
1440
+ Object.keys(object).forEach(function (key) {
1441
+ func(object[key], key);
1442
+ });
1443
+ }
1444
+ /**
1445
+ * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1446
+ * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1447
+ */
1448
+ isObject(value) {
1449
+ console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1450
+ return value !== null && typeof value === 'object' && !this.isArray(value);
1451
+ }
1452
+ /**
1453
+ * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1454
+ */
1455
+ isString(value) {
1456
+ console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1457
+ return typeof value === 'string' || value instanceof String;
1458
+ }
1459
+ /**
1460
+ * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1461
+ */
1462
+ isArray(value) {
1463
+ console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1464
+ return value instanceof Array;
1465
+ }
1466
+ /**
1467
+ * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1468
+ */
1469
+ isNumeric(value) {
1470
+ console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1471
+ return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1472
+ }
1473
+ /**
1474
+ * @deprecated use import { isClass } from @firestitch/common/util; instead
1475
+ */
1476
+ isClass(value, cls) {
1477
+ console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1478
+ if (this.isObject(value)) {
1479
+ if (this.isString(cls)) {
1480
+ if (value.constructor) {
1481
+ if (value.constructor.name === cls) {
1482
+ return true;
1483
+ }
1484
+ }
1485
+ }
1486
+ else {
1487
+ if (value instanceof cls) {
1488
+ return true;
1489
+ }
1490
+ }
1491
+ }
1492
+ return false;
1493
+ }
1494
+ /**
1495
+ * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1496
+ */
1497
+ isBoolean(value) {
1498
+ console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1499
+ return value === true || value === false;
1500
+ }
1501
+ /**
1502
+ * @deprecated use import { value } from @firestitch/common/util; instead
1503
+ */
1504
+ value(object, key, def) {
1505
+ console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1506
+ if (this.isObject(object) || this.isArray(object)) {
1507
+ if (object.hasOwnProperty(key)) {
1508
+ return object[key];
1509
+ }
1510
+ }
1511
+ return def;
1512
+ }
1513
+ throttle(func, wait) {
1514
+ console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1515
+ let waiting = false; // Initially, we're not waiting
1516
+ return function () {
1517
+ if (!waiting) { // If we're not waiting
1518
+ func.apply(null, arguments); // Execute users function
1519
+ waiting = true; // Prevent future invocations
1520
+ setTimeout(function () {
1521
+ waiting = false; // And allow future invocations
1522
+ }, wait);
1523
+ }
1524
+ };
1525
+ }
1526
+ /**
1527
+ * @deprecated use import { debounce } from @firestitch/common/util; instead
1528
+ */
1529
+ debounce(func, wait, immediate) {
1530
+ console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1531
+ var timeout;
1532
+ return function () {
1533
+ var context = this, args = arguments;
1534
+ var later = function () {
1535
+ timeout = null;
1536
+ if (!immediate)
1537
+ func.apply(context, args);
1538
+ };
1539
+ var callNow = immediate && !timeout;
1540
+ clearTimeout(timeout);
1541
+ timeout = setTimeout(later, wait);
1542
+ if (callNow)
1543
+ func.apply(context, args);
1544
+ };
1545
+ }
1546
+ /**
1547
+ * @deprecated use import { length } from @firestitch/common/util; instead
1548
+ */
1549
+ length(object) {
1550
+ console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1551
+ if (this.isObject(object)) {
1552
+ return Object.keys(object).length;
1553
+ }
1554
+ if (this.isArray(object)) {
1555
+ return object.length;
1556
+ }
1557
+ return 0;
1558
+ }
1559
+ /**
1560
+ * @deprecated use import { boolean } from @firestitch/common/util; instead
1561
+ */
1562
+ boolean(value) {
1563
+ console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1564
+ return this.string(value).toLowerCase() !== 'false' && !!value;
1565
+ }
1566
+ /**
1567
+ * @deprecated use import { stringify } from @firestitch/common/util; instead
1568
+ */
1569
+ stringify(value) {
1570
+ console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1571
+ return JSON.stringify(value);
1572
+ }
1573
+ }
1574
+ FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1575
+ FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil });
1576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, decorators: [{
1577
+ type: Injectable
1578
1578
  }] });
1579
1579
 
1580
- class FsValidate {
1581
- constructor(fsUtil) {
1582
- this.fsUtil = fsUtil;
1583
- }
1584
- /**
1585
- * @deprecated use import { email } from @firestitch/common/validate; instead
1586
- */
1587
- phone(value) {
1588
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1589
- return valid || !String(value).length;
1590
- }
1591
- /**
1592
- * @deprecated use import { email } from @firestitch/common/validate; instead
1593
- */
1594
- email(value) {
1595
- return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
1596
- }
1597
- }
1598
- FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1599
- FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate });
1600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, decorators: [{
1601
- type: Injectable
1580
+ class FsValidate {
1581
+ constructor(fsUtil) {
1582
+ this.fsUtil = fsUtil;
1583
+ }
1584
+ /**
1585
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1586
+ */
1587
+ phone(value) {
1588
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1589
+ return valid || !String(value).length;
1590
+ }
1591
+ /**
1592
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1593
+ */
1594
+ email(value) {
1595
+ return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
1596
+ }
1597
+ }
1598
+ FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1599
+ FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate });
1600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, decorators: [{
1601
+ type: Injectable
1602
1602
  }], ctorParameters: function () { return [{ type: FsUtil }]; } });
1603
1603
 
1604
- class FsCommonModule {
1605
- static forRoot() {
1606
- return {
1607
- ngModule: FsCommonModule,
1608
- providers: [
1609
- FsArray,
1610
- FsMath,
1611
- FsUtil,
1612
- FsValidate,
1613
- ],
1614
- };
1615
- }
1616
- }
1617
- FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1618
- FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1619
- FsPreventDefaultDirective,
1620
- FsAutofocusDirective,
1621
- FsUtilGuidPipe,
1622
- FsUtilIsEmptyPipe,
1623
- FsUtilIsNotEmptyPipe,
1624
- FsUtilStringifyPipe,
1625
- FsFormatNumberPipe,
1626
- FsFormatCurrencyPipe,
1627
- FsFormatTruncatePipe,
1628
- FsFormatBytesPipe,
1629
- FsFormatOrdinalNumberPipe,
1630
- FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1631
- FsPreventDefaultDirective,
1632
- FsAutofocusDirective,
1633
- FsUtilGuidPipe,
1634
- FsUtilStringifyPipe,
1635
- FsFormatNumberPipe,
1636
- FsFormatCurrencyPipe,
1637
- FsFormatTruncatePipe,
1638
- FsUtilIsEmptyPipe,
1639
- FsUtilIsNotEmptyPipe,
1640
- FsFormatBytesPipe,
1641
- FsModelChangeDirective,
1642
- FsFormatOrdinalNumberPipe] });
1643
- FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, imports: [[
1644
- CommonModule,
1645
- ]] });
1646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, decorators: [{
1647
- type: NgModule,
1648
- args: [{
1649
- imports: [
1650
- CommonModule,
1651
- ],
1652
- declarations: [
1653
- FsStopPropagationDirective,
1654
- FsPreventDefaultDirective,
1655
- FsAutofocusDirective,
1656
- FsUtilGuidPipe,
1657
- FsUtilIsEmptyPipe,
1658
- FsUtilIsNotEmptyPipe,
1659
- FsUtilStringifyPipe,
1660
- FsFormatNumberPipe,
1661
- FsFormatCurrencyPipe,
1662
- FsFormatTruncatePipe,
1663
- FsFormatBytesPipe,
1664
- FsFormatOrdinalNumberPipe,
1665
- FsModelChangeDirective,
1666
- ],
1667
- exports: [
1668
- FsStopPropagationDirective,
1669
- FsPreventDefaultDirective,
1670
- FsAutofocusDirective,
1671
- FsUtilGuidPipe,
1672
- FsUtilStringifyPipe,
1673
- FsFormatNumberPipe,
1674
- FsFormatCurrencyPipe,
1675
- FsFormatTruncatePipe,
1676
- FsUtilIsEmptyPipe,
1677
- FsUtilIsNotEmptyPipe,
1678
- FsFormatBytesPipe,
1679
- FsModelChangeDirective,
1680
- FsFormatOrdinalNumberPipe,
1681
- ],
1682
- }]
1604
+ class FsCommonModule {
1605
+ static forRoot() {
1606
+ return {
1607
+ ngModule: FsCommonModule,
1608
+ providers: [
1609
+ FsArray,
1610
+ FsMath,
1611
+ FsUtil,
1612
+ FsValidate,
1613
+ ],
1614
+ };
1615
+ }
1616
+ }
1617
+ FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1618
+ FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1619
+ FsPreventDefaultDirective,
1620
+ FsAutofocusDirective,
1621
+ FsUtilGuidPipe,
1622
+ FsUtilIsEmptyPipe,
1623
+ FsUtilIsNotEmptyPipe,
1624
+ FsUtilStringifyPipe,
1625
+ FsFormatNumberPipe,
1626
+ FsFormatCurrencyPipe,
1627
+ FsFormatTruncatePipe,
1628
+ FsFormatBytesPipe,
1629
+ FsFormatOrdinalNumberPipe,
1630
+ FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1631
+ FsPreventDefaultDirective,
1632
+ FsAutofocusDirective,
1633
+ FsUtilGuidPipe,
1634
+ FsUtilStringifyPipe,
1635
+ FsFormatNumberPipe,
1636
+ FsFormatCurrencyPipe,
1637
+ FsFormatTruncatePipe,
1638
+ FsUtilIsEmptyPipe,
1639
+ FsUtilIsNotEmptyPipe,
1640
+ FsFormatBytesPipe,
1641
+ FsModelChangeDirective,
1642
+ FsFormatOrdinalNumberPipe] });
1643
+ FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, imports: [[
1644
+ CommonModule,
1645
+ ]] });
1646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, decorators: [{
1647
+ type: NgModule,
1648
+ args: [{
1649
+ imports: [
1650
+ CommonModule,
1651
+ ],
1652
+ declarations: [
1653
+ FsStopPropagationDirective,
1654
+ FsPreventDefaultDirective,
1655
+ FsAutofocusDirective,
1656
+ FsUtilGuidPipe,
1657
+ FsUtilIsEmptyPipe,
1658
+ FsUtilIsNotEmptyPipe,
1659
+ FsUtilStringifyPipe,
1660
+ FsFormatNumberPipe,
1661
+ FsFormatCurrencyPipe,
1662
+ FsFormatTruncatePipe,
1663
+ FsFormatBytesPipe,
1664
+ FsFormatOrdinalNumberPipe,
1665
+ FsModelChangeDirective,
1666
+ ],
1667
+ exports: [
1668
+ FsStopPropagationDirective,
1669
+ FsPreventDefaultDirective,
1670
+ FsAutofocusDirective,
1671
+ FsUtilGuidPipe,
1672
+ FsUtilStringifyPipe,
1673
+ FsFormatNumberPipe,
1674
+ FsFormatCurrencyPipe,
1675
+ FsFormatTruncatePipe,
1676
+ FsUtilIsEmptyPipe,
1677
+ FsUtilIsNotEmptyPipe,
1678
+ FsFormatBytesPipe,
1679
+ FsModelChangeDirective,
1680
+ FsFormatOrdinalNumberPipe,
1681
+ ],
1682
+ }]
1683
1683
  }] });
1684
1684
 
1685
- const keyboardShortcut = (shortcut) => {
1686
- // Observables for all keydown and keyup events
1687
- const keyDown$ = fromEvent(document, 'keydown');
1688
- const keyUp$ = fromEvent(document, 'keyup');
1689
- // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1690
- const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1691
- // Create KeyboardEvent Observable for specified KeyCode
1692
- const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1693
- // Create Event Stream for every KeyCode in shortcut
1694
- const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1695
- // Emit when specified keys are pressed (keydown).
1696
- // Emit only when all specified keys are pressed at the same time.
1697
- // More on combineLatest below
1698
- return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1685
+ const keyboardShortcut = (shortcut) => {
1686
+ // Observables for all keydown and keyup events
1687
+ const keyDown$ = fromEvent(document, 'keydown');
1688
+ const keyUp$ = fromEvent(document, 'keyup');
1689
+ // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1690
+ const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1691
+ // Create KeyboardEvent Observable for specified KeyCode
1692
+ const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1693
+ // Create Event Stream for every KeyCode in shortcut
1694
+ const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1695
+ // Emit when specified keys are pressed (keydown).
1696
+ // Emit only when all specified keys are pressed at the same time.
1697
+ // More on combineLatest below
1698
+ return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1699
1699
  };
1700
1700
 
1701
1701
  // Modules
1702
1702
 
1703
- /**
1704
- * Generated bundle index. Do not edit.
1703
+ /**
1704
+ * Generated bundle index. Do not edit.
1705
1705
  */
1706
1706
 
1707
1707
  export { FsArray, FsAutofocusDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsModelChangeDirective, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, clone, compare, currency, debounce, delayedRetry, email, filter, find, fsSourceLoader, getNormalizedPath, guid, inArray, index, indexOf, isArrayEqual, isClass, isEmpty, isNumeric, isObject, keyExists, keyboardShortcut, ksort, length, list, loadJs, loadStyles, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, round, rsort, sort, stringify, throttle, toString, truncate, url, uuid, value };