mmhglobal-dynamicform 1.1.38 → 1.1.41

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 CHANGED
@@ -3,40 +3,50 @@
3
3
  This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.13.
4
4
 
5
5
  ## Changelog
6
- `1.38`<br/>
6
+ `1.1.41`<br/>
7
+ [mainservice] check event if not null, check for zudf form if applicable.<br/>
8
+
9
+ `1.1.40`<br/>
10
+ [ztextarea] enhance to allow onchange.<br/>
11
+
12
+ `1.1.39`<br/>
13
+ [zudf] added load userdefinedform.<br/>
14
+ [zupload] enhance to allow to set MinFileSize & MaxFileSize in field attribute
15
+
16
+ `1.1.38`<br/>
7
17
  [zupload] default file size restriction.<br/>
8
18
  [zupload] added clearFiles function.<br/>
9
19
 
10
- `1.37`<br/>
20
+ `1.1.37`<br/>
11
21
  [tooltipsinfo] support for setTooltipsDisplayText, setTooltipsInfoIcon.
12
22
 
13
- `1.36`<br/>
23
+ `1.1.36`<br/>
14
24
  Disable zgrid session storage.
15
25
 
16
- `1.35`<br/>
26
+ `1.1.35`<br/>
17
27
  Temp disable get grid setting from cookiestore when load.
18
28
  Fix and enable back grid session storage.
19
29
 
20
- `1.34`<br/>
30
+ `1.1.34`<br/>
21
31
  Fix zgrid intermittent display all column.
22
32
  Fix zText tooltip issue.
23
33
  Fix zSelectMultiple virtual problem for desktop view.
24
34
 
25
- `1.33`<br/>
35
+ `1.1.33`<br/>
26
36
  [zupload] - minor fix for selectFileOnly attribute. <br/>
27
37
  [zgrid] - added support for filter operator "contains" for .net core. Default as contains, to use ==, zgrid attribute add FilterContainsUsingEqual:true.
28
38
 
29
- `1.32`<br/>
39
+ `1.1.32`<br/>
30
40
  [zgrid] - added getFormControlData function to retrieve incell data. <br/>
31
41
  [zgrid] - added AfterloadCallback attribute handling. <br/>
32
42
  [zgrid] - fix form control error when grid data is null. <br/>
33
43
  [zupload] - save file data to group scope. <br/>
34
44
  [zquerybuilder] - bug fix for query builder.
35
45
 
36
- `1.31`<br/>
46
+ `1.1.31`<br/>
37
47
  update dynamicform module for zuploadmodule. <br/>
38
48
 
39
- `1.30`<br/>
49
+ `1.1.30`<br/>
40
50
  [zupload] - support Select/Remove/Change Event. <br/>
41
51
  [zupload] - added SelectFileOnly attribute handling, to allow select file without upload. <br/>
42
52
  [zupload] - added selected file append to group scope (type+value as name). <br/>
@@ -395,11 +395,11 @@
395
395
  onChangeWatchName: this.onChangeWatchName.bind(this),
396
396
  getWatchName: this.getWatchName.bind(this),
397
397
  fieldElementonEditorCodeChange: this.fieldElementonEditorCodeChange.bind(this),
398
- gridActivityLogColumnFields: this.fieldService.getFormFieldCode('debugActivityLog', "FormField", null, null),
398
+ gridActivityLogColumnFields: this.fieldService.getFormFieldCode('debugActivityLog', "FormField", this.group, "debugActivityLogField"),
399
399
  gridActivityLogOnItemClick: this.gridActivityLogOnItemClick.bind(this),
400
400
  updateModel: this.updateModel.bind(this),
401
401
  refreshWorkflowButtonData: this.loadWorkflowData.bind(this),
402
- gridWorkflowButtonColumnFields: this.fieldService.getFormFieldCode('debugWorkflowButton', 'FormField', null, null),
402
+ gridWorkflowButtonColumnFields: this.fieldService.getFormFieldCode('debugWorkflowButton', 'FormField', this.group, "debugWorkflowButtonField"),
403
403
  gridWorkflowButtonOnItemClick: this.gridWorkflowButtonOnItemClick.bind(this)
