@firestitch/common 8.0.8 → 8.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/app/fs-common.module.d.ts +1 -1
  2. package/app/pipes/ordinal-number.pipe.d.ts +4 -0
  3. package/bundles/firestitch-common.umd.js +244 -2
  4. package/bundles/firestitch-common.umd.js.map +1 -1
  5. package/bundles/firestitch-common.umd.min.js +15 -1
  6. package/bundles/firestitch-common.umd.min.js.map +1 -1
  7. package/esm2015/app/fs-common.module.js +4 -1
  8. package/esm2015/app/pipes/ordinal-number.pipe.js +22 -0
  9. package/esm2015/firestitch-common.js +3 -2
  10. package/esm2015/libs/format/bytes/bytes.js +5 -2
  11. package/esm2015/libs/index.js +2 -2
  12. package/esm2015/libs/util/index.js +2 -1
  13. package/esm2015/libs/util/ordinal-number/ordinal-number.js +20 -0
  14. package/esm2015/libs/validate/url/url.js +2 -2
  15. package/esm2015/public_api.js +2 -2
  16. package/esm5/app/fs-common.module.js +4 -1
  17. package/esm5/app/pipes/ordinal-number.pipe.js +30 -0
  18. package/esm5/firestitch-common.js +3 -2
  19. package/esm5/libs/format/bytes/bytes.js +5 -2
  20. package/esm5/libs/index.js +2 -2
  21. package/esm5/libs/util/index.js +2 -1
  22. package/esm5/libs/util/ordinal-number/ordinal-number.js +22 -0
  23. package/esm5/libs/validate/url/url.js +2 -2
  24. package/esm5/public_api.js +2 -2
  25. package/fesm2015/firestitch-common.js +48 -3
  26. package/fesm2015/firestitch-common.js.map +1 -1
  27. package/fesm5/firestitch-common.js +57 -3
  28. package/fesm5/firestitch-common.js.map +1 -1
  29. package/firestitch-common.d.ts +1 -0
  30. package/firestitch-common.metadata.json +1 -1
  31. package/libs/util/index.d.ts +1 -0
  32. package/libs/util/ordinal-number/ordinal-number.d.ts +1 -0
  33. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  export declare class FsCommonModule {
3
- static forRoot(): ModuleWithProviders;
3
+ static forRoot(): ModuleWithProviders<FsCommonModule>;
4
4
  }
@@ -0,0 +1,4 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ export declare class FsFormatOrdinalNumberPipe implements PipeTransform {
3
+ transform(value: any): string;
4
+ }
@@ -4,6 +4,193 @@
4
4
  (global = global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch.common = {}), global.ng.core, global.ng.common, global.lodashEs, global.rxjs, global.rxjs.operators));
