mmhglobal-dynamicform 2.24.1 → 2.24.3

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.
@@ -1335,6 +1335,7 @@ class MainService {
1335
1335
  });
1336
1336
  }
1337
1337
  if (group.isCloneNew) {
1338
+ this.reloadAllWorkflowButtonList(group);
1338
1339
  this.afterCloneNewModel(group, group.zModel);
1339
1340
  }
1340
1341
  else {
@@ -1343,6 +1344,17 @@ class MainService {
1343
1344
  }
1344
1345
  })).subscribe();
1345
1346
  }
1347
+ reloadAllWorkflowButtonList(group) {
1348
+ const workflowButtonList = Object.keys(group.zComponents)
1349
+ .filter(key => key.startsWith('zworkflowbuttons_'))
1350
+ .reduce((obj, key) => {
1351
+ obj[key] = group.zComponents[key];
1352
+ return obj;
1353
+ }, {});
1354
+ Object.values(workflowButtonList).forEach(value => {
1355
+ value['loadButton']();
1356
+ });
1357
+ }
1346
1358
  createModel(event, group) {
1347
1359
  const fg = group.form;
1348
1360
  const resMessage = group.SuccessCreatedMessage || DefaultMessage.recordCreated;
@@ -7476,18 +7488,19 @@ class ZselectmultipleComponent extends InputFieldBase {
7476
7488
  }
7477
7489
  }
7478
7490
  handleFilter(searchTerm, justOneTime) {
7479
- if (this.multiselect) {
7491
+ if (this.multiselect && this.data.SearchLength) {
7480
7492
  const meetsLengthCondition = this.data.SearchLength && this.data.SearchLength <= searchTerm.length;
7481
7493
  this.multiselect.toggle(meetsLengthCondition);
7482
7494
  }
7483
7495
  const searchBy = this.data.SearchFields ?? this.itemTextField;
7484
7496
  const itemsData = this.getItemsData();
7485
- this.checkAllowCustomValue(searchBy, searchTerm, itemsData);
7497
+ if (this.data.AllowCustomValue) {
7498
+ this.checkAllowCustomValue(searchBy, searchTerm, itemsData);
7499
+ }
7486
7500
  if (this.debounceSub) {
7487
7501
  this.debounceSub.unsubscribe();
7488
7502
  }
7489
- const searchSubscription = of([]).pipe(tap(() => (this.isLoading = true)), delay(500), tap(() => this.performSearch(searchTerm)), tap(() => (this.isLoading = false))).subscribe();
7490
- this.debounceSub = searchSubscription;
7503
+ this.debounceSub = of([]).pipe(tap(() => (this.isLoading = true)), delay(500), tap(() => this.performSearch(searchTerm)), tap(() => (this.isLoading = false))).subscribe();
7491
7504
  }
7492
7505
  performSearch(value) {
7493
7506
  const searchAction = () => {
@@ -10086,6 +10099,9 @@ class ZmfbComponent extends ButtonFieldBase {
10086
10099
  // handle as zWorkflowButton
10087
10100
  this.isWorkflowButton = true;
10088
10101
  this.loadWorkflowButton();
10102
+ //Object.assign(this.group, {
10103
+ // zmfbLinked: `${this.data.Type}_${this.data.Name}`
10104
+ //});
10089
10105
  }
10090
10106
  else {
10091
10107
  const field$ = this.fieldService.getFormFieldCode(this.buttonField.Value, "FormField");
@@ -10098,8 +10114,8 @@ class ZmfbComponent extends ButtonFieldBase {
10098
10114
  this.items.push({
10099
10115
  label: label,
10100
10116
  icon: ZComponentHelper.getIcon(button.Icon),
10101
- 'clickEvent': button.ClickEvent,
10102
- 'click': (y) => {
10117
+ clickEvent: button.ClickEvent,
10118
+ click: (y) => {
10103
10119
  this.buttonClick(button);
10104
10120
  }
10105
10121
  });
@@ -10178,6 +10194,10 @@ class ZmfbComponent extends ButtonFieldBase {
10178
10194
  console.log("GOTO Button: ", button.Name);
10179
10195
  this.workflowService.gotoButton_Onclick(button, this.buttonField, attributes, this.group, false).subscribe(res => {
10180
10196
  this.loadWorkflowButton();
10197
+ // Require to refresh the firstzBtn
10198
+ const mainButtonName = `${this.buttonField.Type}_${this.buttonField.Name}`;
10199
+ const mainButton = ZComponentHelper.getComponent(this.group, mainButtonName);
10200
+ mainButton['loadButton']();
10181
10201
  if (res) {
10182
10202
  this.workflowService.triggerSendEmail(this.group).subscribe();
10183
10203
  }