@smartbit4all/ng-client 3.1.79 → 3.1.80
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-client/smart-component-api-client.mjs +63 -25
- package/esm2020/lib/smart-client/smart.component.mjs +26 -5
- package/esm2020/lib/smart-client/smart.service.mjs +25 -4
- package/fesm2015/smartbit4all-ng-client.mjs +104 -29
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +101 -27
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +7 -1
- package/lib/smart-client/smart.component.d.ts +10 -1
- package/lib/smart-client/smart.service.d.ts +10 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.1.80.tgz +0 -0
- package/smartbit4all-ng-client-3.1.79.tgz +0 -0
|
@@ -13515,6 +13515,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13515
13515
|
// Contained Widgets
|
|
13516
13516
|
this.widgets = new WidgetMap();
|
|
13517
13517
|
this.formWidgets = new WidgetMap();
|
|
13518
|
+
this.useQueryLists = false;
|
|
13518
13519
|
this.detectChange.subscribe((change) => {
|
|
13519
13520
|
this.handleChanges(change);
|
|
13520
13521
|
});
|
|
@@ -13536,7 +13537,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13536
13537
|
}
|
|
13537
13538
|
this._uuid = uuid;
|
|
13538
13539
|
if (uuid) {
|
|
13539
|
-
this.
|
|
13540
|
+
this.getWidgets().widgets.forEach((ref, key) => {
|
|
13540
13541
|
if (ref instanceof SmartGridComponent) {
|
|
13541
13542
|
ref.uuid = uuid;
|
|
13542
13543
|
}
|
|
@@ -13588,6 +13589,23 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13588
13589
|
this._destroy$.next();
|
|
13589
13590
|
this._destroy$.complete();
|
|
13590
13591
|
}
|
|
13592
|
+
getWidgets() {
|
|
13593
|
+
if (this.useQueryLists) {
|
|
13594
|
+
let widgets = new WidgetMap();
|
|
13595
|
+
if (this.getAllGridComponents()) {
|
|
13596
|
+
this.getAllGridComponents()
|
|
13597
|
+
.filter((grid) => { var _a; return (((_a = grid === null || grid === void 0 ? void 0 : grid.smartGrid) === null || _a === void 0 ? void 0 : _a.gridIdentifier) ? true : false); })
|
|
13598
|
+
.forEach((grid) => widgets.addWidget(grid.smartGrid.gridIdentifier, grid));
|
|
13599
|
+
}
|
|
13600
|
+
if (this.getAllTreeComponents()) {
|
|
13601
|
+
this.getAllTreeComponents()
|
|
13602
|
+
.filter((tree) => { var _a; return (((_a = tree === null || tree === void 0 ? void 0 : tree.smartTreeModel) === null || _a === void 0 ? void 0 : _a.identifier) ? true : false); })
|
|
13603
|
+
.forEach((tree) => widgets.addWidget(tree.smartTreeModel.identifier, tree));
|
|
13604
|
+
}
|
|
13605
|
+
return widgets;
|
|
13606
|
+
}
|
|
13607
|
+
return this.widgets;
|
|
13608
|
+
}
|
|
13591
13609
|
initComponentByModel() {
|
|
13592
13610
|
this.initData();
|
|
13593
13611
|
this.initActions();
|
|
@@ -13637,20 +13655,26 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13637
13655
|
});
|
|
13638
13656
|
}
|
|
13639
13657
|
getInvalidFields() {
|
|
13640
|
-
var _a;
|
|
13658
|
+
var _a, _b, _c;
|
|
13641
13659
|
let aggregatedInvalidFields = {
|
|
13642
13660
|
invalidFieldKeys: [],
|
|
13643
13661
|
invalidFieldNames: [],
|
|
13644
13662
|
};
|
|
13645
|
-
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
}
|
|
13663
|
+
if (this.useQueryLists) {
|
|
13664
|
+
(_a = this.getAllFormComponents()) === null || _a === void 0 ? void 0 : _a.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
|
|
13665
|
+
}
|
|
13666
|
+
else {
|
|
13667
|
+
(_c = (_b = this.formWidgets) === null || _b === void 0 ? void 0 : _b.widgets) === null || _c === void 0 ? void 0 : _c.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
|
|
13651
13668
|
}
|
|
13652
13669
|
return aggregatedInvalidFields;
|
|
13653
13670
|
}
|
|
13671
|
+
validateForm(form, aggregatedInvalidFields) {
|
|
13672
|
+
let invalidFieldsOfForm = form === null || form === void 0 ? void 0 : form.getInvalidFields();
|
|
13673
|
+
if (invalidFieldsOfForm) {
|
|
13674
|
+
invalidFieldsOfForm.invalidFieldKeys.forEach((key) => aggregatedInvalidFields.invalidFieldKeys.push(key));
|
|
13675
|
+
invalidFieldsOfForm.invalidFieldNames.forEach((key) => aggregatedInvalidFields.invalidFieldNames.push(key));
|
|
13676
|
+
}
|
|
13677
|
+
}
|
|
13654
13678
|
//#region UseUiAction
|
|
13655
13679
|
getAdditionalParams(uiAction) {
|
|
13656
13680
|
return {
|
|
@@ -13711,10 +13735,13 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13711
13735
|
* Submits all the registered forms in the SmartComponent
|
|
13712
13736
|
*/
|
|
13713
13737
|
submitForms(validate) {
|
|
13714
|
-
var _a, _b;
|
|
13715
|
-
|
|
13716
|
-
form === null || form === void 0 ? void 0 : form.submitForm(validate);
|
|
13717
|
-
}
|
|
13738
|
+
var _a, _b, _c;
|
|
13739
|
+
if (this.useQueryLists) {
|
|
13740
|
+
(_a = this.getAllFormComponents()) === null || _a === void 0 ? void 0 : _a.forEach((form) => form === null || form === void 0 ? void 0 : form.submitForm(validate));
|
|
13741
|
+
}
|
|
13742
|
+
else {
|
|
13743
|
+
(_c = (_b = this.formWidgets) === null || _b === void 0 ? void 0 : _b.widgets) === null || _c === void 0 ? void 0 : _c.forEach((form) => form === null || form === void 0 ? void 0 : form.submitForm(validate));
|
|
13744
|
+
}
|
|
13718
13745
|
}
|
|
13719
13746
|
addGrid(smartGrid, options, useAsDefaultGrid, componentReference) {
|
|
13720
13747
|
smartGrid.options = options;
|
|
@@ -13722,7 +13749,9 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13722
13749
|
smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
|
|
13723
13750
|
smartGrid.serviceToUse = this;
|
|
13724
13751
|
smartGrid.viewContextService = this.viewContext;
|
|
13725
|
-
this.
|
|
13752
|
+
if (!this.useQueryLists) {
|
|
13753
|
+
this.widgets.addWidget(smartGrid.gridIdentifier, componentReference);
|
|
13754
|
+
}
|
|
13726
13755
|
if (useAsDefaultGrid) {
|
|
13727
13756
|
this.smartGrid = smartGrid;
|
|
13728
13757
|
return this.smartGrid;
|
|
@@ -13730,7 +13759,9 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13730
13759
|
return smartGrid;
|
|
13731
13760
|
}
|
|
13732
13761
|
addForm(smartFormId, smartForm, componentReference) {
|
|
13733
|
-
this.
|
|
13762
|
+
if (!this.useQueryLists) {
|
|
13763
|
+
this.formWidgets.addWidget(smartFormId, componentReference);
|
|
13764
|
+
}
|
|
13734
13765
|
// if (this.sendDataChanges && componentReference) {
|
|
13735
13766
|
// smartForm.useOnValueChangeEvent = true;
|
|
13736
13767
|
// componentReference.sophisticatedValueChange
|
|
@@ -13742,12 +13773,13 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13742
13773
|
return smartForm;
|
|
13743
13774
|
}
|
|
13744
13775
|
setUpDefaultTree(treeId) {
|
|
13745
|
-
this.smartTreeService =
|
|
13746
|
-
this.widgets.addWidget(treeId, this.smartTreeService);
|
|
13776
|
+
this.smartTreeService = this.createTreeService(treeId);
|
|
13747
13777
|
}
|
|
13748
13778
|
createTreeService(treeId) {
|
|
13749
13779
|
const treeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
|
|
13750
|
-
this.
|
|
13780
|
+
if (!this.useQueryLists) {
|
|
13781
|
+
this.widgets.addWidget(treeId, treeService);
|
|
13782
|
+
}
|
|
13751
13783
|
return treeService;
|
|
13752
13784
|
}
|
|
13753
13785
|
addFileUploader(uiActionCode, fileFormats, maxSizeMb, isMultiple) {
|
|
@@ -13827,8 +13859,9 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13827
13859
|
}
|
|
13828
13860
|
}
|
|
13829
13861
|
handleChangeWidgets(changedWidgets) {
|
|
13862
|
+
let widgets = this.getWidgets();
|
|
13830
13863
|
changedWidgets.forEach((key) => {
|
|
13831
|
-
const reference =
|
|
13864
|
+
const reference = widgets.get(key);
|
|
13832
13865
|
if (reference instanceof SmartGridComponent) {
|
|
13833
13866
|
reference.refresh();
|
|
13834
13867
|
}
|
|
@@ -13863,15 +13896,21 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
13863
13896
|
}
|
|
13864
13897
|
}
|
|
13865
13898
|
handleDataChange(changes, changeKey) {
|
|
13899
|
+
var _a;
|
|
13866
13900
|
this.setValueDeeply(this.model, changeKey, changes[changeKey]);
|
|
13867
|
-
this.
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
formComponent
|
|
13873
|
-
|
|
13874
|
-
|
|
13901
|
+
if (this.useQueryLists) {
|
|
13902
|
+
(_a = this.getAllFormComponents()) === null || _a === void 0 ? void 0 : _a.forEach((form) => form.refresh());
|
|
13903
|
+
}
|
|
13904
|
+
else {
|
|
13905
|
+
this.formWidgets.widgets.forEach((formComponent, key) => {
|
|
13906
|
+
if (formComponent === undefined) {
|
|
13907
|
+
console.error(`Provided form reference for ${key} is undefined.`);
|
|
13908
|
+
}
|
|
13909
|
+
else {
|
|
13910
|
+
formComponent.refresh();
|
|
13911
|
+
}
|
|
13912
|
+
});
|
|
13913
|
+
}
|
|
13875
13914
|
}
|
|
13876
13915
|
handleLayoutChange(changes, changeKey) {
|
|
13877
13916
|
let layoutKey = changeKey.split('.')[1];
|
|
@@ -13931,9 +13970,18 @@ class SmartComponent extends SmartComponentApiClient {
|
|
|
13931
13970
|
ngOnDestroy() {
|
|
13932
13971
|
this._ngOnDestroy();
|
|
13933
13972
|
}
|
|
13973
|
+
getAllFormComponents() {
|
|
13974
|
+
return this.formComponents;
|
|
13975
|
+
}
|
|
13976
|
+
getAllGridComponents() {
|
|
13977
|
+
return this.gridComponents;
|
|
13978
|
+
}
|
|
13979
|
+
getAllTreeComponents() {
|
|
13980
|
+
return this.treeComponents;
|
|
13981
|
+
}
|
|
13934
13982
|
}
|
|
13935
13983
|
SmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Component });
|
|
13936
|
-
SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
13984
|
+
SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", viewQueries: [{ propertyName: "formComponents", predicate: SmartformComponent, descendants: true }, { propertyName: "gridComponents", predicate: SmartGridComponent, descendants: true }, { propertyName: "treeComponents", predicate: SmarttreeGenericService, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
13937
13985
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, decorators: [{
|
|
13938
13986
|
type: Component,
|
|
13939
13987
|
args: [{
|
|
@@ -13947,7 +13995,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13947
13995
|
type: Inject,
|
|
13948
13996
|
args: ['pageName']
|
|
13949
13997
|
}] }];
|
|
13950
|
-
}
|
|
13998
|
+
}, propDecorators: { formComponents: [{
|
|
13999
|
+
type: ViewChildren,
|
|
14000
|
+
args: [SmartformComponent]
|
|
14001
|
+
}], gridComponents: [{
|
|
14002
|
+
type: ViewChildren,
|
|
14003
|
+
args: [SmartGridComponent]
|
|
14004
|
+
}], treeComponents: [{
|
|
14005
|
+
type: ViewChildren,
|
|
14006
|
+
args: [SmarttreeGenericService]
|
|
14007
|
+
}] } });
|
|
13951
14008
|
|
|
13952
14009
|
class SmartService extends SmartComponentApiClient {
|
|
13953
14010
|
constructor(inject, auth, pageName) {
|
|
@@ -13959,6 +14016,15 @@ class SmartService extends SmartComponentApiClient {
|
|
|
13959
14016
|
ngOnDestroy() {
|
|
13960
14017
|
this._ngOnDestroy();
|
|
13961
14018
|
}
|
|
14019
|
+
getAllFormComponents() {
|
|
14020
|
+
return this.formComponents;
|
|
14021
|
+
}
|
|
14022
|
+
getAllGridComponents() {
|
|
14023
|
+
return this.gridComponents;
|
|
14024
|
+
}
|
|
14025
|
+
getAllTreeComponents() {
|
|
14026
|
+
return this.treeComponents;
|
|
14027
|
+
}
|
|
13962
14028
|
}
|
|
13963
14029
|
SmartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13964
14030
|
SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, providedIn: 'root' });
|
|
@@ -13975,7 +14041,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13975
14041
|
type: Inject,
|
|
13976
14042
|
args: ['pageName']
|
|
13977
14043
|
}] }];
|
|
13978
|
-
}
|
|
14044
|
+
}, propDecorators: { formComponents: [{
|
|
14045
|
+
type: ViewChildren,
|
|
14046
|
+
args: [SmartformComponent]
|
|
14047
|
+
}], gridComponents: [{
|
|
14048
|
+
type: ViewChildren,
|
|
14049
|
+
args: [SmartGridComponent]
|
|
14050
|
+
}], treeComponents: [{
|
|
14051
|
+
type: ViewChildren,
|
|
14052
|
+
args: [SmarttreeGenericService]
|
|
14053
|
+
}] } });
|
|
13979
14054
|
|
|
13980
14055
|
class SmartComponentLayoutUtility {
|
|
13981
14056
|
static setParent(layout, parent) {
|