5
5
  }(this, (function (exports, core, common, lodashEs, rxjs, operators) { 'use strict';
6
6
 
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation. All rights reserved.
9
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
+ this file except in compliance with the License. You may obtain a copy of the
11
+ License at http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
+ MERCHANTABLITY OR NON-INFRINGEMENT.
17
+
18
+ See the Apache Version 2.0 License for specific language governing permissions
19
+ and limitations under the License.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+
36
+ var __assign = function() {
37
+ __assign = Object.assign || function __assign(t) {
38
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
39
+ s = arguments[i];
40
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
+ }
42
+ return t;
43
+ };
44
+ return __assign.apply(this, arguments);
45
+ };
46
+
47
+ function __rest(s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
53
+ t[p[i]] = s[p[i]];
54
+ return t;
55
+ }
56
+
57
+ function __decorate(decorators, target, key, desc) {
58
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
59
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
60
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
61
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
62
+ }
63
+
64
+ function __param(paramIndex, decorator) {
65
+ return function (target, key) { decorator(target, key, paramIndex); }
66
+ }
67
+
68
+ function __metadata(metadataKey, metadataValue) {
69
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
70
+ }
71
+
72
+ function __awaiter(thisArg, _arguments, P, generator) {
73
+ return new (P || (P = Promise))(function (resolve, reject) {
74
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
75
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
76
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
77
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
78
+ });
79
+ }
80
+
81
+ function __generator(thisArg, body) {
82
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
83
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
84
+ function verb(n) { return function (v) { return step([n, v]); }; }
85
+ function step(op) {
86
+ if (f) throw new TypeError("Generator is already executing.");
87
+ while (_) try {
88
+ 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) return t;
89
+ if (y = 0, t) op = [op[0] & 2, t.value];
90
+ switch (op[0]) {
91
+ case 0: case 1: t = op; break;
92
+ case 4: _.label++; return { value: op[1], done: false };
93
+ case 5: _.label++; y = op[1]; op = [0]; continue;
94
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
95
+ default:
96
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
97
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
98
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
99
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
100
+ if (t[2]) _.ops.pop();
101
+ _.trys.pop(); continue;
102
+ }
103
+ op = body.call(thisArg, _);
104
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
105
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
106
+ }
107
+ }
108
+
109
+ function __exportStar(m, exports) {
110
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
111
+ }
112
+
113
+ function __values(o) {
114
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
115
+ if (m) return m.call(o);
116
+ return {
117
+ next: function () {
118
+ if (o && i >= o.length) o = void 0;
119
+ return { value: o && o[i++], done: !o };
120
+ }
121
+ };
122
+ }
123
+
124
+ function __read(o, n) {
125
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
126
+ if (!m) return o;
127
+ var i = m.call(o), r, ar = [], e;
128
+ try {
129
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
130
+ }
131
+ catch (error) { e = { error: error }; }
132
+ finally {
133
+ try {
134
+ if (r && !r.done && (m = i["return"])) m.call(i);
135
+ }
136
+ finally { if (e) throw e.error; }
137
+ }
138
+ return ar;
139
+ }
140
+
141
+ function __spread() {
142
+ for (var ar = [], i = 0; i < arguments.length; i++)
143
+ ar = ar.concat(__read(arguments[i]));
144
+ return ar;
145
+ }
146
+
147
+ function __await(v) {
148
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
149
+ }
150
+
151
+ function __asyncGenerator(thisArg, _arguments, generator) {
152
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
153
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
154
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
155
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
156
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
157
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
158
+ function fulfill(value) { resume("next", value); }
159
+ function reject(value) { resume("throw", value); }
160
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
161
+ }
162
+
163
+ function __asyncDelegator(o) {
164
+ var i, p;
165
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
166
+ 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; }
167
+ }
168
+
169
+ function __asyncValues(o) {
170
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
171
+ var m = o[Symbol.asyncIterator], i;
172
+ 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);
173
+ 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); }); }; }
174
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
175
+ }
176
+
177
+ function __makeTemplateObject(cooked, raw) {
178
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
179
+ return cooked;
180
+ };
181
+
182
+ function __importStar(mod) {
183
+ if (mod && mod.__esModule) return mod;
184
+ var result = {};
185
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
186
+ result.default = mod;
187
+ return result;
188
+ }
189
+
190
+ function __importDefault(mod) {
191
+ return (mod && mod.__esModule) ? mod : { default: mod };
192
+ }
193
+
7
194
  /**
8
195
  * @fileoverview added by tsickle
9
196
  * Generated from: app/services/array.service.ts
@@ -1547,7 +1734,10 @@
1547
1734
  var e = Math.floor(Math.log(bytes) / Math.log(1024));
1548
1735
  /** @type {?} */
1549
1736
  var decimals = (bytes / 1024) > 1000 ? 2 : 0;
1550
- return (bytes / Math.pow(1024, e)).toFixed(decimals) + ' ' + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1737
+ console.log(bytes, (bytes / 1024), decimals);
1738
+ return ("" + (bytes / Math.pow(1024, e)).toFixed(decimals)).replace(/\.00/, '')
1739
+ + ' '
1740
+ + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1551
1741
  }
1552
1742
 
