@smartbit4all/ng-client 3.1.99 → 3.2.1
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 +26 -26
- package/esm2020/lib/smart-form/services/smartform.service.mjs +20 -10
- package/fesm2015/smartbit4all-ng-client.mjs +45 -30
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +43 -33
- 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/lib/smart-form/services/smartform.service.d.ts +1 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.1.tgz +0 -0
- package/smartbit4all-ng-client-3.1.99.tgz +0 -0
|
@@ -3814,13 +3814,18 @@ class SmartFormService {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
toFormGroup() {
|
|
3816
3816
|
this.createFormControls(this.smartForm.widgets);
|
|
3817
|
-
|
|
3817
|
+
if (this.formGroup) {
|
|
3818
|
+
this.formGroup.controls = this.group;
|
|
3819
|
+
}
|
|
3820
|
+
else {
|
|
3821
|
+
this.formGroup = new FormGroup(this.group);
|
|
3822
|
+
}
|
|
3818
3823
|
if (this.smartForm.validators && this.smartForm.validators.length) {
|
|
3819
|
-
formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3824
|
+
this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3820
3825
|
return validator.validator;
|
|
3821
3826
|
}));
|
|
3822
3827
|
}
|
|
3823
|
-
return formGroup;
|
|
3828
|
+
return this.formGroup;
|
|
3824
3829
|
}
|
|
3825
3830
|
createFormControls(widgets, parentKey) {
|
|
3826
3831
|
widgets.map((widget) => {
|
|
@@ -3837,13 +3842,18 @@ class SmartFormService {
|
|
|
3837
3842
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
3838
3843
|
widget.type !== SmartFormWidgetType.MATRIX &&
|
|
3839
3844
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
3840
|
-
let formControl =
|
|
3841
|
-
|
|
3842
|
-
}
|
|
3843
|
-
|
|
3844
|
-
formControl.
|
|
3845
|
+
let formControl = this.group[`${widget.key}`];
|
|
3846
|
+
if (formControl) {
|
|
3847
|
+
}
|
|
3848
|
+
else {
|
|
3849
|
+
formControl = new FormControl(widget.value || '', (_a = widget.validators) === null || _a === void 0 ? void 0 : _a.map((validator) => {
|
|
3850
|
+
return validator.validator;
|
|
3851
|
+
}));
|
|
3852
|
+
if (widget.isDisabled) {
|
|
3853
|
+
formControl.disable();
|
|
3854
|
+
}
|
|
3855
|
+
this.group[`${widget.key}`] = formControl;
|
|
3845
3856
|
}
|
|
3846
|
-
this.group[`${widget.key}`] = formControl;
|
|
3847
3857
|
}
|
|
3848
3858
|
if (widget.type === SmartFormWidgetType.MATRIX) {
|
|
3849
3859
|
if (widget.isMultiple) {
|
|
@@ -13743,19 +13753,37 @@ class SmartFilterEditorContentComponent {
|
|
|
13743
13753
|
this.expressionUiActionModels = [];
|
|
13744
13754
|
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13745
13755
|
}
|
|
13746
|
-
|
|
13756
|
+
ngAfterViewInit() {
|
|
13757
|
+
var _a, _b;
|
|
13758
|
+
if (this.smartFilterChangeSubscription) {
|
|
13759
|
+
this.smartFilterChangeSubscription.unsubscribe();
|
|
13760
|
+
}
|
|
13761
|
+
this.smartFilterChangeSubscription = (_a = this.simpleFilterFormChild.onBlurSubject) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13762
|
+
this.saveFilter();
|
|
13763
|
+
});
|
|
13764
|
+
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13765
|
+
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13766
|
+
}
|
|
13767
|
+
this.smartFilterSophisticatedChangeSubscription =
|
|
13768
|
+
(_b = this.simpleFilterFormChild.sophisticatedValueChange) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13769
|
+
if (change.kind === 'selection') {
|
|
13770
|
+
this.saveFilter();
|
|
13771
|
+
}
|
|
13772
|
+
});
|
|
13773
|
+
}
|
|
13747
13774
|
ngOnInit() {
|
|
13748
13775
|
this.service.load();
|
|
13749
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() =>
|
|
13750
|
-
this.setUp();
|
|
13751
|
-
});
|
|
13776
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13752
13777
|
}
|
|
13753
13778
|
ngOnDestroy() {
|
|
13754
13779
|
this._destroy$.next();
|
|
13755
13780
|
this._destroy$.complete();
|
|
13756
13781
|
}
|
|
13757
13782
|
setupSimpleFilter() {
|
|
13758
|
-
var _a, _b, _c
|
|
13783
|
+
var _a, _b, _c;
|
|
13784
|
+
if (this.simpleFilterForm) {
|
|
13785
|
+
return;
|
|
13786
|
+
}
|
|
13759
13787
|
let widgets = [];
|
|
13760
13788
|
let key;
|
|
13761
13789
|
let model = {};
|
|
@@ -13796,22 +13824,6 @@ class SmartFilterEditorContentComponent {
|
|
|
13796
13824
|
useOnBlurEvent: true,
|
|
13797
13825
|
widgets,
|
|
13798
13826
|
};
|
|
13799
|
-
if (this.smartFilterChangeSubscription) {
|
|
13800
|
-
this.smartFilterChangeSubscription.unsubscribe();
|
|
13801
|
-
}
|
|
13802
|
-
this.smartFilterChangeSubscription = (_e = (_d = this.simpleFilterFormChild) === null || _d === void 0 ? void 0 : _d.onBlurSubject) === null || _e === void 0 ? void 0 : _e.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13803
|
-
this.saveFilter();
|
|
13804
|
-
});
|
|
13805
|
-
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13806
|
-
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13807
|
-
}
|
|
13808
|
-
this.smartFilterSophisticatedChangeSubscription =
|
|
13809
|
-
(_g = (_f = this.simpleFilterFormChild) === null || _f === void 0 ? void 0 : _f.sophisticatedValueChange) === null || _g === void 0 ? void 0 : _g.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13810
|
-
if (change.kind === 'selection') {
|
|
13811
|
-
console.log(change);
|
|
13812
|
-
this.saveFilter();
|
|
13813
|
-
}
|
|
13814
|
-
});
|
|
13815
13827
|
}
|
|
13816
13828
|
extractFilterFieldFromFormModel() {
|
|
13817
13829
|
var _a;
|
|
@@ -13866,6 +13878,9 @@ class SmartFilterEditorContentComponent {
|
|
|
13866
13878
|
}
|
|
13867
13879
|
constructForm() {
|
|
13868
13880
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13881
|
+
if (this.smartForm) {
|
|
13882
|
+
return;
|
|
13883
|
+
}
|
|
13869
13884
|
let generatedWidgets = this.layoutService.render({
|
|
13870
13885
|
layoutDefinitions: (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedFieldEditor) === null || _b === void 0 ? void 0 : _b.layoutDef) === null || _c === void 0 ? void 0 : _c.widgets,
|
|
13871
13886
|
});
|