@firestitch/common 12.3.2 → 12.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/directives/autofocus.directive.d.ts +9 -9
- package/app/directives/prevent-default.directive.d.ts +6 -6
- package/app/directives/stop-propagation.directive.d.ts +6 -6
- package/app/fs-common.module.d.ts +18 -18
- package/app/pipes/bytes.pipe.d.ts +7 -7
- package/app/pipes/currency.pipe.d.ts +9 -9
- package/app/pipes/index.d.ts +2 -2
- package/app/pipes/number.pipe.d.ts +7 -7
- package/app/pipes/ordinal-number.pipe.d.ts +7 -7
- package/app/pipes/truncate.pipe.d.ts +8 -8
- package/app/pipes/util.pipe.d.ts +24 -24
- package/app/services/array.service.d.ts +61 -61
- package/app/services/math.service.d.ts +9 -9
- package/app/services/util.service.d.ts +89 -89
- package/app/services/vaildate.service.d.ts +16 -16
- package/bundles/firestitch-common.umd.js +1884 -1740
- package/bundles/firestitch-common.umd.js.map +1 -1
- package/esm2015/app/directives/autofocus.directive.js +20 -20
- package/esm2015/app/directives/prevent-default.directive.js +18 -18
- package/esm2015/app/directives/stop-propagation.directive.js +18 -18
- package/esm2015/app/fs-common.module.js +92 -92
- package/esm2015/app/pipes/bytes.pipe.js +16 -16
- package/esm2015/app/pipes/currency.pipe.js +22 -22
- package/esm2015/app/pipes/index.js +2 -2
- package/esm2015/app/pipes/number.pipe.js +16 -16
- package/esm2015/app/pipes/ordinal-number.pipe.js +16 -16
- package/esm2015/app/pipes/truncate.pipe.js +17 -17
- package/esm2015/app/pipes/util.pipe.js +59 -59
- package/esm2015/app/services/array.service.js +224 -224
- package/esm2015/app/services/math.service.js +20 -20
- package/esm2015/app/services/util.service.js +250 -250
- package/esm2015/app/services/vaildate.service.js +27 -27
- package/esm2015/firestitch-common.js +4 -4
- package/esm2015/libs/array/compare/compare.js +7 -7
- package/esm2015/libs/array/compare/index.js +1 -1
- package/esm2015/libs/array/filter/filter.js +26 -26
- package/esm2015/libs/array/filter/index.js +1 -1
- package/esm2015/libs/array/find/find.js +5 -5
- package/esm2015/libs/array/find/index.js +1 -1
- package/esm2015/libs/array/inArray/inArray.js +11 -11
- package/esm2015/libs/array/inArray/index.js +1 -1
- package/esm2015/libs/array/index/index.js +7 -7
- package/esm2015/libs/array/index.js +13 -13
- package/esm2015/libs/array/indexOf/index.js +1 -1
- package/esm2015/libs/array/indexOf/indexOf.js +15 -15
- package/esm2015/libs/array/keyExists/index.js +1 -1
- package/esm2015/libs/array/keyExists/keyExists.js +3 -3
- package/esm2015/libs/array/ksort/index.js +1 -1
- package/esm2015/libs/array/ksort/ksort.js +7 -7
- package/esm2015/libs/array/list/index.js +1 -1
- package/esm2015/libs/array/list/list.js +12 -12
- package/esm2015/libs/array/nameValue/index.js +1 -1
- package/esm2015/libs/array/nameValue/nameValue.js +20 -20
- package/esm2015/libs/array/remove/index.js +1 -1
- package/esm2015/libs/array/remove/remove.js +8 -8
- package/esm2015/libs/array/rsort/index.js +1 -1
- package/esm2015/libs/array/rsort/rsort.js +4 -4
- package/esm2015/libs/array/sort/index.js +1 -1
- package/esm2015/libs/array/sort/sort.js +26 -26
- package/esm2015/libs/format/acronym/acronym.js +21 -21
- package/esm2015/libs/format/acronym/index.js +1 -1
- package/esm2015/libs/format/bytes/bytes.js +17 -17
- package/esm2015/libs/format/bytes/index.js +1 -1
- package/esm2015/libs/format/currency/currency.js +5 -5
- package/esm2015/libs/format/currency/index.js +1 -1
- package/esm2015/libs/format/index.js +5 -5
- package/esm2015/libs/format/number/index.js +1 -1
- package/esm2015/libs/format/number/number.js +3 -3
- package/esm2015/libs/format/truncate/index.js +1 -1
- package/esm2015/libs/format/truncate/truncate.js +11 -11
- package/esm2015/libs/index.js +5 -5
- package/esm2015/libs/rxjs/delayedRetry.js +19 -19
- package/esm2015/libs/rxjs/keyboard-shortcut.js +17 -17
- package/esm2015/libs/util/boolean/boolean.js +3 -3
- package/esm2015/libs/util/boolean/index.js +1 -1
- package/esm2015/libs/util/clone/clone.js +20 -20
- package/esm2015/libs/util/clone/index.js +1 -1
- package/esm2015/libs/util/debounce/debounce.js +16 -16
- package/esm2015/libs/util/debounce/index.js +1 -1
- package/esm2015/libs/util/get-normalized-path/get-normalized-path.js +5 -5
- package/esm2015/libs/util/get-normalized-path/index.js +1 -1
- package/esm2015/libs/util/guid/guid.js +18 -18
- package/esm2015/libs/util/guid/index.js +1 -1
- package/esm2015/libs/util/index.js +22 -21
- package/esm2015/libs/util/is-array-equal/is-array-equal.js +21 -21
- package/esm2015/libs/util/isClass/index.js +1 -1
- package/esm2015/libs/util/isClass/isClass.js +17 -17
- package/esm2015/libs/util/isEmpty/index.js +1 -1
- package/esm2015/libs/util/isEmpty/isEmpty.js +11 -11
- package/esm2015/libs/util/isNumeric/index.js +1 -1
- package/esm2015/libs/util/isNumeric/isNumeric.js +4 -4
- package/esm2015/libs/util/keys/index.js +1 -1
- package/esm2015/libs/util/keys/keys.js +37 -37
- package/esm2015/libs/util/length/index.js +1 -1
- package/esm2015/libs/util/length/length.js +9 -9
- package/esm2015/libs/util/ordinal-number/ordinal-number.js +7 -7
- package/esm2015/libs/util/queue/index.js +2 -2
- package/esm2015/libs/util/queue/operation.js +14 -14
- package/esm2015/libs/util/queue/queue.enum.js +5 -5
- package/esm2015/libs/util/queue/queue.js +136 -136
- package/esm2015/libs/util/remove-query-params/index.js +1 -1
- package/esm2015/libs/util/remove-query-params/remove-query-params.js +3 -3
- package/esm2015/libs/util/resolve/index.js +1 -1
- package/esm2015/libs/util/resolve/resolve.js +9 -9
- package/esm2015/libs/util/round/index.js +1 -1
- package/esm2015/libs/util/round/round.js +4 -4
- package/esm2015/libs/util/source-loader/source-loader.js +145 -0
- package/esm2015/libs/util/stringify/index.js +1 -1
- package/esm2015/libs/util/stringify/stringify.js +3 -3
- package/esm2015/libs/util/throttle/index.js +1 -1
- package/esm2015/libs/util/throttle/throttle.js +12 -12
- package/esm2015/libs/util/uuid/index.js +1 -1
- package/esm2015/libs/util/uuid/uuid.js +4 -4
- package/esm2015/libs/util/value/index.js +1 -1
- package/esm2015/libs/util/value/value.js +8 -8
- package/esm2015/libs/validate/email/email.js +3 -3
- package/esm2015/libs/validate/email/index.js +1 -1
- package/esm2015/libs/validate/index.js +3 -3
- package/esm2015/libs/validate/phone/index.js +1 -1
- package/esm2015/libs/validate/phone/phone.js +4 -4
- package/esm2015/libs/validate/url/index.js +1 -1
- package/esm2015/libs/validate/url/url.js +11 -11
- package/esm2015/public_api.js +21 -21
- package/fesm2015/firestitch-common.js +1463 -1320
- package/fesm2015/firestitch-common.js.map +1 -1
- package/firestitch-common.d.ts +5 -5
- package/libs/array/compare/compare.d.ts +1 -1
- package/libs/array/compare/index.d.ts +1 -1
- package/libs/array/filter/filter.d.ts +1 -1
- package/libs/array/filter/index.d.ts +1 -1
- package/libs/array/find/find.d.ts +1 -1
- package/libs/array/find/index.d.ts +1 -1
- package/libs/array/inArray/inArray.d.ts +1 -1
- package/libs/array/inArray/index.d.ts +1 -1
- package/libs/array/index/index.d.ts +1 -1
- package/libs/array/index.d.ts +13 -13
- package/libs/array/indexOf/index.d.ts +1 -1
- package/libs/array/indexOf/indexOf.d.ts +1 -1
- package/libs/array/keyExists/index.d.ts +1 -1
- package/libs/array/keyExists/keyExists.d.ts +1 -1
- package/libs/array/ksort/index.d.ts +1 -1
- package/libs/array/ksort/ksort.d.ts +1 -1
- package/libs/array/list/index.d.ts +1 -1
- package/libs/array/list/list.d.ts +1 -1
- package/libs/array/nameValue/index.d.ts +1 -1
- package/libs/array/nameValue/nameValue.d.ts +1 -1
- package/libs/array/remove/index.d.ts +1 -1
- package/libs/array/remove/remove.d.ts +1 -1
- package/libs/array/rsort/index.d.ts +1 -1
- package/libs/array/rsort/rsort.d.ts +1 -1
- package/libs/array/sort/index.d.ts +1 -1
- package/libs/array/sort/sort.d.ts +1 -1
- package/libs/format/acronym/acronym.d.ts +1 -1
- package/libs/format/acronym/index.d.ts +1 -1
- package/libs/format/bytes/bytes.d.ts +1 -1
- package/libs/format/bytes/index.d.ts +1 -1
- package/libs/format/currency/currency.d.ts +1 -1
- package/libs/format/currency/index.d.ts +1 -1
- package/libs/format/index.d.ts +5 -5
- package/libs/format/number/index.d.ts +1 -1
- package/libs/format/number/number.d.ts +1 -1
- package/libs/format/truncate/index.d.ts +1 -1
- package/libs/format/truncate/truncate.d.ts +1 -1
- package/libs/index.d.ts +5 -5
- package/libs/rxjs/delayedRetry.d.ts +2 -2
- package/libs/rxjs/keyboard-shortcut.d.ts +2 -2
- package/libs/util/boolean/boolean.d.ts +1 -1
- package/libs/util/boolean/index.d.ts +1 -1
- package/libs/util/clone/clone.d.ts +1 -1
- package/libs/util/clone/index.d.ts +1 -1
- package/libs/util/debounce/debounce.d.ts +1 -1
- package/libs/util/debounce/index.d.ts +1 -1
- package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
- package/libs/util/get-normalized-path/index.d.ts +1 -1
- package/libs/util/guid/guid.d.ts +1 -1
- package/libs/util/guid/index.d.ts +1 -1
- package/libs/util/index.d.ts +21 -20
- package/libs/util/is-array-equal/is-array-equal.d.ts +1 -1
- package/libs/util/isClass/index.d.ts +1 -1
- package/libs/util/isClass/isClass.d.ts +1 -1
- package/libs/util/isEmpty/index.d.ts +1 -1
- package/libs/util/isEmpty/isEmpty.d.ts +1 -1
- package/libs/util/isNumeric/index.d.ts +1 -1
- package/libs/util/isNumeric/isNumeric.d.ts +1 -1
- package/libs/util/keys/index.d.ts +1 -1
- package/libs/util/keys/keys.d.ts +37 -37
- package/libs/util/length/index.d.ts +1 -1
- package/libs/util/length/length.d.ts +1 -1
- package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
- package/libs/util/queue/index.d.ts +2 -2
- package/libs/util/queue/operation.d.ts +7 -7
- package/libs/util/queue/queue.d.ts +32 -32
- package/libs/util/queue/queue.enum.d.ts +4 -4
- package/libs/util/remove-query-params/index.d.ts +1 -1
- package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
- package/libs/util/resolve/index.d.ts +1 -1
- package/libs/util/resolve/resolve.d.ts +1 -1
- package/libs/util/round/index.d.ts +1 -1
- package/libs/util/round/round.d.ts +1 -1
- package/libs/util/source-loader/source-loader.d.ts +7 -0
- package/libs/util/stringify/index.d.ts +1 -1
- package/libs/util/stringify/stringify.d.ts +1 -1
- package/libs/util/throttle/index.d.ts +1 -1
- package/libs/util/throttle/throttle.d.ts +1 -1
- package/libs/util/uuid/index.d.ts +1 -1
- package/libs/util/uuid/uuid.d.ts +1 -1
- package/libs/util/value/index.d.ts +1 -1
- package/libs/util/value/value.d.ts +1 -1
- package/libs/validate/email/email.d.ts +1 -1
- package/libs/validate/email/index.d.ts +1 -1
- package/libs/validate/index.d.ts +3 -3
- package/libs/validate/phone/index.d.ts +1 -1
- package/libs/validate/phone/phone.d.ts +1 -1
- package/libs/validate/url/index.d.ts +1 -1
- package/libs/validate/url/url.d.ts +7 -7
- package/package.json +1 -1
- package/public_api.d.ts +16 -16
|
@@ -24,1868 +24,2011 @@
|
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
26
|
|
|
27
|
-
var FsArray = /** @class */ (function () {
|
|
28
|
-
function FsArray() {
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated use import { nameValue } from @firestitch/common/array; instead
|
|
32
|
-
*/
|
|
33
|
-
FsArray.prototype.nameValue = function (array, name, value) {
|
|
34
|
-
console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
|
|
35
|
-
var list = [];
|
|
36
|
-
if (name || value) {
|
|
37
|
-
var nameFn_1 = typeof name === 'function' ? name : function (item) { return item[name]; };
|
|
38
|
-
var valueFn_1 = typeof value === 'function' ? value : function (item) { return item[value]; };
|
|
39
|
-
array.forEach(function (item) {
|
|
40
|
-
list.push({ name: nameFn_1(item), value: valueFn_1(item) });
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
array.forEach(function (name, value) {
|
|
45
|
-
list.push({ name: name, value: value });
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return list;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated use import { remove } from @firestitch/common/array; instead
|
|
52
|
-
*/
|
|
53
|
-
FsArray.prototype.remove = function (array, query) {
|
|
54
|
-
console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
|
|
55
|
-
var idx = this.indexOf(array, query);
|
|
56
|
-
if (idx >= 0) {
|
|
57
|
-
return array.splice(idx, 1);
|
|
58
|
-
}
|
|
59
|
-
return idx;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated use import { indexOf } from @firestitch/common/array; instead
|
|
63
|
-
*/
|
|
64
|
-
FsArray.prototype.indexOf = function (array, query) {
|
|
65
|
-
var _this = this;
|
|
66
|
-
console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
|
|
67
|
-
if (typeof query !== 'function') {
|
|
68
|
-
var queryObj_1 = query;
|
|
69
|
-
query = function (item) {
|
|
70
|
-
return _this.compare(queryObj_1, item);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
for (var i = 0, len = array.length; i < len; i++) {
|
|
74
|
-
if (query(array[i])) {
|
|
75
|
-
return i;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return -1;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated use import { compare } from @firestitch/common/array; instead
|
|
82
|
-
*/
|
|
83
|
-
FsArray.prototype.compare = function (query, item) {
|
|
84
|
-
console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
|
|
85
|
-
var value = true;
|
|
86
|
-
for (var key in query) {
|
|
87
|
-
value = value && item[key] == query[key];
|
|
88
|
-
}
|
|
89
|
-
return value;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated use import { filter } from @firestitch/common/array; instead
|
|
93
|
-
*/
|
|
94
|
-
FsArray.prototype.filter = function (array, query) {
|
|
95
|
-
var _this = this;
|
|
96
|
-
console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
|
|
97
|
-
if (typeof query !== 'function') {
|
|
98
|
-
var queryObj_2 = query;
|
|
99
|
-
query = function (item) {
|
|
100
|
-
return _this.compare(queryObj_2, item);
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
var isarray = Array.isArray(array);
|
|
104
|
-
var list = isarray ? [] : {};
|
|
105
|
-
if (isarray)
|
|
106
|
-
array.forEach(function (item, idx) {
|
|
107
|
-
if (query(item)) {
|
|
108
|
-
list.push(item);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
else
|
|
112
|
-
Object.keys(array).forEach(function (key) {
|
|
113
|
-
if (query(array[key])) {
|
|
114
|
-
list[key] = array[key];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return list;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @deprecated use import { index } from @firestitch/common/array; instead
|
|
121
|
-
*/
|
|
122
|
-
FsArray.prototype.index = function (array, property) {
|
|
123
|
-
console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
|
|
124
|
-
var list = {};
|
|
125
|
-
array.forEach(function (item, idx) {
|
|
126
|
-
list[item[property]] = item;
|
|
127
|
-
});
|
|
128
|
-
return list;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated use import { sort } from @firestitch/common/array; instead
|
|
132
|
-
*/
|
|
133
|
-
FsArray.prototype.sort = function (array, query, reverse) {
|
|
134
|
-
if (reverse === void 0) { reverse = false; }
|
|
135
|
-
console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
|
|
136
|
-
if (typeof query !== 'function') {
|
|
137
|
-
var queryStr_1 = query;
|
|
138
|
-
query = function (a, b) {
|
|
139
|
-
if (reverse) {
|
|
140
|
-
if (a[queryStr_1] < b[queryStr_1]) {
|
|
141
|
-
return 1;
|
|
142
|
-
}
|
|
143
|
-
else if (a[queryStr_1] > b[queryStr_1]) {
|
|
144
|
-
return -1;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
if (a[queryStr_1] > b[queryStr_1]) {
|
|
149
|
-
return 1;
|
|
150
|
-
}
|
|
151
|
-
else if (a[queryStr_1] < b[queryStr_1]) {
|
|
152
|
-
return -1;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return 0;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
array.sort(query);
|
|
159
|
-
return array;
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* @deprecated use import { rsort } from @firestitch/common/array; instead
|
|
163
|
-
*/
|
|
164
|
-
FsArray.prototype.rsort = function (array, query) {
|
|
165
|
-
console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
|
|
166
|
-
return this.sort(array, query, true);
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* @deprecated use import { list } from @firestitch/common/array; instead
|
|
170
|
-
*/
|
|
171
|
-
FsArray.prototype.list = function (array, property, index) {
|
|
172
|
-
if (index === void 0) { index = null; }
|
|
173
|
-
console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
|
|
174
|
-
var list = index ? {} : [];
|
|
175
|
-
array.forEach(function (item, idx) {
|
|
176
|
-
if (index) {
|
|
177
|
-
list[item[index]] = item[property];
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
list.push(item[property]);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
return list;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* @deprecated use import { applyDepth } from @firestitch/common/array; instead
|
|
187
|
-
*/
|
|
188
|
-
FsArray.prototype.applyDepth = function (objects, parent_property, id_property, depth_property) {
|
|
189
|
-
if (id_property === void 0) { id_property = 'id'; }
|
|
190
|
-
if (depth_property === void 0) { depth_property = 'depth'; }
|
|
191
|
-
console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
|
|
192
|
-
var keyed = {};
|
|
193
|
-
objects.forEach(function (object) {
|
|
194
|
-
if (!object[parent_property]) {
|
|
195
|
-
object[depth_property] = 0;
|
|
196
|
-
}
|
|
197
|
-
keyed[object[id_property]] = object;
|
|
198
|
-
});
|
|
199
|
-
Object.keys(keyed).forEach(function (key) {
|
|
200
|
-
Object.keys(keyed).forEach(function (key) {
|
|
201
|
-
var object = keyed[key];
|
|
202
|
-
if (!keyed[key][depth_property]) {
|
|
203
|
-
if (keyed[key][parent_property]) {
|
|
204
|
-
keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
return keyed;
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* @deprecated use import { inArray } from @firestitch/common/array; instead
|
|
213
|
-
*/
|
|
214
|
-
FsArray.prototype.inArray = function (values, array) {
|
|
215
|
-
console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
|
|
216
|
-
if (!Array.isArray(values)) {
|
|
217
|
-
values = [values];
|
|
218
|
-
}
|
|
219
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
|
220
|
-
if (array.indexOf(values[i]) >= 0) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return false;
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* @deprecated use import { keyExists } from @firestitch/common/array; instead
|
|
228
|
-
*/
|
|
229
|
-
FsArray.prototype.keyExists = function (array, key) {
|
|
230
|
-
console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
|
|
231
|
-
return array.hasOwnProperty(key);
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* @deprecated use import { length } from @firestitch/common/array; instead
|
|
235
|
-
*/
|
|
236
|
-
FsArray.prototype.length = function (array) {
|
|
237
|
-
console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
|
|
238
|
-
return array.length;
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* @deprecated use import { ksort } from @firestitch/common/array; instead
|
|
242
|
-
*/
|
|
243
|
-
FsArray.prototype.ksort = function (unordered) {
|
|
244
|
-
console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
|
|
245
|
-
Object.keys(unordered).sort().forEach(function (key) {
|
|
246
|
-
var value = unordered[key];
|
|
247
|
-
delete unordered[key];
|
|
248
|
-
unordered[key] = value;
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
return FsArray;
|
|
252
|
-
}());
|
|
253
|
-
FsArray.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
254
|
-
FsArray.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray });
|
|
255
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray, decorators: [{
|
|
256
|
-
type: i0.Injectable
|
|
27
|
+
var FsArray = /** @class */ (function () {
|
|
28
|
+
function FsArray() {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated use import { nameValue } from @firestitch/common/array; instead
|
|
32
|
+
*/
|
|
33
|
+
FsArray.prototype.nameValue = function (array, name, value) {
|
|
34
|
+
console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
|
|
35
|
+
var list = [];
|
|
36
|
+
if (name || value) {
|
|
37
|
+
var nameFn_1 = typeof name === 'function' ? name : function (item) { return item[name]; };
|
|
38
|
+
var valueFn_1 = typeof value === 'function' ? value : function (item) { return item[value]; };
|
|
39
|
+
array.forEach(function (item) {
|
|
40
|
+
list.push({ name: nameFn_1(item), value: valueFn_1(item) });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
array.forEach(function (name, value) {
|
|
45
|
+
list.push({ name: name, value: value });
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return list;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated use import { remove } from @firestitch/common/array; instead
|
|
52
|
+
*/
|
|
53
|
+
FsArray.prototype.remove = function (array, query) {
|
|
54
|
+
console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
|
|
55
|
+
var idx = this.indexOf(array, query);
|
|
56
|
+
if (idx >= 0) {
|
|
57
|
+
return array.splice(idx, 1);
|
|
58
|
+
}
|
|
59
|
+
return idx;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated use import { indexOf } from @firestitch/common/array; instead
|
|
63
|
+
*/
|
|
64
|
+
FsArray.prototype.indexOf = function (array, query) {
|
|
65
|
+
var _this = this;
|
|
66
|
+
console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
|
|
67
|
+
if (typeof query !== 'function') {
|
|
68
|
+
var queryObj_1 = query;
|
|
69
|
+
query = function (item) {
|
|
70
|
+
return _this.compare(queryObj_1, item);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
for (var i = 0, len = array.length; i < len; i++) {
|
|
74
|
+
if (query(array[i])) {
|
|
75
|
+
return i;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return -1;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated use import { compare } from @firestitch/common/array; instead
|
|
82
|
+
*/
|
|
83
|
+
FsArray.prototype.compare = function (query, item) {
|
|
84
|
+
console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
|
|
85
|
+
var value = true;
|
|
86
|
+
for (var key in query) {
|
|
87
|
+
value = value && item[key] == query[key];
|
|
88
|
+
}
|
|
89
|
+
return value;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated use import { filter } from @firestitch/common/array; instead
|
|
93
|
+
*/
|
|
94
|
+
FsArray.prototype.filter = function (array, query) {
|
|
95
|
+
var _this = this;
|
|
96
|
+
console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
|
|
97
|
+
if (typeof query !== 'function') {
|
|
98
|
+
var queryObj_2 = query;
|
|
99
|
+
query = function (item) {
|
|
100
|
+
return _this.compare(queryObj_2, item);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
var isarray = Array.isArray(array);
|
|
104
|
+
var list = isarray ? [] : {};
|
|
105
|
+
if (isarray)
|
|
106
|
+
array.forEach(function (item, idx) {
|
|
107
|
+
if (query(item)) {
|
|
108
|
+
list.push(item);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
else
|
|
112
|
+
Object.keys(array).forEach(function (key) {
|
|
113
|
+
if (query(array[key])) {
|
|
114
|
+
list[key] = array[key];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return list;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated use import { index } from @firestitch/common/array; instead
|
|
121
|
+
*/
|
|
122
|
+
FsArray.prototype.index = function (array, property) {
|
|
123
|
+
console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
|
|
124
|
+
var list = {};
|
|
125
|
+
array.forEach(function (item, idx) {
|
|
126
|
+
list[item[property]] = item;
|
|
127
|
+
});
|
|
128
|
+
return list;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @deprecated use import { sort } from @firestitch/common/array; instead
|
|
132
|
+
*/
|
|
133
|
+
FsArray.prototype.sort = function (array, query, reverse) {
|
|
134
|
+
if (reverse === void 0) { reverse = false; }
|
|
135
|
+
console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
|
|
136
|
+
if (typeof query !== 'function') {
|
|
137
|
+
var queryStr_1 = query;
|
|
138
|
+
query = function (a, b) {
|
|
139
|
+
if (reverse) {
|
|
140
|
+
if (a[queryStr_1] < b[queryStr_1]) {
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
else if (a[queryStr_1] > b[queryStr_1]) {
|
|
144
|
+
return -1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (a[queryStr_1] > b[queryStr_1]) {
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
else if (a[queryStr_1] < b[queryStr_1]) {
|
|
152
|
+
return -1;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return 0;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
array.sort(query);
|
|
159
|
+
return array;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated use import { rsort } from @firestitch/common/array; instead
|
|
163
|
+
*/
|
|
164
|
+
FsArray.prototype.rsort = function (array, query) {
|
|
165
|
+
console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
|
|
166
|
+
return this.sort(array, query, true);
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated use import { list } from @firestitch/common/array; instead
|
|
170
|
+
*/
|
|
171
|
+
FsArray.prototype.list = function (array, property, index) {
|
|
172
|
+
if (index === void 0) { index = null; }
|
|
173
|
+
console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
|
|
174
|
+
var list = index ? {} : [];
|
|
175
|
+
array.forEach(function (item, idx) {
|
|
176
|
+
if (index) {
|
|
177
|
+
list[item[index]] = item[property];
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
list.push(item[property]);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return list;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* @deprecated use import { applyDepth } from @firestitch/common/array; instead
|
|
187
|
+
*/
|
|
188
|
+
FsArray.prototype.applyDepth = function (objects, parent_property, id_property, depth_property) {
|
|
189
|
+
if (id_property === void 0) { id_property = 'id'; }
|
|
190
|
+
if (depth_property === void 0) { depth_property = 'depth'; }
|
|
191
|
+
console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
|
|
192
|
+
var keyed = {};
|
|
193
|
+
objects.forEach(function (object) {
|
|
194
|
+
if (!object[parent_property]) {
|
|
195
|
+
object[depth_property] = 0;
|
|
196
|
+
}
|
|
197
|
+
keyed[object[id_property]] = object;
|
|
198
|
+
});
|
|
199
|
+
Object.keys(keyed).forEach(function (key) {
|
|
200
|
+
Object.keys(keyed).forEach(function (key) {
|
|
201
|
+
var object = keyed[key];
|
|
202
|
+
if (!keyed[key][depth_property]) {
|
|
203
|
+
if (keyed[key][parent_property]) {
|
|
204
|
+
keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
return keyed;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated use import { inArray } from @firestitch/common/array; instead
|
|
213
|
+
*/
|
|
214
|
+
FsArray.prototype.inArray = function (values, array) {
|
|
215
|
+
console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
|
|
216
|
+
if (!Array.isArray(values)) {
|
|
217
|
+
values = [values];
|
|
218
|
+
}
|
|
219
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
|
220
|
+
if (array.indexOf(values[i]) >= 0) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return false;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* @deprecated use import { keyExists } from @firestitch/common/array; instead
|
|
228
|
+
*/
|
|
229
|
+
FsArray.prototype.keyExists = function (array, key) {
|
|
230
|
+
console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
|
|
231
|
+
return array.hasOwnProperty(key);
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* @deprecated use import { length } from @firestitch/common/array; instead
|
|
235
|
+
*/
|
|
236
|
+
FsArray.prototype.length = function (array) {
|
|
237
|
+
console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
|
|
238
|
+
return array.length;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* @deprecated use import { ksort } from @firestitch/common/array; instead
|
|
242
|
+
*/
|
|
243
|
+
FsArray.prototype.ksort = function (unordered) {
|
|
244
|
+
console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
|
|
245
|
+
Object.keys(unordered).sort().forEach(function (key) {
|
|
246
|
+
var value = unordered[key];
|
|
247
|
+
delete unordered[key];
|
|
248
|
+
unordered[key] = value;
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
return FsArray;
|
|
252
|
+
}());
|
|
253
|
+
FsArray.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
254
|
+
FsArray.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray });
|
|
255
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsArray, decorators: [{
|
|
256
|
+
type: i0.Injectable
|
|
257
257
|
}] });
|
|
258
258
|
|
|
259
|
-
var FsMath = /** @class */ (function () {
|
|
260
|
-
function FsMath() {
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
|
|
264
|
-
*/
|
|
265
|
-
FsMath.prototype.round = function (number, precision) {
|
|
266
|
-
console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
|
|
267
|
-
precision = precision || 0;
|
|
268
|
-
var factor = Math.pow(10, precision);
|
|
269
|
-
var tempNumber = number * factor;
|
|
270
|
-
var roundedTempNumber = Math.round(tempNumber);
|
|
271
|
-
return roundedTempNumber / factor;
|
|
272
|
-
};
|
|
273
|
-
return FsMath;
|
|
274
|
-
}());
|
|
275
|
-
FsMath.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
276
|
-
FsMath.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath });
|
|
277
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath, decorators: [{
|
|
278
|
-
type: i0.Injectable
|
|
259
|
+
var FsMath = /** @class */ (function () {
|
|
260
|
+
function FsMath() {
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
|
|
264
|
+
*/
|
|
265
|
+
FsMath.prototype.round = function (number, precision) {
|
|
266
|
+
console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
|
|
267
|
+
precision = precision || 0;
|
|
268
|
+
var factor = Math.pow(10, precision);
|
|
269
|
+
var tempNumber = number * factor;
|
|
270
|
+
var roundedTempNumber = Math.round(tempNumber);
|
|
271
|
+
return roundedTempNumber / factor;
|
|
272
|
+
};
|
|
273
|
+
return FsMath;
|
|
274
|
+
}());
|
|
275
|
+
FsMath.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
276
|
+
FsMath.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath });
|
|
277
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsMath, decorators: [{
|
|
278
|
+
type: i0.Injectable
|
|
279
279
|
}] });
|
|
280
280
|
|
|
281
|
-
var KEY_CANCEL$1 = 3, KEY_HELP$1 = 6, KEY_BACKSPACE$1 = 8, KEY_TAB$1 = 9, KEY_CLEAR$1 = 12, KEY_RETURN$1 = 13, KEY_ENTER$1 = 14, KEY_SHIFT$1 = 16, KEY_CONTROL$1 = 17, KEY_ALT$1 = 18, KEY_PAUSE$1 = 19, KEY_CAPS_LOCK$1 = 20, KEY_ESCAPE$1 = 27, KEY_SPACE$1 = 32, KEY_PAGE_UP$1 = 33, KEY_PAGE_DOWN$1 = 34, KEY_END$1 = 35, KEY_HOME$1 = 36, KEY_LEFT$1 = 37, KEY_UP$1 = 38, KEY_RIGHT$1 = 39, KEY_DOWN$1 = 40, KEY_PRINTSCREEN$1 = 44, KEY_INSERT$1 = 45, KEY_DELETE$1 = 46, KEY_0$1 = 48, KEY_1$1 = 49, KEY_2$1 = 50, KEY_3$1 = 51, KEY_4$1 = 52, KEY_5$1 = 53, KEY_6$1 = 54, KEY_7$1 = 55, KEY_8$1 = 56, KEY_9$1 = 57, KEY_SEMICOLON$1 = 59, KEY_EQUALS$1 = 61;
|
|
282
|
-
/*
|
|
283
|
-
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)
|
|
284
|
-
There might be a better way to organise constatns but I need to know use-cases
|
|
285
|
-
*/
|
|
286
|
-
var FsUtil = /** @class */ (function () {
|
|
287
|
-
function FsUtil() {
|
|
288
|
-
this.intervals = {};
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* @deprecated use @firestitch/common/util/guid instead
|
|
292
|
-
*/
|
|
293
|
-
FsUtil.prototype.guid = function (pattern) {
|
|
294
|
-
console.warn('@deprecated use @firestitch/common/util/guid instead');
|
|
295
|
-
pattern = pattern || 'xxxxxx';
|
|
296
|
-
return pattern.replace(/[xy]/g, function (c) {
|
|
297
|
-
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
298
|
-
return v.toString(16);
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
/**
|
|
302
|
-
* @deprecated use import { uuid } from @firestitch/common/util; instead
|
|
303
|
-
*/
|
|
304
|
-
FsUtil.prototype.uuid = function () {
|
|
305
|
-
console.warn('@deprecated use @firestitch/common/util/uuid instead');
|
|
306
|
-
return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* @deprecated use import { resolve } from @firestitch/common/util; instead
|
|
310
|
-
*/
|
|
311
|
-
FsUtil.prototype.resolve = function (promise, defaults) {
|
|
312
|
-
if (defaults === void 0) { defaults = []; }
|
|
313
|
-
console.warn('@deprecated use @firestitch/common/util/resolve instead');
|
|
314
|
-
var result = defaults;
|
|
315
|
-
return new Promise(function (resolve) {
|
|
316
|
-
promise.then(function (data) {
|
|
317
|
-
Object.keys(data).forEach(function (key) { return result[key] = data[key]; });
|
|
318
|
-
resolve(result);
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
/**
|
|
323
|
-
* @deprecated use _.toInteger() instead
|
|
324
|
-
*/
|
|
325
|
-
FsUtil.prototype.int = function (value) {
|
|
326
|
-
console.warn('@deprecated use _.toInteger() instead');
|
|
327
|
-
value = parseInt(value);
|
|
328
|
-
if (isNaN(value)) {
|
|
329
|
-
value = 0;
|
|
330
|
-
}
|
|
331
|
-
return value;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* @deprecated use _.toFinite() instead
|
|
335
|
-
*/
|
|
336
|
-
FsUtil.prototype.float = function (value) {
|
|
337
|
-
console.warn('@deprecated use _.toFinite() instead');
|
|
338
|
-
value = parseFloat(value);
|
|
339
|
-
if (isNaN(value)) {
|
|
340
|
-
value = 0;
|
|
341
|
-
}
|
|
342
|
-
return value;
|
|
343
|
-
};
|
|
344
|
-
/**
|
|
345
|
-
* @deprecated use _.toString() instead
|
|
346
|
-
*/
|
|
347
|
-
FsUtil.prototype.string = function (string) {
|
|
348
|
-
console.warn('@deprecated use _.toString() instead');
|
|
349
|
-
if (string === null || string === undefined) {
|
|
350
|
-
string = '';
|
|
351
|
-
}
|
|
352
|
-
return (string).toString();
|
|
353
|
-
};
|
|
354
|
-
/**
|
|
355
|
-
* @deprecated use import { isEmpty } from @firestitch/common/util; instead
|
|
356
|
-
*/
|
|
357
|
-
FsUtil.prototype.isEmpty = function (value, options) {
|
|
358
|
-
console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
|
|
359
|
-
options = options || {};
|
|
360
|
-
return value === undefined ||
|
|
361
|
-
value === null ||
|
|
362
|
-
value === false ||
|
|
363
|
-
value === '' ||
|
|
364
|
-
!this.string(value).length ||
|
|
365
|
-
(this.isObject(value) &&
|
|
366
|
-
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
367
|
-
(!options.zero && (value === 0 || value === '0'));
|
|
368
|
-
};
|
|
369
|
-
/**
|
|
370
|
-
* @deprecated use _.isInteger() instead
|
|
371
|
-
*/
|
|
372
|
-
FsUtil.prototype.isInt = function (value, type) {
|
|
373
|
-
console.warn('@deprecated use _.isInteger() instead');
|
|
374
|
-
var int = !!this.string(value).match(/^\d+$/);
|
|
375
|
-
if (!int) {
|
|
376
|
-
return false;
|
|
377
|
-
}
|
|
378
|
-
if (type) {
|
|
379
|
-
return Number.isInteger(value);
|
|
380
|
-
}
|
|
381
|
-
return true;
|
|
382
|
-
};
|
|
383
|
-
/**
|
|
384
|
-
* @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
|
|
385
|
-
*/
|
|
386
|
-
FsUtil.prototype.each = function (object, func) {
|
|
387
|
-
console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
|
|
388
|
-
if (!this.isArray(object) && !this.isObject(object)) {
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
Object.keys(object).forEach(function (key) {
|
|
392
|
-
func(object[key], key);
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
/**
|
|
396
|
-
* @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
|
|
397
|
-
* or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
|
|
398
|
-
*/
|
|
399
|
-
FsUtil.prototype.isObject = function (value) {
|
|
400
|
-
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');
|
|
401
|
-
return value !== null && typeof value === 'object' && !this.isArray(value);
|
|
402
|
-
};
|
|
403
|
-
/**
|
|
404
|
-
* @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
|
|
405
|
-
*/
|
|
406
|
-
FsUtil.prototype.isString = function (value) {
|
|
407
|
-
console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
|
|
408
|
-
return typeof value === 'string' || value instanceof String;
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
|
|
412
|
-
*/
|
|
413
|
-
FsUtil.prototype.isArray = function (value) {
|
|
414
|
-
console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
|
|
415
|
-
return value instanceof Array;
|
|
416
|
-
};
|
|
417
|
-
/**
|
|
418
|
-
* @deprecated use import { isNumeric } from @firestitch/common/util; instead
|
|
419
|
-
*/
|
|
420
|
-
FsUtil.prototype.isNumeric = function (value) {
|
|
421
|
-
console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
|
|
422
|
-
return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
|
|
423
|
-
};
|
|
424
|
-
/**
|
|
425
|
-
* @deprecated use import { isClass } from @firestitch/common/util; instead
|
|
426
|
-
*/
|
|
427
|
-
FsUtil.prototype.isClass = function (value, cls) {
|
|
428
|
-
console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
|
|
429
|
-
if (this.isObject(value)) {
|
|
430
|
-
if (this.isString(cls)) {
|
|
431
|
-
if (value.constructor) {
|
|
432
|
-
if (value.constructor.name === cls) {
|
|
433
|
-
return true;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
if (value instanceof cls) {
|
|
439
|
-
return true;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
return false;
|
|
444
|
-
};
|
|
445
|
-
/**
|
|
446
|
-
* @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
|
|
447
|
-
*/
|
|
448
|
-
FsUtil.prototype.isBoolean = function (value) {
|
|
449
|
-
console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
|
|
450
|
-
return value === true || value === false;
|
|
451
|
-
};
|
|
452
|
-
/**
|
|
453
|
-
* @deprecated use import { value } from @firestitch/common/util; instead
|
|
454
|
-
*/
|
|
455
|
-
FsUtil.prototype.value = function (object, key, def) {
|
|
456
|
-
console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
|
|
457
|
-
if (this.isObject(object) || this.isArray(object)) {
|
|
458
|
-
if (object.hasOwnProperty(key)) {
|
|
459
|
-
return object[key];
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return def;
|
|
463
|
-
};
|
|
464
|
-
FsUtil.prototype.throttle = function (func, wait) {
|
|
465
|
-
console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
|
|
466
|
-
var waiting = false; // Initially, we're not waiting
|
|
467
|
-
return function () {
|
|
468
|
-
if (!waiting) { // If we're not waiting
|
|
469
|
-
func.apply(null, arguments); // Execute users function
|
|
470
|
-
waiting = true; // Prevent future invocations
|
|
471
|
-
setTimeout(function () {
|
|
472
|
-
waiting = false; // And allow future invocations
|
|
473
|
-
}, wait);
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
};
|
|
477
|
-
/**
|
|
478
|
-
* @deprecated use import { debounce } from @firestitch/common/util; instead
|
|
479
|
-
*/
|
|
480
|
-
FsUtil.prototype.debounce = function (func, wait, immediate) {
|
|
481
|
-
console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
|
|
482
|
-
var timeout;
|
|
483
|
-
return function () {
|
|
484
|
-
var context = this, args = arguments;
|
|
485
|
-
var later = function () {
|
|
486
|
-
timeout = null;
|
|
487
|
-
if (!immediate)
|
|
488
|
-
func.apply(context, args);
|
|
489
|
-
};
|
|
490
|
-
var callNow = immediate && !timeout;
|
|
491
|
-
clearTimeout(timeout);
|
|
492
|
-
timeout = setTimeout(later, wait);
|
|
493
|
-
if (callNow)
|
|
494
|
-
func.apply(context, args);
|
|
495
|
-
};
|
|
496
|
-
};
|
|
497
|
-
/**
|
|
498
|
-
* @deprecated use import { length } from @firestitch/common/util; instead
|
|
499
|
-
*/
|
|
500
|
-
FsUtil.prototype.length = function (object) {
|
|
501
|
-
console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
|
|
502
|
-
if (this.isObject(object)) {
|
|
503
|
-
return Object.keys(object).length;
|
|
504
|
-
}
|
|
505
|
-
if (this.isArray(object)) {
|
|
506
|
-
return object.length;
|
|
507
|
-
}
|
|
508
|
-
return 0;
|
|
509
|
-
};
|
|
510
|
-
/**
|
|
511
|
-
* @deprecated use import { boolean } from @firestitch/common/util; instead
|
|
512
|
-
*/
|
|
513
|
-
FsUtil.prototype.boolean = function (value) {
|
|
514
|
-
console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
|
|
515
|
-
return this.string(value).toLowerCase() !== 'false' && !!value;
|
|
516
|
-
};
|
|
517
|
-
/**
|
|
518
|
-
* @deprecated use import { stringify } from @firestitch/common/util; instead
|
|
519
|
-
*/
|
|
520
|
-
FsUtil.prototype.stringify = function (value) {
|
|
521
|
-
console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
|
|
522
|
-
return JSON.stringify(value);
|
|
523
|
-
};
|
|
524
|
-
return FsUtil;
|
|
525
|
-
}());
|
|
526
|
-
FsUtil.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
527
|
-
FsUtil.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil });
|
|
528
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil, decorators: [{
|
|
529
|
-
type: i0.Injectable
|
|
281
|
+
var KEY_CANCEL$1 = 3, KEY_HELP$1 = 6, KEY_BACKSPACE$1 = 8, KEY_TAB$1 = 9, KEY_CLEAR$1 = 12, KEY_RETURN$1 = 13, KEY_ENTER$1 = 14, KEY_SHIFT$1 = 16, KEY_CONTROL$1 = 17, KEY_ALT$1 = 18, KEY_PAUSE$1 = 19, KEY_CAPS_LOCK$1 = 20, KEY_ESCAPE$1 = 27, KEY_SPACE$1 = 32, KEY_PAGE_UP$1 = 33, KEY_PAGE_DOWN$1 = 34, KEY_END$1 = 35, KEY_HOME$1 = 36, KEY_LEFT$1 = 37, KEY_UP$1 = 38, KEY_RIGHT$1 = 39, KEY_DOWN$1 = 40, KEY_PRINTSCREEN$1 = 44, KEY_INSERT$1 = 45, KEY_DELETE$1 = 46, KEY_0$1 = 48, KEY_1$1 = 49, KEY_2$1 = 50, KEY_3$1 = 51, KEY_4$1 = 52, KEY_5$1 = 53, KEY_6$1 = 54, KEY_7$1 = 55, KEY_8$1 = 56, KEY_9$1 = 57, KEY_SEMICOLON$1 = 59, KEY_EQUALS$1 = 61;
|
|
282
|
+
/*
|
|
283
|
+
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)
|
|
284
|
+
There might be a better way to organise constatns but I need to know use-cases
|
|
285
|
+
*/
|
|
286
|
+
var FsUtil = /** @class */ (function () {
|
|
287
|
+
function FsUtil() {
|
|
288
|
+
this.intervals = {};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @deprecated use @firestitch/common/util/guid instead
|
|
292
|
+
*/
|
|
293
|
+
FsUtil.prototype.guid = function (pattern) {
|
|
294
|
+
console.warn('@deprecated use @firestitch/common/util/guid instead');
|
|
295
|
+
pattern = pattern || 'xxxxxx';
|
|
296
|
+
return pattern.replace(/[xy]/g, function (c) {
|
|
297
|
+
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
298
|
+
return v.toString(16);
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* @deprecated use import { uuid } from @firestitch/common/util; instead
|
|
303
|
+
*/
|
|
304
|
+
FsUtil.prototype.uuid = function () {
|
|
305
|
+
console.warn('@deprecated use @firestitch/common/util/uuid instead');
|
|
306
|
+
return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* @deprecated use import { resolve } from @firestitch/common/util; instead
|
|
310
|
+
*/
|
|
311
|
+
FsUtil.prototype.resolve = function (promise, defaults) {
|
|
312
|
+
if (defaults === void 0) { defaults = []; }
|
|
313
|
+
console.warn('@deprecated use @firestitch/common/util/resolve instead');
|
|
314
|
+
var result = defaults;
|
|
315
|
+
return new Promise(function (resolve) {
|
|
316
|
+
promise.then(function (data) {
|
|
317
|
+
Object.keys(data).forEach(function (key) { return result[key] = data[key]; });
|
|
318
|
+
resolve(result);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated use _.toInteger() instead
|
|
324
|
+
*/
|
|
325
|
+
FsUtil.prototype.int = function (value) {
|
|
326
|
+
console.warn('@deprecated use _.toInteger() instead');
|
|
327
|
+
value = parseInt(value);
|
|
328
|
+
if (isNaN(value)) {
|
|
329
|
+
value = 0;
|
|
330
|
+
}
|
|
331
|
+
return value;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* @deprecated use _.toFinite() instead
|
|
335
|
+
*/
|
|
336
|
+
FsUtil.prototype.float = function (value) {
|
|
337
|
+
console.warn('@deprecated use _.toFinite() instead');
|
|
338
|
+
value = parseFloat(value);
|
|
339
|
+
if (isNaN(value)) {
|
|
340
|
+
value = 0;
|
|
341
|
+
}
|
|
342
|
+
return value;
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* @deprecated use _.toString() instead
|
|
346
|
+
*/
|
|
347
|
+
FsUtil.prototype.string = function (string) {
|
|
348
|
+
console.warn('@deprecated use _.toString() instead');
|
|
349
|
+
if (string === null || string === undefined) {
|
|
350
|
+
string = '';
|
|
351
|
+
}
|
|
352
|
+
return (string).toString();
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* @deprecated use import { isEmpty } from @firestitch/common/util; instead
|
|
356
|
+
*/
|
|
357
|
+
FsUtil.prototype.isEmpty = function (value, options) {
|
|
358
|
+
console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
|
|
359
|
+
options = options || {};
|
|
360
|
+
return value === undefined ||
|
|
361
|
+
value === null ||
|
|
362
|
+
value === false ||
|
|
363
|
+
value === '' ||
|
|
364
|
+
!this.string(value).length ||
|
|
365
|
+
(this.isObject(value) &&
|
|
366
|
+
(value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
367
|
+
(!options.zero && (value === 0 || value === '0'));
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* @deprecated use _.isInteger() instead
|
|
371
|
+
*/
|
|
372
|
+
FsUtil.prototype.isInt = function (value, type) {
|
|
373
|
+
console.warn('@deprecated use _.isInteger() instead');
|
|
374
|
+
var int = !!this.string(value).match(/^\d+$/);
|
|
375
|
+
if (!int) {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
if (type) {
|
|
379
|
+
return Number.isInteger(value);
|
|
380
|
+
}
|
|
381
|
+
return true;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
|
|
385
|
+
*/
|
|
386
|
+
FsUtil.prototype.each = function (object, func) {
|
|
387
|
+
console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
|
|
388
|
+
if (!this.isArray(object) && !this.isObject(object)) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
Object.keys(object).forEach(function (key) {
|
|
392
|
+
func(object[key], key);
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
|
|
397
|
+
* or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
|
|
398
|
+
*/
|
|
399
|
+
FsUtil.prototype.isObject = function (value) {
|
|
400
|
+
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');
|
|
401
|
+
return value !== null && typeof value === 'object' && !this.isArray(value);
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
|
|
405
|
+
*/
|
|
406
|
+
FsUtil.prototype.isString = function (value) {
|
|
407
|
+
console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
|
|
408
|
+
return typeof value === 'string' || value instanceof String;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
|
|
412
|
+
*/
|
|
413
|
+
FsUtil.prototype.isArray = function (value) {
|
|
414
|
+
console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
|
|
415
|
+
return value instanceof Array;
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* @deprecated use import { isNumeric } from @firestitch/common/util; instead
|
|
419
|
+
*/
|
|
420
|
+
FsUtil.prototype.isNumeric = function (value) {
|
|
421
|
+
console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
|
|
422
|
+
return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* @deprecated use import { isClass } from @firestitch/common/util; instead
|
|
426
|
+
*/
|
|
427
|
+
FsUtil.prototype.isClass = function (value, cls) {
|
|
428
|
+
console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
|
|
429
|
+
if (this.isObject(value)) {
|
|
430
|
+
if (this.isString(cls)) {
|
|
431
|
+
if (value.constructor) {
|
|
432
|
+
if (value.constructor.name === cls) {
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
if (value instanceof cls) {
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return false;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
|
|
447
|
+
*/
|
|
448
|
+
FsUtil.prototype.isBoolean = function (value) {
|
|
449
|
+
console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
|
|
450
|
+
return value === true || value === false;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* @deprecated use import { value } from @firestitch/common/util; instead
|
|
454
|
+
*/
|
|
455
|
+
FsUtil.prototype.value = function (object, key, def) {
|
|
456
|
+
console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
|
|
457
|
+
if (this.isObject(object) || this.isArray(object)) {
|
|
458
|
+
if (object.hasOwnProperty(key)) {
|
|
459
|
+
return object[key];
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return def;
|
|
463
|
+
};
|
|
464
|
+
FsUtil.prototype.throttle = function (func, wait) {
|
|
465
|
+
console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
|
|
466
|
+
var waiting = false; // Initially, we're not waiting
|
|
467
|
+
return function () {
|
|
468
|
+
if (!waiting) { // If we're not waiting
|
|
469
|
+
func.apply(null, arguments); // Execute users function
|
|
470
|
+
waiting = true; // Prevent future invocations
|
|
471
|
+
setTimeout(function () {
|
|
472
|
+
waiting = false; // And allow future invocations
|
|
473
|
+
}, wait);
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
/**
|
|
478
|
+
* @deprecated use import { debounce } from @firestitch/common/util; instead
|
|
479
|
+
*/
|
|
480
|
+
FsUtil.prototype.debounce = function (func, wait, immediate) {
|
|
481
|
+
console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
|
|
482
|
+
var timeout;
|
|
483
|
+
return function () {
|
|
484
|
+
var context = this, args = arguments;
|
|
485
|
+
var later = function () {
|
|
486
|
+
timeout = null;
|
|
487
|
+
if (!immediate)
|
|
488
|
+
func.apply(context, args);
|
|
489
|
+
};
|
|
490
|
+
var callNow = immediate && !timeout;
|
|
491
|
+
clearTimeout(timeout);
|
|
492
|
+
timeout = setTimeout(later, wait);
|
|
493
|
+
if (callNow)
|
|
494
|
+
func.apply(context, args);
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* @deprecated use import { length } from @firestitch/common/util; instead
|
|
499
|
+
*/
|
|
500
|
+
FsUtil.prototype.length = function (object) {
|
|
501
|
+
console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
|
|
502
|
+
if (this.isObject(object)) {
|
|
503
|
+
return Object.keys(object).length;
|
|
504
|
+
}
|
|
505
|
+
if (this.isArray(object)) {
|
|
506
|
+
return object.length;
|
|
507
|
+
}
|
|
508
|
+
return 0;
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* @deprecated use import { boolean } from @firestitch/common/util; instead
|
|
512
|
+
*/
|
|
513
|
+
FsUtil.prototype.boolean = function (value) {
|
|
514
|
+
console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
|
|
515
|
+
return this.string(value).toLowerCase() !== 'false' && !!value;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* @deprecated use import { stringify } from @firestitch/common/util; instead
|
|
519
|
+
*/
|
|
520
|
+
FsUtil.prototype.stringify = function (value) {
|
|
521
|
+
console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
|
|
522
|
+
return JSON.stringify(value);
|
|
523
|
+
};
|
|
524
|
+
return FsUtil;
|
|
525
|
+
}());
|
|
526
|
+
FsUtil.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
527
|
+
FsUtil.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil });
|
|
528
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtil, decorators: [{
|
|
529
|
+
type: i0.Injectable
|
|
530
530
|
}] });
|
|
531
531
|
|
|
532
|
-
var FsValidate = /** @class */ (function () {
|
|
533
|
-
function FsValidate(fsUtil) {
|
|
534
|
-
this.fsUtil = fsUtil;
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
538
|
-
*/
|
|
539
|
-
FsValidate.prototype.phone = function (value) {
|
|
540
|
-
var valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
|
|
541
|
-
return valid || !String(value).length;
|
|
542
|
-
};
|
|
543
|
-
/**
|
|
544
|
-
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
545
|
-
*/
|
|
546
|
-
FsValidate.prototype.email = function (value) {
|
|
547
|
-
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,}))$/);
|
|
548
|
-
};
|
|
549
|
-
return FsValidate;
|
|
550
|
-
}());
|
|
551
|
-
FsValidate.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate, deps: [{ token: FsUtil }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
552
|
-
FsValidate.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate });
|
|
553
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate, decorators: [{
|
|
554
|
-
type: i0.Injectable
|
|
532
|
+
var FsValidate = /** @class */ (function () {
|
|
533
|
+
function FsValidate(fsUtil) {
|
|
534
|
+
this.fsUtil = fsUtil;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
538
|
+
*/
|
|
539
|
+
FsValidate.prototype.phone = function (value) {
|
|
540
|
+
var valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
|
|
541
|
+
return valid || !String(value).length;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* @deprecated use import { email } from @firestitch/common/validate; instead
|
|
545
|
+
*/
|
|
546
|
+
FsValidate.prototype.email = function (value) {
|
|
547
|
+
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,}))$/);
|
|
548
|
+
};
|
|
549
|
+
return FsValidate;
|
|
550
|
+
}());
|
|
551
|
+
FsValidate.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate, deps: [{ token: FsUtil }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
552
|
+
FsValidate.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate });
|
|
553
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsValidate, decorators: [{
|
|
554
|
+
type: i0.Injectable
|
|
555
555
|
}], ctorParameters: function () { return [{ type: FsUtil }]; } });
|
|
556
556
|
|
|
557
|
-
function stringify(value) {
|
|
558
|
-
return JSON.stringify(value);
|
|
557
|
+
function stringify(value) {
|
|
558
|
+
return JSON.stringify(value);
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
function guid(pattern, options) {
|
|
562
|
-
if (options === void 0) { options = { case: 'lower', numbers: true }; }
|
|
563
|
-
pattern = pattern || 'xxxxxx';
|
|
564
|
-
var s = '';
|
|
565
|
-
if (options.numbers !== false) {
|
|
566
|
-
s = '0123456789';
|
|
567
|
-
}
|
|
568
|
-
if (!options.case || options.case === 'lower' || options.case === 'mixed') {
|
|
569
|
-
s = s.concat('abcdefghijklmnopqrstuvwxyz');
|
|
570
|
-
}
|
|
571
|
-
if (options.case === 'upper' || options.case === 'mixed') {
|
|
572
|
-
s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
573
|
-
}
|
|
574
|
-
var chars = s.match(/(.{1,1})/g);
|
|
575
|
-
return pattern.replace(/[x]/g, function (c) {
|
|
576
|
-
var i = (Math.random() * chars.length) | 0;
|
|
577
|
-
return chars[i];
|
|
578
|
-
});
|
|
561
|
+
function guid(pattern, options) {
|
|
562
|
+
if (options === void 0) { options = { case: 'lower', numbers: true }; }
|
|
563
|
+
pattern = pattern || 'xxxxxx';
|
|
564
|
+
var s = '';
|
|
565
|
+
if (options.numbers !== false) {
|
|
566
|
+
s = '0123456789';
|
|
567
|
+
}
|
|
568
|
+
if (!options.case || options.case === 'lower' || options.case === 'mixed') {
|
|
569
|
+
s = s.concat('abcdefghijklmnopqrstuvwxyz');
|
|
570
|
+
}
|
|
571
|
+
if (options.case === 'upper' || options.case === 'mixed') {
|
|
572
|
+
s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
573
|
+
}
|
|
574
|
+
var chars = s.match(/(.{1,1})/g);
|
|
575
|
+
return pattern.replace(/[x]/g, function (c) {
|
|
576
|
+
var i = (Math.random() * chars.length) | 0;
|
|
577
|
+
return chars[i];
|
|
578
|
+
});
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
function isEmpty(value, options) {
|
|
582
|
-
options = options || {};
|
|
583
|
-
return value === undefined ||
|
|
584
|
-
value === null ||
|
|
585
|
-
value === false ||
|
|
586
|
-
value === '' ||
|
|
587
|
-
String(value).length === 0 ||
|
|
588
|
-
(Array.isArray(value) && value.length === 0) ||
|
|
589
|
-
(value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
590
|
-
(!options.zero && (value === 0 || value === '0'));
|
|
581
|
+
function isEmpty(value, options) {
|
|
582
|
+
options = options || {};
|
|
583
|
+
return value === undefined ||
|
|
584
|
+
value === null ||
|
|
585
|
+
value === false ||
|
|
586
|
+
value === '' ||
|
|
587
|
+
String(value).length === 0 ||
|
|
588
|
+
(Array.isArray(value) && value.length === 0) ||
|
|
589
|
+
(value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
|
|
590
|
+
(!options.zero && (value === 0 || value === '0'));
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
var FsUtilStringifyPipe = /** @class */ (function () {
|
|
594
|
-
function FsUtilStringifyPipe() {
|
|
595
|
-
}
|
|
596
|
-
FsUtilStringifyPipe.prototype.transform = function (value) {
|
|
597
|
-
return stringify(value);
|
|
598
|
-
};
|
|
599
|
-
return FsUtilStringifyPipe;
|
|
600
|
-
}());
|
|
601
|
-
FsUtilStringifyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
602
|
-
FsUtilStringifyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
|
|
603
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, decorators: [{
|
|
604
|
-
type: i0.Pipe,
|
|
605
|
-
args: [{
|
|
606
|
-
name: 'fsUtilStringify'
|
|
607
|
-
}]
|
|
608
|
-
}], ctorParameters: function () { return []; } });
|
|
609
|
-
var FsUtilGuidPipe = /** @class */ (function () {
|
|
610
|
-
function FsUtilGuidPipe() {
|
|
611
|
-
}
|
|
612
|
-
FsUtilGuidPipe.prototype.transform = function () {
|
|
613
|
-
return guid();
|
|
614
|
-
};
|
|
615
|
-
return FsUtilGuidPipe;
|
|
616
|
-
}());
|
|
617
|
-
FsUtilGuidPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
618
|
-
FsUtilGuidPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, name: "fsUtilGuid" });
|
|
619
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, decorators: [{
|
|
620
|
-
type: i0.Pipe,
|
|
621
|
-
args: [{
|
|
622
|
-
name: 'fsUtilGuid'
|
|
623
|
-
}]
|
|
624
|
-
}], ctorParameters: function () { return []; } });
|
|
625
|
-
var FsUtilIsEmptyPipe = /** @class */ (function () {
|
|
626
|
-
function FsUtilIsEmptyPipe() {
|
|
627
|
-
}
|
|
628
|
-
FsUtilIsEmptyPipe.prototype.transform = function (value) {
|
|
629
|
-
return isEmpty(value);
|
|
630
|
-
};
|
|
631
|
-
return FsUtilIsEmptyPipe;
|
|
632
|
-
}());
|
|
633
|
-
FsUtilIsEmptyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
634
|
-
FsUtilIsEmptyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
|
|
635
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, decorators: [{
|
|
636
|
-
type: i0.Pipe,
|
|
637
|
-
args: [{
|
|
638
|
-
name: 'fsUtilIsEmpty'
|
|
639
|
-
}]
|
|
640
|
-
}] });
|
|
641
|
-
var FsUtilIsNotEmptyPipe = /** @class */ (function () {
|
|
642
|
-
function FsUtilIsNotEmptyPipe() {
|
|
643
|
-
}
|
|
644
|
-
FsUtilIsNotEmptyPipe.prototype.transform = function (value) {
|
|
645
|
-
return !isEmpty(value);
|
|
646
|
-
};
|
|
647
|
-
return FsUtilIsNotEmptyPipe;
|
|
648
|
-
}());
|
|
649
|
-
FsUtilIsNotEmptyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
650
|
-
FsUtilIsNotEmptyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
|
|
651
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, decorators: [{
|
|
652
|
-
type: i0.Pipe,
|
|
653
|
-
args: [{
|
|
654
|
-
name: 'fsUtilIsNotEmpty'
|
|
655
|
-
}]
|
|
593
|
+
var FsUtilStringifyPipe = /** @class */ (function () {
|
|
594
|
+
function FsUtilStringifyPipe() {
|
|
595
|
+
}
|
|
596
|
+
FsUtilStringifyPipe.prototype.transform = function (value) {
|
|
597
|
+
return stringify(value);
|
|
598
|
+
};
|
|
599
|
+
return FsUtilStringifyPipe;
|
|
600
|
+
}());
|
|
601
|
+
FsUtilStringifyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
602
|
+
FsUtilStringifyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
|
|
603
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilStringifyPipe, decorators: [{
|
|
604
|
+
type: i0.Pipe,
|
|
605
|
+
args: [{
|
|
606
|
+
name: 'fsUtilStringify'
|
|
607
|
+
}]
|
|
608
|
+
}], ctorParameters: function () { return []; } });
|
|
609
|
+
var FsUtilGuidPipe = /** @class */ (function () {
|
|
610
|
+
function FsUtilGuidPipe() {
|
|
611
|
+
}
|
|
612
|
+
FsUtilGuidPipe.prototype.transform = function () {
|
|
613
|
+
return guid();
|
|
614
|
+
};
|
|
615
|
+
return FsUtilGuidPipe;
|
|
616
|
+
}());
|
|
617
|
+
FsUtilGuidPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
618
|
+
FsUtilGuidPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, name: "fsUtilGuid" });
|
|
619
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilGuidPipe, decorators: [{
|
|
620
|
+
type: i0.Pipe,
|
|
621
|
+
args: [{
|
|
622
|
+
name: 'fsUtilGuid'
|
|
623
|
+
}]
|
|
624
|
+
}], ctorParameters: function () { return []; } });
|
|
625
|
+
var FsUtilIsEmptyPipe = /** @class */ (function () {
|
|
626
|
+
function FsUtilIsEmptyPipe() {
|
|
627
|
+
}
|
|
628
|
+
FsUtilIsEmptyPipe.prototype.transform = function (value) {
|
|
629
|
+
return isEmpty(value);
|
|
630
|
+
};
|
|
631
|
+
return FsUtilIsEmptyPipe;
|
|
632
|
+
}());
|
|
633
|
+
FsUtilIsEmptyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
634
|
+
FsUtilIsEmptyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
|
|
635
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsEmptyPipe, decorators: [{
|
|
636
|
+
type: i0.Pipe,
|
|
637
|
+
args: [{
|
|
638
|
+
name: 'fsUtilIsEmpty'
|
|
639
|
+
}]
|
|
640
|
+
}] });
|
|
641
|
+
var FsUtilIsNotEmptyPipe = /** @class */ (function () {
|
|
642
|
+
function FsUtilIsNotEmptyPipe() {
|
|
643
|
+
}
|
|
644
|
+
FsUtilIsNotEmptyPipe.prototype.transform = function (value) {
|
|
645
|
+
return !isEmpty(value);
|
|
646
|
+
};
|
|
647
|
+
return FsUtilIsNotEmptyPipe;
|
|
648
|
+
}());
|
|
649
|
+
FsUtilIsNotEmptyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
650
|
+
FsUtilIsNotEmptyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
|
|
651
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsUtilIsNotEmptyPipe, decorators: [{
|
|
652
|
+
type: i0.Pipe,
|
|
653
|
+
args: [{
|
|
654
|
+
name: 'fsUtilIsNotEmpty'
|
|
655
|
+
}]
|
|
656
656
|
}] });
|
|
657
657
|
|
|
658
|
-
function number(value, decimals) {
|
|
659
|
-
return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
|
|
658
|
+
function number(value, decimals) {
|
|
659
|
+
return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
-
var FsFormatNumberPipe = /** @class */ (function () {
|
|
663
|
-
function FsFormatNumberPipe() {
|
|
664
|
-
}
|
|
665
|
-
FsFormatNumberPipe.prototype.transform = function (value, decimals) {
|
|
666
|
-
return number(value, decimals);
|
|
667
|
-
};
|
|
668
|
-
return FsFormatNumberPipe;
|
|
669
|
-
}());
|
|
670
|
-
FsFormatNumberPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
671
|
-
FsFormatNumberPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, name: "fsFormatNumber" });
|
|
672
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, decorators: [{
|
|
673
|
-
type: i0.Pipe,
|
|
674
|
-
args: [{
|
|
675
|
-
name: 'fsFormatNumber'
|
|
676
|
-
}]
|
|
662
|
+
var FsFormatNumberPipe = /** @class */ (function () {
|
|
663
|
+
function FsFormatNumberPipe() {
|
|
664
|
+
}
|
|
665
|
+
FsFormatNumberPipe.prototype.transform = function (value, decimals) {
|
|
666
|
+
return number(value, decimals);
|
|
667
|
+
};
|
|
668
|
+
return FsFormatNumberPipe;
|
|
669
|
+
}());
|
|
670
|
+
FsFormatNumberPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
671
|
+
FsFormatNumberPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, name: "fsFormatNumber" });
|
|
672
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatNumberPipe, decorators: [{
|
|
673
|
+
type: i0.Pipe,
|
|
674
|
+
args: [{
|
|
675
|
+
name: 'fsFormatNumber'
|
|
676
|
+
}]
|
|
677
677
|
}] });
|
|
678
678
|
|
|
679
|
-
function currency(amount, precision, currencyCode, locale) {
|
|
680
|
-
if (precision === void 0) { precision = [2, 10]; }
|
|
681
|
-
if (currencyCode === void 0) { currencyCode = 'USD'; }
|
|
682
|
-
if (locale === void 0) { locale = 'en-US'; }
|
|
683
|
-
var digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
|
|
684
|
-
return new common.CurrencyPipe(locale).transform(amount, currencyCode, 'symbol', "1." + digitsInfo[0] + "-" + digitsInfo[1]);
|
|
679
|
+
function currency(amount, precision, currencyCode, locale) {
|
|
680
|
+
if (precision === void 0) { precision = [2, 10]; }
|
|
681
|
+
if (currencyCode === void 0) { currencyCode = 'USD'; }
|
|
682
|
+
if (locale === void 0) { locale = 'en-US'; }
|
|
683
|
+
var digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
|
|
684
|
+
return new common.CurrencyPipe(locale).transform(amount, currencyCode, 'symbol', "1." + digitsInfo[0] + "-" + digitsInfo[1]);
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
var FsFormatCurrencyPipe = /** @class */ (function () {
|
|
688
|
-
function FsFormatCurrencyPipe(locale) {
|
|
689
|
-
this.locale = locale;
|
|
690
|
-
}
|
|
691
|
-
FsFormatCurrencyPipe.prototype.transform = function (amount, precision, currencyCode) {
|
|
692
|
-
if (precision === void 0) { precision = 2; }
|
|
693
|
-
return currency(amount, precision, currencyCode);
|
|
694
|
-
};
|
|
695
|
-
return FsFormatCurrencyPipe;
|
|
696
|
-
}());
|
|
697
|
-
FsFormatCurrencyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, deps: [{ token: i0.LOCALE_ID }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
698
|
-
FsFormatCurrencyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
|
|
699
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, decorators: [{
|
|
700
|
-
type: i0.Pipe,
|
|
701
|
-
args: [{
|
|
702
|
-
name: 'fsFormatCurrency'
|
|
703
|
-
}]
|
|
704
|
-
}], ctorParameters: function () {
|
|
705
|
-
return [{ type: undefined, decorators: [{
|
|
706
|
-
type: i0.Inject,
|
|
707
|
-
args: [i0.LOCALE_ID]
|
|
708
|
-
}] }];
|
|
687
|
+
var FsFormatCurrencyPipe = /** @class */ (function () {
|
|
688
|
+
function FsFormatCurrencyPipe(locale) {
|
|
689
|
+
this.locale = locale;
|
|
690
|
+
}
|
|
691
|
+
FsFormatCurrencyPipe.prototype.transform = function (amount, precision, currencyCode) {
|
|
692
|
+
if (precision === void 0) { precision = 2; }
|
|
693
|
+
return currency(amount, precision, currencyCode);
|
|
694
|
+
};
|
|
695
|
+
return FsFormatCurrencyPipe;
|
|
696
|
+
}());
|
|
697
|
+
FsFormatCurrencyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, deps: [{ token: i0.LOCALE_ID }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
698
|
+
FsFormatCurrencyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
|
|
699
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatCurrencyPipe, decorators: [{
|
|
700
|
+
type: i0.Pipe,
|
|
701
|
+
args: [{
|
|
702
|
+
name: 'fsFormatCurrency'
|
|
703
|
+
}]
|
|
704
|
+
}], ctorParameters: function () {
|
|
705
|
+
return [{ type: undefined, decorators: [{
|
|
706
|
+
type: i0.Inject,
|
|
707
|
+
args: [i0.LOCALE_ID]
|
|
708
|
+
}] }];
|
|
709
709
|
} });
|
|
710
710
|
|
|
711
|
-
function truncate(value, limit, completeWords, ellipsis) {
|
|
712
|
-
if (limit === void 0) { limit = 100; }
|
|
713
|
-
if (completeWords === void 0) { completeWords = false; }
|
|
714
|
-
if (ellipsis === void 0) { ellipsis = '...'; }
|
|
715
|
-
value = value || '';
|
|
716
|
-
if (completeWords) {
|
|
717
|
-
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
718
|
-
}
|
|
719
|
-
var result = "" + value.substr(0, limit);
|
|
720
|
-
if (result !== value) {
|
|
721
|
-
result += ellipsis;
|
|
722
|
-
}
|
|
723
|
-
return result;
|
|
711
|
+
function truncate(value, limit, completeWords, ellipsis) {
|
|
712
|
+
if (limit === void 0) { limit = 100; }
|
|
713
|
+
if (completeWords === void 0) { completeWords = false; }
|
|
714
|
+
if (ellipsis === void 0) { ellipsis = '...'; }
|
|
715
|
+
value = value || '';
|
|
716
|
+
if (completeWords) {
|
|
717
|
+
limit = value.substr(0, limit).lastIndexOf(' ');
|
|
718
|
+
}
|
|
719
|
+
var result = "" + value.substr(0, limit);
|
|
720
|
+
if (result !== value) {
|
|
721
|
+
result += ellipsis;
|
|
722
|
+
}
|
|
723
|
+
return result;
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
var FsFormatTruncatePipe = /** @class */ (function () {
|
|
727
|
-
function FsFormatTruncatePipe() {
|
|
728
|
-
}
|
|
729
|
-
FsFormatTruncatePipe.prototype.transform = function (value, limit, completeWords, ellipsis) {
|
|
730
|
-
return truncate(value, limit, completeWords, ellipsis);
|
|
731
|
-
};
|
|
732
|
-
return FsFormatTruncatePipe;
|
|
733
|
-
}());
|
|
734
|
-
FsFormatTruncatePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
735
|
-
FsFormatTruncatePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
|
|
736
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, decorators: [{
|
|
737
|
-
type: i0.Pipe,
|
|
738
|
-
args: [{
|
|
739
|
-
name: 'fsFormatTruncate'
|
|
740
|
-
}]
|
|
726
|
+
var FsFormatTruncatePipe = /** @class */ (function () {
|
|
727
|
+
function FsFormatTruncatePipe() {
|
|
728
|
+
}
|
|
729
|
+
FsFormatTruncatePipe.prototype.transform = function (value, limit, completeWords, ellipsis) {
|
|
730
|
+
return truncate(value, limit, completeWords, ellipsis);
|
|
731
|
+
};
|
|
732
|
+
return FsFormatTruncatePipe;
|
|
733
|
+
}());
|
|
734
|
+
FsFormatTruncatePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
735
|
+
FsFormatTruncatePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
|
|
736
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatTruncatePipe, decorators: [{
|
|
737
|
+
type: i0.Pipe,
|
|
738
|
+
args: [{
|
|
739
|
+
name: 'fsFormatTruncate'
|
|
740
|
+
}]
|
|
741
741
|
}], ctorParameters: function () { return []; } });
|
|
742
742
|
|
|
743
|
-
var FsStopPropagationDirective = /** @class */ (function () {
|
|
744
|
-
function FsStopPropagationDirective() {
|
|
745
|
-
}
|
|
746
|
-
FsStopPropagationDirective.prototype.preventClick = function (event) {
|
|
747
|
-
event.stopPropagation();
|
|
748
|
-
};
|
|
749
|
-
return FsStopPropagationDirective;
|
|
750
|
-
}());
|
|
751
|
-
FsStopPropagationDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsStopPropagationDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
752
|
-
FsStopPropagationDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0__namespace });
|
|
753
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsStopPropagationDirective, decorators: [{
|
|
754
|
-
type: i0.Directive,
|
|
755
|
-
args: [{
|
|
756
|
-
selector: '[fsStopPropagation]',
|
|
757
|
-
}]
|
|
758
|
-
}], propDecorators: { preventClick: [{
|
|
759
|
-
type: i0.HostListener,
|
|
760
|
-
args: ['click', ['$event']]
|
|
743
|
+
var FsStopPropagationDirective = /** @class */ (function () {
|
|
744
|
+
function FsStopPropagationDirective() {
|
|
745
|
+
}
|
|
746
|
+
FsStopPropagationDirective.prototype.preventClick = function (event) {
|
|
747
|
+
event.stopPropagation();
|
|
748
|
+
};
|
|
749
|
+
return FsStopPropagationDirective;
|
|
750
|
+
}());
|
|
751
|
+
FsStopPropagationDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsStopPropagationDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
752
|
+
FsStopPropagationDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0__namespace });
|
|
753
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsStopPropagationDirective, decorators: [{
|
|
754
|
+
type: i0.Directive,
|
|
755
|
+
args: [{
|
|
756
|
+
selector: '[fsStopPropagation]',
|
|
757
|
+
}]
|
|
758
|
+
}], propDecorators: { preventClick: [{
|
|
759
|
+
type: i0.HostListener,
|
|
760
|
+
args: ['click', ['$event']]
|
|
761
761
|
}] } });
|
|
762
762
|
|
|
763
|
-
var FsPreventDefaultDirective = /** @class */ (function () {
|
|
764
|
-
function FsPreventDefaultDirective() {
|
|
765
|
-
}
|
|
766
|
-
FsPreventDefaultDirective.prototype.preventClick = function (event) {
|
|
767
|
-
event.preventDefault();
|
|
768
|
-
};
|
|
769
|
-
return FsPreventDefaultDirective;
|
|
770
|
-
}());
|
|
771
|
-
FsPreventDefaultDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPreventDefaultDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
772
|
-
FsPreventDefaultDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0__namespace });
|
|
773
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPreventDefaultDirective, decorators: [{
|
|
774
|
-
type: i0.Directive,
|
|
775
|
-
args: [{
|
|
776
|
-
selector: '[fsPreventDefault]',
|
|
777
|
-
}]
|
|
778
|
-
}], propDecorators: { preventClick: [{
|
|
779
|
-
type: i0.HostListener,
|
|
780
|
-
args: ['click', ['$event']]
|
|
763
|
+
var FsPreventDefaultDirective = /** @class */ (function () {
|
|
764
|
+
function FsPreventDefaultDirective() {
|
|
765
|
+
}
|
|
766
|
+
FsPreventDefaultDirective.prototype.preventClick = function (event) {
|
|
767
|
+
event.preventDefault();
|
|
768
|
+
};
|
|
769
|
+
return FsPreventDefaultDirective;
|
|
770
|
+
}());
|
|
771
|
+
FsPreventDefaultDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPreventDefaultDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
772
|
+
FsPreventDefaultDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0__namespace });
|
|
773
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsPreventDefaultDirective, decorators: [{
|
|
774
|
+
type: i0.Directive,
|
|
775
|
+
args: [{
|
|
776
|
+
selector: '[fsPreventDefault]',
|
|
777
|
+
}]
|
|
778
|
+
}], propDecorators: { preventClick: [{
|
|
779
|
+
type: i0.HostListener,
|
|
780
|
+
args: ['click', ['$event']]
|
|
781
781
|
}] } });
|
|
782
782
|
|
|
783
|
-
var FsAutofocusDirective = /** @class */ (function () {
|
|
784
|
-
function FsAutofocusDirective(_el) {
|
|
785
|
-
this._el = _el;
|
|
786
|
-
}
|
|
787
|
-
FsAutofocusDirective.prototype.ngAfterViewInit = function () {
|
|
788
|
-
var _this = this;
|
|
789
|
-
setTimeout(function () {
|
|
790
|
-
_this._el.nativeElement.focus();
|
|
791
|
-
});
|
|
792
|
-
};
|
|
793
|
-
return FsAutofocusDirective;
|
|
794
|
-
}());
|
|
795
|
-
FsAutofocusDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAutofocusDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
796
|
-
FsAutofocusDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsAutofocusDirective, selector: "[autofocus]", ngImport: i0__namespace });
|
|
797
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAutofocusDirective, decorators: [{
|
|
798
|
-
type: i0.Directive,
|
|
799
|
-
args: [{
|
|
800
|
-
selector: '[autofocus]',
|
|
801
|
-
}]
|
|
783
|
+
var FsAutofocusDirective = /** @class */ (function () {
|
|
784
|
+
function FsAutofocusDirective(_el) {
|
|
785
|
+
this._el = _el;
|
|
786
|
+
}
|
|
787
|
+
FsAutofocusDirective.prototype.ngAfterViewInit = function () {
|
|
788
|
+
var _this = this;
|
|
789
|
+
setTimeout(function () {
|
|
790
|
+
_this._el.nativeElement.focus();
|
|
791
|
+
});
|
|
792
|
+
};
|
|
793
|
+
return FsAutofocusDirective;
|
|
794
|
+
}());
|
|
795
|
+
FsAutofocusDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAutofocusDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
796
|
+
FsAutofocusDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsAutofocusDirective, selector: "[autofocus]", ngImport: i0__namespace });
|
|
797
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAutofocusDirective, decorators: [{
|
|
798
|
+
type: i0.Directive,
|
|
799
|
+
args: [{
|
|
800
|
+
selector: '[autofocus]',
|
|
801
|
+
}]
|
|
802
802
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
|
|
803
803
|
|
|
804
|
-
/*! *****************************************************************************
|
|
805
|
-
Copyright (c) Microsoft Corporation.
|
|
806
|
-
|
|
807
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
808
|
-
purpose with or without fee is hereby granted.
|
|
809
|
-
|
|
810
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
811
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
812
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
813
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
814
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
815
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
816
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
817
|
-
***************************************************************************** */
|
|
818
|
-
/* global Reflect, Promise */
|
|
819
|
-
var extendStatics = function (d, b) {
|
|
820
|
-
extendStatics = Object.setPrototypeOf ||
|
|
821
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
822
|
-
function (d, b) { for (var p in b)
|
|
823
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
824
|
-
d[p] = b[p]; };
|
|
825
|
-
return extendStatics(d, b);
|
|
826
|
-
};
|
|
827
|
-
function __extends(d, b) {
|
|
828
|
-
if (typeof b !== "function" && b !== null)
|
|
829
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
830
|
-
extendStatics(d, b);
|
|
831
|
-
function __() { this.constructor = d; }
|
|
832
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
833
|
-
}
|
|
834
|
-
var __assign = function () {
|
|
835
|
-
__assign = Object.assign || function __assign(t) {
|
|
836
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
837
|
-
s = arguments[i];
|
|
838
|
-
for (var p in s)
|
|
839
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
840
|
-
t[p] = s[p];
|
|
841
|
-
}
|
|
842
|
-
return t;
|
|
843
|
-
};
|
|
844
|
-
return __assign.apply(this, arguments);
|
|
845
|
-
};
|
|
846
|
-
function __rest(s, e) {
|
|
847
|
-
var t = {};
|
|
848
|
-
for (var p in s)
|
|
849
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
850
|
-
t[p] = s[p];
|
|
851
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
852
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
853
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
854
|
-
t[p[i]] = s[p[i]];
|
|
855
|
-
}
|
|
856
|
-
return t;
|
|
857
|
-
}
|
|
858
|
-
function __decorate(decorators, target, key, desc) {
|
|
859
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
860
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
861
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
862
|
-
else
|
|
863
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
864
|
-
if (d = decorators[i])
|
|
865
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
866
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
867
|
-
}
|
|
868
|
-
function __param(paramIndex, decorator) {
|
|
869
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
870
|
-
}
|
|
871
|
-
function __metadata(metadataKey, metadataValue) {
|
|
872
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
873
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
874
|
-
}
|
|
875
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
876
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
877
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
878
|
-
function fulfilled(value) { try {
|
|
879
|
-
step(generator.next(value));
|
|
880
|
-
}
|
|
881
|
-
catch (e) {
|
|
882
|
-
reject(e);
|
|
883
|
-
} }
|
|
884
|
-
function rejected(value) { try {
|
|
885
|
-
step(generator["throw"](value));
|
|
886
|
-
}
|
|
887
|
-
catch (e) {
|
|
888
|
-
reject(e);
|
|
889
|
-
} }
|
|
890
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
891
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
function __generator(thisArg, body) {
|
|
895
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
896
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
897
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
898
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
899
|
-
function step(op) {
|
|
900
|
-
if (f)
|
|
901
|
-
throw new TypeError("Generator is already executing.");
|
|
902
|
-
while (_)
|
|
903
|
-
try {
|
|
904
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
905
|
-
return t;
|
|
906
|
-
if (y = 0, t)
|
|
907
|
-
op = [op[0] & 2, t.value];
|
|
908
|
-
switch (op[0]) {
|
|
909
|
-
case 0:
|
|
910
|
-
case 1:
|
|
911
|
-
t = op;
|
|
912
|
-
break;
|
|
913
|
-
case 4:
|
|
914
|
-
_.label++;
|
|
915
|
-
return { value: op[1], done: false };
|
|
916
|
-
case 5:
|
|
917
|
-
_.label++;
|
|
918
|
-
y = op[1];
|
|
919
|
-
op = [0];
|
|
920
|
-
continue;
|
|
921
|
-
case 7:
|
|
922
|
-
op = _.ops.pop();
|
|
923
|
-
_.trys.pop();
|
|
924
|
-
continue;
|
|
925
|
-
default:
|
|
926
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
927
|
-
_ = 0;
|
|
928
|
-
continue;
|
|
929
|
-
}
|
|
930
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
931
|
-
_.label = op[1];
|
|
932
|
-
break;
|
|
933
|
-
}
|
|
934
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
935
|
-
_.label = t[1];
|
|
936
|
-
t = op;
|
|
937
|
-
break;
|
|
938
|
-
}
|
|
939
|
-
if (t && _.label < t[2]) {
|
|
940
|
-
_.label = t[2];
|
|
941
|
-
_.ops.push(op);
|
|
942
|
-
break;
|
|
943
|
-
}
|
|
944
|
-
if (t[2])
|
|
945
|
-
_.ops.pop();
|
|
946
|
-
_.trys.pop();
|
|
947
|
-
continue;
|
|
948
|
-
}
|
|
949
|
-
op = body.call(thisArg, _);
|
|
950
|
-
}
|
|
951
|
-
catch (e) {
|
|
952
|
-
op = [6, e];
|
|
953
|
-
y = 0;
|
|
954
|
-
}
|
|
955
|
-
finally {
|
|
956
|
-
f = t = 0;
|
|
957
|
-
}
|
|
958
|
-
if (op[0] & 5)
|
|
959
|
-
throw op[1];
|
|
960
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
964
|
-
if (k2 === undefined)
|
|
965
|
-
k2 = k;
|
|
966
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
967
|
-
}) : (function (o, m, k, k2) {
|
|
968
|
-
if (k2 === undefined)
|
|
969
|
-
k2 = k;
|
|
970
|
-
o[k2] = m[k];
|
|
971
|
-
});
|
|
972
|
-
function __exportStar(m, o) {
|
|
973
|
-
for (var p in m)
|
|
974
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
975
|
-
__createBinding(o, m, p);
|
|
976
|
-
}
|
|
977
|
-
function __values(o) {
|
|
978
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
979
|
-
if (m)
|
|
980
|
-
return m.call(o);
|
|
981
|
-
if (o && typeof o.length === "number")
|
|
982
|
-
return {
|
|
983
|
-
next: function () {
|
|
984
|
-
if (o && i >= o.length)
|
|
985
|
-
o = void 0;
|
|
986
|
-
return { value: o && o[i++], done: !o };
|
|
987
|
-
}
|
|
988
|
-
};
|
|
989
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
990
|
-
}
|
|
991
|
-
function __read(o, n) {
|
|
992
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
993
|
-
if (!m)
|
|
994
|
-
return o;
|
|
995
|
-
var i = m.call(o), r, ar = [], e;
|
|
996
|
-
try {
|
|
997
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
998
|
-
ar.push(r.value);
|
|
999
|
-
}
|
|
1000
|
-
catch (error) {
|
|
1001
|
-
e = { error: error };
|
|
1002
|
-
}
|
|
1003
|
-
finally {
|
|
1004
|
-
try {
|
|
1005
|
-
if (r && !r.done && (m = i["return"]))
|
|
1006
|
-
m.call(i);
|
|
1007
|
-
}
|
|
1008
|
-
finally {
|
|
1009
|
-
if (e)
|
|
1010
|
-
throw e.error;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
return ar;
|
|
1014
|
-
}
|
|
1015
|
-
/** @deprecated */
|
|
1016
|
-
function __spread() {
|
|
1017
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1018
|
-
ar = ar.concat(__read(arguments[i]));
|
|
1019
|
-
return ar;
|
|
1020
|
-
}
|
|
1021
|
-
/** @deprecated */
|
|
1022
|
-
function __spreadArrays() {
|
|
1023
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1024
|
-
s += arguments[i].length;
|
|
1025
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1026
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1027
|
-
r[k] = a[j];
|
|
1028
|
-
return r;
|
|
1029
|
-
}
|
|
1030
|
-
function __spreadArray(to, from, pack) {
|
|
1031
|
-
if (pack || arguments.length === 2)
|
|
1032
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1033
|
-
if (ar || !(i in from)) {
|
|
1034
|
-
if (!ar)
|
|
1035
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
1036
|
-
ar[i] = from[i];
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1040
|
-
}
|
|
1041
|
-
function __await(v) {
|
|
1042
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
1043
|
-
}
|
|
1044
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
1045
|
-
if (!Symbol.asyncIterator)
|
|
1046
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1047
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
1048
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
1049
|
-
function verb(n) { if (g[n])
|
|
1050
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
1051
|
-
function resume(n, v) { try {
|
|
1052
|
-
step(g[n](v));
|
|
1053
|
-
}
|
|
1054
|
-
catch (e) {
|
|
1055
|
-
settle(q[0][3], e);
|
|
1056
|
-
} }
|
|
1057
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
1058
|
-
function fulfill(value) { resume("next", value); }
|
|
1059
|
-
function reject(value) { resume("throw", value); }
|
|
1060
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
1061
|
-
resume(q[0][0], q[0][1]); }
|
|
1062
|
-
}
|
|
1063
|
-
function __asyncDelegator(o) {
|
|
1064
|
-
var i, p;
|
|
1065
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1066
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1067
|
-
}
|
|
1068
|
-
function __asyncValues(o) {
|
|
1069
|
-
if (!Symbol.asyncIterator)
|
|
1070
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1071
|
-
var m = o[Symbol.asyncIterator], i;
|
|
1072
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
1073
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
1074
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
1075
|
-
}
|
|
1076
|
-
function __makeTemplateObject(cooked, raw) {
|
|
1077
|
-
if (Object.defineProperty) {
|
|
1078
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
1079
|
-
}
|
|
1080
|
-
else {
|
|
1081
|
-
cooked.raw = raw;
|
|
1082
|
-
}
|
|
1083
|
-
return cooked;
|
|
1084
|
-
}
|
|
1085
|
-
;
|
|
1086
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
1087
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1088
|
-
}) : function (o, v) {
|
|
1089
|
-
o["default"] = v;
|
|
1090
|
-
};
|
|
1091
|
-
function __importStar(mod) {
|
|
1092
|
-
if (mod && mod.__esModule)
|
|
1093
|
-
return mod;
|
|
1094
|
-
var result = {};
|
|
1095
|
-
if (mod != null)
|
|
1096
|
-
for (var k in mod)
|
|
1097
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
1098
|
-
__createBinding(result, mod, k);
|
|
1099
|
-
__setModuleDefault(result, mod);
|
|
1100
|
-
return result;
|
|
1101
|
-
}
|
|
1102
|
-
function __importDefault(mod) {
|
|
1103
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
1104
|
-
}
|
|
1105
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1106
|
-
if (kind === "a" && !f)
|
|
1107
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
1108
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1109
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1110
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1111
|
-
}
|
|
1112
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1113
|
-
if (kind === "m")
|
|
1114
|
-
throw new TypeError("Private method is not writable");
|
|
1115
|
-
if (kind === "a" && !f)
|
|
1116
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
1117
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1118
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1119
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
804
|
+
/*! *****************************************************************************
|
|
805
|
+
Copyright (c) Microsoft Corporation.
|
|
806
|
+
|
|
807
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
808
|
+
purpose with or without fee is hereby granted.
|
|
809
|
+
|
|
810
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
811
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
812
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
813
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
814
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
815
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
816
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
817
|
+
***************************************************************************** */
|
|
818
|
+
/* global Reflect, Promise */
|
|
819
|
+
var extendStatics = function (d, b) {
|
|
820
|
+
extendStatics = Object.setPrototypeOf ||
|
|
821
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
822
|
+
function (d, b) { for (var p in b)
|
|
823
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
824
|
+
d[p] = b[p]; };
|
|
825
|
+
return extendStatics(d, b);
|
|
826
|
+
};
|
|
827
|
+
function __extends(d, b) {
|
|
828
|
+
if (typeof b !== "function" && b !== null)
|
|
829
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
830
|
+
extendStatics(d, b);
|
|
831
|
+
function __() { this.constructor = d; }
|
|
832
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
833
|
+
}
|
|
834
|
+
var __assign = function () {
|
|
835
|
+
__assign = Object.assign || function __assign(t) {
|
|
836
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
837
|
+
s = arguments[i];
|
|
838
|
+
for (var p in s)
|
|
839
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
840
|
+
t[p] = s[p];
|
|
841
|
+
}
|
|
842
|
+
return t;
|
|
843
|
+
};
|
|
844
|
+
return __assign.apply(this, arguments);
|
|
845
|
+
};
|
|
846
|
+
function __rest(s, e) {
|
|
847
|
+
var t = {};
|
|
848
|
+
for (var p in s)
|
|
849
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
850
|
+
t[p] = s[p];
|
|
851
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
852
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
853
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
854
|
+
t[p[i]] = s[p[i]];
|
|
855
|
+
}
|
|
856
|
+
return t;
|
|
857
|
+
}
|
|
858
|
+
function __decorate(decorators, target, key, desc) {
|
|
859
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
860
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
861
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
862
|
+
else
|
|
863
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
864
|
+
if (d = decorators[i])
|
|
865
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
866
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
867
|
+
}
|
|
868
|
+
function __param(paramIndex, decorator) {
|
|
869
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
870
|
+
}
|
|
871
|
+
function __metadata(metadataKey, metadataValue) {
|
|
872
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
873
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
874
|
+
}
|
|
875
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
876
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
877
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
878
|
+
function fulfilled(value) { try {
|
|
879
|
+
step(generator.next(value));
|
|
880
|
+
}
|
|
881
|
+
catch (e) {
|
|
882
|
+
reject(e);
|
|
883
|
+
} }
|
|
884
|
+
function rejected(value) { try {
|
|
885
|
+
step(generator["throw"](value));
|
|
886
|
+
}
|
|
887
|
+
catch (e) {
|
|
888
|
+
reject(e);
|
|
889
|
+
} }
|
|
890
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
891
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
function __generator(thisArg, body) {
|
|
895
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
896
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
897
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
898
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
899
|
+
function step(op) {
|
|
900
|
+
if (f)
|
|
901
|
+
throw new TypeError("Generator is already executing.");
|
|
902
|
+
while (_)
|
|
903
|
+
try {
|
|
904
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
905
|
+
return t;
|
|
906
|
+
if (y = 0, t)
|
|
907
|
+
op = [op[0] & 2, t.value];
|
|
908
|
+
switch (op[0]) {
|
|
909
|
+
case 0:
|
|
910
|
+
case 1:
|
|
911
|
+
t = op;
|
|
912
|
+
break;
|
|
913
|
+
case 4:
|
|
914
|
+
_.label++;
|
|
915
|
+
return { value: op[1], done: false };
|
|
916
|
+
case 5:
|
|
917
|
+
_.label++;
|
|
918
|
+
y = op[1];
|
|
919
|
+
op = [0];
|
|
920
|
+
continue;
|
|
921
|
+
case 7:
|
|
922
|
+
op = _.ops.pop();
|
|
923
|
+
_.trys.pop();
|
|
924
|
+
continue;
|
|
925
|
+
default:
|
|
926
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
927
|
+
_ = 0;
|
|
928
|
+
continue;
|
|
929
|
+
}
|
|
930
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
931
|
+
_.label = op[1];
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
935
|
+
_.label = t[1];
|
|
936
|
+
t = op;
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
if (t && _.label < t[2]) {
|
|
940
|
+
_.label = t[2];
|
|
941
|
+
_.ops.push(op);
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
if (t[2])
|
|
945
|
+
_.ops.pop();
|
|
946
|
+
_.trys.pop();
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
op = body.call(thisArg, _);
|
|
950
|
+
}
|
|
951
|
+
catch (e) {
|
|
952
|
+
op = [6, e];
|
|
953
|
+
y = 0;
|
|
954
|
+
}
|
|
955
|
+
finally {
|
|
956
|
+
f = t = 0;
|
|
957
|
+
}
|
|
958
|
+
if (op[0] & 5)
|
|
959
|
+
throw op[1];
|
|
960
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
964
|
+
if (k2 === undefined)
|
|
965
|
+
k2 = k;
|
|
966
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
967
|
+
}) : (function (o, m, k, k2) {
|
|
968
|
+
if (k2 === undefined)
|
|
969
|
+
k2 = k;
|
|
970
|
+
o[k2] = m[k];
|
|
971
|
+
});
|
|
972
|
+
function __exportStar(m, o) {
|
|
973
|
+
for (var p in m)
|
|
974
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
975
|
+
__createBinding(o, m, p);
|
|
976
|
+
}
|
|
977
|
+
function __values(o) {
|
|
978
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
979
|
+
if (m)
|
|
980
|
+
return m.call(o);
|
|
981
|
+
if (o && typeof o.length === "number")
|
|
982
|
+
return {
|
|
983
|
+
next: function () {
|
|
984
|
+
if (o && i >= o.length)
|
|
985
|
+
o = void 0;
|
|
986
|
+
return { value: o && o[i++], done: !o };
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
990
|
+
}
|
|
991
|
+
function __read(o, n) {
|
|
992
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
993
|
+
if (!m)
|
|
994
|
+
return o;
|
|
995
|
+
var i = m.call(o), r, ar = [], e;
|
|
996
|
+
try {
|
|
997
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
998
|
+
ar.push(r.value);
|
|
999
|
+
}
|
|
1000
|
+
catch (error) {
|
|
1001
|
+
e = { error: error };
|
|
1002
|
+
}
|
|
1003
|
+
finally {
|
|
1004
|
+
try {
|
|
1005
|
+
if (r && !r.done && (m = i["return"]))
|
|
1006
|
+
m.call(i);
|
|
1007
|
+
}
|
|
1008
|
+
finally {
|
|
1009
|
+
if (e)
|
|
1010
|
+
throw e.error;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return ar;
|
|
1014
|
+
}
|
|
1015
|
+
/** @deprecated */
|
|
1016
|
+
function __spread() {
|
|
1017
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1018
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1019
|
+
return ar;
|
|
1020
|
+
}
|
|
1021
|
+
/** @deprecated */
|
|
1022
|
+
function __spreadArrays() {
|
|
1023
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1024
|
+
s += arguments[i].length;
|
|
1025
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1026
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1027
|
+
r[k] = a[j];
|
|
1028
|
+
return r;
|
|
1029
|
+
}
|
|
1030
|
+
function __spreadArray(to, from, pack) {
|
|
1031
|
+
if (pack || arguments.length === 2)
|
|
1032
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1033
|
+
if (ar || !(i in from)) {
|
|
1034
|
+
if (!ar)
|
|
1035
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
1036
|
+
ar[i] = from[i];
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1040
|
+
}
|
|
1041
|
+
function __await(v) {
|
|
1042
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
1043
|
+
}
|
|
1044
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
1045
|
+
if (!Symbol.asyncIterator)
|
|
1046
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1047
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
1048
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
1049
|
+
function verb(n) { if (g[n])
|
|
1050
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
1051
|
+
function resume(n, v) { try {
|
|
1052
|
+
step(g[n](v));
|
|
1053
|
+
}
|
|
1054
|
+
catch (e) {
|
|
1055
|
+
settle(q[0][3], e);
|
|
1056
|
+
} }
|
|
1057
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
1058
|
+
function fulfill(value) { resume("next", value); }
|
|
1059
|
+
function reject(value) { resume("throw", value); }
|
|
1060
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
1061
|
+
resume(q[0][0], q[0][1]); }
|
|
1062
|
+
}
|
|
1063
|
+
function __asyncDelegator(o) {
|
|
1064
|
+
var i, p;
|
|
1065
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1066
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1067
|
+
}
|
|
1068
|
+
function __asyncValues(o) {
|
|
1069
|
+
if (!Symbol.asyncIterator)
|
|
1070
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1071
|
+
var m = o[Symbol.asyncIterator], i;
|
|
1072
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
1073
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
1074
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
1075
|
+
}
|
|
1076
|
+
function __makeTemplateObject(cooked, raw) {
|
|
1077
|
+
if (Object.defineProperty) {
|
|
1078
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
1079
|
+
}
|
|
1080
|
+
else {
|
|
1081
|
+
cooked.raw = raw;
|
|
1082
|
+
}
|
|
1083
|
+
return cooked;
|
|
1084
|
+
}
|
|
1085
|
+
;
|
|
1086
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
1087
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1088
|
+
}) : function (o, v) {
|
|
1089
|
+
o["default"] = v;
|
|
1090
|
+
};
|
|
1091
|
+
function __importStar(mod) {
|
|
1092
|
+
if (mod && mod.__esModule)
|
|
1093
|
+
return mod;
|
|
1094
|
+
var result = {};
|
|
1095
|
+
if (mod != null)
|
|
1096
|
+
for (var k in mod)
|
|
1097
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
1098
|
+
__createBinding(result, mod, k);
|
|
1099
|
+
__setModuleDefault(result, mod);
|
|
1100
|
+
return result;
|
|
1101
|
+
}
|
|
1102
|
+
function __importDefault(mod) {
|
|
1103
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
1104
|
+
}
|
|
1105
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1106
|
+
if (kind === "a" && !f)
|
|
1107
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1108
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1109
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1110
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1111
|
+
}
|
|
1112
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1113
|
+
if (kind === "m")
|
|
1114
|
+
throw new TypeError("Private method is not writable");
|
|
1115
|
+
if (kind === "a" && !f)
|
|
1116
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
1117
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1118
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1119
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
|
-
function ordinalNumber(value) {
|
|
1123
|
-
value = String(value);
|
|
1124
|
-
var index = value.match(templateObject_1 || (templateObject_1 = __makeTemplateObject(["1?.$"], ["1?.$"])));
|
|
1125
|
-
var endings = [, 'st', 'nd', 'rd'];
|
|
1126
|
-
var ending = endings[index] || 'th';
|
|
1127
|
-
return value + ending;
|
|
1128
|
-
}
|
|
1122
|
+
function ordinalNumber(value) {
|
|
1123
|
+
value = String(value);
|
|
1124
|
+
var index = value.match(templateObject_1 || (templateObject_1 = __makeTemplateObject(["1?.$"], ["1?.$"])));
|
|
1125
|
+
var endings = [, 'st', 'nd', 'rd'];
|
|
1126
|
+
var ending = endings[index] || 'th';
|
|
1127
|
+
return value + ending;
|
|
1128
|
+
}
|
|
1129
1129
|
var templateObject_1;
|
|
1130
1130
|
|
|
1131
|
-
var FsFormatOrdinalNumberPipe = /** @class */ (function () {
|
|
1132
|
-
function FsFormatOrdinalNumberPipe() {
|
|
1133
|
-
}
|
|
1134
|
-
FsFormatOrdinalNumberPipe.prototype.transform = function (value) {
|
|
1135
|
-
return ordinalNumber(value);
|
|
1136
|
-
};
|
|
1137
|
-
return FsFormatOrdinalNumberPipe;
|
|
1138
|
-
}());
|
|
1139
|
-
FsFormatOrdinalNumberPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1140
|
-
FsFormatOrdinalNumberPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
|
|
1141
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, decorators: [{
|
|
1142
|
-
type: i0.Pipe,
|
|
1143
|
-
args: [{
|
|
1144
|
-
name: 'fsFormatOrdinalNumber',
|
|
1145
|
-
}]
|
|
1131
|
+
var FsFormatOrdinalNumberPipe = /** @class */ (function () {
|
|
1132
|
+
function FsFormatOrdinalNumberPipe() {
|
|
1133
|
+
}
|
|
1134
|
+
FsFormatOrdinalNumberPipe.prototype.transform = function (value) {
|
|
1135
|
+
return ordinalNumber(value);
|
|
1136
|
+
};
|
|
1137
|
+
return FsFormatOrdinalNumberPipe;
|
|
1138
|
+
}());
|
|
1139
|
+
FsFormatOrdinalNumberPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1140
|
+
FsFormatOrdinalNumberPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
|
|
1141
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatOrdinalNumberPipe, decorators: [{
|
|
1142
|
+
type: i0.Pipe,
|
|
1143
|
+
args: [{
|
|
1144
|
+
name: 'fsFormatOrdinalNumber',
|
|
1145
|
+
}]
|
|
1146
1146
|
}] });
|
|
1147
1147
|
|
|
1148
|
-
function email(value) {
|
|
1149
|
-
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,}))$/);
|
|
1148
|
+
function email(value) {
|
|
1149
|
+
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,}))$/);
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
1152
|
-
function phone(value) {
|
|
1153
|
-
var valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
|
|
1154
|
-
return valid || !String(value).length;
|
|
1152
|
+
function phone(value) {
|
|
1153
|
+
var valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
|
|
1154
|
+
return valid || !String(value).length;
|
|
1155
1155
|
}
|
|
1156
1156
|
|
|
1157
|
-
/**
|
|
1158
|
-
* Check validity of the url.
|
|
1159
|
-
* Protocol (http/https) isn't required.
|
|
1160
|
-
* @param value
|
|
1161
|
-
* @returns {boolean}
|
|
1162
|
-
*/
|
|
1163
|
-
function url(value) {
|
|
1164
|
-
var expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
|
|
1165
|
-
var regexp = new RegExp(expression);
|
|
1166
|
-
return !!String(value).match(regexp);
|
|
1157
|
+
/**
|
|
1158
|
+
* Check validity of the url.
|
|
1159
|
+
* Protocol (http/https) isn't required.
|
|
1160
|
+
* @param value
|
|
1161
|
+
* @returns {boolean}
|
|
1162
|
+
*/
|
|
1163
|
+
function url(value) {
|
|
1164
|
+
var expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
|
|
1165
|
+
var regexp = new RegExp(expression);
|
|
1166
|
+
return !!String(value).match(regexp);
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
1169
|
-
function compare(query, item) {
|
|
1170
|
-
var value = true;
|
|
1171
|
-
for (var key in query) {
|
|
1172
|
-
value = value && item[key] == query[key];
|
|
1173
|
-
}
|
|
1174
|
-
return value;
|
|
1169
|
+
function compare(query, item) {
|
|
1170
|
+
var value = true;
|
|
1171
|
+
for (var key in query) {
|
|
1172
|
+
value = value && item[key] == query[key];
|
|
1173
|
+
}
|
|
1174
|
+
return value;
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
1177
|
-
function filter(array, query) {
|
|
1178
|
-
if (typeof query !== 'function') {
|
|
1179
|
-
var queryObj_1 = query;
|
|
1180
|
-
query = function (item) {
|
|
1181
|
-
return compare(queryObj_1, item);
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
var isarray = Array.isArray(array);
|
|
1185
|
-
var list = isarray ? [] : {};
|
|
1186
|
-
if (isarray) {
|
|
1187
|
-
array.forEach(function (item, idx) {
|
|
1188
|
-
if (query(item)) {
|
|
1189
|
-
list.push(item);
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
else {
|
|
1194
|
-
Object.keys(array).forEach(function (key) {
|
|
1195
|
-
if (query(array[key])) {
|
|
1196
|
-
list[key] = array[key];
|
|
1197
|
-
}
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
|
-
return list;
|
|
1177
|
+
function filter(array, query) {
|
|
1178
|
+
if (typeof query !== 'function') {
|
|
1179
|
+
var queryObj_1 = query;
|
|
1180
|
+
query = function (item) {
|
|
1181
|
+
return compare(queryObj_1, item);
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
var isarray = Array.isArray(array);
|
|
1185
|
+
var list = isarray ? [] : {};
|
|
1186
|
+
if (isarray) {
|
|
1187
|
+
array.forEach(function (item, idx) {
|
|
1188
|
+
if (query(item)) {
|
|
1189
|
+
list.push(item);
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
Object.keys(array).forEach(function (key) {
|
|
1195
|
+
if (query(array[key])) {
|
|
1196
|
+
list[key] = array[key];
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
return list;
|
|
1201
1201
|
}
|
|
1202
1202
|
|
|
1203
|
-
function inArray(values, array) {
|
|
1204
|
-
if (!Array.isArray(values)) {
|
|
1205
|
-
values = [values];
|
|
1206
|
-
}
|
|
1207
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
|
1208
|
-
if (array.indexOf(values[i]) >= 0) {
|
|
1209
|
-
return true;
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
return false;
|
|
1203
|
+
function inArray(values, array) {
|
|
1204
|
+
if (!Array.isArray(values)) {
|
|
1205
|
+
values = [values];
|
|
1206
|
+
}
|
|
1207
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
|
1208
|
+
if (array.indexOf(values[i]) >= 0) {
|
|
1209
|
+
return true;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
return false;
|
|
1213
1213
|
}
|
|
1214
1214
|
|
|
1215
|
-
function index(array, name, value) {
|
|
1216
|
-
if (value === void 0) { value = null; }
|
|
1217
|
-
var list = {};
|
|
1218
|
-
array.forEach(function (item) {
|
|
1219
|
-
list[item[name]] = value ? item[value] : item;
|
|
1220
|
-
});
|
|
1221
|
-
return list;
|
|
1215
|
+
function index(array, name, value) {
|
|
1216
|
+
if (value === void 0) { value = null; }
|
|
1217
|
+
var list = {};
|
|
1218
|
+
array.forEach(function (item) {
|
|
1219
|
+
list[item[name]] = value ? item[value] : item;
|
|
1220
|
+
});
|
|
1221
|
+
return list;
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
|
-
function indexOf(array, query) {
|
|
1225
|
-
if (typeof query !== 'function') {
|
|
1226
|
-
var queryObj_1 = query;
|
|
1227
|
-
query = function (item) {
|
|
1228
|
-
return compare(queryObj_1, item);
|
|
1229
|
-
};
|
|
1230
|
-
}
|
|
1231
|
-
for (var i = 0, len = array.length; i < len; i++) {
|
|
1232
|
-
if (query(array[i])) {
|
|
1233
|
-
return i;
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
return -1;
|
|
1224
|
+
function indexOf(array, query) {
|
|
1225
|
+
if (typeof query !== 'function') {
|
|
1226
|
+
var queryObj_1 = query;
|
|
1227
|
+
query = function (item) {
|
|
1228
|
+
return compare(queryObj_1, item);
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
for (var i = 0, len = array.length; i < len; i++) {
|
|
1232
|
+
if (query(array[i])) {
|
|
1233
|
+
return i;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
return -1;
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
|
-
function keyExists(array, key) {
|
|
1240
|
-
return array.hasOwnProperty(key);
|
|
1239
|
+
function keyExists(array, key) {
|
|
1240
|
+
return array.hasOwnProperty(key);
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
1243
|
-
function ksort(unordered) {
|
|
1244
|
-
Object.keys(unordered).sort().forEach(function (key) {
|
|
1245
|
-
var value = unordered[key];
|
|
1246
|
-
delete unordered[key];
|
|
1247
|
-
unordered[key] = value;
|
|
1248
|
-
});
|
|
1243
|
+
function ksort(unordered) {
|
|
1244
|
+
Object.keys(unordered).sort().forEach(function (key) {
|
|
1245
|
+
var value = unordered[key];
|
|
1246
|
+
delete unordered[key];
|
|
1247
|
+
unordered[key] = value;
|
|
1248
|
+
});
|
|
1249
1249
|
}
|
|
1250
1250
|
|
|
1251
|
-
function list(array, property, index) {
|
|
1252
|
-
if (index === void 0) { index = null; }
|
|
1253
|
-
var resultList = index ? {} : [];
|
|
1254
|
-
array.forEach(function (item, idx) {
|
|
1255
|
-
if (index) {
|
|
1256
|
-
resultList[item[index]] = item[property];
|
|
1257
|
-
}
|
|
1258
|
-
else {
|
|
1259
|
-
resultList.push(item[property]);
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
return resultList;
|
|
1251
|
+
function list(array, property, index) {
|
|
1252
|
+
if (index === void 0) { index = null; }
|
|
1253
|
+
var resultList = index ? {} : [];
|
|
1254
|
+
array.forEach(function (item, idx) {
|
|
1255
|
+
if (index) {
|
|
1256
|
+
resultList[item[index]] = item[property];
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
resultList.push(item[property]);
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
return resultList;
|
|
1263
1263
|
}
|
|
1264
1264
|
|
|
1265
|
-
function nameValue(array, name, value) {
|
|
1266
|
-
var list = [];
|
|
1267
|
-
if (name || value) {
|
|
1268
|
-
var nameFn_1 = typeof name === 'function' ? name : function (item) {
|
|
1269
|
-
return item[name];
|
|
1270
|
-
};
|
|
1271
|
-
var valueFn_1 = typeof value === 'function' ? value : function (item) {
|
|
1272
|
-
return item[value];
|
|
1273
|
-
};
|
|
1274
|
-
array.forEach(function (item) {
|
|
1275
|
-
list.push({ name: nameFn_1(item), value: valueFn_1(item) });
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
else {
|
|
1279
|
-
array.forEach(function (n, v) {
|
|
1280
|
-
list.push({ name: n, value: v });
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
return list;
|
|
1265
|
+
function nameValue(array, name, value) {
|
|
1266
|
+
var list = [];
|
|
1267
|
+
if (name || value) {
|
|
1268
|
+
var nameFn_1 = typeof name === 'function' ? name : function (item) {
|
|
1269
|
+
return item[name];
|
|
1270
|
+
};
|
|
1271
|
+
var valueFn_1 = typeof value === 'function' ? value : function (item) {
|
|
1272
|
+
return item[value];
|
|
1273
|
+
};
|
|
1274
|
+
array.forEach(function (item) {
|
|
1275
|
+
list.push({ name: nameFn_1(item), value: valueFn_1(item) });
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
else {
|
|
1279
|
+
array.forEach(function (n, v) {
|
|
1280
|
+
list.push({ name: n, value: v });
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
return list;
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
1286
|
-
function remove(array, query) {
|
|
1287
|
-
var idx = indexOf(array, query);
|
|
1288
|
-
if (idx >= 0) {
|
|
1289
|
-
return array.splice(idx, 1);
|
|
1290
|
-
}
|
|
1291
|
-
return idx;
|
|
1286
|
+
function remove(array, query) {
|
|
1287
|
+
var idx = indexOf(array, query);
|
|
1288
|
+
if (idx >= 0) {
|
|
1289
|
+
return array.splice(idx, 1);
|
|
1290
|
+
}
|
|
1291
|
+
return idx;
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
-
function sort(array, query, reverse) {
|
|
1295
|
-
if (reverse === void 0) { reverse = false; }
|
|
1296
|
-
if (typeof query !== 'function') {
|
|
1297
|
-
var queryStr_1 = query;
|
|
1298
|
-
query = function (a, b) {
|
|
1299
|
-
if (reverse) {
|
|
1300
|
-
if (a[queryStr_1] < b[queryStr_1]) {
|
|
1301
|
-
return 1;
|
|
1302
|
-
}
|
|
1303
|
-
else if (a[queryStr_1] > b[queryStr_1]) {
|
|
1304
|
-
return -1;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
else {
|
|
1308
|
-
if (a[queryStr_1] > b[queryStr_1]) {
|
|
1309
|
-
return 1;
|
|
1310
|
-
}
|
|
1311
|
-
else if (a[queryStr_1] < b[queryStr_1]) {
|
|
1312
|
-
return -1;
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
return 0;
|
|
1316
|
-
};
|
|
1317
|
-
}
|
|
1318
|
-
array.sort(query);
|
|
1319
|
-
return array;
|
|
1294
|
+
function sort(array, query, reverse) {
|
|
1295
|
+
if (reverse === void 0) { reverse = false; }
|
|
1296
|
+
if (typeof query !== 'function') {
|
|
1297
|
+
var queryStr_1 = query;
|
|
1298
|
+
query = function (a, b) {
|
|
1299
|
+
if (reverse) {
|
|
1300
|
+
if (a[queryStr_1] < b[queryStr_1]) {
|
|
1301
|
+
return 1;
|
|
1302
|
+
}
|
|
1303
|
+
else if (a[queryStr_1] > b[queryStr_1]) {
|
|
1304
|
+
return -1;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
else {
|
|
1308
|
+
if (a[queryStr_1] > b[queryStr_1]) {
|
|
1309
|
+
return 1;
|
|
1310
|
+
}
|
|
1311
|
+
else if (a[queryStr_1] < b[queryStr_1]) {
|
|
1312
|
+
return -1;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
return 0;
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
array.sort(query);
|
|
1319
|
+
return array;
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
-
function rsort(array, query) {
|
|
1323
|
-
return sort(array, query, true);
|
|
1322
|
+
function rsort(array, query) {
|
|
1323
|
+
return sort(array, query, true);
|
|
1324
1324
|
}
|
|
1325
1325
|
|
|
1326
|
-
function find(array, query) {
|
|
1327
|
-
var data = filter(array, query);
|
|
1328
|
-
return data.length ? data[0] : null;
|
|
1326
|
+
function find(array, query) {
|
|
1327
|
+
var data = filter(array, query);
|
|
1328
|
+
return data.length ? data[0] : null;
|
|
1329
1329
|
}
|
|
1330
1330
|
|
|
1331
|
-
function boolean(value) {
|
|
1332
|
-
return String(value).toLowerCase() !== 'false' && !!value;
|
|
1331
|
+
function boolean(value) {
|
|
1332
|
+
return String(value).toLowerCase() !== 'false' && !!value;
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
|
-
function debounce(func, wait, immediate) {
|
|
1336
|
-
var timeout;
|
|
1337
|
-
return function () {
|
|
1338
|
-
var context = this, args = arguments;
|
|
1339
|
-
var later = function () {
|
|
1340
|
-
timeout = null;
|
|
1341
|
-
if (!immediate)
|
|
1342
|
-
func.apply(context, args);
|
|
1343
|
-
};
|
|
1344
|
-
var callNow = immediate && !timeout;
|
|
1345
|
-
clearTimeout(timeout);
|
|
1346
|
-
timeout = setTimeout(later, wait);
|
|
1347
|
-
if (callNow)
|
|
1348
|
-
func.apply(context, args);
|
|
1349
|
-
};
|
|
1335
|
+
function debounce(func, wait, immediate) {
|
|
1336
|
+
var timeout;
|
|
1337
|
+
return function () {
|
|
1338
|
+
var context = this, args = arguments;
|
|
1339
|
+
var later = function () {
|
|
1340
|
+
timeout = null;
|
|
1341
|
+
if (!immediate)
|
|
1342
|
+
func.apply(context, args);
|
|
1343
|
+
};
|
|
1344
|
+
var callNow = immediate && !timeout;
|
|
1345
|
+
clearTimeout(timeout);
|
|
1346
|
+
timeout = setTimeout(later, wait);
|
|
1347
|
+
if (callNow)
|
|
1348
|
+
func.apply(context, args);
|
|
1349
|
+
};
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
-
var KEY_CANCEL = 3;
|
|
1353
|
-
var KEY_HELP = 6;
|
|
1354
|
-
var KEY_BACKSPACE = 8;
|
|
1355
|
-
var KEY_TAB = 9;
|
|
1356
|
-
var KEY_CLEAR = 12;
|
|
1357
|
-
var KEY_RETURN = 13;
|
|
1358
|
-
var KEY_ENTER = 14;
|
|
1359
|
-
var KEY_SHIFT = 16;
|
|
1360
|
-
var KEY_CONTROL = 17;
|
|
1361
|
-
var KEY_ALT = 18;
|
|
1362
|
-
var KEY_PAUSE = 19;
|
|
1363
|
-
var KEY_CAPS_LOCK = 20;
|
|
1364
|
-
var KEY_ESCAPE = 27;
|
|
1365
|
-
var KEY_SPACE = 32;
|
|
1366
|
-
var KEY_PAGE_UP = 33;
|
|
1367
|
-
var KEY_PAGE_DOWN = 34;
|
|
1368
|
-
var KEY_END = 35;
|
|
1369
|
-
var KEY_HOME = 36;
|
|
1370
|
-
var KEY_LEFT = 37;
|
|
1371
|
-
var KEY_UP = 38;
|
|
1372
|
-
var KEY_RIGHT = 39;
|
|
1373
|
-
var KEY_DOWN = 40;
|
|
1374
|
-
var KEY_PRINTSCREEN = 44;
|
|
1375
|
-
var KEY_INSERT = 45;
|
|
1376
|
-
var KEY_DELETE = 46;
|
|
1377
|
-
var KEY_0 = 48;
|
|
1378
|
-
var KEY_1 = 49;
|
|
1379
|
-
var KEY_2 = 50;
|
|
1380
|
-
var KEY_3 = 51;
|
|
1381
|
-
var KEY_4 = 52;
|
|
1382
|
-
var KEY_5 = 53;
|
|
1383
|
-
var KEY_6 = 54;
|
|
1384
|
-
var KEY_7 = 55;
|
|
1385
|
-
var KEY_8 = 56;
|
|
1386
|
-
var KEY_9 = 57;
|
|
1387
|
-
var KEY_SEMICOLON = 59;
|
|
1352
|
+
var KEY_CANCEL = 3;
|
|
1353
|
+
var KEY_HELP = 6;
|
|
1354
|
+
var KEY_BACKSPACE = 8;
|
|
1355
|
+
var KEY_TAB = 9;
|
|
1356
|
+
var KEY_CLEAR = 12;
|
|
1357
|
+
var KEY_RETURN = 13;
|
|
1358
|
+
var KEY_ENTER = 14;
|
|
1359
|
+
var KEY_SHIFT = 16;
|
|
1360
|
+
var KEY_CONTROL = 17;
|
|
1361
|
+
var KEY_ALT = 18;
|
|
1362
|
+
var KEY_PAUSE = 19;
|
|
1363
|
+
var KEY_CAPS_LOCK = 20;
|
|
1364
|
+
var KEY_ESCAPE = 27;
|
|
1365
|
+
var KEY_SPACE = 32;
|
|
1366
|
+
var KEY_PAGE_UP = 33;
|
|
1367
|
+
var KEY_PAGE_DOWN = 34;
|
|
1368
|
+
var KEY_END = 35;
|
|
1369
|
+
var KEY_HOME = 36;
|
|
1370
|
+
var KEY_LEFT = 37;
|
|
1371
|
+
var KEY_UP = 38;
|
|
1372
|
+
var KEY_RIGHT = 39;
|
|
1373
|
+
var KEY_DOWN = 40;
|
|
1374
|
+
var KEY_PRINTSCREEN = 44;
|
|
1375
|
+
var KEY_INSERT = 45;
|
|
1376
|
+
var KEY_DELETE = 46;
|
|
1377
|
+
var KEY_0 = 48;
|
|
1378
|
+
var KEY_1 = 49;
|
|
1379
|
+
var KEY_2 = 50;
|
|
1380
|
+
var KEY_3 = 51;
|
|
1381
|
+
var KEY_4 = 52;
|
|
1382
|
+
var KEY_5 = 53;
|
|
1383
|
+
var KEY_6 = 54;
|
|
1384
|
+
var KEY_7 = 55;
|
|
1385
|
+
var KEY_8 = 56;
|
|
1386
|
+
var KEY_9 = 57;
|
|
1387
|
+
var KEY_SEMICOLON = 59;
|
|
1388
1388
|
var KEY_EQUALS = 61;
|
|
1389
1389
|
|
|
1390
|
-
function length(object) {
|
|
1391
|
-
if (Array.isArray(object)) {
|
|
1392
|
-
return object.length;
|
|
1393
|
-
}
|
|
1394
|
-
if (object instanceof Object) {
|
|
1395
|
-
return Object.keys(object).length;
|
|
1396
|
-
}
|
|
1397
|
-
return 0;
|
|
1390
|
+
function length(object) {
|
|
1391
|
+
if (Array.isArray(object)) {
|
|
1392
|
+
return object.length;
|
|
1393
|
+
}
|
|
1394
|
+
if (object instanceof Object) {
|
|
1395
|
+
return Object.keys(object).length;
|
|
1396
|
+
}
|
|
1397
|
+
return 0;
|
|
1398
1398
|
}
|
|
1399
1399
|
|
|
1400
|
-
function resolve(promise, defaults) {
|
|
1401
|
-
if (defaults === void 0) { defaults = []; }
|
|
1402
|
-
var result = defaults;
|
|
1403
|
-
return new Promise(function (resolve) {
|
|
1404
|
-
promise.then(function (data) {
|
|
1405
|
-
Object.keys(data).forEach(function (key) { return result[key] = data[key]; });
|
|
1406
|
-
resolve(result);
|
|
1407
|
-
});
|
|
1408
|
-
});
|
|
1400
|
+
function resolve(promise, defaults) {
|
|
1401
|
+
if (defaults === void 0) { defaults = []; }
|
|
1402
|
+
var result = defaults;
|
|
1403
|
+
return new Promise(function (resolve) {
|
|
1404
|
+
promise.then(function (data) {
|
|
1405
|
+
Object.keys(data).forEach(function (key) { return result[key] = data[key]; });
|
|
1406
|
+
resolve(result);
|
|
1407
|
+
});
|
|
1408
|
+
});
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
|
-
function uuid() {
|
|
1412
|
-
return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
1411
|
+
function uuid() {
|
|
1412
|
+
return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
|
-
function value(object, key, def) {
|
|
1416
|
-
if (typeof object === 'object' || Array.isArray(object)) {
|
|
1417
|
-
if (object.hasOwnProperty(key)) {
|
|
1418
|
-
return object[key];
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
return def;
|
|
1415
|
+
function value(object, key, def) {
|
|
1416
|
+
if (typeof object === 'object' || Array.isArray(object)) {
|
|
1417
|
+
if (object.hasOwnProperty(key)) {
|
|
1418
|
+
return object[key];
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
return def;
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
|
-
function isClass(value, cls) {
|
|
1425
|
-
if (typeof value === 'object') {
|
|
1426
|
-
if (typeof cls === 'string') {
|
|
1427
|
-
if (value.constructor) {
|
|
1428
|
-
if (value.constructor.name === cls) {
|
|
1429
|
-
return true;
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
else {
|
|
1434
|
-
if (value instanceof cls) {
|
|
1435
|
-
return true;
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
return false;
|
|
1424
|
+
function isClass(value, cls) {
|
|
1425
|
+
if (typeof value === 'object') {
|
|
1426
|
+
if (typeof cls === 'string') {
|
|
1427
|
+
if (value.constructor) {
|
|
1428
|
+
if (value.constructor.name === cls) {
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
else {
|
|
1434
|
+
if (value instanceof cls) {
|
|
1435
|
+
return true;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
return false;
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
|
-
function isNumeric(value) {
|
|
1443
|
-
var str = String(value);
|
|
1444
|
-
return str.length && !!str.match(/^-?\d*\.?\d*$/);
|
|
1442
|
+
function isNumeric(value) {
|
|
1443
|
+
var str = String(value);
|
|
1444
|
+
return str.length && !!str.match(/^-?\d*\.?\d*$/);
|
|
1445
1445
|
}
|
|
1446
1446
|
|
|
1447
|
-
function throttle(func, wait) {
|
|
1448
|
-
var waiting = false; // Initially, we're not waiting
|
|
1449
|
-
return function () {
|
|
1450
|
-
if (!waiting) { // If we're not waiting
|
|
1451
|
-
func.apply(null, arguments); // Execute users function
|
|
1452
|
-
waiting = true; // Prevent future invocations
|
|
1453
|
-
setTimeout(function () {
|
|
1454
|
-
waiting = false; // And allow future invocations
|
|
1455
|
-
}, wait);
|
|
1456
|
-
}
|
|
1457
|
-
};
|
|
1447
|
+
function throttle(func, wait) {
|
|
1448
|
+
var waiting = false; // Initially, we're not waiting
|
|
1449
|
+
return function () {
|
|
1450
|
+
if (!waiting) { // If we're not waiting
|
|
1451
|
+
func.apply(null, arguments); // Execute users function
|
|
1452
|
+
waiting = true; // Prevent future invocations
|
|
1453
|
+
setTimeout(function () {
|
|
1454
|
+
waiting = false; // And allow future invocations
|
|
1455
|
+
}, wait);
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
|
-
var Operation = /** @class */ (function () {
|
|
1461
|
-
function Operation(target, name) {
|
|
1462
|
-
this.ready$ = new rxjs.Subject();
|
|
1463
|
-
this.name = name ? name : guid();
|
|
1464
|
-
if (target instanceof rxjs.Observable) {
|
|
1465
|
-
this.target = target;
|
|
1466
|
-
}
|
|
1467
|
-
else {
|
|
1468
|
-
this.target = rxjs.of(target);
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
return Operation;
|
|
1460
|
+
var Operation = /** @class */ (function () {
|
|
1461
|
+
function Operation(target, name) {
|
|
1462
|
+
this.ready$ = new rxjs.Subject();
|
|
1463
|
+
this.name = name ? name : guid();
|
|
1464
|
+
if (target instanceof rxjs.Observable) {
|
|
1465
|
+
this.target = target;
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
this.target = rxjs.of(target);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
return Operation;
|
|
1472
1472
|
}());
|
|
1473
1473
|
|
|
1474
|
-
exports.QueueState = void 0;
|
|
1475
|
-
(function (QueueState) {
|
|
1476
|
-
QueueState["Idle"] = "idle";
|
|
1477
|
-
QueueState["Processing"] = "processing";
|
|
1474
|
+
exports.QueueState = void 0;
|
|
1475
|
+
(function (QueueState) {
|
|
1476
|
+
QueueState["Idle"] = "idle";
|
|
1477
|
+
QueueState["Processing"] = "processing";
|
|
1478
1478
|
})(exports.QueueState || (exports.QueueState = {}));
|
|
1479
1479
|
|
|
1480
|
-
var Queue = /** @class */ (function () {
|
|
1481
|
-
function Queue(_limit) {
|
|
1482
|
-
if (_limit === void 0) { _limit = Infinity; }
|
|
1483
|
-
this._limit = _limit;
|
|
1484
|
-
this._done = new rxjs.Subject();
|
|
1485
|
-
this._queue = [];
|
|
1486
|
-
this._inProgress = [];
|
|
1487
|
-
this._total = 0;
|
|
1488
|
-
this._completed = 0;
|
|
1489
|
-
this._errors = 0;
|
|
1490
|
-
this._state = exports.QueueState.Idle;
|
|
1491
|
-
this._destroy$ = new rxjs.Subject();
|
|
1492
|
-
}
|
|
1493
|
-
Object.defineProperty(Queue.prototype, "total", {
|
|
1494
|
-
get: function () {
|
|
1495
|
-
return this._total;
|
|
1496
|
-
},
|
|
1497
|
-
enumerable: false,
|
|
1498
|
-
configurable: true
|
|
1499
|
-
});
|
|
1500
|
-
Object.defineProperty(Queue.prototype, "completed", {
|
|
1501
|
-
get: function () {
|
|
1502
|
-
return this._completed;
|
|
1503
|
-
},
|
|
1504
|
-
enumerable: false,
|
|
1505
|
-
configurable: true
|
|
1506
|
-
});
|
|
1507
|
-
Object.defineProperty(Queue.prototype, "pending", {
|
|
1508
|
-
get: function () {
|
|
1509
|
-
return this._queue.length;
|
|
1510
|
-
},
|
|
1511
|
-
enumerable: false,
|
|
1512
|
-
configurable: true
|
|
1513
|
-
});
|
|
1514
|
-
Object.defineProperty(Queue.prototype, "inProgress", {
|
|
1515
|
-
get: function () {
|
|
1516
|
-
return this._inProgress.length;
|
|
1517
|
-
},
|
|
1518
|
-
enumerable: false,
|
|
1519
|
-
configurable: true
|
|
1520
|
-
});
|
|
1521
|
-
Object.defineProperty(Queue.prototype, "errors", {
|
|
1522
|
-
get: function () {
|
|
1523
|
-
return this._errors;
|
|
1524
|
-
},
|
|
1525
|
-
enumerable: false,
|
|
1526
|
-
configurable: true
|
|
1527
|
-
});
|
|
1528
|
-
Object.defineProperty(Queue.prototype, "state", {
|
|
1529
|
-
get: function () {
|
|
1530
|
-
return this._state;
|
|
1531
|
-
},
|
|
1532
|
-
enumerable: false,
|
|
1533
|
-
configurable: true
|
|
1534
|
-
});
|
|
1535
|
-
Object.defineProperty(Queue.prototype, "empty", {
|
|
1536
|
-
get: function () {
|
|
1537
|
-
return !this._queue.length && !this._inProgress.length;
|
|
1538
|
-
},
|
|
1539
|
-
enumerable: false,
|
|
1540
|
-
configurable: true
|
|
1541
|
-
});
|
|
1542
|
-
Object.defineProperty(Queue.prototype, "pendingOperations", {
|
|
1543
|
-
get: function () {
|
|
1544
|
-
return this._queue
|
|
1545
|
-
.map(function (operation) { return operation.name; });
|
|
1546
|
-
},
|
|
1547
|
-
enumerable: false,
|
|
1548
|
-
configurable: true
|
|
1549
|
-
});
|
|
1550
|
-
Object.defineProperty(Queue.prototype, "inProgressOperations", {
|
|
1551
|
-
get: function () {
|
|
1552
|
-
return this._inProgress
|
|
1553
|
-
.map(function (operation) { return operation.name; });
|
|
1554
|
-
},
|
|
1555
|
-
enumerable: false,
|
|
1556
|
-
configurable: true
|
|
1557
|
-
});
|
|
1558
|
-
Queue.prototype.isProcessing = function () {
|
|
1559
|
-
return this._state === exports.QueueState.Processing;
|
|
1560
|
-
};
|
|
1561
|
-
Queue.prototype.isIdle = function () {
|
|
1562
|
-
return this._state === exports.QueueState.Idle;
|
|
1563
|
-
};
|
|
1564
|
-
Queue.prototype.setLimit = function (value) {
|
|
1565
|
-
this._limit = value;
|
|
1566
|
-
};
|
|
1567
|
-
Queue.prototype.subscribe = function (fun, err, complete) {
|
|
1568
|
-
this._done
|
|
1569
|
-
.pipe(operators.takeUntil(this._destroy$))
|
|
1570
|
-
.subscribe(fun, err, complete);
|
|
1571
|
-
};
|
|
1572
|
-
Queue.prototype.complete = function (fun, err, complete) {
|
|
1573
|
-
var _this = this;
|
|
1574
|
-
rxjs.Observable.create(function (observer) {
|
|
1575
|
-
if (!_this.isProcessing()) {
|
|
1576
|
-
observer.next();
|
|
1577
|
-
observer.complete();
|
|
1578
|
-
return;
|
|
1579
|
-
}
|
|
1580
|
-
_this.subscribe(function () {
|
|
1581
|
-
observer.next();
|
|
1582
|
-
observer.complete();
|
|
1583
|
-
}, function (error) {
|
|
1584
|
-
observer.error(error);
|
|
1585
|
-
_this.clear();
|
|
1586
|
-
});
|
|
1587
|
-
}).subscribe(fun, err, complete);
|
|
1588
|
-
};
|
|
1589
|
-
Queue.prototype.push = function (target, name) {
|
|
1590
|
-
var operation = new Operation(target, name);
|
|
1591
|
-
this._total++;
|
|
1592
|
-
this._state = exports.QueueState.Processing;
|
|
1593
|
-
if (this._inProgress.length < this._limit) {
|
|
1594
|
-
this._processOperation(operation);
|
|
1595
|
-
}
|
|
1596
|
-
else {
|
|
1597
|
-
this._queue.push(operation);
|
|
1598
|
-
}
|
|
1599
|
-
return operation.ready$;
|
|
1600
|
-
};
|
|
1601
|
-
Queue.prototype.clear = function () {
|
|
1602
|
-
this._queue = [];
|
|
1603
|
-
this._total = 0;
|
|
1604
|
-
this._errors = 0;
|
|
1605
|
-
this._completed = 0;
|
|
1606
|
-
this._state = exports.QueueState.Idle;
|
|
1607
|
-
this._done = new rxjs.Subject();
|
|
1608
|
-
};
|
|
1609
|
-
Queue.prototype.destroy = function () {
|
|
1610
|
-
this.clear();
|
|
1611
|
-
this._done.complete();
|
|
1612
|
-
};
|
|
1613
|
-
Queue.prototype._processOperation = function (operation) {
|
|
1614
|
-
var _this = this;
|
|
1615
|
-
this._inProgress.push(operation);
|
|
1616
|
-
operation.target
|
|
1617
|
-
.pipe(operators.delay(200), // Hack to prevent extra quick proccess execution
|
|
1618
|
-
operators.takeUntil(this._destroy$)).subscribe({
|
|
1619
|
-
next: function (data) {
|
|
1620
|
-
operation.ready$.next(data);
|
|
1621
|
-
},
|
|
1622
|
-
error: function (error) {
|
|
1623
|
-
var opIndex = _this._inProgress.indexOf(operation);
|
|
1624
|
-
_this._inProgress.splice(opIndex, 1);
|
|
1625
|
-
_this._errors++;
|
|
1626
|
-
operation.ready$.error(error);
|
|
1627
|
-
if (_this.empty) {
|
|
1628
|
-
_this._state = exports.QueueState.Idle;
|
|
1629
|
-
_this._done.error(error);
|
|
1630
|
-
}
|
|
1631
|
-
},
|
|
1632
|
-
complete: function () {
|
|
1633
|
-
var opIndex = _this._inProgress.indexOf(operation);
|
|
1634
|
-
_this._inProgress.splice(opIndex, 1);
|
|
1635
|
-
_this._completed++;
|
|
1636
|
-
operation.ready$.complete();
|
|
1637
|
-
if (_this.empty) {
|
|
1638
|
-
_this._state = exports.QueueState.Idle;
|
|
1639
|
-
_this._done.next();
|
|
1640
|
-
}
|
|
1641
|
-
else {
|
|
1642
|
-
if (_this._queue.length) {
|
|
1643
|
-
var queueItem = _this._queue.shift();
|
|
1644
|
-
_this._processOperation(queueItem);
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
});
|
|
1649
|
-
};
|
|
1650
|
-
return Queue;
|
|
1480
|
+
var Queue = /** @class */ (function () {
|
|
1481
|
+
function Queue(_limit) {
|
|
1482
|
+
if (_limit === void 0) { _limit = Infinity; }
|
|
1483
|
+
this._limit = _limit;
|
|
1484
|
+
this._done = new rxjs.Subject();
|
|
1485
|
+
this._queue = [];
|
|
1486
|
+
this._inProgress = [];
|
|
1487
|
+
this._total = 0;
|
|
1488
|
+
this._completed = 0;
|
|
1489
|
+
this._errors = 0;
|
|
1490
|
+
this._state = exports.QueueState.Idle;
|
|
1491
|
+
this._destroy$ = new rxjs.Subject();
|
|
1492
|
+
}
|
|
1493
|
+
Object.defineProperty(Queue.prototype, "total", {
|
|
1494
|
+
get: function () {
|
|
1495
|
+
return this._total;
|
|
1496
|
+
},
|
|
1497
|
+
enumerable: false,
|
|
1498
|
+
configurable: true
|
|
1499
|
+
});
|
|
1500
|
+
Object.defineProperty(Queue.prototype, "completed", {
|
|
1501
|
+
get: function () {
|
|
1502
|
+
return this._completed;
|
|
1503
|
+
},
|
|
1504
|
+
enumerable: false,
|
|
1505
|
+
configurable: true
|
|
1506
|
+
});
|
|
1507
|
+
Object.defineProperty(Queue.prototype, "pending", {
|
|
1508
|
+
get: function () {
|
|
1509
|
+
return this._queue.length;
|
|
1510
|
+
},
|
|
1511
|
+
enumerable: false,
|
|
1512
|
+
configurable: true
|
|
1513
|
+
});
|
|
1514
|
+
Object.defineProperty(Queue.prototype, "inProgress", {
|
|
1515
|
+
get: function () {
|
|
1516
|
+
return this._inProgress.length;
|
|
1517
|
+
},
|
|
1518
|
+
enumerable: false,
|
|
1519
|
+
configurable: true
|
|
1520
|
+
});
|
|
1521
|
+
Object.defineProperty(Queue.prototype, "errors", {
|
|
1522
|
+
get: function () {
|
|
1523
|
+
return this._errors;
|
|
1524
|
+
},
|
|
1525
|
+
enumerable: false,
|
|
1526
|
+
configurable: true
|
|
1527
|
+
});
|
|
1528
|
+
Object.defineProperty(Queue.prototype, "state", {
|
|
1529
|
+
get: function () {
|
|
1530
|
+
return this._state;
|
|
1531
|
+
},
|
|
1532
|
+
enumerable: false,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
});
|
|
1535
|
+
Object.defineProperty(Queue.prototype, "empty", {
|
|
1536
|
+
get: function () {
|
|
1537
|
+
return !this._queue.length && !this._inProgress.length;
|
|
1538
|
+
},
|
|
1539
|
+
enumerable: false,
|
|
1540
|
+
configurable: true
|
|
1541
|
+
});
|
|
1542
|
+
Object.defineProperty(Queue.prototype, "pendingOperations", {
|
|
1543
|
+
get: function () {
|
|
1544
|
+
return this._queue
|
|
1545
|
+
.map(function (operation) { return operation.name; });
|
|
1546
|
+
},
|
|
1547
|
+
enumerable: false,
|
|
1548
|
+
configurable: true
|
|
1549
|
+
});
|
|
1550
|
+
Object.defineProperty(Queue.prototype, "inProgressOperations", {
|
|
1551
|
+
get: function () {
|
|
1552
|
+
return this._inProgress
|
|
1553
|
+
.map(function (operation) { return operation.name; });
|
|
1554
|
+
},
|
|
1555
|
+
enumerable: false,
|
|
1556
|
+
configurable: true
|
|
1557
|
+
});
|
|
1558
|
+
Queue.prototype.isProcessing = function () {
|
|
1559
|
+
return this._state === exports.QueueState.Processing;
|
|
1560
|
+
};
|
|
1561
|
+
Queue.prototype.isIdle = function () {
|
|
1562
|
+
return this._state === exports.QueueState.Idle;
|
|
1563
|
+
};
|
|
1564
|
+
Queue.prototype.setLimit = function (value) {
|
|
1565
|
+
this._limit = value;
|
|
1566
|
+
};
|
|
1567
|
+
Queue.prototype.subscribe = function (fun, err, complete) {
|
|
1568
|
+
this._done
|
|
1569
|
+
.pipe(operators.takeUntil(this._destroy$))
|
|
1570
|
+
.subscribe(fun, err, complete);
|
|
1571
|
+
};
|
|
1572
|
+
Queue.prototype.complete = function (fun, err, complete) {
|
|
1573
|
+
var _this = this;
|
|
1574
|
+
rxjs.Observable.create(function (observer) {
|
|
1575
|
+
if (!_this.isProcessing()) {
|
|
1576
|
+
observer.next();
|
|
1577
|
+
observer.complete();
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1580
|
+
_this.subscribe(function () {
|
|
1581
|
+
observer.next();
|
|
1582
|
+
observer.complete();
|
|
1583
|
+
}, function (error) {
|
|
1584
|
+
observer.error(error);
|
|
1585
|
+
_this.clear();
|
|
1586
|
+
});
|
|
1587
|
+
}).subscribe(fun, err, complete);
|
|
1588
|
+
};
|
|
1589
|
+
Queue.prototype.push = function (target, name) {
|
|
1590
|
+
var operation = new Operation(target, name);
|
|
1591
|
+
this._total++;
|
|
1592
|
+
this._state = exports.QueueState.Processing;
|
|
1593
|
+
if (this._inProgress.length < this._limit) {
|
|
1594
|
+
this._processOperation(operation);
|
|
1595
|
+
}
|
|
1596
|
+
else {
|
|
1597
|
+
this._queue.push(operation);
|
|
1598
|
+
}
|
|
1599
|
+
return operation.ready$;
|
|
1600
|
+
};
|
|
1601
|
+
Queue.prototype.clear = function () {
|
|
1602
|
+
this._queue = [];
|
|
1603
|
+
this._total = 0;
|
|
1604
|
+
this._errors = 0;
|
|
1605
|
+
this._completed = 0;
|
|
1606
|
+
this._state = exports.QueueState.Idle;
|
|
1607
|
+
this._done = new rxjs.Subject();
|
|
1608
|
+
};
|
|
1609
|
+
Queue.prototype.destroy = function () {
|
|
1610
|
+
this.clear();
|
|
1611
|
+
this._done.complete();
|
|
1612
|
+
};
|
|
1613
|
+
Queue.prototype._processOperation = function (operation) {
|
|
1614
|
+
var _this = this;
|
|
1615
|
+
this._inProgress.push(operation);
|
|
1616
|
+
operation.target
|
|
1617
|
+
.pipe(operators.delay(200), // Hack to prevent extra quick proccess execution
|
|
1618
|
+
operators.takeUntil(this._destroy$)).subscribe({
|
|
1619
|
+
next: function (data) {
|
|
1620
|
+
operation.ready$.next(data);
|
|
1621
|
+
},
|
|
1622
|
+
error: function (error) {
|
|
1623
|
+
var opIndex = _this._inProgress.indexOf(operation);
|
|
1624
|
+
_this._inProgress.splice(opIndex, 1);
|
|
1625
|
+
_this._errors++;
|
|
1626
|
+
operation.ready$.error(error);
|
|
1627
|
+
if (_this.empty) {
|
|
1628
|
+
_this._state = exports.QueueState.Idle;
|
|
1629
|
+
_this._done.error(error);
|
|
1630
|
+
}
|
|
1631
|
+
},
|
|
1632
|
+
complete: function () {
|
|
1633
|
+
var opIndex = _this._inProgress.indexOf(operation);
|
|
1634
|
+
_this._inProgress.splice(opIndex, 1);
|
|
1635
|
+
_this._completed++;
|
|
1636
|
+
operation.ready$.complete();
|
|
1637
|
+
if (_this.empty) {
|
|
1638
|
+
_this._state = exports.QueueState.Idle;
|
|
1639
|
+
_this._done.next();
|
|
1640
|
+
}
|
|
1641
|
+
else {
|
|
1642
|
+
if (_this._queue.length) {
|
|
1643
|
+
var queueItem = _this._queue.shift();
|
|
1644
|
+
_this._processOperation(queueItem);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
};
|
|
1650
|
+
return Queue;
|
|
1651
1651
|
}());
|
|
1652
1652
|
|
|
1653
|
-
function removeQueryParams(path) {
|
|
1654
|
-
return path.split('?')[0];
|
|
1653
|
+
function removeQueryParams(path) {
|
|
1654
|
+
return path.split('?')[0];
|
|
1655
1655
|
}
|
|
1656
1656
|
|
|
1657
|
-
function getNormalizedPath(locationSrv) {
|
|
1658
|
-
var path = locationSrv.prepareExternalUrl(locationSrv.path());
|
|
1659
|
-
return removeQueryParams(path);
|
|
1657
|
+
function getNormalizedPath(locationSrv) {
|
|
1658
|
+
var path = locationSrv.prepareExternalUrl(locationSrv.path());
|
|
1659
|
+
return removeQueryParams(path);
|
|
1660
1660
|
}
|
|
1661
1661
|
|
|
1662
|
-
function round(num, decimalPlaces) {
|
|
1663
|
-
if (decimalPlaces === void 0) { decimalPlaces = 0; }
|
|
1664
|
-
var p = Math.pow(10, decimalPlaces);
|
|
1665
|
-
return Math.round(num * p) / p;
|
|
1662
|
+
function round(num, decimalPlaces) {
|
|
1663
|
+
if (decimalPlaces === void 0) { decimalPlaces = 0; }
|
|
1664
|
+
var p = Math.pow(10, decimalPlaces);
|
|
1665
|
+
return Math.round(num * p) / p;
|
|
1666
1666
|
}
|
|
1667
1667
|
|
|
1668
|
-
function clone(obj) {
|
|
1669
|
-
if (obj instanceof Date) {
|
|
1670
|
-
return new Date(obj);
|
|
1671
|
-
}
|
|
1672
|
-
else if (Array.isArray(obj)) {
|
|
1673
|
-
var arr = [];
|
|
1674
|
-
for (var i = 0; i < obj.length; i++) {
|
|
1675
|
-
arr[i] = clone(obj[i]);
|
|
1676
|
-
}
|
|
1677
|
-
return arr;
|
|
1678
|
-
}
|
|
1679
|
-
else if (typeof (obj) === 'object') {
|
|
1680
|
-
var cloned = {};
|
|
1681
|
-
for (var key in obj) {
|
|
1682
|
-
cloned[key] = clone(obj[key]);
|
|
1683
|
-
}
|
|
1684
|
-
return cloned;
|
|
1685
|
-
}
|
|
1686
|
-
return obj;
|
|
1668
|
+
function clone(obj) {
|
|
1669
|
+
if (obj instanceof Date) {
|
|
1670
|
+
return new Date(obj);
|
|
1671
|
+
}
|
|
1672
|
+
else if (Array.isArray(obj)) {
|
|
1673
|
+
var arr = [];
|
|
1674
|
+
for (var i = 0; i < obj.length; i++) {
|
|
1675
|
+
arr[i] = clone(obj[i]);
|
|
1676
|
+
}
|
|
1677
|
+
return arr;
|
|
1678
|
+
}
|
|
1679
|
+
else if (typeof (obj) === 'object') {
|
|
1680
|
+
var cloned = {};
|
|
1681
|
+
for (var key in obj) {
|
|
1682
|
+
cloned[key] = clone(obj[key]);
|
|
1683
|
+
}
|
|
1684
|
+
return cloned;
|
|
1685
|
+
}
|
|
1686
|
+
return obj;
|
|
1687
1687
|
}
|
|
1688
1688
|
|
|
1689
|
-
function isArrayEqual(arr1, arr2) {
|
|
1690
|
-
if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
|
|
1691
|
-
return false;
|
|
1692
|
-
}
|
|
1693
|
-
var sortFn = function (a, b) {
|
|
1694
|
-
if (a < b) {
|
|
1695
|
-
return -1;
|
|
1696
|
-
}
|
|
1697
|
-
else if (a > b) {
|
|
1698
|
-
return 1;
|
|
1699
|
-
}
|
|
1700
|
-
else {
|
|
1701
|
-
return 0;
|
|
1702
|
-
}
|
|
1703
|
-
};
|
|
1704
|
-
arr1 = __spreadArray([], __read(arr1)).sort(sortFn);
|
|
1705
|
-
arr2 = __spreadArray([], __read(arr2)).sort(sortFn);
|
|
1706
|
-
return arr1.every(function (value, index) {
|
|
1707
|
-
return value === arr2[index];
|
|
1708
|
-
});
|
|
1689
|
+
function isArrayEqual(arr1, arr2) {
|
|
1690
|
+
if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
|
|
1691
|
+
return false;
|
|
1692
|
+
}
|
|
1693
|
+
var sortFn = function (a, b) {
|
|
1694
|
+
if (a < b) {
|
|
1695
|
+
return -1;
|
|
1696
|
+
}
|
|
1697
|
+
else if (a > b) {
|
|
1698
|
+
return 1;
|
|
1699
|
+
}
|
|
1700
|
+
else {
|
|
1701
|
+
return 0;
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
arr1 = __spreadArray([], __read(arr1)).sort(sortFn);
|
|
1705
|
+
arr2 = __spreadArray([], __read(arr2)).sort(sortFn);
|
|
1706
|
+
return arr1.every(function (value, index) {
|
|
1707
|
+
return value === arr2[index];
|
|
1708
|
+
});
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
|
-
function
|
|
1712
|
-
|
|
1713
|
-
var
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1711
|
+
var fsSourceLoader = (function () {
|
|
1712
|
+
var _document;
|
|
1713
|
+
var _headElement;
|
|
1714
|
+
var _sources = new Map();
|
|
1715
|
+
var _loadedResources = new Map();
|
|
1716
|
+
// bad way but don't want to bother developer
|
|
1717
|
+
setDocument(document);
|
|
1718
|
+
// but developer can set document at any time
|
|
1719
|
+
function setDocument(document) {
|
|
1720
|
+
_document = document;
|
|
1721
|
+
_headElement = _document === null || _document === void 0 ? void 0 : _document.head;
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* register a list of the resources for future loading
|
|
1725
|
+
*
|
|
1726
|
+
* example:
|
|
1727
|
+
* sourceLoader.registerResources({
|
|
1728
|
+
* froala: [
|
|
1729
|
+
* '/assets/js/froala/froala_editor.min.js',
|
|
1730
|
+
* '/assets/css/froala_editor.pkgd.min.css',
|
|
1731
|
+
* ],
|
|
1732
|
+
* froala_align: '/assets/js/froala/plugins/align.min.js',
|
|
1733
|
+
* froala_colors: '/assets/js/froala/plugins/colors.min.js',
|
|
1734
|
+
* froala_image: '/assets/js/froala/plugins/image.min.js',
|
|
1735
|
+
* });
|
|
1736
|
+
*
|
|
1737
|
+
*/
|
|
1738
|
+
function registerResources(resources) {
|
|
1739
|
+
Object.entries(resources)
|
|
1740
|
+
.forEach(function (_a) {
|
|
1741
|
+
var _b = __read(_a, 2), name = _b[0], path = _b[1];
|
|
1742
|
+
if (typeof path === 'string') {
|
|
1743
|
+
path = [path];
|
|
1744
|
+
}
|
|
1745
|
+
if (!_sources.has(name)) {
|
|
1746
|
+
_sources.set(name, new Set());
|
|
1747
|
+
}
|
|
1748
|
+
var resourcesList = _sources.get(name);
|
|
1749
|
+
path.forEach(function (p) {
|
|
1750
|
+
resourcesList.add(p);
|
|
1751
|
+
});
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* load any resource previously registered
|
|
1756
|
+
*
|
|
1757
|
+
* sourceLoader.loadResource('froala')
|
|
1758
|
+
*
|
|
1759
|
+
* or load any js/css file
|
|
1760
|
+
*
|
|
1761
|
+
* sourceLoader.loadResource('/assets/my-source.js')
|
|
1762
|
+
*
|
|
1763
|
+
*/
|
|
1764
|
+
function loadResource(name) {
|
|
1765
|
+
if (_loadedResources.has(name)) {
|
|
1766
|
+
return _loadedResources.get(name);
|
|
1767
|
+
}
|
|
1768
|
+
if (_sources.has(name)) {
|
|
1769
|
+
var sourcesForLoading = __spreadArray([], __read(_sources.get(name))).map(function (path) {
|
|
1770
|
+
return _loadResource(path);
|
|
1771
|
+
})
|
|
1772
|
+
.filter(function (v) { return !!v; });
|
|
1773
|
+
return rxjs.combineLatest(sourcesForLoading);
|
|
1774
|
+
}
|
|
1775
|
+
return _loadResource(name);
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* the same as `loadResource` but you can pass list of the resources for loading
|
|
1779
|
+
*/
|
|
1780
|
+
function loadResources(listOfResources) {
|
|
1781
|
+
var resourcesToLoad = listOfResources
|
|
1782
|
+
.reduce(function (acc, name) {
|
|
1783
|
+
var loading$ = loadResource(name);
|
|
1784
|
+
if (loading$) {
|
|
1785
|
+
acc.push(loading$);
|
|
1786
|
+
}
|
|
1787
|
+
return acc;
|
|
1788
|
+
}, []);
|
|
1789
|
+
return rxjs.combineLatest(resourcesToLoad);
|
|
1790
|
+
}
|
|
1791
|
+
///
|
|
1792
|
+
function _loadResource(path) {
|
|
1793
|
+
if (_isStylesUrl(path)) {
|
|
1794
|
+
return _loadStyles(path);
|
|
1795
|
+
}
|
|
1796
|
+
if (_isJavascriptUrl(path)) {
|
|
1797
|
+
return _loadJs(path);
|
|
1798
|
+
}
|
|
1799
|
+
console.warn("Resource " + path + " can not be identified and loaded");
|
|
1800
|
+
return null;
|
|
1801
|
+
}
|
|
1802
|
+
function _loadJs(scriptPath) {
|
|
1803
|
+
if (!_loadedResources.has(scriptPath)) {
|
|
1804
|
+
var obs$ = new rxjs.Observable(function (obs) {
|
|
1805
|
+
var script = document.createElement('script');
|
|
1806
|
+
script.src = scriptPath;
|
|
1807
|
+
_headElement.appendChild(script);
|
|
1808
|
+
script.onload = function () {
|
|
1809
|
+
obs.next();
|
|
1810
|
+
obs.complete();
|
|
1811
|
+
};
|
|
1812
|
+
script.onerror = function (err) {
|
|
1813
|
+
obs.error(err);
|
|
1814
|
+
};
|
|
1815
|
+
}).pipe(operators.shareReplay(1));
|
|
1816
|
+
_loadedResources.set(scriptPath, obs$);
|
|
1817
|
+
}
|
|
1818
|
+
return _loadedResources.get(scriptPath);
|
|
1819
|
+
}
|
|
1820
|
+
function _loadStyles(stylePath) {
|
|
1821
|
+
if (!_loadedResources.has(stylePath)) {
|
|
1822
|
+
var obs$ = new rxjs.Observable(function (obs) {
|
|
1823
|
+
var style = document.createElement('link');
|
|
1824
|
+
style.id = stylePath;
|
|
1825
|
+
style.rel = 'stylesheet';
|
|
1826
|
+
style.href = "" + stylePath;
|
|
1827
|
+
_headElement.appendChild(style);
|
|
1828
|
+
style.onload = function () {
|
|
1829
|
+
obs.next();
|
|
1830
|
+
obs.complete();
|
|
1831
|
+
};
|
|
1832
|
+
style.onerror = function (err) {
|
|
1833
|
+
obs.error(err);
|
|
1834
|
+
};
|
|
1835
|
+
});
|
|
1836
|
+
_loadedResources.set(stylePath, obs$);
|
|
1837
|
+
}
|
|
1838
|
+
return _loadedResources.get(stylePath);
|
|
1839
|
+
}
|
|
1840
|
+
function _isJavascriptUrl(url) {
|
|
1841
|
+
return url.endsWith('.js');
|
|
1842
|
+
}
|
|
1843
|
+
function _isStylesUrl(url) {
|
|
1844
|
+
return url.endsWith('.css');
|
|
1845
|
+
}
|
|
1846
|
+
return {
|
|
1847
|
+
setDocument: setDocument,
|
|
1848
|
+
registerResources: registerResources,
|
|
1849
|
+
loadResource: loadResource,
|
|
1850
|
+
loadResources: loadResources,
|
|
1851
|
+
};
|
|
1852
|
+
})();
|
|
1853
|
+
|
|
1854
|
+
function acronym(str, length) {
|
|
1855
|
+
if (length === void 0) { length = 2; }
|
|
1856
|
+
var splittedString = str
|
|
1857
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ')
|
|
1858
|
+
.split(' ');
|
|
1859
|
+
var result = '';
|
|
1860
|
+
for (var i = 0; i < length; i++) {
|
|
1861
|
+
if (!splittedString[i]) {
|
|
1862
|
+
if (splittedString.length === 1) {
|
|
1863
|
+
for (var j = 1; j < length; j++) {
|
|
1864
|
+
if (!splittedString[i - 1][j]) {
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
result += splittedString[i - 1][j].toUpperCase();
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
break;
|
|
1871
|
+
}
|
|
1872
|
+
result += splittedString[i][0].toUpperCase();
|
|
1873
|
+
}
|
|
1874
|
+
return result;
|
|
1732
1875
|
}
|
|
1733
1876
|
|
|
1734
|
-
function delayedRetry(delayMs, maxRetry, message) {
|
|
1735
|
-
if (maxRetry === void 0) { maxRetry = 5; }
|
|
1736
|
-
var retries = 0;
|
|
1737
|
-
return function (src) { return src.pipe(operators.retryWhen(function (errors) { return errors.pipe(operators.tap(function () {
|
|
1738
|
-
retries++;
|
|
1739
|
-
if (retries <= maxRetry) {
|
|
1740
|
-
console.info("Failed to load Resource. Retry in " + delayMs / 1000 + " sec. " + retries + "/" + maxRetry + " times...");
|
|
1741
|
-
}
|
|
1742
|
-
}), operators.concatMap(function (error) { return rxjs.iif(function () { return retries > maxRetry; }, rxjs.throwError(getErrorMessage(maxRetry, message)), rxjs.timer(delayMs)); })); })); };
|
|
1743
|
-
}
|
|
1744
|
-
var getErrorMessage = function (maxRetry, defaultMessage) {
|
|
1745
|
-
if (!defaultMessage) {
|
|
1746
|
-
return "Failed to load Resource for " + maxRetry + " times. Giving up.";
|
|
1747
|
-
}
|
|
1748
|
-
else {
|
|
1749
|
-
return defaultMessage;
|
|
1750
|
-
}
|
|
1877
|
+
function delayedRetry(delayMs, maxRetry, message) {
|
|
1878
|
+
if (maxRetry === void 0) { maxRetry = 5; }
|
|
1879
|
+
var retries = 0;
|
|
1880
|
+
return function (src) { return src.pipe(operators.retryWhen(function (errors) { return errors.pipe(operators.tap(function () {
|
|
1881
|
+
retries++;
|
|
1882
|
+
if (retries <= maxRetry) {
|
|
1883
|
+
console.info("Failed to load Resource. Retry in " + delayMs / 1000 + " sec. " + retries + "/" + maxRetry + " times...");
|
|
1884
|
+
}
|
|
1885
|
+
}), operators.concatMap(function (error) { return rxjs.iif(function () { return retries > maxRetry; }, rxjs.throwError(getErrorMessage(maxRetry, message)), rxjs.timer(delayMs)); })); })); };
|
|
1886
|
+
}
|
|
1887
|
+
var getErrorMessage = function (maxRetry, defaultMessage) {
|
|
1888
|
+
if (!defaultMessage) {
|
|
1889
|
+
return "Failed to load Resource for " + maxRetry + " times. Giving up.";
|
|
1890
|
+
}
|
|
1891
|
+
else {
|
|
1892
|
+
return defaultMessage;
|
|
1893
|
+
}
|
|
1751
1894
|
};
|
|
1752
1895
|
|
|
1753
|
-
function bytes(bytes, decimals, unit) {
|
|
1754
|
-
if (!bytes) {
|
|
1755
|
-
return '0 MB';
|
|
1756
|
-
}
|
|
1757
|
-
var e = typeof unit === 'string' ?
|
|
1758
|
-
'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
|
|
1759
|
-
Math.floor(Math.log(bytes) / Math.log(1024));
|
|
1760
|
-
if (!isNumeric(decimals)) {
|
|
1761
|
-
decimals = (bytes / 1024) > 1000 ? 2 : 0;
|
|
1762
|
-
}
|
|
1763
|
-
return ("" + (bytes / Math.pow(1024, e))
|
|
1764
|
-
.toFixed(decimals))
|
|
1765
|
-
.replace(/\.00/, '')
|
|
1766
|
-
+ ' '
|
|
1767
|
-
+ (e ? ' KMGTP'.charAt(e) : '') + 'B';
|
|
1896
|
+
function bytes(bytes, decimals, unit) {
|
|
1897
|
+
if (!bytes) {
|
|
1898
|
+
return '0 MB';
|
|
1899
|
+
}
|
|
1900
|
+
var e = typeof unit === 'string' ?
|
|
1901
|
+
'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
|
|
1902
|
+
Math.floor(Math.log(bytes) / Math.log(1024));
|
|
1903
|
+
if (!isNumeric(decimals)) {
|
|
1904
|
+
decimals = (bytes / 1024) > 1000 ? 2 : 0;
|
|
1905
|
+
}
|
|
1906
|
+
return ("" + (bytes / Math.pow(1024, e))
|
|
1907
|
+
.toFixed(decimals))
|
|
1908
|
+
.replace(/\.00/, '')
|
|
1909
|
+
+ ' '
|
|
1910
|
+
+ (e ? ' KMGTP'.charAt(e) : '') + 'B';
|
|
1768
1911
|
}
|
|
1769
1912
|
|
|
1770
|
-
var FsFormatBytesPipe = /** @class */ (function () {
|
|
1771
|
-
function FsFormatBytesPipe() {
|
|
1772
|
-
}
|
|
1773
|
-
FsFormatBytesPipe.prototype.transform = function (value, decimals, unit) {
|
|
1774
|
-
return bytes(value, decimals, unit);
|
|
1775
|
-
};
|
|
1776
|
-
return FsFormatBytesPipe;
|
|
1777
|
-
}());
|
|
1778
|
-
FsFormatBytesPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1779
|
-
FsFormatBytesPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, name: "fsFormatBytes" });
|
|
1780
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, decorators: [{
|
|
1781
|
-
type: i0.Pipe,
|
|
1782
|
-
args: [{
|
|
1783
|
-
name: 'fsFormatBytes',
|
|
1784
|
-
}]
|
|
1913
|
+
var FsFormatBytesPipe = /** @class */ (function () {
|
|
1914
|
+
function FsFormatBytesPipe() {
|
|
1915
|
+
}
|
|
1916
|
+
FsFormatBytesPipe.prototype.transform = function (value, decimals, unit) {
|
|
1917
|
+
return bytes(value, decimals, unit);
|
|
1918
|
+
};
|
|
1919
|
+
return FsFormatBytesPipe;
|
|
1920
|
+
}());
|
|
1921
|
+
FsFormatBytesPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1922
|
+
FsFormatBytesPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, name: "fsFormatBytes" });
|
|
1923
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormatBytesPipe, decorators: [{
|
|
1924
|
+
type: i0.Pipe,
|
|
1925
|
+
args: [{
|
|
1926
|
+
name: 'fsFormatBytes',
|
|
1927
|
+
}]
|
|
1785
1928
|
}] });
|
|
1786
1929
|
|
|
1787
|
-
var FsCommonModule = /** @class */ (function () {
|
|
1788
|
-
function FsCommonModule() {
|
|
1789
|
-
}
|
|
1790
|
-
FsCommonModule.forRoot = function () {
|
|
1791
|
-
return {
|
|
1792
|
-
ngModule: FsCommonModule,
|
|
1793
|
-
providers: [
|
|
1794
|
-
FsArray,
|
|
1795
|
-
FsMath,
|
|
1796
|
-
FsUtil,
|
|
1797
|
-
FsValidate
|
|
1798
|
-
]
|
|
1799
|
-
};
|
|
1800
|
-
};
|
|
1801
|
-
return FsCommonModule;
|
|
1802
|
-
}());
|
|
1803
|
-
FsCommonModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1804
|
-
FsCommonModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, declarations: [FsStopPropagationDirective,
|
|
1805
|
-
FsPreventDefaultDirective,
|
|
1806
|
-
FsAutofocusDirective,
|
|
1807
|
-
FsUtilGuidPipe,
|
|
1808
|
-
FsUtilIsEmptyPipe,
|
|
1809
|
-
FsUtilIsNotEmptyPipe,
|
|
1810
|
-
FsUtilStringifyPipe,
|
|
1811
|
-
FsFormatNumberPipe,
|
|
1812
|
-
FsFormatCurrencyPipe,
|
|
1813
|
-
FsFormatTruncatePipe,
|
|
1814
|
-
FsFormatBytesPipe,
|
|
1815
|
-
FsFormatOrdinalNumberPipe], imports: [common.CommonModule], exports: [FsStopPropagationDirective,
|
|
1816
|
-
FsPreventDefaultDirective,
|
|
1817
|
-
FsAutofocusDirective,
|
|
1818
|
-
FsUtilGuidPipe,
|
|
1819
|
-
FsUtilStringifyPipe,
|
|
1820
|
-
FsFormatNumberPipe,
|
|
1821
|
-
FsFormatCurrencyPipe,
|
|
1822
|
-
FsFormatTruncatePipe,
|
|
1823
|
-
FsUtilIsEmptyPipe,
|
|
1824
|
-
FsUtilIsNotEmptyPipe,
|
|
1825
|
-
FsFormatBytesPipe,
|
|
1826
|
-
FsFormatOrdinalNumberPipe] });
|
|
1827
|
-
FsCommonModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, imports: [[
|
|
1828
|
-
common.CommonModule,
|
|
1829
|
-
]] });
|
|
1830
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, decorators: [{
|
|
1831
|
-
type: i0.NgModule,
|
|
1832
|
-
args: [{
|
|
1833
|
-
imports: [
|
|
1834
|
-
common.CommonModule,
|
|
1835
|
-
],
|
|
1836
|
-
exports: [
|
|
1837
|
-
FsStopPropagationDirective,
|
|
1838
|
-
FsPreventDefaultDirective,
|
|
1839
|
-
FsAutofocusDirective,
|
|
1840
|
-
FsUtilGuidPipe,
|
|
1841
|
-
FsUtilStringifyPipe,
|
|
1842
|
-
FsFormatNumberPipe,
|
|
1843
|
-
FsFormatCurrencyPipe,
|
|
1844
|
-
FsFormatTruncatePipe,
|
|
1845
|
-
FsUtilIsEmptyPipe,
|
|
1846
|
-
FsUtilIsNotEmptyPipe,
|
|
1847
|
-
FsFormatBytesPipe,
|
|
1848
|
-
FsFormatOrdinalNumberPipe,
|
|
1849
|
-
],
|
|
1850
|
-
declarations: [
|
|
1851
|
-
FsStopPropagationDirective,
|
|
1852
|
-
FsPreventDefaultDirective,
|
|
1853
|
-
FsAutofocusDirective,
|
|
1854
|
-
FsUtilGuidPipe,
|
|
1855
|
-
FsUtilIsEmptyPipe,
|
|
1856
|
-
FsUtilIsNotEmptyPipe,
|
|
1857
|
-
FsUtilStringifyPipe,
|
|
1858
|
-
FsFormatNumberPipe,
|
|
1859
|
-
FsFormatCurrencyPipe,
|
|
1860
|
-
FsFormatTruncatePipe,
|
|
1861
|
-
FsFormatBytesPipe,
|
|
1862
|
-
FsFormatOrdinalNumberPipe,
|
|
1863
|
-
],
|
|
1864
|
-
}]
|
|
1930
|
+
var FsCommonModule = /** @class */ (function () {
|
|
1931
|
+
function FsCommonModule() {
|
|
1932
|
+
}
|
|
1933
|
+
FsCommonModule.forRoot = function () {
|
|
1934
|
+
return {
|
|
1935
|
+
ngModule: FsCommonModule,
|
|
1936
|
+
providers: [
|
|
1937
|
+
FsArray,
|
|
1938
|
+
FsMath,
|
|
1939
|
+
FsUtil,
|
|
1940
|
+
FsValidate
|
|
1941
|
+
]
|
|
1942
|
+
};
|
|
1943
|
+
};
|
|
1944
|
+
return FsCommonModule;
|
|
1945
|
+
}());
|
|
1946
|
+
FsCommonModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1947
|
+
FsCommonModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, declarations: [FsStopPropagationDirective,
|
|
1948
|
+
FsPreventDefaultDirective,
|
|
1949
|
+
FsAutofocusDirective,
|
|
1950
|
+
FsUtilGuidPipe,
|
|
1951
|
+
FsUtilIsEmptyPipe,
|
|
1952
|
+
FsUtilIsNotEmptyPipe,
|
|
1953
|
+
FsUtilStringifyPipe,
|
|
1954
|
+
FsFormatNumberPipe,
|
|
1955
|
+
FsFormatCurrencyPipe,
|
|
1956
|
+
FsFormatTruncatePipe,
|
|
1957
|
+
FsFormatBytesPipe,
|
|
1958
|
+
FsFormatOrdinalNumberPipe], imports: [common.CommonModule], exports: [FsStopPropagationDirective,
|
|
1959
|
+
FsPreventDefaultDirective,
|
|
1960
|
+
FsAutofocusDirective,
|
|
1961
|
+
FsUtilGuidPipe,
|
|
1962
|
+
FsUtilStringifyPipe,
|
|
1963
|
+
FsFormatNumberPipe,
|
|
1964
|
+
FsFormatCurrencyPipe,
|
|
1965
|
+
FsFormatTruncatePipe,
|
|
1966
|
+
FsUtilIsEmptyPipe,
|
|
1967
|
+
FsUtilIsNotEmptyPipe,
|
|
1968
|
+
FsFormatBytesPipe,
|
|
1969
|
+
FsFormatOrdinalNumberPipe] });
|
|
1970
|
+
FsCommonModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, imports: [[
|
|
1971
|
+
common.CommonModule,
|
|
1972
|
+
]] });
|
|
1973
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsCommonModule, decorators: [{
|
|
1974
|
+
type: i0.NgModule,
|
|
1975
|
+
args: [{
|
|
1976
|
+
imports: [
|
|
1977
|
+
common.CommonModule,
|
|
1978
|
+
],
|
|
1979
|
+
exports: [
|
|
1980
|
+
FsStopPropagationDirective,
|
|
1981
|
+
FsPreventDefaultDirective,
|
|
1982
|
+
FsAutofocusDirective,
|
|
1983
|
+
FsUtilGuidPipe,
|
|
1984
|
+
FsUtilStringifyPipe,
|
|
1985
|
+
FsFormatNumberPipe,
|
|
1986
|
+
FsFormatCurrencyPipe,
|
|
1987
|
+
FsFormatTruncatePipe,
|
|
1988
|
+
FsUtilIsEmptyPipe,
|
|
1989
|
+
FsUtilIsNotEmptyPipe,
|
|
1990
|
+
FsFormatBytesPipe,
|
|
1991
|
+
FsFormatOrdinalNumberPipe,
|
|
1992
|
+
],
|
|
1993
|
+
declarations: [
|
|
1994
|
+
FsStopPropagationDirective,
|
|
1995
|
+
FsPreventDefaultDirective,
|
|
1996
|
+
FsAutofocusDirective,
|
|
1997
|
+
FsUtilGuidPipe,
|
|
1998
|
+
FsUtilIsEmptyPipe,
|
|
1999
|
+
FsUtilIsNotEmptyPipe,
|
|
2000
|
+
FsUtilStringifyPipe,
|
|
2001
|
+
FsFormatNumberPipe,
|
|
2002
|
+
FsFormatCurrencyPipe,
|
|
2003
|
+
FsFormatTruncatePipe,
|
|
2004
|
+
FsFormatBytesPipe,
|
|
2005
|
+
FsFormatOrdinalNumberPipe,
|
|
2006
|
+
],
|
|
2007
|
+
}]
|
|
1865
2008
|
}] });
|
|
1866
2009
|
|
|
1867
|
-
var keyboardShortcut = function (shortcut) {
|
|
1868
|
-
// Observables for all keydown and keyup events
|
|
1869
|
-
var keyDown$ = rxjs.fromEvent(document, 'keydown');
|
|
1870
|
-
var keyUp$ = rxjs.fromEvent(document, 'keyup');
|
|
1871
|
-
// All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
|
|
1872
|
-
var keyEvents$ = rxjs.merge(keyDown$, keyUp$).pipe(operators.distinctUntilChanged(function (a, b) { return a.code === b.code && a.type === b.type; }), operators.share());
|
|
1873
|
-
// Create KeyboardEvent Observable for specified KeyCode
|
|
1874
|
-
var createKeyPressStream = function (charCode) { return keyEvents$.pipe(operators.filter(function (event) { return event.keyCode === charCode; })); };
|
|
1875
|
-
// Create Event Stream for every KeyCode in shortcut
|
|
1876
|
-
var keyCodeEvents$ = shortcut.map(function (s) { return createKeyPressStream(s); });
|
|
1877
|
-
// Emit when specified keys are pressed (keydown).
|
|
1878
|
-
// Emit only when all specified keys are pressed at the same time.
|
|
1879
|
-
// More on combineLatest below
|
|
1880
|
-
return rxjs.combineLatest(keyCodeEvents$).pipe(operators.filter(function (arr) { return arr.every(function (a) { return a.type === 'keydown'; }); }));
|
|
2010
|
+
var keyboardShortcut = function (shortcut) {
|
|
2011
|
+
// Observables for all keydown and keyup events
|
|
2012
|
+
var keyDown$ = rxjs.fromEvent(document, 'keydown');
|
|
2013
|
+
var keyUp$ = rxjs.fromEvent(document, 'keyup');
|
|
2014
|
+
// All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
|
|
2015
|
+
var keyEvents$ = rxjs.merge(keyDown$, keyUp$).pipe(operators.distinctUntilChanged(function (a, b) { return a.code === b.code && a.type === b.type; }), operators.share());
|
|
2016
|
+
// Create KeyboardEvent Observable for specified KeyCode
|
|
2017
|
+
var createKeyPressStream = function (charCode) { return keyEvents$.pipe(operators.filter(function (event) { return event.keyCode === charCode; })); };
|
|
2018
|
+
// Create Event Stream for every KeyCode in shortcut
|
|
2019
|
+
var keyCodeEvents$ = shortcut.map(function (s) { return createKeyPressStream(s); });
|
|
2020
|
+
// Emit when specified keys are pressed (keydown).
|
|
2021
|
+
// Emit only when all specified keys are pressed at the same time.
|
|
2022
|
+
// More on combineLatest below
|
|
2023
|
+
return rxjs.combineLatest(keyCodeEvents$).pipe(operators.filter(function (arr) { return arr.every(function (a) { return a.type === 'keydown'; }); }));
|
|
1881
2024
|
};
|
|
1882
2025
|
|
|
1883
|
-
/*
|
|
1884
|
-
* Public API Surface of fs-menu
|
|
2026
|
+
/*
|
|
2027
|
+
* Public API Surface of fs-menu
|
|
1885
2028
|
*/
|
|
1886
2029
|
|
|
1887
|
-
/**
|
|
1888
|
-
* Generated bundle index. Do not edit.
|
|
2030
|
+
/**
|
|
2031
|
+
* Generated bundle index. Do not edit.
|
|
1889
2032
|
*/
|
|
1890
2033
|
|
|
1891
2034
|
exports.FsArray = FsArray;
|
|
@@ -1954,6 +2097,7 @@
|
|
|
1954
2097
|
exports.email = email;
|
|
1955
2098
|
exports.filter = filter;
|
|
1956
2099
|
exports.find = find;
|
|
2100
|
+
exports.fsSourceLoader = fsSourceLoader;
|
|
1957
2101
|
exports.getNormalizedPath = getNormalizedPath;
|
|
1958
2102
|
exports.guid = guid;
|
|
1959
2103
|
exports.inArray = inArray;
|