@smartbit4all/ng-client 1.0.10 → 1.0.11
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/esm2020/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.component.mjs +21 -18
- package/esm2020/lib/view-context/smart-ui-action/ui-action.descriptor.service.mjs +26 -30
- package/fesm2015/smartbit4all-ng-client.mjs +39 -39
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +38 -39
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/view-context/smart-ui-action/dialogs/ui-action-input-dialog/ui-action-input-dialog.component.d.ts +7 -6
- package/lib/view-context/smart-ui-action/ui-action.descriptor.service.d.ts +4 -4
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.0.11.tgz +0 -0
- package/smartbit4all-ng-client-1.0.10.tgz +0 -0
|
@@ -2913,27 +2913,27 @@ class UiActionDescriptorService {
|
|
|
2913
2913
|
this.viewContext = viewContext;
|
|
2914
2914
|
this._destroy$ = new Subject();
|
|
2915
2915
|
this.languageChanged = new Subject();
|
|
2916
|
-
this.keysToTranslate = [
|
|
2916
|
+
this.keysToTranslate = ['title', 'text', 'placeholder', 'caption', 'feedbackText'];
|
|
2917
2917
|
this.basicActionDescriptors = new Map([
|
|
2918
2918
|
[
|
|
2919
|
-
|
|
2919
|
+
'UNKOWN',
|
|
2920
2920
|
{
|
|
2921
|
-
title:
|
|
2921
|
+
title: '',
|
|
2922
2922
|
type: UiActionButtonType.Normal,
|
|
2923
|
-
color:
|
|
2924
|
-
icon:
|
|
2923
|
+
color: 'accent',
|
|
2924
|
+
icon: 'Question',
|
|
2925
2925
|
iconColor: `text-primary`,
|
|
2926
2926
|
iconPosition: UiActionButtonIconPos.Post,
|
|
2927
2927
|
dialog: {
|
|
2928
|
-
title:
|
|
2929
|
-
placeholder:
|
|
2928
|
+
title: '',
|
|
2929
|
+
placeholder: 'placeholder',
|
|
2930
2930
|
actionButton: {
|
|
2931
|
-
caption:
|
|
2932
|
-
color:
|
|
2931
|
+
caption: '',
|
|
2932
|
+
color: 'accent',
|
|
2933
2933
|
},
|
|
2934
2934
|
cancelButton: {
|
|
2935
|
-
caption:
|
|
2936
|
-
color:
|
|
2935
|
+
caption: 'Mégse',
|
|
2936
|
+
color: '',
|
|
2937
2937
|
},
|
|
2938
2938
|
},
|
|
2939
2939
|
},
|
|
@@ -2943,9 +2943,7 @@ class UiActionDescriptorService {
|
|
|
2943
2943
|
this.subscribeToTranslateService();
|
|
2944
2944
|
}
|
|
2945
2945
|
else {
|
|
2946
|
-
this.viewContext.translateServiceChanged
|
|
2947
|
-
.pipe(takeUntil(this._destroy$))
|
|
2948
|
-
.subscribe(() => {
|
|
2946
|
+
this.viewContext.translateServiceChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
2949
2947
|
this.subscribeToTranslateService();
|
|
2950
2948
|
});
|
|
2951
2949
|
}
|
|
@@ -2955,9 +2953,7 @@ class UiActionDescriptorService {
|
|
|
2955
2953
|
this._destroy$.complete();
|
|
2956
2954
|
}
|
|
2957
2955
|
subscribeToTranslateService() {
|
|
2958
|
-
this.viewContext
|
|
2959
|
-
.translateService.onLangChange.pipe(takeUntil(this._destroy$))
|
|
2960
|
-
.subscribe(() => {
|
|
2956
|
+
this.viewContext.translateService.onLangChange.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
2961
2957
|
this.languageChanged.next();
|
|
2962
2958
|
});
|
|
2963
2959
|
}
|
|
@@ -2966,11 +2962,11 @@ class UiActionDescriptorService {
|
|
|
2966
2962
|
let actionDescriptorFromDescriptors = this.viewContext.getActionDescriptors()?.get(code);
|
|
2967
2963
|
let actionDescriptor = JSON.parse(JSON.stringify(actionDescriptorFromDescriptors));
|
|
2968
2964
|
if (!actionDescriptor) {
|
|
2969
|
-
actionDescriptor = this.basicActionDescriptors.get(
|
|
2965
|
+
actionDescriptor = this.basicActionDescriptors.get('UNKOWN');
|
|
2970
2966
|
actionDescriptor.title = code;
|
|
2971
2967
|
}
|
|
2972
2968
|
if (!actionDescriptor.dialog) {
|
|
2973
|
-
actionDescriptor = this.setUpUnkownDialogDescriptor(code, actionDescriptor,
|
|
2969
|
+
actionDescriptor = this.setUpUnkownDialogDescriptor(code, actionDescriptor, 'dialog');
|
|
2974
2970
|
}
|
|
2975
2971
|
if (!actionDescriptor.feedbackType && uiAction.submit) {
|
|
2976
2972
|
actionDescriptor.feedbackType = UiActionFeedbackType.Snackbar;
|
|
@@ -2985,22 +2981,22 @@ class UiActionDescriptorService {
|
|
|
2985
2981
|
return uiActionDescriptor;
|
|
2986
2982
|
}
|
|
2987
2983
|
async deepTranslate(model) {
|
|
2988
|
-
Object.keys(model).map(async (key) => {
|
|
2984
|
+
await Promise.all(Object.keys(model).map(async (key) => {
|
|
2989
2985
|
if (model[key] !== undefined &&
|
|
2990
|
-
typeof model[key] ===
|
|
2986
|
+
typeof model[key] === 'string' &&
|
|
2991
2987
|
model[key].length &&
|
|
2992
2988
|
this.keysToTranslate.includes(key)) {
|
|
2993
2989
|
model[key] = await this.viewContext.translateService.get(model[key]).toPromise();
|
|
2994
2990
|
}
|
|
2995
|
-
else if (model[key] !== undefined && typeof model[key] ===
|
|
2991
|
+
else if (model[key] !== undefined && typeof model[key] === 'object') {
|
|
2996
2992
|
model[key] = await this.deepTranslate(model[key]);
|
|
2997
2993
|
}
|
|
2998
2994
|
return model;
|
|
2999
|
-
});
|
|
2995
|
+
}));
|
|
3000
2996
|
return model;
|
|
3001
2997
|
}
|
|
3002
2998
|
setUpUnkownDialogDescriptor(code, uiActionDescriptor, dialogType) {
|
|
3003
|
-
let unkownDescriptor = this.basicActionDescriptors.get(
|
|
2999
|
+
let unkownDescriptor = this.basicActionDescriptors.get('UNKOWN');
|
|
3004
3000
|
uiActionDescriptor[dialogType] = unkownDescriptor.dialog;
|
|
3005
3001
|
uiActionDescriptor[dialogType].title = code;
|
|
3006
3002
|
uiActionDescriptor[dialogType].actionButton.caption = code;
|
|
@@ -3008,11 +3004,11 @@ class UiActionDescriptorService {
|
|
|
3008
3004
|
}
|
|
3009
3005
|
}
|
|
3010
3006
|
UiActionDescriptorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, deps: [{ token: SmartViewContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3011
|
-
UiActionDescriptorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, providedIn:
|
|
3007
|
+
UiActionDescriptorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, providedIn: 'root' });
|
|
3012
3008
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, decorators: [{
|
|
3013
3009
|
type: Injectable,
|
|
3014
3010
|
args: [{
|
|
3015
|
-
providedIn:
|
|
3011
|
+
providedIn: 'root',
|
|
3016
3012
|
}]
|
|
3017
3013
|
}], ctorParameters: function () { return [{ type: SmartViewContextService }]; } });
|
|
3018
3014
|
|
|
@@ -3145,13 +3141,16 @@ class UiActionInputDialogComponent {
|
|
|
3145
3141
|
this.dialogType = this.service.inputTypeName;
|
|
3146
3142
|
}
|
|
3147
3143
|
else {
|
|
3148
|
-
this.dialogType = this.descriptor.inputDialog ?
|
|
3144
|
+
this.dialogType = this.descriptor.inputDialog ? 'inputDialog' : 'dialog';
|
|
3149
3145
|
}
|
|
3150
3146
|
this.constructForm();
|
|
3151
3147
|
}
|
|
3152
3148
|
getTitle() {
|
|
3153
3149
|
return this.descriptor[this.dialogType].title;
|
|
3154
3150
|
}
|
|
3151
|
+
getText() {
|
|
3152
|
+
return this.descriptor[this.dialogType].text ?? '';
|
|
3153
|
+
}
|
|
3155
3154
|
getActionButtonLabel() {
|
|
3156
3155
|
return this.descriptor[this.dialogType].actionButton.caption;
|
|
3157
3156
|
}
|
|
@@ -3167,17 +3166,17 @@ class UiActionInputDialogComponent {
|
|
|
3167
3166
|
constructForm() {
|
|
3168
3167
|
let model = {};
|
|
3169
3168
|
let inputName;
|
|
3170
|
-
if (this.service.inputTypeName ===
|
|
3171
|
-
inputName =
|
|
3169
|
+
if (this.service.inputTypeName === 'inputDialog') {
|
|
3170
|
+
inputName = 'input';
|
|
3172
3171
|
}
|
|
3173
3172
|
else {
|
|
3174
|
-
inputName =
|
|
3173
|
+
inputName = 'input2';
|
|
3175
3174
|
}
|
|
3176
3175
|
if (this.service.nodeName) {
|
|
3177
3176
|
model[inputName] = this.service.nodeName;
|
|
3178
3177
|
}
|
|
3179
3178
|
else {
|
|
3180
|
-
model[inputName] =
|
|
3179
|
+
model[inputName] = '';
|
|
3181
3180
|
}
|
|
3182
3181
|
let type;
|
|
3183
3182
|
let inputType = `${inputName}Type`;
|
|
@@ -3193,17 +3192,17 @@ class UiActionInputDialogComponent {
|
|
|
3193
3192
|
widgets: [
|
|
3194
3193
|
{
|
|
3195
3194
|
key: inputName,
|
|
3196
|
-
label:
|
|
3195
|
+
label: '',
|
|
3197
3196
|
type,
|
|
3198
|
-
value:
|
|
3197
|
+
value: '',
|
|
3199
3198
|
validators: [
|
|
3200
3199
|
{
|
|
3201
3200
|
validator: Validators.required,
|
|
3202
3201
|
name: SmartValidatorName.required,
|
|
3203
|
-
errorMessage:
|
|
3202
|
+
errorMessage: 'Ez a mező kötelező',
|
|
3204
3203
|
},
|
|
3205
3204
|
],
|
|
3206
|
-
placeholder: this.descriptor[this.dialogType].placeholder ??
|
|
3205
|
+
placeholder: this.descriptor[this.dialogType].placeholder ?? '',
|
|
3207
3206
|
showLabel: true,
|
|
3208
3207
|
},
|
|
3209
3208
|
],
|
|
@@ -3212,7 +3211,7 @@ class UiActionInputDialogComponent {
|
|
|
3212
3211
|
save() {
|
|
3213
3212
|
let form = this.folderFormChild.submitForm();
|
|
3214
3213
|
if (form.invalidFields) {
|
|
3215
|
-
throw new Error(
|
|
3214
|
+
throw new Error('The form is invalid!');
|
|
3216
3215
|
}
|
|
3217
3216
|
this.service.onSave(form.model);
|
|
3218
3217
|
}
|
|
@@ -3221,13 +3220,13 @@ class UiActionInputDialogComponent {
|
|
|
3221
3220
|
}
|
|
3222
3221
|
}
|
|
3223
3222
|
UiActionInputDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, deps: [{ token: UiActionInputDialogService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3224
|
-
UiActionInputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionInputDialogComponent, selector: "smart-ui-action-input-dialog", viewQueries: [{ propertyName: "folderFormChild", first: true, predicate: ["form"], descendants: true }], ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5$1.SmartformComponent, selector: "smartform", inputs: ["smartForm"] }] });
|
|
3223
|
+
UiActionInputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionInputDialogComponent, selector: "smart-ui-action-input-dialog", viewQueries: [{ propertyName: "folderFormChild", first: true, predicate: ["form"], descendants: true }], ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5$1.SmartformComponent, selector: "smartform", inputs: ["smartForm"] }] });
|
|
3225
3224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, decorators: [{
|
|
3226
3225
|
type: Component,
|
|
3227
|
-
args: [{ selector:
|
|
3226
|
+
args: [{ selector: 'smart-ui-action-input-dialog', template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"] }]
|
|
3228
3227
|
}], ctorParameters: function () { return [{ type: UiActionInputDialogService }, { type: UiActionDescriptorService }]; }, propDecorators: { folderFormChild: [{
|
|
3229
3228
|
type: ViewChild,
|
|
3230
|
-
args: [
|
|
3229
|
+
args: ['form']
|
|
3231
3230
|
}] } });
|
|
3232
3231
|
|
|
3233
3232
|
class UiActionInputDialogService extends SmartdialogService {
|