404
404
  });
405
405
  if (!d.zData) {
@@ -1488,10 +1488,22 @@
1488
1488
  group.beforeBackNavigationPage(group).subscribe(function () {
1489
1489
  group['isTriggered'] = false;
1490
1490
  _this.router.navigate([group.backNavigationPage]);
1491
+ //if (group['reload']) {
1492
+ // group['isTriggered'] = false;
1493
+ // this.router.routeReuseStrategy.shouldReuseRoute = function () {
1494
+ // return false;
1495
+ // }
1496
+ // this.router.onSameUrlNavigation = 'reload';
1497
+ //}
1498
+ //this.router.navigate([group.backNavigationPage],);
1491
1499
  });
1492
1500
  }
1493
1501
  else {
1494
1502
  group['isTriggered'] = false;
1503
+ //this.router.routeReuseStrategy.shouldReuseRoute = function () {
1504
+ // return false;
1505
+ //}
1506
+ //this.router.onSameUrlNavigation = 'reload';
1495
1507
  this.router.navigate([group.backNavigationPage]);
1496
1508
  }
1497
1509
  };
@@ -1538,10 +1550,16 @@
1538
1550
  };
1539
1551
  MainService.prototype.newModel = function (event, group) {
1540
1552
  var _this = this;
1553
+ var _group = group;
1554
+ if (event) {
1555
+ if (event.data && event.data.SubType) {
1556
+ _group = group['_' + event.data.SubType];
1557
+ }
1558
+ }
1541
1559
  rxjs.of([])
1542
1560
  .pipe(operators.switchMap(function (zmodel) {
1543
1561
  console.log("Before new, zModel:", zmodel);
1544
- return _this.beforeNewModel(group);
1562
+ return _this.beforeNewModel(_group);
1545
1563
  }), operators.tap(function () {
1546
1564
  var referenceId = group.parentReferenceId || "0";
1547
1565
  console.log("current url: ", _this.router.url);
@@ -1587,7 +1605,15 @@
1587
1605
  };
1588
1606
  MainService.prototype.createModel = function (event, group) {
1589
1607
  var _this = this;
1608
+ var createModelres = null;
1590
1609
  var fg = group.form;
1610
+ var _group = group;
1611
+ if (event) {
1612
+ if (event.data && event.data.SubType) {
1613
+ fg = group['_' + event.data.SubType].form;
1614
+ _group = group['_' + event.data.SubType];
1615
+ }
1616
+ }
1591
1617
  if (!fg.dirty) {
1592
1618
  console.warn("Form is not dirty hence record is not save.");
1593
1619
  return;
@@ -1597,15 +1623,14 @@
1597
1623
  console.warn("Form Validation got error(s):", errors);
1598
1624
  return;
1599
1625
  }
1600
- var createModelres = null;
1601
- rxjs.of(group.zModel)
1626
+ rxjs.of(_group.zModel)
1602
1627
  .pipe(operators.switchMap(function (zmodel) {
1603
1628
  console.log("Before create, zModel:", zmodel);
1604
- return _this.beforeCreateModel(group);
1629
+ return _this.beforeCreateModel(_group);
1605
1630
  }), operators.tap(function () {
1606
- Object.assign(group.zModel, fg.value);
1631
+ Object.assign(_group.zModel, fg.value);
1607
1632
  }), operators.switchMap(function () {
1608
- var newModel = Object.assign({}, group.zModel);
1633
+ var newModel = Object.assign({}, _group.zModel);
1609
1634
  i3.ZComponentHelper.removeNullFields(newModel);
1610
1635
  // Object.keys(newModel).forEach((key) => {
1611
1636
  // if (newModel[key] === null) {
@@ -1616,7 +1641,7 @@
1616
1641
  // newModel.Id = 0;
1617
1642
  // }
1618
1643
  return _this.webApiService
1619
- .httpPost$(group.resourceURL, // + "/" + group.zModel.Id,
1644
+ .httpPost$(_group.resourceURL, // + "/" + group.zModel.Id,
1620
1645
  newModel)
1621
1646
  .pipe(operators.tap(function (resp) {
1622
1647
  createModelres = resp;
@@ -1627,25 +1652,25 @@
1627
1652
  if (zmodel) {
1628
1653
  //support old and new webapi method
1629
1654
  if (zmodel.Data) {
1630
- Object.assign(group.zModel, zmodel.Data);
1655
+ Object.assign(_group.zModel, zmodel.Data);
1631
1656
  fg.patchValue(zmodel.Data);
1632
1657
  }
1633
1658
  else if (zmodel["Id"]) {
1634
- Object.assign(group.zModel, zmodel);
1659
+ Object.assign(_group.zModel, zmodel);
1635
1660
  fg.patchValue(zmodel);
1636
1661
  }
1637
- group.referenceId = group.zModel.Id;
1662
+ _group.referenceId = _group.zModel.Id;
1638
1663
  fg.markAsPristine();
1639
1664
  }
1640
- return _this.afterCreateModel(group);
1665
+ return _this.afterCreateModel(_group);
1641
1666
  }), operators.tap(function (resp) {
1642
1667
  if (createModelres.ProcessingStatus == null || createModelres.ProcessingStatus == true) {
1643
- if (resp && group.zModel.Id !== 0) {
1644
- group.isNew = false;
1645
- group.isEdit = true;
1646
- group.isTriggered = false;
1647
- group.cancelButtonName = "Close";
1648
- Object.assign(group.zModel, resp);
1668
+ if (resp && _group.zModel.Id !== 0) {
1669
+ _group.isNew = false;
1670
+ _group.isEdit = true;
1671
+ _group.isTriggered = false;
1672
+ _group.cancelButtonName = "Close";
1673
+ Object.assign(_group.zModel, resp);
1649
1674
  fg.patchValue(resp);
1650
1675
  }
1651
1676
  fg.markAsPristine();
@@ -1661,6 +1686,13 @@
1661
1686
  MainService.prototype.updateModel = function (event, group) {
1662
1687
  var _this = this;
1663
1688
  var fg = group.form;
1689
+ var _group = group;
1690
+ if (event) {
1691
+ if (event.data && event.data.SubType) {
1692
+ fg = group['_' + event.data.SubType].form;
1693
+ _group = group['_' + event.data.SubType];
1694
+ }
1695
+ }
1664
1696
  if (!fg.dirty) {
1665
1697
  console.warn("Form is not dirty hence record is not save.");
1666
1698
  return;
@@ -1670,31 +1702,32 @@
1670
1702
  console.warn("Form Validation got error(s):", errors);
1671
1703
  return;
1672
1704
  }
1673
- rxjs.of(group.zModel)
1705
+ rxjs.of(_group.zModel)
1674
1706
  .pipe(operators.switchMap(function (zmodel) {
1675
1707
  console.log("Before update, zModel:", zmodel);
1676
- return _this.beforeUpdateModel(group);
1708
+ return _this.beforeUpdateModel(_group);
1677
1709
  }), operators.tap(function () {
1678
- Object.assign(group.zModel, fg.value);
1710
+ Object.assign(_group.zModel, fg.value);
1679
1711
  }), operators.switchMap(function () {
1680
1712
  return _this.webApiService
1681
- .httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel)
1713
+ .httpPut$(_group.resourceURL + "/" + _group.zModel.Id, _group.zModel)
1682
1714
  .pipe(operators.map(function (res) { return _this.handleSuccess(res, "Record is updated successfully."); }));
1683
1715
  }), operators.switchMap(function (zmodel) {
1684
1716
  console.log("After updated, zModel:", zmodel);
1685
1717
  if (zmodel && zmodel.Data) {
1686
- Object.assign(group.zModel, zmodel.Data);
1718
+ Object.assign(_group.zModel, zmodel.Data);
1687
1719
  fg.patchValue(zmodel.Data);
1688
1720
  // console.log("Done updateModel updated zModel:", fg.value);
1689
1721
  }
1690
1722
  else if (zmodel && zmodel["Id"]) {
1691
- Object.assign(group.zModel, zmodel);
1723
+ Object.assign(_group.zModel, zmodel);
1692
1724
  fg.patchValue(zmodel);
1693
1725
  // console.log("Done updateModel updated zModel:", fg.value);
1694
1726
  }
1695
1727
  group.isTriggered = false;
1728
+ _group.isTriggered = false;
1696
1729
  fg.markAsPristine();
1697
- return _this.afterUpdateModel(group);
1730
+ return _this.afterUpdateModel(_group);
1698
1731
  }))
1699
1732
  .subscribe();
1700
1733
  // Object.assign(group.zModel, fg.value);
@@ -1708,49 +1741,55 @@
1708
1741
  // });
1709
1742
  };
1710
1743
  MainService.prototype.cloneNewModel = function (event, group) {
1711
- Object.assign(group.zModel, group.form.value);
1712
- group.zModel.Id = 0;
1744
+ var _group = group;
1745
+ if (event) {
1746
+ if (event.data && event.data.SubType) {
1747
+ _group = group['_' + event.data.SubType];
1748
+ }
1749
+ }
1750
+ Object.assign(_group.zModel, _group.form.value);
1751
+ _group.zModel.Id = 0;
1713
1752
  var clearFields = ["WFS_DocumentId", "WFS_StatusCode", "WFS_StatusName"];
1714
1753
  clearFields.forEach(function (field) {
1715
- if (group.zModel.hasOwnProperty(field)) {
1716
- group.zModel[field] = null;
1754
+ if (_group.zModel.hasOwnProperty(field)) {
1755
+ _group.zModel[field] = null;
1717
1756
  }
1718
1757
  });
1719
1758
  this.cacheService.setCache("cloneNewModel", group.zModel);
1720
1759
  this.newModel(null, group);
1721
1760
  group.isTriggered = false;
1761
+ _group.isTriggered = false;
1722
1762
  };
1723
1763
  MainService.prototype.deleteModel = function (event, group) {
1724
1764
  var _this = this;
1725
1765
  var fg = group.form;
1726
- // if (!fg.dirty) {
1727
- // console.warn('Form is not dirty hence record is not save.');
1728
- // return;
1729
- // }
1730
- // if (!fg.valid) {
1731
- // const errors = ZComponentHelper.getFormGroupErrors(fg);
1732
- // console.warn("Form Validation got error(s):", errors);
1733
- // return;
1734
- // }
1735
- rxjs.of(group.zModel)
1766
+ var _group = group;
1767
+ if (event) {
1768
+ if (event.data && event.data.SubType) {
1769
+ fg = group['_' + event.data.SubType].form;
1770
+ _group = group['_' + event.data.SubType];
1771
+ }
1772
+ }
1773
+ rxjs.of(_group.zModel)
1736
1774
  .pipe(operators.switchMap(function (zmodel) {
1737
1775
  console.log("Before delete, zModel:", zmodel);
1738
- return _this.beforeDeleteModel(group);
1776
+ return _this.beforeDeleteModel(_group);
1739
1777
  }), operators.switchMap(function () {
1740
1778
  group.isTriggered = false;
1779
+ _group.isTriggered = false;
1741
1780
  return _this.alertService.show("Delete Record", "Are you sure?", [
1742
1781
  { text: "No", cssClass: "secondary" },
1743
1782
  { text: "Yes", cssClass: "primary" }
1744
1783
  ]);
1745
1784
  }), operators.switchMap(function (reply) {
1746
1785
  if (reply === "Yes") {
1747
- Object.assign(group.zModel, fg.value);
1748
- group.zModel.Disabled = true;
1786
+ Object.assign(_group.zModel, fg.value);
1787
+ _group.zModel.Disabled = true;
1749
1788
  return _this.webApiService
1750
- .httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel)
1789
+ .httpPut$(_group.resourceURL + "/" + _group.zModel.Id, _group.zModel)
1751
1790
  .pipe(operators.map(function (res) { return _this.handleSuccess(res, "Record is deleted successfully."); }), operators.switchMap(function (zmodel) {
1752
1791
  console.log("After deleted, zModel:", zmodel);
1753
- return _this.afterDeleteModel(group);
1792
+ return _this.afterDeleteModel(_group);
1754
1793
  }), operators.tap(function (resp) {
1755
1794
  _this.historyBack();
1756
1795
  }));
@@ -4022,6 +4061,9 @@
4022
4061
  field$.subscribe(function (data) {
4023
4062
  // this.items = data;
4024
4063
  data.forEach(function (button) {
4064
+ if (_this.data.SubType) {
4065
+ button.Name = _this.data.SubType + '_' + button.Name;
4066
+ }
4025
4067
  var label = _this.getButtonLabel(button);
4026
4068
  var buttonDisabled = null;
4027
4069
  if (button.Disabled != "" && button.Disabled) {
@@ -4037,6 +4079,7 @@
4037
4079
  iconName: button.Icon,
4038
4080
  dismissType: button.DismissType,
4039
4081
  disableTriggerTimer: button.DisableTriggerTimer,
4082
+ SubType: _this.data.SubType,
4040
4083
  click: function (y) {
4041
4084
  _this.buttonClick(button);
4042
4085
  }
@@ -5334,12 +5377,16 @@
5334
5377
  }
5335
5378
  return readOnlyValue;
5336
5379
  };
5380
+ ZformComponent.prototype.trackByFn = function (index, item) {
5381
+ //return item['Type'] + '-' + item['Name'];
5382
+ return index;
5383
+ };
5337
5384
  return ZformComponent;
5338
5385
  }());
5339
5386
  ZformComponent.decorators = [
5340
5387
  { type: i0.Component, args: [{
5341
5388
  selector: "app-zform",
5342
- template: "<div class=\"e1-form\">\r\n <!--<div class=\"k-overlay\" *ngIf=\"isLoading\"></div>-->\r\n <form [formGroup]=\"form\" autocomplete=\"off\" *ngIf=\"!isLoading\">\r\n <ion-grid>\r\n <ion-row id=\"dynamic-form-host\" class=\"ion-align-items-start\">\r\n <app-zformcontrol *ngFor=\"let field of fields\"\r\n [ngClass]=\"group[field['isVisibleField']] ? field.DivClass :\r\n ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n [field]=\"field\"\r\n [group]=\"getGroup()\"\r\n [form]=\"form\"\r\n id=\"{{field.Type}}-{{field.Name}}\"></app-zformcontrol>\r\n </ion-row>\r\n </ion-grid>\r\n </form>\r\n</div>",
5389
+ template: "<div class=\"e1-form\">\r\n <!--<div class=\"k-overlay\" *ngIf=\"isLoading\"></div>-->\r\n <form [formGroup]=\"form\" autocomplete=\"off\" *ngIf=\"!isLoading\">\r\n <ion-grid>\r\n <ion-row id=\"dynamic-form-host\" class=\"ion-align-items-start\">\r\n <app-zformcontrol *ngFor=\"let field of fields; trackBy: trackByFn\"\r\n [ngClass]=\"group[field['isVisibleField']] ? field.DivClass :\r\n ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n [field]=\"field\"\r\n [group]=\"getGroup()\"\r\n [form]=\"form\"\r\n id=\"{{field.Type}}-{{field.Name}}\"></app-zformcontrol>\r\n </ion-row>\r\n </ion-grid>\r\n </form>\r\n</div>\r\n",
5343
5390
  styles: ["#dynamic-form-host app-zformcontrol{overflow-x:auto;overflow-y:hidden}"]
5344
5391
  },] }
5345
5392
  ];
@@ -9486,8 +9533,8 @@
9486
9533
  });
9487
9534
  };
9488
9535
  ZtextComponent.prototype.onChange = function (event) {
9489
- // console.log('ztext.component - onChange: ', event.target.value);
9490
- i3.ZComponentHelper.setModelValue(this.data.Value, event.target.value, this.group);
9536
+ // console.log('ztext.component - onChange: ', event.target.value);
9537
+ i3.ZComponentHelper.setComponentModelValue(this.data, event.target.value, this.group);
9491
9538
  this.group.subject.next({
9492
9539
  type: "onChange",
9493
9540
  target: this.data.OnChange,
@@ -9653,6 +9700,12 @@
9653
9700
  this.group[this.itemDataField.slice(6)] = zdataModel;
9654
9701
  }
9655
9702
  }
9703
+ this.group.subject.next({
9704
+ type: "onChange",
9705
+ target: this.data.OnChange,
9706
+ event: event,
9707
+ data: { value: value, field: this.data }
9708
+ });
9656
9709
  };
9657
9710
  ZtextareaComponent.prototype.getReadOnlyValue = function () {
9658
9711
  var readOnlyValue = i3.ZComponentHelper.getGroupEvalValue.call(this, this.data.ReadOnly, this.group);
@@ -10681,6 +10734,158 @@
10681
10734
  form: [{ type: i0.Input }]
10682
10735
  };
10683
10736
 
10737
+ /********** Angular **********/
10738
+ var ZudfComponent = /** @class */ (function () {
10739
+ function ZudfComponent(alertService, authService, fieldService, resourceApiService, toastService, webApiService) {
10740
+ var _this = this;
10741
+ this.alertService = alertService;
10742
+ this.authService = authService;
10743
+ this.fieldService = fieldService;
10744
+ this.resourceApiService = resourceApiService;
10745
+ this.toastService = toastService;
10746
+ this.webApiService = webApiService;
10747
+ this.componentProperties = new i3.ZComponentProperties();
10748
+ this.setEnable = function (status) {
10749
+ _this.componentProperties.isReadOnly = !status;
10750
+ };
10751
+ this.setVisible = function (status) {
10752
+ _this.componentProperties.isVisible = status;
10753
+ _this.data.Visible = status;
10754
+ };
10755
+ this.setRequire = function (status) {
10756
+ _this.componentProperties.isRequired = status;
10757
+ i3.ZComponentHelper.changeValidator(status, _this.group, _this.data.Value, _this.componentProperties, forms.Validators.required);
10758
+ };
10759
+ }
10760
+ ZudfComponent.prototype.ngOnInit = function () {
10761
+ var _this = this;
10762
+ i3.ZComponentHelper.setComponentProperties(this);
10763
+ i3.ZComponentHelper.registerComponent(this);
10764
+ rxjs.of(true).pipe(operators.concatMap(function (fieldElements) {
10765
+ var asyncSubject = new rxjs.AsyncSubject();
10766
+ _this.fieldService.getFormFieldCode(_this.data.Value, 'FormField', _this, 'fields').pipe(operators.map(function (formFieldResult) {
10767
+ // rename add prefix to all udf field to prevent duplicate from main form
10768
+ _this.appendPrefix(formFieldResult, 'zudf');
10769
+ // change the value to the result field form
10770
+ _this.data.Value = formFieldResult;
10771
+ // change zudf to zdiv
10772
+ _this.data.Type = 'zdiv';
10773
+ // end subject
10774
+ asyncSubject.next(true);
10775
+ asyncSubject.complete();
10776
+ })).subscribe();
10777
+ return asyncSubject.asObservable();
10778
+ }), operators.tap(function () {
10779
+ if (!_this.group._zudf) {
10780
+ _this.group._zudf = new i3.ZGroup;
10781
+ }
10782
+ _this.group._zudf.zModel = {};
10783
+ // create as new Form Group
10784
+ _this.form = _this.toFormGroup(_this.data.Value);
10785
+ // set to zGroup scope
10786
+ _this.group._zudf.form = _this.form;
10787
+ }), operators.tap(function () {
10788
+ // set to formField for display
10789
+ _this.formField = _this.data.Value;
10790
+ })).subscribe(function () {
10791
+ // set Field div class
10792
+ i3.ZComponentHelper.setFieldsDivClass(_this.group._projectName, _this.group.fieldName, _this.data, _this.authService);
10793
+ // get saved record
10794
+ _this.getFormFieldzModel();
10795
+ });
10796
+ };
10797
+ ZudfComponent.prototype.getFormFieldzModel = function () {
10798
+ var form = this.group._zudf.form;
10799
+ var zModel = this.group._zudf.zModel;
10800
+ var url = this.resourceApiService.getURL('field');
10801
+ var respData = { 'parentFormId': 5722, 'zudf_Name': 'test' };
10802
+ Object.assign(zModel, respData);
10803
+ form.patchValue(zModel);
10804
+ form.markAsPristine();
10805
+ //return this.webApiService.httpGet$(url, { name: this.group.fieldName, type: 'FormField' }).pipe(
10806
+ // tap((respData: any) => {
10807
+ // debugger;
10808
+ // Object.assign(zModel, respData);
10809
+ // form.patchValue(zModel);
10810
+ // form.markAsPristine();
10811
+ // })
10812
+ //);
10813
+ };
10814
+ ZudfComponent.prototype.toFormGroup = function (fieldElements) {
10815
+ var formControls = {};
10816
+ this.getFormControls(fieldElements, formControls);
10817
+ var newFormGroup = new forms.FormGroup(formControls);
10818
+ return newFormGroup;
10819
+ };
10820
+ ZudfComponent.prototype.getFormControls = function (fieldArray, formControls) {
10821
+ var _this = this;
10822
+ fieldArray.forEach(function (field) {
10823
+ if (typeof field.Value === "string" && field.Value.indexOf(".") !== -1) {
10824
+ if (['zgrid', 'ztree', 'zimg', 'textareajson'].indexOf(field.Type) === -1) {
10825
+ console.warn("FormControl - invalid field value", field.Value);
10826
+ }
10827
+ }
10828
+ else {
10829
+ if (Array.isArray(field.Value)) {
10830
+ _this.getFormControls(field.Value, formControls);
10831
+ }
10832
+ else {
10833
+ var isFormControl = i3.ZComponentHelper.isFormControl(field);
10834
+ var isVisible = i3.ZComponentHelper.isVisibleFormControl(_this, field);
10835
+ var isRequired = i3.ZComponentHelper.isRequiredFormControl(_this, field);
10836
+ if (isFormControl === true) {
10837
+ var validators = i3.ZComponentHelper.getValidators(field, isVisible, isRequired);
10838
+ formControls[field.Value] = new forms.FormControl(_this.group._zudf.zModel[field.Value], validators);
10839
+ if (i3.ZComponentHelper.hasCCField(field.Type)) {
10840
+ var ccValidators = i3.ZComponentHelper.getCCValidators(field, isVisible, isRequired);
10841
+ formControls[field.CCValue] = new forms.FormControl(_this.group._zudf.zModel[field.CCValue], ccValidators);
10842
+ }
10843
+ }
10844
+ }
10845
+ }
10846
+ });
10847
+ };
10848
+ ZudfComponent.prototype.appendPrefix = function (fields, prefix) {
10849
+ var _this = this;
10850
+ fields.forEach(function (field) {
10851
+ if (Array.isArray(field.Value)) {
10852
+ _this.appendPrefix(field.Value, prefix);
10853
+ }
10854
+ else {
10855
+ field.Name = prefix + '_' + field.Name;
10856
+ if (field.Type != 'zbuttons') {
10857
+ field.Value = prefix + '_' + field.Value;
10858
+ }
10859
+ field.SubType = prefix;
10860
+ }
10861
+ });
10862
+ };
10863
+ ZudfComponent.prototype.ComponentIsVisible = function (field) {
10864
+ return i3.ZComponentHelper.ComponentIsVisible(field, this.group);
10865
+ };
10866
+ return ZudfComponent;
10867
+ }());
10868
+ ZudfComponent.decorators = [
10869
+ { type: i0.Component, args: [{
10870
+ selector: 'app-zudf',
10871
+ template: "<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" class=\"ion-row\">\r\n\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of formField | divzlayout: data.zlayout\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"zudf-{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol> \r\n</div>\r\n",
10872
+ styles: ["#div1,#div2{float:left;width:100px;height:35px;margin:10px;padding:10px;border:1px solid #000}"]
10873
+ },] }
10874
+ ];
10875
+ ZudfComponent.ctorParameters = function () { return [
10876
+ { type: i3.AlertService },
10877
+ { type: i3.AuthService },
10878
+ { type: i3.FieldService },
10879
+ { type: i3.ResourceApiService },
10880
+ { type: i3.ToastService },
10881
+ { type: i3.WebApiService }
10882
+ ]; };
10883
+ ZudfComponent.propDecorators = {
10884
+ data: [{ type: i0.Input }],
10885
+ group: [{ type: i0.Input }],
10886
+ form: [{ type: i0.Input }]
10887
+ };
10888
+
10684
10889
  /********** Angular **********/
10685
10890
  var ZunknownComponent = /** @class */ (function () {
10686
10891
  function ZunknownComponent() {
@@ -10794,6 +10999,12 @@
10794
10999
  this.restrictions.allowedExtensions = this.data
10795
11000
  .SelectOptions;
10796
11001
  }
11002
+ if (this.data.MinFileSize) {
11003
+ this.restrictions.minFileSize = this.data.MinFileSize;
11004
+ }
11005
+ if (this.data.MaxFileSize) {
11006
+ this.restrictions.maxFileSize = this.data.MaxFileSize;
11007
+ }
10797
11008
  this.isAutoUpload = this.data.AutoUpload || false;
10798
11009
  if (!this.data.AllowRemove) {
10799
11010
  this.uploadRemoveUrl = "";
@@ -11028,7 +11239,7 @@
11028
11239
  } // file type check
11029
11240
  }); // loop each file
11030
11241
  } // imagecompression check
11031
- // add to group scope
11242
+ // add to group scope
11032
11243
  me.group['zupload_' + me.data.Value] = e.files;
11033
11244
  }
11034
11245
  }
@@ -11327,6 +11538,7 @@
11327
11538
  ktree_list: ZtreelistComponent,
11328
11539
  ztrendcard: ZtrendcardComponent,
11329
11540
  unknown: ZunknownComponent,
11541
+ zudf: ZudfComponent,
11330
11542
  zupload: ZuploadComponent,
11331
11543
  zworkflowbuttons: ZworkflowbuttonsComponent
11332
11544
  // kdate_rangepicker: ZdaterangeComponent
@@ -11510,6 +11722,7 @@
11510
11722
  ZtreelistComponent,
11511
11723
  ZtrendcardComponent,
11512
11724
  ZunknownComponent,
11725
+ ZudfComponent,
11513
11726
  ZuploadComponent,
11514
11727
  ZworkflowbuttonsComponent
11515
11728
  ],
@@ -11609,6 +11822,7 @@
11609
11822
  ZtreelistComponent,
11610
11823
  ZtrendcardComponent,
11611
11824
  ZunknownComponent,
11825
+ ZudfComponent,
11612
11826
  ZuploadComponent,
11613
11827
  ZworkflowbuttonsComponent
11614
11828
  ],
@@ -11658,6 +11872,7 @@
11658
11872
  ZtreelistComponent,
11659
11873
  ZtrendcardComponent,
11660
11874
  ZunknownComponent,
11875
+ ZudfComponent,
11661
11876
  ZuploadComponent,
11662
11877
  ZworkflowbuttonsComponent
11663
11878
  ],
@@ -11733,6 +11948,7 @@
11733
11948
  exports.ZtreeComponent = ZtreeComponent;
11734
11949
  exports.ZtreelistComponent = ZtreelistComponent;
11735
11950
  exports.ZtrendcardComponent = ZtrendcardComponent;
11951
+ exports.ZudfComponent = ZudfComponent;
11736
11952
  exports.ZunknownComponent = ZunknownComponent;
11737
11953
  exports.ZuploadComponent = ZuploadComponent;
11738
11954
  exports.ZworkflowbuttonsComponent = ZworkflowbuttonsComponent;