@stemy/ngx-utils 12.2.11 → 12.2.13
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 +44 -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/config.service.js +14 -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 +28 -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 +9 -1
- package/ngx-utils/services/config.service.d.ts +1 -0
- 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
|
@@ -3399,6 +3399,19 @@
|
|
|
3399
3399
|
ConfigService.prototype.prepareConfig = function (config) {
|
|
3400
3400
|
return Promise.resolve(config);
|
|
3401
3401
|
};
|
|
3402
|
+
ConfigService.prototype.cloneRootElem = function () {
|
|
3403
|
+
if (this.rootElement instanceof HTMLElement) {
|
|
3404
|
+
var clone = this.rootElement.cloneNode(true);
|
|
3405
|
+
var children = Array.from(clone.childNodes);
|
|
3406
|
+
children.forEach(function (child) {
|
|
3407
|
+
if (child instanceof HTMLElement) {
|
|
3408
|
+
child.remove();
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3411
|
+
return clone;
|
|
3412
|
+
}
|
|
3413
|
+
return this.rootElement.cloneNode(true);
|
|
3414
|
+
};
|
|
3402
3415
|
ConfigService.prototype.prepareUrl = function (url, ending) {
|
|
3403
3416
|
var _a;
|
|
3404
3417
|
var project = !this.loadedConfig ? "" : this.loadedConfig.project;
|
|
@@ -3848,8 +3861,8 @@
|
|
|
3848
3861
|
get: function () {
|
|
3849
3862
|
var _this = this;
|
|
3850
3863
|
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
|
|
3864
|
+
return rxjs.combineLatest([this.languageSettings, this.events.languageChanged]).pipe(operators.map(function (_b) {
|
|
3865
|
+
var _c = __read(_b, 2), settings = _c[0], lang = _c[1];
|
|
3853
3866
|
return !settings ? {} : settings.settings[lang] || {};
|
|
3854
3867
|
}));
|
|
3855
3868
|
},
|
|
@@ -3870,22 +3883,35 @@
|
|
|
3870
3883
|
LanguageService.prototype.initFromSettings = function () {
|
|
3871
3884
|
return __awaiter(this, void 0, void 0, function () {
|
|
3872
3885
|
var defaultLanguage, settings, devLanguages, lang;
|
|
3873
|
-
|
|
3874
|
-
|
|
3886
|
+
var _this = this;
|
|
3887
|
+
return __generator(this, function (_b) {
|
|
3888
|
+
switch (_b.label) {
|
|
3875
3889
|
case 0:
|
|
3876
3890
|
defaultLanguage = this.defaultLanguage;
|
|
3877
3891
|
return [4 /*yield*/, this.loadSettings()];
|
|
3878
3892
|
case 1:
|
|
3879
|
-
settings =
|
|
3893
|
+
settings = _b.sent();
|
|
3880
3894
|
this.languageSettings.next(settings);
|
|
3881
3895
|
devLanguages = settings.devLanguages || [];
|
|
3882
3896
|
this.languageList = (settings.languages || []).filter(function (lang) {
|
|
3897
|
+
var _a;
|
|
3898
|
+
var unavailable = (_a = settings.settings[lang]) === null || _a === void 0 ? void 0 : _a.unavailable;
|
|
3899
|
+
if (unavailable) {
|
|
3900
|
+
var parts = unavailable.split("/");
|
|
3901
|
+
var value = parts[0] || parts[1];
|
|
3902
|
+
var flags = parts.length > 1 ? parts[parts.length - 1] : "g";
|
|
3903
|
+
if (new RegExp(value, flags).test(_this.config.baseDomain))
|
|
3904
|
+
return false;
|
|
3905
|
+
}
|
|
3883
3906
|
return devLanguages.indexOf(lang) < 0;
|
|
3884
3907
|
});
|
|
3885
|
-
|
|
3908
|
+
if (this.languageList.length === 0) {
|
|
3909
|
+
this.languageList = [defaultLanguage];
|
|
3910
|
+
}
|
|
3911
|
+
lang = this.languages.indexOf(defaultLanguage) < 0 ? settings.defaultLanguage || this.languageList[0] : defaultLanguage;
|
|
3886
3912
|
return [4 /*yield*/, this.useLanguage(lang)];
|
|
3887
3913
|
case 2:
|
|
3888
|
-
|
|
3914
|
+
_b.sent();
|
|
3889
3915
|
this.events.languageChanged.emit(lang);
|
|
3890
3916
|
return [2 /*return*/];
|
|
3891
3917
|
}
|
|
@@ -3896,24 +3922,24 @@
|
|
|
3896
3922
|
if (params === void 0) { params = null; }
|
|
3897
3923
|
return __awaiter(this, void 0, void 0, function () {
|
|
3898
3924
|
var lowerKey, dict, reason_1;
|
|
3899
|
-
return __generator(this, function (
|
|
3900
|
-
switch (
|
|
3925
|
+
return __generator(this, function (_b) {
|
|
3926
|
+
switch (_b.label) {
|
|
3901
3927
|
case 0:
|
|
3902
3928
|
if (!key)
|
|
3903
3929
|
return [2 /*return*/, ""];
|
|
3904
|
-
|
|
3930
|
+
_b.label = 1;
|
|
3905
3931
|
case 1:
|
|
3906
|
-
|
|
3932
|
+
_b.trys.push([1, 3, , 4]);
|
|
3907
3933
|
lowerKey = key.toLocaleLowerCase();
|
|
3908
3934
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3909
3935
|
case 2:
|
|
3910
|
-
dict =
|
|
3936
|
+
dict = _b.sent();
|
|
3911
3937
|
if (lowerKey in dict) {
|
|
3912
3938
|
return [2 /*return*/, this.interpolate(dict[lowerKey], params)];
|
|
3913
3939
|
}
|
|
3914
3940
|
return [2 /*return*/, this.interpolate(key, params)];
|
|
3915
3941
|
case 3:
|
|
3916
|
-
reason_1 =
|
|
3942
|
+
reason_1 = _b.sent();
|
|
3917
3943
|
console.log("ERROR IN TRANSLATIONS", reason_1);
|
|
3918
3944
|
return [2 /*return*/, key];
|
|
3919
3945
|
case 4: return [2 /*return*/];
|
|
@@ -3924,8 +3950,8 @@
|
|
|
3924
3950
|
LanguageService.prototype.useLanguage = function (lang) {
|
|
3925
3951
|
return __awaiter(this, void 0, void 0, function () {
|
|
3926
3952
|
var dict;
|
|
3927
|
-
return __generator(this, function (
|
|
3928
|
-
switch (
|
|
3953
|
+
return __generator(this, function (_b) {
|
|
3954
|
+
switch (_b.label) {
|
|
3929
3955
|
case 0:
|
|
3930
3956
|
lang = this.languages.indexOf(lang) < 0 ? this.languages[0] : lang;
|
|
3931
3957
|
this.client.setExtraRequestParam("language", lang);
|
|
@@ -3935,7 +3961,7 @@
|
|
|
3935
3961
|
this.currentLang = lang;
|
|
3936
3962
|
return [4 /*yield*/, this.loadDictionary()];
|
|
3937
3963
|
case 1:
|
|
3938
|
-
dict =
|
|
3964
|
+
dict = _b.sent();
|
|
3939
3965
|
this.translations[lang] = dict;
|
|
3940
3966
|
return [2 /*return*/, dict];
|
|
3941
3967
|
}
|
|
@@ -3959,7 +3985,7 @@
|
|
|
3959
3985
|
return this.translationRequests[lang];
|
|
3960
3986
|
};
|
|
3961
3987
|
LanguageService.prototype.loadSettings = function () {
|
|
3962
|
-
this.settingsPromise = this.settingsPromise || this.client.get(this.config.translationUrl + "languageSettings").toPromise()
|
|
3988
|
+
this.settingsPromise = this.settingsPromise || (this.client.get(this.config.translationUrl + "languageSettings").toPromise())
|
|
3963
3989
|
.then(function (settings) {
|
|
3964
3990
|
return settings;
|
|
3965
3991
|
}, function () {
|
|
@@ -3970,7 +3996,7 @@
|
|
|
3970
3996
|
settings: {
|
|
3971
3997
|
de: {},
|
|
3972
3998
|
hu: {},
|
|
3973
|
-
|
|
3999
|
+
en: {}
|
|
3974
4000
|
}
|
|
3975
4001
|
};
|
|
3976
4002
|
});
|