1553
1743
  /**
@@ -1680,6 +1870,54 @@
1680
1870
  FsAutofocusDirective.prototype._el;
1681
1871
  }
1682
1872
 
1873
+ /**
1874
+ * @fileoverview added by tsickle
1875
+ * Generated from: libs/util/ordinal-number/ordinal-number.ts
1876
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1877
+ */
1878
+ /**
1879
+ * @param {?} value
1880
+ * @return {?}
1881
+ */
1882
+ function ordinalNumber(value) {
1883
+ value = String(value);
1884
+ /** @type {?} */
1885
+ var index = value.match(templateObject_1 || (templateObject_1 = __makeTemplateObject(["1?.$"], ["1?.$"])));
1886
+ /** @type {?} */
1887
+ var endings = [, 'st', 'nd', 'rd'];
1888
+ /** @type {?} */
1889
+ var ending = endings[index] || 'th';
1890
+ return value + ending;
1891
+ }
1892
+ var templateObject_1;
1893
+
1894
+ /**
1895
+ * @fileoverview added by tsickle
1896
+ * Generated from: app/pipes/ordinal-number.pipe.ts
1897
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1898
+ */
1899
+ var FsFormatOrdinalNumberPipe = /** @class */ (function () {
1900
+ function FsFormatOrdinalNumberPipe() {
1901
+ }
1902
+ /**
1903
+ * @param {?} value
1904
+ * @return {?}
1905
+ */
1906
+ FsFormatOrdinalNumberPipe.prototype.transform = /**
1907
+ * @param {?} value
1908
+ * @return {?}
1909
+ */
1910
+ function (value) {
1911
+ return ordinalNumber(value);
1912
+ };
1913
+ FsFormatOrdinalNumberPipe.decorators = [
1914
+ { type: core.Pipe, args: [{
1915
+ name: 'fsFormatOrdinalNumber',
1916
+ },] }
1917
+ ];
1918
+ return FsFormatOrdinalNumberPipe;
1919
+ }());
1920
+
1683
1921
  /**
1684
1922
  * @fileoverview added by tsickle
1685
1923
  * Generated from: app/fs-common.module.ts
@@ -1722,6 +1960,7 @@
1722
1960
  FsUtilIsEmptyPipe,
1723
1961
  FsUtilIsNotEmptyPipe,
1724
1962
  FsFormatBytesPipe,
1963
+ FsFormatOrdinalNumberPipe,
1725
1964
  ],
1726
1965
  declarations: [
1727
1966
  FsStopPropagationDirective,
@@ -1735,6 +1974,7 @@
1735
1974
  FsFormatCurrencyPipe,
1736
1975
  FsFormatTruncatePipe,
1737
1976
  FsFormatBytesPipe,
1977
+ FsFormatOrdinalNumberPipe,
1738
1978
  ],
1739
1979
  },] }
1740
1980
  ];
@@ -1798,7 +2038,7 @@
1798
2038
  */
1799
2039
  function url(value) {
1800
2040
  /** @type {?} */
1801
- var expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/gm;
2041
+ var expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
1802
2042
  /** @type {?} */
1803
2043
  var regexp = new RegExp(expression);
1804
2044
  return !!String(value).match(regexp);
@@ -3276,6 +3516,7 @@
3276
3516
  exports.list = list;
3277
3517
  exports.nameValue = nameValue;
3278
3518
  exports.number = number;
3519
+ exports.ordinalNumber = ordinalNumber;
3279
3520
  exports.phone = phone;
3280
3521
  exports.remove = remove;
3281
3522
  exports.removeQueryParams = removeQueryParams;
@@ -3299,6 +3540,7 @@
3299
3540
  exports.ɵi = FsFormatCurrencyPipe;
3300
3541
  exports.ɵj = FsFormatTruncatePipe;
3301
3542
  exports.ɵk = FsFormatBytesPipe;
3543
+ exports.ɵl = FsFormatOrdinalNumberPipe;
3302
3544
 
3303
3545
  Object.defineProperty(exports, '__esModule', { value: true });
3304
3546