@firestitch/common 13.0.4 → 14.0.0

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