@smartbit4all/ng-client 3.2.2 → 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 +53 -44
- 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 +66 -60
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +63 -59
- 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 +3 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.4.tgz +0 -0
- package/smartbit4all-ng-client-3.2.2.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) {
|
|
@@ -13614,19 +13609,43 @@ class SmartFilterEditorContentComponent {
|
|
|
13614
13609
|
this.expressionUiActionModels = [];
|
|
13615
13610
|
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13616
13611
|
}
|
|
13617
|
-
ngAfterViewInit() {
|
|
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
|
-
this.service.load();
|
|
13620
13641
|
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13642
|
+
this.service.load();
|
|
13621
13643
|
}
|
|
13622
13644
|
ngOnDestroy() {
|
|
13623
13645
|
this._destroy$.next();
|
|
13624
13646
|
this._destroy$.complete();
|
|
13625
13647
|
}
|
|
13626
13648
|
setupSimpleFilter() {
|
|
13627
|
-
if (this.simpleFilterForm) {
|
|
13628
|
-
return;
|
|
13629
|
-
}
|
|
13630
13649
|
let widgets = [];
|
|
13631
13650
|
let key;
|
|
13632
13651
|
let model = {};
|
|
@@ -13666,24 +13685,9 @@ class SmartFilterEditorContentComponent {
|
|
|
13666
13685
|
useOnBlurEvent: true,
|
|
13667
13686
|
widgets,
|
|
13668
13687
|
};
|
|
13669
|
-
if (this.smartFilterChangeSubscription) {
|
|
13670
|
-
this.smartFilterChangeSubscription.unsubscribe();
|
|
13671
|
-
}
|
|
13672
|
-
this.smartFilterChangeSubscription = this.simpleFilterFormChild.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13673
|
-
this.saveFilter();
|
|
13674
|
-
});
|
|
13675
|
-
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13676
|
-
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13677
|
-
}
|
|
13678
|
-
this.smartFilterSophisticatedChangeSubscription =
|
|
13679
|
-
this.simpleFilterFormChild.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13680
|
-
if (change.kind === 'selection') {
|
|
13681
|
-
this.saveFilter();
|
|
13682
|
-
}
|
|
13683
|
-
});
|
|
13684
13688
|
}
|
|
13685
13689
|
extractFilterFieldFromFormModel() {
|
|
13686
|
-
let simpleFilter = this.
|
|
13690
|
+
let simpleFilter = this.simpleFilterFormChildren?.first?.submitForm(false).componentModel.data;
|
|
13687
13691
|
let result = [];
|
|
13688
13692
|
Object.keys(simpleFilter).forEach((key) => {
|
|
13689
13693
|
result.push(simpleFilter[key]);
|
|
@@ -13746,24 +13750,24 @@ class SmartFilterEditorContentComponent {
|
|
|
13746
13750
|
if (this.smartformChangeSubscription) {
|
|
13747
13751
|
this.smartformChangeSubscription.unsubscribe();
|
|
13748
13752
|
}
|
|
13749
|
-
this.smartformChangeSubscription = this.formChild?.onBlurSubject
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
});
|
|
13754
|
-
if (this.smartformSophisticatedChangeSubscription) {
|
|
13755
|
-
|
|
13756
|
-
}
|
|
13757
|
-
this.smartformSophisticatedChangeSubscription = this.formChild?.sophisticatedValueChange
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
});
|
|
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
|
+
// });
|
|
13764
13768
|
}
|
|
13765
13769
|
save() {
|
|
13766
|
-
this.
|
|
13770
|
+
this.formChildren?.first?.submitForm(false);
|
|
13767
13771
|
this.service.peformWidgetAction({
|
|
13768
13772
|
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13769
13773
|
params: {
|
|
@@ -13824,17 +13828,17 @@ class SmartFilterEditorContentComponent {
|
|
|
13824
13828
|
}
|
|
13825
13829
|
}
|
|
13826
13830
|
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13827
|
-
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "
|
|
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"] }] });
|
|
13828
13832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13829
13833
|
type: Component,
|
|
13830
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"] }]
|
|
13831
13835
|
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
|
|
13832
13836
|
type: Input
|
|
13833
|
-
}],
|
|
13834
|
-
type:
|
|
13837
|
+
}], formChildren: [{
|
|
13838
|
+
type: ViewChildren,
|
|
13835
13839
|
args: ['form']
|
|
13836
|
-
}],
|
|
13837
|
-
type:
|
|
13840
|
+
}], simpleFilterFormChildren: [{
|
|
13841
|
+
type: ViewChildren,
|
|
13838
13842
|
args: ['simpleFilterFromChild']
|
|
13839
13843
|
}] } });
|
|
13840
13844
|
|