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