mmhglobal-dynamicform 2.27.0 → 2.28.0
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/README.md +5 -0
- package/esm2020/lib/services/main.service.mjs +11 -22
- package/esm2020/lib/uipage/uipage.component.mjs +4 -4
- package/esm2020/lib/zbuttons/zbuttons.component.mjs +6 -4
- package/esm2020/lib/zselectmultiple/zselectmultiple.component.mjs +8 -2
- package/esm2020/lib/zworkflowbuttons/zworkflowbuttons.component.mjs +9 -22
- package/fesm2015/mmhglobal-dynamicform.mjs +30 -47
- package/fesm2015/mmhglobal-dynamicform.mjs.map +1 -1
- package/fesm2020/mmhglobal-dynamicform.mjs +30 -46
- package/fesm2020/mmhglobal-dynamicform.mjs.map +1 -1
- package/lib/services/main.service.d.ts +3 -3
- package/lib/zselectmultiple/zselectmultiple.component.d.ts +1 -0
- package/lib/zworkflowbuttons/zworkflowbuttons.component.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { NavigationStart, NavigationEnd, NavigationError, RouterModule } from '@
|
|
|
6
6
|
import { BehaviorSubject, forkJoin, of, tap as tap$1, map as map$1, first, isObservable, switchMap as switchMap$1, interval, takeWhile, from, Subject, delay as delay$1, filter, auditTime } from 'rxjs';
|
|
7
7
|
import { tap, switchMap, map, take, delay, concatMap, ignoreElements } from 'rxjs/operators';
|
|
8
8
|
import * as i2 from 'mmhglobal-zcore';
|
|
9
|
-
import { ZGroup, FormType, ZComponentHelper, MESSAGETYPE, ActionType, DefaultMessage, DefaultDialogTitle, Delimiter, ZSelectPostApiParams, ComponentType as ComponentType$1, ZComponentProperties, SignalType, DropdownSearchOperator, InternalComponentType_DropDown, UploadMetaData, AttachmentConfig, DefaultPageSettingParams, ZCoreModule } from 'mmhglobal-zcore';
|
|
9
|
+
import { ZGroup, FormType, ZComponentHelper, MESSAGETYPE, ActionType, DefaultMessage, DefaultDialogTitle, TriggerFromType, Delimiter, ZSelectPostApiParams, ComponentType as ComponentType$1, ZComponentProperties, SignalType, DropdownSearchOperator, InternalComponentType_DropDown, UploadMetaData, AttachmentConfig, DefaultPageSettingParams, ZCoreModule } from 'mmhglobal-zcore';
|
|
10
10
|
import * as i2$1 from '@ionic/angular';
|
|
11
11
|
import { IonicModule } from '@ionic/angular';
|
|
12
12
|
import * as i3 from 'mmhglobal-zmodal';
|
|
@@ -828,8 +828,8 @@ class MainService {
|
|
|
828
828
|
getResourceServerData() {
|
|
829
829
|
return this.resourceApiService.loadData();
|
|
830
830
|
}
|
|
831
|
-
getGroupFields(fieldElementName, formType, group, propertyName) {
|
|
832
|
-
return this.fieldService.getFormFieldCode(fieldElementName, formType, group, propertyName);
|
|
831
|
+
getGroupFields(fieldElementName, formType, triggerFrom, group, propertyName) {
|
|
832
|
+
return this.fieldService.getFormFieldCode(fieldElementName, formType, group, propertyName, triggerFrom);
|
|
833
833
|
}
|
|
834
834
|
initializeGroup(group, ctrlName, pageName, me) {
|
|
835
835
|
if (me.subscription) {
|
|
@@ -839,7 +839,7 @@ class MainService {
|
|
|
839
839
|
group.resourceURLName = resourceName;
|
|
840
840
|
Object.assign(group, {
|
|
841
841
|
resourceURL: this.resourceApiService.getURL(resourceName),
|
|
842
|
-
gridColumnFields: this.fieldService.getFormFieldCode(ctrlName, "FormField"
|
|
842
|
+
gridColumnFields: this.fieldService.getFormFieldCode(ctrlName, "FormField"),
|
|
843
843
|
ctrlScope: me,
|
|
844
844
|
pageName,
|
|
845
845
|
ctrlName,
|
|
@@ -879,23 +879,12 @@ class MainService {
|
|
|
879
879
|
me.subscription = group.subject.subscribe((event) => this.subjectEvent(event, group, me));
|
|
880
880
|
return me.subscription;
|
|
881
881
|
}
|
|
882
|
-
getModel$(group, id) {
|
|
882
|
+
getModel$(group, id, triggerFrom) {
|
|
883
883
|
const recId = id || group.referenceId;
|
|
884
884
|
return this.webApiService
|
|
885
|
-
.httpGet$(group.resourceURL
|
|
885
|
+
.httpGet$(`${group.resourceURL}/${recId}`, null, { triggerFrom: triggerFrom })
|
|
886
886
|
.pipe(tap((zmodel) => {
|
|
887
887
|
group.zModel = zmodel;
|
|
888
|
-
//if (
|
|
889
|
-
// group.parentReferenceField &&
|
|
890
|
-
// Object.keys(zmodel).indexOf(group.parentReferenceField) !== -1 &&
|
|
891
|
-
// !group.backNavigationPage.endsWith(".edit")
|
|
892
|
-
//) {
|
|
893
|
-
// group.backNavigationPage =
|
|
894
|
-
// group.backNavigationPage +
|
|
895
|
-
// "/" +
|
|
896
|
-
// zmodel[group.parentReferenceField].toString() +
|
|
897
|
-
// "/edit";
|
|
898
|
-
//}
|
|
899
888
|
}), switchMap(() => {
|
|
900
889
|
if (group.afterGetModelSuccess) {
|
|
901
890
|
return this.afterGetModelSuccess(group);
|
|
@@ -1365,7 +1354,7 @@ class MainService {
|
|
|
1365
1354
|
}), switchMap(() => {
|
|
1366
1355
|
const newModel = Object.assign({}, group.zModel);
|
|
1367
1356
|
ZComponentHelper.removeNullFields(newModel);
|
|
1368
|
-
return this.webApiService.httpPost$(group.resourceURL, newModel).pipe(tap((resp) => {
|
|
1357
|
+
return this.webApiService.httpPost$(group.resourceURL, newModel, { buttonDetail: event, group: group, triggerFrom: event.triggerFrom }).pipe(tap((resp) => {
|
|
1369
1358
|
createModelres = resp;
|
|
1370
1359
|
return resp;
|
|
1371
1360
|
}), tap((res) => {
|
|
@@ -1411,7 +1400,7 @@ class MainService {
|
|
|
1411
1400
|
}
|
|
1412
1401
|
return of(false);
|
|
1413
1402
|
}
|
|
1414
|
-
updateAPIObservable = updateAPIObservable || this.webApiService.httpPut$(`${group.resourceURL}/${group.zModel.Id}`, group.zModel,
|
|
1403
|
+
updateAPIObservable = updateAPIObservable || this.webApiService.httpPut$(`${group.resourceURL}/${group.zModel.Id}`, group.zModel, { buttonDetail: event, group: group, triggerFrom: event.triggerFrom }).pipe(tap((res) => {
|
|
1415
1404
|
this.handleSuccess(res, resMessage);
|
|
1416
1405
|
}
|
|
1417
1406
|
//this.handleSuccess(res, "Record is updated successfully.")
|
|
@@ -1501,7 +1490,7 @@ class MainService {
|
|
|
1501
1490
|
group.zModel.Disabled = true;
|
|
1502
1491
|
let tempResponse = {};
|
|
1503
1492
|
return this.webApiService
|
|
1504
|
-
.httpPut$(group.resourceURL
|
|
1493
|
+
.httpPut$(`${group.resourceURL}/${group.zModel.Id}`, group.zModel, { buttonDetail: event, group: group, triggerFrom: event.triggerFrom })
|
|
1505
1494
|
.pipe(tap((res) => {
|
|
1506
1495
|
tempResponse = Object.assign({}, res);
|
|
1507
1496
|
this.handleSuccess(res, resMessage);
|
|
@@ -1795,7 +1784,7 @@ class MainService {
|
|
|
1795
1784
|
if (formId === respResult.Id?.toString() && eventName === window.location.href) {
|
|
1796
1785
|
if (respResult.UserName === this.authService.e1Token.myProfile.UserName) {
|
|
1797
1786
|
if (respResult.Action === ActionType.Update) {
|
|
1798
|
-
this.webApiService.httpGet$(`${this.group.resourceURL}/${formId}`, null).subscribe(resp => {
|
|
1787
|
+
this.webApiService.httpGet$(`${this.group.resourceURL}/${formId}`, null, { triggerFrom: TriggerFromType.signalRAlert }).subscribe(resp => {
|
|
1799
1788
|
this.reloadDataAndWorkflowButton(resp);
|
|
1800
1789
|
});
|
|
1801
1790
|
}
|
|
@@ -4004,7 +3993,7 @@ class UipageComponent {
|
|
|
4004
3993
|
const fieldElementName = this.group.fieldName ? this.group.fieldName : ctrlName;
|
|
4005
3994
|
this.group.fieldName = fieldElementName; // to be decprecated
|
|
4006
3995
|
this.group.fieldElementName = fieldElementName;
|
|
4007
|
-
return this.mainService.getGroupFields(fieldElementName, formType, this.group, "fields");
|
|
3996
|
+
return this.mainService.getGroupFields(fieldElementName, formType, TriggerFromType.initialPageLoad, this.group, "fields");
|
|
4008
3997
|
//let formFieldName = this.group.fieldName ? this.group.fieldName : ctrlName;
|
|
4009
3998
|
//this.group.fieldName = formFieldName;
|
|
4010
3999
|
//if(UipageComponent.signalrEventSubscription){
|
|
@@ -4049,7 +4038,7 @@ class UipageComponent {
|
|
|
4049
4038
|
return this.group.getModel(this.group, this.group.referenceId);
|
|
4050
4039
|
}
|
|
4051
4040
|
else {
|
|
4052
|
-
return this.mainService.getModel$(this.group, this.group.referenceId);
|
|
4041
|
+
return this.mainService.getModel$(this.group, this.group.referenceId, TriggerFromType.initialPageLoad);
|
|
4053
4042
|
}
|
|
4054
4043
|
}
|
|
4055
4044
|
else {
|
|
@@ -5303,7 +5292,7 @@ class ZbuttonsComponent extends ButtonFieldBase {
|
|
|
5303
5292
|
this.componentService.decrementComponentCounterForField(this.data);
|
|
5304
5293
|
}
|
|
5305
5294
|
loadButton() {
|
|
5306
|
-
const field$ = this.fieldService.getFormFieldCode(this.data.Value, "FormField"
|
|
5295
|
+
const field$ = this.fieldService.getFormFieldCode(this.data.Value, "FormField");
|
|
5307
5296
|
this.group.zButtonsCount++;
|
|
5308
5297
|
if (this.group.zButtonsCount === 1) {
|
|
5309
5298
|
this.FirstZbtn = true;
|
|
@@ -5354,6 +5343,7 @@ class ZbuttonsComponent extends ButtonFieldBase {
|
|
|
5354
5343
|
SubType: this.data.SubType,
|
|
5355
5344
|
Type: button.Type,
|
|
5356
5345
|
buttonData: button,
|
|
5346
|
+
eventId: ZComponentHelper.generateTimeStampId()
|
|
5357
5347
|
};
|
|
5358
5348
|
}
|
|
5359
5349
|
if (button['PositionX'] && button['PositionX'] === "right") {
|
|
@@ -5378,7 +5368,8 @@ class ZbuttonsComponent extends ButtonFieldBase {
|
|
|
5378
5368
|
this.group.subject.next({
|
|
5379
5369
|
type: "buttonClick",
|
|
5380
5370
|
target: item.clickEvent,
|
|
5381
|
-
data: item
|
|
5371
|
+
data: item,
|
|
5372
|
+
triggerFrom: TriggerFromType.button
|
|
5382
5373
|
});
|
|
5383
5374
|
}
|
|
5384
5375
|
getButtonDisableTriggerValue(data, button) {
|
|
@@ -6852,13 +6843,13 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6852
6843
|
if (this.group.resourceURL) {
|
|
6853
6844
|
this.isLocalHostAPI = this.group.resourceURL.toLowerCase().includes("localhost") ? true : false;
|
|
6854
6845
|
}
|
|
6855
|
-
this.loadButton();
|
|
6846
|
+
this.loadButton(TriggerFromType.initialPageLoad);
|
|
6856
6847
|
});
|
|
6857
6848
|
}
|
|
6858
6849
|
ngAfterViewInit() {
|
|
6859
6850
|
this.componentService.decrementComponentCounterForField(this.data);
|
|
6860
6851
|
}
|
|
6861
|
-
loadButton() {
|
|
6852
|
+
loadButton(triggerFrom) {
|
|
6862
6853
|
this.leftBtns = [];
|
|
6863
6854
|
this.rightBtns = [];
|
|
6864
6855
|
this.items = [];
|
|
@@ -6872,7 +6863,7 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6872
6863
|
try {
|
|
6873
6864
|
of(true).pipe(concatMap(() => {
|
|
6874
6865
|
// retrieve the workflow button
|
|
6875
|
-
return this.workflowService.getWorkflowButtonsField(this.data.WorkflowCode, this.e1wfs_wfcGetWorkflowButtonURL, String(this.isLocalHostAPI));
|
|
6866
|
+
return this.workflowService.getWorkflowButtonsField(this.data.WorkflowCode, this.e1wfs_wfcGetWorkflowButtonURL, String(this.isLocalHostAPI), triggerFrom);
|
|
6876
6867
|
}), tap(resultData => {
|
|
6877
6868
|
if (resultData) {
|
|
6878
6869
|
resultData.forEach((button) => {
|
|
@@ -6908,7 +6899,7 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6908
6899
|
this.items.push(...this.leftBtns, ...this.rightBtns);
|
|
6909
6900
|
}
|
|
6910
6901
|
else {
|
|
6911
|
-
console.warn(
|
|
6902
|
+
console.warn(`Unable to get workflow button. Data returned null.`);
|
|
6912
6903
|
}
|
|
6913
6904
|
}), switchMap(() => {
|
|
6914
6905
|
return super.translateButtonsLabel(this.items);
|
|
@@ -6955,19 +6946,6 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6955
6946
|
const formGroup = this.group.form;
|
|
6956
6947
|
const attributes = JSON.parse(button.Attributes);
|
|
6957
6948
|
const buttonTypeCode = button.TypeCode.toUpperCase();
|
|
6958
|
-
//// Skip if the button's click event includes backnavigation
|
|
6959
|
-
//if (buttonTypeCode === 'GOTO') {
|
|
6960
|
-
// // Check if the form has unsaved changes
|
|
6961
|
-
// if (!this.data.SkipCheckFormDirty && !formGroup.dirty) {
|
|
6962
|
-
// console.warn(`Record not saved because the form is not dirty.`);
|
|
6963
|
-
// return;
|
|
6964
|
-
// }
|
|
6965
|
-
// // Check if the form is valid
|
|
6966
|
-
// if (this.data.UseDefaultValidate && !formGroup.valid) {
|
|
6967
|
-
// this.componentErrorHandlerService.showFormGroupErrorMessage(this.group, formGroup);
|
|
6968
|
-
// return;
|
|
6969
|
-
// }
|
|
6970
|
-
//}
|
|
6971
6949
|
// Type 1 == functional;
|
|
6972
6950
|
// Type 2 == GOTO;
|
|
6973
6951
|
this.group.isTriggered = button.disableTrigger != undefined ? !button.disableTrigger : true;
|
|
@@ -6977,11 +6955,10 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6977
6955
|
if (!this.group.isTriggered) {
|
|
6978
6956
|
return;
|
|
6979
6957
|
}
|
|
6980
|
-
const group = this.group;
|
|
6981
6958
|
// Disable trigger timer
|
|
6982
6959
|
if (!attributes['DisableTriggerTimer']) {
|
|
6983
6960
|
setTimeout(function () {
|
|
6984
|
-
group['isTriggered'] = false;
|
|
6961
|
+
this.group['isTriggered'] = false;
|
|
6985
6962
|
}, 500);
|
|
6986
6963
|
}
|
|
6987
6964
|
console.log("Functional Button: ", button.Name);
|
|
@@ -6993,7 +6970,7 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
6993
6970
|
// Call the workflow service to handle the GOTO button click event
|
|
6994
6971
|
this.workflowService.gotoButton_Onclick(button, this.data, attributes, this.group, this.isLocalHostAPI).subscribe(res => {
|
|
6995
6972
|
// Reload the button
|
|
6996
|
-
this.loadButton();
|
|
6973
|
+
this.loadButton(TriggerFromType.goToButton);
|
|
6997
6974
|
// Reset trigger status
|
|
6998
6975
|
this.group.isTriggered = false;
|
|
6999
6976
|
if (res) {
|
|
@@ -7017,6 +6994,7 @@ class ZworkflowbuttonsComponent extends ButtonFieldBase {
|
|
|
7017
6994
|
};
|
|
7018
6995
|
const newButton = {
|
|
7019
6996
|
...button,
|
|
6997
|
+
eventId: ZComponentHelper.generateTimeStampId(),
|
|
7020
6998
|
Attributes: JSON.stringify(newAttributes),
|
|
7021
6999
|
disableTrigger: this.isButtonDisableTrigger(this.data, button),
|
|
7022
7000
|
};
|
|
@@ -7215,6 +7193,7 @@ class ZselectmultipleComponent extends InputFieldBase {
|
|
|
7215
7193
|
this.itemDataField = null;
|
|
7216
7194
|
this.itemTemplate = "{{item[itemTextField]}}";
|
|
7217
7195
|
this.infiniteScrollPageNo = 0;
|
|
7196
|
+
this.infiniteDataLoaded = false;
|
|
7218
7197
|
this.isLoading = true;
|
|
7219
7198
|
this.allowCustomValue = false;
|
|
7220
7199
|
this.autoClose = true;
|
|
@@ -7432,6 +7411,8 @@ class ZselectmultipleComponent extends InputFieldBase {
|
|
|
7432
7411
|
this.infiniteScrollPageNo = 0;
|
|
7433
7412
|
this.modelzData = [];
|
|
7434
7413
|
}
|
|
7414
|
+
this.infiniteDataLoaded = false;
|
|
7415
|
+
ZComponentHelper.cancelGetInfiniteData;
|
|
7435
7416
|
this.getInfiniteData(event);
|
|
7436
7417
|
}
|
|
7437
7418
|
else {
|
|
@@ -7529,7 +7510,10 @@ class ZselectmultipleComponent extends InputFieldBase {
|
|
|
7529
7510
|
}
|
|
7530
7511
|
handleOpen(event) {
|
|
7531
7512
|
if (this.data.HasInfiniteScroll) {
|
|
7532
|
-
this.
|
|
7513
|
+
if (!this.infiniteDataLoaded) {
|
|
7514
|
+
this.infiniteDataLoaded = true;
|
|
7515
|
+
this.handleFilter(null);
|
|
7516
|
+
}
|
|
7533
7517
|
}
|
|
7534
7518
|
// Ensure multiselect value meets the search length requirement
|
|
7535
7519
|
if (this.multiselect && this.data.SearchLength && this.multiselect.value.length < this.data.SearchLength) {
|