@firestitch/common 8.0.13 → 12.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.
- package/app/directives/autofocus.directive.d.ts +9 -6
- package/app/directives/prevent-default.directive.d.ts +6 -3
- package/app/directives/stop-propagation.directive.d.ts +6 -3
- package/app/fs-common.module.d.ts +18 -4
- package/app/pipes/bytes.pipe.d.ts +7 -4
- package/app/pipes/currency.pipe.d.ts +9 -6
- package/app/pipes/number.pipe.d.ts +7 -4
- package/app/pipes/ordinal-number.pipe.d.ts +7 -4
- package/app/pipes/truncate.pipe.d.ts +8 -5
- package/app/pipes/util.pipe.d.ts +24 -15
- package/app/services/array.service.d.ts +61 -58
- package/app/services/math.service.d.ts +9 -6
- package/app/services/util.service.d.ts +89 -86
- package/app/services/vaildate.service.d.ts +16 -13
- package/bundles/firestitch-common.umd.js +1771 -3404
- package/bundles/firestitch-common.umd.js.map +1 -1
- package/esm2015/app/directives/autofocus.directive.js +21 -42
- package/esm2015/app/directives/prevent-default.directive.js +19 -24
- package/esm2015/app/directives/stop-propagation.directive.js +19 -24
- package/esm2015/app/fs-common.module.js +93 -72
- package/esm2015/app/pipes/bytes.pipe.js +17 -22
- package/esm2015/app/pipes/currency.pipe.js +23 -38
- package/esm2015/app/pipes/number.pipe.js +17 -23
- package/esm2015/app/pipes/ordinal-number.pipe.js +17 -22
- package/esm2015/app/pipes/truncate.pipe.js +18 -28
- package/esm2015/app/pipes/util.pipe.js +60 -71
- package/esm2015/app/services/array.service.js +225 -352
- package/esm2015/app/services/math.service.js +21 -29
- package/esm2015/app/services/util.service.js +251 -430
- package/esm2015/app/services/vaildate.service.js +28 -48
- package/esm2015/firestitch-common.js +5 -19
- package/esm2015/libs/array/compare/compare.js +8 -19
- package/esm2015/libs/array/compare/index.js +2 -7
- package/esm2015/libs/array/filter/filter.js +27 -53
- package/esm2015/libs/array/filter/index.js +2 -7
- package/esm2015/libs/array/find/find.js +6 -17
- package/esm2015/libs/array/find/index.js +2 -7
- package/esm2015/libs/array/inArray/inArray.js +12 -22
- package/esm2015/libs/array/inArray/index.js +2 -7
- package/esm2015/libs/array/index/index.js +8 -24
- package/esm2015/libs/array/index.js +14 -19
- package/esm2015/libs/array/indexOf/index.js +2 -7
- package/esm2015/libs/array/indexOf/indexOf.js +16 -31
- package/esm2015/libs/array/keyExists/index.js +2 -7
- package/esm2015/libs/array/keyExists/keyExists.js +4 -14
- package/esm2015/libs/array/ksort/index.js +2 -7
- package/esm2015/libs/array/ksort/ksort.js +8 -22
- package/esm2015/libs/array/list/index.js +2 -7
- package/esm2015/libs/array/list/list.js +13 -30
- package/esm2015/libs/array/nameValue/index.js +2 -7
- package/esm2015/libs/array/nameValue/nameValue.js +21 -52
- package/esm2015/libs/array/remove/index.js +2 -7
- package/esm2015/libs/array/remove/remove.js +9 -20
- package/esm2015/libs/array/rsort/index.js +2 -7
- package/esm2015/libs/array/rsort/rsort.js +5 -15
- package/esm2015/libs/array/sort/index.js +2 -7
- package/esm2015/libs/array/sort/sort.js +27 -44
- package/esm2015/libs/format/acronym/acronym.js +22 -34
- package/esm2015/libs/format/acronym/index.js +2 -7
- package/esm2015/libs/format/bytes/bytes.js +12 -23
- package/esm2015/libs/format/bytes/index.js +2 -7
- package/esm2015/libs/format/currency/currency.js +7 -20
- package/esm2015/libs/format/currency/index.js +2 -7
- package/esm2015/libs/format/index.js +6 -11
- package/esm2015/libs/format/number/index.js +2 -7
- package/esm2015/libs/format/number/number.js +4 -14
- package/esm2015/libs/format/truncate/index.js +2 -7
- package/esm2015/libs/format/truncate/truncate.js +12 -25
- package/esm2015/libs/index.js +6 -11
- package/esm2015/libs/rxjs/delayedRetry.js +20 -58
- package/esm2015/libs/util/boolean/boolean.js +5 -14
- package/esm2015/libs/util/boolean/index.js +2 -7
- package/esm2015/libs/util/debounce/debounce.js +17 -40
- package/esm2015/libs/util/debounce/index.js +2 -7
- package/esm2015/libs/util/get-normalized-path/get-normalized-path.js +6 -16
- package/esm2015/libs/util/get-normalized-path/index.js +2 -7
- package/esm2015/libs/util/guid/guid.js +19 -36
- package/esm2015/libs/util/guid/index.js +2 -7
- package/esm2015/libs/util/index.js +18 -23
- package/esm2015/libs/util/isClass/index.js +2 -7
- package/esm2015/libs/util/isClass/isClass.js +18 -28
- package/esm2015/libs/util/isEmpty/index.js +2 -7
- package/esm2015/libs/util/isEmpty/isEmpty.js +13 -23
- package/esm2015/libs/util/isNumeric/index.js +2 -7
- package/esm2015/libs/util/isNumeric/isNumeric.js +6 -16
- package/esm2015/libs/util/keys/index.js +2 -7
- package/esm2015/libs/util/keys/keys.js +38 -80
- package/esm2015/libs/util/length/index.js +2 -7
- package/esm2015/libs/util/length/length.js +11 -20
- package/esm2015/libs/util/ordinal-number/ordinal-number.js +8 -20
- package/esm2015/libs/util/queue/index.js +3 -8
- package/esm2015/libs/util/queue/operation.js +15 -32
- package/esm2015/libs/util/queue/queue.enum.js +6 -12
- package/esm2015/libs/util/queue/queue.js +137 -291
- package/esm2015/libs/util/remove-query-params/index.js +2 -7
- package/esm2015/libs/util/remove-query-params/remove-query-params.js +4 -13
- package/esm2015/libs/util/resolve/index.js +2 -7
- package/esm2015/libs/util/resolve/resolve.js +10 -33
- package/esm2015/libs/util/stringify/index.js +2 -7
- package/esm2015/libs/util/stringify/stringify.js +4 -13
- package/esm2015/libs/util/throttle/index.js +2 -7
- package/esm2015/libs/util/throttle/throttle.js +13 -30
- package/esm2015/libs/util/uuid/index.js +2 -7
- package/esm2015/libs/util/uuid/uuid.js +5 -13
- package/esm2015/libs/util/value/index.js +2 -7
- package/esm2015/libs/util/value/value.js +9 -20
- package/esm2015/libs/validate/email/email.js +4 -13
- package/esm2015/libs/validate/email/index.js +2 -7
- package/esm2015/libs/validate/index.js +4 -9
- package/esm2015/libs/validate/phone/index.js +2 -7
- package/esm2015/libs/validate/phone/phone.js +5 -15
- package/esm2015/libs/validate/url/index.js +2 -7
- package/esm2015/libs/validate/url/url.js +12 -23
- package/esm2015/public_api.js +21 -17
- package/fesm2015/firestitch-common.js +1287 -2677
- package/fesm2015/firestitch-common.js.map +1 -1
- package/firestitch-common.d.ts +5 -13
- package/libs/array/compare/compare.d.ts +1 -1
- package/libs/array/compare/index.d.ts +1 -1
- package/libs/array/filter/filter.d.ts +1 -1
- package/libs/array/filter/index.d.ts +1 -1
- package/libs/array/find/find.d.ts +1 -1
- package/libs/array/find/index.d.ts +1 -1
- package/libs/array/inArray/inArray.d.ts +1 -1
- package/libs/array/inArray/index.d.ts +1 -1
- package/libs/array/index/index.d.ts +1 -1
- package/libs/array/index.d.ts +13 -13
- package/libs/array/indexOf/index.d.ts +1 -1
- package/libs/array/indexOf/indexOf.d.ts +1 -1
- package/libs/array/keyExists/index.d.ts +1 -1
- package/libs/array/keyExists/keyExists.d.ts +1 -1
- package/libs/array/ksort/index.d.ts +1 -1
- package/libs/array/ksort/ksort.d.ts +1 -1
- package/libs/array/list/index.d.ts +1 -1
- package/libs/array/list/list.d.ts +1 -1
- package/libs/array/nameValue/index.d.ts +1 -1
- package/libs/array/nameValue/nameValue.d.ts +1 -1
- package/libs/array/remove/index.d.ts +1 -1
- package/libs/array/remove/remove.d.ts +1 -1
- package/libs/array/rsort/index.d.ts +1 -1
- package/libs/array/rsort/rsort.d.ts +1 -1
- package/libs/array/sort/index.d.ts +1 -1
- package/libs/array/sort/sort.d.ts +1 -1
- package/libs/format/acronym/acronym.d.ts +1 -1
- package/libs/format/acronym/index.d.ts +1 -1
- package/libs/format/bytes/bytes.d.ts +1 -1
- package/libs/format/bytes/index.d.ts +1 -1
- package/libs/format/currency/currency.d.ts +1 -1
- package/libs/format/currency/index.d.ts +1 -1
- package/libs/format/index.d.ts +5 -5
- package/libs/format/number/index.d.ts +1 -1
- package/libs/format/number/number.d.ts +1 -1
- package/libs/format/truncate/index.d.ts +1 -1
- package/libs/format/truncate/truncate.d.ts +1 -1
- package/libs/index.d.ts +5 -5
- package/libs/rxjs/delayedRetry.d.ts +2 -2
- package/libs/util/boolean/boolean.d.ts +1 -1
- package/libs/util/boolean/index.d.ts +1 -1
- package/libs/util/debounce/debounce.d.ts +1 -1
- package/libs/util/debounce/index.d.ts +1 -1
- package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
- package/libs/util/get-normalized-path/index.d.ts +1 -1
- package/libs/util/guid/guid.d.ts +1 -1
- package/libs/util/guid/index.d.ts +1 -1
- package/libs/util/index.d.ts +17 -17
- package/libs/util/isClass/index.d.ts +1 -1
- package/libs/util/isClass/isClass.d.ts +1 -1
- package/libs/util/isEmpty/index.d.ts +1 -1
- package/libs/util/isEmpty/isEmpty.d.ts +1 -1
- package/libs/util/isNumeric/index.d.ts +1 -1
- package/libs/util/isNumeric/isNumeric.d.ts +1 -1
- package/libs/util/keys/index.d.ts +1 -1
- package/libs/util/keys/keys.d.ts +37 -37
- package/libs/util/length/index.d.ts +1 -1
- package/libs/util/length/length.d.ts +1 -1
- package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
- package/libs/util/queue/index.d.ts +2 -2
- package/libs/util/queue/operation.d.ts +7 -7
- package/libs/util/queue/queue.d.ts +32 -32
- package/libs/util/queue/queue.enum.d.ts +4 -4
- package/libs/util/remove-query-params/index.d.ts +1 -1
- package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
- package/libs/util/resolve/index.d.ts +1 -1
- package/libs/util/resolve/resolve.d.ts +1 -1
- package/libs/util/stringify/index.d.ts +1 -1
- package/libs/util/stringify/stringify.d.ts +1 -1
- package/libs/util/throttle/index.d.ts +1 -1
- package/libs/util/throttle/throttle.d.ts +1 -1
- package/libs/util/uuid/index.d.ts +1 -1
- package/libs/util/uuid/uuid.d.ts +1 -1
- package/libs/util/value/index.d.ts +1 -1
- package/libs/util/value/value.d.ts +1 -1
- package/libs/validate/email/email.d.ts +1 -1
- package/libs/validate/email/index.d.ts +1 -1
- package/libs/validate/index.d.ts +3 -3
- package/libs/validate/phone/index.d.ts +1 -1
- package/libs/validate/phone/phone.d.ts +1 -1
- package/libs/validate/url/index.d.ts +1 -1
- package/libs/validate/url/url.d.ts +7 -7
- package/package.json +7 -11
- package/public_api.d.ts +15 -6
- package/bundles/firestitch-common.umd.min.js +0 -16
- package/bundles/firestitch-common.umd.min.js.map +0 -1
- package/esm5/app/directives/autofocus.directive.js +0 -45
- package/esm5/app/directives/prevent-default.directive.js +0 -32
- package/esm5/app/directives/stop-propagation.directive.js +0 -32
- package/esm5/app/fs-common.module.js +0 -79
- package/esm5/app/pipes/bytes.pipe.js +0 -30
- package/esm5/app/pipes/currency.pipe.js +0 -43
- package/esm5/app/pipes/number.pipe.js +0 -32
- package/esm5/app/pipes/ordinal-number.pipe.js +0 -30
- package/esm5/app/pipes/truncate.pipe.js +0 -38
- package/esm5/app/pipes/util.pipe.js +0 -100
- package/esm5/app/services/array.service.js +0 -491
- package/esm5/app/services/math.service.js +0 -42
- package/esm5/app/services/util.service.js +0 -608
- package/esm5/app/services/vaildate.service.js +0 -63
- package/esm5/firestitch-common.js +0 -19
- package/esm5/libs/array/compare/compare.js +0 -19
- package/esm5/libs/array/compare/index.js +0 -7
- package/esm5/libs/array/filter/filter.js +0 -53
- package/esm5/libs/array/filter/index.js +0 -7
- package/esm5/libs/array/find/find.js +0 -17
- package/esm5/libs/array/find/index.js +0 -7
- package/esm5/libs/array/inArray/inArray.js +0 -22
- package/esm5/libs/array/inArray/index.js +0 -7
- package/esm5/libs/array/index/index.js +0 -25
- package/esm5/libs/array/index.js +0 -19
- package/esm5/libs/array/indexOf/index.js +0 -7
- package/esm5/libs/array/indexOf/indexOf.js +0 -31
- package/esm5/libs/array/keyExists/index.js +0 -7
- package/esm5/libs/array/keyExists/keyExists.js +0 -14
- package/esm5/libs/array/ksort/index.js +0 -7
- package/esm5/libs/array/ksort/ksort.js +0 -22
- package/esm5/libs/array/list/index.js +0 -7
- package/esm5/libs/array/list/list.js +0 -31
- package/esm5/libs/array/nameValue/index.js +0 -7
- package/esm5/libs/array/nameValue/nameValue.js +0 -52
- package/esm5/libs/array/remove/index.js +0 -7
- package/esm5/libs/array/remove/remove.js +0 -20
- package/esm5/libs/array/rsort/index.js +0 -7
- package/esm5/libs/array/rsort/rsort.js +0 -15
- package/esm5/libs/array/sort/index.js +0 -7
- package/esm5/libs/array/sort/sort.js +0 -45
- package/esm5/libs/format/acronym/acronym.js +0 -35
- package/esm5/libs/format/acronym/index.js +0 -7
- package/esm5/libs/format/bytes/bytes.js +0 -23
- package/esm5/libs/format/bytes/index.js +0 -7
- package/esm5/libs/format/currency/currency.js +0 -23
- package/esm5/libs/format/currency/index.js +0 -7
- package/esm5/libs/format/index.js +0 -11
- package/esm5/libs/format/number/index.js +0 -7
- package/esm5/libs/format/number/number.js +0 -14
- package/esm5/libs/format/truncate/index.js +0 -7
- package/esm5/libs/format/truncate/truncate.js +0 -28
- package/esm5/libs/index.js +0 -11
- package/esm5/libs/rxjs/delayedRetry.js +0 -65
- package/esm5/libs/util/boolean/boolean.js +0 -14
- package/esm5/libs/util/boolean/index.js +0 -7
- package/esm5/libs/util/debounce/debounce.js +0 -40
- package/esm5/libs/util/debounce/index.js +0 -7
- package/esm5/libs/util/get-normalized-path/get-normalized-path.js +0 -16
- package/esm5/libs/util/get-normalized-path/index.js +0 -7
- package/esm5/libs/util/guid/guid.js +0 -37
- package/esm5/libs/util/guid/index.js +0 -7
- package/esm5/libs/util/index.js +0 -23
- package/esm5/libs/util/isClass/index.js +0 -7
- package/esm5/libs/util/isClass/isClass.js +0 -28
- package/esm5/libs/util/isEmpty/index.js +0 -7
- package/esm5/libs/util/isEmpty/isEmpty.js +0 -23
- package/esm5/libs/util/isNumeric/index.js +0 -7
- package/esm5/libs/util/isNumeric/isNumeric.js +0 -16
- package/esm5/libs/util/keys/index.js +0 -7
- package/esm5/libs/util/keys/keys.js +0 -80
- package/esm5/libs/util/length/index.js +0 -7
- package/esm5/libs/util/length/length.js +0 -20
- package/esm5/libs/util/ordinal-number/ordinal-number.js +0 -22
- package/esm5/libs/util/queue/index.js +0 -8
- package/esm5/libs/util/queue/operation.js +0 -30
- package/esm5/libs/util/queue/queue.enum.js +0 -12
- package/esm5/libs/util/queue/queue.js +0 -367
- package/esm5/libs/util/remove-query-params/index.js +0 -7
- package/esm5/libs/util/remove-query-params/remove-query-params.js +0 -13
- package/esm5/libs/util/resolve/index.js +0 -7
- package/esm5/libs/util/resolve/resolve.js +0 -34
- package/esm5/libs/util/stringify/index.js +0 -7
- package/esm5/libs/util/stringify/stringify.js +0 -13
- package/esm5/libs/util/throttle/index.js +0 -7
- package/esm5/libs/util/throttle/throttle.js +0 -30
- package/esm5/libs/util/uuid/index.js +0 -7
- package/esm5/libs/util/uuid/uuid.js +0 -13
- package/esm5/libs/util/value/index.js +0 -7
- package/esm5/libs/util/value/value.js +0 -20
- package/esm5/libs/validate/email/email.js +0 -13
- package/esm5/libs/validate/email/index.js +0 -7
- package/esm5/libs/validate/index.js +0 -9
- package/esm5/libs/validate/phone/index.js +0 -7
- package/esm5/libs/validate/phone/phone.js +0 -15
- package/esm5/libs/validate/url/index.js +0 -7
- package/esm5/libs/validate/url/url.js +0 -23
- package/esm5/public_api.js +0 -17
- package/fesm5/firestitch-common.js +0 -3285
- package/fesm5/firestitch-common.js.map +0 -1
- package/firestitch-common.metadata.json +0 -1
|
@@ -1,2769 +1,1379 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, LOCALE_ID, Inject, Directive, HostListener, NgModule } from '@angular/core';
|
|
2
3
|
import { CurrencyPipe, CommonModule } from '@angular/common';
|
|
3
4
|
import { toString, isObject, isArray } from 'lodash-es';
|
|
4
5
|
import { Subject, Observable, of, iif, throwError, timer } from 'rxjs';
|
|
5
6
|
import { takeUntil, delay, retryWhen, tap, concatMap } from 'rxjs/operators';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated use import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return list;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* @deprecated use import {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
* @
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
console.warn('@deprecated use import {
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
* @return {?}
|
|
224
|
-
*/
|
|
225
|
-
rsort(array, query) {
|
|
226
|
-
console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
|
|
227
|
-
return this.sort(array, query, true);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* @deprecated use import { list } from \@firestitch/common/array; instead
|
|
231
|
-
* @param {?} array
|
|
232
|
-
* @param {?} property
|
|
233
|
-
* @param {?=} index
|
|
234
|
-
* @return {?}
|
|
235
|
-
*/
|
|
236
|
-
list(array, property, index = null) {
|
|
237
|
-
console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
|
|
238
|
-
/** @type {?} */
|
|
239
|
-
let list = index ? {} : [];
|
|
240
|
-
array.forEach((/**
|
|
241
|
-
* @param {?} item
|
|
242
|
-
* @param {?} idx
|
|
243
|
-
* @return {?}
|
|
244
|
-
*/
|
|
245
|
-
function (item, idx) {
|
|
246
|
-
if (index) {
|
|
247
|
-
list[item[index]] = item[property];
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
list.push(item[property]);
|
|
251
|
-
}
|
|
252
|
-
}));
|
|
253
|
-
return list;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @deprecated use import { applyDepth } from \@firestitch/common/array; instead
|
|
257
|
-
* @param {?} objects
|
|
258
|
-
* @param {?} parent_property
|
|
259
|
-
* @param {?=} id_property
|
|
260
|
-
* @param {?=} depth_property
|
|
261
|
-
* @return {?}
|
|
262
|
-
*/
|
|
263
|
-
applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
|
|
264
|
-
console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
|
|
265
|
-
/** @type {?} */
|
|
266
|
-
let keyed = {};
|
|
267
|
-
objects.forEach((/**
|
|
268
|
-
* @param {?} object
|
|
269
|
-
* @return {?}
|
|
270
|
-
*/
|
|
271
|
-
function (object) {
|
|
272
|
-
if (!object[parent_property]) {
|
|
273
|
-
object[depth_property] = 0;
|
|
274
|
-
}
|
|
275
|
-
keyed[object[id_property]] = object;
|
|
276
|
-
}));
|
|
277
|
-
Object.keys(keyed).forEach((/**
|
|
278
|
-
* @param {?} key
|
|
279
|
-
* @return {?}
|
|
280
|
-
*/
|
|
281
|
-
key => {
|
|
282
|
-
Object.keys(keyed).forEach((/**
|
|
283
|
-
* @param {?} key
|
|
284
|
-
* @return {?}
|
|
285
|
-
*/
|
|
286
|
-
key => {
|
|
287
|
-
/** @type {?} */
|
|
288
|
-
let object = keyed[key];
|
|
289
|
-
if (!keyed[key][depth_property]) {
|
|
290
|
-
if (keyed[key][parent_property]) {
|
|
291
|
-
keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}));
|
|
295
|
-
}));
|
|
296
|
-
return keyed;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* @deprecated use import { inArray } from \@firestitch/common/array; instead
|
|
300
|
-
* @param {?} values
|
|
301
|
-
* @param {?} array
|
|
302
|
-
* @return {?}
|
|
303
|
-
*/
|
|
304
|
-
inArray(values, array) {
|
|
305
|
-
console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
|
|
306
|
-
if (!Array.isArray(values)) {
|
|
307
|
-
values = [values];
|
|
308
|
-
}
|
|
309
|
-
for (let i = 0, len = values.length; i < len; i++) {
|
|
310
|
-
if (array.indexOf(values[i]) >= 0) {
|
|
311
|
-
return true;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return false;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @deprecated use import { keyExists } from \@firestitch/common/array; instead
|
|
318
|
-
* @param {?} array
|
|
319
|
-
* @param {?} key
|
|
320
|
-
* @return {?}
|
|
321
|
-
*/
|
|
322
|
-
keyExists(array, key) {
|
|
323
|
-
console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
|
|
324
|
-
return array.hasOwnProperty(key);
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* @deprecated use import { length } from \@firestitch/common/array; instead
|
|
328
|
-
* @param {?} array
|
|
329
|
-
* @return {?}
|
|
330
|
-
*/
|
|
331
|
-
length(array) {
|
|
332
|
-
console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
|
|
333
|
-
return array.length;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* @deprecated use import { ksort } from \@firestitch/common/array; instead
|
|
337
|
-
* @param {?} unordered
|
|
338
|
-
* @return {?}
|
|
339
|
-
*/
|
|
340
|
-
ksort(unordered) {
|
|
341
|
-
console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
|
|
342
|
-
Object.keys(unordered).sort().forEach((/**
|
|
343
|
-
* @param {?} key
|
|
344
|
-
* @return {?}
|
|
345
|
-
*/
|
|
346
|
-
function (key) {
|
|
347
|
-
/** @type {?} */
|
|
348
|
-
let value = unordered[key];
|
|
349
|
-
delete unordered[key];
|
|
350
|
-
unordered[key] = value;
|
|
351
|
-
}));
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
FsArray.decorators = [
|
|
355
|
-
{ type: Injectable }
|
|
356
|
-
];
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* @fileoverview added by tsickle
|
|
360
|
-
* Generated from: app/services/math.service.ts
|
|
361
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
362
|
-
*/
|
|
363
|
-
class FsMath {
|
|
364
|
-
/**
|
|
365
|
-
* @deprecated use _.round() instead {\@link https://lodash.com/docs/4.17.5#round}
|
|
366
|
-
* @param {?} number
|
|
367
|
-
* @param {?} precision
|
|
368
|
-
* @return {?}
|
|
369
|
-
*/
|
|
370
|
-
round(number, precision) {
|
|
371
|
-
console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
|
|
372
|
-
precision = precision || 0;
|
|
373
|
-
/** @type {?} */
|
|
374
|
-
let factor = Math.pow(10, precision);
|
|
375
|
-
/** @type {?} */
|
|
376
|
-
let tempNumber = number * factor;
|
|
377
|
-
/** @type {?} */
|
|
378
|
-
let roundedTempNumber = Math.round(tempNumber);
|
|
379
|
-
return roundedTempNumber / factor;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
FsMath.decorators = [
|
|
383
|
-
{ type: Injectable }
|
|
384
|
-
];
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* @fileoverview added by tsickle
|
|
388
|
-
* Generated from: app/services/util.service.ts
|
|
389
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
390
|
-
*/
|
|
391
|
-
/** @type {?} */
|
|
392
|
-
const KEY_CANCEL = 3;
|
|
393
|
-
/** @type {?} */
|
|
394
|
-
const KEY_HELP = 6;
|
|
395
|
-
/** @type {?} */
|
|
396
|
-
const KEY_BACKSPACE = 8;
|
|
397
|
-
/** @type {?} */
|
|
398
|
-
const KEY_TAB = 9;
|
|
399
|
-
/** @type {?} */
|
|
400
|
-
const KEY_CLEAR = 12;
|
|
401
|
-
/** @type {?} */
|
|
402
|
-
const KEY_RETURN = 13;
|
|
403
|
-
/** @type {?} */
|
|
404
|
-
const KEY_ENTER = 14;
|
|
405
|
-
/** @type {?} */
|
|
406
|
-
const KEY_SHIFT = 16;
|
|
407
|
-
/** @type {?} */
|
|
408
|
-
const KEY_CONTROL = 17;
|
|
409
|
-
/** @type {?} */
|
|
410
|
-
const KEY_ALT = 18;
|
|
411
|
-
/** @type {?} */
|
|
412
|
-
const KEY_PAUSE = 19;
|
|
413
|
-
/** @type {?} */
|
|
414
|
-
const KEY_CAPS_LOCK = 20;
|
|
415
|
-
/** @type {?} */
|
|
416
|
-
const KEY_ESCAPE = 27;
|
|
417
|
-
/** @type {?} */
|
|
418
|
-
const KEY_SPACE = 32;
|
|
419
|
-
/** @type {?} */
|
|
420
|
-
const KEY_PAGE_UP = 33;
|
|
421
|
-
/** @type {?} */
|
|
422
|
-
const KEY_PAGE_DOWN = 34;
|
|
423
|
-
/** @type {?} */
|
|
424
|
-
const KEY_END = 35;
|
|
425
|
-
/** @type {?} */
|
|
426
|
-
const KEY_HOME = 36;
|
|
427
|
-
/** @type {?} */
|
|
428
|
-
const KEY_LEFT = 37;
|
|
429
|
-
/** @type {?} */
|
|
430
|
-
const KEY_UP = 38;
|
|
431
|
-
/** @type {?} */
|
|
432
|
-
const KEY_RIGHT = 39;
|
|
433
|
-
/** @type {?} */
|
|
434
|
-
const KEY_DOWN = 40;
|
|
435
|
-
/** @type {?} */
|
|
436
|
-
const KEY_PRINTSCREEN = 44;
|
|
437
|
-
/** @type {?} */
|
|
438
|
-
const KEY_INSERT = 45;
|
|
439
|
-
/** @type {?} */
|
|
440
|
-
const KEY_DELETE = 46;
|
|
441
|
-
/** @type {?} */
|
|
442
|
-
const KEY_0 = 48;
|
|
443
|
-
/** @type {?} */
|
|
444
|
-
const KEY_1 = 49;
|
|
445
|
-
/** @type {?} */
|
|
446
|
-
const KEY_2 = 50;
|
|
447
|
-
/** @type {?} */
|
|
448
|
-
const KEY_3 = 51;
|
|
449
|
-
/** @type {?} */
|
|
450
|
-
const KEY_4 = 52;
|
|
451
|
-
/** @type {?} */
|
|
452
|
-
const KEY_5 = 53;
|
|
453
|
-
/** @type {?} */
|
|
454
|
-
const KEY_6 = 54;
|
|
455
|
-
/** @type {?} */
|
|
456
|
-
const KEY_7 = 55;
|
|
457
|
-
/** @type {?} */
|
|
458
|
-
const KEY_8 = 56;
|
|
459
|
-
/** @type {?} */
|
|
460
|
-
const KEY_9 = 57;
|
|
461
|
-
/** @type {?} */
|
|
462
|
-
const KEY_SEMICOLON = 59;
|
|
463
|
-
/** @type {?} */
|
|
464
|
-
const KEY_EQUALS = 61;
|
|
465
|
-
/*
|
|
466
|
-
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)
|
|
467
|
-
There might be a better way to organise constatns but I need to know use-cases
|
|
468
|
-
*/
|
|
469
|
-
class FsUtil {
|
|
470
|
-
constructor() {
|
|
471
|
-
this.intervals = {};
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* @deprecated use \@firestitch/common/util/guid instead
|
|
475
|
-
* @param {?=} pattern
|
|
476
|
-
* @return {?}
|
|
477
|
-
*/
|
|
478
|
-
guid(pattern) {
|
|
479
|
-
console.warn('@deprecated use @firestitch/common/util/guid instead');
|
|
480
|
-
pattern = pattern || 'xxxxxx';
|
|
481
|
-
return pattern.replace(/[xy]/g, (/**
|
|
482
|
-
* @param {?} c
|
|
483
|
-
* @return {?}
|
|
484
|
-
*/
|
|
485
|
-
function (c) {
|
|
486
|
-
/** @type {?} */
|
|
487
|
-
var r = Math.random() * 16 | 0;
|
|
488
|
-
/** @type {?} */
|
|
489
|
-
var v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
490
|
-
return v.toString(16);
|
|
491
|
-
}));
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* @deprecated use import { uuid } from \@firestitch/common/util; instead
|
|
495
|
-
* @return {?}
|
|
496
|
-
*/
|
|
497
|
-
uuid() {
|
|
498
|
-
console.warn('@deprecated use @firestitch/common/util/uuid instead');
|
|
499
|
-
return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* @deprecated use import { resolve } from \@firestitch/common/util; instead
|
|
503
|
-
* @param {?} promise
|
|
504
|
-
* @param {?=} defaults
|
|
505
|
-
* @return {?}
|
|
506
|
-
*/
|
|
507
|
-
resolve(promise, defaults = []) {
|
|
508
|
-
console.warn('@deprecated use @firestitch/common/util/resolve instead');
|
|
509
|
-
/** @type {?} */
|
|
510
|
-
const result = defaults;
|
|
511
|
-
return new Promise((/**
|
|
512
|
-
* @param {?} resolve
|
|
513
|
-
* @return {?}
|
|
514
|
-
*/
|
|
515
|
-
resolve => {
|
|
516
|
-
promise.then((/**
|
|
517
|
-
* @param {?} data
|
|
518
|
-
* @return {?}
|
|
519
|
-
*/
|
|
520
|
-
function (data) {
|
|
521
|
-
Object.keys(data).forEach((/**
|
|
522
|
-
* @param {?} key
|
|
523
|
-
* @return {?}
|
|
524
|
-
*/
|
|
525
|
-
key => result[key] = data[key]));
|
|
526
|
-
resolve(result);
|
|
527
|
-
}));
|
|
528
|
-
}));
|
|
529
|
-
}
|
|
530
|
-
/**
|
|
531
|
-
* @deprecated use _.toInteger() instead
|
|
532
|
-
* @param {?} value
|
|
533
|
-
* @return {?}
|
|
534
|
-
*/
|
|
535
|
-
int(value) {
|
|
536
|
-
console.warn('@deprecated use _.toInteger() instead');
|
|
537
|
-
value = parseInt(value);
|
|
538
|
-
if (isNaN(value)) {
|
|
539
|
-
value = 0;
|
|
540
|
-
}
|
|
541
|
-
return value;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* @deprecated use _.toFinite() instead
|
|
545
|
-
* @param {?} value
|
|
546
|
-
* @return {?}
|
|
547
|
-
*/
|
|
548
|
-
float(value) {
|
|
549
|
-
console.warn('@deprecated use _.toFinite() instead');
|
|
550
|
-
value = parseFloat(value);
|
|
551
|
-
if (isNaN(value)) {
|
|
552
|
-
value = 0;
|
|
553
|
-
}
|
|
554
|
-
return value;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* @deprecated use _.toString() instead
|
|
558
|
-
* @param {?} string
|
|
559
|
-
* @return {?}
|
|
560
|
-
*/
|
|
561
|
-
string(string) {
|
|
562
|
-
console.warn('@deprecated use _.toString() instead');
|
|
563
|
-
if (string === null || string === undefined) {
|
|
564
|
-
string = '';
|
|
565
|
-
}
|
|
566
|
-
return (string).toString();
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* @deprecated use import { isEmpty } from \@firestitch/common/util; instead
|
|
570
|
-
* @param {?} value
|
|
571
|
-
* @param {?=} options
|
|
572
|
-
* @return {?}
|
|
573
|
-
*/
|
|
574
|
-
isEmpty(value, options) {
|
|
575
|
-
console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
|
|
576
|
-
options = options || {};
|
|
577
|
-
return value === undefined ||
|
|
578
|
-
value === null ||
|
|
579
|
-
value === false ||
|
|
580
|
-
value === '' ||
|
|
581
|
-
!this.string(value).length ||
|
|
582
|
-
(this.isObject(value) &&
|
|
583
|
-
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
584
|
-
(!options.zero && (value === 0 || value === '0'));
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* @deprecated use _.isInteger() instead
|
|
588
|
-
* @param {?} value
|
|
589
|
-
* @param {?=} type
|
|
590
|
-
* @return {?}
|
|
591
|
-
*/
|
|
592
|
-
isInt(value, type) {
|
|
593
|
-
console.warn('@deprecated use _.isInteger() instead');
|
|
594
|
-
/** @type {?} */
|
|
595
|
-
const int = !!this.string(value).match(/^\d+$/);
|
|
596
|
-
if (!int) {
|
|
597
|
-
return false;
|
|
598
|
-
}
|
|
599
|
-
if (type) {
|
|
600
|
-
return Number.isInteger(value);
|
|
601
|
-
}
|
|
602
|
-
return true;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* @deprecated use _.each() instead {\@link https://lodash.com/docs/4.17.5#forEach}
|
|
606
|
-
* @param {?} object
|
|
607
|
-
* @param {?} func
|
|
608
|
-
* @return {?}
|
|
609
|
-
*/
|
|
610
|
-
each(object, func) {
|
|
611
|
-
console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
|
|
612
|
-
if (!this.isArray(object) && !this.isObject(object)) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
Object.keys(object).forEach((/**
|
|
616
|
-
* @param {?} key
|
|
617
|
-
* @return {?}
|
|
618
|
-
*/
|
|
619
|
-
function (key) {
|
|
620
|
-
func(object[key], key);
|
|
621
|
-
}));
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* @deprecated use _.isArrayLikeObject() {\@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
|
|
625
|
-
* or _.isObject() {\@link https://lodash.com/docs/4.17.5#isObject} instead
|
|
626
|
-
* @param {?} value
|
|
627
|
-
* @return {?}
|
|
628
|
-
*/
|
|
629
|
-
isObject(value) {
|
|
630
|
-
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');
|
|
631
|
-
return value !== null && typeof value === 'object' && !this.isArray(value);
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* @deprecated use _.isString() instead {\@link https://lodash.com/docs/4.17.5#isString}
|
|
635
|
-
* @param {?} value
|
|
636
|
-
* @return {?}
|
|
637
|
-
*/
|
|
638
|
-
isString(value) {
|
|
639
|
-
console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
|
|
640
|
-
return typeof value === 'string' || value instanceof String;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* @deprecated use _.isArray() instead {\@link https://lodash.com/docs/4.17.5#isArray}
|
|
644
|
-
* @param {?} value
|
|
645
|
-
* @return {?}
|
|
646
|
-
*/
|
|
647
|
-
isArray(value) {
|
|
648
|
-
console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
|
|
649
|
-
return value instanceof Array;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* @deprecated use import { isNumeric } from \@firestitch/common/util; instead
|
|
653
|
-
* @param {?} value
|
|
654
|
-
* @return {?}
|
|
655
|
-
*/
|
|
656
|
-
isNumeric(value) {
|
|
657
|
-
console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
|
|
658
|
-
return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* @deprecated use import { isClass } from \@firestitch/common/util; instead
|
|
662
|
-
* @param {?} value
|
|
663
|
-
* @param {?} cls
|
|
664
|
-
* @return {?}
|
|
665
|
-
*/
|
|
666
|
-
isClass(value, cls) {
|
|
667
|
-
console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
|
|
668
|
-
if (this.isObject(value)) {
|
|
669
|
-
if (this.isString(cls)) {
|
|
670
|
-
if (value.constructor) {
|
|
671
|
-
if (value.constructor.name === cls) {
|
|
672
|
-
return true;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
if (value instanceof cls) {
|
|
678
|
-
return true;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
return false;
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* @deprecated use _.isBoolean() instead {\@link https://lodash.com/docs/4.17.5#isBoolean}
|
|
686
|
-
* @param {?} value
|
|
687
|
-
* @return {?}
|
|
688
|
-
*/
|
|
689
|
-
isBoolean(value) {
|
|
690
|
-
console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
|
|
691
|
-
return value === true || value === false;
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* @deprecated use import { value } from \@firestitch/common/util; instead
|
|
695
|
-
* @param {?} object
|
|
696
|
-
* @param {?} key
|
|
697
|
-
* @param {?} def
|
|
698
|
-
* @return {?}
|
|
699
|
-
*/
|
|
700
|
-
value(object, key, def) {
|
|
701
|
-
console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
|
|
702
|
-
if (this.isObject(object) || this.isArray(object)) {
|
|
703
|
-
if (object.hasOwnProperty(key)) {
|
|
704
|
-
return object[key];
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
return def;
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* @param {?} func
|
|
711
|
-
* @param {?} wait
|
|
712
|
-
* @return {?}
|
|
713
|
-
*/
|
|
714
|
-
throttle(func, wait) {
|
|
715
|
-
console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
|
|
716
|
-
/** @type {?} */
|
|
717
|
-
let waiting = false;
|
|
718
|
-
return (/**
|
|
719
|
-
* @return {?}
|
|
720
|
-
*/
|
|
721
|
-
function () {
|
|
722
|
-
if (!waiting) { // If we're not waiting
|
|
723
|
-
func.apply(null, arguments); // Execute users function
|
|
724
|
-
waiting = true; // Prevent future invocations
|
|
725
|
-
setTimeout((/**
|
|
726
|
-
* @return {?}
|
|
727
|
-
*/
|
|
728
|
-
function () {
|
|
729
|
-
waiting = false; // And allow future invocations
|
|
730
|
-
}), wait);
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* @deprecated use import { debounce } from \@firestitch/common/util; instead
|
|
736
|
-
* @param {?} func
|
|
737
|
-
* @param {?} wait
|
|
738
|
-
* @param {?} immediate
|
|
739
|
-
* @return {?}
|
|
740
|
-
*/
|
|
741
|
-
debounce(func, wait, immediate) {
|
|
742
|
-
console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
|
|
743
|
-
/** @type {?} */
|
|
744
|
-
var timeout;
|
|
745
|
-
return (/**
|
|
746
|
-
* @return {?}
|
|
747
|
-
*/
|
|
748
|
-
function () {
|
|
749
|
-
/** @type {?} */
|
|
750
|
-
var context = this;
|
|
751
|
-
/** @type {?} */
|
|
752
|
-
var args = arguments;
|
|
753
|
-
/** @type {?} */
|
|
754
|
-
var later = (/**
|
|
755
|
-
* @return {?}
|
|
756
|
-
*/
|
|
757
|
-
function () {
|
|
758
|
-
timeout = null;
|
|
759
|
-
if (!immediate)
|
|
760
|
-
func.apply(context, args);
|
|
761
|
-
});
|
|
762
|
-
/** @type {?} */
|
|
763
|
-
var callNow = immediate && !timeout;
|
|
764
|
-
clearTimeout(timeout);
|
|
765
|
-
timeout = setTimeout(later, wait);
|
|
766
|
-
if (callNow)
|
|
767
|
-
func.apply(context, args);
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
/**
|
|
771
|
-
* @deprecated use import { length } from \@firestitch/common/util; instead
|
|
772
|
-
* @param {?} object
|
|
773
|
-
* @return {?}
|
|
774
|
-
*/
|
|
775
|
-
length(object) {
|
|
776
|
-
console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
|
|
777
|
-
if (this.isObject(object)) {
|
|
778
|
-
return Object.keys(object).length;
|
|
779
|
-
}
|
|
780
|
-
if (this.isArray(object)) {
|
|
781
|
-
return object.length;
|
|
782
|
-
}
|
|
783
|
-
return 0;
|
|
784
|
-
}
|
|
785
|
-
/**
|
|
786
|
-
* @deprecated use import { boolean } from \@firestitch/common/util; instead
|
|
787
|
-
* @param {?} value
|
|
788
|
-
* @return {?}
|
|
789
|
-
*/
|
|
790
|
-
boolean(value) {
|
|
791
|
-
console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
|
|
792
|
-
return this.string(value).toLowerCase() !== 'false' && !!value;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* @deprecated use import { stringify } from \@firestitch/common/util; instead
|
|
796
|
-
* @param {?} value
|
|
797
|
-
* @return {?}
|
|
798
|
-
*/
|
|
799
|
-
stringify(value) {
|
|
800
|
-
console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
|
|
801
|
-
return JSON.stringify(value);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
FsUtil.decorators = [
|
|
805
|
-
{ type: Injectable }
|
|
806
|
-
];
|
|
807
|
-
if (false) {
|
|
808
|
-
/**
|
|
809
|
-
* @type {?}
|
|
810
|
-
* @private
|
|
811
|
-
*/
|
|
812
|
-
FsUtil.prototype.intervals;
|
|
8
|
+
class FsArray {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use import { nameValue } from @firestitch/common/array; instead
|
|
11
|
+
*/
|
|
12
|
+
nameValue(array, name, value) {
|
|
13
|
+
console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
|
|
14
|
+
let list = [];
|
|
15
|
+
if (name || value) {
|
|
16
|
+
let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
|
|
17
|
+
let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
|
|
18
|
+
array.forEach(function (item) {
|
|
19
|
+
list.push({ name: nameFn(item), value: valueFn(item) });
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
array.forEach(function (name, value) {
|
|
24
|
+
list.push({ name: name, value: value });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return list;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated use import { remove } from @firestitch/common/array; instead
|
|
31
|
+
*/
|
|
32
|
+
remove(array, query) {
|
|
33
|
+
console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
|
|
34
|
+
let idx = this.indexOf(array, query);
|
|
35
|
+
if (idx >= 0) {
|
|
36
|
+
return array.splice(idx, 1);
|
|
37
|
+
}
|
|
38
|
+
return idx;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated use import { indexOf } from @firestitch/common/array; instead
|
|
42
|
+
*/
|
|
43
|
+
indexOf(array, query) {
|
|
44
|
+
console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
|
|
45
|
+
if (typeof query !== 'function') {
|
|
46
|
+
let queryObj = query;
|
|
47
|
+
query = (item) => {
|
|
48
|
+
return this.compare(queryObj, item);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
52
|
+
if (query(array[i])) {
|
|
53
|
+
return i;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return -1;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated use import { compare } from @firestitch/common/array; instead
|
|
60
|
+
*/
|
|
61
|
+
compare(query, item) {
|
|
62
|
+
console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
|
|
63
|
+
let value = true;
|
|
64
|
+
for (let key in query) {
|
|
65
|
+
value = value && item[key] == query[key];
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated use import { filter } from @firestitch/common/array; instead
|
|
71
|
+
*/
|
|
72
|
+
filter(array, query) {
|
|
73
|
+
console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
|
|
74
|
+
if (typeof query !== 'function') {
|
|
75
|
+
let queryObj = query;
|
|
76
|
+
query = (item) => {
|
|
77
|
+
return this.compare(queryObj, item);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
let isarray = Array.isArray(array);
|
|
81
|
+
let list = isarray ? [] : {};
|
|
82
|
+
if (isarray)
|
|
83
|
+
array.forEach(function (item, idx) {
|
|
84
|
+
if (query(item)) {
|
|
85
|
+
list.push(item);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
else
|
|
89
|
+
Object.keys(array).forEach(key => {
|
|
90
|
+
if (query(array[key])) {
|
|
91
|
+
list[key] = array[key];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return list;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated use import { index } from @firestitch/common/array; instead
|
|
98
|
+
*/
|
|
99
|
+
index(array, property) {
|
|
100
|
+
console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
|
|
101
|
+
let list = {};
|
|
102
|
+
array.forEach(function (item, idx) {
|
|
103
|
+
list[item[property]] = item;
|
|
104
|
+
});
|
|
105
|
+
return list;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated use import { sort } from @firestitch/common/array; instead
|
|
109
|
+
*/
|
|
110
|
+
sort(array, query, reverse = false) {
|
|
111
|
+
console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
|
|
112
|
+
if (typeof query !== 'function') {
|
|
113
|
+
let queryStr = query;
|
|
114
|
+
query = function (a, b) {
|
|
115
|
+
if (reverse) {
|
|
116
|
+
if (a[queryStr] < b[queryStr]) {
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
else if (a[queryStr] > b[queryStr]) {
|
|
120
|
+
return -1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
if (a[queryStr] > b[queryStr]) {
|
|
125
|
+
return 1;
|
|
126
|
+
}
|
|
127
|
+
else if (a[queryStr] < b[queryStr]) {
|
|
128
|
+
return -1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return 0;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
array.sort(query);
|
|
135
|
+
return array;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated use import { rsort } from @firestitch/common/array; instead
|
|
139
|
+
*/
|
|
140
|
+
rsort(array, query) {
|
|
141
|
+
console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
|
|
142
|
+
return this.sort(array, query, true);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated use import { list } from @firestitch/common/array; instead
|
|
146
|
+
*/
|
|
147
|
+
list(array, property, index = null) {
|
|
148
|
+
console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
|
|
149
|
+
let list = index ? {} : [];
|
|
150
|
+
array.forEach(function (item, idx) {
|
|
151
|
+
if (index) {
|
|
152
|
+
list[item[index]] = item[property];
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
list.push(item[property]);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
return list;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @deprecated use import { applyDepth } from @firestitch/common/array; instead
|
|
162
|
+
*/
|
|
163
|
+
applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
|
|
164
|
+
console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
|
|
165
|
+
let keyed = {};
|
|
166
|
+
objects.forEach(function (object) {
|
|
167
|
+
if (!object[parent_property]) {
|
|
168
|
+
object[depth_property] = 0;
|
|
169
|
+
}
|
|
170
|
+
keyed[object[id_property]] = object;
|
|
171
|
+
});
|
|
172
|
+
Object.keys(keyed).forEach(key => {
|
|
173
|
+
Object.keys(keyed).forEach(key => {
|
|
174
|
+
let object = keyed[key];
|
|
175
|
+
if (!keyed[key][depth_property]) {
|
|
176
|
+
if (keyed[key][parent_property]) {
|
|
177
|
+
keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
return keyed;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated use import { inArray } from @firestitch/common/array; instead
|
|
186
|
+
*/
|
|
187
|
+
inArray(values, array) {
|
|
188
|
+
console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
|
|
189
|
+
if (!Array.isArray(values)) {
|
|
190
|
+
values = [values];
|
|
191
|
+
}
|
|
192
|
+
for (let i = 0, len = values.length; i < len; i++) {
|
|
193
|
+
if (array.indexOf(values[i]) >= 0) {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated use import { keyExists } from @firestitch/common/array; instead
|
|
201
|
+
*/
|
|
202
|
+
keyExists(array, key) {
|
|
203
|
+
console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
|
|
204
|
+
return array.hasOwnProperty(key);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated use import { length } from @firestitch/common/array; instead
|
|
208
|
+
*/
|
|
209
|
+
length(array) {
|
|
210
|
+
console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
|
|
211
|
+
return array.length;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @deprecated use import { ksort } from @firestitch/common/array; instead
|
|
215
|
+
*/
|
|
216
|
+
ksort(unordered) {
|
|
217
|
+
console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
|
|
218
|
+
Object.keys(unordered).sort().forEach(function (key) {
|
|
219
|
+
let value = unordered[key];
|
|
220
|
+
delete unordered[key];
|
|
221
|
+
unordered[key] = value;
|
|
222
|
+
});
|
|
223
|
+
}
|
|
813
224
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
class
|
|
821
|
-
/**
|
|
822
|
-
* @
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
phone(value) {
|
|
833
|
-
/** @type {?} */
|
|
834
|
-
const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
|
|
835
|
-
return valid || !String(value).length;
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* @deprecated use import { email } from \@firestitch/common/validate; instead
|
|
839
|
-
* @param {?} value
|
|
840
|
-
* @return {?}
|
|
841
|
-
*/
|
|
842
|
-
email(value) {
|
|
843
|
-
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,}))$/);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
FsValidate.decorators = [
|
|
847
|
-
{ type: Injectable }
|
|
848
|
-
];
|
|
849
|
-
/** @nocollapse */
|
|
850
|
-
FsValidate.ctorParameters = () => [
|
|
851
|
-
{ type: FsUtil }
|
|
852
|
-
];
|
|
853
|
-
if (false) {
|
|
854
|
-
/**
|
|
855
|
-
* @type {?}
|
|
856
|
-
* @private
|
|
857
|
-
*/
|
|
858
|
-
FsValidate.prototype.fsUtil;
|
|
225
|
+
FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
226
|
+
FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray });
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray, decorators: [{
|
|
228
|
+
type: Injectable
|
|
229
|
+
}] });
|
|
230
|
+
|
|
231
|
+
class FsMath {
|
|
232
|
+
/**
|
|
233
|
+
* @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
|
|
234
|
+
*/
|
|
235
|
+
round(number, precision) {
|
|
236
|
+
console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
|
|
237
|
+
precision = precision || 0;
|
|
238
|
+
let factor = Math.pow(10, precision);
|
|
239
|
+
let tempNumber = number * factor;
|
|
240
|
+
let roundedTempNumber = Math.round(tempNumber);
|
|
241
|
+
return roundedTempNumber / factor;
|
|
242
|
+
}
|
|
859
243
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
244
|
+
FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
245
|
+
FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath });
|
|
246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath, decorators: [{
|
|
247
|
+
type: Injectable
|
|
248
|
+
}] });
|
|
249
|
+
|
|
250
|
+
const KEY_CANCEL$1 = 3, KEY_HELP$1 = 6, KEY_BACKSPACE$1 = 8, KEY_TAB$1 = 9, KEY_CLEAR$1 = 12, KEY_RETURN$1 = 13, KEY_ENTER$1 = 14, KEY_SHIFT$1 = 16, KEY_CONTROL$1 = 17, KEY_ALT$1 = 18, KEY_PAUSE$1 = 19, KEY_CAPS_LOCK$1 = 20, KEY_ESCAPE$1 = 27, KEY_SPACE$1 = 32, KEY_PAGE_UP$1 = 33, KEY_PAGE_DOWN$1 = 34, KEY_END$1 = 35, KEY_HOME$1 = 36, KEY_LEFT$1 = 37, KEY_UP$1 = 38, KEY_RIGHT$1 = 39, KEY_DOWN$1 = 40, KEY_PRINTSCREEN$1 = 44, KEY_INSERT$1 = 45, KEY_DELETE$1 = 46, KEY_0$1 = 48, KEY_1$1 = 49, KEY_2$1 = 50, KEY_3$1 = 51, KEY_4$1 = 52, KEY_5$1 = 53, KEY_6$1 = 54, KEY_7$1 = 55, KEY_8$1 = 56, KEY_9$1 = 57, KEY_SEMICOLON$1 = 59, KEY_EQUALS$1 = 61;
|
|
251
|
+
/*
|
|
252
|
+
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)
|
|
253
|
+
There might be a better way to organise constatns but I need to know use-cases
|
|
254
|
+
*/
|
|
255
|
+
class FsUtil {
|
|
256
|
+
constructor() {
|
|
257
|
+
this.intervals = {};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* @deprecated use @firestitch/common/util/guid instead
|
|
261
|
+
*/
|
|
262
|
+
guid(pattern) {
|
|
263
|
+
console.warn('@deprecated use @firestitch/common/util/guid instead');
|
|
264
|
+
pattern = pattern || 'xxxxxx';
|
|
265
|
+
return pattern.replace(/[xy]/g, function (c) {
|
|
266
|
+
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
267
|
+
return v.toString(16);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @deprecated use import { uuid } from @firestitch/common/util; instead
|
|
272
|
+
*/
|
|
273
|
+
uuid() {
|
|
274
|
+
console.warn('@deprecated use @firestitch/common/util/uuid instead');
|
|
275
|
+
return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @deprecated use import { resolve } from @firestitch/common/util; instead
|
|
279
|
+
*/
|
|
280
|
+
resolve(promise, defaults = []) {
|
|
281
|
+
console.warn('@deprecated use @firestitch/common/util/resolve instead');
|
|
282
|
+
const result = defaults;
|
|
283
|
+
return new Promise(resolve => {
|
|
284
|
+
promise.then(function (data) {
|
|
285
|
+
Object.keys(data).forEach(key => result[key] = data[key]);
|
|
286
|
+
resolve(result);
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @deprecated use _.toInteger() instead
|
|
292
|
+
*/
|
|
293
|
+
int(value) {
|
|
294
|
+
console.warn('@deprecated use _.toInteger() instead');
|
|
295
|
+
value = parseInt(value);
|
|
296
|
+
if (isNaN(value)) {
|
|
297
|
+
value = 0;
|
|
298
|
+
}
|
|
299
|
+
return value;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* @deprecated use _.toFinite() instead
|
|
303
|
+
*/
|
|
304
|
+
float(value) {
|
|
305
|
+
console.warn('@deprecated use _.toFinite() instead');
|
|
306
|
+
value = parseFloat(value);
|
|
307
|
+
if (isNaN(value)) {
|
|
308
|
+
value = 0;
|
|
309
|
+
}
|
|
310
|
+
return value;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @deprecated use _.toString() instead
|
|
314
|
+
*/
|
|
315
|
+
string(string) {
|
|
316
|
+
console.warn('@deprecated use _.toString() instead');
|
|
317
|
+
if (string === null || string === undefined) {
|
|
318
|
+
string = '';
|
|
319
|
+
}
|
|
320
|
+
return (string).toString();
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated use import { isEmpty } from @firestitch/common/util; instead
|
|
324
|
+
*/
|
|
325
|
+
isEmpty(value, options) {
|
|
326
|
+
console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
|
|
327
|
+
options = options || {};
|
|
328
|
+
return value === undefined ||
|
|
329
|
+
value === null ||
|
|
330
|
+
value === false ||
|
|
331
|
+
value === '' ||
|
|
332
|
+
!this.string(value).length ||
|
|
333
|
+
(this.isObject(value) &&
|
|
334
|
+
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
335
|
+
(!options.zero && (value === 0 || value === '0'));
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* @deprecated use _.isInteger() instead
|
|
339
|
+
*/
|
|
340
|
+
isInt(value, type) {
|
|
341
|
+
console.warn('@deprecated use _.isInteger() instead');
|
|
342
|
+
const int = !!this.string(value).match(/^\d+$/);
|
|
343
|
+
if (!int) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
if (type) {
|
|
347
|
+
return Number.isInteger(value);
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
|
|
353
|
+
*/
|
|
354
|
+
each(object, func) {
|
|
355
|
+
console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
|
|
356
|
+
if (!this.isArray(object) && !this.isObject(object)) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
Object.keys(object).forEach(function (key) {
|
|
360
|
+
func(object[key], key);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
|
|
365
|
+
* or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
|
|
366
|
+
*/
|
|
367
|
+
isObject(value) {
|
|
368
|
+
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');
|
|
369
|
+
return value !== null && typeof value === 'object' && !this.isArray(value);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
|
|
373
|
+
*/
|
|
374
|
+
isString(value) {
|
|
375
|
+
console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
|
|
376
|
+
return typeof value === 'string' || value instanceof String;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
|
|
380
|
+
*/
|
|
381
|
+
isArray(value) {
|
|
382
|
+
console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
|
|
383
|
+
return value instanceof Array;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* @deprecated use import { isNumeric } from @firestitch/common/util; instead
|
|
387
|
+
*/
|
|
388
|
+
isNumeric(value) {
|
|
389
|
+
console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
|
|
390
|
+
return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @deprecated use import { isClass } from @firestitch/common/util; instead
|
|
394
|
+
*/
|
|
395
|
+
isClass(value, cls) {
|
|
396
|
+
console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
|
|
397
|
+
if (this.isObject(value)) {
|
|
398
|
+
if (this.isString(cls)) {
|
|
399
|
+
if (value.constructor) {
|
|
400
|
+
if (value.constructor.name === cls) {
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
if (value instanceof cls) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
|
|
415
|
+
*/
|
|
416
|
+
isBoolean(value) {
|
|
417
|
+
console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
|
|
418
|
+
return value === true || value === false;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* @deprecated use import { value } from @firestitch/common/util; instead
|
|
422
|
+
*/
|
|
423
|
+
value(object, key, def) {
|
|
424
|
+
console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
|
|
425
|
+
if (this.isObject(object) || this.isArray(object)) {
|
|
426
|
+
if (object.hasOwnProperty(key)) {
|
|
427
|
+
return object[key];
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return def;
|
|
431
|
+
}
|
|
432
|
+
throttle(func, wait) {
|
|
433
|
+
console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
|
|
434
|
+
let waiting = false; // Initially, we're not waiting
|
|
435
|
+
return function () {
|
|
436
|
+
if (!waiting) { // If we're not waiting
|
|
437
|
+
func.apply(null, arguments); // Execute users function
|
|
438
|
+
waiting = true; // Prevent future invocations
|
|
439
|
+
setTimeout(function () {
|
|
440
|
+
waiting = false; // And allow future invocations
|
|
441
|
+
}, wait);
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @deprecated use import { debounce } from @firestitch/common/util; instead
|
|
447
|
+
*/
|
|
448
|
+
debounce(func, wait, immediate) {
|
|
449
|
+
console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
|
|
450
|
+
var timeout;
|
|
451
|
+
return function () {
|
|
452
|
+
var context = this, args = arguments;
|
|
453
|
+
var later = function () {
|
|
454
|
+
timeout = null;
|
|
455
|
+
if (!immediate)
|
|
456
|
+
func.apply(context, args);
|
|
457
|
+
};
|
|
458
|
+
var callNow = immediate && !timeout;
|
|
459
|
+
clearTimeout(timeout);
|
|
460
|
+
timeout = setTimeout(later, wait);
|
|
461
|
+
if (callNow)
|
|
462
|
+
func.apply(context, args);
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated use import { length } from @firestitch/common/util; instead
|
|
467
|
+
*/
|
|
468
|
+
length(object) {
|
|
469
|
+
console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
|
|
470
|
+
if (this.isObject(object)) {
|
|
471
|
+
return Object.keys(object).length;
|
|
472
|
+
}
|
|
473
|
+
if (this.isArray(object)) {
|
|
474
|
+
return object.length;
|
|
475
|
+
}
|
|
476
|
+
return 0;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* @deprecated use import { boolean } from @firestitch/common/util; instead
|
|
480
|
+
*/
|
|
481
|
+
boolean(value) {
|
|
482
|
+
console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
|
|
483
|
+
return this.string(value).toLowerCase() !== 'false' && !!value;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* @deprecated use import { stringify } from @firestitch/common/util; instead
|
|
487
|
+
*/
|
|
488
|
+
stringify(value) {
|
|
489
|
+
console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
|
|
490
|
+
return JSON.stringify(value);
|
|
491
|
+
}
|
|
872
492
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}
|
|
897
|
-
/** @type {?} */
|
|
898
|
-
const chars = s.match(/(.{1,1})/g);
|
|
899
|
-
return pattern.replace(/[x]/g, (/**
|
|
900
|
-
* @param {?} c
|
|
901
|
-
* @return {?}
|
|
902
|
-
*/
|
|
903
|
-
function (c) {
|
|
904
|
-
/** @type {?} */
|
|
905
|
-
const i = (Math.random() * chars.length) | 0;
|
|
906
|
-
return chars[i];
|
|
907
|
-
}));
|
|
493
|
+
FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
494
|
+
FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil });
|
|
495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil, decorators: [{
|
|
496
|
+
type: Injectable
|
|
497
|
+
}] });
|
|
498
|
+
|
|
499
|
+
class FsValidate {
|
|
500
|
+
constructor(fsUtil) {
|
|
501
|
+
this.fsUtil = fsUtil;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
505
|
+
*/
|
|
506
|
+
phone(value) {
|
|
507
|
+
const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
|
|
508
|
+
return valid || !String(value).length;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
512
|
+
*/
|
|
513
|
+
email(value) {
|
|
514
|
+
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,}))$/);
|
|
515
|
+
}
|
|
908
516
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
* @param {?=} options
|
|
918
|
-
* @return {?}
|
|
919
|
-
*/
|
|
920
|
-
function isEmpty(value, options) {
|
|
921
|
-
options = options || {};
|
|
922
|
-
return value === undefined ||
|
|
923
|
-
value === null ||
|
|
924
|
-
value === false ||
|
|
925
|
-
value === '' ||
|
|
926
|
-
!toString(value).length ||
|
|
927
|
-
(isObject(value) &&
|
|
928
|
-
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
929
|
-
(!options.zero && (value === 0 || value === '0'));
|
|
517
|
+
FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
518
|
+
FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate });
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate, decorators: [{
|
|
520
|
+
type: Injectable
|
|
521
|
+
}], ctorParameters: function () { return [{ type: FsUtil }]; } });
|
|
522
|
+
|
|
523
|
+
function stringify(value) {
|
|
524
|
+
return JSON.stringify(value);
|
|
930
525
|
}
|
|
931
526
|
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
name: 'fsUtilStringify'
|
|
950
|
-
},] }
|
|
951
|
-
];
|
|
952
|
-
/** @nocollapse */
|
|
953
|
-
FsUtilStringifyPipe.ctorParameters = () => [];
|
|
954
|
-
class FsUtilGuidPipe {
|
|
955
|
-
constructor() { }
|
|
956
|
-
/**
|
|
957
|
-
* @return {?}
|
|
958
|
-
*/
|
|
959
|
-
transform() {
|
|
960
|
-
return guid();
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
FsUtilGuidPipe.decorators = [
|
|
964
|
-
{ type: Pipe, args: [{
|
|
965
|
-
name: 'fsUtilGuid'
|
|
966
|
-
},] }
|
|
967
|
-
];
|
|
968
|
-
/** @nocollapse */
|
|
969
|
-
FsUtilGuidPipe.ctorParameters = () => [];
|
|
970
|
-
class FsUtilIsEmptyPipe {
|
|
971
|
-
/**
|
|
972
|
-
* @param {?} value
|
|
973
|
-
* @return {?}
|
|
974
|
-
*/
|
|
975
|
-
transform(value) {
|
|
976
|
-
return isEmpty(value);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
FsUtilIsEmptyPipe.decorators = [
|
|
980
|
-
{ type: Pipe, args: [{
|
|
981
|
-
name: 'fsUtilIsEmpty'
|
|
982
|
-
},] }
|
|
983
|
-
];
|
|
984
|
-
class FsUtilIsNotEmptyPipe {
|
|
985
|
-
/**
|
|
986
|
-
* @param {?} value
|
|
987
|
-
* @return {?}
|
|
988
|
-
*/
|
|
989
|
-
transform(value) {
|
|
990
|
-
return !isEmpty(value);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
FsUtilIsNotEmptyPipe.decorators = [
|
|
994
|
-
{ type: Pipe, args: [{
|
|
995
|
-
name: 'fsUtilIsNotEmpty'
|
|
996
|
-
},] }
|
|
997
|
-
];
|
|
998
|
-
|
|
999
|
-
/**
|
|
1000
|
-
* @fileoverview added by tsickle
|
|
1001
|
-
* Generated from: libs/format/number/number.ts
|
|
1002
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1003
|
-
*/
|
|
1004
|
-
/**
|
|
1005
|
-
* @param {?} value
|
|
1006
|
-
* @param {?=} decimals
|
|
1007
|
-
* @return {?}
|
|
1008
|
-
*/
|
|
1009
|
-
function number(value, decimals) {
|
|
1010
|
-
return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
|
|
527
|
+
function guid(pattern, options = { case: 'lower', numbers: true }) {
|
|
528
|
+
pattern = pattern || 'xxxxxx';
|
|
529
|
+
let s = '';
|
|
530
|
+
if (options.numbers !== false) {
|
|
531
|
+
s = '0123456789';
|
|
532
|
+
}
|
|
533
|
+
if (!options.case || options.case === 'lower' || options.case === 'mixed') {
|
|
534
|
+
s = s.concat('abcdefghijklmnopqrstuvwxyz');
|
|
535
|
+
}
|
|
536
|
+
if (options.case === 'upper' || options.case === 'mixed') {
|
|
537
|
+
s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
538
|
+
}
|
|
539
|
+
const chars = s.match(/(.{1,1})/g);
|
|
540
|
+
return pattern.replace(/[x]/g, function (c) {
|
|
541
|
+
const i = (Math.random() * chars.length) | 0;
|
|
542
|
+
return chars[i];
|
|
543
|
+
});
|
|
1011
544
|
}
|
|
1012
545
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
*/
|
|
1024
|
-
transform(value, decimals) {
|
|
1025
|
-
return number(value, decimals);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
FsFormatNumberPipe.decorators = [
|
|
1029
|
-
{ type: Pipe, args: [{
|
|
1030
|
-
name: 'fsFormatNumber'
|
|
1031
|
-
},] }
|
|
1032
|
-
];
|
|
1033
|
-
|
|
1034
|
-
/**
|
|
1035
|
-
* @fileoverview added by tsickle
|
|
1036
|
-
* Generated from: libs/format/currency/currency.ts
|
|
1037
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1038
|
-
*/
|
|
1039
|
-
/**
|
|
1040
|
-
* @param {?} amount
|
|
1041
|
-
* @param {?=} precision
|
|
1042
|
-
* @param {?=} currencyCode
|
|
1043
|
-
* @param {?=} locale
|
|
1044
|
-
* @return {?}
|
|
1045
|
-
*/
|
|
1046
|
-
function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
|
|
1047
|
-
/** @type {?} */
|
|
1048
|
-
const digitsInfo = isArray(precision) ? precision : [precision, precision];
|
|
1049
|
-
return new CurrencyPipe(locale).transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
|
|
546
|
+
function isEmpty(value, options) {
|
|
547
|
+
options = options || {};
|
|
548
|
+
return value === undefined ||
|
|
549
|
+
value === null ||
|
|
550
|
+
value === false ||
|
|
551
|
+
value === '' ||
|
|
552
|
+
!toString(value).length ||
|
|
553
|
+
(isObject(value) &&
|
|
554
|
+
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
555
|
+
(!options.zero && (value === 0 || value === '0'));
|
|
1050
556
|
}
|
|
1051
557
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
class FsFormatCurrencyPipe {
|
|
1058
|
-
/**
|
|
1059
|
-
* @param {?} locale
|
|
1060
|
-
*/
|
|
1061
|
-
constructor(locale) {
|
|
1062
|
-
this.locale = locale;
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* @param {?} amount
|
|
1066
|
-
* @param {?=} precision
|
|
1067
|
-
* @param {?=} currencyCode
|
|
1068
|
-
* @return {?}
|
|
1069
|
-
*/
|
|
1070
|
-
transform(amount, precision, currencyCode) {
|
|
1071
|
-
return currency(amount, precision, currencyCode);
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
FsFormatCurrencyPipe.decorators = [
|
|
1075
|
-
{ type: Pipe, args: [{
|
|
1076
|
-
name: 'fsFormatCurrency'
|
|
1077
|
-
},] }
|
|
1078
|
-
];
|
|
1079
|
-
/** @nocollapse */
|
|
1080
|
-
FsFormatCurrencyPipe.ctorParameters = () => [
|
|
1081
|
-
{ type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
|
|
1082
|
-
];
|
|
1083
|
-
if (false) {
|
|
1084
|
-
/** @type {?} */
|
|
1085
|
-
FsFormatCurrencyPipe.prototype.locale;
|
|
558
|
+
class FsUtilStringifyPipe {
|
|
559
|
+
constructor() { }
|
|
560
|
+
transform(value) {
|
|
561
|
+
return stringify(value);
|
|
562
|
+
}
|
|
1086
563
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
|
|
1101
|
-
value = value || '';
|
|
1102
|
-
if (completeWords) {
|
|
1103
|
-
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
1104
|
-
}
|
|
1105
|
-
/** @type {?} */
|
|
1106
|
-
let result = `${value.substr(0, limit)}`;
|
|
1107
|
-
if (result !== value) {
|
|
1108
|
-
result += ellipsis;
|
|
1109
|
-
}
|
|
1110
|
-
return result;
|
|
564
|
+
FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
565
|
+
FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
|
|
567
|
+
type: Pipe,
|
|
568
|
+
args: [{
|
|
569
|
+
name: 'fsUtilStringify'
|
|
570
|
+
}]
|
|
571
|
+
}], ctorParameters: function () { return []; } });
|
|
572
|
+
class FsUtilGuidPipe {
|
|
573
|
+
constructor() { }
|
|
574
|
+
transform() {
|
|
575
|
+
return guid();
|
|
576
|
+
}
|
|
1111
577
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
* @param {?=} ellipsis
|
|
1125
|
-
* @return {?}
|
|
1126
|
-
*/
|
|
1127
|
-
transform(value, limit, completeWords, ellipsis) {
|
|
1128
|
-
return truncate(value, limit, completeWords, ellipsis);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
FsFormatTruncatePipe.decorators = [
|
|
1132
|
-
{ type: Pipe, args: [{
|
|
1133
|
-
name: 'fsFormatTruncate'
|
|
1134
|
-
},] }
|
|
1135
|
-
];
|
|
1136
|
-
/** @nocollapse */
|
|
1137
|
-
FsFormatTruncatePipe.ctorParameters = () => [];
|
|
1138
|
-
|
|
1139
|
-
/**
|
|
1140
|
-
* @fileoverview added by tsickle
|
|
1141
|
-
* Generated from: libs/format/bytes/bytes.ts
|
|
1142
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1143
|
-
*/
|
|
1144
|
-
/**
|
|
1145
|
-
* @param {?} bytes
|
|
1146
|
-
* @return {?}
|
|
1147
|
-
*/
|
|
1148
|
-
function bytes(bytes) {
|
|
1149
|
-
if (!bytes) {
|
|
1150
|
-
return '0.00 B';
|
|
1151
|
-
}
|
|
1152
|
-
/** @type {?} */
|
|
1153
|
-
const e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
1154
|
-
/** @type {?} */
|
|
1155
|
-
const decimals = (bytes / 1024) > 1000 ? 2 : 0;
|
|
1156
|
-
console.log(bytes, (bytes / 1024), decimals);
|
|
1157
|
-
return `${(bytes / Math.pow(1024, e)).toFixed(decimals)}`.replace(/\.00/, '')
|
|
1158
|
-
+ ' '
|
|
1159
|
-
+ (e ? ' KMGTP'.charAt(e) : '') + 'B';
|
|
578
|
+
FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
579
|
+
FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
|
|
580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
|
|
581
|
+
type: Pipe,
|
|
582
|
+
args: [{
|
|
583
|
+
name: 'fsUtilGuid'
|
|
584
|
+
}]
|
|
585
|
+
}], ctorParameters: function () { return []; } });
|
|
586
|
+
class FsUtilIsEmptyPipe {
|
|
587
|
+
transform(value) {
|
|
588
|
+
return isEmpty(value);
|
|
589
|
+
}
|
|
1160
590
|
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
return bytes(value);
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
FsFormatBytesPipe.decorators = [
|
|
1177
|
-
{ type: Pipe, args: [{
|
|
1178
|
-
name: 'fsFormatBytes',
|
|
1179
|
-
},] }
|
|
1180
|
-
];
|
|
1181
|
-
|
|
1182
|
-
/**
|
|
1183
|
-
* @fileoverview added by tsickle
|
|
1184
|
-
* Generated from: app/directives/stop-propagation.directive.ts
|
|
1185
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1186
|
-
*/
|
|
1187
|
-
class FsStopPropagationDirective {
|
|
1188
|
-
/**
|
|
1189
|
-
* @param {?} event
|
|
1190
|
-
* @return {?}
|
|
1191
|
-
*/
|
|
1192
|
-
preventClick(event) {
|
|
1193
|
-
event.stopPropagation();
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
FsStopPropagationDirective.decorators = [
|
|
1197
|
-
{ type: Directive, args: [{
|
|
1198
|
-
selector: '[fsStopPropagation]',
|
|
1199
|
-
},] }
|
|
1200
|
-
];
|
|
1201
|
-
FsStopPropagationDirective.propDecorators = {
|
|
1202
|
-
preventClick: [{ type: HostListener, args: ['click', ['$event'],] }]
|
|
1203
|
-
};
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* @fileoverview added by tsickle
|
|
1207
|
-
* Generated from: app/directives/prevent-default.directive.ts
|
|
1208
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1209
|
-
*/
|
|
1210
|
-
class FsPreventDefaultDirective {
|
|
1211
|
-
/**
|
|
1212
|
-
* @param {?} event
|
|
1213
|
-
* @return {?}
|
|
1214
|
-
*/
|
|
1215
|
-
preventClick(event) {
|
|
1216
|
-
event.preventDefault();
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
FsPreventDefaultDirective.decorators = [
|
|
1220
|
-
{ type: Directive, args: [{
|
|
1221
|
-
selector: '[fsPreventDefault]',
|
|
1222
|
-
},] }
|
|
1223
|
-
];
|
|
1224
|
-
FsPreventDefaultDirective.propDecorators = {
|
|
1225
|
-
preventClick: [{ type: HostListener, args: ['click', ['$event'],] }]
|
|
1226
|
-
};
|
|
1227
|
-
|
|
1228
|
-
/**
|
|
1229
|
-
* @fileoverview added by tsickle
|
|
1230
|
-
* Generated from: app/directives/autofocus.directive.ts
|
|
1231
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1232
|
-
*/
|
|
1233
|
-
class FsAutofocusDirective {
|
|
1234
|
-
/**
|
|
1235
|
-
* @param {?} _el
|
|
1236
|
-
*/
|
|
1237
|
-
constructor(_el) {
|
|
1238
|
-
this._el = _el;
|
|
1239
|
-
}
|
|
1240
|
-
/**
|
|
1241
|
-
* @return {?}
|
|
1242
|
-
*/
|
|
1243
|
-
ngAfterViewInit() {
|
|
1244
|
-
setTimeout((/**
|
|
1245
|
-
* @return {?}
|
|
1246
|
-
*/
|
|
1247
|
-
() => {
|
|
1248
|
-
this._el.nativeElement.focus();
|
|
1249
|
-
}));
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
FsAutofocusDirective.decorators = [
|
|
1253
|
-
{ type: Directive, args: [{
|
|
1254
|
-
selector: '[autofocus]',
|
|
1255
|
-
},] }
|
|
1256
|
-
];
|
|
1257
|
-
/** @nocollapse */
|
|
1258
|
-
FsAutofocusDirective.ctorParameters = () => [
|
|
1259
|
-
{ type: ElementRef }
|
|
1260
|
-
];
|
|
1261
|
-
if (false) {
|
|
1262
|
-
/**
|
|
1263
|
-
* @type {?}
|
|
1264
|
-
* @private
|
|
1265
|
-
*/
|
|
1266
|
-
FsAutofocusDirective.prototype._el;
|
|
591
|
+
FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
592
|
+
FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
|
|
594
|
+
type: Pipe,
|
|
595
|
+
args: [{
|
|
596
|
+
name: 'fsUtilIsEmpty'
|
|
597
|
+
}]
|
|
598
|
+
}] });
|
|
599
|
+
class FsUtilIsNotEmptyPipe {
|
|
600
|
+
transform(value) {
|
|
601
|
+
return !isEmpty(value);
|
|
602
|
+
}
|
|
1267
603
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
value = String(value);
|
|
1280
|
-
/** @type {?} */
|
|
1281
|
-
const index = value.match `1?.$`;
|
|
1282
|
-
/** @type {?} */
|
|
1283
|
-
const endings = [, 'st', 'nd', 'rd'];
|
|
1284
|
-
/** @type {?} */
|
|
1285
|
-
const ending = endings[index] || 'th';
|
|
1286
|
-
return value + ending;
|
|
604
|
+
FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
605
|
+
FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
|
|
607
|
+
type: Pipe,
|
|
608
|
+
args: [{
|
|
609
|
+
name: 'fsUtilIsNotEmpty'
|
|
610
|
+
}]
|
|
611
|
+
}] });
|
|
612
|
+
|
|
613
|
+
function number(value, decimals) {
|
|
614
|
+
return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
|
|
1287
615
|
}
|
|
1288
616
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
*/
|
|
1294
|
-
class FsFormatOrdinalNumberPipe {
|
|
1295
|
-
/**
|
|
1296
|
-
* @param {?} value
|
|
1297
|
-
* @return {?}
|
|
1298
|
-
*/
|
|
1299
|
-
transform(value) {
|
|
1300
|
-
return ordinalNumber(value);
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
FsFormatOrdinalNumberPipe.decorators = [
|
|
1304
|
-
{ type: Pipe, args: [{
|
|
1305
|
-
name: 'fsFormatOrdinalNumber',
|
|
1306
|
-
},] }
|
|
1307
|
-
];
|
|
1308
|
-
|
|
1309
|
-
/**
|
|
1310
|
-
* @fileoverview added by tsickle
|
|
1311
|
-
* Generated from: app/fs-common.module.ts
|
|
1312
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1313
|
-
*/
|
|
1314
|
-
class FsCommonModule {
|
|
1315
|
-
/**
|
|
1316
|
-
* @return {?}
|
|
1317
|
-
*/
|
|
1318
|
-
static forRoot() {
|
|
1319
|
-
return {
|
|
1320
|
-
ngModule: FsCommonModule,
|
|
1321
|
-
providers: [
|
|
1322
|
-
FsArray,
|
|
1323
|
-
FsMath,
|
|
1324
|
-
FsUtil,
|
|
1325
|
-
FsValidate
|
|
1326
|
-
]
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
FsCommonModule.decorators = [
|
|
1331
|
-
{ type: NgModule, args: [{
|
|
1332
|
-
imports: [
|
|
1333
|
-
CommonModule,
|
|
1334
|
-
],
|
|
1335
|
-
exports: [
|
|
1336
|
-
FsStopPropagationDirective,
|
|
1337
|
-
FsPreventDefaultDirective,
|
|
1338
|
-
FsAutofocusDirective,
|
|
1339
|
-
FsUtilGuidPipe,
|
|
1340
|
-
FsUtilStringifyPipe,
|
|
1341
|
-
FsFormatNumberPipe,
|
|
1342
|
-
FsFormatCurrencyPipe,
|
|
1343
|
-
FsFormatTruncatePipe,
|
|
1344
|
-
FsUtilIsEmptyPipe,
|
|
1345
|
-
FsUtilIsNotEmptyPipe,
|
|
1346
|
-
FsFormatBytesPipe,
|
|
1347
|
-
FsFormatOrdinalNumberPipe,
|
|
1348
|
-
],
|
|
1349
|
-
declarations: [
|
|
1350
|
-
FsStopPropagationDirective,
|
|
1351
|
-
FsPreventDefaultDirective,
|
|
1352
|
-
FsAutofocusDirective,
|
|
1353
|
-
FsUtilGuidPipe,
|
|
1354
|
-
FsUtilIsEmptyPipe,
|
|
1355
|
-
FsUtilIsNotEmptyPipe,
|
|
1356
|
-
FsUtilStringifyPipe,
|
|
1357
|
-
FsFormatNumberPipe,
|
|
1358
|
-
FsFormatCurrencyPipe,
|
|
1359
|
-
FsFormatTruncatePipe,
|
|
1360
|
-
FsFormatBytesPipe,
|
|
1361
|
-
FsFormatOrdinalNumberPipe,
|
|
1362
|
-
],
|
|
1363
|
-
},] }
|
|
1364
|
-
];
|
|
1365
|
-
|
|
1366
|
-
/**
|
|
1367
|
-
* @fileoverview added by tsickle
|
|
1368
|
-
* Generated from: libs/validate/email/email.ts
|
|
1369
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1370
|
-
*/
|
|
1371
|
-
/**
|
|
1372
|
-
* @param {?} value
|
|
1373
|
-
* @return {?}
|
|
1374
|
-
*/
|
|
1375
|
-
function email(value) {
|
|
1376
|
-
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,}))$/);
|
|
617
|
+
class FsFormatNumberPipe {
|
|
618
|
+
transform(value, decimals) {
|
|
619
|
+
return number(value, decimals);
|
|
620
|
+
}
|
|
1377
621
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
/**
|
|
1391
|
-
* @param {?} value
|
|
1392
|
-
* @return {?}
|
|
1393
|
-
*/
|
|
1394
|
-
function phone(value) {
|
|
1395
|
-
/** @type {?} */
|
|
1396
|
-
const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
|
|
1397
|
-
return valid || !String(value).length;
|
|
622
|
+
FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
623
|
+
FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
|
|
625
|
+
type: Pipe,
|
|
626
|
+
args: [{
|
|
627
|
+
name: 'fsFormatNumber'
|
|
628
|
+
}]
|
|
629
|
+
}] });
|
|
630
|
+
|
|
631
|
+
function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
|
|
632
|
+
const digitsInfo = isArray(precision) ? precision : [precision, precision];
|
|
633
|
+
return new CurrencyPipe(locale).transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
|
|
1398
634
|
}
|
|
1399
635
|
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
* @fileoverview added by tsickle
|
|
1408
|
-
* Generated from: libs/validate/url/url.ts
|
|
1409
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1410
|
-
*/
|
|
1411
|
-
/**
|
|
1412
|
-
* Check validity of the url.
|
|
1413
|
-
* Protocol (http/https) isn't required.
|
|
1414
|
-
* @param value
|
|
1415
|
-
* @returns {boolean}
|
|
1416
|
-
*/
|
|
1417
|
-
/**
|
|
1418
|
-
* @param {?} value
|
|
1419
|
-
* @return {?}
|
|
1420
|
-
*/
|
|
1421
|
-
function url(value) {
|
|
1422
|
-
/** @type {?} */
|
|
1423
|
-
const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
|
|
1424
|
-
/** @type {?} */
|
|
1425
|
-
const regexp = new RegExp(expression);
|
|
1426
|
-
return !!String(value).match(regexp);
|
|
636
|
+
class FsFormatCurrencyPipe {
|
|
637
|
+
constructor(locale) {
|
|
638
|
+
this.locale = locale;
|
|
639
|
+
}
|
|
640
|
+
transform(amount, precision, currencyCode) {
|
|
641
|
+
return currency(amount, precision, currencyCode);
|
|
642
|
+
}
|
|
1427
643
|
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
*/
|
|
1451
|
-
function compare(query, item) {
|
|
1452
|
-
/** @type {?} */
|
|
1453
|
-
let value = true;
|
|
1454
|
-
for (const key in query) {
|
|
1455
|
-
value = value && item[key] == query[key];
|
|
1456
|
-
}
|
|
1457
|
-
return value;
|
|
644
|
+
FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
645
|
+
FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
|
|
646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
|
|
647
|
+
type: Pipe,
|
|
648
|
+
args: [{
|
|
649
|
+
name: 'fsFormatCurrency'
|
|
650
|
+
}]
|
|
651
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
652
|
+
type: Inject,
|
|
653
|
+
args: [LOCALE_ID]
|
|
654
|
+
}] }]; } });
|
|
655
|
+
|
|
656
|
+
function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
|
|
657
|
+
value = value || '';
|
|
658
|
+
if (completeWords) {
|
|
659
|
+
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
660
|
+
}
|
|
661
|
+
let result = `${value.substr(0, limit)}`;
|
|
662
|
+
if (result !== value) {
|
|
663
|
+
result += ellipsis;
|
|
664
|
+
}
|
|
665
|
+
return result;
|
|
1458
666
|
}
|
|
1459
667
|
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* @fileoverview added by tsickle
|
|
1468
|
-
* Generated from: libs/array/filter/filter.ts
|
|
1469
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1470
|
-
*/
|
|
1471
|
-
/**
|
|
1472
|
-
* @param {?} array
|
|
1473
|
-
* @param {?} query
|
|
1474
|
-
* @return {?}
|
|
1475
|
-
*/
|
|
1476
|
-
function filter(array, query) {
|
|
1477
|
-
if (typeof query !== 'function') {
|
|
1478
|
-
/** @type {?} */
|
|
1479
|
-
const queryObj = query;
|
|
1480
|
-
query = (/**
|
|
1481
|
-
* @param {?} item
|
|
1482
|
-
* @return {?}
|
|
1483
|
-
*/
|
|
1484
|
-
(item) => {
|
|
1485
|
-
return compare(queryObj, item);
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
/** @type {?} */
|
|
1489
|
-
const isarray = Array.isArray(array);
|
|
1490
|
-
/** @type {?} */
|
|
1491
|
-
const list = isarray ? [] : {};
|
|
1492
|
-
if (isarray) {
|
|
1493
|
-
array.forEach((/**
|
|
1494
|
-
* @param {?} item
|
|
1495
|
-
* @param {?} idx
|
|
1496
|
-
* @return {?}
|
|
1497
|
-
*/
|
|
1498
|
-
function (item, idx) {
|
|
1499
|
-
if (query(item)) {
|
|
1500
|
-
list.push(item);
|
|
1501
|
-
}
|
|
1502
|
-
}));
|
|
1503
|
-
}
|
|
1504
|
-
else {
|
|
1505
|
-
Object.keys(array).forEach((/**
|
|
1506
|
-
* @param {?} key
|
|
1507
|
-
* @return {?}
|
|
1508
|
-
*/
|
|
1509
|
-
key => {
|
|
1510
|
-
if (query(array[key])) {
|
|
1511
|
-
list[key] = array[key];
|
|
1512
|
-
}
|
|
1513
|
-
}));
|
|
1514
|
-
}
|
|
1515
|
-
return list;
|
|
668
|
+
class FsFormatTruncatePipe {
|
|
669
|
+
constructor() { }
|
|
670
|
+
transform(value, limit, completeWords, ellipsis) {
|
|
671
|
+
return truncate(value, limit, completeWords, ellipsis);
|
|
672
|
+
}
|
|
1516
673
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
values = [values];
|
|
1537
|
-
}
|
|
1538
|
-
for (let i = 0, len = values.length; i < len; i++) {
|
|
1539
|
-
if (array.indexOf(values[i]) >= 0) {
|
|
1540
|
-
return true;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
return false;
|
|
674
|
+
FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
675
|
+
FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
|
|
676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
|
|
677
|
+
type: Pipe,
|
|
678
|
+
args: [{
|
|
679
|
+
name: 'fsFormatTruncate'
|
|
680
|
+
}]
|
|
681
|
+
}], ctorParameters: function () { return []; } });
|
|
682
|
+
|
|
683
|
+
function bytes(bytes) {
|
|
684
|
+
if (!bytes) {
|
|
685
|
+
return '0.00 B';
|
|
686
|
+
}
|
|
687
|
+
const e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
688
|
+
const decimals = (bytes / 1024) > 1000 ? 2 : 0;
|
|
689
|
+
console.log(bytes, (bytes / 1024), decimals);
|
|
690
|
+
return `${(bytes / Math.pow(1024, e)).toFixed(decimals)}`.replace(/\.00/, '')
|
|
691
|
+
+ ' '
|
|
692
|
+
+ (e ? ' KMGTP'.charAt(e) : '') + 'B';
|
|
1544
693
|
}
|
|
1545
694
|
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
*/
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
* @fileoverview added by tsickle
|
|
1554
|
-
* Generated from: libs/array/index/index.ts
|
|
1555
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1556
|
-
*/
|
|
1557
|
-
/**
|
|
1558
|
-
* @param {?} array
|
|
1559
|
-
* @param {?} name
|
|
1560
|
-
* @param {?=} value
|
|
1561
|
-
* @return {?}
|
|
1562
|
-
*/
|
|
1563
|
-
function index(array, name, value = null) {
|
|
1564
|
-
/** @type {?} */
|
|
1565
|
-
const list = {};
|
|
1566
|
-
array.forEach((/**
|
|
1567
|
-
* @param {?} item
|
|
1568
|
-
* @return {?}
|
|
1569
|
-
*/
|
|
1570
|
-
function (item) {
|
|
1571
|
-
list[item[name]] = value ? item[value] : item;
|
|
1572
|
-
}));
|
|
1573
|
-
return list;
|
|
695
|
+
class FsFormatBytesPipe {
|
|
696
|
+
transform(value) {
|
|
697
|
+
return bytes(value);
|
|
698
|
+
}
|
|
1574
699
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
/** @type {?} */
|
|
1589
|
-
const queryObj = query;
|
|
1590
|
-
query = (/**
|
|
1591
|
-
* @param {?} item
|
|
1592
|
-
* @return {?}
|
|
1593
|
-
*/
|
|
1594
|
-
(item) => {
|
|
1595
|
-
return compare(queryObj, item);
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
1599
|
-
if (query(array[i])) {
|
|
1600
|
-
return i;
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
return -1;
|
|
700
|
+
FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
701
|
+
FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
|
|
702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
|
|
703
|
+
type: Pipe,
|
|
704
|
+
args: [{
|
|
705
|
+
name: 'fsFormatBytes',
|
|
706
|
+
}]
|
|
707
|
+
}] });
|
|
708
|
+
|
|
709
|
+
class FsStopPropagationDirective {
|
|
710
|
+
preventClick(event) {
|
|
711
|
+
event.stopPropagation();
|
|
712
|
+
}
|
|
1604
713
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
*/
|
|
1622
|
-
function keyExists(array, key) {
|
|
1623
|
-
return array.hasOwnProperty(key);
|
|
714
|
+
FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
715
|
+
FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
|
|
716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
|
|
717
|
+
type: Directive,
|
|
718
|
+
args: [{
|
|
719
|
+
selector: '[fsStopPropagation]',
|
|
720
|
+
}]
|
|
721
|
+
}], propDecorators: { preventClick: [{
|
|
722
|
+
type: HostListener,
|
|
723
|
+
args: ['click', ['$event']]
|
|
724
|
+
}] } });
|
|
725
|
+
|
|
726
|
+
class FsPreventDefaultDirective {
|
|
727
|
+
preventClick(event) {
|
|
728
|
+
event.preventDefault();
|
|
729
|
+
}
|
|
1624
730
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
function (key) {
|
|
1647
|
-
/** @type {?} */
|
|
1648
|
-
const value = unordered[key];
|
|
1649
|
-
delete unordered[key];
|
|
1650
|
-
unordered[key] = value;
|
|
1651
|
-
}));
|
|
731
|
+
FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
732
|
+
FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
|
|
733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
|
|
734
|
+
type: Directive,
|
|
735
|
+
args: [{
|
|
736
|
+
selector: '[fsPreventDefault]',
|
|
737
|
+
}]
|
|
738
|
+
}], propDecorators: { preventClick: [{
|
|
739
|
+
type: HostListener,
|
|
740
|
+
args: ['click', ['$event']]
|
|
741
|
+
}] } });
|
|
742
|
+
|
|
743
|
+
class FsAutofocusDirective {
|
|
744
|
+
constructor(_el) {
|
|
745
|
+
this._el = _el;
|
|
746
|
+
}
|
|
747
|
+
ngAfterViewInit() {
|
|
748
|
+
setTimeout(() => {
|
|
749
|
+
this._el.nativeElement.focus();
|
|
750
|
+
});
|
|
751
|
+
}
|
|
1652
752
|
}
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
* @param {?=} index
|
|
1669
|
-
* @return {?}
|
|
1670
|
-
*/
|
|
1671
|
-
function list(array, property, index = null) {
|
|
1672
|
-
/** @type {?} */
|
|
1673
|
-
const resultList = index ? {} : [];
|
|
1674
|
-
array.forEach((/**
|
|
1675
|
-
* @param {?} item
|
|
1676
|
-
* @param {?} idx
|
|
1677
|
-
* @return {?}
|
|
1678
|
-
*/
|
|
1679
|
-
function (item, idx) {
|
|
1680
|
-
if (index) {
|
|
1681
|
-
resultList[item[index]] = item[property];
|
|
1682
|
-
}
|
|
1683
|
-
else {
|
|
1684
|
-
resultList.push(item[property]);
|
|
1685
|
-
}
|
|
1686
|
-
}));
|
|
1687
|
-
return resultList;
|
|
753
|
+
FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAutofocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
754
|
+
FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsAutofocusDirective, selector: "[autofocus]", ngImport: i0 });
|
|
755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAutofocusDirective, decorators: [{
|
|
756
|
+
type: Directive,
|
|
757
|
+
args: [{
|
|
758
|
+
selector: '[autofocus]',
|
|
759
|
+
}]
|
|
760
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
761
|
+
|
|
762
|
+
function ordinalNumber(value) {
|
|
763
|
+
value = String(value);
|
|
764
|
+
const index = value.match `1?.$`;
|
|
765
|
+
const endings = [, 'st', 'nd', 'rd'];
|
|
766
|
+
const ending = endings[index] || 'th';
|
|
767
|
+
return value + ending;
|
|
1688
768
|
}
|
|
1689
769
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
*/
|
|
1695
|
-
|
|
1696
|
-
/**
|
|
1697
|
-
* @fileoverview added by tsickle
|
|
1698
|
-
* Generated from: libs/array/nameValue/nameValue.ts
|
|
1699
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1700
|
-
*/
|
|
1701
|
-
/**
|
|
1702
|
-
* @param {?} array
|
|
1703
|
-
* @param {?} name
|
|
1704
|
-
* @param {?} value
|
|
1705
|
-
* @return {?}
|
|
1706
|
-
*/
|
|
1707
|
-
function nameValue(array, name, value) {
|
|
1708
|
-
/** @type {?} */
|
|
1709
|
-
const list = [];
|
|
1710
|
-
if (name || value) {
|
|
1711
|
-
/** @type {?} */
|
|
1712
|
-
const nameFn = typeof name === 'function' ? name : (/**
|
|
1713
|
-
* @param {?} item
|
|
1714
|
-
* @return {?}
|
|
1715
|
-
*/
|
|
1716
|
-
function (item) {
|
|
1717
|
-
return item[name];
|
|
1718
|
-
});
|
|
1719
|
-
/** @type {?} */
|
|
1720
|
-
const valueFn = typeof value === 'function' ? value : (/**
|
|
1721
|
-
* @param {?} item
|
|
1722
|
-
* @return {?}
|
|
1723
|
-
*/
|
|
1724
|
-
function (item) {
|
|
1725
|
-
return item[value];
|
|
1726
|
-
});
|
|
1727
|
-
array.forEach((/**
|
|
1728
|
-
* @param {?} item
|
|
1729
|
-
* @return {?}
|
|
1730
|
-
*/
|
|
1731
|
-
function (item) {
|
|
1732
|
-
list.push({ name: nameFn(item), value: valueFn(item) });
|
|
1733
|
-
}));
|
|
1734
|
-
}
|
|
1735
|
-
else {
|
|
1736
|
-
array.forEach((/**
|
|
1737
|
-
* @param {?} n
|
|
1738
|
-
* @param {?} v
|
|
1739
|
-
* @return {?}
|
|
1740
|
-
*/
|
|
1741
|
-
function (n, v) {
|
|
1742
|
-
list.push({ name: n, value: v });
|
|
1743
|
-
}));
|
|
1744
|
-
}
|
|
1745
|
-
return list;
|
|
770
|
+
class FsFormatOrdinalNumberPipe {
|
|
771
|
+
transform(value) {
|
|
772
|
+
return ordinalNumber(value);
|
|
773
|
+
}
|
|
1746
774
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
return array.splice(idx, 1);
|
|
1769
|
-
}
|
|
1770
|
-
return idx;
|
|
775
|
+
FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
776
|
+
FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
|
|
778
|
+
type: Pipe,
|
|
779
|
+
args: [{
|
|
780
|
+
name: 'fsFormatOrdinalNumber',
|
|
781
|
+
}]
|
|
782
|
+
}] });
|
|
783
|
+
|
|
784
|
+
class FsCommonModule {
|
|
785
|
+
static forRoot() {
|
|
786
|
+
return {
|
|
787
|
+
ngModule: FsCommonModule,
|
|
788
|
+
providers: [
|
|
789
|
+
FsArray,
|
|
790
|
+
FsMath,
|
|
791
|
+
FsUtil,
|
|
792
|
+
FsValidate
|
|
793
|
+
]
|
|
794
|
+
};
|
|
795
|
+
}
|
|
1771
796
|
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
797
|
+
FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
798
|
+
FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
|
|
799
|
+
FsPreventDefaultDirective,
|
|
800
|
+
FsAutofocusDirective,
|
|
801
|
+
FsUtilGuidPipe,
|
|
802
|
+
FsUtilIsEmptyPipe,
|
|
803
|
+
FsUtilIsNotEmptyPipe,
|
|
804
|
+
FsUtilStringifyPipe,
|
|
805
|
+
FsFormatNumberPipe,
|
|
806
|
+
FsFormatCurrencyPipe,
|
|
807
|
+
FsFormatTruncatePipe,
|
|
808
|
+
FsFormatBytesPipe,
|
|
809
|
+
FsFormatOrdinalNumberPipe], imports: [CommonModule], exports: [FsStopPropagationDirective,
|
|
810
|
+
FsPreventDefaultDirective,
|
|
811
|
+
FsAutofocusDirective,
|
|
812
|
+
FsUtilGuidPipe,
|
|
813
|
+
FsUtilStringifyPipe,
|
|
814
|
+
FsFormatNumberPipe,
|
|
815
|
+
FsFormatCurrencyPipe,
|
|
816
|
+
FsFormatTruncatePipe,
|
|
817
|
+
FsUtilIsEmptyPipe,
|
|
818
|
+
FsUtilIsNotEmptyPipe,
|
|
819
|
+
FsFormatBytesPipe,
|
|
820
|
+
FsFormatOrdinalNumberPipe] });
|
|
821
|
+
FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, imports: [[
|
|
822
|
+
CommonModule,
|
|
823
|
+
]] });
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, decorators: [{
|
|
825
|
+
type: NgModule,
|
|
826
|
+
args: [{
|
|
827
|
+
imports: [
|
|
828
|
+
CommonModule,
|
|
829
|
+
],
|
|
830
|
+
exports: [
|
|
831
|
+
FsStopPropagationDirective,
|
|
832
|
+
FsPreventDefaultDirective,
|
|
833
|
+
FsAutofocusDirective,
|
|
834
|
+
FsUtilGuidPipe,
|
|
835
|
+
FsUtilStringifyPipe,
|
|
836
|
+
FsFormatNumberPipe,
|
|
837
|
+
FsFormatCurrencyPipe,
|
|
838
|
+
FsFormatTruncatePipe,
|
|
839
|
+
FsUtilIsEmptyPipe,
|
|
840
|
+
FsUtilIsNotEmptyPipe,
|
|
841
|
+
FsFormatBytesPipe,
|
|
842
|
+
FsFormatOrdinalNumberPipe,
|
|
843
|
+
],
|
|
844
|
+
declarations: [
|
|
845
|
+
FsStopPropagationDirective,
|
|
846
|
+
FsPreventDefaultDirective,
|
|
847
|
+
FsAutofocusDirective,
|
|
848
|
+
FsUtilGuidPipe,
|
|
849
|
+
FsUtilIsEmptyPipe,
|
|
850
|
+
FsUtilIsNotEmptyPipe,
|
|
851
|
+
FsUtilStringifyPipe,
|
|
852
|
+
FsFormatNumberPipe,
|
|
853
|
+
FsFormatCurrencyPipe,
|
|
854
|
+
FsFormatTruncatePipe,
|
|
855
|
+
FsFormatBytesPipe,
|
|
856
|
+
FsFormatOrdinalNumberPipe,
|
|
857
|
+
],
|
|
858
|
+
}]
|
|
859
|
+
}] });
|
|
860
|
+
|
|
861
|
+
function email(value) {
|
|
862
|
+
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,}))$/);
|
|
1821
863
|
}
|
|
1822
864
|
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1827
|
-
*/
|
|
1828
|
-
|
|
1829
|
-
/**
|
|
1830
|
-
* @fileoverview added by tsickle
|
|
1831
|
-
* Generated from: libs/array/rsort/rsort.ts
|
|
1832
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1833
|
-
*/
|
|
1834
|
-
/**
|
|
1835
|
-
* @param {?} array
|
|
1836
|
-
* @param {?} query
|
|
1837
|
-
* @return {?}
|
|
1838
|
-
*/
|
|
1839
|
-
function rsort(array, query) {
|
|
1840
|
-
return sort(array, query, true);
|
|
865
|
+
function phone(value) {
|
|
866
|
+
const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
|
|
867
|
+
return valid || !String(value).length;
|
|
1841
868
|
}
|
|
1842
869
|
|
|
1843
|
-
/**
|
|
1844
|
-
*
|
|
1845
|
-
*
|
|
1846
|
-
* @
|
|
870
|
+
/**
|
|
871
|
+
* Check validity of the url.
|
|
872
|
+
* Protocol (http/https) isn't required.
|
|
873
|
+
* @param value
|
|
874
|
+
* @returns {boolean}
|
|
1847
875
|
*/
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1853
|
-
*/
|
|
1854
|
-
/**
|
|
1855
|
-
* @param {?} array
|
|
1856
|
-
* @param {?} query
|
|
1857
|
-
* @return {?}
|
|
1858
|
-
*/
|
|
1859
|
-
function find(array, query) {
|
|
1860
|
-
/** @type {?} */
|
|
1861
|
-
const data = filter(array, query);
|
|
1862
|
-
return data.length ? data[0] : null;
|
|
876
|
+
function url(value) {
|
|
877
|
+
const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
|
|
878
|
+
const regexp = new RegExp(expression);
|
|
879
|
+
return !!String(value).match(regexp);
|
|
1863
880
|
}
|
|
1864
881
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
/**
|
|
1872
|
-
* @fileoverview added by tsickle
|
|
1873
|
-
* Generated from: libs/array/index.ts
|
|
1874
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1875
|
-
*/
|
|
1876
|
-
|
|
1877
|
-
/**
|
|
1878
|
-
* @fileoverview added by tsickle
|
|
1879
|
-
* Generated from: libs/util/boolean/boolean.ts
|
|
1880
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1881
|
-
*/
|
|
1882
|
-
/**
|
|
1883
|
-
* @param {?} value
|
|
1884
|
-
* @return {?}
|
|
1885
|
-
*/
|
|
1886
|
-
function boolean(value) {
|
|
1887
|
-
return toString(value).toLowerCase() !== 'false' && !!value;
|
|
882
|
+
function compare(query, item) {
|
|
883
|
+
let value = true;
|
|
884
|
+
for (const key in query) {
|
|
885
|
+
value = value && item[key] == query[key];
|
|
886
|
+
}
|
|
887
|
+
return value;
|
|
1888
888
|
}
|
|
1889
889
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
/** @type {?} */
|
|
1915
|
-
const context = this;
|
|
1916
|
-
/** @type {?} */
|
|
1917
|
-
const args = arguments;
|
|
1918
|
-
/** @type {?} */
|
|
1919
|
-
const later = (/**
|
|
1920
|
-
* @return {?}
|
|
1921
|
-
*/
|
|
1922
|
-
function () {
|
|
1923
|
-
timeout = null;
|
|
1924
|
-
if (!immediate)
|
|
1925
|
-
func.apply(context, args);
|
|
1926
|
-
});
|
|
1927
|
-
/** @type {?} */
|
|
1928
|
-
const callNow = immediate && !timeout;
|
|
1929
|
-
clearTimeout(timeout);
|
|
1930
|
-
timeout = setTimeout(later, wait);
|
|
1931
|
-
if (callNow)
|
|
1932
|
-
func.apply(context, args);
|
|
1933
|
-
});
|
|
890
|
+
function filter(array, query) {
|
|
891
|
+
if (typeof query !== 'function') {
|
|
892
|
+
const queryObj = query;
|
|
893
|
+
query = (item) => {
|
|
894
|
+
return compare(queryObj, item);
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
const isarray = Array.isArray(array);
|
|
898
|
+
const list = isarray ? [] : {};
|
|
899
|
+
if (isarray) {
|
|
900
|
+
array.forEach(function (item, idx) {
|
|
901
|
+
if (query(item)) {
|
|
902
|
+
list.push(item);
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
Object.keys(array).forEach(key => {
|
|
908
|
+
if (query(array[key])) {
|
|
909
|
+
list[key] = array[key];
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
return list;
|
|
1934
914
|
}
|
|
1935
915
|
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
*/
|
|
1947
|
-
|
|
1948
|
-
/**
|
|
1949
|
-
* @fileoverview added by tsickle
|
|
1950
|
-
* Generated from: libs/util/keys/keys.ts
|
|
1951
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1952
|
-
*/
|
|
1953
|
-
/** @type {?} */
|
|
1954
|
-
const KEY_CANCEL$1 = 3;
|
|
1955
|
-
/** @type {?} */
|
|
1956
|
-
const KEY_HELP$1 = 6;
|
|
1957
|
-
/** @type {?} */
|
|
1958
|
-
const KEY_BACKSPACE$1 = 8;
|
|
1959
|
-
/** @type {?} */
|
|
1960
|
-
const KEY_TAB$1 = 9;
|
|
1961
|
-
/** @type {?} */
|
|
1962
|
-
const KEY_CLEAR$1 = 12;
|
|
1963
|
-
/** @type {?} */
|
|
1964
|
-
const KEY_RETURN$1 = 13;
|
|
1965
|
-
/** @type {?} */
|
|
1966
|
-
const KEY_ENTER$1 = 14;
|
|
1967
|
-
/** @type {?} */
|
|
1968
|
-
const KEY_SHIFT$1 = 16;
|
|
1969
|
-
/** @type {?} */
|
|
1970
|
-
const KEY_CONTROL$1 = 17;
|
|
1971
|
-
/** @type {?} */
|
|
1972
|
-
const KEY_ALT$1 = 18;
|
|
1973
|
-
/** @type {?} */
|
|
1974
|
-
const KEY_PAUSE$1 = 19;
|
|
1975
|
-
/** @type {?} */
|
|
1976
|
-
const KEY_CAPS_LOCK$1 = 20;
|
|
1977
|
-
/** @type {?} */
|
|
1978
|
-
const KEY_ESCAPE$1 = 27;
|
|
1979
|
-
/** @type {?} */
|
|
1980
|
-
const KEY_SPACE$1 = 32;
|
|
1981
|
-
/** @type {?} */
|
|
1982
|
-
const KEY_PAGE_UP$1 = 33;
|
|
1983
|
-
/** @type {?} */
|
|
1984
|
-
const KEY_PAGE_DOWN$1 = 34;
|
|
1985
|
-
/** @type {?} */
|
|
1986
|
-
const KEY_END$1 = 35;
|
|
1987
|
-
/** @type {?} */
|
|
1988
|
-
const KEY_HOME$1 = 36;
|
|
1989
|
-
/** @type {?} */
|
|
1990
|
-
const KEY_LEFT$1 = 37;
|
|
1991
|
-
/** @type {?} */
|
|
1992
|
-
const KEY_UP$1 = 38;
|
|
1993
|
-
/** @type {?} */
|
|
1994
|
-
const KEY_RIGHT$1 = 39;
|
|
1995
|
-
/** @type {?} */
|
|
1996
|
-
const KEY_DOWN$1 = 40;
|
|
1997
|
-
/** @type {?} */
|
|
1998
|
-
const KEY_PRINTSCREEN$1 = 44;
|
|
1999
|
-
/** @type {?} */
|
|
2000
|
-
const KEY_INSERT$1 = 45;
|
|
2001
|
-
/** @type {?} */
|
|
2002
|
-
const KEY_DELETE$1 = 46;
|
|
2003
|
-
/** @type {?} */
|
|
2004
|
-
const KEY_0$1 = 48;
|
|
2005
|
-
/** @type {?} */
|
|
2006
|
-
const KEY_1$1 = 49;
|
|
2007
|
-
/** @type {?} */
|
|
2008
|
-
const KEY_2$1 = 50;
|
|
2009
|
-
/** @type {?} */
|
|
2010
|
-
const KEY_3$1 = 51;
|
|
2011
|
-
/** @type {?} */
|
|
2012
|
-
const KEY_4$1 = 52;
|
|
2013
|
-
/** @type {?} */
|
|
2014
|
-
const KEY_5$1 = 53;
|
|
2015
|
-
/** @type {?} */
|
|
2016
|
-
const KEY_6$1 = 54;
|
|
2017
|
-
/** @type {?} */
|
|
2018
|
-
const KEY_7$1 = 55;
|
|
2019
|
-
/** @type {?} */
|
|
2020
|
-
const KEY_8$1 = 56;
|
|
2021
|
-
/** @type {?} */
|
|
2022
|
-
const KEY_9$1 = 57;
|
|
2023
|
-
/** @type {?} */
|
|
2024
|
-
const KEY_SEMICOLON$1 = 59;
|
|
2025
|
-
/** @type {?} */
|
|
2026
|
-
const KEY_EQUALS$1 = 61;
|
|
2027
|
-
|
|
2028
|
-
/**
|
|
2029
|
-
* @fileoverview added by tsickle
|
|
2030
|
-
* Generated from: libs/util/keys/index.ts
|
|
2031
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2032
|
-
*/
|
|
2033
|
-
|
|
2034
|
-
/**
|
|
2035
|
-
* @fileoverview added by tsickle
|
|
2036
|
-
* Generated from: libs/util/length/length.ts
|
|
2037
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2038
|
-
*/
|
|
2039
|
-
/**
|
|
2040
|
-
* @param {?} object
|
|
2041
|
-
* @return {?}
|
|
2042
|
-
*/
|
|
2043
|
-
function length(object) {
|
|
2044
|
-
if (isObject(object)) {
|
|
2045
|
-
return Object.keys(object).length;
|
|
2046
|
-
}
|
|
2047
|
-
if (isArray(object)) {
|
|
2048
|
-
return object.length;
|
|
2049
|
-
}
|
|
2050
|
-
return 0;
|
|
916
|
+
function inArray(values, array) {
|
|
917
|
+
if (!Array.isArray(values)) {
|
|
918
|
+
values = [values];
|
|
919
|
+
}
|
|
920
|
+
for (let i = 0, len = values.length; i < len; i++) {
|
|
921
|
+
if (array.indexOf(values[i]) >= 0) {
|
|
922
|
+
return true;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return false;
|
|
2051
926
|
}
|
|
2052
927
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
/**
|
|
2060
|
-
* @fileoverview added by tsickle
|
|
2061
|
-
* Generated from: libs/util/resolve/resolve.ts
|
|
2062
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2063
|
-
*/
|
|
2064
|
-
/**
|
|
2065
|
-
* @param {?} promise
|
|
2066
|
-
* @param {?=} defaults
|
|
2067
|
-
* @return {?}
|
|
2068
|
-
*/
|
|
2069
|
-
function resolve(promise, defaults = []) {
|
|
2070
|
-
/** @type {?} */
|
|
2071
|
-
const result = defaults;
|
|
2072
|
-
return new Promise((/**
|
|
2073
|
-
* @param {?} resolve
|
|
2074
|
-
* @return {?}
|
|
2075
|
-
*/
|
|
2076
|
-
resolve => {
|
|
2077
|
-
promise.then((/**
|
|
2078
|
-
* @param {?} data
|
|
2079
|
-
* @return {?}
|
|
2080
|
-
*/
|
|
2081
|
-
function (data) {
|
|
2082
|
-
Object.keys(data).forEach((/**
|
|
2083
|
-
* @param {?} key
|
|
2084
|
-
* @return {?}
|
|
2085
|
-
*/
|
|
2086
|
-
key => result[key] = data[key]));
|
|
2087
|
-
resolve(result);
|
|
2088
|
-
}));
|
|
2089
|
-
}));
|
|
928
|
+
function index(array, name, value = null) {
|
|
929
|
+
const list = {};
|
|
930
|
+
array.forEach(function (item) {
|
|
931
|
+
list[item[name]] = value ? item[value] : item;
|
|
932
|
+
});
|
|
933
|
+
return list;
|
|
2090
934
|
}
|
|
2091
935
|
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
* @fileoverview added by tsickle
|
|
2106
|
-
* Generated from: libs/util/uuid/uuid.ts
|
|
2107
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2108
|
-
*/
|
|
2109
|
-
/**
|
|
2110
|
-
* @return {?}
|
|
2111
|
-
*/
|
|
2112
|
-
function uuid() {
|
|
2113
|
-
return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
936
|
+
function indexOf(array, query) {
|
|
937
|
+
if (typeof query !== 'function') {
|
|
938
|
+
const queryObj = query;
|
|
939
|
+
query = (item) => {
|
|
940
|
+
return compare(queryObj, item);
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
944
|
+
if (query(array[i])) {
|
|
945
|
+
return i;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return -1;
|
|
2114
949
|
}
|
|
2115
950
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
* Generated from: libs/util/uuid/index.ts
|
|
2119
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2120
|
-
*/
|
|
2121
|
-
|
|
2122
|
-
/**
|
|
2123
|
-
* @fileoverview added by tsickle
|
|
2124
|
-
* Generated from: libs/util/value/value.ts
|
|
2125
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2126
|
-
*/
|
|
2127
|
-
/**
|
|
2128
|
-
* @param {?} object
|
|
2129
|
-
* @param {?} key
|
|
2130
|
-
* @param {?} def
|
|
2131
|
-
* @return {?}
|
|
2132
|
-
*/
|
|
2133
|
-
function value(object, key, def) {
|
|
2134
|
-
if (typeof object === 'object' || Array.isArray(object)) {
|
|
2135
|
-
if (object.hasOwnProperty(key)) {
|
|
2136
|
-
return object[key];
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
return def;
|
|
951
|
+
function keyExists(array, key) {
|
|
952
|
+
return array.hasOwnProperty(key);
|
|
2140
953
|
}
|
|
2141
954
|
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
/**
|
|
2149
|
-
* @fileoverview added by tsickle
|
|
2150
|
-
* Generated from: libs/util/isClass/isClass.ts
|
|
2151
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2152
|
-
*/
|
|
2153
|
-
/**
|
|
2154
|
-
* @param {?} value
|
|
2155
|
-
* @param {?} cls
|
|
2156
|
-
* @return {?}
|
|
2157
|
-
*/
|
|
2158
|
-
function isClass(value, cls) {
|
|
2159
|
-
if (typeof value === 'object') {
|
|
2160
|
-
if (typeof cls === 'string') {
|
|
2161
|
-
if (value.constructor) {
|
|
2162
|
-
if (value.constructor.name === cls) {
|
|
2163
|
-
return true;
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
|
-
else {
|
|
2168
|
-
if (value instanceof cls) {
|
|
2169
|
-
return true;
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
return false;
|
|
955
|
+
function ksort(unordered) {
|
|
956
|
+
Object.keys(unordered).sort().forEach(function (key) {
|
|
957
|
+
const value = unordered[key];
|
|
958
|
+
delete unordered[key];
|
|
959
|
+
unordered[key] = value;
|
|
960
|
+
});
|
|
2174
961
|
}
|
|
2175
962
|
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
* @param {?} value
|
|
2189
|
-
* @return {?}
|
|
2190
|
-
*/
|
|
2191
|
-
function isNumeric(value) {
|
|
2192
|
-
/** @type {?} */
|
|
2193
|
-
const str = toString(value);
|
|
2194
|
-
return str.length && !!str.match(/^-?\d*\.?\d*$/);
|
|
963
|
+
function list(array, property, index = null) {
|
|
964
|
+
const resultList = index ? {} : [];
|
|
965
|
+
array.forEach(function (item, idx) {
|
|
966
|
+
if (index) {
|
|
967
|
+
resultList[item[index]] = item[property];
|
|
968
|
+
}
|
|
969
|
+
else {
|
|
970
|
+
resultList.push(item[property]);
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
return resultList;
|
|
2195
974
|
}
|
|
2196
975
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
* @param {?} wait
|
|
2217
|
-
* @return {?}
|
|
2218
|
-
*/
|
|
2219
|
-
function throttle(func, wait) {
|
|
2220
|
-
/** @type {?} */
|
|
2221
|
-
let waiting = false;
|
|
2222
|
-
return (/**
|
|
2223
|
-
* @return {?}
|
|
2224
|
-
*/
|
|
2225
|
-
function () {
|
|
2226
|
-
if (!waiting) { // If we're not waiting
|
|
2227
|
-
func.apply(null, arguments); // Execute users function
|
|
2228
|
-
waiting = true; // Prevent future invocations
|
|
2229
|
-
setTimeout((/**
|
|
2230
|
-
* @return {?}
|
|
2231
|
-
*/
|
|
2232
|
-
function () {
|
|
2233
|
-
waiting = false; // And allow future invocations
|
|
2234
|
-
}), wait);
|
|
2235
|
-
}
|
|
2236
|
-
});
|
|
976
|
+
function nameValue(array, name, value) {
|
|
977
|
+
const list = [];
|
|
978
|
+
if (name || value) {
|
|
979
|
+
const nameFn = typeof name === 'function' ? name : function (item) {
|
|
980
|
+
return item[name];
|
|
981
|
+
};
|
|
982
|
+
const valueFn = typeof value === 'function' ? value : function (item) {
|
|
983
|
+
return item[value];
|
|
984
|
+
};
|
|
985
|
+
array.forEach(function (item) {
|
|
986
|
+
list.push({ name: nameFn(item), value: valueFn(item) });
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
array.forEach(function (n, v) {
|
|
991
|
+
list.push({ name: n, value: v });
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
return list;
|
|
2237
995
|
}
|
|
2238
996
|
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
997
|
+
function remove(array, query) {
|
|
998
|
+
const idx = indexOf(array, query);
|
|
999
|
+
if (idx >= 0) {
|
|
1000
|
+
return array.splice(idx, 1);
|
|
1001
|
+
}
|
|
1002
|
+
return idx;
|
|
1003
|
+
}
|
|
2244
1004
|
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
Operation.prototype.target;
|
|
2271
|
-
/** @type {?} */
|
|
2272
|
-
Operation.prototype.ready$;
|
|
1005
|
+
function sort(array, query, reverse = false) {
|
|
1006
|
+
if (typeof query !== 'function') {
|
|
1007
|
+
const queryStr = query;
|
|
1008
|
+
query = function (a, b) {
|
|
1009
|
+
if (reverse) {
|
|
1010
|
+
if (a[queryStr] < b[queryStr]) {
|
|
1011
|
+
return 1;
|
|
1012
|
+
}
|
|
1013
|
+
else if (a[queryStr] > b[queryStr]) {
|
|
1014
|
+
return -1;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
else {
|
|
1018
|
+
if (a[queryStr] > b[queryStr]) {
|
|
1019
|
+
return 1;
|
|
1020
|
+
}
|
|
1021
|
+
else if (a[queryStr] < b[queryStr]) {
|
|
1022
|
+
return -1;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
return 0;
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
array.sort(query);
|
|
1029
|
+
return array;
|
|
2273
1030
|
}
|
|
2274
1031
|
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2279
|
-
*/
|
|
2280
|
-
/** @enum {string} */
|
|
2281
|
-
const QueueState = {
|
|
2282
|
-
Idle: "idle",
|
|
2283
|
-
Processing: "processing",
|
|
2284
|
-
};
|
|
1032
|
+
function rsort(array, query) {
|
|
1033
|
+
return sort(array, query, true);
|
|
1034
|
+
}
|
|
2285
1035
|
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2290
|
-
*/
|
|
2291
|
-
class Queue {
|
|
2292
|
-
/**
|
|
2293
|
-
* @param {?=} _limit
|
|
2294
|
-
*/
|
|
2295
|
-
constructor(_limit = Infinity) {
|
|
2296
|
-
this._limit = _limit;
|
|
2297
|
-
this._done = new Subject();
|
|
2298
|
-
this._queue = [];
|
|
2299
|
-
this._inProgress = [];
|
|
2300
|
-
this._total = 0;
|
|
2301
|
-
this._completed = 0;
|
|
2302
|
-
this._errors = 0;
|
|
2303
|
-
this._state = QueueState.Idle;
|
|
2304
|
-
this._destroy$ = new Subject();
|
|
2305
|
-
}
|
|
2306
|
-
/**
|
|
2307
|
-
* @return {?}
|
|
2308
|
-
*/
|
|
2309
|
-
get total() {
|
|
2310
|
-
return this._total;
|
|
2311
|
-
}
|
|
2312
|
-
/**
|
|
2313
|
-
* @return {?}
|
|
2314
|
-
*/
|
|
2315
|
-
get completed() {
|
|
2316
|
-
return this._completed;
|
|
2317
|
-
}
|
|
2318
|
-
/**
|
|
2319
|
-
* @return {?}
|
|
2320
|
-
*/
|
|
2321
|
-
get pending() {
|
|
2322
|
-
return this._queue.length;
|
|
2323
|
-
}
|
|
2324
|
-
/**
|
|
2325
|
-
* @return {?}
|
|
2326
|
-
*/
|
|
2327
|
-
get inProgress() {
|
|
2328
|
-
return this._inProgress.length;
|
|
2329
|
-
}
|
|
2330
|
-
/**
|
|
2331
|
-
* @return {?}
|
|
2332
|
-
*/
|
|
2333
|
-
get errors() {
|
|
2334
|
-
return this._errors;
|
|
2335
|
-
}
|
|
2336
|
-
/**
|
|
2337
|
-
* @return {?}
|
|
2338
|
-
*/
|
|
2339
|
-
get state() {
|
|
2340
|
-
return this._state;
|
|
2341
|
-
}
|
|
2342
|
-
/**
|
|
2343
|
-
* @return {?}
|
|
2344
|
-
*/
|
|
2345
|
-
get empty() {
|
|
2346
|
-
return !this._queue.length && !this._inProgress.length;
|
|
2347
|
-
}
|
|
2348
|
-
/**
|
|
2349
|
-
* @return {?}
|
|
2350
|
-
*/
|
|
2351
|
-
get pendingOperations() {
|
|
2352
|
-
return this._queue
|
|
2353
|
-
.map((/**
|
|
2354
|
-
* @param {?} operation
|
|
2355
|
-
* @return {?}
|
|
2356
|
-
*/
|
|
2357
|
-
(operation) => operation.name));
|
|
2358
|
-
}
|
|
2359
|
-
/**
|
|
2360
|
-
* @return {?}
|
|
2361
|
-
*/
|
|
2362
|
-
get inProgressOperations() {
|
|
2363
|
-
return this._inProgress
|
|
2364
|
-
.map((/**
|
|
2365
|
-
* @param {?} operation
|
|
2366
|
-
* @return {?}
|
|
2367
|
-
*/
|
|
2368
|
-
(operation) => operation.name));
|
|
2369
|
-
}
|
|
2370
|
-
/**
|
|
2371
|
-
* @return {?}
|
|
2372
|
-
*/
|
|
2373
|
-
isProcessing() {
|
|
2374
|
-
return this._state === QueueState.Processing;
|
|
2375
|
-
}
|
|
2376
|
-
/**
|
|
2377
|
-
* @return {?}
|
|
2378
|
-
*/
|
|
2379
|
-
isIdle() {
|
|
2380
|
-
return this._state === QueueState.Idle;
|
|
2381
|
-
}
|
|
2382
|
-
/**
|
|
2383
|
-
* @param {?} value
|
|
2384
|
-
* @return {?}
|
|
2385
|
-
*/
|
|
2386
|
-
setLimit(value) {
|
|
2387
|
-
this._limit = value;
|
|
2388
|
-
}
|
|
2389
|
-
/**
|
|
2390
|
-
* @param {?} fun
|
|
2391
|
-
* @param {?=} err
|
|
2392
|
-
* @param {?=} complete
|
|
2393
|
-
* @return {?}
|
|
2394
|
-
*/
|
|
2395
|
-
subscribe(fun, err, complete) {
|
|
2396
|
-
this._done
|
|
2397
|
-
.pipe(takeUntil(this._destroy$))
|
|
2398
|
-
.subscribe(fun, err, complete);
|
|
2399
|
-
}
|
|
2400
|
-
/**
|
|
2401
|
-
* @param {?} fun
|
|
2402
|
-
* @param {?=} err
|
|
2403
|
-
* @param {?=} complete
|
|
2404
|
-
* @return {?}
|
|
2405
|
-
*/
|
|
2406
|
-
complete(fun, err, complete) {
|
|
2407
|
-
Observable.create((/**
|
|
2408
|
-
* @param {?} observer
|
|
2409
|
-
* @return {?}
|
|
2410
|
-
*/
|
|
2411
|
-
observer => {
|
|
2412
|
-
if (!this.isProcessing()) {
|
|
2413
|
-
observer.next();
|
|
2414
|
-
observer.complete();
|
|
2415
|
-
return;
|
|
2416
|
-
}
|
|
2417
|
-
this.subscribe((/**
|
|
2418
|
-
* @return {?}
|
|
2419
|
-
*/
|
|
2420
|
-
() => {
|
|
2421
|
-
observer.next();
|
|
2422
|
-
observer.complete();
|
|
2423
|
-
}), (/**
|
|
2424
|
-
* @param {?} error
|
|
2425
|
-
* @return {?}
|
|
2426
|
-
*/
|
|
2427
|
-
(error) => {
|
|
2428
|
-
observer.error(error);
|
|
2429
|
-
this.clear();
|
|
2430
|
-
}));
|
|
2431
|
-
})).subscribe(fun, err, complete);
|
|
2432
|
-
}
|
|
2433
|
-
/**
|
|
2434
|
-
* @param {?} target
|
|
2435
|
-
* @param {?=} name
|
|
2436
|
-
* @return {?}
|
|
2437
|
-
*/
|
|
2438
|
-
push(target, name) {
|
|
2439
|
-
/** @type {?} */
|
|
2440
|
-
const operation = new Operation(target, name);
|
|
2441
|
-
this._total++;
|
|
2442
|
-
this._state = QueueState.Processing;
|
|
2443
|
-
if (this._inProgress.length < this._limit) {
|
|
2444
|
-
this._processOperation(operation);
|
|
2445
|
-
}
|
|
2446
|
-
else {
|
|
2447
|
-
this._queue.push(operation);
|
|
2448
|
-
}
|
|
2449
|
-
return operation.ready$;
|
|
2450
|
-
}
|
|
2451
|
-
/**
|
|
2452
|
-
* @return {?}
|
|
2453
|
-
*/
|
|
2454
|
-
clear() {
|
|
2455
|
-
this._queue = [];
|
|
2456
|
-
this._total = 0;
|
|
2457
|
-
this._errors = 0;
|
|
2458
|
-
this._completed = 0;
|
|
2459
|
-
this._state = QueueState.Idle;
|
|
2460
|
-
this._done = new Subject();
|
|
2461
|
-
}
|
|
2462
|
-
/**
|
|
2463
|
-
* @return {?}
|
|
2464
|
-
*/
|
|
2465
|
-
destroy() {
|
|
2466
|
-
this.clear();
|
|
2467
|
-
this._done.complete();
|
|
2468
|
-
}
|
|
2469
|
-
/**
|
|
2470
|
-
* @private
|
|
2471
|
-
* @param {?} operation
|
|
2472
|
-
* @return {?}
|
|
2473
|
-
*/
|
|
2474
|
-
_processOperation(operation) {
|
|
2475
|
-
this._inProgress.push(operation);
|
|
2476
|
-
operation.target
|
|
2477
|
-
.pipe(delay(200), // Hack to prevent extra quick proccess execution
|
|
2478
|
-
takeUntil(this._destroy$)).subscribe({
|
|
2479
|
-
next: (/**
|
|
2480
|
-
* @param {?} data
|
|
2481
|
-
* @return {?}
|
|
2482
|
-
*/
|
|
2483
|
-
(data) => {
|
|
2484
|
-
operation.ready$.next(data);
|
|
2485
|
-
}),
|
|
2486
|
-
error: (/**
|
|
2487
|
-
* @param {?} error
|
|
2488
|
-
* @return {?}
|
|
2489
|
-
*/
|
|
2490
|
-
(error) => {
|
|
2491
|
-
/** @type {?} */
|
|
2492
|
-
const opIndex = this._inProgress.indexOf(operation);
|
|
2493
|
-
this._inProgress.splice(opIndex, 1);
|
|
2494
|
-
this._errors++;
|
|
2495
|
-
operation.ready$.error(error);
|
|
2496
|
-
if (this.empty) {
|
|
2497
|
-
this._state = QueueState.Idle;
|
|
2498
|
-
this._done.error(error);
|
|
2499
|
-
}
|
|
2500
|
-
}),
|
|
2501
|
-
complete: (/**
|
|
2502
|
-
* @return {?}
|
|
2503
|
-
*/
|
|
2504
|
-
() => {
|
|
2505
|
-
/** @type {?} */
|
|
2506
|
-
const opIndex = this._inProgress.indexOf(operation);
|
|
2507
|
-
this._inProgress.splice(opIndex, 1);
|
|
2508
|
-
this._completed++;
|
|
2509
|
-
operation.ready$.complete();
|
|
2510
|
-
if (this.empty) {
|
|
2511
|
-
this._state = QueueState.Idle;
|
|
2512
|
-
this._done.next();
|
|
2513
|
-
}
|
|
2514
|
-
else {
|
|
2515
|
-
if (this._queue.length) {
|
|
2516
|
-
/** @type {?} */
|
|
2517
|
-
const queueItem = this._queue.shift();
|
|
2518
|
-
this._processOperation(queueItem);
|
|
2519
|
-
}
|
|
2520
|
-
}
|
|
2521
|
-
})
|
|
2522
|
-
});
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
if (false) {
|
|
2526
|
-
/**
|
|
2527
|
-
* @type {?}
|
|
2528
|
-
* @private
|
|
2529
|
-
*/
|
|
2530
|
-
Queue.prototype._done;
|
|
2531
|
-
/**
|
|
2532
|
-
* @type {?}
|
|
2533
|
-
* @private
|
|
2534
|
-
*/
|
|
2535
|
-
Queue.prototype._queue;
|
|
2536
|
-
/**
|
|
2537
|
-
* @type {?}
|
|
2538
|
-
* @private
|
|
2539
|
-
*/
|
|
2540
|
-
Queue.prototype._inProgress;
|
|
2541
|
-
/**
|
|
2542
|
-
* @type {?}
|
|
2543
|
-
* @private
|
|
2544
|
-
*/
|
|
2545
|
-
Queue.prototype._total;
|
|
2546
|
-
/**
|
|
2547
|
-
* @type {?}
|
|
2548
|
-
* @private
|
|
2549
|
-
*/
|
|
2550
|
-
Queue.prototype._completed;
|
|
2551
|
-
/**
|
|
2552
|
-
* @type {?}
|
|
2553
|
-
* @private
|
|
2554
|
-
*/
|
|
2555
|
-
Queue.prototype._errors;
|
|
2556
|
-
/**
|
|
2557
|
-
* @type {?}
|
|
2558
|
-
* @private
|
|
2559
|
-
*/
|
|
2560
|
-
Queue.prototype._state;
|
|
2561
|
-
/**
|
|
2562
|
-
* @type {?}
|
|
2563
|
-
* @private
|
|
2564
|
-
*/
|
|
2565
|
-
Queue.prototype._destroy$;
|
|
2566
|
-
/**
|
|
2567
|
-
* @type {?}
|
|
2568
|
-
* @private
|
|
2569
|
-
*/
|
|
2570
|
-
Queue.prototype._limit;
|
|
1036
|
+
function find(array, query) {
|
|
1037
|
+
const data = filter(array, query);
|
|
1038
|
+
return data.length ? data[0] : null;
|
|
2571
1039
|
}
|
|
2572
1040
|
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2577
|
-
*/
|
|
1041
|
+
function boolean(value) {
|
|
1042
|
+
return toString(value).toLowerCase() !== 'false' && !!value;
|
|
1043
|
+
}
|
|
2578
1044
|
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
1045
|
+
function debounce(func, wait, immediate) {
|
|
1046
|
+
let timeout;
|
|
1047
|
+
return function () {
|
|
1048
|
+
const context = this, args = arguments;
|
|
1049
|
+
const later = function () {
|
|
1050
|
+
timeout = null;
|
|
1051
|
+
if (!immediate)
|
|
1052
|
+
func.apply(context, args);
|
|
1053
|
+
};
|
|
1054
|
+
const callNow = immediate && !timeout;
|
|
1055
|
+
clearTimeout(timeout);
|
|
1056
|
+
timeout = setTimeout(later, wait);
|
|
1057
|
+
if (callNow)
|
|
1058
|
+
func.apply(context, args);
|
|
1059
|
+
};
|
|
2590
1060
|
}
|
|
2591
1061
|
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
1062
|
+
const KEY_CANCEL = 3;
|
|
1063
|
+
const KEY_HELP = 6;
|
|
1064
|
+
const KEY_BACKSPACE = 8;
|
|
1065
|
+
const KEY_TAB = 9;
|
|
1066
|
+
const KEY_CLEAR = 12;
|
|
1067
|
+
const KEY_RETURN = 13;
|
|
1068
|
+
const KEY_ENTER = 14;
|
|
1069
|
+
const KEY_SHIFT = 16;
|
|
1070
|
+
const KEY_CONTROL = 17;
|
|
1071
|
+
const KEY_ALT = 18;
|
|
1072
|
+
const KEY_PAUSE = 19;
|
|
1073
|
+
const KEY_CAPS_LOCK = 20;
|
|
1074
|
+
const KEY_ESCAPE = 27;
|
|
1075
|
+
const KEY_SPACE = 32;
|
|
1076
|
+
const KEY_PAGE_UP = 33;
|
|
1077
|
+
const KEY_PAGE_DOWN = 34;
|
|
1078
|
+
const KEY_END = 35;
|
|
1079
|
+
const KEY_HOME = 36;
|
|
1080
|
+
const KEY_LEFT = 37;
|
|
1081
|
+
const KEY_UP = 38;
|
|
1082
|
+
const KEY_RIGHT = 39;
|
|
1083
|
+
const KEY_DOWN = 40;
|
|
1084
|
+
const KEY_PRINTSCREEN = 44;
|
|
1085
|
+
const KEY_INSERT = 45;
|
|
1086
|
+
const KEY_DELETE = 46;
|
|
1087
|
+
const KEY_0 = 48;
|
|
1088
|
+
const KEY_1 = 49;
|
|
1089
|
+
const KEY_2 = 50;
|
|
1090
|
+
const KEY_3 = 51;
|
|
1091
|
+
const KEY_4 = 52;
|
|
1092
|
+
const KEY_5 = 53;
|
|
1093
|
+
const KEY_6 = 54;
|
|
1094
|
+
const KEY_7 = 55;
|
|
1095
|
+
const KEY_8 = 56;
|
|
1096
|
+
const KEY_9 = 57;
|
|
1097
|
+
const KEY_SEMICOLON = 59;
|
|
1098
|
+
const KEY_EQUALS = 61;
|
|
1099
|
+
|
|
1100
|
+
function length(object) {
|
|
1101
|
+
if (isObject(object)) {
|
|
1102
|
+
return Object.keys(object).length;
|
|
1103
|
+
}
|
|
1104
|
+
if (isArray(object)) {
|
|
1105
|
+
return object.length;
|
|
1106
|
+
}
|
|
1107
|
+
return 0;
|
|
1108
|
+
}
|
|
2597
1109
|
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
*/
|
|
2607
|
-
function getNormalizedPath(locationSrv) {
|
|
2608
|
-
/** @type {?} */
|
|
2609
|
-
const path = locationSrv.prepareExternalUrl(locationSrv.path());
|
|
2610
|
-
return removeQueryParams(path);
|
|
1110
|
+
function resolve(promise, defaults = []) {
|
|
1111
|
+
const result = defaults;
|
|
1112
|
+
return new Promise(resolve => {
|
|
1113
|
+
promise.then(function (data) {
|
|
1114
|
+
Object.keys(data).forEach(key => result[key] = data[key]);
|
|
1115
|
+
resolve(result);
|
|
1116
|
+
});
|
|
1117
|
+
});
|
|
2611
1118
|
}
|
|
2612
1119
|
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2617
|
-
*/
|
|
1120
|
+
function uuid() {
|
|
1121
|
+
return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
1122
|
+
}
|
|
2618
1123
|
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
1124
|
+
function value(object, key, def) {
|
|
1125
|
+
if (typeof object === 'object' || Array.isArray(object)) {
|
|
1126
|
+
if (object.hasOwnProperty(key)) {
|
|
1127
|
+
return object[key];
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
return def;
|
|
1131
|
+
}
|
|
2624
1132
|
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
1133
|
+
function isClass(value, cls) {
|
|
1134
|
+
if (typeof value === 'object') {
|
|
1135
|
+
if (typeof cls === 'string') {
|
|
1136
|
+
if (value.constructor) {
|
|
1137
|
+
if (value.constructor.name === cls) {
|
|
1138
|
+
return true;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
else {
|
|
1143
|
+
if (value instanceof cls) {
|
|
1144
|
+
return true;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
return false;
|
|
1149
|
+
}
|
|
2630
1150
|
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2635
|
-
*/
|
|
2636
|
-
/**
|
|
2637
|
-
* @param {?} str
|
|
2638
|
-
* @param {?=} length
|
|
2639
|
-
* @return {?}
|
|
2640
|
-
*/
|
|
2641
|
-
function acronym(str, length = 2) {
|
|
2642
|
-
/** @type {?} */
|
|
2643
|
-
const splittedString = str
|
|
2644
|
-
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
2645
|
-
.split(' ');
|
|
2646
|
-
/** @type {?} */
|
|
2647
|
-
let result = '';
|
|
2648
|
-
for (let i = 0; i < length; i++) {
|
|
2649
|
-
if (!splittedString[i]) {
|
|
2650
|
-
if (splittedString.length === 1) {
|
|
2651
|
-
for (let j = 1; j < length; j++) {
|
|
2652
|
-
if (!splittedString[i - 1][j]) {
|
|
2653
|
-
break;
|
|
2654
|
-
}
|
|
2655
|
-
result += splittedString[i - 1][j].toUpperCase();
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
|
-
break;
|
|
2659
|
-
}
|
|
2660
|
-
result += splittedString[i][0].toUpperCase();
|
|
2661
|
-
}
|
|
2662
|
-
return result;
|
|
1151
|
+
function isNumeric(value) {
|
|
1152
|
+
const str = toString(value);
|
|
1153
|
+
return str.length && !!str.match(/^-?\d*\.?\d*$/);
|
|
2663
1154
|
}
|
|
2664
1155
|
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
1156
|
+
function throttle(func, wait) {
|
|
1157
|
+
let waiting = false; // Initially, we're not waiting
|
|
1158
|
+
return function () {
|
|
1159
|
+
if (!waiting) { // If we're not waiting
|
|
1160
|
+
func.apply(null, arguments); // Execute users function
|
|
1161
|
+
waiting = true; // Prevent future invocations
|
|
1162
|
+
setTimeout(function () {
|
|
1163
|
+
waiting = false; // And allow future invocations
|
|
1164
|
+
}, wait);
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
2670
1168
|
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
1169
|
+
class Operation {
|
|
1170
|
+
constructor(target, name) {
|
|
1171
|
+
this.ready$ = new Subject();
|
|
1172
|
+
this.name = name ? name : guid();
|
|
1173
|
+
if (target instanceof Observable) {
|
|
1174
|
+
this.target = target;
|
|
1175
|
+
}
|
|
1176
|
+
else {
|
|
1177
|
+
this.target = of(target);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
2676
1181
|
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
1182
|
+
var QueueState;
|
|
1183
|
+
(function (QueueState) {
|
|
1184
|
+
QueueState["Idle"] = "idle";
|
|
1185
|
+
QueueState["Processing"] = "processing";
|
|
1186
|
+
})(QueueState || (QueueState = {}));
|
|
1187
|
+
|
|
1188
|
+
class Queue {
|
|
1189
|
+
constructor(_limit = Infinity) {
|
|
1190
|
+
this._limit = _limit;
|
|
1191
|
+
this._done = new Subject();
|
|
1192
|
+
this._queue = [];
|
|
1193
|
+
this._inProgress = [];
|
|
1194
|
+
this._total = 0;
|
|
1195
|
+
this._completed = 0;
|
|
1196
|
+
this._errors = 0;
|
|
1197
|
+
this._state = QueueState.Idle;
|
|
1198
|
+
this._destroy$ = new Subject();
|
|
1199
|
+
}
|
|
1200
|
+
get total() {
|
|
1201
|
+
return this._total;
|
|
1202
|
+
}
|
|
1203
|
+
get completed() {
|
|
1204
|
+
return this._completed;
|
|
1205
|
+
}
|
|
1206
|
+
get pending() {
|
|
1207
|
+
return this._queue.length;
|
|
1208
|
+
}
|
|
1209
|
+
get inProgress() {
|
|
1210
|
+
return this._inProgress.length;
|
|
1211
|
+
}
|
|
1212
|
+
get errors() {
|
|
1213
|
+
return this._errors;
|
|
1214
|
+
}
|
|
1215
|
+
get state() {
|
|
1216
|
+
return this._state;
|
|
1217
|
+
}
|
|
1218
|
+
get empty() {
|
|
1219
|
+
return !this._queue.length && !this._inProgress.length;
|
|
1220
|
+
}
|
|
1221
|
+
get pendingOperations() {
|
|
1222
|
+
return this._queue
|
|
1223
|
+
.map((operation) => operation.name);
|
|
1224
|
+
}
|
|
1225
|
+
get inProgressOperations() {
|
|
1226
|
+
return this._inProgress
|
|
1227
|
+
.map((operation) => operation.name);
|
|
1228
|
+
}
|
|
1229
|
+
isProcessing() {
|
|
1230
|
+
return this._state === QueueState.Processing;
|
|
1231
|
+
}
|
|
1232
|
+
isIdle() {
|
|
1233
|
+
return this._state === QueueState.Idle;
|
|
1234
|
+
}
|
|
1235
|
+
setLimit(value) {
|
|
1236
|
+
this._limit = value;
|
|
1237
|
+
}
|
|
1238
|
+
subscribe(fun, err, complete) {
|
|
1239
|
+
this._done
|
|
1240
|
+
.pipe(takeUntil(this._destroy$))
|
|
1241
|
+
.subscribe(fun, err, complete);
|
|
1242
|
+
}
|
|
1243
|
+
complete(fun, err, complete) {
|
|
1244
|
+
Observable.create(observer => {
|
|
1245
|
+
if (!this.isProcessing()) {
|
|
1246
|
+
observer.next();
|
|
1247
|
+
observer.complete();
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
this.subscribe(() => {
|
|
1251
|
+
observer.next();
|
|
1252
|
+
observer.complete();
|
|
1253
|
+
}, (error) => {
|
|
1254
|
+
observer.error(error);
|
|
1255
|
+
this.clear();
|
|
1256
|
+
});
|
|
1257
|
+
}).subscribe(fun, err, complete);
|
|
1258
|
+
}
|
|
1259
|
+
push(target, name) {
|
|
1260
|
+
const operation = new Operation(target, name);
|
|
1261
|
+
this._total++;
|
|
1262
|
+
this._state = QueueState.Processing;
|
|
1263
|
+
if (this._inProgress.length < this._limit) {
|
|
1264
|
+
this._processOperation(operation);
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
this._queue.push(operation);
|
|
1268
|
+
}
|
|
1269
|
+
return operation.ready$;
|
|
1270
|
+
}
|
|
1271
|
+
clear() {
|
|
1272
|
+
this._queue = [];
|
|
1273
|
+
this._total = 0;
|
|
1274
|
+
this._errors = 0;
|
|
1275
|
+
this._completed = 0;
|
|
1276
|
+
this._state = QueueState.Idle;
|
|
1277
|
+
this._done = new Subject();
|
|
1278
|
+
}
|
|
1279
|
+
destroy() {
|
|
1280
|
+
this.clear();
|
|
1281
|
+
this._done.complete();
|
|
1282
|
+
}
|
|
1283
|
+
_processOperation(operation) {
|
|
1284
|
+
this._inProgress.push(operation);
|
|
1285
|
+
operation.target
|
|
1286
|
+
.pipe(delay(200), // Hack to prevent extra quick proccess execution
|
|
1287
|
+
takeUntil(this._destroy$)).subscribe({
|
|
1288
|
+
next: (data) => {
|
|
1289
|
+
operation.ready$.next(data);
|
|
1290
|
+
},
|
|
1291
|
+
error: (error) => {
|
|
1292
|
+
const opIndex = this._inProgress.indexOf(operation);
|
|
1293
|
+
this._inProgress.splice(opIndex, 1);
|
|
1294
|
+
this._errors++;
|
|
1295
|
+
operation.ready$.error(error);
|
|
1296
|
+
if (this.empty) {
|
|
1297
|
+
this._state = QueueState.Idle;
|
|
1298
|
+
this._done.error(error);
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
complete: () => {
|
|
1302
|
+
const opIndex = this._inProgress.indexOf(operation);
|
|
1303
|
+
this._inProgress.splice(opIndex, 1);
|
|
1304
|
+
this._completed++;
|
|
1305
|
+
operation.ready$.complete();
|
|
1306
|
+
if (this.empty) {
|
|
1307
|
+
this._state = QueueState.Idle;
|
|
1308
|
+
this._done.next();
|
|
1309
|
+
}
|
|
1310
|
+
else {
|
|
1311
|
+
if (this._queue.length) {
|
|
1312
|
+
const queueItem = this._queue.shift();
|
|
1313
|
+
this._processOperation(queueItem);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
2682
1320
|
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2687
|
-
*/
|
|
1321
|
+
function removeQueryParams(path) {
|
|
1322
|
+
return path.split('?')[0];
|
|
1323
|
+
}
|
|
2688
1324
|
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
*/
|
|
1325
|
+
function getNormalizedPath(locationSrv) {
|
|
1326
|
+
const path = locationSrv.prepareExternalUrl(locationSrv.path());
|
|
1327
|
+
return removeQueryParams(path);
|
|
1328
|
+
}
|
|
2694
1329
|
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
*/
|
|
2717
|
-
(errors) => errors.pipe(tap((/**
|
|
2718
|
-
* @return {?}
|
|
2719
|
-
*/
|
|
2720
|
-
() => {
|
|
2721
|
-
retries++;
|
|
2722
|
-
if (retries <= maxRetry) {
|
|
2723
|
-
console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
|
|
2724
|
-
}
|
|
2725
|
-
})), concatMap((/**
|
|
2726
|
-
* @param {?} error
|
|
2727
|
-
* @return {?}
|
|
2728
|
-
*/
|
|
2729
|
-
(error) => iif((/**
|
|
2730
|
-
* @return {?}
|
|
2731
|
-
*/
|
|
2732
|
-
() => retries > maxRetry), throwError(getErrorMessage(maxRetry, message)), timer(delayMs)))))))));
|
|
2733
|
-
}
|
|
2734
|
-
/** @type {?} */
|
|
2735
|
-
const getErrorMessage = (/**
|
|
2736
|
-
* @param {?} maxRetry
|
|
2737
|
-
* @param {?} defaultMessage
|
|
2738
|
-
* @return {?}
|
|
2739
|
-
*/
|
|
2740
|
-
(maxRetry, defaultMessage) => {
|
|
2741
|
-
if (!defaultMessage) {
|
|
2742
|
-
return `Failed to load Resource for ${maxRetry} times. Giving up.`;
|
|
2743
|
-
}
|
|
2744
|
-
else {
|
|
2745
|
-
return defaultMessage;
|
|
2746
|
-
}
|
|
2747
|
-
});
|
|
2748
|
-
const ɵ0 = getErrorMessage;
|
|
1330
|
+
function acronym(str, length = 2) {
|
|
1331
|
+
const splittedString = str
|
|
1332
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
1333
|
+
.split(' ');
|
|
1334
|
+
let result = '';
|
|
1335
|
+
for (let i = 0; i < length; i++) {
|
|
1336
|
+
if (!splittedString[i]) {
|
|
1337
|
+
if (splittedString.length === 1) {
|
|
1338
|
+
for (let j = 1; j < length; j++) {
|
|
1339
|
+
if (!splittedString[i - 1][j]) {
|
|
1340
|
+
break;
|
|
1341
|
+
}
|
|
1342
|
+
result += splittedString[i - 1][j].toUpperCase();
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
break;
|
|
1346
|
+
}
|
|
1347
|
+
result += splittedString[i][0].toUpperCase();
|
|
1348
|
+
}
|
|
1349
|
+
return result;
|
|
1350
|
+
}
|
|
2749
1351
|
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
1352
|
+
function delayedRetry(delayMs, maxRetry = 5, message) {
|
|
1353
|
+
let retries = 0;
|
|
1354
|
+
return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
|
|
1355
|
+
retries++;
|
|
1356
|
+
if (retries <= maxRetry) {
|
|
1357
|
+
console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
|
|
1358
|
+
}
|
|
1359
|
+
}), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
|
|
1360
|
+
}
|
|
1361
|
+
const getErrorMessage = (maxRetry, defaultMessage) => {
|
|
1362
|
+
if (!defaultMessage) {
|
|
1363
|
+
return `Failed to load Resource for ${maxRetry} times. Giving up.`;
|
|
1364
|
+
}
|
|
1365
|
+
else {
|
|
1366
|
+
return defaultMessage;
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
2755
1369
|
|
|
2756
|
-
|
|
2757
|
-
*
|
|
2758
|
-
* Generated from: public_api.ts
|
|
2759
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1370
|
+
/*
|
|
1371
|
+
* Public API Surface of fs-menu
|
|
2760
1372
|
*/
|
|
2761
1373
|
|
|
2762
|
-
/**
|
|
2763
|
-
*
|
|
2764
|
-
* Generated from: firestitch-common.ts
|
|
2765
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1374
|
+
/**
|
|
1375
|
+
* Generated bundle index. Do not edit.
|
|
2766
1376
|
*/
|
|
2767
1377
|
|
|
2768
|
-
export { FsArray, FsCommonModule,
|
|
1378
|
+
export { FsArray, FsAutofocusDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_ALT, KEY_BACKSPACE, KEY_CANCEL, KEY_CAPS_LOCK, KEY_CLEAR, KEY_CONTROL, KEY_DELETE, KEY_DOWN, KEY_END, KEY_ENTER, KEY_EQUALS, KEY_ESCAPE, KEY_HELP, KEY_HOME, KEY_INSERT, KEY_LEFT, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_PAUSE, KEY_PRINTSCREEN, KEY_RETURN, KEY_RIGHT, KEY_SEMICOLON, KEY_SHIFT, KEY_SPACE, KEY_TAB, KEY_UP, Queue, QueueState, acronym, boolean, bytes, compare, currency, debounce, delayedRetry, email, filter, find, getNormalizedPath, guid, inArray, index, indexOf, isClass, isEmpty, isNumeric, keyExists, ksort, length, list, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, rsort, sort, stringify, throttle, truncate, url, uuid, value };
|
|
2769
1379
|
//# sourceMappingURL=firestitch-common.js.map
|