mmhglobal-dynamicform 1.1.37 → 1.1.40

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,36 +3,47 @@
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.37`<br/>
6
+ `1.1.40`<br/>
7
+ [ztextarea] enhance to allow onchange.<br/>
8
+
9
+ `1.1.39`<br/>
10
+ [zudf] added load userdefinedform.<br/>
11
+ [zupload] enhance to allow to set MinFileSize & MaxFileSize in field attribute
12
+
13
+ `1.1.38`<br/>
14
+ [zupload] default file size restriction.<br/>
15
+ [zupload] added clearFiles function.<br/>
16
+
17
+ `1.1.37`<br/>
7
18
  [tooltipsinfo] support for setTooltipsDisplayText, setTooltipsInfoIcon.
8
19
 
9
- `1.36`<br/>
20
+ `1.1.36`<br/>
10
21
  Disable zgrid session storage.
11
22
 
12
- `1.35`<br/>
23
+ `1.1.35`<br/>
13
24
  Temp disable get grid setting from cookiestore when load.
14
25
  Fix and enable back grid session storage.
15
26
 
16
- `1.34`<br/>
27
+ `1.1.34`<br/>
17
28
  Fix zgrid intermittent display all column.
18
29
  Fix zText tooltip issue.
19
30
  Fix zSelectMultiple virtual problem for desktop view.
20
31
 
21
- `1.33`<br/>
32
+ `1.1.33`<br/>
22
33
  [zupload] - minor fix for selectFileOnly attribute. <br/>
23
34
  [zgrid] - added support for filter operator "contains" for .net core. Default as contains, to use ==, zgrid attribute add FilterContainsUsingEqual:true.
24
35
 
25
- `1.32`<br/>
36
+ `1.1.32`<br/>
26
37
  [zgrid] - added getFormControlData function to retrieve incell data. <br/>
27
38
  [zgrid] - added AfterloadCallback attribute handling. <br/>
28
39
  [zgrid] - fix form control error when grid data is null. <br/>
29
40
  [zupload] - save file data to group scope. <br/>
30
41
  [zquerybuilder] - bug fix for query builder.
31
42
 
32
- `1.31`<br/>
43
+ `1.1.31`<br/>
33
44
  update dynamicform module for zuploadmodule. <br/>
34
45
 
35
- `1.30`<br/>
46
+ `1.1.30`<br/>
36
47
  [zupload] - support Select/Remove/Change Event. <br/>
37
48
  [zupload] - added SelectFileOnly attribute handling, to allow select file without upload. <br/>
38
49
  [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,14 @@
1538
1550
  };
1539
1551
  MainService.prototype.newModel = function (event, group) {
1540
1552
  var _this = this;
1553
+ var _group = group;
1554
+ if (event.data && event.data.SubType) {
1555
+ _group = group['_' + event.data.SubType];
1556
+ }
1541
1557
  rxjs.of([])
1542
1558
  .pipe(operators.switchMap(function (zmodel) {
1543
1559
  console.log("Before new, zModel:", zmodel);
1544
- return _this.beforeNewModel(group);
1560
+ return _this.beforeNewModel(_group);
1545
1561
  }), operators.tap(function () {
1546
1562
  var referenceId = group.parentReferenceId || "0";
1547
1563
  console.log("current url: ", _this.router.url);
@@ -1587,7 +1603,13 @@
1587
1603
  };
1588
1604
  MainService.prototype.createModel = function (event, group) {
1589
1605
  var _this = this;
1606
+ var createModelres = null;
1590
1607
  var fg = group.form;
1608
+ var _group = group;
1609
+ if (event.data && event.data.SubType) {
1610
+ fg = group['_' + event.data.SubType].form;
1611
+ _group = group['_' + event.data.SubType];
1612
+ }
1591
1613
  if (!fg.dirty) {
1592
1614
  console.warn("Form is not dirty hence record is not save.");
1593
1615
  return;
@@ -1597,15 +1619,14 @@
1597
1619
  console.warn("Form Validation got error(s):", errors);
1598
1620
  return;
1599
1621
  }
1600
- var createModelres = null;
1601
- rxjs.of(group.zModel)
1622
+ rxjs.of(_group.zModel)
1602
1623
  .pipe(operators.switchMap(function (zmodel) {
1603
1624
  console.log("Before create, zModel:", zmodel);
1604
- return _this.beforeCreateModel(group);
1625
+ return _this.beforeCreateModel(_group);
1605
1626
  }), operators.tap(function () {
1606
- Object.assign(group.zModel, fg.value);
1627
+ Object.assign(_group.zModel, fg.value);
1607
1628
  }), operators.switchMap(function () {
1608
- var newModel = Object.assign({}, group.zModel);
1629
+ var newModel = Object.assign({}, _group.zModel);
1609
1630
  i3.ZComponentHelper.removeNullFields(newModel);
1610
1631
  // Object.keys(newModel).forEach((key) => {
1611
1632
  // if (newModel[key] === null) {
@@ -1616,7 +1637,7 @@
1616
1637
  // newModel.Id = 0;
1617
1638
  // }
1618
1639
  return _this.webApiService
1619
- .httpPost$(group.resourceURL, // + "/" + group.zModel.Id,
1640
+ .httpPost$(_group.resourceURL, // + "/" + group.zModel.Id,
1620
1641
  newModel)
1621
1642
  .pipe(operators.tap(function (resp) {
1622
1643
  createModelres = resp;
@@ -1627,25 +1648,25 @@
1627
1648
  if (zmodel) {
1628
1649
  //support old and new webapi method
1629
1650
  if (zmodel.Data) {
1630
- Object.assign(group.zModel, zmodel.Data);
1651
+ Object.assign(_group.zModel, zmodel.Data);
1631
1652
  fg.patchValue(zmodel.Data);
1632
1653
  }
1633
1654
  else if (zmodel["Id"]) {
1634
- Object.assign(group.zModel, zmodel);
1655
+ Object.assign(_group.zModel, zmodel);
1635
1656
  fg.patchValue(zmodel);
1636
1657
  }
1637
- group.referenceId = group.zModel.Id;
1658
+ _group.referenceId = _group.zModel.Id;
1638
1659
  fg.markAsPristine();
1639
1660
  }
1640
- return _this.afterCreateModel(group);
1661
+ return _this.afterCreateModel(_group);
1641
1662
  }), operators.tap(function (resp) {
1642
1663
  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);
1664
+ if (resp && _group.zModel.Id !== 0) {
1665
+ _group.isNew = false;
1666
+ _group.isEdit = true;
1667
+ _group.isTriggered = false;
1668
+ _group.cancelButtonName = "Close";
1669
+ Object.assign(_group.zModel, resp);
1649
1670
  fg.patchValue(resp);
1650
1671
  }
1651
1672
  fg.markAsPristine();
@@ -1661,6 +1682,11 @@
1661
1682
  MainService.prototype.updateModel = function (event, group) {
1662
1683
  var _this = this;
1663
1684
  var fg = group.form;
1685
+ var _group = group;
1686
+ if (event.data && event.data.SubType) {
1687
+ fg = group['_' + event.data.SubType].form;
1688
+ _group = group['_' + event.data.SubType];
1689
+ }
1664
1690
  if (!fg.dirty) {
1665
1691
  console.warn("Form is not dirty hence record is not save.");
1666
1692
  return;
@@ -1670,31 +1696,32 @@
1670
1696
  console.warn("Form Validation got error(s):", errors);
1671
1697
  return;
1672
1698
  }
1673
- rxjs.of(group.zModel)
1699
+ rxjs.of(_group.zModel)
1674
1700
  .pipe(operators.switchMap(function (zmodel) {
1675
1701
  console.log("Before update, zModel:", zmodel);
1676
- return _this.beforeUpdateModel(group);
1702
+ return _this.beforeUpdateModel(_group);
1677
1703
  }), operators.tap(function () {
1678
- Object.assign(group.zModel, fg.value);
1704
+ Object.assign(_group.zModel, fg.value);
1679
1705
  }), operators.switchMap(function () {
1680
1706
  return _this.webApiService
1681
- .httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel)
1707
+ .httpPut$(_group.resourceURL + "/" + _group.zModel.Id, _group.zModel)
1682
1708
  .pipe(operators.map(function (res) { return _this.handleSuccess(res, "Record is updated successfully."); }));
1683
1709
  }), operators.switchMap(function (zmodel) {
1684
1710
  console.log("After updated, zModel:", zmodel);
1685
1711
  if (zmodel && zmodel.Data) {
1686
- Object.assign(group.zModel, zmodel.Data);
1712
+ Object.assign(_group.zModel, zmodel.Data);
1687
1713
  fg.patchValue(zmodel.Data);
1688
1714
  // console.log("Done updateModel updated zModel:", fg.value);
1689
1715
  }
1690
1716
  else if (zmodel && zmodel["Id"]) {
1691
- Object.assign(group.zModel, zmodel);
1717
+ Object.assign(_group.zModel, zmodel);
1692
1718
  fg.patchValue(zmodel);
1693
1719
  // console.log("Done updateModel updated zModel:", fg.value);
1694
1720
  }
1695
1721
  group.isTriggered = false;
1722
+ _group.isTriggered = false;
1696
1723
  fg.markAsPristine();
1697
- return _this.afterUpdateModel(group);
1724
+ return _this.afterUpdateModel(_group);
1698
1725
  }))
1699
1726
  .subscribe();
1700
1727
  // Object.assign(group.zModel, fg.value);
@@ -1708,49 +1735,51 @@
1708
1735
  // });
1709
1736
  };
1710
1737
  MainService.prototype.cloneNewModel = function (event, group) {
1711
- Object.assign(group.zModel, group.form.value);
1712
- group.zModel.Id = 0;
1738
+ var _group = group;
1739
+ if (event.data && event.data.SubType) {
1740
+ _group = group['_' + event.data.SubType];
1741
+ }
1742
+ Object.assign(_group.zModel, _group.form.value);
1743
+ _group.zModel.Id = 0;
1713
1744
  var clearFields = ["WFS_DocumentId", "WFS_StatusCode", "WFS_StatusName"];
1714
1745
  clearFields.forEach(function (field) {
1715
- if (group.zModel.hasOwnProperty(field)) {
1716
- group.zModel[field] = null;
1746
+ if (_group.zModel.hasOwnProperty(field)) {
1747
+ _group.zModel[field] = null;
1717
1748
  }
1718
1749
  });
1719
1750
  this.cacheService.setCache("cloneNewModel", group.zModel);
1720
1751
  this.newModel(null, group);
1721
1752
  group.isTriggered = false;
1753
+ _group.isTriggered = false;
1722
1754
  };
1723
1755
  MainService.prototype.deleteModel = function (event, group) {
1724
1756
  var _this = this;
1725
1757
  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)
1758
+ var _group = group;
1759
+ if (event.data && event.data.SubType) {
1760
+ fg = group['_' + event.data.SubType].form;
1761
+ _group = group['_' + event.data.SubType];
1762
+ }
1763
+ rxjs.of(_group.zModel)
1736
1764
  .pipe(operators.switchMap(function (zmodel) {
1737
1765
  console.log("Before delete, zModel:", zmodel);
1738
- return _this.beforeDeleteModel(group);
1766
+ return _this.beforeDeleteModel(_group);
1739
1767
  }), operators.switchMap(function () {
1740
1768
  group.isTriggered = false;
1769
+ _group.isTriggered = false;
1741
1770
  return _this.alertService.show("Delete Record", "Are you sure?", [
1742
1771
  { text: "No", cssClass: "secondary" },
1743
1772
  { text: "Yes", cssClass: "primary" }
1744
1773
  ]);
1745
1774
  }), operators.switchMap(function (reply) {
1746
1775
  if (reply === "Yes") {
1747
- Object.assign(group.zModel, fg.value);
1748
- group.zModel.Disabled = true;
1776
+ Object.assign(_group.zModel, fg.value);
1777
+ _group.zModel.Disabled = true;
1749
1778
  return _this.webApiService
1750
- .httpPut$(group.resourceURL + "/" + group.zModel.Id, group.zModel)
1779
+ .httpPut$(_group.resourceURL + "/" + _group.zModel.Id, _group.zModel)
1751
1780
  .pipe(operators.map(function (res) { return _this.handleSuccess(res, "Record is deleted successfully."); }), operators.switchMap(function (zmodel) {
1752
1781
  console.log("After deleted, zModel:", zmodel);
1753
- return _this.afterDeleteModel(group);
1782
+ return _this.afterDeleteModel(_group);
1754
1783
  }), operators.tap(function (resp) {
1755
1784
  _this.historyBack();
1756
1785
  }));
@@ -4022,6 +4051,9 @@
4022
4051
  field$.subscribe(function (data) {
4023
4052
  // this.items = data;
4024
4053
  data.forEach(function (button) {
4054
+ if (_this.data.SubType) {
4055
+ button.Name = _this.data.SubType + '_' + button.Name;
4056
+ }
4025
4057
  var label = _this.getButtonLabel(button);
4026
4058
  var buttonDisabled = null;
4027
4059
  if (button.Disabled != "" && button.Disabled) {
@@ -4037,6 +4069,7 @@
4037
4069
  iconName: button.Icon,
4038
4070
  dismissType: button.DismissType,
4039
4071
  disableTriggerTimer: button.DisableTriggerTimer,
4072
+ SubType: _this.data.SubType,
4040
4073
  click: function (y) {
4041
4074
  _this.buttonClick(button);
4042
4075
  }
@@ -5334,12 +5367,16 @@
5334
5367
  }
5335
5368
  return readOnlyValue;
5336
5369
  };
5370
+ ZformComponent.prototype.trackByFn = function (index, item) {
5371
+ //return item['Type'] + '-' + item['Name'];
5372
+ return index;
5373
+ };
5337
5374
  return ZformComponent;
5338
5375
  }());
5339
5376
  ZformComponent.decorators = [
5340
5377
  { type: i0.Component, args: [{
5341
5378
  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>",
5379
+ 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
5380
  styles: ["#dynamic-form-host app-zformcontrol{overflow-x:auto;overflow-y:hidden}"]
5344
5381
  },] }
5345
5382
  ];
@@ -9486,8 +9523,8 @@
9486
9523
  });
9487
9524
  };
9488
9525
  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);
9526
+ // console.log('ztext.component - onChange: ', event.target.value);
9527
+ i3.ZComponentHelper.setComponentModelValue(this.data, event.target.value, this.group);
9491
9528
  this.group.subject.next({
9492
9529
  type: "onChange",
9493
9530
  target: this.data.OnChange,
@@ -9653,6 +9690,12 @@
9653
9690
  this.group[this.itemDataField.slice(6)] = zdataModel;
9654
9691
  }
9655
9692
  }
9693
+ this.group.subject.next({
9694
+ type: "onChange",
9695
+ target: this.data.OnChange,
9696
+ event: event,
9697
+ data: { value: value, field: this.data }
9698
+ });
9656
9699
  };
9657
9700
  ZtextareaComponent.prototype.getReadOnlyValue = function () {
9658
9701
  var readOnlyValue = i3.ZComponentHelper.getGroupEvalValue.call(this, this.data.ReadOnly, this.group);
@@ -10681,6 +10724,158 @@
10681
10724
  form: [{ type: i0.Input }]
10682
10725
  };
10683
10726
 
10727
+ /********** Angular **********/
10728
+ var ZudfComponent = /** @class */ (function () {
10729
+ function ZudfComponent(alertService, authService, fieldService, resourceApiService, toastService, webApiService) {
10730
+ var _this = this;
10731
+ this.alertService = alertService;
10732
+ this.authService = authService;
10733
+ this.fieldService = fieldService;
10734
+ this.resourceApiService = resourceApiService;
10735
+ this.toastService = toastService;
10736
+ this.webApiService = webApiService;
10737
+ this.componentProperties = new i3.ZComponentProperties();
10738
+ this.setEnable = function (status) {
10739
+ _this.componentProperties.isReadOnly = !status;
10740
+ };
10741
+ this.setVisible = function (status) {
10742
+ _this.componentProperties.isVisible = status;
10743
+ _this.data.Visible = status;
10744
+ };
10745
+ this.setRequire = function (status) {
10746
+ _this.componentProperties.isRequired = status;
10747
+ i3.ZComponentHelper.changeValidator(status, _this.group, _this.data.Value, _this.componentProperties, forms.Validators.required);
10748
+ };
10749
+ }
10750
+ ZudfComponent.prototype.ngOnInit = function () {
10751
+ var _this = this;
10752
+ i3.ZComponentHelper.setComponentProperties(this);
10753
+ i3.ZComponentHelper.registerComponent(this);
10754
+ rxjs.of(true).pipe(operators.concatMap(function (fieldElements) {
10755
+ var asyncSubject = new rxjs.AsyncSubject();
10756
+ _this.fieldService.getFormFieldCode(_this.data.Value, 'FormField', _this, 'fields').pipe(operators.map(function (formFieldResult) {
10757
+ // rename add prefix to all udf field to prevent duplicate from main form
10758
+ _this.appendPrefix(formFieldResult, 'zudf');
10759
+ // change the value to the result field form
10760
+ _this.data.Value = formFieldResult;
10761
+ // change zudf to zdiv
10762
+ _this.data.Type = 'zdiv';
10763
+ // end subject
10764
+ asyncSubject.next(true);
10765
+ asyncSubject.complete();
10766
+ })).subscribe();
10767
+ return asyncSubject.asObservable();
10768
+ }), operators.tap(function () {
10769
+ if (!_this.group._zudf) {
10770
+ _this.group._zudf = new i3.ZGroup;
10771
+ }
10772
+ _this.group._zudf.zModel = {};
10773
+ // create as new Form Group
10774
+ _this.form = _this.toFormGroup(_this.data.Value);
10775
+ // set to zGroup scope
10776
+ _this.group._zudf.form = _this.form;
10777
+ }), operators.tap(function () {
10778
+ // set to formField for display
10779
+ _this.formField = _this.data.Value;
10780
+ })).subscribe(function () {
10781
+ // set Field div class
10782
+ i3.ZComponentHelper.setFieldsDivClass(_this.group._projectName, _this.group.fieldName, _this.data, _this.authService);
10783
+ // get saved record
10784
+ _this.getFormFieldzModel();
10785
+ });
10786
+ };
10787
+ ZudfComponent.prototype.getFormFieldzModel = function () {
10788
+ var form = this.group._zudf.form;
10789
+ var zModel = this.group._zudf.zModel;
10790
+ var url = this.resourceApiService.getURL('field');
10791
+ var respData = { 'parentFormId': 5722, 'zudf_Name': 'test' };
10792
+ Object.assign(zModel, respData);
10793
+ form.patchValue(zModel);
10794
+ form.markAsPristine();
10795
+ //return this.webApiService.httpGet$(url, { name: this.group.fieldName, type: 'FormField' }).pipe(
10796
+ // tap((respData: any) => {
10797
+ // debugger;
10798
+ // Object.assign(zModel, respData);
10799
+ // form.patchValue(zModel);
10800
+ // form.markAsPristine();
10801
+ // })
10802
+ //);
10803
+ };
10804
+ ZudfComponent.prototype.toFormGroup = function (fieldElements) {
10805
+ var formControls = {};
10806
+ this.getFormControls(fieldElements, formControls);
10807
+ var newFormGroup = new forms.FormGroup(formControls);
10808
+ return newFormGroup;
10809
+ };
10810
+ ZudfComponent.prototype.getFormControls = function (fieldArray, formControls) {
10811
+ var _this = this;
10812
+ fieldArray.forEach(function (field) {
10813
+ if (typeof field.Value === "string" && field.Value.indexOf(".") !== -1) {
10814
+ if (['zgrid', 'ztree', 'zimg', 'textareajson'].indexOf(field.Type) === -1) {
10815
+ console.warn("FormControl - invalid field value", field.Value);
10816
+ }
10817
+ }
10818
+ else {
10819
+ if (Array.isArray(field.Value)) {
10820
+ _this.getFormControls(field.Value, formControls);
10821
+ }
10822
+ else {
10823
+ var isFormControl = i3.ZComponentHelper.isFormControl(field);
10824
+ var isVisible = i3.ZComponentHelper.isVisibleFormControl(_this, field);
10825
+ var isRequired = i3.ZComponentHelper.isRequiredFormControl(_this, field);
10826
+ if (isFormControl === true) {
10827
+ var validators = i3.ZComponentHelper.getValidators(field, isVisible, isRequired);
10828
+ formControls[field.Value] = new forms.FormControl(_this.group._zudf.zModel[field.Value], validators);
10829
+ if (i3.ZComponentHelper.hasCCField(field.Type)) {
10830
+ var ccValidators = i3.ZComponentHelper.getCCValidators(field, isVisible, isRequired);
10831
+ formControls[field.CCValue] = new forms.FormControl(_this.group._zudf.zModel[field.CCValue], ccValidators);
10832
+ }
10833
+ }
10834
+ }
10835
+ }
10836
+ });
10837
+ };
10838
+ ZudfComponent.prototype.appendPrefix = function (fields, prefix) {
10839
+ var _this = this;
10840
+ fields.forEach(function (field) {
10841
+ if (Array.isArray(field.Value)) {
10842
+ _this.appendPrefix(field.Value, prefix);
10843
+ }
10844
+ else {
10845
+ field.Name = prefix + '_' + field.Name;
10846
+ if (field.Type != 'zbuttons') {
10847
+ field.Value = prefix + '_' + field.Value;
10848
+ }
10849
+ field.SubType = prefix;
10850
+ }
10851
+ });
10852
+ };
10853
+ ZudfComponent.prototype.ComponentIsVisible = function (field) {
10854
+ return i3.ZComponentHelper.ComponentIsVisible(field, this.group);
10855
+ };
10856
+ return ZudfComponent;
10857
+ }());
10858
+ ZudfComponent.decorators = [
10859
+ { type: i0.Component, args: [{
10860
+ selector: 'app-zudf',
10861
+ 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",
10862
+ styles: ["#div1,#div2{float:left;width:100px;height:35px;margin:10px;padding:10px;border:1px solid #000}"]
10863
+ },] }
10864
+ ];
10865
+ ZudfComponent.ctorParameters = function () { return [
10866
+ { type: i3.AlertService },
10867
+ { type: i3.AuthService },
10868
+ { type: i3.FieldService },
10869
+ { type: i3.ResourceApiService },
10870
+ { type: i3.ToastService },
10871
+ { type: i3.WebApiService }
10872
+ ]; };
10873
+ ZudfComponent.propDecorators = {
10874
+ data: [{ type: i0.Input }],
10875
+ group: [{ type: i0.Input }],
10876
+ form: [{ type: i0.Input }]
10877
+ };
10878
+
10684
10879
  /********** Angular **********/
10685
10880
  var ZunknownComponent = /** @class */ (function () {
10686
10881
  function ZunknownComponent() {
@@ -10745,6 +10940,8 @@
10745
10940
  this.showFileList = true;
10746
10941
  this.fileList = [];
10747
10942
  this.restrictions = {
10943
+ minFileSize: 1,
10944
+ maxFileSize: 4194304,
10748
10945
  allowedExtensions: [
10749
10946
  "jpg",
10750
10947
  "jpeg",
@@ -10792,6 +10989,12 @@
10792
10989
  this.restrictions.allowedExtensions = this.data
10793
10990
  .SelectOptions;
10794
10991
  }
10992
+ if (this.data.MinFileSize) {
10993
+ this.restrictions.minFileSize = this.data.MinFileSize;
10994
+ }
10995
+ if (this.data.MaxFileSize) {
10996
+ this.restrictions.maxFileSize = this.data.MaxFileSize;
10997
+ }
10795
10998
  this.isAutoUpload = this.data.AutoUpload || false;
10796
10999
  if (!this.data.AllowRemove) {
10797
11000
  this.uploadRemoveUrl = "";
@@ -11026,17 +11229,21 @@
11026
11229
  } // file type check
11027
11230
  }); // loop each file
11028
11231
  } // imagecompression check
11029
- // add to group scope
11232
+ // add to group scope
11030
11233
  me.group['zupload_' + me.data.Value] = e.files;
11031
11234
  }
11032
11235
  }
11033
11236
  };
11237
+ ZuploadComponent.prototype.clearFiles = function () {
11238
+ this.uploadComponent.clearFiles();
11239
+ this.group['zupload_' + this.data.Value] = this.fileList;
11240
+ };
11034
11241
  return ZuploadComponent;
11035
11242
  }());
11036
11243
  ZuploadComponent.decorators = [
11037
11244
  { type: i0.Component, args: [{
11038
11245
  selector: "app-zupload",
11039
- template: "<ion-item [formGroup]=\"form\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" [ngClass]=\"getIon_InvalidClass(form, data)\" style=\"margin-left: -15px;\">\r\n <ion-label [attr.for]=\"data.Value\" *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\" style=\"margin-bottom: 10px;\">\r\n {{data.Label}} <ion-text *ngIf=\"(!!componentProperties.isRequiredField ? group[componentProperties.isRequiredField] : componentProperties.isRequired)\" color=\"danger\">*</ion-text>\r\n </ion-label>\r\n <div class=\"ion-row\" style=\"justify-content: space-between; width: 100%\">\r\n <span style=\"flex: 1;\">\r\n <kendo-upload *ngIf=\"!data.SelectFileOnly\"\r\n [autoUpload]=\"isAutoUpload\"\r\n [saveUrl]=\"uploadSaveUrl\"\r\n [removeUrl]=\"uploadRemoveUrl\"\r\n [restrictions]=\"restrictions\"\r\n [formControlName]=\"data.Value\"\r\n [multiple]=\"isMultiple\"\r\n [chunkable]=\"chunkSettings\"\r\n [showFileList]=\"showFileList\"\r\n (select)=\"selectEventHandler($event)\"\r\n (remove)=\"onRemove($event)\"\r\n (success)=\"onSuccess($event)\"\r\n (upload)=\"uploadEventHandler($event)\">\r\n </kendo-upload>\r\n\r\n <kendo-fileselect *ngIf=\"data.SelectFileOnly\"\r\n (select)=\"selectEventHandler($event)\"\r\n (remove)=\"onRemove($event)\"\r\n (valueChange)=\"onChange($event)\"\r\n [restrictions]=\"restrictions\" >\r\n </kendo-fileselect>\r\n </span>\r\n </div>\r\n</ion-item>\r\n<br />\r\n<!--<div class=\"wrap\" *ngIf=\"data.EnableCompression\">\r\n <ion-label>Enable Compression: </ion-label>\r\n <ion-checkbox style=\"margin: -5px 0;\" color=\"primary\" (ionChange)=\"toogleEnableCompression($event)\"></ion-checkbox>\r\n</div>-->\r\n<ion-label *ngIf=\"imagePreviews.length\" position=\"stacked\">\r\n Image Preview:\r\n</ion-label>\r\n<div *ngIf=\"imagePreviews.length\" >\r\n <img *ngFor=\"let image of imagePreviews\"\r\n [src]=\"image.src\"\r\n alt=\"image preview\"\r\n height=\"100\"\r\n style=\"margin: 5px; border: 1px solid gray;\"/>\r\n</div>\r\n",
11246
+ template: "<ion-item [formGroup]=\"form\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" [ngClass]=\"getIon_InvalidClass(form, data)\" style=\"margin-left: -15px;\">\r\n <ion-label [attr.for]=\"data.Value\" *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\" style=\"margin-bottom: 10px;\">\r\n {{data.Label}} <ion-text *ngIf=\"(!!componentProperties.isRequiredField ? group[componentProperties.isRequiredField] : componentProperties.isRequired)\" color=\"danger\">*</ion-text>\r\n </ion-label>\r\n <div class=\"ion-row\" style=\"justify-content: space-between; width: 100%\">\r\n <span style=\"flex: 1;\">\r\n <kendo-upload #uploadComponent\r\n *ngIf=\"!data.SelectFileOnly\"\r\n [id]=\"data.Value\"\r\n [autoUpload]=\"isAutoUpload\"\r\n [saveUrl]=\"uploadSaveUrl\"\r\n [removeUrl]=\"uploadRemoveUrl\"\r\n [restrictions]=\"restrictions\"\r\n [formControlName]=\"data.Value\"\r\n [multiple]=\"isMultiple\"\r\n [chunkable]=\"chunkSettings\"\r\n [showFileList]=\"showFileList\"\r\n (select)=\"selectEventHandler($event)\"\r\n (remove)=\"onRemove($event)\" \r\n (success)=\"onSuccess($event)\"\r\n (upload)=\"uploadEventHandler($event)\">\r\n </kendo-upload>\r\n\r\n <kendo-fileselect #uploadComponent\r\n *ngIf=\"data.SelectFileOnly\"\r\n [id]=\"data.Value\"\r\n (select)=\"selectEventHandler($event)\"\r\n (remove)=\"onRemove($event)\" \r\n (valueChange)=\"onChange($event)\"\r\n [restrictions]=\"restrictions\" >\r\n </kendo-fileselect>\r\n </span>\r\n </div>\r\n</ion-item>\r\n<br />\r\n<!--<div class=\"wrap\" *ngIf=\"data.EnableCompression\">\r\n <ion-label>Enable Compression: </ion-label>\r\n <ion-checkbox style=\"margin: -5px 0;\" color=\"primary\" (ionChange)=\"toogleEnableCompression($event)\"></ion-checkbox>\r\n</div>-->\r\n<ion-label *ngIf=\"imagePreviews.length\" position=\"stacked\">\r\n Image Preview:\r\n</ion-label>\r\n<div *ngIf=\"imagePreviews.length\" >\r\n <img *ngFor=\"let image of imagePreviews\"\r\n [src]=\"image.src\"\r\n alt=\"image preview\"\r\n height=\"100\"\r\n style=\"margin: 5px; border: 1px solid gray;\"/>\r\n</div>\r\n",
11040
11247
  styles: [""]
11041
11248
  },] }
11042
11249
  ];
@@ -11049,7 +11256,8 @@
11049
11256
  ZuploadComponent.propDecorators = {
11050
11257
  data: [{ type: i0.Input }],
11051
11258
  group: [{ type: i0.Input }],
11052
- form: [{ type: i0.Input }]
11259
+ form: [{ type: i0.Input }],
11260
+ uploadComponent: [{ type: i0.ViewChild, args: ["uploadComponent",] }]
11053
11261
  };
11054
11262
 
11055
11263
  /********** Angular **********/
@@ -11320,6 +11528,7 @@
11320
11528
  ktree_list: ZtreelistComponent,
11321
11529
  ztrendcard: ZtrendcardComponent,
11322
11530
  unknown: ZunknownComponent,
11531
+ zudf: ZudfComponent,
11323
11532
  zupload: ZuploadComponent,
11324
11533
  zworkflowbuttons: ZworkflowbuttonsComponent
11325
11534
  // kdate_rangepicker: ZdaterangeComponent
@@ -11503,6 +11712,7 @@
11503
11712
  ZtreelistComponent,
11504
11713
  ZtrendcardComponent,
11505
11714
  ZunknownComponent,
11715
+ ZudfComponent,
11506
11716
  ZuploadComponent,
11507
11717
  ZworkflowbuttonsComponent
11508
11718
  ],
@@ -11602,6 +11812,7 @@
11602
11812
  ZtreelistComponent,
11603
11813
  ZtrendcardComponent,
11604
11814
  ZunknownComponent,
11815
+ ZudfComponent,
11605
11816
  ZuploadComponent,
11606
11817
  ZworkflowbuttonsComponent
11607
11818
  ],
@@ -11651,6 +11862,7 @@
11651
11862
  ZtreelistComponent,
11652
11863
  ZtrendcardComponent,
11653
11864
  ZunknownComponent,
11865
+ ZudfComponent,
11654
11866
  ZuploadComponent,
11655
11867
  ZworkflowbuttonsComponent
11656
11868
  ],
@@ -11726,6 +11938,7 @@
11726
11938
  exports.ZtreeComponent = ZtreeComponent;
11727
11939
  exports.ZtreelistComponent = ZtreelistComponent;
11728
11940
  exports.ZtrendcardComponent = ZtrendcardComponent;
11941
+ exports.ZudfComponent = ZudfComponent;
11729
11942
  exports.ZunknownComponent = ZunknownComponent;
11730
11943
  exports.ZuploadComponent = ZuploadComponent;
11731
11944
  exports.ZworkflowbuttonsComponent = ZworkflowbuttonsComponent;