@firestitch/common 8.0.10
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 +6 -0
- package/app/directives/prevent-default.directive.d.ts +3 -0
- package/app/directives/stop-propagation.directive.d.ts +3 -0
- package/app/fs-common.module.d.ts +4 -0
- package/app/pipes/bytes.pipe.d.ts +4 -0
- package/app/pipes/currency.pipe.d.ts +6 -0
- package/app/pipes/number.pipe.d.ts +4 -0
- package/app/pipes/ordinal-number.pipe.d.ts +4 -0
- package/app/pipes/truncate.pipe.d.ts +5 -0
- package/app/pipes/util.pipe.d.ts +15 -0
- package/app/services/array.service.d.ts +58 -0
- package/app/services/math.service.d.ts +6 -0
- package/app/services/util.service.d.ts +86 -0
- package/app/services/vaildate.service.d.ts +13 -0
- package/bundles/firestitch-common.umd.js +3548 -0
- package/bundles/firestitch-common.umd.js.map +1 -0
- package/bundles/firestitch-common.umd.min.js +16 -0
- package/bundles/firestitch-common.umd.min.js.map +1 -0
- package/esm2015/app/directives/autofocus.directive.js +42 -0
- package/esm2015/app/directives/prevent-default.directive.js +24 -0
- package/esm2015/app/directives/stop-propagation.directive.js +24 -0
- package/esm2015/app/fs-common.module.js +72 -0
- package/esm2015/app/pipes/bytes.pipe.js +22 -0
- package/esm2015/app/pipes/currency.pipe.js +38 -0
- package/esm2015/app/pipes/number.pipe.js +23 -0
- package/esm2015/app/pipes/ordinal-number.pipe.js +22 -0
- package/esm2015/app/pipes/truncate.pipe.js +28 -0
- package/esm2015/app/pipes/util.pipe.js +71 -0
- package/esm2015/app/services/array.service.js +352 -0
- package/esm2015/app/services/math.service.js +29 -0
- package/esm2015/app/services/util.service.js +430 -0
- package/esm2015/app/services/vaildate.service.js +48 -0
- package/esm2015/firestitch-common.js +19 -0
- package/esm2015/libs/array/compare/compare.js +19 -0
- package/esm2015/libs/array/compare/index.js +7 -0
- package/esm2015/libs/array/filter/filter.js +53 -0
- package/esm2015/libs/array/filter/index.js +7 -0
- package/esm2015/libs/array/find/find.js +17 -0
- package/esm2015/libs/array/find/index.js +7 -0
- package/esm2015/libs/array/inArray/inArray.js +22 -0
- package/esm2015/libs/array/inArray/index.js +7 -0
- package/esm2015/libs/array/index/index.js +24 -0
- package/esm2015/libs/array/index.js +19 -0
- package/esm2015/libs/array/indexOf/index.js +7 -0
- package/esm2015/libs/array/indexOf/indexOf.js +31 -0
- package/esm2015/libs/array/keyExists/index.js +7 -0
- package/esm2015/libs/array/keyExists/keyExists.js +14 -0
- package/esm2015/libs/array/ksort/index.js +7 -0
- package/esm2015/libs/array/ksort/ksort.js +22 -0
- package/esm2015/libs/array/list/index.js +7 -0
- package/esm2015/libs/array/list/list.js +30 -0
- package/esm2015/libs/array/nameValue/index.js +7 -0
- package/esm2015/libs/array/nameValue/nameValue.js +52 -0
- package/esm2015/libs/array/remove/index.js +7 -0
- package/esm2015/libs/array/remove/remove.js +20 -0
- package/esm2015/libs/array/rsort/index.js +7 -0
- package/esm2015/libs/array/rsort/rsort.js +15 -0
- package/esm2015/libs/array/sort/index.js +7 -0
- package/esm2015/libs/array/sort/sort.js +44 -0
- package/esm2015/libs/format/acronym/acronym.js +34 -0
- package/esm2015/libs/format/acronym/index.js +7 -0
- package/esm2015/libs/format/bytes/bytes.js +23 -0
- package/esm2015/libs/format/bytes/index.js +7 -0
- package/esm2015/libs/format/currency/currency.js +20 -0
- package/esm2015/libs/format/currency/index.js +7 -0
- package/esm2015/libs/format/index.js +11 -0
- package/esm2015/libs/format/number/index.js +7 -0
- package/esm2015/libs/format/number/number.js +14 -0
- package/esm2015/libs/format/truncate/index.js +7 -0
- package/esm2015/libs/format/truncate/truncate.js +25 -0
- package/esm2015/libs/index.js +11 -0
- package/esm2015/libs/rxjs/delayedRetry.js +58 -0
- package/esm2015/libs/util/boolean/boolean.js +14 -0
- package/esm2015/libs/util/boolean/index.js +7 -0
- package/esm2015/libs/util/debounce/debounce.js +40 -0
- package/esm2015/libs/util/debounce/index.js +7 -0
- package/esm2015/libs/util/get-normalized-path/get-normalized-path.js +16 -0
- package/esm2015/libs/util/get-normalized-path/index.js +7 -0
- package/esm2015/libs/util/guid/guid.js +36 -0
- package/esm2015/libs/util/guid/index.js +7 -0
- package/esm2015/libs/util/index.js +23 -0
- package/esm2015/libs/util/isClass/index.js +7 -0
- package/esm2015/libs/util/isClass/isClass.js +28 -0
- package/esm2015/libs/util/isEmpty/index.js +7 -0
- package/esm2015/libs/util/isEmpty/isEmpty.js +23 -0
- package/esm2015/libs/util/isNumeric/index.js +7 -0
- package/esm2015/libs/util/isNumeric/isNumeric.js +16 -0
- package/esm2015/libs/util/keys/index.js +7 -0
- package/esm2015/libs/util/keys/keys.js +80 -0
- package/esm2015/libs/util/length/index.js +7 -0
- package/esm2015/libs/util/length/length.js +20 -0
- package/esm2015/libs/util/ordinal-number/ordinal-number.js +20 -0
- package/esm2015/libs/util/queue/index.js +8 -0
- package/esm2015/libs/util/queue/operation.js +32 -0
- package/esm2015/libs/util/queue/queue.enum.js +12 -0
- package/esm2015/libs/util/queue/queue.js +291 -0
- package/esm2015/libs/util/remove-query-params/index.js +7 -0
- package/esm2015/libs/util/remove-query-params/remove-query-params.js +13 -0
- package/esm2015/libs/util/resolve/index.js +7 -0
- package/esm2015/libs/util/resolve/resolve.js +33 -0
- package/esm2015/libs/util/stringify/index.js +7 -0
- package/esm2015/libs/util/stringify/stringify.js +13 -0
- package/esm2015/libs/util/throttle/index.js +7 -0
- package/esm2015/libs/util/throttle/throttle.js +30 -0
- package/esm2015/libs/util/uuid/index.js +7 -0
- package/esm2015/libs/util/uuid/uuid.js +13 -0
- package/esm2015/libs/util/value/index.js +7 -0
- package/esm2015/libs/util/value/value.js +20 -0
- package/esm2015/libs/validate/email/email.js +13 -0
- package/esm2015/libs/validate/email/index.js +7 -0
- package/esm2015/libs/validate/index.js +9 -0
- package/esm2015/libs/validate/phone/index.js +7 -0
- package/esm2015/libs/validate/phone/phone.js +15 -0
- package/esm2015/libs/validate/url/index.js +7 -0
- package/esm2015/libs/validate/url/url.js +23 -0
- package/esm2015/public_api.js +17 -0
- package/esm5/app/directives/autofocus.directive.js +45 -0
- package/esm5/app/directives/prevent-default.directive.js +32 -0
- package/esm5/app/directives/stop-propagation.directive.js +32 -0
- package/esm5/app/fs-common.module.js +79 -0
- package/esm5/app/pipes/bytes.pipe.js +30 -0
- package/esm5/app/pipes/currency.pipe.js +43 -0
- package/esm5/app/pipes/number.pipe.js +32 -0
- package/esm5/app/pipes/ordinal-number.pipe.js +30 -0
- package/esm5/app/pipes/truncate.pipe.js +38 -0
- package/esm5/app/pipes/util.pipe.js +100 -0
- package/esm5/app/services/array.service.js +491 -0
- package/esm5/app/services/math.service.js +42 -0
- package/esm5/app/services/util.service.js +608 -0
- package/esm5/app/services/vaildate.service.js +63 -0
- package/esm5/firestitch-common.js +19 -0
- package/esm5/libs/array/compare/compare.js +19 -0
- package/esm5/libs/array/compare/index.js +7 -0
- package/esm5/libs/array/filter/filter.js +53 -0
- package/esm5/libs/array/filter/index.js +7 -0
- package/esm5/libs/array/find/find.js +17 -0
- package/esm5/libs/array/find/index.js +7 -0
- package/esm5/libs/array/inArray/inArray.js +22 -0
- package/esm5/libs/array/inArray/index.js +7 -0
- package/esm5/libs/array/index/index.js +24 -0
- package/esm5/libs/array/index.js +19 -0
- package/esm5/libs/array/indexOf/index.js +7 -0
- package/esm5/libs/array/indexOf/indexOf.js +31 -0
- package/esm5/libs/array/keyExists/index.js +7 -0
- package/esm5/libs/array/keyExists/keyExists.js +14 -0
- package/esm5/libs/array/ksort/index.js +7 -0
- package/esm5/libs/array/ksort/ksort.js +22 -0
- package/esm5/libs/array/list/index.js +7 -0
- package/esm5/libs/array/list/list.js +31 -0
- package/esm5/libs/array/nameValue/index.js +7 -0
- package/esm5/libs/array/nameValue/nameValue.js +52 -0
- package/esm5/libs/array/remove/index.js +7 -0
- package/esm5/libs/array/remove/remove.js +20 -0
- package/esm5/libs/array/rsort/index.js +7 -0
- package/esm5/libs/array/rsort/rsort.js +15 -0
- package/esm5/libs/array/sort/index.js +7 -0
- package/esm5/libs/array/sort/sort.js +45 -0
- package/esm5/libs/format/acronym/acronym.js +35 -0
- package/esm5/libs/format/acronym/index.js +7 -0
- package/esm5/libs/format/bytes/bytes.js +23 -0
- package/esm5/libs/format/bytes/index.js +7 -0
- package/esm5/libs/format/currency/currency.js +23 -0
- package/esm5/libs/format/currency/index.js +7 -0
- package/esm5/libs/format/index.js +11 -0
- package/esm5/libs/format/number/index.js +7 -0
- package/esm5/libs/format/number/number.js +14 -0
- package/esm5/libs/format/truncate/index.js +7 -0
- package/esm5/libs/format/truncate/truncate.js +28 -0
- package/esm5/libs/index.js +11 -0
- package/esm5/libs/rxjs/delayedRetry.js +65 -0
- package/esm5/libs/util/boolean/boolean.js +14 -0
- package/esm5/libs/util/boolean/index.js +7 -0
- package/esm5/libs/util/debounce/debounce.js +40 -0
- package/esm5/libs/util/debounce/index.js +7 -0
- package/esm5/libs/util/get-normalized-path/get-normalized-path.js +16 -0
- package/esm5/libs/util/get-normalized-path/index.js +7 -0
- package/esm5/libs/util/guid/guid.js +37 -0
- package/esm5/libs/util/guid/index.js +7 -0
- package/esm5/libs/util/index.js +23 -0
- package/esm5/libs/util/isClass/index.js +7 -0
- package/esm5/libs/util/isClass/isClass.js +28 -0
- package/esm5/libs/util/isEmpty/index.js +7 -0
- package/esm5/libs/util/isEmpty/isEmpty.js +23 -0
- package/esm5/libs/util/isNumeric/index.js +7 -0
- package/esm5/libs/util/isNumeric/isNumeric.js +16 -0
- package/esm5/libs/util/keys/index.js +7 -0
- package/esm5/libs/util/keys/keys.js +80 -0
- package/esm5/libs/util/length/index.js +7 -0
- package/esm5/libs/util/length/length.js +20 -0
- package/esm5/libs/util/ordinal-number/ordinal-number.js +22 -0
- package/esm5/libs/util/queue/index.js +8 -0
- package/esm5/libs/util/queue/operation.js +30 -0
- package/esm5/libs/util/queue/queue.enum.js +12 -0
- package/esm5/libs/util/queue/queue.js +367 -0
- package/esm5/libs/util/remove-query-params/index.js +7 -0
- package/esm5/libs/util/remove-query-params/remove-query-params.js +13 -0
- package/esm5/libs/util/resolve/index.js +7 -0
- package/esm5/libs/util/resolve/resolve.js +34 -0
- package/esm5/libs/util/stringify/index.js +7 -0
- package/esm5/libs/util/stringify/stringify.js +13 -0
- package/esm5/libs/util/throttle/index.js +7 -0
- package/esm5/libs/util/throttle/throttle.js +30 -0
- package/esm5/libs/util/uuid/index.js +7 -0
- package/esm5/libs/util/uuid/uuid.js +13 -0
- package/esm5/libs/util/value/index.js +7 -0
- package/esm5/libs/util/value/value.js +20 -0
- package/esm5/libs/validate/email/email.js +13 -0
- package/esm5/libs/validate/email/index.js +7 -0
- package/esm5/libs/validate/index.js +9 -0
- package/esm5/libs/validate/phone/index.js +7 -0
- package/esm5/libs/validate/phone/phone.js +15 -0
- package/esm5/libs/validate/url/index.js +7 -0
- package/esm5/libs/validate/url/url.js +23 -0
- package/esm5/public_api.js +17 -0
- package/fesm2015/firestitch-common.js +2769 -0
- package/fesm2015/firestitch-common.js.map +1 -0
- package/fesm5/firestitch-common.js +3284 -0
- package/fesm5/firestitch-common.js.map +1 -0
- package/firestitch-common.d.ts +13 -0
- package/firestitch-common.metadata.json +1 -0
- package/libs/array/compare/compare.d.ts +1 -0
- package/libs/array/compare/index.d.ts +1 -0
- package/libs/array/filter/filter.d.ts +1 -0
- package/libs/array/filter/index.d.ts +1 -0
- package/libs/array/find/find.d.ts +1 -0
- package/libs/array/find/index.d.ts +1 -0
- package/libs/array/inArray/inArray.d.ts +1 -0
- package/libs/array/inArray/index.d.ts +1 -0
- package/libs/array/index/index.d.ts +1 -0
- package/libs/array/index.d.ts +13 -0
- package/libs/array/indexOf/index.d.ts +1 -0
- package/libs/array/indexOf/indexOf.d.ts +1 -0
- package/libs/array/keyExists/index.d.ts +1 -0
- package/libs/array/keyExists/keyExists.d.ts +1 -0
- package/libs/array/ksort/index.d.ts +1 -0
- package/libs/array/ksort/ksort.d.ts +1 -0
- package/libs/array/list/index.d.ts +1 -0
- package/libs/array/list/list.d.ts +1 -0
- package/libs/array/nameValue/index.d.ts +1 -0
- package/libs/array/nameValue/nameValue.d.ts +1 -0
- package/libs/array/remove/index.d.ts +1 -0
- package/libs/array/remove/remove.d.ts +1 -0
- package/libs/array/rsort/index.d.ts +1 -0
- package/libs/array/rsort/rsort.d.ts +1 -0
- package/libs/array/sort/index.d.ts +1 -0
- package/libs/array/sort/sort.d.ts +1 -0
- package/libs/format/acronym/acronym.d.ts +1 -0
- package/libs/format/acronym/index.d.ts +1 -0
- package/libs/format/bytes/bytes.d.ts +1 -0
- package/libs/format/bytes/index.d.ts +1 -0
- package/libs/format/currency/currency.d.ts +1 -0
- package/libs/format/currency/index.d.ts +1 -0
- package/libs/format/index.d.ts +5 -0
- package/libs/format/number/index.d.ts +1 -0
- package/libs/format/number/number.d.ts +1 -0
- package/libs/format/truncate/index.d.ts +1 -0
- package/libs/format/truncate/truncate.d.ts +1 -0
- package/libs/index.d.ts +5 -0
- package/libs/rxjs/delayedRetry.d.ts +2 -0
- package/libs/util/boolean/boolean.d.ts +1 -0
- package/libs/util/boolean/index.d.ts +1 -0
- package/libs/util/debounce/debounce.d.ts +1 -0
- package/libs/util/debounce/index.d.ts +1 -0
- package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -0
- package/libs/util/get-normalized-path/index.d.ts +1 -0
- package/libs/util/guid/guid.d.ts +1 -0
- package/libs/util/guid/index.d.ts +1 -0
- package/libs/util/index.d.ts +17 -0
- package/libs/util/isClass/index.d.ts +1 -0
- package/libs/util/isClass/isClass.d.ts +1 -0
- package/libs/util/isEmpty/index.d.ts +1 -0
- package/libs/util/isEmpty/isEmpty.d.ts +1 -0
- package/libs/util/isNumeric/index.d.ts +1 -0
- package/libs/util/isNumeric/isNumeric.d.ts +1 -0
- package/libs/util/keys/index.d.ts +1 -0
- package/libs/util/keys/keys.d.ts +37 -0
- package/libs/util/length/index.d.ts +1 -0
- package/libs/util/length/length.d.ts +1 -0
- package/libs/util/ordinal-number/ordinal-number.d.ts +1 -0
- package/libs/util/queue/index.d.ts +2 -0
- package/libs/util/queue/operation.d.ts +7 -0
- package/libs/util/queue/queue.d.ts +32 -0
- package/libs/util/queue/queue.enum.d.ts +4 -0
- package/libs/util/remove-query-params/index.d.ts +1 -0
- package/libs/util/remove-query-params/remove-query-params.d.ts +1 -0
- package/libs/util/resolve/index.d.ts +1 -0
- package/libs/util/resolve/resolve.d.ts +1 -0
- package/libs/util/stringify/index.d.ts +1 -0
- package/libs/util/stringify/stringify.d.ts +1 -0
- package/libs/util/throttle/index.d.ts +1 -0
- package/libs/util/throttle/throttle.d.ts +1 -0
- package/libs/util/uuid/index.d.ts +1 -0
- package/libs/util/uuid/uuid.d.ts +1 -0
- package/libs/util/value/index.d.ts +1 -0
- package/libs/util/value/value.d.ts +1 -0
- package/libs/validate/email/email.d.ts +1 -0
- package/libs/validate/email/index.d.ts +1 -0
- package/libs/validate/index.d.ts +3 -0
- package/libs/validate/phone/index.d.ts +1 -0
- package/libs/validate/phone/phone.d.ts +1 -0
- package/libs/validate/url/index.d.ts +1 -0
- package/libs/validate/url/url.d.ts +7 -0
- package/package.json +33 -0
- package/public_api.d.ts +6 -0
|
@@ -0,0 +1,2769 @@
|
|
|
1
|
+
import { Injectable, Pipe, Inject, LOCALE_ID, Directive, HostListener, ElementRef, NgModule } from '@angular/core';
|
|
2
|
+
import { CurrencyPipe, CommonModule } from '@angular/common';
|
|
3
|
+
import { toString, isObject, isArray } from 'lodash-es';
|
|
4
|
+
import { Subject, Observable, of, iif, throwError, timer } from 'rxjs';
|
|
5
|
+
import { takeUntil, delay, retryWhen, tap, concatMap } from 'rxjs/operators';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview added by tsickle
|
|
9
|
+
* Generated from: app/services/array.service.ts
|
|
10
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
+
*/
|
|
12
|
+
class FsArray {
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated use import { nameValue } from \@firestitch/common/array; instead
|
|
15
|
+
* @param {?} array
|
|
16
|
+
* @param {?} name
|
|
17
|
+
* @param {?} value
|
|
18
|
+
* @return {?}
|
|
19
|
+
*/
|
|
20
|
+
nameValue(array, name, value) {
|
|
21
|
+
console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
|
|
22
|
+
/** @type {?} */
|
|
23
|
+
let list = [];
|
|
24
|
+
if (name || value) {
|
|
25
|
+
/** @type {?} */
|
|
26
|
+
let nameFn = typeof name === 'function' ? name : (/**
|
|
27
|
+
* @param {?} item
|
|
28
|
+
* @return {?}
|
|
29
|
+
*/
|
|
30
|
+
function (item) { return item[name]; });
|
|
31
|
+
/** @type {?} */
|
|
32
|
+
let valueFn = typeof value === 'function' ? value : (/**
|
|
33
|
+
* @param {?} item
|
|
34
|
+
* @return {?}
|
|
35
|
+
*/
|
|
36
|
+
function (item) { return item[value]; });
|
|
37
|
+
array.forEach((/**
|
|
38
|
+
* @param {?} item
|
|
39
|
+
* @return {?}
|
|
40
|
+
*/
|
|
41
|
+
function (item) {
|
|
42
|
+
list.push({ name: nameFn(item), value: valueFn(item) });
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
array.forEach((/**
|
|
47
|
+
* @param {?} name
|
|
48
|
+
* @param {?} value
|
|
49
|
+
* @return {?}
|
|
50
|
+
*/
|
|
51
|
+
function (name, value) {
|
|
52
|
+
list.push({ name: name, value: value });
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
return list;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated use import { remove } from \@firestitch/common/array; instead
|
|
59
|
+
* @param {?} array
|
|
60
|
+
* @param {?} query
|
|
61
|
+
* @return {?}
|
|
62
|
+
*/
|
|
63
|
+
remove(array, query) {
|
|
64
|
+
console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
|
|
65
|
+
/** @type {?} */
|
|
66
|
+
let idx = this.indexOf(array, query);
|
|
67
|
+
if (idx >= 0) {
|
|
68
|
+
return array.splice(idx, 1);
|
|
69
|
+
}
|
|
70
|
+
return idx;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated use import { indexOf } from \@firestitch/common/array; instead
|
|
74
|
+
* @param {?} array
|
|
75
|
+
* @param {?} query
|
|
76
|
+
* @return {?}
|
|
77
|
+
*/
|
|
78
|
+
indexOf(array, query) {
|
|
79
|
+
console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
|
|
80
|
+
if (typeof query !== 'function') {
|
|
81
|
+
/** @type {?} */
|
|
82
|
+
let queryObj = query;
|
|
83
|
+
query = (/**
|
|
84
|
+
* @param {?} item
|
|
85
|
+
* @return {?}
|
|
86
|
+
*/
|
|
87
|
+
(item) => {
|
|
88
|
+
return this.compare(queryObj, item);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
92
|
+
if (query(array[i])) {
|
|
93
|
+
return i;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated use import { compare } from \@firestitch/common/array; instead
|
|
100
|
+
* @param {?} query
|
|
101
|
+
* @param {?} item
|
|
102
|
+
* @return {?}
|
|
103
|
+
*/
|
|
104
|
+
compare(query, item) {
|
|
105
|
+
console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
|
|
106
|
+
/** @type {?} */
|
|
107
|
+
let value = true;
|
|
108
|
+
for (let key in query) {
|
|
109
|
+
value = value && item[key] == query[key];
|
|
110
|
+
}
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated use import { filter } from \@firestitch/common/array; instead
|
|
115
|
+
* @param {?} array
|
|
116
|
+
* @param {?} query
|
|
117
|
+
* @return {?}
|
|
118
|
+
*/
|
|
119
|
+
filter(array, query) {
|
|
120
|
+
console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
|
|
121
|
+
if (typeof query !== 'function') {
|
|
122
|
+
/** @type {?} */
|
|
123
|
+
let queryObj = query;
|
|
124
|
+
query = (/**
|
|
125
|
+
* @param {?} item
|
|
126
|
+
* @return {?}
|
|
127
|
+
*/
|
|
128
|
+
(item) => {
|
|
129
|
+
return this.compare(queryObj, item);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/** @type {?} */
|
|
133
|
+
let isarray = Array.isArray(array);
|
|
134
|
+
/** @type {?} */
|
|
135
|
+
let list = isarray ? [] : {};
|
|
136
|
+
if (isarray)
|
|
137
|
+
array.forEach((/**
|
|
138
|
+
* @param {?} item
|
|
139
|
+
* @param {?} idx
|
|
140
|
+
* @return {?}
|
|
141
|
+
*/
|
|
142
|
+
function (item, idx) {
|
|
143
|
+
if (query(item)) {
|
|
144
|
+
list.push(item);
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
else
|
|
148
|
+
Object.keys(array).forEach((/**
|
|
149
|
+
* @param {?} key
|
|
150
|
+
* @return {?}
|
|
151
|
+
*/
|
|
152
|
+
key => {
|
|
153
|
+
if (query(array[key])) {
|
|
154
|
+
list[key] = array[key];
|
|
155
|
+
}
|
|
156
|
+
}));
|
|
157
|
+
return list;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated use import { index } from \@firestitch/common/array; instead
|
|
161
|
+
* @param {?} array
|
|
162
|
+
* @param {?} property
|
|
163
|
+
* @return {?}
|
|
164
|
+
*/
|
|
165
|
+
index(array, property) {
|
|
166
|
+
console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
|
|
167
|
+
/** @type {?} */
|
|
168
|
+
let list = {};
|
|
169
|
+
array.forEach((/**
|
|
170
|
+
* @param {?} item
|
|
171
|
+
* @param {?} idx
|
|
172
|
+
* @return {?}
|
|
173
|
+
*/
|
|
174
|
+
function (item, idx) {
|
|
175
|
+
list[item[property]] = item;
|
|
176
|
+
}));
|
|
177
|
+
return list;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @deprecated use import { sort } from \@firestitch/common/array; instead
|
|
181
|
+
* @param {?} array
|
|
182
|
+
* @param {?} query
|
|
183
|
+
* @param {?=} reverse
|
|
184
|
+
* @return {?}
|
|
185
|
+
*/
|
|
186
|
+
sort(array, query, reverse = false) {
|
|
187
|
+
console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
|
|
188
|
+
if (typeof query !== 'function') {
|
|
189
|
+
/** @type {?} */
|
|
190
|
+
let queryStr = query;
|
|
191
|
+
query = (/**
|
|
192
|
+
* @param {?} a
|
|
193
|
+
* @param {?} b
|
|
194
|
+
* @return {?}
|
|
195
|
+
*/
|
|
196
|
+
function (a, b) {
|
|
197
|
+
if (reverse) {
|
|
198
|
+
if (a[queryStr] < b[queryStr]) {
|
|
199
|
+
return 1;
|
|
200
|
+
}
|
|
201
|
+
else if (a[queryStr] > b[queryStr]) {
|
|
202
|
+
return -1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
if (a[queryStr] > b[queryStr]) {
|
|
207
|
+
return 1;
|
|
208
|
+
}
|
|
209
|
+
else if (a[queryStr] < b[queryStr]) {
|
|
210
|
+
return -1;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return 0;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
array.sort(query);
|
|
217
|
+
return array;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @deprecated use import { rsort } from \@firestitch/common/array; instead
|
|
221
|
+
* @param {?} array
|
|
222
|
+
* @param {?} query
|
|
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;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* @fileoverview added by tsickle
|
|
817
|
+
* Generated from: app/services/vaildate.service.ts
|
|
818
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
819
|
+
*/
|
|
820
|
+
class FsValidate {
|
|
821
|
+
/**
|
|
822
|
+
* @param {?} fsUtil
|
|
823
|
+
*/
|
|
824
|
+
constructor(fsUtil) {
|
|
825
|
+
this.fsUtil = fsUtil;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* @deprecated use import { email } from \@firestitch/common/validate; instead
|
|
829
|
+
* @param {?} value
|
|
830
|
+
* @return {?}
|
|
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;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* @fileoverview added by tsickle
|
|
863
|
+
* Generated from: libs/util/stringify/stringify.ts
|
|
864
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
865
|
+
*/
|
|
866
|
+
/**
|
|
867
|
+
* @param {?} value
|
|
868
|
+
* @return {?}
|
|
869
|
+
*/
|
|
870
|
+
function stringify(value) {
|
|
871
|
+
return JSON.stringify(value);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* @fileoverview added by tsickle
|
|
876
|
+
* Generated from: libs/util/guid/guid.ts
|
|
877
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
878
|
+
*/
|
|
879
|
+
/**
|
|
880
|
+
* @param {?=} pattern
|
|
881
|
+
* @param {?=} options
|
|
882
|
+
* @return {?}
|
|
883
|
+
*/
|
|
884
|
+
function guid(pattern, options = { case: 'lower', numbers: true }) {
|
|
885
|
+
pattern = pattern || 'xxxxxx';
|
|
886
|
+
/** @type {?} */
|
|
887
|
+
let s = '';
|
|
888
|
+
if (options.numbers !== false) {
|
|
889
|
+
s = '0123456789';
|
|
890
|
+
}
|
|
891
|
+
if (!options.case || options.case === 'lower' || options.case === 'mixed') {
|
|
892
|
+
s = s.concat('abcdefghijklmnopqrstuvwxyz');
|
|
893
|
+
}
|
|
894
|
+
if (options.case === 'upper' || options.case === 'mixed') {
|
|
895
|
+
s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
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
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* @fileoverview added by tsickle
|
|
912
|
+
* Generated from: libs/util/isEmpty/isEmpty.ts
|
|
913
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
914
|
+
*/
|
|
915
|
+
/**
|
|
916
|
+
* @param {?} value
|
|
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'));
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* @fileoverview added by tsickle
|
|
934
|
+
* Generated from: app/pipes/util.pipe.ts
|
|
935
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
936
|
+
*/
|
|
937
|
+
class FsUtilStringifyPipe {
|
|
938
|
+
constructor() { }
|
|
939
|
+
/**
|
|
940
|
+
* @param {?} value
|
|
941
|
+
* @return {?}
|
|
942
|
+
*/
|
|
943
|
+
transform(value) {
|
|
944
|
+
return stringify(value);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
FsUtilStringifyPipe.decorators = [
|
|
948
|
+
{ type: Pipe, args: [{
|
|
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 });
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* @fileoverview added by tsickle
|
|
1015
|
+
* Generated from: app/pipes/number.pipe.ts
|
|
1016
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1017
|
+
*/
|
|
1018
|
+
class FsFormatNumberPipe {
|
|
1019
|
+
/**
|
|
1020
|
+
* @param {?} value
|
|
1021
|
+
* @param {?=} decimals
|
|
1022
|
+
* @return {?}
|
|
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]}`);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* @fileoverview added by tsickle
|
|
1054
|
+
* Generated from: app/pipes/currency.pipe.ts
|
|
1055
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* @fileoverview added by tsickle
|
|
1090
|
+
* Generated from: libs/format/truncate/truncate.ts
|
|
1091
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1092
|
+
*/
|
|
1093
|
+
/**
|
|
1094
|
+
* @param {?} value
|
|
1095
|
+
* @param {?=} limit
|
|
1096
|
+
* @param {?=} completeWords
|
|
1097
|
+
* @param {?=} ellipsis
|
|
1098
|
+
* @return {?}
|
|
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;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* @fileoverview added by tsickle
|
|
1115
|
+
* Generated from: app/pipes/truncate.pipe.ts
|
|
1116
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1117
|
+
*/
|
|
1118
|
+
class FsFormatTruncatePipe {
|
|
1119
|
+
constructor() { }
|
|
1120
|
+
/**
|
|
1121
|
+
* @param {?} value
|
|
1122
|
+
* @param {?=} limit
|
|
1123
|
+
* @param {?=} completeWords
|
|
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';
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* @fileoverview added by tsickle
|
|
1164
|
+
* Generated from: app/pipes/bytes.pipe.ts
|
|
1165
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1166
|
+
*/
|
|
1167
|
+
class FsFormatBytesPipe {
|
|
1168
|
+
/**
|
|
1169
|
+
* @param {?} value
|
|
1170
|
+
* @return {?}
|
|
1171
|
+
*/
|
|
1172
|
+
transform(value) {
|
|
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;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @fileoverview added by tsickle
|
|
1271
|
+
* Generated from: libs/util/ordinal-number/ordinal-number.ts
|
|
1272
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1273
|
+
*/
|
|
1274
|
+
/**
|
|
1275
|
+
* @param {?} value
|
|
1276
|
+
* @return {?}
|
|
1277
|
+
*/
|
|
1278
|
+
function ordinalNumber(value) {
|
|
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;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @fileoverview added by tsickle
|
|
1291
|
+
* Generated from: app/pipes/ordinal-number.pipe.ts
|
|
1292
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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,}))$/);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* @fileoverview added by tsickle
|
|
1381
|
+
* Generated from: libs/validate/email/index.ts
|
|
1382
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1383
|
+
*/
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* @fileoverview added by tsickle
|
|
1387
|
+
* Generated from: libs/validate/phone/phone.ts
|
|
1388
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* @fileoverview added by tsickle
|
|
1402
|
+
* Generated from: libs/validate/phone/index.ts
|
|
1403
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* @fileoverview added by tsickle
|
|
1431
|
+
* Generated from: libs/validate/url/index.ts
|
|
1432
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1433
|
+
*/
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* @fileoverview added by tsickle
|
|
1437
|
+
* Generated from: libs/validate/index.ts
|
|
1438
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1439
|
+
*/
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* @fileoverview added by tsickle
|
|
1443
|
+
* Generated from: libs/array/compare/compare.ts
|
|
1444
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1445
|
+
*/
|
|
1446
|
+
/**
|
|
1447
|
+
* @param {?} query
|
|
1448
|
+
* @param {?} item
|
|
1449
|
+
* @return {?}
|
|
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;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* @fileoverview added by tsickle
|
|
1462
|
+
* Generated from: libs/array/compare/index.ts
|
|
1463
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @fileoverview added by tsickle
|
|
1520
|
+
* Generated from: libs/array/filter/index.ts
|
|
1521
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1522
|
+
*/
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* @fileoverview added by tsickle
|
|
1526
|
+
* Generated from: libs/array/inArray/inArray.ts
|
|
1527
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1528
|
+
*/
|
|
1529
|
+
/**
|
|
1530
|
+
* @param {?} values
|
|
1531
|
+
* @param {?} array
|
|
1532
|
+
* @return {?}
|
|
1533
|
+
*/
|
|
1534
|
+
function inArray(values, array) {
|
|
1535
|
+
if (!Array.isArray(values)) {
|
|
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;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* @fileoverview added by tsickle
|
|
1548
|
+
* Generated from: libs/array/inArray/index.ts
|
|
1549
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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 {?} property
|
|
1560
|
+
* @return {?}
|
|
1561
|
+
*/
|
|
1562
|
+
function index(array, property) {
|
|
1563
|
+
/** @type {?} */
|
|
1564
|
+
const list = {};
|
|
1565
|
+
array.forEach((/**
|
|
1566
|
+
* @param {?} item
|
|
1567
|
+
* @param {?} idx
|
|
1568
|
+
* @return {?}
|
|
1569
|
+
*/
|
|
1570
|
+
function (item, idx) {
|
|
1571
|
+
list[item[property]] = item;
|
|
1572
|
+
}));
|
|
1573
|
+
return list;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
/**
|
|
1577
|
+
* @fileoverview added by tsickle
|
|
1578
|
+
* Generated from: libs/array/indexOf/indexOf.ts
|
|
1579
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1580
|
+
*/
|
|
1581
|
+
/**
|
|
1582
|
+
* @param {?} array
|
|
1583
|
+
* @param {?} query
|
|
1584
|
+
* @return {?}
|
|
1585
|
+
*/
|
|
1586
|
+
function indexOf(array, query) {
|
|
1587
|
+
if (typeof query !== 'function') {
|
|
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;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* @fileoverview added by tsickle
|
|
1608
|
+
* Generated from: libs/array/indexOf/index.ts
|
|
1609
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1610
|
+
*/
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* @fileoverview added by tsickle
|
|
1614
|
+
* Generated from: libs/array/keyExists/keyExists.ts
|
|
1615
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1616
|
+
*/
|
|
1617
|
+
/**
|
|
1618
|
+
* @param {?} array
|
|
1619
|
+
* @param {?} key
|
|
1620
|
+
* @return {?}
|
|
1621
|
+
*/
|
|
1622
|
+
function keyExists(array, key) {
|
|
1623
|
+
return array.hasOwnProperty(key);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
/**
|
|
1627
|
+
* @fileoverview added by tsickle
|
|
1628
|
+
* Generated from: libs/array/keyExists/index.ts
|
|
1629
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1630
|
+
*/
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* @fileoverview added by tsickle
|
|
1634
|
+
* Generated from: libs/array/ksort/ksort.ts
|
|
1635
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1636
|
+
*/
|
|
1637
|
+
/**
|
|
1638
|
+
* @param {?} unordered
|
|
1639
|
+
* @return {?}
|
|
1640
|
+
*/
|
|
1641
|
+
function ksort(unordered) {
|
|
1642
|
+
Object.keys(unordered).sort().forEach((/**
|
|
1643
|
+
* @param {?} key
|
|
1644
|
+
* @return {?}
|
|
1645
|
+
*/
|
|
1646
|
+
function (key) {
|
|
1647
|
+
/** @type {?} */
|
|
1648
|
+
const value = unordered[key];
|
|
1649
|
+
delete unordered[key];
|
|
1650
|
+
unordered[key] = value;
|
|
1651
|
+
}));
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* @fileoverview added by tsickle
|
|
1656
|
+
* Generated from: libs/array/ksort/index.ts
|
|
1657
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1658
|
+
*/
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* @fileoverview added by tsickle
|
|
1662
|
+
* Generated from: libs/array/list/list.ts
|
|
1663
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1664
|
+
*/
|
|
1665
|
+
/**
|
|
1666
|
+
* @param {?} array
|
|
1667
|
+
* @param {?} property
|
|
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;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* @fileoverview added by tsickle
|
|
1692
|
+
* Generated from: libs/array/list/index.ts
|
|
1693
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
/**
|
|
1749
|
+
* @fileoverview added by tsickle
|
|
1750
|
+
* Generated from: libs/array/nameValue/index.ts
|
|
1751
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1752
|
+
*/
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* @fileoverview added by tsickle
|
|
1756
|
+
* Generated from: libs/array/remove/remove.ts
|
|
1757
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1758
|
+
*/
|
|
1759
|
+
/**
|
|
1760
|
+
* @param {?} array
|
|
1761
|
+
* @param {?} query
|
|
1762
|
+
* @return {?}
|
|
1763
|
+
*/
|
|
1764
|
+
function remove(array, query) {
|
|
1765
|
+
/** @type {?} */
|
|
1766
|
+
const idx = indexOf(array, query);
|
|
1767
|
+
if (idx >= 0) {
|
|
1768
|
+
return array.splice(idx, 1);
|
|
1769
|
+
}
|
|
1770
|
+
return idx;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* @fileoverview added by tsickle
|
|
1775
|
+
* Generated from: libs/array/remove/index.ts
|
|
1776
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1777
|
+
*/
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* @fileoverview added by tsickle
|
|
1781
|
+
* Generated from: libs/array/sort/sort.ts
|
|
1782
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1783
|
+
*/
|
|
1784
|
+
/**
|
|
1785
|
+
* @param {?} array
|
|
1786
|
+
* @param {?} query
|
|
1787
|
+
* @param {?=} reverse
|
|
1788
|
+
* @return {?}
|
|
1789
|
+
*/
|
|
1790
|
+
function sort(array, query, reverse = false) {
|
|
1791
|
+
if (typeof query !== 'function') {
|
|
1792
|
+
/** @type {?} */
|
|
1793
|
+
const queryStr = query;
|
|
1794
|
+
query = (/**
|
|
1795
|
+
* @param {?} a
|
|
1796
|
+
* @param {?} b
|
|
1797
|
+
* @return {?}
|
|
1798
|
+
*/
|
|
1799
|
+
function (a, b) {
|
|
1800
|
+
if (reverse) {
|
|
1801
|
+
if (a[queryStr] < b[queryStr]) {
|
|
1802
|
+
return 1;
|
|
1803
|
+
}
|
|
1804
|
+
else if (a[queryStr] > b[queryStr]) {
|
|
1805
|
+
return -1;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
else {
|
|
1809
|
+
if (a[queryStr] > b[queryStr]) {
|
|
1810
|
+
return 1;
|
|
1811
|
+
}
|
|
1812
|
+
else if (a[queryStr] < b[queryStr]) {
|
|
1813
|
+
return -1;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
return 0;
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
array.sort(query);
|
|
1820
|
+
return array;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* @fileoverview added by tsickle
|
|
1825
|
+
* Generated from: libs/array/sort/index.ts
|
|
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);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* @fileoverview added by tsickle
|
|
1845
|
+
* Generated from: libs/array/rsort/index.ts
|
|
1846
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1847
|
+
*/
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* @fileoverview added by tsickle
|
|
1851
|
+
* Generated from: libs/array/find/find.ts
|
|
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;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* @fileoverview added by tsickle
|
|
1867
|
+
* Generated from: libs/array/find/index.ts
|
|
1868
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* @fileoverview added by tsickle
|
|
1892
|
+
* Generated from: libs/util/boolean/index.ts
|
|
1893
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1894
|
+
*/
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* @fileoverview added by tsickle
|
|
1898
|
+
* Generated from: libs/util/debounce/debounce.ts
|
|
1899
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1900
|
+
*/
|
|
1901
|
+
/**
|
|
1902
|
+
* @param {?} func
|
|
1903
|
+
* @param {?} wait
|
|
1904
|
+
* @param {?} immediate
|
|
1905
|
+
* @return {?}
|
|
1906
|
+
*/
|
|
1907
|
+
function debounce(func, wait, immediate) {
|
|
1908
|
+
/** @type {?} */
|
|
1909
|
+
let timeout;
|
|
1910
|
+
return (/**
|
|
1911
|
+
* @return {?}
|
|
1912
|
+
*/
|
|
1913
|
+
function () {
|
|
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
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* @fileoverview added by tsickle
|
|
1938
|
+
* Generated from: libs/util/debounce/index.ts
|
|
1939
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1940
|
+
*/
|
|
1941
|
+
|
|
1942
|
+
/**
|
|
1943
|
+
* @fileoverview added by tsickle
|
|
1944
|
+
* Generated from: libs/util/guid/index.ts
|
|
1945
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
* @fileoverview added by tsickle
|
|
2055
|
+
* Generated from: libs/util/length/index.ts
|
|
2056
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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
|
+
}));
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* @fileoverview added by tsickle
|
|
2094
|
+
* Generated from: libs/util/resolve/index.ts
|
|
2095
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2096
|
+
*/
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* @fileoverview added by tsickle
|
|
2100
|
+
* Generated from: libs/util/stringify/index.ts
|
|
2101
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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');
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
/**
|
|
2117
|
+
* @fileoverview added by tsickle
|
|
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;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* @fileoverview added by tsickle
|
|
2144
|
+
* Generated from: libs/util/value/index.ts
|
|
2145
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
/**
|
|
2177
|
+
* @fileoverview added by tsickle
|
|
2178
|
+
* Generated from: libs/util/isClass/index.ts
|
|
2179
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2180
|
+
*/
|
|
2181
|
+
|
|
2182
|
+
/**
|
|
2183
|
+
* @fileoverview added by tsickle
|
|
2184
|
+
* Generated from: libs/util/isNumeric/isNumeric.ts
|
|
2185
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
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*$/);
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* @fileoverview added by tsickle
|
|
2199
|
+
* Generated from: libs/util/isNumeric/index.ts
|
|
2200
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2201
|
+
*/
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* @fileoverview added by tsickle
|
|
2205
|
+
* Generated from: libs/util/isEmpty/index.ts
|
|
2206
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2207
|
+
*/
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* @fileoverview added by tsickle
|
|
2211
|
+
* Generated from: libs/util/throttle/throttle.ts
|
|
2212
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2213
|
+
*/
|
|
2214
|
+
/**
|
|
2215
|
+
* @param {?} func
|
|
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
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* @fileoverview added by tsickle
|
|
2241
|
+
* Generated from: libs/util/throttle/index.ts
|
|
2242
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2243
|
+
*/
|
|
2244
|
+
|
|
2245
|
+
/**
|
|
2246
|
+
* @fileoverview added by tsickle
|
|
2247
|
+
* Generated from: libs/util/queue/operation.ts
|
|
2248
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2249
|
+
*/
|
|
2250
|
+
class Operation {
|
|
2251
|
+
/**
|
|
2252
|
+
* @param {?} target
|
|
2253
|
+
* @param {?=} name
|
|
2254
|
+
*/
|
|
2255
|
+
constructor(target, name) {
|
|
2256
|
+
this.ready$ = new Subject();
|
|
2257
|
+
this.name = name ? name : guid();
|
|
2258
|
+
if (target instanceof Observable) {
|
|
2259
|
+
this.target = target;
|
|
2260
|
+
}
|
|
2261
|
+
else {
|
|
2262
|
+
this.target = of(target);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
if (false) {
|
|
2267
|
+
/** @type {?} */
|
|
2268
|
+
Operation.prototype.name;
|
|
2269
|
+
/** @type {?} */
|
|
2270
|
+
Operation.prototype.target;
|
|
2271
|
+
/** @type {?} */
|
|
2272
|
+
Operation.prototype.ready$;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* @fileoverview added by tsickle
|
|
2277
|
+
* Generated from: libs/util/queue/queue.enum.ts
|
|
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
|
+
};
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* @fileoverview added by tsickle
|
|
2288
|
+
* Generated from: libs/util/queue/queue.ts
|
|
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;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
/**
|
|
2574
|
+
* @fileoverview added by tsickle
|
|
2575
|
+
* Generated from: libs/util/queue/index.ts
|
|
2576
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2577
|
+
*/
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* @fileoverview added by tsickle
|
|
2581
|
+
* Generated from: libs/util/remove-query-params/remove-query-params.ts
|
|
2582
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2583
|
+
*/
|
|
2584
|
+
/**
|
|
2585
|
+
* @param {?} path
|
|
2586
|
+
* @return {?}
|
|
2587
|
+
*/
|
|
2588
|
+
function removeQueryParams(path) {
|
|
2589
|
+
return path.split('?')[0];
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
/**
|
|
2593
|
+
* @fileoverview added by tsickle
|
|
2594
|
+
* Generated from: libs/util/remove-query-params/index.ts
|
|
2595
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2596
|
+
*/
|
|
2597
|
+
|
|
2598
|
+
/**
|
|
2599
|
+
* @fileoverview added by tsickle
|
|
2600
|
+
* Generated from: libs/util/get-normalized-path/get-normalized-path.ts
|
|
2601
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2602
|
+
*/
|
|
2603
|
+
/**
|
|
2604
|
+
* @param {?} locationSrv
|
|
2605
|
+
* @return {?}
|
|
2606
|
+
*/
|
|
2607
|
+
function getNormalizedPath(locationSrv) {
|
|
2608
|
+
/** @type {?} */
|
|
2609
|
+
const path = locationSrv.prepareExternalUrl(locationSrv.path());
|
|
2610
|
+
return removeQueryParams(path);
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
/**
|
|
2614
|
+
* @fileoverview added by tsickle
|
|
2615
|
+
* Generated from: libs/util/get-normalized-path/index.ts
|
|
2616
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2617
|
+
*/
|
|
2618
|
+
|
|
2619
|
+
/**
|
|
2620
|
+
* @fileoverview added by tsickle
|
|
2621
|
+
* Generated from: libs/util/index.ts
|
|
2622
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2623
|
+
*/
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* @fileoverview added by tsickle
|
|
2627
|
+
* Generated from: libs/format/number/index.ts
|
|
2628
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2629
|
+
*/
|
|
2630
|
+
|
|
2631
|
+
/**
|
|
2632
|
+
* @fileoverview added by tsickle
|
|
2633
|
+
* Generated from: libs/format/acronym/acronym.ts
|
|
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;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
/**
|
|
2666
|
+
* @fileoverview added by tsickle
|
|
2667
|
+
* Generated from: libs/format/acronym/index.ts
|
|
2668
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2669
|
+
*/
|
|
2670
|
+
|
|
2671
|
+
/**
|
|
2672
|
+
* @fileoverview added by tsickle
|
|
2673
|
+
* Generated from: libs/format/currency/index.ts
|
|
2674
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2675
|
+
*/
|
|
2676
|
+
|
|
2677
|
+
/**
|
|
2678
|
+
* @fileoverview added by tsickle
|
|
2679
|
+
* Generated from: libs/format/truncate/index.ts
|
|
2680
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2681
|
+
*/
|
|
2682
|
+
|
|
2683
|
+
/**
|
|
2684
|
+
* @fileoverview added by tsickle
|
|
2685
|
+
* Generated from: libs/format/bytes/index.ts
|
|
2686
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2687
|
+
*/
|
|
2688
|
+
|
|
2689
|
+
/**
|
|
2690
|
+
* @fileoverview added by tsickle
|
|
2691
|
+
* Generated from: libs/format/index.ts
|
|
2692
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2693
|
+
*/
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* @fileoverview added by tsickle
|
|
2697
|
+
* Generated from: libs/rxjs/delayedRetry.ts
|
|
2698
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2699
|
+
*/
|
|
2700
|
+
/**
|
|
2701
|
+
* @param {?} delayMs
|
|
2702
|
+
* @param {?=} maxRetry
|
|
2703
|
+
* @param {?=} message
|
|
2704
|
+
* @return {?}
|
|
2705
|
+
*/
|
|
2706
|
+
function delayedRetry(delayMs, maxRetry = 5, message) {
|
|
2707
|
+
/** @type {?} */
|
|
2708
|
+
let retries = 0;
|
|
2709
|
+
return (/**
|
|
2710
|
+
* @param {?} src
|
|
2711
|
+
* @return {?}
|
|
2712
|
+
*/
|
|
2713
|
+
(src) => src.pipe(retryWhen((/**
|
|
2714
|
+
* @param {?} errors
|
|
2715
|
+
* @return {?}
|
|
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;
|
|
2749
|
+
|
|
2750
|
+
/**
|
|
2751
|
+
* @fileoverview added by tsickle
|
|
2752
|
+
* Generated from: libs/index.ts
|
|
2753
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2754
|
+
*/
|
|
2755
|
+
|
|
2756
|
+
/**
|
|
2757
|
+
* @fileoverview added by tsickle
|
|
2758
|
+
* Generated from: public_api.ts
|
|
2759
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2760
|
+
*/
|
|
2761
|
+
|
|
2762
|
+
/**
|
|
2763
|
+
* @fileoverview added by tsickle
|
|
2764
|
+
* Generated from: firestitch-common.ts
|
|
2765
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2766
|
+
*/
|
|
2767
|
+
|
|
2768
|
+
export { FsArray, FsCommonModule, FsMath, FsUtil, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, 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, FsStopPropagationDirective as ɵa, FsPreventDefaultDirective as ɵb, FsAutofocusDirective as ɵc, FsUtilStringifyPipe as ɵd, FsUtilGuidPipe as ɵe, FsUtilIsEmptyPipe as ɵf, FsUtilIsNotEmptyPipe as ɵg, FsFormatNumberPipe as ɵh, FsFormatCurrencyPipe as ɵi, FsFormatTruncatePipe as ɵj, FsFormatBytesPipe as ɵk, FsFormatOrdinalNumberPipe as ɵl };
|
|
2769
|
+
//# sourceMappingURL=firestitch-common.js.map
|