@stemy/ngx-utils 12.2.10 → 12.2.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.
- package/bundles/stemy-ngx-utils.umd.js +34 -20
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +1 -1
- package/esm2015/ngx-utils/services/formatter.service.js +4 -3
- package/esm2015/ngx-utils/services/language.service.js +16 -4
- package/esm2015/public_api.js +1 -1
- package/esm2020/ngx-utils/common-types.mjs +3 -1
- package/esm2020/ngx-utils/components/dynamic-table/dynamic-table.component.mjs +3 -3
- package/esm2020/ngx-utils/components/pagination-menu/pagination-menu.component.mjs +3 -3
- package/esm2020/ngx-utils/components/unordered-list/unordered-list.component.mjs +3 -3
- package/esm2020/ngx-utils/directives/async-method.base.mjs +3 -3
- package/esm2020/ngx-utils/directives/async-method.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/background.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/dynamic-table-template.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/global-template.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/icon.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/ngx-template-outlet.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/pagination-item.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/pagination.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/resource-if.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/sticky-class.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/sticky.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/unordered-list-item.directive.mjs +3 -3
- package/esm2020/ngx-utils/directives/unordered-list-template.directive.mjs +3 -3
- package/esm2020/ngx-utils/ngx-utils.imports.mjs +5 -1
- package/esm2020/ngx-utils/ngx-utils.module.mjs +15 -6
- package/esm2020/ngx-utils/pipes/chunk.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/entries.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/extra-item-properties.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/filter.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/find.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/format-number.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/get-offset.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/get-type.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/global-template.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/group-by.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/is-type.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/join.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/keys.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/map.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/max.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/min.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/pop.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/reduce.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/remap.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/replace.pipe.mjs +6 -5
- package/esm2020/ngx-utils/pipes/reverse.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/round.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/safe-html.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/shift.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/split.pipe.mjs +3 -3
- package/esm2020/ngx-utils/pipes/translate.pipe.mjs +4 -4
- package/esm2020/ngx-utils/pipes/values.pipe.mjs +3 -3
- package/esm2020/ngx-utils/plugins/resize-event.plugin.mjs +24 -9
- package/esm2020/ngx-utils/plugins/scroll-event.plugin.mjs +3 -3
- package/esm2020/ngx-utils/services/acl.service.mjs +3 -3
- package/esm2020/ngx-utils/services/api.service.mjs +3 -3
- package/esm2020/ngx-utils/services/base-http.client.mjs +3 -3
- package/esm2020/ngx-utils/services/base-http.service.mjs +12 -8
- package/esm2020/ngx-utils/services/config.service.mjs +3 -3
- package/esm2020/ngx-utils/services/error-handler.service.mjs +3 -3
- package/esm2020/ngx-utils/services/events.service.mjs +3 -3
- package/esm2020/ngx-utils/services/formatter.service.mjs +7 -6
- package/esm2020/ngx-utils/services/global-template.service.mjs +3 -3
- package/esm2020/ngx-utils/services/icon.service.mjs +3 -3
- package/esm2020/ngx-utils/services/language.service.mjs +3 -3
- package/esm2020/ngx-utils/services/local-http.service.mjs +47 -0
- package/esm2020/ngx-utils/services/open-api.service.mjs +3 -3
- package/esm2020/ngx-utils/services/promise.service.mjs +3 -3
- package/esm2020/ngx-utils/services/state.service.mjs +5 -5
- package/esm2020/ngx-utils/services/static-language.service.mjs +3 -3
- package/esm2020/ngx-utils/services/storage.service.mjs +3 -3
- package/esm2020/ngx-utils/services/toaster.service.mjs +3 -3
- package/esm2020/ngx-utils/services/translated-url.serializer.mjs +3 -3
- package/esm2020/ngx-utils/services/universal.service.mjs +5 -5
- package/esm2020/ngx-utils/services/wasm.service.mjs +46 -0
- package/esm2020/ngx-utils/utils/auth.guard.mjs +3 -3
- package/esm2020/ngx-utils/utils/date.utils.mjs +5 -4
- package/esm2020/ngx-utils/utils/jsonfn.mjs +45 -0
- package/esm2020/ngx-utils/utils/object.utils.mjs +3 -3
- package/esm2020/ngx-utils/utils/wasi.mjs +159 -0
- package/esm2020/ngx-utils/utils/wasm-worker-proxy.mjs +99 -0
- package/esm2020/public_api.mjs +5 -2
- package/fesm2015/stemy-ngx-utils.js +18 -5
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/fesm2015/stemy-ngx-utils.mjs +705 -288
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +699 -286
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +7 -1
- package/ngx-utils/services/formatter.service.d.ts +1 -1
- package/ngx-utils/services/language.service.d.ts +3 -3
- package/ngx-utils/services/local-http.service.d.ts +14 -0
- package/ngx-utils/services/wasm.service.d.ts +25 -0
- package/ngx-utils/utils/jsonfn.d.ts +6 -0
- package/ngx-utils/utils/wasi.d.ts +26 -0
- package/ngx-utils/utils/wasm-worker-proxy.d.ts +17 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -3539,12 +3539,13 @@
|
|
|
3539
3539
|
FormatterService.prototype.roundNumber = function (value, precision, divider) {
|
|
3540
3540
|
return MathUtils.round(value, this.getPrecision(precision), divider || this.defaultDivider);
|
|
3541
3541
|
};
|
|
3542
|
-
FormatterService.prototype.formatNumber = function (value, format, precision, divider) {
|
|
3542
|
+
FormatterService.prototype.formatNumber = function (value, format, precision, divider, minDigits) {
|
|
3543
3543
|
precision = this.getPrecision(precision);
|
|
3544
|
+
minDigits = minDigits !== null && minDigits !== void 0 ? minDigits : precision;
|
|
3544
3545
|
divider = divider || this.defaultDivider;
|
|
3545
3546
|
var num = ObjectUtils.isNumber(value) ? value : parseFloat(value) || 0;
|
|
3546
3547
|
var str = (num / divider).toLocaleString(this.language.currentLanguage, {
|
|
3547
|
-
minimumFractionDigits:
|
|
3548
|
+
minimumFractionDigits: minDigits,
|
|
3548
3549
|
maximumFractionDigits: precision,
|
|
3549
3550
|
useGrouping: false
|
|
3550
3551
|
});
|
|
@@ -3847,8 +3848,8 @@
|
|
|
3847
3848
|
get: function () {
|
|
3848
3849
|
var _this = this;
|
|
3849
3850
|
this.loadSettings().then(function (s) { return _this.languageSettings.next(s); });
|
|
3850
|
-
return rxjs.combineLatest([this.languageSettings, this.events.languageChanged]).pipe(operators.map(function (
|
|
3851
|
-
var
|
|
3851
|
+
return rxjs.combineLatest([this.languageSettings, this.events.languageChanged]).pipe(operators.map(function (_b) {
|
|
3852
|
+
var _c = __read(_b, 2), settings = _c[0], lang = _c[1];
|
|
3852
3853
|
return !settings ? {} : settings.settings[lang] || {};
|
|
3853
3854
|
}));
|
|
3854
3855
|
},
|
|
@@ -3869,22 +3870,35 @@
|
|
|
3869
3870
|
LanguageService.prototype.initFromSettings = function () {
|
|
3870
3871
|
return __awaiter(this, void 0, void 0, function () {
|
|
3871
3872
|
var defaultLanguage, settings, devLanguages, lang;
|
|
3872
|
-
|
|
3873
|
-
|
|
3873
|
+
var _this = this;
|
|
3874
|
+
return __generator(this, function (_b) {
|
|
3875
|
+
switch (_b.label) {
|
|
3874
3876
|
case 0:
|
|
3875
3877
|
defaultLanguage = this.defaultLanguage;
|
|
3876
3878
|
return [4 /*yield*/, this.loadSettings()];
|
|
3877
3879
|
case 1:
|
|
3878
|
-
settings =
|
|
3880
|
+
settings = _b.sent();
|
|
3879
3881
|
this.languageSettings.next(settings);
|
|
3880
3882
|
devLanguages = settings.devLanguages || [];
|
|
3881
3883
|
this.languageList = (settings.languages || []).filter(function (lang) {
|
|
3884
|
+
var _a;
|
|
3885
|
+
var unavailable = (_a = settings.settings[lang]) === null || _a === void 0 ? void 0 : _a.unavailable;
|
|
3886
|
+
if (unavailable) {
|
|
3887
|
+
var parts = unavailable.split("/");
|
|
3888
|
+
var value = parts[0] || parts[1];
|
|
3889
|
+
var flags = parts.length > 1 ? parts[parts.length - 1] : "g";
|
|
3890
|
+
if (new RegExp(value, flags).test(_this.config.baseDomain))
|
|
3891
|
+
return false;
|
|
3892
|
+
}
|
|
3882
3893
|
return devLanguages.indexOf(lang) < 0;
|
|
3883
3894
|
});
|
|
3884
|
-
|
|
3895
|
+
if (this.languageList.length === 0) {
|
|
3896
|
+
this.languageList = [defaultLanguage];
|
|
3897
|
+
}
|
|
3898
|
+
lang = this.languages.indexOf(defaultLanguage) < 0 ? settings.defaultLanguage || this.languageList[0] : defaultLanguage;
|
|
3885
3899
|
return [4 /*yield*/, this.useLanguage(lang)];
|
|
3886
3900
|
case 2:
|
|
3887
|
-
|
|
3901
|
+
_b.sent();
|
|
3888
3902
|
this.events.languageChanged.emit(lang);
|
|
3889
3903
|
return [2 /*return*/];
|
|
3890
3904
|
}
|
|
@@ -3895,24 +3909,24 @@
|
|
|
3895
3909
|
if (params === void 0) { params = null; }
|
|
3896
3910
|
return __awaiter(this, void 0, void 0, function () {
|
|
3897
3911
|
var lowerKey, dict, reason_1;
|
|
3898
|
-
return __generator(this, function (
|
|
3899
|
-
switch (
|
|
3912
|
+
return __generator(this, function (_b) {
|
|
3913
|
+
switch (_b.label) {
|
|
3900
3914
|
case 0:
|
|
3901
3915
|
if (!key)
|
|
3902
3916
|
return [2 /*return*/, ""];
|
|
3903
|
-
|
|
3917
|
+
_b.label = 1;
|
|
3904
3918
|
case 1:
|
|
3905
|
-
|
|
3919
|
+
_b.trys.push([1, 3, , 4]);
|
|
3906
3920
|
lowerKey = key.toLocaleLowerCase();
|
|
3907
3921
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3908
3922
|
case 2:
|
|
3909
|
-
dict =
|
|
3923
|
+
dict = _b.sent();
|
|
3910
3924
|
if (lowerKey in dict) {
|
|
3911
3925
|
return [2 /*return*/, this.interpolate(dict[lowerKey], params)];
|
|
3912
3926
|
}
|
|
3913
3927
|
return [2 /*return*/, this.interpolate(key, params)];
|
|
3914
3928
|
case 3:
|
|
3915
|
-
reason_1 =
|
|
3929
|
+
reason_1 = _b.sent();
|
|
3916
3930
|
console.log("ERROR IN TRANSLATIONS", reason_1);
|
|
3917
3931
|
return [2 /*return*/, key];
|
|
3918
3932
|
case 4: return [2 /*return*/];
|
|
@@ -3923,8 +3937,8 @@
|
|
|
3923
3937
|
LanguageService.prototype.useLanguage = function (lang) {
|
|
3924
3938
|
return __awaiter(this, void 0, void 0, function () {
|
|
3925
3939
|
var dict;
|
|
3926
|
-
return __generator(this, function (
|
|
3927
|
-
switch (
|
|
3940
|
+
return __generator(this, function (_b) {
|
|
3941
|
+
switch (_b.label) {
|
|
3928
3942
|
case 0:
|
|
3929
3943
|
lang = this.languages.indexOf(lang) < 0 ? this.languages[0] : lang;
|
|
3930
3944
|
this.client.setExtraRequestParam("language", lang);
|
|
@@ -3934,7 +3948,7 @@
|
|
|
3934
3948
|
this.currentLang = lang;
|
|
3935
3949
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3936
3950
|
case 1:
|
|
3937
|
-
dict =
|
|
3951
|
+
dict = _b.sent();
|
|
3938
3952
|
this.translations[lang] = dict;
|
|
3939
3953
|
return [2 /*return*/, dict];
|
|
3940
3954
|
}
|
|
@@ -3958,7 +3972,7 @@
|
|
|
3958
3972
|
return this.translationRequests[lang];
|
|
3959
3973
|
};
|
|
3960
3974
|
LanguageService.prototype.loadSettings = function () {
|
|
3961
|
-
this.settingsPromise = this.settingsPromise || this.client.get(this.config.translationUrl + "languageSettings").toPromise()
|
|
3975
|
+
this.settingsPromise = this.settingsPromise || (this.client.get(this.config.translationUrl + "languageSettings").toPromise())
|
|
3962
3976
|
.then(function (settings) {
|
|
3963
3977
|
return settings;
|
|
3964
3978
|
}, function () {
|
|
@@ -3969,7 +3983,7 @@
|
|
|
3969
3983
|
settings: {
|
|
3970
3984
|
de: {},
|
|
3971
3985
|
hu: {},
|
|
3972
|
-
|
|
3986
|
+
en: {}
|
|
3973
3987
|
}
|
|
3974
3988
|
};
|
|
3975
3989
|
});
|