mmhglobal-dynamicform 1.2.0 → 1.2.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.
- package/README.md +12 -1
- package/bundles/mmhglobal-dynamicform.umd.js +44 -37
- package/bundles/mmhglobal-dynamicform.umd.js.map +1 -1
- package/bundles/mmhglobal-dynamicform.umd.min.js +2 -2
- package/bundles/mmhglobal-dynamicform.umd.min.js.map +1 -1
- package/esm2015/lib/services/main.service.js +5 -16
- package/esm2015/lib/zgrid/zgrid.component.js +18 -9
- package/esm2015/lib/zselectmultiple/zselectmultiple.component.js +17 -12
- package/esm2015/lib/ztree/ztree.component.js +8 -3
- package/fesm2015/mmhglobal-dynamicform.js +44 -36
- package/fesm2015/mmhglobal-dynamicform.js.map +1 -1
- package/lib/ztree/ztree.component.d.ts +1 -0
- package/mmhglobal-dynamicform.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.2.3`<br/>
|
|
7
|
+
[ztree] - fix ztree selected node ui when popup.
|
|
8
|
+
[zgrid] - enhance on grid command handler.
|
|
9
|
+
mainservice - fix successhandler.
|
|
10
|
+
|
|
11
|
+
`1.2.2`<br/>
|
|
12
|
+
[ztree] - fix ztree ui in when popup.
|
|
13
|
+
|
|
14
|
+
`1.2.1`<br/>
|
|
15
|
+
[ztree] - fix popup ui display.
|
|
16
|
+
|
|
6
17
|
`1.2.0`<br/>
|
|
7
18
|
[zgrid] - change page button from 5 to 3.<br/>
|
|
8
19
|
[zgrid] - allow previousnext page button by setting EnablePreviousNextButton true/false.<br/>
|
|
@@ -11,7 +22,7 @@ This library was generated with [Angular CLI](https://github.com/angular/angular
|
|
|
11
22
|
[zgrid] - fix PageSize NAN if using setdata.<br/>
|
|
12
23
|
[zgrid] - hide tooltips if is command cell.<br/>
|
|
13
24
|
[zgrid] - Added validation for cell edit via EnableGridCommand.<br/>
|
|
14
|
-
[
|
|
25
|
+
[ztree] - fix ui for latest kendo treeview v8.<br/>
|
|
15
26
|
[zgridcalendar] - removed.<br/>
|
|
16
27
|
Update Kendo component.
|
|
17
28
|
|
|
@@ -1451,25 +1451,13 @@
|
|
|
1451
1451
|
}
|
|
1452
1452
|
};
|
|
1453
1453
|
MainService.prototype.handleSuccess = function (res, successMsg) {
|
|
1454
|
-
var _this = this;
|
|
1455
1454
|
this.group.isTriggered = false;
|
|
1456
|
-
if (res
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
else if (res.Data !== undefined && res.ProcessingStatus !== undefined) {
|
|
1460
|
-
if (res.ProcessingStatus === true) {
|
|
1461
|
-
if (Array.isArray(res.Data)) {
|
|
1462
|
-
res.Data.map(function (s) { return _this.webApiService.showHttpResponseMessage(i3.MESSAGETYPE.Success, successMsg + " : " + s.CostCode, null); });
|
|
1463
|
-
}
|
|
1464
|
-
else {
|
|
1465
|
-
this.webApiService.showHttpResponseMessage(i3.MESSAGETYPE.Success, successMsg, null);
|
|
1466
|
-
}
|
|
1455
|
+
if (res) {
|
|
1456
|
+
if (res.ProcessingStatus) {
|
|
1457
|
+
this.webApiService.showHttpResponseMessage(i3.MESSAGETYPE.Success, successMsg, null);
|
|
1467
1458
|
}
|
|
1459
|
+
return res;
|
|
1468
1460
|
}
|
|
1469
|
-
else {
|
|
1470
|
-
this.toastService.show(successMsg);
|
|
1471
|
-
}
|
|
1472
|
-
return res;
|
|
1473
1461
|
};
|
|
1474
1462
|
MainService.prototype.handleError = function (res) {
|
|
1475
1463
|
this.group.isTriggered = false;
|
|
@@ -5955,7 +5943,7 @@
|
|
|
5955
5943
|
var _zgrid = this.zgrid;
|
|
5956
5944
|
}
|
|
5957
5945
|
};
|
|
5958
|
-
/*
|
|
5946
|
+
/* grid command handler */
|
|
5959
5947
|
ZgridComponent.prototype.addHandler = function (_a) {
|
|
5960
5948
|
var sender = _a.sender;
|
|
5961
5949
|
this.isNew = true;
|
|
@@ -5981,18 +5969,24 @@
|
|
|
5981
5969
|
ZgridComponent.prototype.saveHandler = function (_a) {
|
|
5982
5970
|
var sender = _a.sender, rowIndex = _a.rowIndex, formGroup = _a.formGroup, isNew = _a.isNew;
|
|
5983
5971
|
// get grid data.
|
|
5984
|
-
var gridExistingData = this.gData ? this.gData : [];
|
|
5972
|
+
var gridExistingData = this.gData ? this.gData : this.gridData ? this.gridData.data : [];
|
|
5985
5973
|
// if valid
|
|
5986
5974
|
if (formGroup.valid) {
|
|
5987
5975
|
// check for duplicate UniqueKey
|
|
5988
|
-
var uniqueKeyExist_1
|
|
5976
|
+
var uniqueKeyExist_1;
|
|
5989
5977
|
var uniqueKey_1 = this.data['UniqueKey'];
|
|
5990
5978
|
if (uniqueKey_1) {
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5979
|
+
var formUniqueKeyValue_1 = formGroup.value[uniqueKey_1];
|
|
5980
|
+
if (isNew || (!isNew && (gridExistingData[rowIndex][uniqueKey_1] != formUniqueKeyValue_1))) {
|
|
5981
|
+
// if new...
|
|
5982
|
+
// if edit... if current field, uniquekey value changed. need to check.
|
|
5983
|
+
gridExistingData.forEach(function (data) {
|
|
5984
|
+
if (data[uniqueKey_1] === formUniqueKeyValue_1) {
|
|
5985
|
+
uniqueKeyExist_1 = true;
|
|
5986
|
+
return;
|
|
5987
|
+
}
|
|
5988
|
+
});
|
|
5989
|
+
}
|
|
5996
5990
|
}
|
|
5997
5991
|
if (!uniqueKeyExist_1) {
|
|
5998
5992
|
if (isNew) {
|
|
@@ -6006,6 +6000,9 @@
|
|
|
6006
6000
|
this.setData(gridExistingData);
|
|
6007
6001
|
sender.closeRow(rowIndex);
|
|
6008
6002
|
}
|
|
6003
|
+
else {
|
|
6004
|
+
this.toastService.show('Error occur: Duplicated unique field entry.', 'top', true, 3000, 'danger');
|
|
6005
|
+
}
|
|
6009
6006
|
}
|
|
6010
6007
|
};
|
|
6011
6008
|
ZgridComponent.prototype.cancelHandler = function (_a) {
|
|
@@ -8058,18 +8055,23 @@
|
|
|
8058
8055
|
});
|
|
8059
8056
|
}
|
|
8060
8057
|
else {
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8058
|
+
if (Array.isArray(this.data.SelectOptions) && this.data.SelectOptions) {
|
|
8059
|
+
//skip eval if selectoptions is exist
|
|
8060
|
+
}
|
|
8061
|
+
else {
|
|
8062
|
+
var optionData_1 = i3.ZComponentHelper.getGroupEvalValue.call(this, this.itemDataField);
|
|
8063
|
+
// append data via timeout after data is loaded.
|
|
8064
|
+
if (optionData_1 && optionData_1.length === 1 && !this.data.DisableAutoFirstSelection) {
|
|
8065
|
+
var thisComponent_1 = this;
|
|
8066
|
+
setTimeout(function () {
|
|
8067
|
+
thisComponent_1.autoSelectFirstOption(isRequired_1, optionData_1[0], fieldValue, thisComponent_1.group.zModel.Id);
|
|
8068
|
+
if (this.group) {
|
|
8069
|
+
if (this.group.afterLoadzDataOptions) {
|
|
8070
|
+
this.group.afterLoadzDataOptions(this.group);
|
|
8071
|
+
}
|
|
8070
8072
|
}
|
|
8071
|
-
}
|
|
8072
|
-
}
|
|
8073
|
+
}, 100);
|
|
8074
|
+
}
|
|
8073
8075
|
}
|
|
8074
8076
|
this.isLoading = false;
|
|
8075
8077
|
}
|
|
@@ -9095,6 +9097,7 @@
|
|
|
9095
9097
|
this.state = { expandedkeys: [] };
|
|
9096
9098
|
this.itemIndex = [];
|
|
9097
9099
|
this.selectedKeys = [];
|
|
9100
|
+
this.absoluteText = false;
|
|
9098
9101
|
this.componentProperties = new i3.ZComponentProperties();
|
|
9099
9102
|
this.isExpanded = function (dataItem, index) {
|
|
9100
9103
|
// console.log(index);
|
|
@@ -9170,6 +9173,10 @@
|
|
|
9170
9173
|
if (this.data.TreeviewExpandAll) {
|
|
9171
9174
|
this.expandAll();
|
|
9172
9175
|
}
|
|
9176
|
+
// fix text align issue
|
|
9177
|
+
if (this.data.OnAddNode || this.data.OnRemoveNode) {
|
|
9178
|
+
this.absoluteText = true;
|
|
9179
|
+
}
|
|
9173
9180
|
};
|
|
9174
9181
|
ZtreeComponent.prototype.ngAfterViewInit = function () {
|
|
9175
9182
|
// const componentId = ZComponentHelper.getComponentId(this.data);
|
|
@@ -9439,8 +9446,8 @@
|
|
|
9439
9446
|
ZtreeComponent.decorators = [
|
|
9440
9447
|
{ type: i0.Component, args: [{
|
|
9441
9448
|
selector: "app-ztree",
|
|
9442
|
-
template: "<div style=\"width:100%\"\r\n *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\">\r\n <kendo-treeview [nodes]=\"getItems()\"\r\n kendoTreeViewExpandable\r\n kendoTreeViewSelectable\r\n kendoTreeViewDragAndDrop\r\n kendoTreeViewDragAndDropEditing\r\n [isExpanded]=\"isExpanded\"\r\n (collapse)=\"handleCollapse($event)\"\r\n (expand)=\"handleExpand($event)\"\r\n (nodeDrop)=\"handleNodeDrop($event)\"\r\n (nodeDragEnd)=\"handleNodeDragEnd($event)\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n [selectedKeys]=\"selectedKeys\"\r\n kendoTreeViewHierarchyBinding\r\n childrenField=\"Value\"\r\n [filterable]=\"data.Filterable\"\r\n textField=\"Name\"\r\n (filterChange)=\"handleFilter($event)\">\r\n\r\n <ng-template kendoTreeViewNodeTemplate let-dataItem #nodetemplate>\r\n\r\n <ion-button *ngIf=\"!!data.OnAddNode\"\r\n (click)=\"onAddNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6; margin: 0 0 0 2px;\" mat-raised-button color=\"primary\" size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnAddNodeVisible)\"
|
|
9443
|
-
styles: [":host{--ion-color-primary:#479400;--ion-color-primary-rgb:56,128,255;--ion-color-primary-contrast:#fff;--ion-color-primary-contrast-rgb:255,255,255;--ion-color-primary-shade:#3171e0;--ion-color-primary-tint:#4c8dff}:host ::ng-deep kendo-treeview .k-treeview-leaf{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:3px;border:1px solid #c8dbf5;background-color:#e3ecf8;color:#0a45ab;font-size:13px;cursor:pointer}:host ::ng-deep kendo-treeview .k-treeview-leaf.k-
|
|
9449
|
+
template: "<div style=\"width:100%\"\r\n *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\">\r\n <kendo-treeview [nodes]=\"getItems()\"\r\n kendoTreeViewExpandable\r\n kendoTreeViewSelectable\r\n kendoTreeViewDragAndDrop\r\n kendoTreeViewDragAndDropEditing\r\n [isExpanded]=\"isExpanded\"\r\n (collapse)=\"handleCollapse($event)\"\r\n (expand)=\"handleExpand($event)\"\r\n (nodeDrop)=\"handleNodeDrop($event)\"\r\n (nodeDragEnd)=\"handleNodeDragEnd($event)\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n [selectedKeys]=\"selectedKeys\"\r\n kendoTreeViewHierarchyBinding\r\n childrenField=\"Value\"\r\n [filterable]=\"data.Filterable\"\r\n textField=\"Name\"\r\n (filterChange)=\"handleFilter($event)\">\r\n\r\n <ng-template kendoTreeViewNodeTemplate let-dataItem #nodetemplate>\r\n\r\n <ion-button *ngIf=\"!!data.OnAddNode\"\r\n (click)=\"onAddNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6; margin: 0 0 0 2px;\" mat-raised-button color=\"primary\" size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnAddNodeVisible)\"> \r\n <fa-icon [icon]=\"'plus'\"></fa-icon>\r\n </ion-button>\r\n <ion-button *ngIf=\"!!data.OnRemoveNode\" (click)=\"onRemoveNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6; margin: 0 15px 0 10px;\" color=\"danger\" mat-raised-button size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnRemoveNodeVisible)\"> \r\n <fa-icon [icon]=\"'minus'\"></fa-icon>\r\n </ion-button>\r\n\r\n <ion-label *ngIf=\"absoluteText\" style=\"position: absolute; top: 14px;\">\r\n {{ getTemplate(dataItem, data, group) }}\r\n </ion-label>\r\n\r\n <ion-label *ngIf=\"!absoluteText\">\r\n {{ getTemplate(dataItem, data, group) }}\r\n </ion-label>\r\n </ng-template>\r\n </kendo-treeview>\r\n</div>\r\n",
|
|
9450
|
+
styles: [":host{--ion-color-primary:#479400;--ion-color-primary-rgb:56,128,255;--ion-color-primary-contrast:#fff;--ion-color-primary-contrast-rgb:255,255,255;--ion-color-primary-shade:#3171e0;--ion-color-primary-tint:#4c8dff}:host ::ng-deep kendo-treeview .k-treeview-leaf{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:3px;border:1px solid #c8dbf5;background-color:#e3ecf8;color:#0a45ab;font-size:13px;cursor:pointer}:host ::ng-deep kendo-treeview .k-treeview-leaf.k-selected{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:3px;background-color:#a9c3e8!important;color:#0a45ab!important;font-size:13px;cursor:pointer}:host ::ng-deep kendo-treeview .k-treeview-leaf.k-state-hover,:host ::ng-deep kendo-treeview .k-treeview-leaf:hover{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:3px;background-color:#c9daf2;color:#0a45ab;font-size:13px;cursor:pointer}"]
|
|
9444
9451
|
},] }
|
|
9445
9452
|
];
|
|
9446
9453
|
ZtreeComponent.ctorParameters = function () { return []; };
|