@stemy/ngx-utils 12.2.11 → 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 +31 -18
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +1 -1
- package/esm2015/ngx-utils/services/language.service.js +16 -4
- package/esm2015/public_api.js +1 -1
- package/esm2020/ngx-utils/common-types.mjs +2 -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.module.mjs +10 -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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/esm2020/ngx-utils/services/wasm.service.mjs +3 -3
- package/esm2020/ngx-utils/utils/auth.guard.mjs +3 -3
- package/esm2020/ngx-utils/utils/wasi.mjs +3 -3
- package/esm2020/public_api.mjs +2 -2
- package/fesm2015/stemy-ngx-utils.js +15 -3
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/fesm2015/stemy-ngx-utils.mjs +240 -220
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +239 -220
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +7 -1
- package/ngx-utils/services/language.service.d.ts +3 -3
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -3848,8 +3848,8 @@
|
|
|
3848
3848
|
get: function () {
|
|
3849
3849
|
var _this = this;
|
|
3850
3850
|
this.loadSettings().then(function (s) { return _this.languageSettings.next(s); });
|
|
3851
|
-
return rxjs.combineLatest([this.languageSettings, this.events.languageChanged]).pipe(operators.map(function (
|
|
3852
|
-
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];
|
|
3853
3853
|
return !settings ? {} : settings.settings[lang] || {};
|
|
3854
3854
|
}));
|
|
3855
3855
|
},
|
|
@@ -3870,22 +3870,35 @@
|
|
|
3870
3870
|
LanguageService.prototype.initFromSettings = function () {
|
|
3871
3871
|
return __awaiter(this, void 0, void 0, function () {
|
|
3872
3872
|
var defaultLanguage, settings, devLanguages, lang;
|
|
3873
|
-
|
|
3874
|
-
|
|
3873
|
+
var _this = this;
|
|
3874
|
+
return __generator(this, function (_b) {
|
|
3875
|
+
switch (_b.label) {
|
|
3875
3876
|
case 0:
|
|
3876
3877
|
defaultLanguage = this.defaultLanguage;
|
|
3877
3878
|
return [4 /*yield*/, this.loadSettings()];
|
|
3878
3879
|
case 1:
|
|
3879
|
-
settings =
|
|
3880
|
+
settings = _b.sent();
|
|
3880
3881
|
this.languageSettings.next(settings);
|
|
3881
3882
|
devLanguages = settings.devLanguages || [];
|
|
3882
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
|
+
}
|
|
3883
3893
|
return devLanguages.indexOf(lang) < 0;
|
|
3884
3894
|
});
|
|
3885
|
-
|
|
3895
|
+
if (this.languageList.length === 0) {
|
|
3896
|
+
this.languageList = [defaultLanguage];
|
|
3897
|
+
}
|
|
3898
|
+
lang = this.languages.indexOf(defaultLanguage) < 0 ? settings.defaultLanguage || this.languageList[0] : defaultLanguage;
|
|
3886
3899
|
return [4 /*yield*/, this.useLanguage(lang)];
|
|
3887
3900
|
case 2:
|
|
3888
|
-
|
|
3901
|
+
_b.sent();
|
|
3889
3902
|
this.events.languageChanged.emit(lang);
|
|
3890
3903
|
return [2 /*return*/];
|
|
3891
3904
|
}
|
|
@@ -3896,24 +3909,24 @@
|
|
|
3896
3909
|
if (params === void 0) { params = null; }
|
|
3897
3910
|
return __awaiter(this, void 0, void 0, function () {
|
|
3898
3911
|
var lowerKey, dict, reason_1;
|
|
3899
|
-
return __generator(this, function (
|
|
3900
|
-
switch (
|
|
3912
|
+
return __generator(this, function (_b) {
|
|
3913
|
+
switch (_b.label) {
|
|
3901
3914
|
case 0:
|
|
3902
3915
|
if (!key)
|
|
3903
3916
|
return [2 /*return*/, ""];
|
|
3904
|
-
|
|
3917
|
+
_b.label = 1;
|
|
3905
3918
|
case 1:
|
|
3906
|
-
|
|
3919
|
+
_b.trys.push([1, 3, , 4]);
|
|
3907
3920
|
lowerKey = key.toLocaleLowerCase();
|
|
3908
3921
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3909
3922
|
case 2:
|
|
3910
|
-
dict =
|
|
3923
|
+
dict = _b.sent();
|
|
3911
3924
|
if (lowerKey in dict) {
|
|
3912
3925
|
return [2 /*return*/, this.interpolate(dict[lowerKey], params)];
|
|
3913
3926
|
}
|
|
3914
3927
|
return [2 /*return*/, this.interpolate(key, params)];
|
|
3915
3928
|
case 3:
|
|
3916
|
-
reason_1 =
|
|
3929
|
+
reason_1 = _b.sent();
|
|
3917
3930
|
console.log("ERROR IN TRANSLATIONS", reason_1);
|
|
3918
3931
|
return [2 /*return*/, key];
|
|
3919
3932
|
case 4: return [2 /*return*/];
|
|
@@ -3924,8 +3937,8 @@
|
|
|
3924
3937
|
LanguageService.prototype.useLanguage = function (lang) {
|
|
3925
3938
|
return __awaiter(this, void 0, void 0, function () {
|
|
3926
3939
|
var dict;
|
|
3927
|
-
return __generator(this, function (
|
|
3928
|
-
switch (
|
|
3940
|
+
return __generator(this, function (_b) {
|
|
3941
|
+
switch (_b.label) {
|
|
3929
3942
|
case 0:
|
|
3930
3943
|
lang = this.languages.indexOf(lang) < 0 ? this.languages[0] : lang;
|
|
3931
3944
|
this.client.setExtraRequestParam("language", lang);
|
|
@@ -3935,7 +3948,7 @@
|
|
|
3935
3948
|
this.currentLang = lang;
|
|
3936
3949
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3937
3950
|
case 1:
|
|
3938
|
-
dict =
|
|
3951
|
+
dict = _b.sent();
|
|
3939
3952
|
this.translations[lang] = dict;
|
|
3940
3953
|
return [2 /*return*/, dict];
|
|
3941
3954
|
}
|
|
@@ -3959,7 +3972,7 @@
|
|
|
3959
3972
|
return this.translationRequests[lang];
|
|
3960
3973
|
};
|
|
3961
3974
|
LanguageService.prototype.loadSettings = function () {
|
|
3962
|
-
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())
|
|
3963
3976
|
.then(function (settings) {
|
|
3964
3977
|
return settings;
|
|
3965
3978
|
}, function () {
|
|
@@ -3970,7 +3983,7 @@
|
|
|
3970
3983
|
settings: {
|
|
3971
3984
|
de: {},
|
|
3972
3985
|
hu: {},
|
|
3973
|
-
|
|
3986
|
+
en: {}
|
|
3974
3987
|
}
|
|
3975
3988
|
};
|
|
3976
3989
|
});
|