@smartbit4all/ng-client 3.2.3 → 3.2.4
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/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +59 -54
- package/esm2020/lib/smart-filter-editor/smart-filter-editor.service.mjs +1 -1
- package/esm2020/lib/smart-form/services/smartform.service.mjs +13 -18
- package/fesm2015/smartbit4all-ng-client.mjs +71 -68
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +68 -67
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.d.ts +6 -9
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.4.tgz +0 -0
- package/smartbit4all-ng-client-3.2.3.tgz +0 -0
|
@@ -3877,12 +3877,11 @@ class SmartFormService {
|
|
|
3877
3877
|
}
|
|
3878
3878
|
toFormGroup() {
|
|
3879
3879
|
this.createFormControls(this.smartForm.widgets);
|
|
3880
|
-
if (this.formGroup) {
|
|
3881
|
-
|
|
3882
|
-
}
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
}
|
|
3880
|
+
// if (this.formGroup) {
|
|
3881
|
+
// this.formGroup.controls = this.group;
|
|
3882
|
+
// } else {
|
|
3883
|
+
// }
|
|
3884
|
+
this.formGroup = new FormGroup(this.group);
|
|
3886
3885
|
if (this.smartForm.validators && this.smartForm.validators.length) {
|
|
3887
3886
|
this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3888
3887
|
return validator.validator;
|
|
@@ -3904,18 +3903,14 @@ class SmartFormService {
|
|
|
3904
3903
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
3905
3904
|
widget.type !== SmartFormWidgetType.MATRIX &&
|
|
3906
3905
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
3907
|
-
let formControl = this.group[`${widget.key}`];
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
}));
|
|
3914
|
-
if (widget.isDisabled) {
|
|
3915
|
-
formControl.disable();
|
|
3916
|
-
}
|
|
3917
|
-
this.group[`${widget.key}`] = formControl;
|
|
3906
|
+
// let formControl = this.group[`${widget.key}`];
|
|
3907
|
+
let formControl = new FormControl(widget.value || '', widget.validators?.map((validator) => {
|
|
3908
|
+
return validator.validator;
|
|
3909
|
+
}));
|
|
3910
|
+
if (widget.isDisabled) {
|
|
3911
|
+
formControl.disable();
|
|
3918
3912
|
}
|
|
3913
|
+
this.group[`${widget.key}`] = formControl;
|
|
3919
3914
|
}
|
|
3920
3915
|
if (widget.type === SmartFormWidgetType.MATRIX) {
|
|
3921
3916
|
if (widget.isMultiple) {
|
|
@@ -13607,14 +13602,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13607
13602
|
}] } });
|
|
13608
13603
|
|
|
13609
13604
|
class SmartFilterEditorContentComponent {
|
|
13610
|
-
constructor(layoutService
|
|
13605
|
+
constructor(layoutService) {
|
|
13611
13606
|
this.layoutService = layoutService;
|
|
13612
|
-
this.cfService = cfService;
|
|
13613
13607
|
this._destroy$ = new Subject();
|
|
13614
13608
|
this.uiActionModels = [];
|
|
13615
13609
|
this.expressionUiActionModels = [];
|
|
13616
13610
|
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13617
13611
|
}
|
|
13612
|
+
ngAfterViewInit() {
|
|
13613
|
+
if (this.simpleFilterFormChildren?.first) {
|
|
13614
|
+
this.simpleFilterFormChildren.first.onBlurSubject
|
|
13615
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13616
|
+
.subscribe(() => {
|
|
13617
|
+
this.saveFilter();
|
|
13618
|
+
});
|
|
13619
|
+
this.simpleFilterFormChildren.first.sophisticatedValueChange
|
|
13620
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13621
|
+
.subscribe((change) => {
|
|
13622
|
+
if (change.kind === 'selection') {
|
|
13623
|
+
this.saveFilter();
|
|
13624
|
+
}
|
|
13625
|
+
});
|
|
13626
|
+
}
|
|
13627
|
+
else {
|
|
13628
|
+
this.simpleFilterFormChildren?.changes.subscribe(() => {
|
|
13629
|
+
this.simpleFilterFormChildren.first.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13630
|
+
this.saveFilter();
|
|
13631
|
+
});
|
|
13632
|
+
this.simpleFilterFormChildren.first.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13633
|
+
if (change.kind === 'selection') {
|
|
13634
|
+
this.saveFilter();
|
|
13635
|
+
}
|
|
13636
|
+
});
|
|
13637
|
+
});
|
|
13638
|
+
}
|
|
13639
|
+
}
|
|
13618
13640
|
ngOnInit() {
|
|
13619
13641
|
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13620
13642
|
this.service.load();
|
|
@@ -13624,9 +13646,6 @@ class SmartFilterEditorContentComponent {
|
|
|
13624
13646
|
this._destroy$.complete();
|
|
13625
13647
|
}
|
|
13626
13648
|
setupSimpleFilter() {
|
|
13627
|
-
if (this.simpleFilterFormChild) {
|
|
13628
|
-
return;
|
|
13629
|
-
}
|
|
13630
13649
|
let widgets = [];
|
|
13631
13650
|
let key;
|
|
13632
13651
|
let model = {};
|
|
@@ -13666,25 +13685,9 @@ class SmartFilterEditorContentComponent {
|
|
|
13666
13685
|
useOnBlurEvent: true,
|
|
13667
13686
|
widgets,
|
|
13668
13687
|
};
|
|
13669
|
-
this.simpleFilterFormChild = this.cfService.createComponent(this.simpleFilterFormVcRef, SmartformComponent, new Map([['smartForm', this.simpleFilterForm]]));
|
|
13670
|
-
if (this.smartFilterChangeSubscription) {
|
|
13671
|
-
this.smartFilterChangeSubscription.unsubscribe();
|
|
13672
|
-
}
|
|
13673
|
-
this.smartFilterChangeSubscription = this.simpleFilterFormChild.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13674
|
-
this.saveFilter();
|
|
13675
|
-
});
|
|
13676
|
-
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13677
|
-
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13678
|
-
}
|
|
13679
|
-
this.smartFilterSophisticatedChangeSubscription =
|
|
13680
|
-
this.simpleFilterFormChild.instance.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13681
|
-
if (change.kind === 'selection') {
|
|
13682
|
-
this.saveFilter();
|
|
13683
|
-
}
|
|
13684
|
-
});
|
|
13685
13688
|
}
|
|
13686
13689
|
extractFilterFieldFromFormModel() {
|
|
13687
|
-
let simpleFilter = this.
|
|
13690
|
+
let simpleFilter = this.simpleFilterFormChildren?.first?.submitForm(false).componentModel.data;
|
|
13688
13691
|
let result = [];
|
|
13689
13692
|
Object.keys(simpleFilter).forEach((key) => {
|
|
13690
13693
|
result.push(simpleFilter[key]);
|
|
@@ -13744,29 +13747,27 @@ class SmartFilterEditorContentComponent {
|
|
|
13744
13747
|
componentModel: { data: this.service.model?.selectedField },
|
|
13745
13748
|
widgets: generatedWidgets,
|
|
13746
13749
|
};
|
|
13747
|
-
this.formChild = this.cfService.createComponent(this.formChildVcRef, SmartformComponent, new Map([['smartForm', this.smartForm]]));
|
|
13748
13750
|
if (this.smartformChangeSubscription) {
|
|
13749
13751
|
this.smartformChangeSubscription.unsubscribe();
|
|
13750
13752
|
}
|
|
13751
|
-
this.smartformChangeSubscription = this.formChild?.
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
});
|
|
13756
|
-
if (this.smartformSophisticatedChangeSubscription) {
|
|
13757
|
-
|
|
13758
|
-
}
|
|
13759
|
-
this.smartformSophisticatedChangeSubscription =
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
});
|
|
13753
|
+
// this.smartformChangeSubscription = this.formChild?.onBlurSubject
|
|
13754
|
+
// ?.pipe(takeUntil(this._destroy$))
|
|
13755
|
+
// .subscribe(() => {
|
|
13756
|
+
// this.save();
|
|
13757
|
+
// });
|
|
13758
|
+
// if (this.smartformSophisticatedChangeSubscription) {
|
|
13759
|
+
// this.smartformSophisticatedChangeSubscription.unsubscribe();
|
|
13760
|
+
// }
|
|
13761
|
+
// this.smartformSophisticatedChangeSubscription = this.formChild?.sophisticatedValueChange
|
|
13762
|
+
// ?.pipe(takeUntil(this._destroy$))
|
|
13763
|
+
// .subscribe((change: SophisticatedValueChange) => {
|
|
13764
|
+
// if (change.key === 'expressionData.currentOperation') {
|
|
13765
|
+
// this.save();
|
|
13766
|
+
// }
|
|
13767
|
+
// });
|
|
13767
13768
|
}
|
|
13768
13769
|
save() {
|
|
13769
|
-
this.
|
|
13770
|
+
this.formChildren?.first?.submitForm(false);
|
|
13770
13771
|
this.service.peformWidgetAction({
|
|
13771
13772
|
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13772
13773
|
params: {
|
|
@@ -13826,19 +13827,19 @@ class SmartFilterEditorContentComponent {
|
|
|
13826
13827
|
return widget;
|
|
13827
13828
|
}
|
|
13828
13829
|
}
|
|
13829
|
-
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }
|
|
13830
|
-
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "
|
|
13830
|
+
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13831
|
+
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildren", predicate: ["form"], descendants: true }, { propertyName: "simpleFilterFormChildren", predicate: ["simpleFilterFromChild"], descendants: true }], ngImport: i0, template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"], components: [{ type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService"] }, { type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: ["items"] }, { type: i3.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"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
13831
13832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13832
13833
|
type: Component,
|
|
13833
|
-
args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <
|
|
13834
|
-
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }
|
|
13834
|
+
args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"] }]
|
|
13835
|
+
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
|
|
13835
13836
|
type: Input
|
|
13836
|
-
}],
|
|
13837
|
-
type:
|
|
13838
|
-
args: ['form'
|
|
13839
|
-
}],
|
|
13840
|
-
type:
|
|
13841
|
-
args: ['simpleFilterFromChild'
|
|
13837
|
+
}], formChildren: [{
|
|
13838
|
+
type: ViewChildren,
|
|
13839
|
+
args: ['form']
|
|
13840
|
+
}], simpleFilterFormChildren: [{
|
|
13841
|
+
type: ViewChildren,
|
|
13842
|
+
args: ['simpleFilterFromChild']
|
|
13842
13843
|
}] } });
|
|
13843
13844
|
|
|
13844
13845
|
class SmartFilterEditorModule {
|